oak-backend-base 4.1.22 → 4.1.23
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/AppLoader.d.ts +2 -3
- package/lib/AppLoader.js +4 -4
- package/lib/Synchronizer.d.ts +1 -1
- package/lib/Synchronizer.js +1 -1
- package/lib/cluster/env.js +1 -2
- package/lib/routines/i18n.js +2 -3
- package/lib/utils/requirePrj.js +1 -1
- package/package.json +1 -1
package/lib/AppLoader.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
|
3
2
|
import { AppLoader as GeneralAppLoader, Trigger, EntityDict, Watcher, OpRecord, FreeTimer, OperationResult } from "oak-domain/lib/types";
|
|
4
3
|
import { DbStore } from "./DbStore";
|
|
@@ -38,9 +37,9 @@ export declare class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt exten
|
|
|
38
37
|
initialize(ifExists?: 'drop' | 'omit' | 'dropIfNotStatic'): Promise<void>;
|
|
39
38
|
getStore(): DbStore<ED, Cxt>;
|
|
40
39
|
getEndpoints(prefix: string): [string, "post" | "get" | "put" | "delete", string, (params: Record<string, string>, headers: IncomingHttpHeaders, req: IncomingMessage, body?: any) => Promise<{
|
|
41
|
-
headers?: Record<string, string | string[]
|
|
40
|
+
headers?: Record<string, string | string[]>;
|
|
42
41
|
data: any;
|
|
43
|
-
statusCode?: number
|
|
42
|
+
statusCode?: number;
|
|
44
43
|
}>][];
|
|
45
44
|
protected operateInWatcher<T extends keyof ED>(entity: T, operation: ED[T]['Update'], context: Cxt, singleton?: true): Promise<OperationResult<ED>>;
|
|
46
45
|
protected selectInWatcher<T extends keyof ED>(entity: T, selection: ED[T]['Selection'], context: Cxt, forUpdate?: true, singleton?: true): Promise<Partial<ED[T]["Schema"]>[]>;
|
package/lib/AppLoader.js
CHANGED
|
@@ -423,7 +423,7 @@ class AppLoader extends types_1.AppLoader {
|
|
|
423
423
|
console.log(`定时器【${name}】执行成功,耗时${Date.now() - start}毫秒】,结果是`, result);
|
|
424
424
|
}
|
|
425
425
|
catch (err) {
|
|
426
|
-
console.
|
|
426
|
+
console.error(`定时器【${name}】执行失败,耗时${Date.now() - start}毫秒】,错误是`, err);
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
429
|
else {
|
|
@@ -436,7 +436,7 @@ class AppLoader extends types_1.AppLoader {
|
|
|
436
436
|
await context.commit();
|
|
437
437
|
}
|
|
438
438
|
catch (err) {
|
|
439
|
-
console.
|
|
439
|
+
console.error(`定时器【${name}】执行失败,耗时${Date.now() - start}毫秒,错误是`, err);
|
|
440
440
|
if (err instanceof types_1.OakPartialSuccess) {
|
|
441
441
|
await context.commit();
|
|
442
442
|
}
|
|
@@ -468,7 +468,7 @@ class AppLoader extends types_1.AppLoader {
|
|
|
468
468
|
console.log(`例程【${routine.name}】执行成功,耗时${Date.now() - start}毫秒,结果是`, result);
|
|
469
469
|
}
|
|
470
470
|
catch (err) {
|
|
471
|
-
console.
|
|
471
|
+
console.error(`例程【${routine.name}】执行失败,耗时${Date.now() - start}毫秒,错误是`, err);
|
|
472
472
|
throw err;
|
|
473
473
|
}
|
|
474
474
|
}
|
|
@@ -484,7 +484,7 @@ class AppLoader extends types_1.AppLoader {
|
|
|
484
484
|
await context.commit();
|
|
485
485
|
}
|
|
486
486
|
catch (err) {
|
|
487
|
-
console.
|
|
487
|
+
console.error(`例程【${name}】执行失败,耗时${Date.now() - start}毫秒,错误是`, err);
|
|
488
488
|
await context.rollback();
|
|
489
489
|
throw err;
|
|
490
490
|
}
|
package/lib/Synchronizer.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export default class Synchronizer<ED extends EntityDict & BaseEntityDict, Cxt ex
|
|
|
27
27
|
* 根据sync的定义,生成对应的 commit triggers
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
|
-
getSyncTriggers(): VolatileTrigger<ED, keyof ED, Cxt
|
|
30
|
+
getSyncTriggers(): Array<VolatileTrigger<ED, keyof ED, Cxt>>;
|
|
31
31
|
getSelfEndpoint(): EndpointItem<ED, Cxt>;
|
|
32
32
|
tryCreateSyncProcess(): void;
|
|
33
33
|
}
|
package/lib/Synchronizer.js
CHANGED
|
@@ -114,7 +114,7 @@ class Synchronizer {
|
|
|
114
114
|
remoteEntityId: entityId,
|
|
115
115
|
data: queue.map((ele) => ({
|
|
116
116
|
entity: ele.oper.targetEntity,
|
|
117
|
-
rowIds: ele.oper.filter.id.$in,
|
|
117
|
+
rowIds: ele.oper.filter.id.$in, // 暂时应该没什么用
|
|
118
118
|
action: ele.oper.action,
|
|
119
119
|
data: ele.oper.data,
|
|
120
120
|
})),
|
package/lib/cluster/env.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getClusterInfo =
|
|
3
|
+
exports.getClusterInfo = getClusterInfo;
|
|
4
4
|
function getProcessEnvOption(option) {
|
|
5
5
|
if (process.env.hasOwnProperty(option)) {
|
|
6
6
|
return process.env[option];
|
|
@@ -54,4 +54,3 @@ const MyClusterInfo = initialize();
|
|
|
54
54
|
function getClusterInfo() {
|
|
55
55
|
return MyClusterInfo;
|
|
56
56
|
}
|
|
57
|
-
exports.getClusterInfo = getClusterInfo;
|
package/lib/routines/i18n.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.checkI18n = checkI18n;
|
|
4
|
+
exports.checkAndUpdateI18n = checkAndUpdateI18n;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const node_path_1 = require("node:path");
|
|
6
7
|
const requirePrj_1 = tslib_1.__importDefault(require("../utils/requirePrj"));
|
|
@@ -66,7 +67,6 @@ async function checkAndUpdateI18nInner(context, onlyCheck) {
|
|
|
66
67
|
function checkI18n(context) {
|
|
67
68
|
return checkAndUpdateI18nInner(context, true);
|
|
68
69
|
}
|
|
69
|
-
exports.checkI18n = checkI18n;
|
|
70
70
|
/**
|
|
71
71
|
* 检查项目目录下的i18n数据和数据库中的差异,并更新
|
|
72
72
|
* @param context
|
|
@@ -75,4 +75,3 @@ exports.checkI18n = checkI18n;
|
|
|
75
75
|
function checkAndUpdateI18n(context) {
|
|
76
76
|
return checkAndUpdateI18nInner(context);
|
|
77
77
|
}
|
|
78
|
-
exports.checkAndUpdateI18n = checkAndUpdateI18n;
|
package/lib/utils/requirePrj.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = requireSth;
|
|
3
4
|
const fs_1 = require("fs");
|
|
4
5
|
const lodash_1 = require("oak-domain/lib/utils/lodash");
|
|
5
6
|
const path_1 = require("path");
|
|
@@ -20,4 +21,3 @@ function requireSth(prjPath, filePath, dependencies) {
|
|
|
20
21
|
}
|
|
21
22
|
return (0, lodash_1.mergeConcatMany)(sthExternal);
|
|
22
23
|
}
|
|
23
|
-
exports.default = requireSth;
|