@common-stack/store-mongo 0.2.9 → 0.2.16
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 +141 -208
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -1,100 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
/******/
|
|
3
|
-
/******/
|
|
4
|
-
/******/ var installedModules = {};
|
|
5
|
-
/******/
|
|
6
|
-
/******/ // The require function
|
|
7
|
-
/******/ function __webpack_require__(moduleId) {
|
|
8
|
-
/******/
|
|
9
|
-
/******/ // Check if module is in cache
|
|
10
|
-
/******/ if(installedModules[moduleId]) {
|
|
11
|
-
/******/ return installedModules[moduleId].exports;
|
|
12
|
-
/******/ }
|
|
13
|
-
/******/ // Create a new module (and put it into the cache)
|
|
14
|
-
/******/ var module = installedModules[moduleId] = {
|
|
15
|
-
/******/ i: moduleId,
|
|
16
|
-
/******/ l: false,
|
|
17
|
-
/******/ exports: {}
|
|
18
|
-
/******/ };
|
|
19
|
-
/******/
|
|
20
|
-
/******/ // Execute the module function
|
|
21
|
-
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
22
|
-
/******/
|
|
23
|
-
/******/ // Flag the module as loaded
|
|
24
|
-
/******/ module.l = true;
|
|
25
|
-
/******/
|
|
26
|
-
/******/ // Return the exports of the module
|
|
27
|
-
/******/ return module.exports;
|
|
28
|
-
/******/ }
|
|
29
|
-
/******/
|
|
30
|
-
/******/
|
|
31
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
32
|
-
/******/ __webpack_require__.m = modules;
|
|
33
|
-
/******/
|
|
34
|
-
/******/ // expose the module cache
|
|
35
|
-
/******/ __webpack_require__.c = installedModules;
|
|
36
|
-
/******/
|
|
37
|
-
/******/ // define getter function for harmony exports
|
|
38
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
-
/******/ }
|
|
42
|
-
/******/ };
|
|
43
|
-
/******/
|
|
44
|
-
/******/ // define __esModule on exports
|
|
45
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
-
/******/ }
|
|
49
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
-
/******/ };
|
|
51
|
-
/******/
|
|
52
|
-
/******/ // create a fake namespace object
|
|
53
|
-
/******/ // mode & 1: value is a module id, require it
|
|
54
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
-
/******/ // mode & 4: return value when already ns object
|
|
56
|
-
/******/ // mode & 8|1: behave like require
|
|
57
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
-
/******/ if(mode & 8) return value;
|
|
60
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
-
/******/ var ns = Object.create(null);
|
|
62
|
-
/******/ __webpack_require__.r(ns);
|
|
63
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
-
/******/ return ns;
|
|
66
|
-
/******/ };
|
|
67
|
-
/******/
|
|
68
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
-
/******/ __webpack_require__.n = function(module) {
|
|
70
|
-
/******/ var getter = module && module.__esModule ?
|
|
71
|
-
/******/ function getDefault() { return module['default']; } :
|
|
72
|
-
/******/ function getModuleExports() { return module; };
|
|
73
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
-
/******/ return getter;
|
|
75
|
-
/******/ };
|
|
76
|
-
/******/
|
|
77
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts");
|
|
86
|
-
/******/ })
|
|
87
|
-
/************************************************************************/
|
|
88
|
-
/******/ ({
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
89
4
|
|
|
90
5
|
/***/ "./src/dataloaders/bulk-dataloader.ts":
|
|
91
6
|
/*!********************************************!*\
|
|
92
7
|
!*** ./src/dataloaders/bulk-dataloader.ts ***!
|
|
93
8
|
\********************************************/
|
|
94
|
-
|
|
95
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
9
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
96
10
|
|
|
97
|
-
"use strict";
|
|
98
11
|
|
|
99
12
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
100
13
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -105,7 +18,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
105
18
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
106
19
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
107
20
|
};
|
|
108
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
109
22
|
exports.BulkDataLoader = void 0;
|
|
110
23
|
const DataLoader = __webpack_require__(/*! dataloader */ "dataloader");
|
|
111
24
|
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
@@ -118,8 +31,8 @@ let BulkDataLoader = class BulkDataLoader extends DataLoader {
|
|
|
118
31
|
}
|
|
119
32
|
};
|
|
120
33
|
BulkDataLoader = __decorate([
|
|
121
|
-
inversify_1.injectable(),
|
|
122
|
-
__param(0, inversify_1.unmanaged())
|
|
34
|
+
(0, inversify_1.injectable)(),
|
|
35
|
+
__param(0, (0, inversify_1.unmanaged)())
|
|
123
36
|
], BulkDataLoader);
|
|
124
37
|
exports.BulkDataLoader = BulkDataLoader;
|
|
125
38
|
|
|
@@ -130,14 +43,16 @@ exports.BulkDataLoader = BulkDataLoader;
|
|
|
130
43
|
/*!**********************************!*\
|
|
131
44
|
!*** ./src/dataloaders/index.ts ***!
|
|
132
45
|
\**********************************/
|
|
133
|
-
|
|
134
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
46
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
135
47
|
|
|
136
|
-
"use strict";
|
|
137
48
|
|
|
138
49
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
139
50
|
if (k2 === undefined) k2 = k;
|
|
140
|
-
Object.
|
|
51
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
52
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
53
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
54
|
+
}
|
|
55
|
+
Object.defineProperty(o, k2, desc);
|
|
141
56
|
}) : (function(o, m, k, k2) {
|
|
142
57
|
if (k2 === undefined) k2 = k;
|
|
143
58
|
o[k2] = m[k];
|
|
@@ -145,7 +60,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
145
60
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
146
61
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
147
62
|
};
|
|
148
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
149
64
|
__exportStar(__webpack_require__(/*! ./bulk-dataloader */ "./src/dataloaders/bulk-dataloader.ts"), exports);
|
|
150
65
|
|
|
151
66
|
|
|
@@ -155,14 +70,16 @@ __exportStar(__webpack_require__(/*! ./bulk-dataloader */ "./src/dataloaders/bul
|
|
|
155
70
|
/*!******************************!*\
|
|
156
71
|
!*** ./src/helpers/index.ts ***!
|
|
157
72
|
\******************************/
|
|
158
|
-
|
|
159
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
73
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
160
74
|
|
|
161
|
-
"use strict";
|
|
162
75
|
|
|
163
76
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
164
77
|
if (k2 === undefined) k2 = k;
|
|
165
|
-
Object.
|
|
78
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
79
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
80
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
81
|
+
}
|
|
82
|
+
Object.defineProperty(o, k2, desc);
|
|
166
83
|
}) : (function(o, m, k, k2) {
|
|
167
84
|
if (k2 === undefined) k2 = k;
|
|
168
85
|
o[k2] = m[k];
|
|
@@ -170,7 +87,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
170
87
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
171
88
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
172
89
|
};
|
|
173
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
90
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
174
91
|
__exportStar(__webpack_require__(/*! ./mongoose-connection */ "./src/helpers/mongoose-connection.ts"), exports);
|
|
175
92
|
|
|
176
93
|
|
|
@@ -180,12 +97,10 @@ __exportStar(__webpack_require__(/*! ./mongoose-connection */ "./src/helpers/mon
|
|
|
180
97
|
/*!********************************************!*\
|
|
181
98
|
!*** ./src/helpers/mongoose-connection.ts ***!
|
|
182
99
|
\********************************************/
|
|
183
|
-
|
|
184
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
100
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
185
101
|
|
|
186
|
-
"use strict";
|
|
187
102
|
|
|
188
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
103
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
189
104
|
exports.generateMongo = void 0;
|
|
190
105
|
const mongoose = __webpack_require__(/*! mongoose */ "mongoose");
|
|
191
106
|
let connectionOptions;
|
|
@@ -214,14 +129,16 @@ exports.generateMongo = generateMongo;
|
|
|
214
129
|
/*!**********************!*\
|
|
215
130
|
!*** ./src/index.ts ***!
|
|
216
131
|
\**********************/
|
|
217
|
-
|
|
218
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
132
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
219
133
|
|
|
220
|
-
"use strict";
|
|
221
134
|
|
|
222
135
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
223
136
|
if (k2 === undefined) k2 = k;
|
|
224
|
-
Object.
|
|
137
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
138
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
139
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
140
|
+
}
|
|
141
|
+
Object.defineProperty(o, k2, desc);
|
|
225
142
|
}) : (function(o, m, k, k2) {
|
|
226
143
|
if (k2 === undefined) k2 = k;
|
|
227
144
|
o[k2] = m[k];
|
|
@@ -229,7 +146,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
229
146
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
230
147
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
231
148
|
};
|
|
232
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
149
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
233
150
|
__exportStar(__webpack_require__(/*! ./interfaces */ "./src/interfaces/index.ts"), exports);
|
|
234
151
|
__exportStar(__webpack_require__(/*! ./helpers */ "./src/helpers/index.ts"), exports);
|
|
235
152
|
__exportStar(__webpack_require__(/*! ./services */ "./src/services/index.ts"), exports);
|
|
@@ -244,12 +161,10 @@ __exportStar(__webpack_require__(/*! ./mixins */ "./src/mixins/index.ts"), expor
|
|
|
244
161
|
/*!*******************************************!*\
|
|
245
162
|
!*** ./src/interfaces/base-repository.ts ***!
|
|
246
163
|
\*******************************************/
|
|
247
|
-
|
|
248
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
164
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
249
165
|
|
|
250
|
-
"use strict";
|
|
251
166
|
|
|
252
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
167
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
253
168
|
exports.DEFAULT_SORTING = exports.PAGINATION_OPTIONS = void 0;
|
|
254
169
|
var PAGINATION_OPTIONS;
|
|
255
170
|
(function (PAGINATION_OPTIONS) {
|
|
@@ -267,12 +182,10 @@ exports.DEFAULT_SORTING = {
|
|
|
267
182
|
/*!****************************************!*\
|
|
268
183
|
!*** ./src/interfaces/base-service.ts ***!
|
|
269
184
|
\****************************************/
|
|
270
|
-
|
|
271
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
185
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
272
186
|
|
|
273
|
-
"use strict";
|
|
274
187
|
|
|
275
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
188
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
276
189
|
|
|
277
190
|
|
|
278
191
|
/***/ }),
|
|
@@ -281,12 +194,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
281
194
|
/*!***************************************!*\
|
|
282
195
|
!*** ./src/interfaces/dataloaders.ts ***!
|
|
283
196
|
\***************************************/
|
|
284
|
-
|
|
285
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
197
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
286
198
|
|
|
287
|
-
"use strict";
|
|
288
199
|
|
|
289
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
200
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
290
201
|
|
|
291
202
|
|
|
292
203
|
/***/ }),
|
|
@@ -295,12 +206,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
295
206
|
/*!********************************************!*\
|
|
296
207
|
!*** ./src/interfaces/generated-models.ts ***!
|
|
297
208
|
\********************************************/
|
|
298
|
-
|
|
299
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
209
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
300
210
|
|
|
301
|
-
"use strict";
|
|
302
211
|
|
|
303
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
212
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
304
213
|
exports.ISortEnum = exports.IMoleculerServiceName = exports.ICacheControlScope = exports.IBaseServiceCommands = void 0;
|
|
305
214
|
var IBaseServiceCommands;
|
|
306
215
|
(function (IBaseServiceCommands) {
|
|
@@ -338,12 +247,10 @@ var ISortEnum;
|
|
|
338
247
|
/*!****************************************!*\
|
|
339
248
|
!*** ./src/interfaces/get-all-args.ts ***!
|
|
340
249
|
\****************************************/
|
|
341
|
-
|
|
342
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
250
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
343
251
|
|
|
344
|
-
"use strict";
|
|
345
252
|
|
|
346
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
253
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
347
254
|
|
|
348
255
|
|
|
349
256
|
/***/ }),
|
|
@@ -352,14 +259,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
352
259
|
/*!*********************************!*\
|
|
353
260
|
!*** ./src/interfaces/index.ts ***!
|
|
354
261
|
\*********************************/
|
|
355
|
-
|
|
356
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
262
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
357
263
|
|
|
358
|
-
"use strict";
|
|
359
264
|
|
|
360
265
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
361
266
|
if (k2 === undefined) k2 = k;
|
|
362
|
-
Object.
|
|
267
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
268
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
269
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
270
|
+
}
|
|
271
|
+
Object.defineProperty(o, k2, desc);
|
|
363
272
|
}) : (function(o, m, k, k2) {
|
|
364
273
|
if (k2 === undefined) k2 = k;
|
|
365
274
|
o[k2] = m[k];
|
|
@@ -367,7 +276,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
367
276
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
368
277
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
369
278
|
};
|
|
370
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
279
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
371
280
|
__exportStar(__webpack_require__(/*! ./mongoose-settings */ "./src/interfaces/mongoose-settings.ts"), exports);
|
|
372
281
|
__exportStar(__webpack_require__(/*! ./get-all-args */ "./src/interfaces/get-all-args.ts"), exports);
|
|
373
282
|
__exportStar(__webpack_require__(/*! ./base-repository */ "./src/interfaces/base-repository.ts"), exports);
|
|
@@ -382,12 +291,10 @@ __exportStar(__webpack_require__(/*! ./generated-models */ "./src/interfaces/gen
|
|
|
382
291
|
/*!*********************************************!*\
|
|
383
292
|
!*** ./src/interfaces/mongoose-settings.ts ***!
|
|
384
293
|
\*********************************************/
|
|
385
|
-
|
|
386
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
294
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
387
295
|
|
|
388
|
-
"use strict";
|
|
389
296
|
|
|
390
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
297
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
391
298
|
|
|
392
299
|
|
|
393
300
|
/***/ }),
|
|
@@ -396,12 +303,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
396
303
|
/*!******************************************!*\
|
|
397
304
|
!*** ./src/mixins/base-service-mixin.ts ***!
|
|
398
305
|
\******************************************/
|
|
399
|
-
|
|
400
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
306
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
401
307
|
|
|
402
|
-
"use strict";
|
|
403
308
|
|
|
404
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
309
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
405
310
|
exports.BaseServiceMixin = void 0;
|
|
406
311
|
const interfaces_1 = __webpack_require__(/*! ../interfaces */ "./src/interfaces/index.ts");
|
|
407
312
|
const BaseServiceMixin = (service) => ({
|
|
@@ -483,15 +388,13 @@ exports.BaseServiceMixin = BaseServiceMixin;
|
|
|
483
388
|
/*!*****************************!*\
|
|
484
389
|
!*** ./src/mixins/index.ts ***!
|
|
485
390
|
\*****************************/
|
|
486
|
-
|
|
487
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
391
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
488
392
|
|
|
489
|
-
"use strict";
|
|
490
393
|
|
|
491
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
394
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
492
395
|
exports.BaseServiceMixin = void 0;
|
|
493
396
|
var base_service_mixin_1 = __webpack_require__(/*! ./base-service-mixin */ "./src/mixins/base-service-mixin.ts");
|
|
494
|
-
Object.defineProperty(exports, "BaseServiceMixin", { enumerable: true, get: function () { return base_service_mixin_1.BaseServiceMixin; } });
|
|
397
|
+
Object.defineProperty(exports, "BaseServiceMixin", ({ enumerable: true, get: function () { return base_service_mixin_1.BaseServiceMixin; } }));
|
|
495
398
|
|
|
496
399
|
|
|
497
400
|
/***/ }),
|
|
@@ -500,10 +403,8 @@ Object.defineProperty(exports, "BaseServiceMixin", { enumerable: true, get: func
|
|
|
500
403
|
/*!********************************************!*\
|
|
501
404
|
!*** ./src/services/base-proxy-service.ts ***!
|
|
502
405
|
\********************************************/
|
|
503
|
-
|
|
504
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
406
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
505
407
|
|
|
506
|
-
"use strict";
|
|
507
408
|
|
|
508
409
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
509
410
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -514,7 +415,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
514
415
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
515
416
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
516
417
|
};
|
|
517
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
418
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
518
419
|
exports.BaseProxyService = void 0;
|
|
519
420
|
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
520
421
|
const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
|
|
@@ -559,9 +460,9 @@ let BaseProxyService = class BaseProxyService {
|
|
|
559
460
|
}
|
|
560
461
|
};
|
|
561
462
|
BaseProxyService = __decorate([
|
|
562
|
-
inversify_1.injectable(),
|
|
563
|
-
__param(0, inversify_1.inject(core_1.CommonType.MOLECULER_BROKER)),
|
|
564
|
-
__param(1, inversify_1.inject('Logger'))
|
|
463
|
+
(0, inversify_1.injectable)(),
|
|
464
|
+
__param(0, (0, inversify_1.inject)(core_1.CommonType.MOLECULER_BROKER)),
|
|
465
|
+
__param(1, (0, inversify_1.inject)('Logger'))
|
|
565
466
|
], BaseProxyService);
|
|
566
467
|
exports.BaseProxyService = BaseProxyService;
|
|
567
468
|
|
|
@@ -572,10 +473,8 @@ exports.BaseProxyService = BaseProxyService;
|
|
|
572
473
|
/*!**************************************!*\
|
|
573
474
|
!*** ./src/services/base-service.ts ***!
|
|
574
475
|
\**************************************/
|
|
575
|
-
|
|
576
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
476
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
577
477
|
|
|
578
|
-
"use strict";
|
|
579
478
|
|
|
580
479
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
581
480
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -594,7 +493,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
594
493
|
}
|
|
595
494
|
return t;
|
|
596
495
|
};
|
|
597
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
496
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
598
497
|
exports.BaseService = void 0;
|
|
599
498
|
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
600
499
|
let BaseService = class BaseService {
|
|
@@ -655,7 +554,7 @@ let BaseService = class BaseService {
|
|
|
655
554
|
}
|
|
656
555
|
};
|
|
657
556
|
BaseService = __decorate([
|
|
658
|
-
inversify_1.injectable()
|
|
557
|
+
(0, inversify_1.injectable)()
|
|
659
558
|
], BaseService);
|
|
660
559
|
exports.BaseService = BaseService;
|
|
661
560
|
|
|
@@ -666,14 +565,16 @@ exports.BaseService = BaseService;
|
|
|
666
565
|
/*!*******************************!*\
|
|
667
566
|
!*** ./src/services/index.ts ***!
|
|
668
567
|
\*******************************/
|
|
669
|
-
|
|
670
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
568
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
671
569
|
|
|
672
|
-
"use strict";
|
|
673
570
|
|
|
674
571
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
675
572
|
if (k2 === undefined) k2 = k;
|
|
676
|
-
Object.
|
|
573
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
574
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
575
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
576
|
+
}
|
|
577
|
+
Object.defineProperty(o, k2, desc);
|
|
677
578
|
}) : (function(o, m, k, k2) {
|
|
678
579
|
if (k2 === undefined) k2 = k;
|
|
679
580
|
o[k2] = m[k];
|
|
@@ -681,7 +582,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
681
582
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
682
583
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
683
584
|
};
|
|
684
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
585
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
685
586
|
__exportStar(__webpack_require__(/*! ./base-service */ "./src/services/base-service.ts"), exports);
|
|
686
587
|
__exportStar(__webpack_require__(/*! ./base-proxy-service */ "./src/services/base-proxy-service.ts"), exports);
|
|
687
588
|
|
|
@@ -692,14 +593,16 @@ __exportStar(__webpack_require__(/*! ./base-proxy-service */ "./src/services/bas
|
|
|
692
593
|
/*!****************************!*\
|
|
693
594
|
!*** ./src/store/index.ts ***!
|
|
694
595
|
\****************************/
|
|
695
|
-
|
|
696
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
596
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
697
597
|
|
|
698
|
-
"use strict";
|
|
699
598
|
|
|
700
599
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
701
600
|
if (k2 === undefined) k2 = k;
|
|
702
|
-
Object.
|
|
601
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
602
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
603
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
604
|
+
}
|
|
605
|
+
Object.defineProperty(o, k2, desc);
|
|
703
606
|
}) : (function(o, m, k, k2) {
|
|
704
607
|
if (k2 === undefined) k2 = k;
|
|
705
608
|
o[k2] = m[k];
|
|
@@ -707,7 +610,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
707
610
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
708
611
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
709
612
|
};
|
|
710
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
613
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
711
614
|
__exportStar(__webpack_require__(/*! ./models */ "./src/store/models/index.ts"), exports);
|
|
712
615
|
__exportStar(__webpack_require__(/*! ./repositories */ "./src/store/repositories/index.ts"), exports);
|
|
713
616
|
|
|
@@ -718,12 +621,10 @@ __exportStar(__webpack_require__(/*! ./repositories */ "./src/store/repositories
|
|
|
718
621
|
/*!********************************************!*\
|
|
719
622
|
!*** ./src/store/models/common-options.ts ***!
|
|
720
623
|
\********************************************/
|
|
721
|
-
|
|
722
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
624
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
723
625
|
|
|
724
|
-
"use strict";
|
|
725
626
|
|
|
726
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
627
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
727
628
|
exports.addIdVirtualFields = exports.commonModeSchemaOptions = void 0;
|
|
728
629
|
exports.commonModeSchemaOptions = {
|
|
729
630
|
timestamps: true,
|
|
@@ -754,14 +655,16 @@ exports.addIdVirtualFields = addIdVirtualFields;
|
|
|
754
655
|
/*!***********************************!*\
|
|
755
656
|
!*** ./src/store/models/index.ts ***!
|
|
756
657
|
\***********************************/
|
|
757
|
-
|
|
758
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
658
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
759
659
|
|
|
760
|
-
"use strict";
|
|
761
660
|
|
|
762
661
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
763
662
|
if (k2 === undefined) k2 = k;
|
|
764
|
-
Object.
|
|
663
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
664
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
665
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
666
|
+
}
|
|
667
|
+
Object.defineProperty(o, k2, desc);
|
|
765
668
|
}) : (function(o, m, k, k2) {
|
|
766
669
|
if (k2 === undefined) k2 = k;
|
|
767
670
|
o[k2] = m[k];
|
|
@@ -769,7 +672,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
769
672
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
770
673
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
771
674
|
};
|
|
772
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
675
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
773
676
|
__exportStar(__webpack_require__(/*! ./common-options */ "./src/store/models/common-options.ts"), exports);
|
|
774
677
|
|
|
775
678
|
|
|
@@ -779,10 +682,8 @@ __exportStar(__webpack_require__(/*! ./common-options */ "./src/store/models/com
|
|
|
779
682
|
/*!***************************************************!*\
|
|
780
683
|
!*** ./src/store/repositories/base-repository.ts ***!
|
|
781
684
|
\***************************************************/
|
|
782
|
-
|
|
783
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
685
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
784
686
|
|
|
785
|
-
"use strict";
|
|
786
687
|
|
|
787
688
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
788
689
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -805,7 +706,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
805
706
|
return t;
|
|
806
707
|
};
|
|
807
708
|
var BaseRepository_1;
|
|
808
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
709
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
809
710
|
exports.BaseRepository = void 0;
|
|
810
711
|
const lodash_1 = __webpack_require__(/*! lodash */ "lodash");
|
|
811
712
|
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
@@ -822,7 +723,7 @@ let BaseRepository = BaseRepository_1 = class BaseRepository {
|
|
|
822
723
|
const { criteria, selectedFields, sort, limit, skip } = options;
|
|
823
724
|
// map id to mongoose _id
|
|
824
725
|
const _a = criteria || { id: undefined }, { id } = _a, rest = __rest(_a, ["id"]);
|
|
825
|
-
const sortBy = lodash_1.isObject(sort) ? { [sort === null || sort === void 0 ? void 0 : sort.key]: sort.value } : interfaces_1.DEFAULT_SORTING;
|
|
726
|
+
const sortBy = (0, lodash_1.isObject)(sort) ? { [sort === null || sort === void 0 ? void 0 : sort.key]: sort.value } : interfaces_1.DEFAULT_SORTING;
|
|
826
727
|
const response = await this.model
|
|
827
728
|
.find(Object.assign(Object.assign({}, rest), (id ? { _id: id } : {})), selectedFields)
|
|
828
729
|
.limit(limit || interfaces_1.PAGINATION_OPTIONS.limit)
|
|
@@ -967,11 +868,11 @@ let BaseRepository = BaseRepository_1 = class BaseRepository {
|
|
|
967
868
|
}
|
|
968
869
|
};
|
|
969
870
|
BaseRepository = BaseRepository_1 = __decorate([
|
|
970
|
-
inversify_1.injectable(),
|
|
971
|
-
__param(0, inversify_1.unmanaged()),
|
|
972
|
-
__param(1, inversify_1.unmanaged()),
|
|
973
|
-
__param(2, inversify_1.unmanaged()),
|
|
974
|
-
__param(3, inversify_1.unmanaged())
|
|
871
|
+
(0, inversify_1.injectable)(),
|
|
872
|
+
__param(0, (0, inversify_1.unmanaged)()),
|
|
873
|
+
__param(1, (0, inversify_1.unmanaged)()),
|
|
874
|
+
__param(2, (0, inversify_1.unmanaged)()),
|
|
875
|
+
__param(3, (0, inversify_1.unmanaged)())
|
|
975
876
|
], BaseRepository);
|
|
976
877
|
exports.BaseRepository = BaseRepository;
|
|
977
878
|
|
|
@@ -982,14 +883,16 @@ exports.BaseRepository = BaseRepository;
|
|
|
982
883
|
/*!*****************************************!*\
|
|
983
884
|
!*** ./src/store/repositories/index.ts ***!
|
|
984
885
|
\*****************************************/
|
|
985
|
-
|
|
986
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
886
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
987
887
|
|
|
988
|
-
"use strict";
|
|
989
888
|
|
|
990
889
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
991
890
|
if (k2 === undefined) k2 = k;
|
|
992
|
-
Object.
|
|
891
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
892
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
893
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
894
|
+
}
|
|
895
|
+
Object.defineProperty(o, k2, desc);
|
|
993
896
|
}) : (function(o, m, k, k2) {
|
|
994
897
|
if (k2 === undefined) k2 = k;
|
|
995
898
|
o[k2] = m[k];
|
|
@@ -997,7 +900,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
997
900
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
998
901
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
999
902
|
};
|
|
1000
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
903
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1001
904
|
__exportStar(__webpack_require__(/*! ./base-repository */ "./src/store/repositories/base-repository.ts"), exports);
|
|
1002
905
|
|
|
1003
906
|
|
|
@@ -1007,8 +910,7 @@ __exportStar(__webpack_require__(/*! ./base-repository */ "./src/store/repositor
|
|
|
1007
910
|
/*!*************************************!*\
|
|
1008
911
|
!*** external "@common-stack/core" ***!
|
|
1009
912
|
\*************************************/
|
|
1010
|
-
|
|
1011
|
-
/***/ (function(module, exports) {
|
|
913
|
+
/***/ ((module) => {
|
|
1012
914
|
|
|
1013
915
|
module.exports = require("@common-stack/core");
|
|
1014
916
|
|
|
@@ -1018,8 +920,7 @@ module.exports = require("@common-stack/core");
|
|
|
1018
920
|
/*!*****************************!*\
|
|
1019
921
|
!*** external "dataloader" ***!
|
|
1020
922
|
\*****************************/
|
|
1021
|
-
|
|
1022
|
-
/***/ (function(module, exports) {
|
|
923
|
+
/***/ ((module) => {
|
|
1023
924
|
|
|
1024
925
|
module.exports = require("dataloader");
|
|
1025
926
|
|
|
@@ -1029,8 +930,7 @@ module.exports = require("dataloader");
|
|
|
1029
930
|
/*!****************************!*\
|
|
1030
931
|
!*** external "inversify" ***!
|
|
1031
932
|
\****************************/
|
|
1032
|
-
|
|
1033
|
-
/***/ (function(module, exports) {
|
|
933
|
+
/***/ ((module) => {
|
|
1034
934
|
|
|
1035
935
|
module.exports = require("inversify");
|
|
1036
936
|
|
|
@@ -1040,8 +940,7 @@ module.exports = require("inversify");
|
|
|
1040
940
|
/*!*************************!*\
|
|
1041
941
|
!*** external "lodash" ***!
|
|
1042
942
|
\*************************/
|
|
1043
|
-
|
|
1044
|
-
/***/ (function(module, exports) {
|
|
943
|
+
/***/ ((module) => {
|
|
1045
944
|
|
|
1046
945
|
module.exports = require("lodash");
|
|
1047
946
|
|
|
@@ -1051,12 +950,46 @@ module.exports = require("lodash");
|
|
|
1051
950
|
/*!***************************!*\
|
|
1052
951
|
!*** external "mongoose" ***!
|
|
1053
952
|
\***************************/
|
|
1054
|
-
|
|
1055
|
-
/***/ (function(module, exports) {
|
|
953
|
+
/***/ ((module) => {
|
|
1056
954
|
|
|
1057
955
|
module.exports = require("mongoose");
|
|
1058
956
|
|
|
1059
957
|
/***/ })
|
|
1060
958
|
|
|
1061
|
-
/******/
|
|
959
|
+
/******/ });
|
|
960
|
+
/************************************************************************/
|
|
961
|
+
/******/ // The module cache
|
|
962
|
+
/******/ var __webpack_module_cache__ = {};
|
|
963
|
+
/******/
|
|
964
|
+
/******/ // The require function
|
|
965
|
+
/******/ function __webpack_require__(moduleId) {
|
|
966
|
+
/******/ // Check if module is in cache
|
|
967
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
968
|
+
/******/ if (cachedModule !== undefined) {
|
|
969
|
+
/******/ return cachedModule.exports;
|
|
970
|
+
/******/ }
|
|
971
|
+
/******/ // Create a new module (and put it into the cache)
|
|
972
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
973
|
+
/******/ // no module.id needed
|
|
974
|
+
/******/ // no module.loaded needed
|
|
975
|
+
/******/ exports: {}
|
|
976
|
+
/******/ };
|
|
977
|
+
/******/
|
|
978
|
+
/******/ // Execute the module function
|
|
979
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
980
|
+
/******/
|
|
981
|
+
/******/ // Return the exports of the module
|
|
982
|
+
/******/ return module.exports;
|
|
983
|
+
/******/ }
|
|
984
|
+
/******/
|
|
985
|
+
/************************************************************************/
|
|
986
|
+
/******/
|
|
987
|
+
/******/ // startup
|
|
988
|
+
/******/ // Load entry module and return exports
|
|
989
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
990
|
+
/******/ var __webpack_exports__ = __webpack_require__("./src/index.ts");
|
|
991
|
+
/******/ module.exports = __webpack_exports__;
|
|
992
|
+
/******/
|
|
993
|
+
/******/ })()
|
|
994
|
+
;
|
|
1062
995
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/dataloaders/bulk-dataloader.ts","webpack:///./src/dataloaders/index.ts","webpack:///./src/helpers/index.ts","webpack:///./src/helpers/mongoose-connection.ts","webpack:///./src/index.ts","webpack:///./src/interfaces/base-repository.ts","webpack:///./src/interfaces/generated-models.ts","webpack:///./src/interfaces/index.ts","webpack:///./src/mixins/base-service-mixin.ts","webpack:///./src/mixins/index.ts","webpack:///./src/services/base-proxy-service.ts","webpack:///./src/services/base-service.ts","webpack:///./src/services/index.ts","webpack:///./src/store/index.ts","webpack:///./src/store/models/common-options.ts","webpack:///./src/store/models/index.ts","webpack:///./src/store/repositories/base-repository.ts","webpack:///./src/store/repositories/index.ts","webpack:///external \"@common-stack/core\"","webpack:///external \"dataloader\"","webpack:///external \"inversify\"","webpack:///external \"lodash\"","webpack:///external \"mongoose\""],"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;QAC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,KAAK,CAAC,UAAU,CAAC,QAAwB;QAC5C,IAAI;YACA,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC1E,OAAO,QAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,KAAI,CAAC,CAAC;SACrC;QAAC,OAAO,CAAC,EAAE;YACR,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,EAAE,QAAQ,CAAC,CAAC;YACxE,MAAM,CAAC,CAAC;SACX;IACL,CAAC;CAEJ;AApMY,cAAc;IAD1B,sBAAU,EAAE;IASJ,gCAAS,EAAE;IAEX,gCAAS,EAAE;IAEX,gCAAS,EAAE;IAEX,gCAAS,EAAE;GAdP,cAAc,CAoM1B;AApMY,wCAAc;;;;;;;;;;;;;;;;;;;;;;;;;ACP3B,mHAAkC;;;;;;;;;;;;ACAlC,+C;;;;;;;;;;;ACAA,uC;;;;;;;;;;;ACAA,sC;;;;;;;;;;;ACAA,mC;;;;;;;;;;;ACAA,qC","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 * as DataLoader from 'dataloader';\nimport { injectable, unmanaged } from 'inversify';\nimport { IBaseService } from '../interfaces';\n\n@injectable()\nexport class BulkDataLoader<T extends { id: string }> extends DataLoader<string, T> {\n constructor(\n @unmanaged()\n service: IBaseService<T>,\n ) {\n super(async (ids: string[]) => {\n const data = await service.getByIds(ids);\n return ids.map((id) => data.find((record) => record.id === id));\n });\n }\n}\n","export * from './bulk-dataloader';\n","export * from './mongoose-connection';\n","import * as mongoose from 'mongoose';\n\nlet connectionOptions: mongoose.ConnectionOptions | undefined;\n// (mongoose as any).Promise = global.Promise;\n\nconst generateMongo: (monoUrl) => mongoose.Connection = (mongoUrl) => {\n\n // creates default connection\n mongoose.connect(mongoUrl, {\n }).then(() => {\n console.info('mogoose connect - success');\n // console.info(`uri - ${uri}`);\n // console.info(`connectionOptions - ${connectionOptions}`);\n }).catch((err: mongoose.Error) => {\n console.error('mogoose connect - error - ', err);\n // throw err;\n process.kill(process.pid);\n });\n // to access default connection\n const mongooseConnection: mongoose.Connection = mongoose.connection;\n\n return mongooseConnection;\n};\n\n\n\nexport { generateMongo };\n","export * from './interfaces';\nexport * from './helpers';\nexport * from './services';\nexport * from './store';\nexport * from './dataloaders';\nexport * from './mixins';\n","import { FilterQuery, Document, Model, UpdateQuery } from 'mongoose';\nimport { GetAllArgs } from './get-all-args';\n\nexport enum PAGINATION_OPTIONS {\n limit = 10,\n skip = 0,\n}\n\nexport const DEFAULT_SORTING = {\n id: 'asc',\n};\n\nexport interface IBaseRepository<T, D = Document<T>> {\n model: Model<D>;\n count(conditions?: FilterQuery<D>): Promise<number>;\n getAll(options: GetAllArgs<D>): Promise<T[]>;\n get(conditions?: FilterQuery<D>, selectedFields?: string): Promise<T>;\n create<I>(data: I): Promise<T>;\n upsert<I>(conditions: FilterQuery<D>, update: I, options): Promise<T>;\n update<I>(criteria: FilterQuery<D>, update: UpdateQuery<D>, options?): Promise<T>;\n bulkUpdate<I>(criteria: FilterQuery<D>, update: UpdateQuery<D>, options?): Promise<T[]>;\n delete(criteria: FilterQuery<D>): Promise<boolean>;\n bulkGet(ids: string[], selectedFields?: string): Promise<T[]>;\n bulkCreate<I>(data: I[]): Promise<T[]>;\n bulkDelete(criteria: FilterQuery<D>): Promise<number>;\n}\n","/* tslint:disable */\nexport type Maybe<T> = T | null;\nexport type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: string;\n String: string;\n Boolean: boolean;\n Int: number;\n Float: number;\n AnyObject: any;\n Date: any;\n DateTime: any;\n JSON: any;\n JSONObject: any;\n Observable: any;\n Time: any;\n URI: any;\n URIInput: any;\n};\n\n\nexport type IAdminIdeSettings = {\n __typename?: 'AdminIdeSettings';\n dummy?: Maybe<Scalars['Int']>;\n};\n\n\nexport enum IBaseServiceCommands {\n count = 'count',\n get = 'get',\n getAll = 'getAll',\n getByIds = 'getByIds',\n create = 'create',\n insert = 'insert',\n bulkCreate = 'bulkCreate',\n update = 'update',\n delete = 'delete',\n getAllWithCount = 'getAllWithCount'\n}\n\nexport enum ICacheControlScope {\n PUBLIC = 'PUBLIC',\n PRIVATE = 'PRIVATE'\n}\n\n\n\n/** Represents a null return value. */\nexport type IEmptyResponse = {\n __typename?: 'EmptyResponse';\n alwaysNil?: Maybe<Scalars['String']>;\n};\n\nexport type IFieldError = {\n __typename?: 'FieldError';\n field: Scalars['String'];\n message: Scalars['String'];\n};\n\n\n\n/** All Moleculer Topic names are extended from this. */\nexport enum IMoleculerServiceName {\n dummy = 'dummy'\n}\n\nexport type IMutation = {\n __typename?: 'Mutation';\n dummy?: Maybe<Scalars['Int']>;\n};\n\n/** An object with an ID. */\nexport type INode = {\n /** The ID of the node. */\n id: Scalars['ID'];\n};\n\n\nexport type IPageInfo = {\n __typename?: 'PageInfo';\n hasNextPage: Scalars['Boolean'];\n};\n\nexport type IQuery = {\n __typename?: 'Query';\n /** Looks up a node by ID. */\n node?: Maybe<INode>;\n};\n\n\nexport type IQuerynodeArgs = {\n id: Scalars['ID'];\n};\n\nexport type ISort = {\n key: Scalars['String'];\n value: ISortEnum;\n};\n\nexport enum ISortEnum {\n ASC = 'ASC',\n DESC = 'DESC'\n}\n\nexport type ISubscription = {\n __typename?: 'Subscription';\n dummy?: Maybe<Scalars['Int']>;\n};\n\n\n\n","export * from './mongoose-settings';\nexport * from './get-all-args';\nexport * from './base-repository';\nexport * from './base-service';\nexport * from './dataloaders';\nexport * from './generated-models';\n","import { Context, ServiceSchema } from 'moleculer';\nimport { Document, FilterQuery } from 'mongoose';\nimport { IBaseServiceCommands, GetAllArgs, IBaseService } from '../interfaces';\n\nexport const BaseServiceMixin = <T, C, U>(service: IBaseService<T, C, U>): Partial<ServiceSchema> => ({\n name: 'BaseServiceMixin',\n actions: {\n [IBaseServiceCommands.get]: {\n params: {\n id: 'string',\n },\n handler: async (ctx: Context<{ id: string }>) => service.get(ctx.params.id),\n },\n [IBaseServiceCommands.count]: {\n params: {\n criteria: { type: 'object', optional: true },\n },\n handler: async (ctx: Context<{ criteria?: FilterQuery<Document<T>> }>) =>\n service.count(ctx.params.criteria),\n },\n [IBaseServiceCommands.bulkCreate]: {\n params: {\n data: { type: 'array', items: 'object' },\n },\n handler: async (ctx: Context<{ data: never[] }>) => service.bulkCreate(ctx.params.data),\n },\n [IBaseServiceCommands.create]: {\n params: {\n data: 'object',\n },\n handler: async (ctx: Context<{ data: never }>) => service.create(ctx.params.data),\n },\n [IBaseServiceCommands.delete]: {\n params: {\n id: 'string',\n },\n handler: async (ctx: Context<{ id: string | FilterQuery<Document<T>> }>) =>\n service.delete(ctx.params.id as never),\n },\n [IBaseServiceCommands.getAll]: {\n params: {\n criteria: 'object|optional',\n sort: 'object|optional',\n skip: 'number|optional',\n limit: 'number|optional',\n selectedFields: 'string|optional',\n },\n handler: async (ctx: Context<GetAllArgs<Document<T>>>) => service.getAll(ctx.params),\n },\n [IBaseServiceCommands.getAllWithCount]: {\n params: {\n criteria: 'object|optional',\n sort: 'object|optional',\n skip: 'number|optional',\n limit: 'number|optional',\n selectedFields: 'string|optional',\n },\n handler: async (ctx: Context<GetAllArgs<Document<T>>>) => service.getAllWithCount(ctx.params),\n },\n [IBaseServiceCommands.insert]: {\n params: {\n data: 'object',\n overwrite: 'boolean|optional',\n },\n handler: async (ctx: Context<{ data: never & { id?: string }; overwrite: boolean }>) =>\n service.insert(ctx.params.data, ctx.params.overwrite),\n },\n [IBaseServiceCommands.update]: {\n params: {\n id: 'string',\n data: 'object',\n overwrite: 'boolean|optional',\n },\n handler: async (ctx: Context<{ id: string; data: never; overwrite: boolean }>) =>\n service.update(ctx.params.id, ctx.params.data, ctx.params.overwrite),\n },\n },\n});\n","export { BaseServiceMixin } from './base-service-mixin';\n","import { inject, injectable } from 'inversify';\nimport { ServiceBroker } from 'moleculer';\nimport { FilterQuery } from 'mongoose';\nimport * as Logger from 'bunyan';\nimport { CommonType } from '@common-stack/core';\nimport { IBaseServiceCommands, GetAllArgs, IBaseService } from '../interfaces';\n\ntype MethodsNames<T, C, U> = keyof IBaseService<T, C, U>;\ntype MethodResponse<T, C, U, M extends MethodsNames<T, C, U>> = ReturnType<IBaseService<T, C, U>[M]>;\n\n@injectable()\nexport abstract class BaseProxyService<T, C = T, U = T> implements IBaseService<T, C, U> {\n protected logger: Logger;\n\n protected abstract topic;\n\n constructor(\n @inject(CommonType.MOLECULER_BROKER)\n private readonly broker: ServiceBroker,\n @inject('Logger')\n logger: Logger,\n ) {\n this.logger = logger.child({ className: 'BaseProxyService' });\n }\n\n bulkCreate(data: C[]): MethodResponse<T, C, U, 'bulkCreate'> {\n return this.callAction<T[], { data: C[] }>(IBaseServiceCommands.bulkCreate, { data });\n }\n\n count(criteria?: FilterQuery<Document>): MethodResponse<T, C, U, 'count'> {\n return this.callAction(IBaseServiceCommands.count, { criteria });\n }\n\n create(data: C): MethodResponse<T, C, U, 'create'> {\n return this.callAction(IBaseServiceCommands.create, { data });\n }\n\n delete(id: string | FilterQuery<Document>): MethodResponse<T, C, U, 'delete'> {\n return this.callAction(IBaseServiceCommands.delete, { id });\n }\n\n get(id?: string | FilterQuery<Document>): MethodResponse<T, C, U, 'get'> {\n return this.callAction(IBaseServiceCommands.get, { id });\n }\n\n getAll(options?: GetAllArgs<Document>): MethodResponse<T, C, U, 'getAll'> {\n return this.callAction(IBaseServiceCommands.getAll, options);\n }\n\n getByIds(ids: string[]): Promise<T[]> {\n return this.callAction(IBaseServiceCommands.getByIds, { ids });\n }\n\n getAllWithCount(options: GetAllArgs<Document>): MethodResponse<T, C, U, 'getAllWithCount'> {\n return this.callAction(IBaseServiceCommands.getAllWithCount, options);\n }\n\n insert(data: C | U, overwrite?: boolean): MethodResponse<T, C, U, 'insert'> {\n return this.callAction(IBaseServiceCommands.insert, { data, overwrite });\n }\n\n update(id: string, data: U, overwrite?: boolean): MethodResponse<T, C, U, 'update'> {\n return this.callAction<T>(IBaseServiceCommands.update, { id, data, overwrite });\n }\n\n protected async callAction<T, P = unknown>(command: string, params?: P): Promise<T> {\n return this.broker.call<T, P>(`${this.topic}.${command}`, params);\n }\n}\n","import { Document, FilterQuery } from 'mongoose';\nimport { injectable } from 'inversify';\nimport { GetAllArgs, IBaseRepository, IBaseService } from '../interfaces';\n\n@injectable()\nexport class BaseService<T, C = Omit<T, 'id'>, U = C> implements IBaseService<T, C, U> {\n constructor(protected repository: IBaseRepository<T>) {\n this.repository = repository;\n }\n\n async getAllWithCount(options: GetAllArgs<Document<T>>): Promise<{ data: T[]; totalCount: number }> {\n const totalCount = await this.count(options.criteria);\n const data = await this.getAll(options);\n return {\n totalCount,\n data,\n };\n }\n\n count(conditions?: FilterQuery<Document<T>>): Promise<number> {\n return this.repository.count(conditions);\n }\n\n get(conditions: string | FilterQuery<Document<T>>): Promise<T> {\n if (typeof conditions === 'string') {\n return this.repository.get({ id: conditions });\n }\n return this.repository.get(conditions);\n }\n\n getName(name: string): Promise<T> {\n return this.repository.get({ name });\n }\n\n getAll(options: GetAllArgs<Document<T>>): Promise<T[]> {\n return this.repository.getAll(options);\n }\n\n getByIds(ids: string[]): Promise<T[]> {\n return this.repository.bulkGet(ids);\n }\n\n create(data: C): Promise<T> {\n return this.repository.create<C>(data);\n }\n\n bulkCreate(data: C[]): Promise<T[]> {\n return this.repository.bulkCreate<C>(data);\n }\n\n async update(id: string, data: Partial<U>, overwrite = false): Promise<T> {\n return this.repository.update<U>({ id }, data, { overwrite });\n }\n\n insert(data: (C | U) & { id?: string }, overwrite = true): Promise<T> {\n const { id, ...rest } = data;\n if (id) {\n const existing = this.repository.get({ id });\n if (existing) {\n return this.update(id, rest as U, overwrite);\n }\n }\n return this.create(rest as C);\n }\n\n delete(id: string | FilterQuery<Document<T>>): Promise<boolean> {\n if (typeof id === 'string') {\n return this.repository.delete({ id });\n }\n return this.repository.delete(id);\n }\n}\n","export * from './base-service';\nexport * from './base-proxy-service';\n","export * from './models';\nexport * from './repositories';\n","import { Schema } from 'mongoose';\n\nexport const commonModeSchemaOptions = {\n timestamps: true,\n toJSON: {\n virtuals: true,\n },\n toObject: {\n virtuals: true,\n getters: true,\n transform(doc, ret) {\n delete ret.__v;\n delete ret._id;\n },\n },\n};\n\nexport const addIdVirtualFields = (schema: Schema) => {\n schema.set('toJSON', {\n virtuals: true,\n });\n return schema;\n};\n","export * from './common-options';\n","import { isObject } from 'lodash';\nimport { logger as Logger } from '@cdm-logger/server';\nimport { Connection, Document, FilterQuery, Model, UpdateQuery } from 'mongoose';\nimport { injectable, unmanaged } from 'inversify';\nimport { GetAllArgs, IBaseRepository, IMongoOptions, DEFAULT_SORTING, PAGINATION_OPTIONS, } from '../../interfaces';\n\n@injectable()\nexport class BaseRepository<T, D = Document<T>> implements IBaseRepository<T, D> {\n private options: IMongoOptions;\n\n protected logger: typeof Logger;\n\n model: Model<D>;\n\n constructor(\n @unmanaged()\n private modelFunc: (db: Connection) => Model<D>,\n @unmanaged()\n db: Connection,\n @unmanaged()\n logger: typeof Logger,\n @unmanaged()\n options?: IMongoOptions,\n ) {\n this.model = modelFunc(db);\n this.options = options;\n this.logger = logger.child({ className: BaseRepository.name });\n }\n\n public async getAll(options: GetAllArgs<D>): Promise<T[]> {\n try {\n const { criteria, selectedFields, sort, limit, skip } = options;\n // map id to mongoose _id\n const { id, ...rest } = criteria || { id: undefined };\n const sortBy = isObject(sort) ? { [sort?.key]: sort.value } : DEFAULT_SORTING;\n const response = await this.model\n .find({ ...rest, ...(id ? { _id: id } : {}) }, selectedFields)\n .limit(limit || PAGINATION_OPTIONS.limit)\n .skip(skip || PAGINATION_OPTIONS.skip)\n .sort(sortBy as never)\n .exec();\n return response.map((i) => i?.toObject()) as T[];\n } catch (e) {\n this.logger.error(`Unable to retrieve Model with criteria ${JSON.stringify(options)}`);\n throw e;\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private mapConditions(conditions: FilterQuery<D>): FilterQuery<D> {\n const { id: _id, ...remaining } = conditions;\n return {\n ...(_id ? { _id } : {}),\n ...remaining,\n };\n }\n\n public async count(conditions?: FilterQuery<D>): Promise<number> {\n return this.model.count(conditions).exec();\n }\n\n public async get(conditions?: FilterQuery<D>, selectedFields?: string): Promise<T> {\n try {\n const response = await this.model.findOne(this.mapConditions(conditions), selectedFields).exec();\n return response?.toObject() as T;\n } catch (e) {\n this.logger.error(`Unable to retrieve Model with criteria ${JSON.stringify(conditions)}`);\n throw e;\n }\n }\n\n public async bulkGet(ids: string[]): Promise<T[]> {\n try {\n const results = await this.model.find().setOptions({ batchSize: 100 }).where('_id').in(ids).exec();\n return results.map((i) => i.toObject()) as T[];\n } catch (e) {\n this.logger.error(`Unable to retrieve Model with criteria ${JSON.stringify(ids)}`);\n throw e;\n }\n }\n\n public async find(conditions: Partial<FilterQuery<D>>, selectedFields?: string): Promise<T> {\n try {\n const response = await this.model.findOne(conditions, selectedFields).exec();\n return response?.toObject() as T;\n } catch (e) {\n this.logger.error(`Unable to retrieve Model with criteria ${JSON.stringify(conditions)}`);\n throw e;\n }\n }\n\n public async create<I>(data: I): Promise<T> {\n try {\n const response = await this.model.create(data);\n return response.toObject() as T;\n } catch (e) {\n this.logger.error(`Unable to create Model with data ${JSON.stringify(data)} due to ${e?.message}`);\n throw e;\n }\n }\n\n public async bulkCreate<I>(data: I[]): Promise<T[]> {\n try {\n const response = await this.model.insertMany(data, {\n lean: true,\n ordered: true,\n });\n return response as unknown as T[];\n } catch (e) {\n this.logger.error(`Unable to bulk create due to error`, e.message);\n }\n }\n\n public async upsert<I>(conditions: FilterQuery<D>, update: I, options?: Record<string, unknown>): Promise<T> {\n return this.update<I>(conditions, update, {\n upsert: true,\n ...options,\n });\n }\n\n public async bulkUpdate<I>(\n criteria: FilterQuery<D>,\n update: UpdateQuery<D>,\n options: Record<string, unknown>,\n ): Promise<T[]> {\n try {\n const { id, ...rest } = criteria;\n const processedCriteria = id ? { _id: id, ...rest } : criteria;\n const res = await this.model.updateMany(processedCriteria, update);\n if (res) {\n const response = await this.model\n .find(processedCriteria)\n .exec();\n return response.map((i) => i?.toObject()) as T[];\n } else {\n this.logger.error(\n `Unable to Bulk Update with criteria ${JSON.stringify(criteria)} and data ${JSON.stringify(update)}`,\n );\n throw new Error('Unable to do bulk update');\n }\n\n } catch (e) {\n this.logger.error(\n `Unable to Bulk Update with criteria ${JSON.stringify(criteria)} and data ${JSON.stringify(update)}`,\n );\n throw e;\n }\n }\n\n public async update<I>(\n criteria: FilterQuery<D>,\n update: UpdateQuery<D>,\n options: Record<string, unknown>,\n ): Promise<T> {\n try {\n const { id, ...rest } = criteria;\n const processedCriteria = id ? { _id: id, ...rest } : criteria;\n const mergedOptions = {\n new: true,\n useFindAndModify: false,\n ...options,\n };\n if (id) {\n return (await this.model\n .findByIdAndUpdate(id, update as unknown as never, mergedOptions)\n .exec()) as unknown as Promise<T>;\n }\n return (await this.model\n .findOneAndUpdate(processedCriteria, update as unknown as never, mergedOptions)\n .exec()) as unknown as Promise<T>;\n } catch (e) {\n this.logger.error(\n `Unable to Update with criteria ${JSON.stringify(criteria)} and data ${JSON.stringify(update)}`,\n );\n throw e;\n }\n }\n\n public async delete(criteria: FilterQuery<D>): Promise<boolean> {\n try {\n let deleted;\n if (criteria?.id) {\n deleted = await this.model.findByIdAndDelete(criteria.id);\n } else {\n deleted = await this.model.findOneAndDelete(this.mapConditions(criteria));\n }\n return !!deleted;\n } catch (e) {\n this.logger.error(`Unable to delete the model with criteria`, criteria);\n throw e;\n }\n }\n\n public async bulkDelete(criteria: FilterQuery<D>): Promise<number> {\n try {\n const deleted = await this.model.deleteMany(this.mapConditions(criteria));\n return deleted?.deletedCount || 0;\n } catch (e) {\n this.logger.error(`Unable to delete the model with criteria`, criteria);\n throw e;\n }\n }\n \n}\n","export * from './base-repository';\n","module.exports = require(\"@common-stack/core\");","module.exports = require(\"dataloader\");","module.exports = require(\"inversify\");","module.exports = require(\"lodash\");","module.exports = require(\"mongoose\");"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uEAAyC;AACzC,sEAAkD;AAIlD,IAAa,cAAc,GAA3B,MAAa,cAAyC,SAAQ,UAAqB;IAC/E,YAEI,OAAwB;QAExB,KAAK,CAAC,KAAK,EAAE,GAAa,EAAE,EAAE;YAC1B,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YACzC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAVY,cAAc;IAD1B,0BAAU,GAAE;IAGJ,oCAAS,GAAE;GAFP,cAAc,CAU1B;AAVY,wCAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;ACL3B,4GAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAlC,gHAAsC;;;;;;;;;;;;;;ACAtC,iEAAqC;AAErC,IA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,CAAC,OAAO,CAAC;SACpB;QAAC,OAAO,CAAC,EAAE;YACR,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,EAAE,QAAQ,CAAC,CAAC;YACxE,MAAM,CAAC,CAAC;SACX;IACL,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,QAAwB;QAC5C,IAAI;YACA,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC1E,OAAO,QAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,KAAI,CAAC,CAAC;SACrC;QAAC,OAAO,CAAC,EAAE;YACR,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,EAAE,QAAQ,CAAC,CAAC;YACxE,MAAM,CAAC,CAAC;SACX;IACL,CAAC;CAEJ;AApMY,cAAc;IAD1B,0BAAU,GAAE;IASJ,oCAAS,GAAE;IAEX,oCAAS,GAAE;IAEX,oCAAS,GAAE;IAEX,oCAAS,GAAE;GAdP,cAAc,CAoM1B;AApMY,wCAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;ACP3B,mHAAkC;;;;;;;;;;;ACAlC;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;UEtBA;UACA;UACA;UACA","sources":["webpack://@common-stack/store-mongo/./src/dataloaders/bulk-dataloader.ts","webpack://@common-stack/store-mongo/./src/dataloaders/index.ts","webpack://@common-stack/store-mongo/./src/helpers/index.ts","webpack://@common-stack/store-mongo/./src/helpers/mongoose-connection.ts","webpack://@common-stack/store-mongo/./src/index.ts","webpack://@common-stack/store-mongo/./src/interfaces/base-repository.ts","webpack://@common-stack/store-mongo/./src/interfaces/base-service.ts","webpack://@common-stack/store-mongo/./src/interfaces/dataloaders.ts","webpack://@common-stack/store-mongo/./src/interfaces/generated-models.ts","webpack://@common-stack/store-mongo/./src/interfaces/get-all-args.ts","webpack://@common-stack/store-mongo/./src/interfaces/index.ts","webpack://@common-stack/store-mongo/./src/interfaces/mongoose-settings.ts","webpack://@common-stack/store-mongo/./src/mixins/base-service-mixin.ts","webpack://@common-stack/store-mongo/./src/mixins/index.ts","webpack://@common-stack/store-mongo/./src/services/base-proxy-service.ts","webpack://@common-stack/store-mongo/./src/services/base-service.ts","webpack://@common-stack/store-mongo/./src/services/index.ts","webpack://@common-stack/store-mongo/./src/store/index.ts","webpack://@common-stack/store-mongo/./src/store/models/common-options.ts","webpack://@common-stack/store-mongo/./src/store/models/index.ts","webpack://@common-stack/store-mongo/./src/store/repositories/base-repository.ts","webpack://@common-stack/store-mongo/./src/store/repositories/index.ts","webpack://@common-stack/store-mongo/external commonjs \"@common-stack/core\"","webpack://@common-stack/store-mongo/external commonjs \"dataloader\"","webpack://@common-stack/store-mongo/external commonjs \"inversify\"","webpack://@common-stack/store-mongo/external commonjs \"lodash\"","webpack://@common-stack/store-mongo/external commonjs \"mongoose\"","webpack://@common-stack/store-mongo/webpack/bootstrap","webpack://@common-stack/store-mongo/webpack/before-startup","webpack://@common-stack/store-mongo/webpack/startup","webpack://@common-stack/store-mongo/webpack/after-startup"],"sourcesContent":["import * as DataLoader from 'dataloader';\nimport { injectable, unmanaged } from 'inversify';\nimport { IBaseService } from '../interfaces';\n\n@injectable()\nexport class BulkDataLoader<T extends { id: string }> extends DataLoader<string, T> {\n constructor(\n @unmanaged()\n service: IBaseService<T>,\n ) {\n super(async (ids: string[]) => {\n const data = await service.getByIds(ids);\n return ids.map((id) => data.find((record) => record.id === id));\n });\n }\n}\n","export * from './bulk-dataloader';\n","export * from './mongoose-connection';\n","import * as mongoose from 'mongoose';\n\nlet connectionOptions: mongoose.ConnectionOptions | undefined;\n// (mongoose as any).Promise = global.Promise;\n\nconst generateMongo: (monoUrl) => mongoose.Connection = (mongoUrl) => {\n\n // creates default connection\n mongoose.connect(mongoUrl, {\n }).then(() => {\n console.info('mogoose connect - success');\n // console.info(`uri - ${uri}`);\n // console.info(`connectionOptions - ${connectionOptions}`);\n }).catch((err: mongoose.Error) => {\n console.error('mogoose connect - error - ', err);\n // throw err;\n process.kill(process.pid);\n });\n // to access default connection\n const mongooseConnection: mongoose.Connection = mongoose.connection;\n\n return mongooseConnection;\n};\n\n\n\nexport { generateMongo };\n","export * from './interfaces';\nexport * from './helpers';\nexport * from './services';\nexport * from './store';\nexport * from './dataloaders';\nexport * from './mixins';\n","import { FilterQuery, Document, Model, UpdateQuery } from 'mongoose';\nimport { GetAllArgs } from './get-all-args';\n\nexport enum PAGINATION_OPTIONS {\n limit = 10,\n skip = 0,\n}\n\nexport const DEFAULT_SORTING = {\n id: 'asc',\n};\n\nexport interface IBaseRepository<T, D = Document<T>> {\n model: Model<D>;\n count(conditions?: FilterQuery<D>): Promise<number>;\n getAll(options: GetAllArgs<D>): Promise<T[]>;\n get(conditions?: FilterQuery<D>, selectedFields?: string): Promise<T>;\n create<I>(data: I): Promise<T>;\n upsert<I>(conditions: FilterQuery<D>, update: I, options): Promise<T>;\n update<I>(criteria: FilterQuery<D>, update: UpdateQuery<D>, options?): Promise<T>;\n bulkUpdate<I>(criteria: FilterQuery<D>, update: UpdateQuery<D>, options?): Promise<T[]>;\n delete(criteria: FilterQuery<D>): Promise<boolean>;\n bulkGet(ids: string[], selectedFields?: string): Promise<T[]>;\n bulkCreate<I>(data: I[]): Promise<T[]>;\n bulkDelete(criteria: FilterQuery<D>): Promise<number>;\n}\n","import { FilterQuery, Document } from 'mongoose';\nimport { GetAllArgs } from './get-all-args';\n\nexport interface IBaseService<T, C = Omit<T, 'id'>, U = C> {\n count(conditions?: FilterQuery<Document<T>>): Promise<number>;\n\n get(id: string): Promise<T>;\n\n get(conditions?: string | FilterQuery<Document<T>>): Promise<T>;\n\n getAll(options?: GetAllArgs<Document<T>>): Promise<T[]>;\n\n getByIds(ids: string[]): Promise<T[]>;\n\n create(data: C): Promise<T>;\n\n insert(data: (C | U) & { id?: string }, overwrite?: boolean): Promise<T>;\n\n bulkCreate(data: C[]): Promise<T[]>;\n\n update(id: string, data: U, overwrite?: boolean): Promise<T>;\n\n delete(id: string): Promise<boolean>;\n\n delete(conditions: string | FilterQuery<Document<T>>): Promise<boolean>;\n\n getAllWithCount(options: GetAllArgs<Document<T>>): Promise<{ data: T[]; totalCount: number }>;\n}\n","import * as DataLoader from 'dataloader';\n\nexport type IDataLoader<T> = DataLoader<string, T>;\n","/* tslint:disable */\nexport type Maybe<T> = T | null;\nexport type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: string;\n String: string;\n Boolean: boolean;\n Int: number;\n Float: number;\n AnyObject: any;\n Date: any;\n DateTime: any;\n JSON: any;\n JSONObject: any;\n Observable: any;\n Time: any;\n URI: any;\n URIInput: any;\n};\n\n\nexport type IAdminIdeSettings = {\n __typename?: 'AdminIdeSettings';\n dummy?: Maybe<Scalars['Int']>;\n};\n\n\nexport enum IBaseServiceCommands {\n count = 'count',\n get = 'get',\n getAll = 'getAll',\n getByIds = 'getByIds',\n create = 'create',\n insert = 'insert',\n bulkCreate = 'bulkCreate',\n update = 'update',\n delete = 'delete',\n getAllWithCount = 'getAllWithCount'\n}\n\nexport enum ICacheControlScope {\n PUBLIC = 'PUBLIC',\n PRIVATE = 'PRIVATE'\n}\n\n\n\n/** Represents a null return value. */\nexport type IEmptyResponse = {\n __typename?: 'EmptyResponse';\n alwaysNil?: Maybe<Scalars['String']>;\n};\n\nexport type IFieldError = {\n __typename?: 'FieldError';\n field: Scalars['String'];\n message: Scalars['String'];\n};\n\n\n\n/** All Moleculer Topic names are extended from this. */\nexport enum IMoleculerServiceName {\n dummy = 'dummy'\n}\n\nexport type IMutation = {\n __typename?: 'Mutation';\n dummy?: Maybe<Scalars['Int']>;\n};\n\n/** An object with an ID. */\nexport type INode = {\n /** The ID of the node. */\n id: Scalars['ID'];\n};\n\n\nexport type IPageInfo = {\n __typename?: 'PageInfo';\n hasNextPage: Scalars['Boolean'];\n};\n\nexport type IQuery = {\n __typename?: 'Query';\n /** Looks up a node by ID. */\n node?: Maybe<INode>;\n};\n\n\nexport type IQuerynodeArgs = {\n id: Scalars['ID'];\n};\n\nexport type ISort = {\n key: Scalars['String'];\n value: ISortEnum;\n};\n\nexport enum ISortEnum {\n ASC = 'ASC',\n DESC = 'DESC'\n}\n\nexport type ISubscription = {\n __typename?: 'Subscription';\n dummy?: Maybe<Scalars['Int']>;\n};\n\n\n\n","import { FilterQuery } from 'mongoose';\nimport { ISortEnum, ISort } from './generated-models';\n\nexport interface GetAllArgs<T> {\n criteria?: FilterQuery<T>;\n sort?: ISort;\n skip?: number;\n limit?: number;\n selectedFields?: string;\n}\n","export * from './mongoose-settings';\nexport * from './get-all-args';\nexport * from './base-repository';\nexport * from './base-service';\nexport * from './dataloaders';\nexport * from './generated-models';\n","import * as mongoose from 'mongoose';\n\nexport interface IMongoDBSettings {\n mongoConnection: mongoose.Connection;\n}\nexport interface IMongoOptions {\n collectionName?: string;\n sessionCollectionName?: string;\n timestamps?: {\n createdAt: string;\n updatedAt: string;\n };\n convertUserIdToMongoObjectId?: boolean;\n convertSessionIdToMongoObjectId?: boolean;\n caseSensitiveUserName?: boolean;\n idProvider?: (() => string | Object);\n dateProvider?: (date?: Date) => any;\n}\n","import { Context, ServiceSchema } from 'moleculer';\nimport { Document, FilterQuery } from 'mongoose';\nimport { IBaseServiceCommands, GetAllArgs, IBaseService } from '../interfaces';\n\nexport const BaseServiceMixin = <T, C, U>(service: IBaseService<T, C, U>): Partial<ServiceSchema> => ({\n name: 'BaseServiceMixin',\n actions: {\n [IBaseServiceCommands.get]: {\n params: {\n id: 'string',\n },\n handler: async (ctx: Context<{ id: string }>) => service.get(ctx.params.id),\n },\n [IBaseServiceCommands.count]: {\n params: {\n criteria: { type: 'object', optional: true },\n },\n handler: async (ctx: Context<{ criteria?: FilterQuery<Document<T>> }>) =>\n service.count(ctx.params.criteria),\n },\n [IBaseServiceCommands.bulkCreate]: {\n params: {\n data: { type: 'array', items: 'object' },\n },\n handler: async (ctx: Context<{ data: never[] }>) => service.bulkCreate(ctx.params.data),\n },\n [IBaseServiceCommands.create]: {\n params: {\n data: 'object',\n },\n handler: async (ctx: Context<{ data: never }>) => service.create(ctx.params.data),\n },\n [IBaseServiceCommands.delete]: {\n params: {\n id: 'string',\n },\n handler: async (ctx: Context<{ id: string | FilterQuery<Document<T>> }>) =>\n service.delete(ctx.params.id as never),\n },\n [IBaseServiceCommands.getAll]: {\n params: {\n criteria: 'object|optional',\n sort: 'object|optional',\n skip: 'number|optional',\n limit: 'number|optional',\n selectedFields: 'string|optional',\n },\n handler: async (ctx: Context<GetAllArgs<Document<T>>>) => service.getAll(ctx.params),\n },\n [IBaseServiceCommands.getAllWithCount]: {\n params: {\n criteria: 'object|optional',\n sort: 'object|optional',\n skip: 'number|optional',\n limit: 'number|optional',\n selectedFields: 'string|optional',\n },\n handler: async (ctx: Context<GetAllArgs<Document<T>>>) => service.getAllWithCount(ctx.params),\n },\n [IBaseServiceCommands.insert]: {\n params: {\n data: 'object',\n overwrite: 'boolean|optional',\n },\n handler: async (ctx: Context<{ data: never & { id?: string }; overwrite: boolean }>) =>\n service.insert(ctx.params.data, ctx.params.overwrite),\n },\n [IBaseServiceCommands.update]: {\n params: {\n id: 'string',\n data: 'object',\n overwrite: 'boolean|optional',\n },\n handler: async (ctx: Context<{ id: string; data: never; overwrite: boolean }>) =>\n service.update(ctx.params.id, ctx.params.data, ctx.params.overwrite),\n },\n },\n});\n","export { BaseServiceMixin } from './base-service-mixin';\n","import { inject, injectable } from 'inversify';\nimport { ServiceBroker } from 'moleculer';\nimport { FilterQuery } from 'mongoose';\nimport * as Logger from 'bunyan';\nimport { CommonType } from '@common-stack/core';\nimport { IBaseServiceCommands, GetAllArgs, IBaseService } from '../interfaces';\n\ntype MethodsNames<T, C, U> = keyof IBaseService<T, C, U>;\ntype MethodResponse<T, C, U, M extends MethodsNames<T, C, U>> = ReturnType<IBaseService<T, C, U>[M]>;\n\n@injectable()\nexport abstract class BaseProxyService<T, C = T, U = T> implements IBaseService<T, C, U> {\n protected logger: Logger;\n\n protected abstract topic;\n\n constructor(\n @inject(CommonType.MOLECULER_BROKER)\n private readonly broker: ServiceBroker,\n @inject('Logger')\n logger: Logger,\n ) {\n this.logger = logger.child({ className: 'BaseProxyService' });\n }\n\n bulkCreate(data: C[]): MethodResponse<T, C, U, 'bulkCreate'> {\n return this.callAction<T[], { data: C[] }>(IBaseServiceCommands.bulkCreate, { data });\n }\n\n count(criteria?: FilterQuery<Document>): MethodResponse<T, C, U, 'count'> {\n return this.callAction(IBaseServiceCommands.count, { criteria });\n }\n\n create(data: C): MethodResponse<T, C, U, 'create'> {\n return this.callAction(IBaseServiceCommands.create, { data });\n }\n\n delete(id: string | FilterQuery<Document>): MethodResponse<T, C, U, 'delete'> {\n return this.callAction(IBaseServiceCommands.delete, { id });\n }\n\n get(id?: string | FilterQuery<Document>): MethodResponse<T, C, U, 'get'> {\n return this.callAction(IBaseServiceCommands.get, { id });\n }\n\n getAll(options?: GetAllArgs<Document>): MethodResponse<T, C, U, 'getAll'> {\n return this.callAction(IBaseServiceCommands.getAll, options);\n }\n\n getByIds(ids: string[]): Promise<T[]> {\n return this.callAction(IBaseServiceCommands.getByIds, { ids });\n }\n\n getAllWithCount(options: GetAllArgs<Document>): MethodResponse<T, C, U, 'getAllWithCount'> {\n return this.callAction(IBaseServiceCommands.getAllWithCount, options);\n }\n\n insert(data: C | U, overwrite?: boolean): MethodResponse<T, C, U, 'insert'> {\n return this.callAction(IBaseServiceCommands.insert, { data, overwrite });\n }\n\n update(id: string, data: U, overwrite?: boolean): MethodResponse<T, C, U, 'update'> {\n return this.callAction<T>(IBaseServiceCommands.update, { id, data, overwrite });\n }\n\n protected async callAction<T, P = unknown>(command: string, params?: P): Promise<T> {\n return this.broker.call<T, P>(`${this.topic}.${command}`, params);\n }\n}\n","import { Document, FilterQuery } from 'mongoose';\nimport { injectable } from 'inversify';\nimport { GetAllArgs, IBaseRepository, IBaseService } from '../interfaces';\n\n@injectable()\nexport class BaseService<T, C = Omit<T, 'id'>, U = C> implements IBaseService<T, C, U> {\n constructor(protected repository: IBaseRepository<T>) {\n this.repository = repository;\n }\n\n async getAllWithCount(options: GetAllArgs<Document<T>>): Promise<{ data: T[]; totalCount: number }> {\n const totalCount = await this.count(options.criteria);\n const data = await this.getAll(options);\n return {\n totalCount,\n data,\n };\n }\n\n count(conditions?: FilterQuery<Document<T>>): Promise<number> {\n return this.repository.count(conditions);\n }\n\n get(conditions: string | FilterQuery<Document<T>>): Promise<T> {\n if (typeof conditions === 'string') {\n return this.repository.get({ id: conditions });\n }\n return this.repository.get(conditions);\n }\n\n getName(name: string): Promise<T> {\n return this.repository.get({ name });\n }\n\n getAll(options: GetAllArgs<Document<T>>): Promise<T[]> {\n return this.repository.getAll(options);\n }\n\n getByIds(ids: string[]): Promise<T[]> {\n return this.repository.bulkGet(ids);\n }\n\n create(data: C): Promise<T> {\n return this.repository.create<C>(data);\n }\n\n bulkCreate(data: C[]): Promise<T[]> {\n return this.repository.bulkCreate<C>(data);\n }\n\n async update(id: string, data: Partial<U>, overwrite = false): Promise<T> {\n return this.repository.update<U>({ id }, data, { overwrite });\n }\n\n insert(data: (C | U) & { id?: string }, overwrite = true): Promise<T> {\n const { id, ...rest } = data;\n if (id) {\n const existing = this.repository.get({ id });\n if (existing) {\n return this.update(id, rest as U, overwrite);\n }\n }\n return this.create(rest as C);\n }\n\n delete(id: string | FilterQuery<Document<T>>): Promise<boolean> {\n if (typeof id === 'string') {\n return this.repository.delete({ id });\n }\n return this.repository.delete(id);\n }\n}\n","export * from './base-service';\nexport * from './base-proxy-service';\n","export * from './models';\nexport * from './repositories';\n","import { Schema } from 'mongoose';\n\nexport const commonModeSchemaOptions = {\n timestamps: true,\n toJSON: {\n virtuals: true,\n },\n toObject: {\n virtuals: true,\n getters: true,\n transform(doc, ret) {\n delete ret.__v;\n delete ret._id;\n },\n },\n};\n\nexport const addIdVirtualFields = (schema: Schema) => {\n schema.set('toJSON', {\n virtuals: true,\n });\n return schema;\n};\n","export * from './common-options';\n","import { isObject } from 'lodash';\nimport { logger as Logger } from '@cdm-logger/server';\nimport { Connection, Document, FilterQuery, Model, UpdateQuery } from 'mongoose';\nimport { injectable, unmanaged } from 'inversify';\nimport { GetAllArgs, IBaseRepository, IMongoOptions, DEFAULT_SORTING, PAGINATION_OPTIONS, } from '../../interfaces';\n\n@injectable()\nexport class BaseRepository<T, D = Document<T>> implements IBaseRepository<T, D> {\n private options: IMongoOptions;\n\n protected logger: typeof Logger;\n\n model: Model<D>;\n\n constructor(\n @unmanaged()\n private modelFunc: (db: Connection) => Model<D>,\n @unmanaged()\n db: Connection,\n @unmanaged()\n logger: typeof Logger,\n @unmanaged()\n options?: IMongoOptions,\n ) {\n this.model = modelFunc(db);\n this.options = options;\n this.logger = logger.child({ className: BaseRepository.name });\n }\n\n public async getAll(options: GetAllArgs<D>): Promise<T[]> {\n try {\n const { criteria, selectedFields, sort, limit, skip } = options;\n // map id to mongoose _id\n const { id, ...rest } = criteria || { id: undefined };\n const sortBy = isObject(sort) ? { [sort?.key]: sort.value } : DEFAULT_SORTING;\n const response = await this.model\n .find({ ...rest, ...(id ? { _id: id } : {}) }, selectedFields)\n .limit(limit || PAGINATION_OPTIONS.limit)\n .skip(skip || PAGINATION_OPTIONS.skip)\n .sort(sortBy as never)\n .exec();\n return response.map((i) => i?.toObject()) as T[];\n } catch (e) {\n this.logger.error(`Unable to retrieve Model with criteria ${JSON.stringify(options)}`);\n throw e;\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private mapConditions(conditions: FilterQuery<D>): FilterQuery<D> {\n const { id: _id, ...remaining } = conditions;\n return {\n ...(_id ? { _id } : {}),\n ...remaining,\n };\n }\n\n public async count(conditions?: FilterQuery<D>): Promise<number> {\n return this.model.count(conditions).exec();\n }\n\n public async get(conditions?: FilterQuery<D>, selectedFields?: string): Promise<T> {\n try {\n const response = await this.model.findOne(this.mapConditions(conditions), selectedFields).exec();\n return response?.toObject() as T;\n } catch (e) {\n this.logger.error(`Unable to retrieve Model with criteria ${JSON.stringify(conditions)}`);\n throw e;\n }\n }\n\n public async bulkGet(ids: string[]): Promise<T[]> {\n try {\n const results = await this.model.find().setOptions({ batchSize: 100 }).where('_id').in(ids).exec();\n return results.map((i) => i.toObject()) as T[];\n } catch (e) {\n this.logger.error(`Unable to retrieve Model with criteria ${JSON.stringify(ids)}`);\n throw e;\n }\n }\n\n public async find(conditions: Partial<FilterQuery<D>>, selectedFields?: string): Promise<T> {\n try {\n const response = await this.model.findOne(conditions, selectedFields).exec();\n return response?.toObject() as T;\n } catch (e) {\n this.logger.error(`Unable to retrieve Model with criteria ${JSON.stringify(conditions)}`);\n throw e;\n }\n }\n\n public async create<I>(data: I): Promise<T> {\n try {\n const response = await this.model.create(data);\n return response.toObject() as T;\n } catch (e) {\n this.logger.error(`Unable to create Model with data ${JSON.stringify(data)} due to ${e?.message}`);\n throw e;\n }\n }\n\n public async bulkCreate<I>(data: I[]): Promise<T[]> {\n try {\n const response = await this.model.insertMany(data, {\n lean: true,\n ordered: true,\n });\n return response as unknown as T[];\n } catch (e) {\n this.logger.error(`Unable to bulk create due to error`, e.message);\n }\n }\n\n public async upsert<I>(conditions: FilterQuery<D>, update: I, options?: Record<string, unknown>): Promise<T> {\n return this.update<I>(conditions, update, {\n upsert: true,\n ...options,\n });\n }\n\n public async bulkUpdate<I>(\n criteria: FilterQuery<D>,\n update: UpdateQuery<D>,\n options: Record<string, unknown>,\n ): Promise<T[]> {\n try {\n const { id, ...rest } = criteria;\n const processedCriteria = id ? { _id: id, ...rest } : criteria;\n const res = await this.model.updateMany(processedCriteria, update);\n if (res) {\n const response = await this.model\n .find(processedCriteria)\n .exec();\n return response.map((i) => i?.toObject()) as T[];\n } else {\n this.logger.error(\n `Unable to Bulk Update with criteria ${JSON.stringify(criteria)} and data ${JSON.stringify(update)}`,\n );\n throw new Error('Unable to do bulk update');\n }\n\n } catch (e) {\n this.logger.error(\n `Unable to Bulk Update with criteria ${JSON.stringify(criteria)} and data ${JSON.stringify(update)}`,\n );\n throw e;\n }\n }\n\n public async update<I>(\n criteria: FilterQuery<D>,\n update: UpdateQuery<D>,\n options: Record<string, unknown>,\n ): Promise<T> {\n try {\n const { id, ...rest } = criteria;\n const processedCriteria = id ? { _id: id, ...rest } : criteria;\n const mergedOptions = {\n new: true,\n useFindAndModify: false,\n ...options,\n };\n if (id) {\n return (await this.model\n .findByIdAndUpdate(id, update as unknown as never, mergedOptions)\n .exec()) as unknown as Promise<T>;\n }\n return (await this.model\n .findOneAndUpdate(processedCriteria, update as unknown as never, mergedOptions)\n .exec()) as unknown as Promise<T>;\n } catch (e) {\n this.logger.error(\n `Unable to Update with criteria ${JSON.stringify(criteria)} and data ${JSON.stringify(update)}`,\n );\n throw e;\n }\n }\n\n public async delete(criteria: FilterQuery<D>): Promise<boolean> {\n try {\n let deleted;\n if (criteria?.id) {\n deleted = await this.model.findByIdAndDelete(criteria.id);\n } else {\n deleted = await this.model.findOneAndDelete(this.mapConditions(criteria));\n }\n return !!deleted;\n } catch (e) {\n this.logger.error(`Unable to delete the model with criteria`, criteria);\n throw e;\n }\n }\n\n public async bulkDelete(criteria: FilterQuery<D>): Promise<number> {\n try {\n const deleted = await this.model.deleteMany(this.mapConditions(criteria));\n return deleted?.deletedCount || 0;\n } catch (e) {\n this.logger.error(`Unable to delete the model with criteria`, criteria);\n throw e;\n }\n }\n \n}\n","export * from './base-repository';\n","module.exports = require(\"@common-stack/core\");","module.exports = require(\"dataloader\");","module.exports = require(\"inversify\");","module.exports = require(\"lodash\");","module.exports = require(\"mongoose\");","// 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","","// 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":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/store-mongo",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"watch": "npm run build:lib:watch"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@common-stack/core": "^0.2.
|
|
22
|
+
"@common-stack/core": "^0.2.16"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"dataloader": ">=2.0.0",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"typescript": {
|
|
32
32
|
"definition": "lib/index.d.ts"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "b6b684b47c3aab68830ce5788ef271bf8e7b6e19"
|
|
35
35
|
}
|