@common-stack/store-mongo 0.2.7 → 0.2.8
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 +48 -39
- package/lib/index.js.map +1 -1
- package/lib/interfaces/generated-models.d.ts +65 -1
- package/lib/interfaces/get-all-args.d.ts +1 -8
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -301,20 +301,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
301
301
|
"use strict";
|
|
302
302
|
|
|
303
303
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
304
|
-
exports.
|
|
305
|
-
var
|
|
306
|
-
(function (
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
})(
|
|
304
|
+
exports.ISortEnum = exports.IMoleculerServiceName = exports.ICacheControlScope = exports.IBaseServiceCommands = void 0;
|
|
305
|
+
var IBaseServiceCommands;
|
|
306
|
+
(function (IBaseServiceCommands) {
|
|
307
|
+
IBaseServiceCommands["count"] = "count";
|
|
308
|
+
IBaseServiceCommands["get"] = "get";
|
|
309
|
+
IBaseServiceCommands["getAll"] = "getAll";
|
|
310
|
+
IBaseServiceCommands["getByIds"] = "getByIds";
|
|
311
|
+
IBaseServiceCommands["create"] = "create";
|
|
312
|
+
IBaseServiceCommands["insert"] = "insert";
|
|
313
|
+
IBaseServiceCommands["bulkCreate"] = "bulkCreate";
|
|
314
|
+
IBaseServiceCommands["update"] = "update";
|
|
315
|
+
IBaseServiceCommands["delete"] = "delete";
|
|
316
|
+
IBaseServiceCommands["getAllWithCount"] = "getAllWithCount";
|
|
317
|
+
})(IBaseServiceCommands = exports.IBaseServiceCommands || (exports.IBaseServiceCommands = {}));
|
|
318
|
+
var ICacheControlScope;
|
|
319
|
+
(function (ICacheControlScope) {
|
|
320
|
+
ICacheControlScope["PUBLIC"] = "PUBLIC";
|
|
321
|
+
ICacheControlScope["PRIVATE"] = "PRIVATE";
|
|
322
|
+
})(ICacheControlScope = exports.ICacheControlScope || (exports.ICacheControlScope = {}));
|
|
323
|
+
/** All Moleculer Topic names are extended from this. */
|
|
324
|
+
var IMoleculerServiceName;
|
|
325
|
+
(function (IMoleculerServiceName) {
|
|
326
|
+
IMoleculerServiceName["dummy"] = "dummy";
|
|
327
|
+
})(IMoleculerServiceName = exports.IMoleculerServiceName || (exports.IMoleculerServiceName = {}));
|
|
328
|
+
var ISortEnum;
|
|
329
|
+
(function (ISortEnum) {
|
|
330
|
+
ISortEnum["ASC"] = "ASC";
|
|
331
|
+
ISortEnum["DESC"] = "DESC";
|
|
332
|
+
})(ISortEnum = exports.ISortEnum || (exports.ISortEnum = {}));
|
|
318
333
|
|
|
319
334
|
|
|
320
335
|
/***/ }),
|
|
@@ -329,12 +344,6 @@ var BaseServiceCommands;
|
|
|
329
344
|
"use strict";
|
|
330
345
|
|
|
331
346
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
332
|
-
exports.ISortEnum = void 0;
|
|
333
|
-
var ISortEnum;
|
|
334
|
-
(function (ISortEnum) {
|
|
335
|
-
ISortEnum["ASC"] = "ASC";
|
|
336
|
-
ISortEnum["DESC"] = "DESC";
|
|
337
|
-
})(ISortEnum = exports.ISortEnum || (exports.ISortEnum = {}));
|
|
338
347
|
|
|
339
348
|
|
|
340
349
|
/***/ }),
|
|
@@ -398,37 +407,37 @@ const interfaces_1 = __webpack_require__(/*! ../interfaces */ "./src/interfaces/
|
|
|
398
407
|
const BaseServiceMixin = (service) => ({
|
|
399
408
|
name: 'BaseServiceMixin',
|
|
400
409
|
actions: {
|
|
401
|
-
[interfaces_1.
|
|
410
|
+
[interfaces_1.IBaseServiceCommands.get]: {
|
|
402
411
|
params: {
|
|
403
412
|
id: 'string',
|
|
404
413
|
},
|
|
405
414
|
handler: async (ctx) => service.get(ctx.params.id),
|
|
406
415
|
},
|
|
407
|
-
[interfaces_1.
|
|
416
|
+
[interfaces_1.IBaseServiceCommands.count]: {
|
|
408
417
|
params: {
|
|
409
418
|
criteria: { type: 'object', optional: true },
|
|
410
419
|
},
|
|
411
420
|
handler: async (ctx) => service.count(ctx.params.criteria),
|
|
412
421
|
},
|
|
413
|
-
[interfaces_1.
|
|
422
|
+
[interfaces_1.IBaseServiceCommands.bulkCreate]: {
|
|
414
423
|
params: {
|
|
415
424
|
data: { type: 'array', items: 'object' },
|
|
416
425
|
},
|
|
417
426
|
handler: async (ctx) => service.bulkCreate(ctx.params.data),
|
|
418
427
|
},
|
|
419
|
-
[interfaces_1.
|
|
428
|
+
[interfaces_1.IBaseServiceCommands.create]: {
|
|
420
429
|
params: {
|
|
421
430
|
data: 'object',
|
|
422
431
|
},
|
|
423
432
|
handler: async (ctx) => service.create(ctx.params.data),
|
|
424
433
|
},
|
|
425
|
-
[interfaces_1.
|
|
434
|
+
[interfaces_1.IBaseServiceCommands.delete]: {
|
|
426
435
|
params: {
|
|
427
436
|
id: 'string',
|
|
428
437
|
},
|
|
429
438
|
handler: async (ctx) => service.delete(ctx.params.id),
|
|
430
439
|
},
|
|
431
|
-
[interfaces_1.
|
|
440
|
+
[interfaces_1.IBaseServiceCommands.getAll]: {
|
|
432
441
|
params: {
|
|
433
442
|
criteria: 'object|optional',
|
|
434
443
|
sort: 'object|optional',
|
|
@@ -438,7 +447,7 @@ const BaseServiceMixin = (service) => ({
|
|
|
438
447
|
},
|
|
439
448
|
handler: async (ctx) => service.getAll(ctx.params),
|
|
440
449
|
},
|
|
441
|
-
[interfaces_1.
|
|
450
|
+
[interfaces_1.IBaseServiceCommands.getAllWithCount]: {
|
|
442
451
|
params: {
|
|
443
452
|
criteria: 'object|optional',
|
|
444
453
|
sort: 'object|optional',
|
|
@@ -448,14 +457,14 @@ const BaseServiceMixin = (service) => ({
|
|
|
448
457
|
},
|
|
449
458
|
handler: async (ctx) => service.getAllWithCount(ctx.params),
|
|
450
459
|
},
|
|
451
|
-
[interfaces_1.
|
|
460
|
+
[interfaces_1.IBaseServiceCommands.insert]: {
|
|
452
461
|
params: {
|
|
453
462
|
data: 'object',
|
|
454
463
|
overwrite: 'boolean|optional',
|
|
455
464
|
},
|
|
456
465
|
handler: async (ctx) => service.insert(ctx.params.data, ctx.params.overwrite),
|
|
457
466
|
},
|
|
458
|
-
[interfaces_1.
|
|
467
|
+
[interfaces_1.IBaseServiceCommands.update]: {
|
|
459
468
|
params: {
|
|
460
469
|
id: 'string',
|
|
461
470
|
data: 'object',
|
|
@@ -516,34 +525,34 @@ let BaseProxyService = class BaseProxyService {
|
|
|
516
525
|
this.logger = logger.child({ className: 'BaseProxyService' });
|
|
517
526
|
}
|
|
518
527
|
bulkCreate(data) {
|
|
519
|
-
return this.callAction(interfaces_1.
|
|
528
|
+
return this.callAction(interfaces_1.IBaseServiceCommands.bulkCreate, { data });
|
|
520
529
|
}
|
|
521
530
|
count(criteria) {
|
|
522
|
-
return this.callAction(interfaces_1.
|
|
531
|
+
return this.callAction(interfaces_1.IBaseServiceCommands.count, { criteria });
|
|
523
532
|
}
|
|
524
533
|
create(data) {
|
|
525
|
-
return this.callAction(interfaces_1.
|
|
534
|
+
return this.callAction(interfaces_1.IBaseServiceCommands.create, { data });
|
|
526
535
|
}
|
|
527
536
|
delete(id) {
|
|
528
|
-
return this.callAction(interfaces_1.
|
|
537
|
+
return this.callAction(interfaces_1.IBaseServiceCommands.delete, { id });
|
|
529
538
|
}
|
|
530
539
|
get(id) {
|
|
531
|
-
return this.callAction(interfaces_1.
|
|
540
|
+
return this.callAction(interfaces_1.IBaseServiceCommands.get, { id });
|
|
532
541
|
}
|
|
533
542
|
getAll(options) {
|
|
534
|
-
return this.callAction(interfaces_1.
|
|
543
|
+
return this.callAction(interfaces_1.IBaseServiceCommands.getAll, options);
|
|
535
544
|
}
|
|
536
545
|
getByIds(ids) {
|
|
537
|
-
return this.callAction(interfaces_1.
|
|
546
|
+
return this.callAction(interfaces_1.IBaseServiceCommands.getByIds, { ids });
|
|
538
547
|
}
|
|
539
548
|
getAllWithCount(options) {
|
|
540
|
-
return this.callAction(interfaces_1.
|
|
549
|
+
return this.callAction(interfaces_1.IBaseServiceCommands.getAllWithCount, options);
|
|
541
550
|
}
|
|
542
551
|
insert(data, overwrite) {
|
|
543
|
-
return this.callAction(interfaces_1.
|
|
552
|
+
return this.callAction(interfaces_1.IBaseServiceCommands.insert, { data, overwrite });
|
|
544
553
|
}
|
|
545
554
|
update(id, data, overwrite) {
|
|
546
|
-
return this.callAction(interfaces_1.
|
|
555
|
+
return this.callAction(interfaces_1.IBaseServiceCommands.update, { id, data, overwrite });
|
|
547
556
|
}
|
|
548
557
|
async callAction(command, params) {
|
|
549
558
|
return this.broker.call(`${this.topic}.${command}`, params);
|
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/get-all-args.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;;;QAG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rC;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};\n\nexport enum BaseServiceCommands {\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","import { FilterQuery } from 'mongoose';\n\nexport type ISort = {\n key: string;\n value: ISortEnum;\n};\n\nexport enum ISortEnum {\n ASC = 'ASC',\n DESC = 'DESC'\n}\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 { Context, ServiceSchema } from 'moleculer';\nimport { Document, FilterQuery } from 'mongoose';\nimport { BaseServiceCommands, GetAllArgs, IBaseService } from '../interfaces';\n\nexport const BaseServiceMixin = <T, C, U>(service: IBaseService<T, C, U>): Partial<ServiceSchema> => ({\n name: 'BaseServiceMixin',\n actions: {\n [BaseServiceCommands.get]: {\n params: {\n id: 'string',\n },\n handler: async (ctx: Context<{ id: string }>) => service.get(ctx.params.id),\n },\n [BaseServiceCommands.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 [BaseServiceCommands.bulkCreate]: {\n params: {\n data: { type: 'array', items: 'object' },\n },\n handler: async (ctx: Context<{ data: never[] }>) => service.bulkCreate(ctx.params.data),\n },\n [BaseServiceCommands.create]: {\n params: {\n data: 'object',\n },\n handler: async (ctx: Context<{ data: never }>) => service.create(ctx.params.data),\n },\n [BaseServiceCommands.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 [BaseServiceCommands.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 [BaseServiceCommands.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 [BaseServiceCommands.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 [BaseServiceCommands.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 { BaseServiceCommands, 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[] }>(BaseServiceCommands.bulkCreate, { data });\n }\n\n count(criteria?: FilterQuery<Document>): MethodResponse<T, C, U, 'count'> {\n return this.callAction(BaseServiceCommands.count, { criteria });\n }\n\n create(data: C): MethodResponse<T, C, U, 'create'> {\n return this.callAction(BaseServiceCommands.create, { data });\n }\n\n delete(id: string | FilterQuery<Document>): MethodResponse<T, C, U, 'delete'> {\n return this.callAction(BaseServiceCommands.delete, { id });\n }\n\n get(id?: string | FilterQuery<Document>): MethodResponse<T, C, U, 'get'> {\n return this.callAction(BaseServiceCommands.get, { id });\n }\n\n getAll(options?: GetAllArgs<Document>): MethodResponse<T, C, U, 'getAll'> {\n return this.callAction(BaseServiceCommands.getAll, options);\n }\n\n getByIds(ids: string[]): Promise<T[]> {\n return this.callAction(BaseServiceCommands.getByIds, { ids });\n }\n\n getAllWithCount(options: GetAllArgs<Document>): MethodResponse<T, C, U, 'getAllWithCount'> {\n return this.callAction(BaseServiceCommands.getAllWithCount, options);\n }\n\n insert(data: C | U, overwrite?: boolean): MethodResponse<T, C, U, 'insert'> {\n return this.callAction(BaseServiceCommands.insert, { data, overwrite });\n }\n\n update(id: string, data: U, overwrite?: boolean): MethodResponse<T, C, U, 'update'> {\n return this.callAction<T>(BaseServiceCommands.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,"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;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;;;;;;;;;;;;;;;;;;;;;;;;;AClFA,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,sBAAU,EAAE;IAGJ,gCAAS,EAAE;GAFP,cAAc,CAU1B;AAVY,wCAAc;;;;;;;;;;;;;;;;;;;;;;;;;ACL3B,4GAAkC;;;;;;;;;;;;;;;;;;;;;;;;;ACAlC,gHAAs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,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;aAC7E;YACD,OAAO,CAAC,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,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":""}
|
|
@@ -17,8 +17,21 @@ export declare type Scalars = {
|
|
|
17
17
|
Boolean: boolean;
|
|
18
18
|
Int: number;
|
|
19
19
|
Float: number;
|
|
20
|
+
AnyObject: any;
|
|
21
|
+
Date: any;
|
|
22
|
+
DateTime: any;
|
|
23
|
+
JSON: any;
|
|
24
|
+
JSONObject: any;
|
|
25
|
+
Observable: any;
|
|
26
|
+
Time: any;
|
|
27
|
+
URI: any;
|
|
28
|
+
URIInput: any;
|
|
20
29
|
};
|
|
21
|
-
export declare
|
|
30
|
+
export declare type IAdminIdeSettings = {
|
|
31
|
+
__typename?: 'AdminIdeSettings';
|
|
32
|
+
dummy?: Maybe<Scalars['Int']>;
|
|
33
|
+
};
|
|
34
|
+
export declare enum IBaseServiceCommands {
|
|
22
35
|
count = "count",
|
|
23
36
|
get = "get",
|
|
24
37
|
getAll = "getAll",
|
|
@@ -30,3 +43,54 @@ export declare enum BaseServiceCommands {
|
|
|
30
43
|
delete = "delete",
|
|
31
44
|
getAllWithCount = "getAllWithCount"
|
|
32
45
|
}
|
|
46
|
+
export declare enum ICacheControlScope {
|
|
47
|
+
PUBLIC = "PUBLIC",
|
|
48
|
+
PRIVATE = "PRIVATE"
|
|
49
|
+
}
|
|
50
|
+
/** Represents a null return value. */
|
|
51
|
+
export declare type IEmptyResponse = {
|
|
52
|
+
__typename?: 'EmptyResponse';
|
|
53
|
+
alwaysNil?: Maybe<Scalars['String']>;
|
|
54
|
+
};
|
|
55
|
+
export declare type IFieldError = {
|
|
56
|
+
__typename?: 'FieldError';
|
|
57
|
+
field: Scalars['String'];
|
|
58
|
+
message: Scalars['String'];
|
|
59
|
+
};
|
|
60
|
+
/** All Moleculer Topic names are extended from this. */
|
|
61
|
+
export declare enum IMoleculerServiceName {
|
|
62
|
+
dummy = "dummy"
|
|
63
|
+
}
|
|
64
|
+
export declare type IMutation = {
|
|
65
|
+
__typename?: 'Mutation';
|
|
66
|
+
dummy?: Maybe<Scalars['Int']>;
|
|
67
|
+
};
|
|
68
|
+
/** An object with an ID. */
|
|
69
|
+
export declare type INode = {
|
|
70
|
+
/** The ID of the node. */
|
|
71
|
+
id: Scalars['ID'];
|
|
72
|
+
};
|
|
73
|
+
export declare type IPageInfo = {
|
|
74
|
+
__typename?: 'PageInfo';
|
|
75
|
+
hasNextPage: Scalars['Boolean'];
|
|
76
|
+
};
|
|
77
|
+
export declare type IQuery = {
|
|
78
|
+
__typename?: 'Query';
|
|
79
|
+
/** Looks up a node by ID. */
|
|
80
|
+
node?: Maybe<INode>;
|
|
81
|
+
};
|
|
82
|
+
export declare type IQuerynodeArgs = {
|
|
83
|
+
id: Scalars['ID'];
|
|
84
|
+
};
|
|
85
|
+
export declare type ISort = {
|
|
86
|
+
key: Scalars['String'];
|
|
87
|
+
value: ISortEnum;
|
|
88
|
+
};
|
|
89
|
+
export declare enum ISortEnum {
|
|
90
|
+
ASC = "ASC",
|
|
91
|
+
DESC = "DESC"
|
|
92
|
+
}
|
|
93
|
+
export declare type ISubscription = {
|
|
94
|
+
__typename?: 'Subscription';
|
|
95
|
+
dummy?: Maybe<Scalars['Int']>;
|
|
96
|
+
};
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { FilterQuery } from 'mongoose';
|
|
2
|
-
|
|
3
|
-
key: string;
|
|
4
|
-
value: ISortEnum;
|
|
5
|
-
};
|
|
6
|
-
export declare enum ISortEnum {
|
|
7
|
-
ASC = "ASC",
|
|
8
|
-
DESC = "DESC"
|
|
9
|
-
}
|
|
2
|
+
import { ISort } from './generated-models';
|
|
10
3
|
export interface GetAllArgs<T> {
|
|
11
4
|
criteria?: FilterQuery<T>;
|
|
12
5
|
sort?: ISort;
|
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.8",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"typescript": {
|
|
32
32
|
"definition": "lib/index.d.ts"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "d3dede25f08437855fdc6f2e829a5e9bb825f348"
|
|
35
35
|
}
|