修改了exception的i18n设计

This commit is contained in:
Xu Chang 2025-01-21 12:51:02 +08:00
parent eec5230ee6
commit 73858ded4f
43 changed files with 1042 additions and 177 deletions

View File

@ -0,0 +1,44 @@
import { ForeignKey, JsonProjection } from "../../types/DataType";
import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, ExprOp, ExpressionKey, JsonFilter } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { GenericAction } from "../../actions/action";
type Actions = string[];
export type OpSchema = EntityShape & {
relationId?: ForeignKey<"relation"> | null;
pathId: ForeignKey<"path">;
deActions: Actions;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
relationId: Q_StringValue;
pathId: Q_StringValue;
deActions: JsonFilter<Actions>;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
relationId?: number;
pathId?: number;
deActions?: number | JsonProjection<Actions>;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
deActions: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<GenericAction | string>;
export type OpUpdateAction = "update" | string;
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,51 @@
import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, ExprOp, ExpressionKey } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { GenericAction } from "../../actions/action";
import { String } from "../../types/DataType";
export type OpSchema = EntityShape & {
module: String<64>;
position: String<188>;
namespace: String<256>;
language: String<32>;
data: Object;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
module: Q_StringValue;
position: Q_StringValue;
namespace: Q_StringValue;
language: Q_StringValue;
data: Object;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
module?: number;
position?: number;
namespace?: number;
language?: number;
data?: number | Object;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
module: number;
position: number;
namespace: number;
language: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<GenericAction | string>;
export type OpUpdateAction = "update" | string;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,44 @@
import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, ExprOp, ExpressionKey } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { Action, ParticularAction } from "./Action";
import { String } from "../../types/DataType";
export type OpSchema = EntityShape & {
entity: String<32>;
entityId: String<64>;
iState: "normal" | "rollbacked";
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
entity: Q_StringValue;
entityId: Q_StringValue;
iState: Q_EnumValue<"normal" | "rollbacked">;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
entity?: number;
entityId?: number;
iState?: number;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
entity: number;
entityId: number;
iState: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<Action | string>;
export type OpUpdateAction = "update" | ParticularAction | string;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,61 @@
import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, ExprOp, ExpressionKey } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { Action, ParticularAction, IState } from "./Action";
import { String } from "../../types/DataType";
export type OpSchema = EntityShape & {
targetEntity: String<32>;
entity: String<32>;
entityId: String<64>;
action: String<24>;
data: Object;
filter?: Object | null;
extra?: Object | null;
iState?: IState | null;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
targetEntity: Q_StringValue;
entity: Q_StringValue;
entityId: Q_StringValue;
action: Q_StringValue;
data: Object;
filter: Object;
extra: Object;
iState: Q_EnumValue<IState>;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
targetEntity?: number;
entity?: number;
entityId?: number;
action?: number;
data?: number | Object;
filter?: number | Object;
extra?: number | Object;
iState?: number;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
targetEntity: number;
entity: number;
entityId: number;
action: number;
iState: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<Action | string>;
export type OpUpdateAction = "update" | ParticularAction | string;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,44 @@
import { ForeignKey } from "../../types/DataType";
import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, ExprOp, ExpressionKey } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { AppendOnlyAction } from "../../actions/action";
import { String } from "../../types/DataType";
export type OpSchema = EntityShape & {
modiId: ForeignKey<"modi">;
entity: String<32>;
entityId: String<64>;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
modiId: Q_StringValue;
entity: Q_StringValue;
entityId: Q_StringValue;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
modiId?: number;
entity?: number;
entityId?: number;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
entity: number;
entityId: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<AppendOnlyAction | string>;
export type OpUpdateAction = "update" | string;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,67 @@
import { ForeignKey } from "../../types/DataType";
import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, ExprOp, ExpressionKey } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { Action, ParticularAction, IState } from "./Action";
import { String, Datetime } from "../../types/DataType";
export type OpSchema = EntityShape & {
action: String<24>;
data: Object;
filter?: Object | null;
extra?: Object | null;
operatorId?: ForeignKey<"user"> | null;
targetEntity: String<32>;
bornAt?: Datetime | null;
logId?: ForeignKey<"log"> | null;
undoData?: Object | null;
iState?: IState | null;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
action: Q_StringValue;
data: Object;
filter: Object;
extra: Object;
operatorId: Q_StringValue;
targetEntity: Q_StringValue;
bornAt: Q_DateValue;
logId: Q_StringValue;
undoData: Object;
iState: Q_EnumValue<IState>;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
action?: number;
data?: number | Object;
filter?: number | Object;
extra?: number | Object;
operatorId?: number;
targetEntity?: number;
bornAt?: number;
logId?: number;
undoData?: number | Object;
iState?: number;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
action: number;
targetEntity: number;
bornAt: number;
iState: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<Action | string>;
export type OpUpdateAction = "update" | ParticularAction | string;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,44 @@
import { ForeignKey } from "../../types/DataType";
import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, ExprOp, ExpressionKey } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { AppendOnlyAction } from "../../actions/action";
import { String } from "../../types/DataType";
export type OpSchema = EntityShape & {
operId: ForeignKey<"oper">;
entity: String<32>;
entityId: String<64>;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
operId: Q_StringValue;
entity: Q_StringValue;
entityId: Q_StringValue;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
operId?: number;
entity?: number;
entityId?: number;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
entity: number;
entityId: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<AppendOnlyAction | string>;
export type OpUpdateAction = "update" | string;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,52 @@
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, NodeId, ExprOp, ExpressionKey } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { GenericAction } from "../../actions/action";
import { String, Boolean } from "../../types/DataType";
export type OpSchema = EntityShape & {
destEntity: String<32>;
value: String<256>;
recursive: Boolean;
sourceEntity: String<32>;
desc?: String<256> | null;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
destEntity: Q_StringValue;
value: Q_StringValue;
recursive: Q_BooleanValue;
sourceEntity: Q_StringValue;
desc: Q_StringValue;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
destEntity?: number;
value?: number;
recursive?: number;
sourceEntity?: number;
desc?: number;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
destEntity: number;
value: number;
recursive: number;
sourceEntity: number;
desc: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<GenericAction | string>;
export type OpUpdateAction = "update" | string;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,48 @@
import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, ExprOp, ExpressionKey } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { GenericAction } from "../../actions/action";
import { String } from "../../types/DataType";
export type OpSchema = EntityShape & {
entity: String<32>;
entityId?: String<64> | null;
name?: String<32> | null;
display?: String<32> | null;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
entity: Q_StringValue;
entityId: Q_StringValue;
name: Q_StringValue;
display: Q_StringValue;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
entity?: number;
entityId?: number;
name?: number;
display?: number;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
entity: number;
entityId: number;
name: number;
display: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<GenericAction | string>;
export type OpUpdateAction = "update" | string;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,41 @@
import { ForeignKey } from "../../types/DataType";
import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, ExprOp, ExpressionKey } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { GenericAction } from "../../actions/action";
export type OpSchema = EntityShape & {
sourceRelationId: ForeignKey<"relation">;
pathId: ForeignKey<"path">;
destRelationId: ForeignKey<"relation">;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
sourceRelationId: Q_StringValue;
pathId: Q_StringValue;
destRelationId: Q_StringValue;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
sourceRelationId?: number;
pathId?: number;
destRelationId?: number;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<GenericAction | string>;
export type OpUpdateAction = "update" | string;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,53 @@
import { ForeignKey } from "../../types/DataType";
import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, ExprOp, ExpressionKey } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { Action, ParticularAction, UserState } from "./Action";
import { RelationAction } from "../../actions/action";
import { String, Text } from "../../types/DataType";
export type OpSchema = EntityShape & {
name?: String<16> | null;
nickname?: String<64> | null;
password?: Text | null;
refId?: ForeignKey<"user"> | null;
userState?: UserState | null;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
name: Q_StringValue;
nickname: Q_StringValue;
password: Q_StringValue;
refId: Q_StringValue;
userState: Q_EnumValue<UserState>;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
name?: number;
nickname?: number;
password?: number;
refId?: number;
userState?: number;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
name: number;
nickname: number;
password: number;
userState: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<Action | RelationAction | string>;
export type OpUpdateAction = "update" | ParticularAction | string;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,49 @@
import { ForeignKey } from "../../types/DataType";
import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, ExprOp, ExpressionKey } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { GenericAction } from "../../actions/action";
import { String } from "../../types/DataType";
export type OpSchema = EntityShape & {
uegId: ForeignKey<"userEntityGrant">;
userId: ForeignKey<"user">;
relationId: ForeignKey<"relation">;
claimEntityId: String<64>;
userRelationId: ForeignKey<"userRelation">;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
uegId: Q_StringValue;
userId: Q_StringValue;
relationId: Q_StringValue;
claimEntityId: Q_StringValue;
userRelationId: Q_StringValue;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
uegId?: number;
userId?: number;
relationId?: number;
claimEntityId?: number;
userRelationId?: number;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
claimEntityId: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<GenericAction | string>;
export type OpUpdateAction = "update" | string;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,46 @@
import { JsonProjection } from "../../types/DataType";
import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, ExprOp, ExpressionKey, JsonFilter } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { GenericAction } from "../../actions/action";
import { String } from "../../types/DataType";
type RelationIds = string[];
export type OpSchema = EntityShape & {
relationEntity: String<32>;
relationEntityFilter: Object;
relationIds: RelationIds;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
relationEntity: Q_StringValue;
relationEntityFilter: Object;
relationIds: JsonFilter<RelationIds>;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
relationEntity?: number;
relationEntityFilter?: number | Object;
relationIds?: number | JsonProjection<RelationIds>;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
relationEntity: number;
relationIds: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<GenericAction | string>;
export type OpUpdateAction = "update" | string;
export {};

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,47 @@
import { ForeignKey } from "../../types/DataType";
import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, ExprOp, ExpressionKey } from "../../types/Demand";
import { MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
import { GenericAction } from "../../actions/action";
import { String } from "../../types/DataType";
export type OpSchema = EntityShape & {
userId: ForeignKey<"user">;
relationId: ForeignKey<"relation">;
entity: String<32>;
entityId: String<64>;
} & {
[A in ExpressionKey]?: any;
};
export type OpAttr = keyof OpSchema;
export type OpFilter = {
id: Q_StringValue;
$$createAt$$: Q_DateValue;
$$seq$$: Q_NumberValue;
$$updateAt$$: Q_DateValue;
userId: Q_StringValue;
relationId: Q_StringValue;
entity: Q_StringValue;
entityId: Q_StringValue;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
userId?: number;
relationId?: number;
entity?: number;
entityId?: number;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
entity: number;
entityId: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<GenericAction | string>;
export type OpUpdateAction = "update" | string;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -9,6 +9,7 @@ export default class LocaleBuilder {
pwd: string;
locales: Record<string, [string, string, string, object]>;
hash: Hash;
projectName?: string;
constructor(asLib?: boolean);
/**
* locales输出成为data/i18n.ts中的数据

View File

@ -32,6 +32,7 @@ class LocaleBuilder {
pwd;
locales; // key: namespace, value: [module, position, language, data]
hash;
projectName;
constructor(asLib) {
const pwd = process.cwd();
this.pwd = pwd;
@ -52,8 +53,9 @@ class LocaleBuilder {
* 如果有Dependency需要引出来
*/
outputDataFile() {
const appDomainDir = this.projectName === 'oak-domain' ? 'base-app-domain' : 'oak-app-domain';
const statements = [
factory.createImportDeclaration(undefined, factory.createImportClause(false, undefined, factory.createNamedImports([factory.createImportSpecifier(false, factory.createIdentifier("CreateOperationData"), factory.createIdentifier("I18n"))])), factory.createStringLiteral("../oak-app-domain/I18n/Schema"), undefined)
factory.createImportDeclaration(undefined, factory.createImportClause(false, undefined, factory.createNamedImports([factory.createImportSpecifier(false, factory.createIdentifier("CreateOperationData"), factory.createIdentifier("I18n"))])), factory.createStringLiteral(`../${appDomainDir}/I18n/Schema`), undefined)
];
// 改为在初始化时合并
/* if (this.dependencies) {
@ -111,7 +113,11 @@ class LocaleBuilder {
/* } */
const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed });
const result = printer.printList(ts.ListFormat.SourceFileStatements, factory.createNodeArray(statements), ts.createSourceFile("someFileName.ts", "", ts.ScriptTarget.Latest, false, ts.ScriptKind.TS));
const filename = (0, path_1.join)(this.pwd, 'src', 'data', 'i18n.ts');
const dataDir = (0, path_1.join)(this.pwd, 'src', 'data');
if (!fs_1.default.existsSync(dataDir)) {
fs_1.default.mkdirSync(dataDir);
}
const filename = (0, path_1.join)(dataDir, 'i18n.ts');
const result2 = (0, string_1.unescapeUnicode)(`// 本文件为自动编译产生,请勿直接修改\n\n${result}`);
fs_1.default.writeFileSync(filename, result2, { flag: 'w' });
}
@ -168,6 +174,7 @@ class LocaleBuilder {
buildProject(root, src, watch) {
const packageJson = (0, path_1.join)(root, 'package.json');
const { name } = require(packageJson);
this.projectName = name;
const pagePath = (0, path_1.join)(src ? 'src' : 'es', 'pages');
const pageAbsolutePath = (0, path_1.join)(root, pagePath); //编译i18时font中的componentPath缺少根目录导致编译不出
if (fs_1.default.existsSync(pageAbsolutePath)) {

3
lib/data/i18n.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
import { CreateOperationData as I18n } from "../base-app-domain/I18n/Schema";
declare const i18ns: I18n[];
export default i18ns;

32
lib/data/i18n.js Normal file
View File

@ -0,0 +1,32 @@
"use strict";
// 本文件为自动编译产生,请勿直接修改
Object.defineProperty(exports, "__esModule", { value: true });
const i18ns = [
{
id: "78c237bf2064a36fe73d943ccbbe22d5",
namespace: "oak-domain-l-error",
language: "zh-CN",
module: "oak-domain",
position: "locales/error",
data: {
"requestTimeout": "请求超时",
"noRelationDef": "对象[%{entity}]的操作${%{action}}找不到有效的relation定义",
"rowUnexisted": "查询对象[%{entity}]时发现了空指针,请检查数据一致性",
"uniqViolation": "您更新的数据违反了唯一性约束",
"signatureFailed": "验签失败",
"attributesNull": "属性[%{attributes}]不允许为空",
"attributesCantUpdate": "属性[%{attributes}]不能更新",
"operationUnpermitted": "用户操作权限不足",
"dataInvisible": "用户查询权限不足",
"unLoggedIn": "用户未登录",
"rowLocked": "该行数据当前处于被锁定状态",
"congrentRowExists": "相同的行数据已经存在",
"deadlock": "发现死锁",
"preconditionUnset": "前置条件未满足",
"externalException": "外部接口调用异常",
"socketConnectException": "连接出现问题,请尝试刷新页面",
"importedDataParseError": "import的数据存在异常"
}
}
];
exports.default = i18ns;

View File

@ -1118,12 +1118,12 @@ class RelationAuth {
if (result instanceof Promise) {
return result.then((r) => {
if (!r) {
throw new types_1.OakUserInvisibleException(entity, operation);
throw new types_1.OakDataInvisibleException(entity, operation);
}
});
}
if (!result) {
throw new types_1.OakUserInvisibleException(entity, operation);
throw new types_1.OakDataInvisibleException(entity, operation);
}
}
else {
@ -1131,12 +1131,12 @@ class RelationAuth {
if (result instanceof Promise) {
return result.then((r) => {
if (!r) {
throw new types_1.OakUserUnpermittedException(entity, operation);
throw new types_1.OakOperationUnpermittedException(entity, operation);
}
});
}
if (!result) {
throw new types_1.OakUserUnpermittedException(entity, operation);
throw new types_1.OakOperationUnpermittedException(entity, operation);
}
}
}

View File

@ -3,12 +3,15 @@ import { EntityDict, OpRecord } from "./Entity";
import { EntityDict as BaseEntityDict } from '../base-app-domain';
export declare class OakException<ED extends EntityDict & BaseEntityDict> extends Error {
opRecords: OpRecord<ED>[];
constructor(message?: string);
namespace?: string;
params?: Record<string, any>;
constructor(message?: string, namespace?: string, params?: Record<string, any>);
addData<T extends keyof ED>(entity: T, rows: Partial<ED[T]['Schema']>[], schema: StorageSchema<ED>): void;
setOpRecords(opRecords: OpRecord<ED>[]): void;
getSerialData(): {
name: string;
message: string;
namespace: string | undefined;
opRecords: OpRecord<ED>[];
tag1: string | undefined;
tag2: boolean | undefined;
@ -20,7 +23,7 @@ export declare class OakException<ED extends EntityDict & BaseEntityDict> extend
tag3?: any;
}
export declare class OakRequestTimeoutException<ED extends EntityDict & BaseEntityDict> extends OakException<ED> {
constructor(message?: string);
constructor(message?: string, ns?: string, params?: Record<string, any>);
}
export declare class OakMakeSureByMySelfException<ED extends EntityDict & BaseEntityDict> extends OakException<ED> {
}
@ -31,7 +34,7 @@ export declare class OakDataException<ED extends EntityDict & BaseEntityDict> ex
export declare class OakNoRelationDefException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakDataException<ED> {
entity: T;
actions: ED[T]['Action'][];
constructor(entity: T, actions: ED[T]['Action'][], msg?: string);
constructor(entity: T, actions: ED[T]['Action'][], msg?: string, namespace?: string, params?: Record<string, any>);
toString(): string;
}
export declare class OakOperExistedException<ED extends EntityDict & BaseEntityDict> extends OakDataException<ED> {
@ -41,7 +44,7 @@ export declare class OakRowUnexistedException<ED extends EntityDict & BaseEntity
constructor(rows: Array<{
entity: any;
selection: any;
}>);
}>, msg?: string, namespace?: string, params?: Record<string, any>);
toString(): string;
getRows(): {
entity: any;
@ -61,12 +64,12 @@ export declare class OakUniqueViolationException<ED extends EntityDict & BaseEnt
constructor(rows: Array<{
id?: string;
attrs: string[];
}>, message?: string);
}>, message?: string, namespace?: string, params?: Record<string, any>);
}
export declare class OakImportDataParseException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
line: number;
header?: string;
constructor(message: string, line: number, header?: string);
constructor(message: string, line: number, header?: string, namespace?: string, params?: Record<string, any>);
}
/**
*
@ -78,7 +81,7 @@ export declare class OakServerProxyException<ED extends EntityDict & BaseEntityD
export declare class OakClockDriftException<ED extends EntityDict & BaseEntityDict> extends OakException<ED> {
}
export declare class OakSignatureVerificationException<ED extends EntityDict & BaseEntityDict> extends OakException<ED> {
constructor(message?: string);
constructor(message?: string, namespace?: string, params?: Record<string, any>);
}
/**
*
@ -93,7 +96,7 @@ export declare class OakRowInconsistencyException<ED extends EntityDict & BaseEn
export declare class OakInputIllegalException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
private attributes;
private entity;
constructor(entity: keyof ED, attributes: string[], message?: string);
constructor(entity: keyof ED, attributes: string[], message?: string, namespace?: string, params?: Record<string, any>);
getEntity(): keyof ED;
getAttributes(): string[];
addAttributesPrefix(prefix: string): void;
@ -103,43 +106,43 @@ export declare class OakInputIllegalException<ED extends EntityDict & BaseEntity
*
*/
export declare class OakAttrNotNullException<ED extends EntityDict & BaseEntityDict> extends OakInputIllegalException<ED> {
constructor(entity: keyof ED, attributes: string[], message?: string);
constructor(entity: keyof ED, attributes: string[], message?: string, namespace?: string, params?: Record<string, any>);
}
/**
* update时对应属性的露出
*/
export declare class OakAttrCantUpdateException<ED extends EntityDict & BaseEntityDict> extends OakInputIllegalException<ED> {
constructor(entity: keyof ED, attributes: string[], message?: string);
constructor(entity: keyof ED, attributes: string[], message?: string, namespace?: string, params?: Record<string, any>);
}
/**
*
*/
export declare class OakUserUnpermittedException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
export declare class OakOperationUnpermittedException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
private entity;
private operation;
constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string);
constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string, namespace?: string, params?: Record<string, any>);
toString(): string;
}
/**
*
*/
export declare class OakUserInvisibleException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
export declare class OakDataInvisibleException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
private entity;
private operation;
constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string);
constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string, namespace?: string, params?: Record<string, any>);
toString(): string;
}
/**
*
*/
export declare class OakUnloggedInException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
constructor(message?: string);
constructor(message?: string, namespace?: string, params?: Record<string, any>);
}
/**
*
*/
export declare class OakRowLockedException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
constructor(message?: string);
constructor(message?: string, namespace?: string, params?: Record<string, any>);
}
/**
*
@ -147,7 +150,7 @@ export declare class OakRowLockedException<ED extends EntityDict & BaseEntityDic
export declare class OakCongruentRowExists<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
private data;
private entity;
constructor(entity: T, data: ED[T]['OpSchema'], message?: string);
constructor(entity: T, data: ED[T]['OpSchema'], message?: string, namespace?: string, params?: Record<string, any>);
getData(): ED[T]["OpSchema"];
getEntity(): T;
toString(): string;
@ -156,7 +159,7 @@ export declare class OakCongruentRowExists<ED extends EntityDict & BaseEntityDic
*
*/
export declare class OakDeadlock<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
constructor(message?: string | undefined);
constructor(message?: string, namespace?: string, params?: Record<string, any>);
}
/**
*
@ -164,7 +167,7 @@ export declare class OakDeadlock<ED extends EntityDict & BaseEntityDict> extends
export declare class OakPreConditionUnsetException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
entity?: keyof ED;
code?: string;
constructor(message?: string | undefined, entity?: keyof ED | undefined, code?: string | undefined);
constructor(message?: string, entity?: keyof ED, code?: string, namespace?: string, params?: Record<string, any>);
toString(): string;
}
/**
@ -174,14 +177,14 @@ export declare class OakExternalException<ED extends EntityDict & BaseEntityDict
code?: string;
source: string;
data?: any;
constructor(source: string, code?: string, message?: string, data?: any);
constructor(source: string, code?: string, message?: string, data?: any, namespace?: string, params?: Record<string, any>);
toString(): string;
}
/**
* socket连接异常
*/
export declare class OakSocketConnectException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
constructor(message?: string);
constructor(message?: string, namespace?: string, params?: Record<string, any>);
}
export declare function makeException<ED extends EntityDict & BaseEntityDict>(data: {
name: string;

View File

@ -1,12 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeException = exports.OakSocketConnectException = exports.OakExternalException = exports.OakPreConditionUnsetException = exports.OakDeadlock = exports.OakCongruentRowExists = exports.OakRowLockedException = exports.OakUnloggedInException = exports.OakUserInvisibleException = exports.OakUserUnpermittedException = exports.OakAttrCantUpdateException = exports.OakAttrNotNullException = exports.OakInputIllegalException = exports.OakRowInconsistencyException = exports.OakSignatureVerificationException = exports.OakClockDriftException = exports.OakServerProxyException = exports.OakNetworkException = exports.OakImportDataParseException = exports.OakUniqueViolationException = exports.OakUserException = exports.OakRowUnexistedException = exports.OakOperExistedException = exports.OakNoRelationDefException = exports.OakDataException = exports.OakPartialSuccess = exports.OakMakeSureByMySelfException = exports.OakRequestTimeoutException = exports.OakException = void 0;
exports.makeException = exports.OakSocketConnectException = exports.OakExternalException = exports.OakPreConditionUnsetException = exports.OakDeadlock = exports.OakCongruentRowExists = exports.OakRowLockedException = exports.OakUnloggedInException = exports.OakDataInvisibleException = exports.OakOperationUnpermittedException = exports.OakAttrCantUpdateException = exports.OakAttrNotNullException = exports.OakInputIllegalException = exports.OakRowInconsistencyException = exports.OakSignatureVerificationException = exports.OakClockDriftException = exports.OakServerProxyException = exports.OakNetworkException = exports.OakImportDataParseException = exports.OakUniqueViolationException = exports.OakUserException = exports.OakRowUnexistedException = exports.OakOperExistedException = exports.OakNoRelationDefException = exports.OakDataException = exports.OakPartialSuccess = exports.OakMakeSureByMySelfException = exports.OakRequestTimeoutException = exports.OakException = void 0;
const relation_1 = require("../store/relation");
const lodash_1 = require("../utils/lodash");
class OakException extends Error {
opRecords;
constructor(message) {
namespace;
params;
constructor(message, namespace, params) {
super(message);
this.namespace = namespace;
this.params = params;
this.name = new.target.name;
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, new.target);
@ -75,6 +79,7 @@ class OakException extends Error {
return {
name: this.constructor.name,
message: this.message,
namespace: this.namespace,
opRecords: this.opRecords,
tag1: this.tag1,
tag2: this.tag2,
@ -92,8 +97,8 @@ class OakException extends Error {
exports.OakException = OakException;
// 请求超时
class OakRequestTimeoutException extends OakException {
constructor(message) {
super(message || '请求超时');
constructor(message, ns, params) {
super(message || 'error::requestTimeout', ns || 'oak-domain', params);
}
}
exports.OakRequestTimeoutException = OakRequestTimeoutException;
@ -111,8 +116,11 @@ exports.OakDataException = OakDataException;
class OakNoRelationDefException extends OakDataException {
entity;
actions;
constructor(entity, actions, msg) {
super(msg || `对象${entity}的操作${actions.join(',')}找不到有效的relation定义`);
constructor(entity, actions, msg, namespace, params) {
super(msg || 'error::noRelationDef', namespace || 'oak-domain', params || {
entity,
actions: actions.join(',')
});
this.entity = entity;
this.actions = actions;
}
@ -132,8 +140,10 @@ exports.OakOperExistedException = OakOperExistedException;
class OakRowUnexistedException extends OakDataException {
rows;
// 指定主键查询时却发现行不存在,一般发生在缓存中
constructor(rows) {
super(`查询${rows.map(ele => ele.entity).join(',')}对象时发现了空指针,请检查数据一致性`);
constructor(rows, msg, namespace, params) {
super(msg || 'error::rowUnexisted', namespace || 'oak-domain', params || {
entity: rows[0].entity,
});
this.rows = rows;
}
toString() {
@ -157,8 +167,8 @@ exports.OakUserException = OakUserException;
;
class OakUniqueViolationException extends OakUserException {
rows;
constructor(rows, message) {
super(message || '您更新的数据违反了唯一性约束');
constructor(rows, message, namespace, params) {
super(message || 'error::uniqViolation', namespace || 'oak-domain', params);
this.rows = rows;
}
}
@ -167,8 +177,8 @@ class OakImportDataParseException extends OakUserException {
line;
header;
// message必传描述具体错误的数据内容
constructor(message, line, header) {
super(message);
constructor(message, line, header, namespace, params) {
super(message || 'error::importedDataParseError', namespace || 'oak-domain', params);
this.line = line;
this.header = header;
}
@ -190,8 +200,8 @@ class OakClockDriftException extends OakException {
exports.OakClockDriftException = OakClockDriftException;
// 验签失败
class OakSignatureVerificationException extends OakException {
constructor(message) {
super(message || '验签失败');
constructor(message, namespace, params) {
super(message || 'error::signatureFailed', namespace || 'oak-domain', params);
}
}
exports.OakSignatureVerificationException = OakSignatureVerificationException;
@ -214,8 +224,8 @@ exports.OakRowInconsistencyException = OakRowInconsistencyException;
class OakInputIllegalException extends OakUserException {
attributes;
entity;
constructor(entity, attributes, message) {
super(message);
constructor(entity, attributes, message, namespace, params) {
super(message, namespace, params);
this.entity = entity;
this.attributes = attributes;
}
@ -243,8 +253,8 @@ exports.OakInputIllegalException = OakInputIllegalException;
* 属性为空时抛的异常
*/
class OakAttrNotNullException extends OakInputIllegalException {
constructor(entity, attributes, message) {
super(entity, attributes, message || `属性[${attributes.join(',')}]不允许为空`);
constructor(entity, attributes, message, namespace, params) {
super(entity, attributes, message || 'error::attributesNull', namespace || 'oak-domain', params);
}
}
exports.OakAttrNotNullException = OakAttrNotNullException;
@ -252,19 +262,19 @@ exports.OakAttrNotNullException = OakAttrNotNullException;
* 属性不允许更新抛的异常前端可以用这个异常来处理update时对应属性的露出
*/
class OakAttrCantUpdateException extends OakInputIllegalException {
constructor(entity, attributes, message) {
super(entity, attributes, message || `属性[${attributes.join(',')}]不允许更新`);
constructor(entity, attributes, message, namespace, params) {
super(entity, attributes, message || 'error::attributesCantUpdate', namespace || 'oak-domain', params);
}
}
exports.OakAttrCantUpdateException = OakAttrCantUpdateException;
/**
* 用户权限不够时抛的异常
*/
class OakUserUnpermittedException extends OakUserException {
class OakOperationUnpermittedException extends OakUserException {
entity;
operation;
constructor(entity, operation, message) {
super(message || '用户操作权限不足');
constructor(entity, operation, message, namespace, params) {
super(message || 'error::operationUnpermitted', namespace || 'oak-domain', params);
this.entity = entity;
this.operation = operation;
}
@ -277,16 +287,16 @@ class OakUserUnpermittedException extends OakUserException {
});
}
}
exports.OakUserUnpermittedException = OakUserUnpermittedException;
exports.OakOperationUnpermittedException = OakOperationUnpermittedException;
;
/**
* 用户查询权限不够抛出异常
*/
class OakUserInvisibleException extends OakUserException {
class OakDataInvisibleException extends OakUserException {
entity;
operation;
constructor(entity, operation, message) {
super(message || '用户查询权限不足');
constructor(entity, operation, message, namespace, params) {
super(message || 'error::dataInvisible', namespace || 'oak-domain', params);
this.entity = entity;
this.operation = operation;
}
@ -299,14 +309,14 @@ class OakUserInvisibleException extends OakUserException {
});
}
}
exports.OakUserInvisibleException = OakUserInvisibleException;
exports.OakDataInvisibleException = OakDataInvisibleException;
;
/**
* 用户未登录抛的异常
*/
class OakUnloggedInException extends OakUserException {
constructor(message) {
super(message || '您尚未登录');
constructor(message, namespace, params) {
super(message || 'error::unLoggedIn', namespace || 'oak-domain', params);
}
}
exports.OakUnloggedInException = OakUnloggedInException;
@ -315,8 +325,8 @@ exports.OakUnloggedInException = OakUnloggedInException;
* 行数据被锁抛的异常
*/
class OakRowLockedException extends OakUserException {
constructor(message) {
super(message || '该行数据正在被更新中,请稍后再试');
constructor(message, namespace, params) {
super(message || 'error::rowLocked', namespace || 'oak-domain', params);
}
}
exports.OakRowLockedException = OakRowLockedException;
@ -327,8 +337,8 @@ exports.OakRowLockedException = OakRowLockedException;
class OakCongruentRowExists extends OakUserException {
data;
entity;
constructor(entity, data, message) {
super(message);
constructor(entity, data, message, namespace, params) {
super(message || 'error::congrentRowExists', namespace || 'oak-domain', params);
this.data = data;
this.entity = entity;
}
@ -352,8 +362,8 @@ exports.OakCongruentRowExists = OakCongruentRowExists;
* 死锁抛的异常
*/
class OakDeadlock extends OakUserException {
constructor(message) {
super(message || '发现死锁');
constructor(message, namespace, params) {
super(message || 'error::deadlock', namespace || 'oak-domain', params);
}
}
exports.OakDeadlock = OakDeadlock;
@ -364,8 +374,8 @@ exports.OakDeadlock = OakDeadlock;
class OakPreConditionUnsetException extends OakUserException {
entity;
code;
constructor(message, entity, code) {
super(message || '前置条件不满足');
constructor(message, entity, code, namespace, params) {
super(message || 'error::preconditionUnset', namespace || 'oak-domain', params);
this.entity = entity,
this.code = code;
}
@ -386,8 +396,8 @@ class OakExternalException extends OakUserException {
code;
source;
data;
constructor(source, code, message, data) {
super(message);
constructor(source, code, message, data, namespace, params) {
super(message || 'error::externalException', namespace || 'oak-domain', params);
this.code = code;
this.source = source;
this.data = data;
@ -407,8 +417,8 @@ exports.OakExternalException = OakExternalException;
* socket连接异常
*/
class OakSocketConnectException extends OakUserException {
constructor(message) {
super(message || '连接出现问题,请尝试刷新页面');
constructor(message, namespace, params) {
super(message || 'error::socketConnectException', namespace || 'oak-domain', params);
}
}
exports.OakSocketConnectException = OakSocketConnectException;
@ -418,107 +428,107 @@ function makeException(data) {
let e = undefined;
switch (name) {
case 'OakException': {
e = new OakException(data.message);
e = new OakException(data.message, data.namespace, data.params);
break;
}
case 'OakUserException': {
e = new OakUserException(data.message);
e = new OakUserException(data.message, data.namespace, data.params);
break;
}
case 'OakRowInconsistencyException': {
e = new OakRowInconsistencyException(data.message);
e = new OakRowInconsistencyException(data.message, data.namespace, data.params);
break;
}
case 'OakInputIllegalException': {
e = new OakInputIllegalException(data.entity, data.attributes, data.message);
e = new OakInputIllegalException(data.entity, data.attributes, data.message, data.namespace, data.params);
break;
}
case 'OakAttrCantUpdateException': {
e = new OakAttrCantUpdateException(data.entity, data.attributes, data.message);
e = new OakAttrCantUpdateException(data.entity, data.attributes, data.message, data.namespace, data.params);
break;
}
case 'OakUserUnpermittedException': {
e = new OakUserUnpermittedException(data.entity, data.operation, data.message);
case 'OakOperationUnpermittedException': {
e = new OakOperationUnpermittedException(data.entity, data.operation, data.message, data.namespace, data.params);
break;
}
case 'OakUserInvisibleException': {
e = new OakUserInvisibleException(data.entity, data.operation, data.message);
case 'OakDataInvisibleException': {
e = new OakDataInvisibleException(data.entity, data.operation, data.message, data.namespace, data.params);
break;
}
case 'OakUnloggedInException': {
e = new OakUnloggedInException(data.message);
e = new OakUnloggedInException(data.message, data.namespace, data.params);
break;
}
case 'OakCongruentRowExists': {
e = new OakCongruentRowExists(data.entity, data.data, data.message);
e = new OakCongruentRowExists(data.entity, data.data, data.message, data.namespace, data.params);
break;
}
case 'OakRowLockedException': {
e = new OakRowLockedException(data.message);
e = new OakRowLockedException(data.message, data.namespace, data.params);
break;
}
case 'OakRowUnexistedException': {
e = new OakRowUnexistedException(data.rows);
e = new OakRowUnexistedException(data.rows, data.message, data.namespace, data.params);
break;
}
case 'OakDeadlock': {
e = new OakDeadlock(data.message);
e = new OakDeadlock(data.message, data.namespace, data.params);
break;
}
case 'OakDataException': {
e = new OakDataException(data.message);
e = new OakDataException(data.message, data.namespace, data.params);
break;
}
case 'OakNoRelationDefException': {
e = new OakNoRelationDefException(data.entity, data.action, data.message);
e = new OakNoRelationDefException(data.entity, data.action, data.message, data.namespace, data.params);
break;
}
case 'OakUniqueViolationException': {
e = new OakUniqueViolationException(data.rows, data.message);
e = new OakUniqueViolationException(data.rows, data.message, data.namespace, data.params);
break;
}
case 'OakImportDataParseException': {
e = new OakImportDataParseException(data.message, data.line, data.header);
e = new OakImportDataParseException(data.message, data.line, data.header, data.namespace, data.params);
break;
}
case 'OakPreConditionUnsetException': {
e = new OakPreConditionUnsetException(data.message, data.entity, data.code);
e = new OakPreConditionUnsetException(data.message, data.entity, data.code, data.namespace, data.params);
break;
}
case 'OakAttrNotNullException': {
e = new OakAttrNotNullException(data.entity, data.attributes, data.message);
e = new OakAttrNotNullException(data.entity, data.attributes, data.message, data.namespace, data.params);
break;
}
case 'OakExternalException': {
e = new OakExternalException(data.source, data.code, data.message, data.data);
e = new OakExternalException(data.source, data.code, data.message, data.data, data.namespace, data.params);
break;
}
case 'OakNetworkException': {
e = new OakNetworkException(data.message);
e = new OakNetworkException(data.message, data.namespace, data.params);
break;
}
case 'OakClockDriftException': {
e = new OakClockDriftException(data.message);
e = new OakClockDriftException(data.message, data.namespace, data.params);
break;
}
case 'OakServerProxyException': {
e = new OakServerProxyException(data.message);
e = new OakServerProxyException(data.message, data.namespace, data.params);
break;
}
case 'OakSocketConnectException': {
e = new OakSocketConnectException(data.message);
e = new OakSocketConnectException(data.message, data.namespace, data.params);
break;
}
case 'OakPartialSuccess': {
e = new OakPartialSuccess(data.message);
e = new OakPartialSuccess(data.message, data.namespace, data.params);
break;
}
case 'OakRequestTimeoutException': {
e = new OakRequestTimeoutException(data.message);
e = new OakRequestTimeoutException(data.message, data.namespace, data.params);
break;
}
case 'OakSignatureVerificationException': {
e = new OakSignatureVerificationException(data.message);
e = new OakSignatureVerificationException(data.message, data.namespace, data.params);
break;
}
default:

4
scripts/buildLocales.ts Normal file
View File

@ -0,0 +1,4 @@
import LocaleBuilder from '../src/compiler/localeBuilder';
const builder = new LocaleBuilder(true);
builder.build();

View File

@ -5,7 +5,7 @@ import { resolve } from 'path';
// ts-node scripts/build-app-domain & npm link ./app-domain
console.log(`${chalk.greenBright(`build base-app-domain`)}`);
const result = spawn.sync(
let result = spawn.sync(
'ts-node',
[resolve(process.cwd(), 'scripts', 'buildBaseEntityDict.ts')],
{
@ -15,9 +15,25 @@ const result = spawn.sync(
);
// const result2 = spawn.sync('npm -v', [], { stdio: 'inherit', shell: true });
if (result.status === 0) {
console.log(`${chalk.greenBright(`build 执行完成`)}`);
} else {
Error(`${chalk.redBright(`build 执行失败`)}`);
if (result.status !== 0) {
Error(`${chalk.redBright(`build base-app-domain 执行失败`)}`);
process.exit(1);
}
console.log(`${chalk.greenBright(`build base-app-domain 执行完成`)}`);
console.log(`${chalk.greenBright(`build locales`)}`);
result = spawn.sync(
'ts-node',
[resolve(process.cwd(), 'scripts', 'buildLocales.ts')],
{
stdio: 'inherit',
shell: true,
}
);
// const result2 = spawn.sync('npm -v', [], { stdio: 'inherit', shell: true });
if (result.status !== 0) {
Error(`${chalk.redBright(`build locales 执行失败`)}`);
process.exit(1);
}
console.log(`${chalk.greenBright(`build locales 执行完成`)}`);

View File

@ -42,6 +42,7 @@ export default class LocaleBuilder {
pwd: string;
locales: Record<string, [string, string, string, object]>; // key: namespace, value: [module, position, language, data]
hash: Hash;
projectName?: string;
constructor(asLib?: boolean) {
const pwd = process.cwd();
@ -64,6 +65,7 @@ export default class LocaleBuilder {
* Dependency需要引出来
*/
private outputDataFile() {
const appDomainDir = this.projectName === 'oak-domain' ? 'base-app-domain' : 'oak-app-domain';
const statements: ts.Statement[] = [
factory.createImportDeclaration(
undefined,
@ -76,7 +78,7 @@ export default class LocaleBuilder {
factory.createIdentifier("I18n")
)])
),
factory.createStringLiteral("../oak-app-domain/I18n/Schema"),
factory.createStringLiteral(`../${appDomainDir}/I18n/Schema`),
undefined
)
];
@ -194,7 +196,12 @@ export default class LocaleBuilder {
ts.ListFormat.SourceFileStatements,
factory.createNodeArray(statements),
ts.createSourceFile("someFileName.ts", "", ts.ScriptTarget.Latest, false, ts.ScriptKind.TS));
const filename = join(this.pwd, 'src', 'data', 'i18n.ts');
const dataDir = join(this.pwd, 'src', 'data');
if (!fs.existsSync(dataDir)) {
fs.mkdirSync(dataDir);
}
const filename = join(dataDir, 'i18n.ts');
const result2 = unescapeUnicode(`// 本文件为自动编译产生,请勿直接修改\n\n${result}`);
fs.writeFileSync(filename, result2, { flag: 'w' });
}
@ -258,6 +265,7 @@ export default class LocaleBuilder {
private buildProject(root: string, src?: boolean, watch?: boolean) {
const packageJson = join(root, 'package.json');
const { name } = require(packageJson);
this.projectName = name;
const pagePath = join(src ? 'src' : 'es', 'pages');
const pageAbsolutePath = join(root, pagePath);//编译i18时font中的componentPath缺少根目录导致编译不出
if (fs.existsSync(pageAbsolutePath)) {

32
src/data/i18n.ts Normal file
View File

@ -0,0 +1,32 @@
// 本文件为自动编译产生,请勿直接修改
import { CreateOperationData as I18n } from "../base-app-domain/I18n/Schema";
const i18ns: I18n[] = [
{
id: "78c237bf2064a36fe73d943ccbbe22d5",
namespace: "oak-domain-l-error",
language: "zh-CN",
module: "oak-domain",
position: "locales/error",
data: {
"requestTimeout": "请求超时",
"noRelationDef": "对象[%{entity}]的操作${%{action}}找不到有效的relation定义",
"rowUnexisted": "查询对象[%{entity}]时发现了空指针,请检查数据一致性",
"uniqViolation": "您更新的数据违反了唯一性约束",
"signatureFailed": "验签失败",
"attributesNull": "属性[%{attributes}]不允许为空",
"attributesCantUpdate": "属性[%{attributes}]不能更新",
"operationUnpermitted": "用户操作权限不足",
"dataInvisible": "用户查询权限不足",
"unLoggedIn": "用户未登录",
"rowLocked": "该行数据当前处于被锁定状态",
"congrentRowExists": "相同的行数据已经存在",
"deadlock": "发现死锁",
"preconditionUnset": "前置条件未满足",
"externalException": "外部接口调用异常",
"socketConnectException": "连接出现问题,请尝试刷新页面",
"importedDataParseError": "import的数据存在异常"
}
}
];
export default i18ns;

View File

@ -0,0 +1,19 @@
{
"requestTimeout": "请求超时",
"noRelationDef": "对象[%{entity}]的操作${%{action}}找不到有效的relation定义",
"rowUnexisted": "查询对象[%{entity}]时发现了空指针,请检查数据一致性",
"uniqViolation": "您更新的数据违反了唯一性约束",
"signatureFailed": "验签失败",
"attributesNull": "属性[%{attributes}]不允许为空",
"attributesCantUpdate": "属性[%{attributes}]不能更新",
"operationUnpermitted": "用户操作权限不足",
"dataInvisible": "用户查询权限不足",
"unLoggedIn": "用户未登录",
"rowLocked": "该行数据当前处于被锁定状态",
"congrentRowExists": "相同的行数据已经存在",
"deadlock": "发现死锁",
"preconditionUnset": "前置条件未满足",
"externalException": "外部接口调用异常",
"socketConnectException": "连接出现问题,请尝试刷新页面",
"importedDataParseError": "import的数据存在异常"
}

View File

@ -1,6 +1,6 @@
import assert from "assert";
import { EntityDict } from "../base-app-domain";
import { OakUnloggedInException, OakUserInvisibleException, OakUserUnpermittedException, StorageSchema } from "../types";
import { OakUnloggedInException, OakDataInvisibleException, OakOperationUnpermittedException, StorageSchema } from "../types";
import { EntityDict as BaseEntityDict, AuthDeduceRelationMap } from "../types/Entity";
import { AsyncContext } from "./AsyncRowStore";
import { checkFilterContains, combineFilters, getRelevantIds, translateCreateDataToFilter } from "./filter";
@ -1450,13 +1450,13 @@ export class RelationAuth<ED extends EntityDict & BaseEntityDict> {
return result.then(
(r) => {
if (!r) {
throw new OakUserInvisibleException<ED, T>(entity, operation as ED[T]['Operation']);
throw new OakDataInvisibleException<ED, T>(entity, operation as ED[T]['Operation']);
}
}
);
}
if (!result) {
throw new OakUserInvisibleException<ED, T>(entity, operation as ED[T]['Operation']);
throw new OakDataInvisibleException<ED, T>(entity, operation as ED[T]['Operation']);
}
}
else {
@ -1465,13 +1465,13 @@ export class RelationAuth<ED extends EntityDict & BaseEntityDict> {
return result.then(
(r) => {
if (!r) {
throw new OakUserUnpermittedException<ED, T>(entity, operation as ED[T]['Operation']);
throw new OakOperationUnpermittedException<ED, T>(entity, operation as ED[T]['Operation']);
}
}
);
}
if (!result) {
throw new OakUserUnpermittedException<ED, T>(entity, operation as ED[T]['Operation']);
throw new OakOperationUnpermittedException<ED, T>(entity, operation as ED[T]['Operation']);
}
}
}

View File

@ -1,6 +1,6 @@
import assert from 'assert';
import { checkFilterContains, combineFilters, translateCreateDataToFilter } from "../store/filter";
import { OakAttrNotNullException, OakInputIllegalException, OakRowInconsistencyException, OakUserUnpermittedException } from '../types/Exception';
import { OakAttrNotNullException, OakInputIllegalException, OakRowInconsistencyException } from '../types/Exception';
import {
Checker, CreateTriggerInTxn, EntityDict, OperateOption, SelectOption, StorageSchema, Trigger,
UpdateTriggerInTxn, SelectOpResult, CHECKER_MAX_PRIORITY } from "../types";

View File

@ -7,8 +7,12 @@ import { pick } from '../utils/lodash';
export class OakException<ED extends EntityDict & BaseEntityDict> extends Error {
opRecords: OpRecord<ED>[];
constructor(message?: string) {
namespace?: string;
params?: Record<string, any>;
constructor(message?: string, namespace?: string, params?: Record<string, any>) {
super(message);
this.namespace = namespace;
this.params = params;
this.name = new.target.name;
if (typeof (Error as any).captureStackTrace === 'function') {
(Error as any).captureStackTrace(this, new.target);
@ -85,6 +89,8 @@ export class OakException<ED extends EntityDict & BaseEntityDict> extends Error
return {
name: this.constructor.name,
message: this.message,
namespace: this.namespace,
opRecords: this.opRecords,
tag1: this.tag1,
tag2: this.tag2,
@ -104,8 +110,8 @@ export class OakException<ED extends EntityDict & BaseEntityDict> extends Error
// 请求超时
export class OakRequestTimeoutException<ED extends EntityDict & BaseEntityDict> extends OakException<ED> {
constructor(message?: string) {
super(message || '请求超时');
constructor(message?: string, ns?: string, params?: Record<string, any>) {
super(message || 'error::requestTimeout', ns || 'oak-domain', params);
}
}
@ -126,8 +132,11 @@ export class OakDataException<ED extends EntityDict & BaseEntityDict> extends Oa
export class OakNoRelationDefException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakDataException<ED> {
entity: T;
actions: ED[T]['Action'][];
constructor(entity: T, actions: ED[T]['Action'][], msg?: string) {
super(msg || `对象${entity as string}的操作${actions.join(',')}找不到有效的relation定义`);
constructor(entity: T, actions: ED[T]['Action'][], msg?: string, namespace?: string, params?: Record<string, any>) {
super(msg || 'error::noRelationDef', namespace || 'oak-domain', params || {
entity,
actions: actions.join(',')
});
this.entity = entity;
this.actions = actions;
}
@ -152,8 +161,10 @@ export class OakRowUnexistedException<ED extends EntityDict & BaseEntityDict> ex
selection: any;
}>
// 指定主键查询时却发现行不存在,一般发生在缓存中
constructor(rows: Array<{entity: any, selection: any}>) {
super(`查询${rows.map(ele => ele.entity).join(',')}对象时发现了空指针,请检查数据一致性`);
constructor(rows: Array<{entity: any, selection: any}>, msg?: string, namespace?: string, params?: Record<string, any>) {
super(msg || 'error::rowUnexisted', namespace || 'oak-domain', params || {
entity: rows[0].entity,
});
this.rows = rows;
}
@ -186,8 +197,8 @@ export class OakUniqueViolationException<ED extends EntityDict & BaseEntityDict>
constructor(rows: Array<{
id?: string;
attrs: string[];
}>, message?: string) {
super(message || '您更新的数据违反了唯一性约束');
}>, message?: string, namespace?: string, params?: Record<string, any>) {
super(message || 'error::uniqViolation', namespace || 'oak-domain', params);
this.rows = rows;
}
}
@ -197,8 +208,8 @@ export class OakImportDataParseException<ED extends EntityDict & BaseEntityDict>
header?: string;
// message必传描述具体错误的数据内容
constructor(message: string, line: number, header?: string) {
super(message);
constructor(message: string, line: number, header?: string, namespace?: string, params?: Record<string, any>) {
super(message || 'error::importedDataParseError', namespace || 'oak-domain', params);
this.line = line;
this.header = header;
}
@ -223,8 +234,8 @@ export class OakClockDriftException<ED extends EntityDict & BaseEntityDict> exte
// 验签失败
export class OakSignatureVerificationException<ED extends EntityDict & BaseEntityDict> extends OakException<ED> {
constructor(message?: string) {
super(message || '验签失败');
constructor(message?: string, namespace?: string, params?: Record<string, any>) {
super(message || 'error::signatureFailed', namespace || 'oak-domain', params);
}
}
@ -246,8 +257,8 @@ export class OakRowInconsistencyException<ED extends EntityDict & BaseEntityDict
export class OakInputIllegalException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
private attributes: string[];
private entity: keyof ED;
constructor(entity: keyof ED, attributes: string[], message?: string) {
super(message);
constructor(entity: keyof ED, attributes: string[], message?: string, namespace?: string, params?: Record<string, any>) {
super(message, namespace, params);
this.entity = entity;
this.attributes = attributes;
}
@ -280,8 +291,8 @@ export class OakInputIllegalException<ED extends EntityDict & BaseEntityDict> ex
*
*/
export class OakAttrNotNullException<ED extends EntityDict & BaseEntityDict> extends OakInputIllegalException<ED> {
constructor(entity: keyof ED, attributes: string[], message?: string) {
super(entity, attributes, message || `属性[${attributes.join(',')}]不允许为空`);
constructor(entity: keyof ED, attributes: string[], message?: string, namespace?: string, params?: Record<string, any>) {
super(entity, attributes, message || 'error::attributesNull', namespace || 'oak-domain', params);
}
}
@ -289,20 +300,20 @@ export class OakAttrNotNullException<ED extends EntityDict & BaseEntityDict> ext
* update时对应属性的露出
*/
export class OakAttrCantUpdateException<ED extends EntityDict & BaseEntityDict> extends OakInputIllegalException<ED> {
constructor(entity: keyof ED, attributes: string[], message?: string) {
super(entity, attributes, message || `属性[${attributes.join(',')}]不允许更新`);
constructor(entity: keyof ED, attributes: string[], message?: string, namespace?: string, params?: Record<string, any>) {
super(entity, attributes, message || 'error::attributesCantUpdate', namespace || 'oak-domain', params);
}
}
/**
*
*/
export class OakUserUnpermittedException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
export class OakOperationUnpermittedException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
private entity: T;
private operation: ED[T]['Selection'] | ED[T]['Operation'];
constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string) {
super(message || '用户操作权限不足');
constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string, namespace?: string, params?: Record<string, any>) {
super(message || 'error::operationUnpermitted', namespace || 'oak-domain', params);
this.entity = entity;
this.operation = operation;
}
@ -321,12 +332,12 @@ export class OakUserUnpermittedException<ED extends EntityDict & BaseEntityDict,
/**
*
*/
export class OakUserInvisibleException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
export class OakDataInvisibleException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
private entity: T;
private operation: ED[T]['Selection'] | ED[T]['Operation'];
constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string) {
super(message || '用户查询权限不足');
constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string, namespace?: string, params?: Record<string, any>) {
super(message || 'error::dataInvisible', namespace || 'oak-domain', params);
this.entity = entity;
this.operation = operation;
}
@ -347,8 +358,8 @@ export class OakUserInvisibleException<ED extends EntityDict & BaseEntityDict, T
*
*/
export class OakUnloggedInException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
constructor(message?: string) {
super(message || '您尚未登录');
constructor(message?: string, namespace?: string, params?: Record<string, any>) {
super(message || 'error::unLoggedIn', namespace || 'oak-domain', params);
}
};
@ -357,8 +368,8 @@ export class OakUnloggedInException<ED extends EntityDict & BaseEntityDict> exte
*
*/
export class OakRowLockedException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
constructor(message?: string) {
super(message || '该行数据正在被更新中,请稍后再试');
constructor(message?: string, namespace?: string, params?: Record<string, any>) {
super(message || 'error::rowLocked', namespace || 'oak-domain', params);
}
};
/**
@ -367,8 +378,8 @@ export class OakUnloggedInException<ED extends EntityDict & BaseEntityDict> exte
export class OakCongruentRowExists<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
private data: ED[T]['OpSchema'];
private entity: T;
constructor(entity: T, data: ED[T]['OpSchema'], message?: string) {
super(message);
constructor(entity: T, data: ED[T]['OpSchema'], message?: string, namespace?: string, params?: Record<string, any>) {
super(message || 'error::congrentRowExists', namespace || 'oak-domain', params);
this.data = data;
this.entity = entity;
}
@ -395,8 +406,8 @@ export class OakCongruentRowExists<ED extends EntityDict & BaseEntityDict, T ext
*
*/
export class OakDeadlock<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
constructor(message?: string | undefined) {
super(message || '发现死锁');
constructor(message?: string, namespace?: string, params?: Record<string, any>) {
super(message || 'error::deadlock', namespace || 'oak-domain', params);
}
};
@ -407,8 +418,8 @@ export class OakPreConditionUnsetException<ED extends EntityDict & BaseEntityDic
entity?: keyof ED;
code?: string;
constructor(message?: string | undefined, entity?: keyof ED | undefined, code?: string | undefined) {
super(message || '前置条件不满足');
constructor(message?: string, entity?: keyof ED, code?: string, namespace?: string, params?: Record<string, any>) {
super(message || 'error::preconditionUnset', namespace || 'oak-domain', params);
this.entity = entity,
this.code = code;
}
@ -432,8 +443,8 @@ export class OakExternalException<ED extends EntityDict & BaseEntityDict> extend
source: string;
data?: any;
constructor(source: string, code?: string, message?: string, data?: any) {
super(message);
constructor(source: string, code?: string, message?: string, data?: any, namespace?: string, params?: Record<string, any>) {
super(message || 'error::externalException', namespace || 'oak-domain', params);
this.code = code;
this.source = source;
this.data = data;
@ -454,8 +465,8 @@ export class OakExternalException<ED extends EntityDict & BaseEntityDict> extend
* socket连接异常
*/
export class OakSocketConnectException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
constructor(message?: string) {
super(message || '连接出现问题,请尝试刷新页面');
constructor(message?: string, namespace?: string, params?: Record<string, any>) {
super(message || 'error::socketConnectException', namespace || 'oak-domain', params);
}
};
@ -469,111 +480,111 @@ export function makeException<ED extends EntityDict & BaseEntityDict>(data: {
let e: OakException<ED> | undefined = undefined;
switch (name) {
case 'OakException': {
e = new OakException(data.message);
e = new OakException(data.message, data.namespace, data.params);
break;
}
case 'OakUserException': {
e = new OakUserException(data.message);
e = new OakUserException(data.message, data.namespace, data.params);
break;
}
case 'OakRowInconsistencyException': {
e = new OakRowInconsistencyException(data.message);
e = new OakRowInconsistencyException(data.message, data.namespace, data.params);
break;
}
case 'OakInputIllegalException': {
e = new OakInputIllegalException(data.entity, data.attributes, data.message);
e = new OakInputIllegalException(data.entity, data.attributes, data.message, data.namespace, data.params);
break;
}
case 'OakAttrCantUpdateException': {
e = new OakAttrCantUpdateException(data.entity, data.attributes, data.message);
e = new OakAttrCantUpdateException(data.entity, data.attributes, data.message, data.namespace, data.params);
break;
}
case 'OakUserUnpermittedException': {
e = new OakUserUnpermittedException(data.entity, data.operation, data.message);
case 'OakOperationUnpermittedException': {
e = new OakOperationUnpermittedException(data.entity, data.operation, data.message, data.namespace, data.params);
break;
}
case 'OakUserInvisibleException': {
e = new OakUserInvisibleException(data.entity, data.operation, data.message);
case 'OakDataInvisibleException': {
e = new OakDataInvisibleException(data.entity, data.operation, data.message, data.namespace, data.params);
break;
}
case 'OakUnloggedInException': {
e = new OakUnloggedInException(data.message);
e = new OakUnloggedInException(data.message, data.namespace, data.params);
break;
}
case 'OakCongruentRowExists': {
e = new OakCongruentRowExists(data.entity, data.data, data.message);
e = new OakCongruentRowExists(data.entity, data.data, data.message, data.namespace, data.params);
break;
}
case 'OakRowLockedException': {
e = new OakRowLockedException(data.message);
e = new OakRowLockedException(data.message, data.namespace, data.params);
break;
}
case 'OakRowUnexistedException': {
e = new OakRowUnexistedException(data.rows);
e = new OakRowUnexistedException(data.rows, data.message, data.namespace, data.params);
break;
}
case 'OakDeadlock': {
e = new OakDeadlock(data.message);
e = new OakDeadlock(data.message, data.namespace, data.params);
break;
}
case 'OakDataException': {
e = new OakDataException(data.message);
e = new OakDataException(data.message, data.namespace, data.params);
break;
}
case 'OakNoRelationDefException': {
e = new OakNoRelationDefException(data.entity, data.action, data.message);
e = new OakNoRelationDefException(data.entity, data.action, data.message, data.namespace, data.params);
break;
}
case 'OakUniqueViolationException': {
e = new OakUniqueViolationException(data.rows, data.message);
e = new OakUniqueViolationException(data.rows, data.message, data.namespace, data.params);
break;
}
case 'OakImportDataParseException': {
e = new OakImportDataParseException(data.message!, data.line, data.header);
e = new OakImportDataParseException(data.message!, data.line, data.header, data.namespace, data.params);
break;
}
case 'OakPreConditionUnsetException': {
e = new OakPreConditionUnsetException(data.message, data.entity, data.code);
e = new OakPreConditionUnsetException(data.message, data.entity, data.code, data.namespace, data.params);
break;
}
case 'OakAttrNotNullException': {
e = new OakAttrNotNullException(
data.entity,
data.attributes,
data.message
data.message, data.namespace, data.params
);
break;
}
case 'OakExternalException': {
e = new OakExternalException(data.source, data.code, data.message, data.data);
e = new OakExternalException(data.source, data.code, data.message, data.data, data.namespace, data.params);
break;
}
case 'OakNetworkException': {
e = new OakNetworkException(data.message);
e = new OakNetworkException(data.message, data.namespace, data.params);
break;
}
case 'OakClockDriftException': {
e = new OakClockDriftException(data.message);
e = new OakClockDriftException(data.message, data.namespace, data.params);
break;
}
case 'OakServerProxyException': {
e = new OakServerProxyException(data.message);
e = new OakServerProxyException(data.message, data.namespace, data.params);
break;
}
case 'OakSocketConnectException': {
e = new OakSocketConnectException(data.message);
e = new OakSocketConnectException(data.message, data.namespace, data.params);
break;
}
case 'OakPartialSuccess': {
e = new OakPartialSuccess(data.message);
e = new OakPartialSuccess(data.message, data.namespace, data.params);
break;
}
case 'OakRequestTimeoutException': {
e = new OakRequestTimeoutException(data.message);
e = new OakRequestTimeoutException(data.message, data.namespace, data.params);
break;
}
case 'OakSignatureVerificationException': {
e = new OakSignatureVerificationException(data.message);
e = new OakSignatureVerificationException(data.message, data.namespace, data.params);
break;
}
default: