build
This commit is contained in:
parent
7dbef1ea51
commit
2f92571fdf
|
|
@ -1,4 +1,3 @@
|
||||||
/// <reference types="node" />
|
|
||||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
||||||
import { AppLoader as GeneralAppLoader, Trigger, EntityDict, Watcher, OpRecord, FreeTimer, OperationResult } from "oak-domain/lib/types";
|
import { AppLoader as GeneralAppLoader, Trigger, EntityDict, Watcher, OpRecord, FreeTimer, OperationResult } from "oak-domain/lib/types";
|
||||||
import { DbStore } from "./DbStore";
|
import { DbStore } from "./DbStore";
|
||||||
|
|
@ -38,9 +37,9 @@ export declare class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt exten
|
||||||
initialize(ifExists?: 'drop' | 'omit' | 'dropIfNotStatic'): Promise<void>;
|
initialize(ifExists?: 'drop' | 'omit' | 'dropIfNotStatic'): Promise<void>;
|
||||||
getStore(): DbStore<ED, Cxt>;
|
getStore(): DbStore<ED, Cxt>;
|
||||||
getEndpoints(prefix: string): [string, "post" | "get" | "put" | "delete", string, (params: Record<string, string>, headers: IncomingHttpHeaders, req: IncomingMessage, body?: any) => Promise<{
|
getEndpoints(prefix: string): [string, "post" | "get" | "put" | "delete", string, (params: Record<string, string>, headers: IncomingHttpHeaders, req: IncomingMessage, body?: any) => Promise<{
|
||||||
headers?: Record<string, string | string[]> | undefined;
|
headers?: Record<string, string | string[]>;
|
||||||
data: any;
|
data: any;
|
||||||
statusCode?: number | undefined;
|
statusCode?: number;
|
||||||
}>][];
|
}>][];
|
||||||
protected operateInWatcher<T extends keyof ED>(entity: T, operation: ED[T]['Update'], context: Cxt, singleton?: true): Promise<OperationResult<ED>>;
|
protected operateInWatcher<T extends keyof ED>(entity: T, operation: ED[T]['Update'], context: Cxt, singleton?: true): Promise<OperationResult<ED>>;
|
||||||
protected selectInWatcher<T extends keyof ED>(entity: T, selection: ED[T]['Selection'], context: Cxt, forUpdate?: true, singleton?: true): Promise<Partial<ED[T]["Schema"]>[]>;
|
protected selectInWatcher<T extends keyof ED>(entity: T, selection: ED[T]['Selection'], context: Cxt, forUpdate?: true, singleton?: true): Promise<Partial<ED[T]["Schema"]>[]>;
|
||||||
|
|
|
||||||
|
|
@ -423,7 +423,7 @@ class AppLoader extends types_1.AppLoader {
|
||||||
console.log(`定时器【${name}】执行成功,耗时${Date.now() - start}毫秒】,结果是`, result);
|
console.log(`定时器【${name}】执行成功,耗时${Date.now() - start}毫秒】,结果是`, result);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.warn(`定时器【${name}】执行失败,耗时${Date.now() - start}毫秒】,错误是`, err);
|
console.error(`定时器【${name}】执行失败,耗时${Date.now() - start}毫秒】,错误是`, err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -436,7 +436,7 @@ class AppLoader extends types_1.AppLoader {
|
||||||
await context.commit();
|
await context.commit();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.warn(`定时器【${name}】执行失败,耗时${Date.now() - start}毫秒,错误是`, err);
|
console.error(`定时器【${name}】执行失败,耗时${Date.now() - start}毫秒,错误是`, err);
|
||||||
if (err instanceof types_1.OakPartialSuccess) {
|
if (err instanceof types_1.OakPartialSuccess) {
|
||||||
await context.commit();
|
await context.commit();
|
||||||
}
|
}
|
||||||
|
|
@ -468,7 +468,7 @@ class AppLoader extends types_1.AppLoader {
|
||||||
console.log(`例程【${routine.name}】执行成功,耗时${Date.now() - start}毫秒,结果是`, result);
|
console.log(`例程【${routine.name}】执行成功,耗时${Date.now() - start}毫秒,结果是`, result);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.warn(`例程【${routine.name}】执行失败,耗时${Date.now() - start}毫秒,错误是`, err);
|
console.error(`例程【${routine.name}】执行失败,耗时${Date.now() - start}毫秒,错误是`, err);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -484,7 +484,7 @@ class AppLoader extends types_1.AppLoader {
|
||||||
await context.commit();
|
await context.commit();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.warn(`例程【${name}】执行失败,耗时${Date.now() - start}毫秒,错误是`, err);
|
console.error(`例程【${name}】执行失败,耗时${Date.now() - start}毫秒,错误是`, err);
|
||||||
await context.rollback();
|
await context.rollback();
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export default class Synchronizer<ED extends EntityDict & BaseEntityDict, Cxt ex
|
||||||
* 根据sync的定义,生成对应的 commit triggers
|
* 根据sync的定义,生成对应的 commit triggers
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getSyncTriggers(): VolatileTrigger<ED, keyof ED, Cxt>[];
|
getSyncTriggers(): Array<VolatileTrigger<ED, keyof ED, Cxt>>;
|
||||||
getSelfEndpoint(): EndpointItem<ED, Cxt>;
|
getSelfEndpoint(): EndpointItem<ED, Cxt>;
|
||||||
tryCreateSyncProcess(): void;
|
tryCreateSyncProcess(): void;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ class Synchronizer {
|
||||||
remoteEntityId: entityId,
|
remoteEntityId: entityId,
|
||||||
data: queue.map((ele) => ({
|
data: queue.map((ele) => ({
|
||||||
entity: ele.oper.targetEntity,
|
entity: ele.oper.targetEntity,
|
||||||
rowIds: ele.oper.filter.id.$in,
|
rowIds: ele.oper.filter.id.$in, // 暂时应该没什么用
|
||||||
action: ele.oper.action,
|
action: ele.oper.action,
|
||||||
data: ele.oper.data,
|
data: ele.oper.data,
|
||||||
})),
|
})),
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.getClusterInfo = void 0;
|
exports.getClusterInfo = getClusterInfo;
|
||||||
function getProcessEnvOption(option) {
|
function getProcessEnvOption(option) {
|
||||||
if (process.env.hasOwnProperty(option)) {
|
if (process.env.hasOwnProperty(option)) {
|
||||||
return process.env[option];
|
return process.env[option];
|
||||||
|
|
@ -54,4 +54,3 @@ const MyClusterInfo = initialize();
|
||||||
function getClusterInfo() {
|
function getClusterInfo() {
|
||||||
return MyClusterInfo;
|
return MyClusterInfo;
|
||||||
}
|
}
|
||||||
exports.getClusterInfo = getClusterInfo;
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.checkAndUpdateI18n = exports.checkI18n = void 0;
|
exports.checkI18n = checkI18n;
|
||||||
|
exports.checkAndUpdateI18n = checkAndUpdateI18n;
|
||||||
const tslib_1 = require("tslib");
|
const tslib_1 = require("tslib");
|
||||||
const node_path_1 = require("node:path");
|
const node_path_1 = require("node:path");
|
||||||
const requirePrj_1 = tslib_1.__importDefault(require("../utils/requirePrj"));
|
const requirePrj_1 = tslib_1.__importDefault(require("../utils/requirePrj"));
|
||||||
|
|
@ -66,7 +67,6 @@ async function checkAndUpdateI18nInner(context, onlyCheck) {
|
||||||
function checkI18n(context) {
|
function checkI18n(context) {
|
||||||
return checkAndUpdateI18nInner(context, true);
|
return checkAndUpdateI18nInner(context, true);
|
||||||
}
|
}
|
||||||
exports.checkI18n = checkI18n;
|
|
||||||
/**
|
/**
|
||||||
* 检查项目目录下的i18n数据和数据库中的差异,并更新
|
* 检查项目目录下的i18n数据和数据库中的差异,并更新
|
||||||
* @param context
|
* @param context
|
||||||
|
|
@ -75,4 +75,3 @@ exports.checkI18n = checkI18n;
|
||||||
function checkAndUpdateI18n(context) {
|
function checkAndUpdateI18n(context) {
|
||||||
return checkAndUpdateI18nInner(context);
|
return checkAndUpdateI18nInner(context);
|
||||||
}
|
}
|
||||||
exports.checkAndUpdateI18n = checkAndUpdateI18n;
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.default = requireSth;
|
||||||
const fs_1 = require("fs");
|
const fs_1 = require("fs");
|
||||||
const lodash_1 = require("oak-domain/lib/utils/lodash");
|
const lodash_1 = require("oak-domain/lib/utils/lodash");
|
||||||
const path_1 = require("path");
|
const path_1 = require("path");
|
||||||
|
|
@ -20,4 +21,3 @@ function requireSth(prjPath, filePath, dependencies) {
|
||||||
}
|
}
|
||||||
return (0, lodash_1.mergeConcatMany)(sthExternal);
|
return (0, lodash_1.mergeConcatMany)(sthExternal);
|
||||||
}
|
}
|
||||||
exports.default = requireSth;
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue