@sdflc/backend-helpers 1.0.72 → 1.0.73
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/build/BaseGateway.d.ts +4 -1
- package/build/BaseGateway.js +12 -1
- package/package.json +1 -1
package/build/BaseGateway.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DateTimeHelpers, Logger } from '@sdflc/utils';
|
|
2
|
-
import { ApiContext, BaseGatewayPropsInterface, BuildListQueryArgsInterface, ListArgsInterface } from './interfaces';
|
|
2
|
+
import { ApiContext, BaseGatewayPropsInterface, BuildListQueryArgsInterface, CacheInterface, ListArgsInterface, LoaderInterface } from './interfaces';
|
|
3
3
|
import { Database } from './Database';
|
|
4
4
|
declare class BaseGateway {
|
|
5
5
|
protected config: BaseGatewayPropsInterface;
|
|
@@ -8,7 +8,10 @@ declare class BaseGateway {
|
|
|
8
8
|
protected dateTime: DateTimeHelpers;
|
|
9
9
|
protected dateTimeNow: Date;
|
|
10
10
|
constructor(props: BaseGatewayPropsInterface);
|
|
11
|
+
getConfig(): BaseGatewayPropsInterface;
|
|
11
12
|
setConfigPart(props: BaseGatewayPropsInterface): this;
|
|
13
|
+
setLoader(loader: LoaderInterface): this;
|
|
14
|
+
setLoaderConfig(config: CacheInterface): this;
|
|
12
15
|
generateId(args?: any): Promise<string>;
|
|
13
16
|
onListFilter(query: any, filterParams: any): Promise<void>;
|
|
14
17
|
onUpdateFilter(query: any, filterParams: any): Promise<number>;
|
package/build/BaseGateway.js
CHANGED
|
@@ -15,11 +15,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.BaseGateway = void 0;
|
|
16
16
|
const uuid_1 = require("uuid");
|
|
17
17
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
18
|
+
const check_types_1 = __importDefault(require("check-types"));
|
|
18
19
|
const lodash_1 = require("lodash");
|
|
19
20
|
const utils_1 = require("@sdflc/utils");
|
|
20
21
|
const DataCache_1 = require("./DataCache");
|
|
21
22
|
const constants_1 = require("./constants");
|
|
22
|
-
const check_types_1 = __importDefault(require("check-types"));
|
|
23
23
|
const DEFAULT_CHUNCK_SIZE = 2500;
|
|
24
24
|
class BaseGateway {
|
|
25
25
|
constructor(props) {
|
|
@@ -42,10 +42,21 @@ class BaseGateway {
|
|
|
42
42
|
this.logger = (props === null || props === void 0 ? void 0 : props.logger) instanceof utils_1.Logger ? props.logger : new utils_1.Logger({ level: utils_1.LoggerLevels.WARNING });
|
|
43
43
|
this.loader = check_types_1.default.function((_c = this.config) === null || _c === void 0 ? void 0 : _c.loader) ? this.config.loader : new DataCache_1.DataCache(this.config);
|
|
44
44
|
}
|
|
45
|
+
getConfig() {
|
|
46
|
+
return this.config;
|
|
47
|
+
}
|
|
45
48
|
setConfigPart(props) {
|
|
46
49
|
Object.assign(this.config, props);
|
|
47
50
|
return this;
|
|
48
51
|
}
|
|
52
|
+
setLoader(loader) {
|
|
53
|
+
this.loader = loader;
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
setLoaderConfig(config) {
|
|
57
|
+
this.loader = new DataCache_1.DataCache(Object.assign(Object.assign({}, this.config), config));
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
49
60
|
// eslint-disable-next-line
|
|
50
61
|
generateId(args) {
|
|
51
62
|
return __awaiter(this, void 0, void 0, function* () {
|
package/package.json
CHANGED