oak-domain 4.5.0 → 5.0.0

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.
Files changed (72) hide show
  1. package/lib/base-app-domain/ActionDefDict.d.ts +1 -1
  2. package/lib/base-app-domain/ActionDefDict.js +4 -4
  3. package/lib/base-app-domain/I18n/Storage.js +0 -1
  4. package/lib/base-app-domain/Modi/Action.d.ts +1 -1
  5. package/lib/base-app-domain/Modi/Action.js +2 -2
  6. package/lib/base-app-domain/Modi/Style.d.ts +3 -0
  7. package/lib/base-app-domain/Modi/Style.js +16 -0
  8. package/lib/base-app-domain/ModiEntity/Schema.d.ts +14 -0
  9. package/lib/base-app-domain/OperEntity/Schema.d.ts +14 -0
  10. package/lib/base-app-domain/StyleDict.d.ts +3 -0
  11. package/lib/base-app-domain/StyleDict.js +9 -0
  12. package/lib/base-app-domain/User/Action.d.ts +1 -1
  13. package/lib/base-app-domain/User/Action.js +2 -2
  14. package/lib/base-app-domain/User/Style.d.ts +3 -0
  15. package/lib/base-app-domain/User/Style.js +14 -0
  16. package/lib/base-app-domain/index.d.ts +1 -0
  17. package/lib/base-app-domain/index.js +1 -0
  18. package/lib/compiler/dependencyBuilder.d.ts +21 -0
  19. package/lib/compiler/dependencyBuilder.js +873 -0
  20. package/lib/compiler/env.d.ts +1 -1
  21. package/lib/compiler/env.js +2 -8
  22. package/lib/compiler/localeBuilder.js +13 -7
  23. package/lib/compiler/routerBuilder.js +29 -44
  24. package/lib/compiler/schemalBuilder.js +67 -8
  25. package/lib/entities/I18n.js +0 -3
  26. package/lib/entities/Modi.js +13 -0
  27. package/lib/entities/User.js +11 -0
  28. package/lib/store/IntrinsicCheckers.d.ts +2 -2
  29. package/lib/store/IntrinsicCheckers.js +83 -17
  30. package/lib/store/IntrinsicLogics.d.ts +2 -2
  31. package/lib/store/IntrinsicLogics.js +3 -3
  32. package/lib/store/filter.d.ts +47 -0
  33. package/lib/store/filter.js +49 -6
  34. package/lib/types/Action.d.ts +1 -1
  35. package/lib/types/Configuration.d.ts +42 -7
  36. package/lib/types/Configuration.js +0 -1
  37. package/lib/types/Connector.d.ts +3 -0
  38. package/lib/types/EntityDesc.d.ts +10 -3
  39. package/lib/types/Style.d.ts +35 -6
  40. package/lib/utils/SimpleConnector.d.ts +6 -10
  41. package/lib/utils/SimpleConnector.js +33 -20
  42. package/lib/utils/assert.d.ts +1 -0
  43. package/lib/utils/lodash.d.ts +10 -1
  44. package/lib/utils/lodash.js +27 -1
  45. package/lib/utils/module/combine.common.d.ts +15 -0
  46. package/lib/utils/module/combine.common.js +27 -0
  47. package/lib/utils/module/combine.d.ts +1 -0
  48. package/lib/utils/module/combine.dev.d.ts +17 -0
  49. package/lib/utils/module/combine.dev.js +55 -0
  50. package/lib/utils/module/combine.js +4 -0
  51. package/lib/utils/module/combine.prod.d.ts +8 -0
  52. package/lib/utils/module/combine.prod.js +8 -0
  53. package/lib/utils/module/combine.server.d.ts +17 -0
  54. package/lib/utils/module/combine.server.js +55 -0
  55. package/lib/utils/relationPath.js +1 -1
  56. package/package.json +1 -1
  57. package/src/entities/ActionAuth.ts +41 -41
  58. package/src/entities/I18n.ts +0 -3
  59. package/src/entities/Modi.ts +13 -0
  60. package/src/entities/ModiEntity.ts +26 -26
  61. package/src/entities/OperEntity.ts +27 -27
  62. package/src/entities/Path.ts +43 -43
  63. package/src/entities/Relation.ts +43 -43
  64. package/src/entities/RelationAuth.ts +44 -44
  65. package/src/entities/User.ts +12 -1
  66. package/src/entities/UserEntityClaim.ts +29 -29
  67. package/src/entities/UserEntityGrant.ts +24 -24
  68. package/src/entities/UserRelation.ts +50 -50
  69. package/lib/actions/relation.d.ts +0 -5
  70. package/lib/actions/relation.js +0 -25
  71. package/lib/base-app-domain/UserEntityGrant/Action.d.ts +0 -5
  72. package/lib/base-app-domain/UserEntityGrant/Action.js +0 -5
@@ -1,4 +1,4 @@
1
- export declare const ActionDefDict: {
1
+ export declare const actionDefDict: {
2
2
  modi: {
3
3
  iState: import("../types").ActionDef<string, string>;
4
4
  };
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionDefDict = void 0;
3
+ exports.actionDefDict = void 0;
4
4
  const Action_1 = require("./Modi/Action");
5
5
  const Action_2 = require("./User/Action");
6
- exports.ActionDefDict = {
7
- modi: Action_1.ActionDefDict,
8
- user: Action_2.ActionDefDict
6
+ exports.actionDefDict = {
7
+ modi: Action_1.actionDefDict,
8
+ user: Action_2.actionDefDict
9
9
  };
@@ -37,7 +37,6 @@ exports.desc = {
37
37
  type: "object"
38
38
  }
39
39
  },
40
- static: true,
41
40
  actionType: "crud",
42
41
  actions: action_1.genericActions,
43
42
  indexes: [
@@ -5,6 +5,6 @@ export type IAction = 'apply' | 'abandon' | string;
5
5
  export type ParticularAction = IAction;
6
6
  export declare const actions: string[];
7
7
  export type Action = GenericAction | ParticularAction | string;
8
- export declare const ActionDefDict: {
8
+ export declare const actionDefDict: {
9
9
  iState: ActionDef<string, string>;
10
10
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionDefDict = exports.actions = void 0;
3
+ exports.actionDefDict = exports.actions = void 0;
4
4
  const IActionDef = {
5
5
  stm: {
6
6
  apply: ['active', 'applied'],
@@ -9,6 +9,6 @@ const IActionDef = {
9
9
  is: 'active',
10
10
  };
11
11
  exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "apply", "abandon"];
12
- exports.ActionDefDict = {
12
+ exports.actionDefDict = {
13
13
  iState: IActionDef
14
14
  };
@@ -0,0 +1,3 @@
1
+ import { EntityDef } from "./Schema";
2
+ import { StyleDef } from "../../types/Style";
3
+ export declare const style: StyleDef<EntityDef["OpSchema"], EntityDef["Action"]>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.style = void 0;
4
+ exports.style = {
5
+ icon: {
6
+ apply: '',
7
+ abandon: '',
8
+ },
9
+ color: {
10
+ iState: {
11
+ active: '#0000FF',
12
+ applied: '#008000',
13
+ abandoned: '#A9A9A9',
14
+ }
15
+ }
16
+ };
@@ -177,6 +177,14 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
177
177
  entity: "actionAuth";
178
178
  entityId: ForeignKey<"ActionAuth">;
179
179
  actionAuth?: never;
180
+ } | {
181
+ entity?: never;
182
+ entityId?: never;
183
+ i18n: I18n.CreateSingleOperation;
184
+ } | {
185
+ entity: "i18n";
186
+ entityId: ForeignKey<"I18n">;
187
+ i18n?: I18n.UpdateOperation;
180
188
  } | {
181
189
  entity: "i18n";
182
190
  entityId: ForeignKey<"I18n">;
@@ -289,6 +297,10 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
289
297
  actionAuth?: ActionAuth.CreateSingleOperation | ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
290
298
  entityId?: never;
291
299
  entity?: never;
300
+ } | {
301
+ i18n?: I18n.CreateSingleOperation | I18n.UpdateOperation | I18n.RemoveOperation;
302
+ entityId?: never;
303
+ entity?: never;
292
304
  } | {
293
305
  path?: Path.CreateSingleOperation | Path.UpdateOperation | Path.RemoveOperation;
294
306
  entityId?: never;
@@ -337,6 +349,8 @@ export type RemoveOperationData = {} & (({
337
349
  modi?: Modi.UpdateOperation | Modi.RemoveOperation;
338
350
  })) & ({
339
351
  actionAuth?: ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
352
+ } | {
353
+ i18n?: I18n.UpdateOperation | I18n.RemoveOperation;
340
354
  } | {
341
355
  path?: Path.UpdateOperation | Path.RemoveOperation;
342
356
  } | {
@@ -174,6 +174,14 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
174
174
  entity: "actionAuth";
175
175
  entityId: ForeignKey<"ActionAuth">;
176
176
  actionAuth?: never;
177
+ } | {
178
+ entity?: never;
179
+ entityId?: never;
180
+ i18n: I18n.CreateSingleOperation;
181
+ } | {
182
+ entity: "i18n";
183
+ entityId: ForeignKey<"I18n">;
184
+ i18n?: I18n.UpdateOperation;
177
185
  } | {
178
186
  entity: "i18n";
179
187
  entityId: ForeignKey<"I18n">;
@@ -280,6 +288,10 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
280
288
  actionAuth?: ActionAuth.CreateSingleOperation | ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
281
289
  entityId?: never;
282
290
  entity?: never;
291
+ } | {
292
+ i18n?: I18n.CreateSingleOperation | I18n.UpdateOperation | I18n.RemoveOperation;
293
+ entityId?: never;
294
+ entity?: never;
283
295
  } | {
284
296
  path?: Path.CreateSingleOperation | Path.UpdateOperation | Path.RemoveOperation;
285
297
  entityId?: never;
@@ -326,6 +338,8 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
326
338
  export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
327
339
  export type RemoveOperationData = {} & ({
328
340
  actionAuth?: ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
341
+ } | {
342
+ i18n?: I18n.UpdateOperation | I18n.RemoveOperation;
329
343
  } | {
330
344
  path?: Path.UpdateOperation | Path.RemoveOperation;
331
345
  } | {
@@ -0,0 +1,3 @@
1
+ import { EntityDict } from "./EntityDict";
2
+ import { StyleDict } from "../types/Style";
3
+ export declare const styleDict: StyleDict<EntityDict>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.styleDict = void 0;
4
+ const Style_1 = require("./Modi/Style");
5
+ const Style_2 = require("./User/Style");
6
+ exports.styleDict = {
7
+ modi: Style_1.style,
8
+ user: Style_2.style
9
+ };
@@ -6,6 +6,6 @@ export type ParticularAction = UserAction;
6
6
  export declare const actions: string[];
7
7
  export declare const UserActionDef: ActionDef<UserAction, UserState>;
8
8
  export type Action = GenericAction | ParticularAction | RelationAction | string;
9
- export declare const ActionDefDict: {
9
+ export declare const actionDefDict: {
10
10
  userState: ActionDef<string, string>;
11
11
  };
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionDefDict = exports.UserActionDef = exports.actions = void 0;
3
+ exports.actionDefDict = exports.UserActionDef = exports.actions = void 0;
4
4
  exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "grant", "revoke", "mergeTo"];
5
5
  exports.UserActionDef = {
6
6
  stm: {
7
7
  mergeTo: ['normal', 'merged'],
8
8
  },
9
9
  };
10
- exports.ActionDefDict = {
10
+ exports.actionDefDict = {
11
11
  userState: exports.UserActionDef
12
12
  };
@@ -0,0 +1,3 @@
1
+ import { EntityDef } from "./Schema";
2
+ import { StyleDef } from "../../types/Style";
3
+ export declare const style: StyleDef<EntityDef["OpSchema"], EntityDef["Action"]>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.style = void 0;
4
+ exports.style = {
5
+ icon: {
6
+ mergeTo: '',
7
+ },
8
+ color: {
9
+ userState: {
10
+ normal: '#112233',
11
+ merged: '#223344',
12
+ }
13
+ }
14
+ };
@@ -2,3 +2,4 @@ export * from './EntityDict';
2
2
  export * from './Storage';
3
3
  export * from './ActionDefDict';
4
4
  export * from './Relation';
5
+ export * from './StyleDict';
@@ -5,3 +5,4 @@ tslib_1.__exportStar(require("./EntityDict"), exports);
5
5
  tslib_1.__exportStar(require("./Storage"), exports);
6
6
  tslib_1.__exportStar(require("./ActionDefDict"), exports);
7
7
  tslib_1.__exportStar(require("./Relation"), exports);
8
+ tslib_1.__exportStar(require("./StyleDict"), exports);
@@ -0,0 +1,21 @@
1
+ type DepNode = {
2
+ name: string;
3
+ parent?: DepNode;
4
+ };
5
+ type DepGraph = {
6
+ nodeDict: Record<string, DepNode>;
7
+ roots: DepNode[];
8
+ ascOrder: string[];
9
+ };
10
+ /**
11
+ * 构建项目依赖关系图
12
+ * @param cwd
13
+ * @returns
14
+ */
15
+ export declare function analyzeDepedency(cwd: string): DepGraph;
16
+ /**
17
+ * 本函数用于构建src/initialize.dev, src/initialize.prod, src/initializeFeatures, src/context/FrontendContext, src/contextBackendContext
18
+ * 这些和dependency相关的项目文件
19
+ */
20
+ export default function buildDependency(rebuild?: boolean): void;
21
+ export {};