@common-stack/store-mongo 7.2.1-alpha.0 → 7.2.1-alpha.10
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/module.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { FilterQuery } from 'mongoose';
|
|
|
3
3
|
import { CdmLogger } from '@cdm-logger/core';
|
|
4
4
|
import { GetAllArgs, IBaseService, AsDomainType, CreateType, UpdateType } from 'common/server';
|
|
5
5
|
export declare abstract class BaseProxyService2<SchemaType> implements IBaseService<SchemaType> {
|
|
6
|
-
|
|
6
|
+
protected readonly broker: ServiceBroker;
|
|
7
7
|
protected abstract logger?: CdmLogger.ILogger;
|
|
8
8
|
protected abstract topic: string;
|
|
9
9
|
constructor(broker: ServiceBroker, logger: CdmLogger.ILogger);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseProxyService.js","sources":["../../src/services/BaseProxyService.ts"],"sourcesContent":["/* eslint-disable import/no-unresolved */\n/* eslint-disable import/no-extraneous-dependencies */\n/* eslint-disable no-useless-constructor */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-empty-function */\nimport { inject, injectable, optional } from 'inversify';\nimport { ServiceBroker } from 'moleculer';\nimport { FilterQuery } from 'mongoose';\nimport { CdmLogger } from '@cdm-logger/core';\nimport { CommonType } from '@common-stack/core';\nimport { GetAllArgs, IBaseService, AsDomainType, CreateType, UpdateType, BaseServiceCommands } from 'common/server';\n\n@injectable()\nexport abstract class BaseProxyService2<SchemaType> implements IBaseService<SchemaType> {\n protected abstract logger?: CdmLogger.ILogger;\n\n protected abstract topic: string;\n\n constructor(\n @inject(CommonType.MOLECULER_BROKER)\n
|
|
1
|
+
{"version":3,"file":"BaseProxyService.js","sources":["../../src/services/BaseProxyService.ts"],"sourcesContent":["/* eslint-disable import/no-unresolved */\n/* eslint-disable import/no-extraneous-dependencies */\n/* eslint-disable no-useless-constructor */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-empty-function */\nimport { inject, injectable, optional } from 'inversify';\nimport { ServiceBroker } from 'moleculer';\nimport { FilterQuery } from 'mongoose';\nimport { CdmLogger } from '@cdm-logger/core';\nimport { CommonType } from '@common-stack/core';\nimport { GetAllArgs, IBaseService, AsDomainType, CreateType, UpdateType, BaseServiceCommands } from 'common/server';\n\n@injectable()\nexport abstract class BaseProxyService2<SchemaType> implements IBaseService<SchemaType> {\n protected abstract logger?: CdmLogger.ILogger;\n\n protected abstract topic: string;\n\n constructor(\n @inject(CommonType.MOLECULER_BROKER)\n protected readonly broker: ServiceBroker,\n @inject(CommonType.LOGGER)\n @optional()\n logger: CdmLogger.ILogger,\n ) {}\n\n getByName(name: string): Promise<AsDomainType<SchemaType> | null> {\n return this.callAction(BaseServiceCommands.GetByName, { name });\n }\n\n bulkCreate<T = CreateType<SchemaType>>(data: T[]): Promise<AsDomainType<SchemaType>[]> {\n return this.callAction(BaseServiceCommands.BulkCreate, { data });\n }\n\n count(criteria?: FilterQuery<SchemaType>): Promise<number> {\n return this.callAction(BaseServiceCommands.Count, { criteria });\n }\n\n create<T = CreateType<SchemaType>>(data: T): Promise<AsDomainType<SchemaType>> {\n return this.callAction(BaseServiceCommands.Create, { data });\n }\n\n delete(id: string | FilterQuery<SchemaType>): Promise<boolean> {\n return this.callAction(BaseServiceCommands.Delete, { id });\n }\n\n bulkDelete(criteria: FilterQuery<SchemaType>): Promise<number> {\n return this.callAction(BaseServiceCommands.BulkDelete, { criteria });\n }\n\n get(id?: string | FilterQuery<SchemaType>): Promise<AsDomainType<SchemaType> | null> {\n return this.callAction(BaseServiceCommands.Get, { id });\n }\n\n getAll(options?: GetAllArgs<SchemaType>): Promise<AsDomainType<SchemaType>[]> {\n return this.callAction(BaseServiceCommands.GetAll, options);\n }\n\n getByIds(ids: string[]): Promise<AsDomainType<SchemaType>[]> {\n return this.callAction(BaseServiceCommands.GetByIds, { ids });\n }\n\n getAllWithCount(options: GetAllArgs<SchemaType>): Promise<{\n data: AsDomainType<SchemaType>[];\n totalCount: number;\n }> {\n return this.callAction(BaseServiceCommands.GetAllWithCount, options);\n }\n\n insert<T = CreateType<SchemaType>>(\n data: T & { id?: string },\n overwrite?: boolean,\n ): Promise<AsDomainType<SchemaType>> {\n return this.callAction(BaseServiceCommands.Insert, { data, overwrite });\n }\n\n update<T = UpdateType<SchemaType>>(id: string, data: T, overwrite?: boolean): Promise<AsDomainType<SchemaType>> {\n return this.callAction(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"],"names":[],"mappings":"gQAasB,IAAA,iBAAiB,GAAhC,MAAe,iBAAiB,CAAA;AAOZ,IAAA,MAAA,CAAA;IAFvB,WAEuB,CAAA,MAAqB,EAGxC,MAAyB,EAAA;QAHN,IAAM,CAAA,MAAA,GAAN,MAAM,CAAe;KAIxC;AAEJ,IAAA,SAAS,CAAC,IAAY,EAAA;AAClB,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;KACnE;AAED,IAAA,UAAU,CAA6B,IAAS,EAAA;AAC5C,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;KACpE;AAED,IAAA,KAAK,CAAC,QAAkC,EAAA;AACpC,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;KACnE;AAED,IAAA,MAAM,CAA6B,IAAO,EAAA;AACtC,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;KAChE;AAED,IAAA,MAAM,CAAC,EAAoC,EAAA;AACvC,QAAA,OAAO,IA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IAAI,CAAC,KAAK,IAAI,OAAO,CAAA,CAAE,EAAE,MAAM,CAAC,CAAC;KACrE;EACJ;AAtEqB,iBAAiB,GAAA,UAAA,CAAA;AADtC,IAAA,UAAU,EAAE;AAOJ,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAA;AAEnC,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;IACzB,OAAA,CAAA,CAAA,EAAA,QAAQ,EAAE,CAAA;qCAFgB,aAAa,EAAA,MAAA,CAAA,CAAA;AAP1B,CAAA,EAAA,iBAAiB,CAsEtC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/store-mongo",
|
|
3
|
-
"version": "7.2.1-alpha.
|
|
3
|
+
"version": "7.2.1-alpha.10",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"watch": "npm run build:lib:watch"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@common-stack/core": "7.
|
|
27
|
+
"@common-stack/core": "7.2.1-alpha.10"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"common": "7.
|
|
30
|
+
"common": "7.2.1-alpha.5",
|
|
31
31
|
"moleculer": "^0.14.33",
|
|
32
32
|
"mongoose": "^6.12.8"
|
|
33
33
|
},
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"typescript": {
|
|
59
59
|
"definition": "lib/index.d.ts"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "05bb2c0157ad3a623351c08994b0eccc2609b7f0"
|
|
62
62
|
}
|