oak-domain 1.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 (89) hide show
  1. package/lib/OakError.d.ts +7 -0
  2. package/lib/OakError.js +29 -0
  3. package/lib/actions/action.d.ts +6 -0
  4. package/lib/actions/action.js +12 -0
  5. package/lib/actions/relation.d.ts +1 -0
  6. package/lib/actions/relation.js +2 -0
  7. package/lib/compiler/env.d.ts +10 -0
  8. package/lib/compiler/env.js +26 -0
  9. package/lib/compiler/schemalBuilder.d.ts +2 -0
  10. package/lib/compiler/schemalBuilder.js +2738 -0
  11. package/lib/compiler/uiBuilder.d.ts +1 -0
  12. package/lib/compiler/uiBuilder.js +3 -0
  13. package/lib/compiler/utils.d.ts +2 -0
  14. package/lib/compiler/utils.js +11 -0
  15. package/lib/store/CascadeStore.d.ts +38 -0
  16. package/lib/store/CascadeStore.js +681 -0
  17. package/lib/store/TriggerExecutor.d.ts +30 -0
  18. package/lib/store/TriggerExecutor.js +549 -0
  19. package/lib/store/UniversalContext.d.ts +26 -0
  20. package/lib/store/UniversalContext.js +208 -0
  21. package/lib/store/actionDef.d.ts +8 -0
  22. package/lib/store/actionDef.js +241 -0
  23. package/lib/store/filter.d.ts +36 -0
  24. package/lib/store/filter.js +121 -0
  25. package/lib/store/relation.d.ts +13 -0
  26. package/lib/store/relation.js +64 -0
  27. package/lib/store/watchers.d.ts +2 -0
  28. package/lib/store/watchers.js +32 -0
  29. package/lib/types/Action.d.ts +14 -0
  30. package/lib/types/Action.js +2 -0
  31. package/lib/types/AppLoader.d.ts +11 -0
  32. package/lib/types/AppLoader.js +10 -0
  33. package/lib/types/Aspect.d.ts +12 -0
  34. package/lib/types/Aspect.js +4 -0
  35. package/lib/types/Auth.d.ts +28 -0
  36. package/lib/types/Auth.js +2 -0
  37. package/lib/types/Connector.d.ts +26 -0
  38. package/lib/types/Connector.js +9 -0
  39. package/lib/types/Context.d.ts +14 -0
  40. package/lib/types/Context.js +3 -0
  41. package/lib/types/DataType.d.ts +17 -0
  42. package/lib/types/DataType.js +5 -0
  43. package/lib/types/Demand.d.ts +77 -0
  44. package/lib/types/Demand.js +9 -0
  45. package/lib/types/Entity.d.ts +138 -0
  46. package/lib/types/Entity.js +8 -0
  47. package/lib/types/Exception.d.ts +48 -0
  48. package/lib/types/Exception.js +178 -0
  49. package/lib/types/Expression.d.ts +132 -0
  50. package/lib/types/Expression.js +378 -0
  51. package/lib/types/Geo.d.ts +18 -0
  52. package/lib/types/Geo.js +2 -0
  53. package/lib/types/Locale.d.ts +24 -0
  54. package/lib/types/Locale.js +2 -0
  55. package/lib/types/Logger.d.ts +5 -0
  56. package/lib/types/Logger.js +3 -0
  57. package/lib/types/Polyfill.d.ts +23 -0
  58. package/lib/types/Polyfill.js +2 -0
  59. package/lib/types/RowStore.d.ts +22 -0
  60. package/lib/types/RowStore.js +33 -0
  61. package/lib/types/Storage.d.ts +48 -0
  62. package/lib/types/Storage.js +2 -0
  63. package/lib/types/Trigger.d.ts +105 -0
  64. package/lib/types/Trigger.js +24 -0
  65. package/lib/types/Txn.d.ts +2 -0
  66. package/lib/types/Txn.js +3 -0
  67. package/lib/types/Watcher.d.ts +19 -0
  68. package/lib/types/Watcher.js +4 -0
  69. package/lib/types/index.d.ts +18 -0
  70. package/lib/types/index.js +30 -0
  71. package/lib/types/schema/DataTypes.d.ts +32 -0
  72. package/lib/types/schema/DataTypes.js +3 -0
  73. package/lib/utils/SimpleConnector.d.ts +29 -0
  74. package/lib/utils/SimpleConnector.js +145 -0
  75. package/lib/utils/assert.d.ts +5 -0
  76. package/lib/utils/assert.js +11 -0
  77. package/lib/utils/concurrent.d.ts +15 -0
  78. package/lib/utils/concurrent.js +138 -0
  79. package/lib/utils/geo.d.ts +4 -0
  80. package/lib/utils/geo.js +24 -0
  81. package/lib/utils/lodash.d.ts +16 -0
  82. package/lib/utils/lodash.js +32 -0
  83. package/lib/utils/string.d.ts +2 -0
  84. package/lib/utils/string.js +11 -0
  85. package/lib/utils/uuid.d.ts +2 -0
  86. package/lib/utils/uuid.js +11 -0
  87. package/lib/utils/validator.d.ts +23 -0
  88. package/lib/utils/validator.js +123 -0
  89. package/package.json +38 -0
@@ -0,0 +1 @@
1
+ declare function outputElement(): void;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ function outputElement() {
3
+ }
@@ -0,0 +1,2 @@
1
+ export declare function firstLetterLowerCase(s: string): string;
2
+ export declare function firstLetterUpperCase(s: string): string;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.firstLetterUpperCase = exports.firstLetterLowerCase = void 0;
4
+ function firstLetterLowerCase(s) {
5
+ return s.slice(0, 1).toLowerCase().concat(s.slice(1));
6
+ }
7
+ exports.firstLetterLowerCase = firstLetterLowerCase;
8
+ function firstLetterUpperCase(s) {
9
+ return s.slice(0, 1).toUpperCase().concat(s.slice(1));
10
+ }
11
+ exports.firstLetterUpperCase = firstLetterUpperCase;
@@ -0,0 +1,38 @@
1
+ import { Context } from '../types/Context';
2
+ import { DeduceCreateMultipleOperation, DeduceCreateOperation, DeduceCreateSingleOperation, DeduceRemoveOperation, DeduceUpdateOperation, EntityDict, OperateOption, SelectOption, OperationResult, SelectRowShape } from "../types/Entity";
3
+ import { RowStore } from '../types/RowStore';
4
+ import { StorageSchema } from '../types/Storage';
5
+ /**这个用来处理级联的select和update,对不同能力的 */
6
+ export declare abstract class CascadeStore<ED extends EntityDict, Cxt extends Context<ED>> extends RowStore<ED, Cxt> {
7
+ constructor(storageSchema: StorageSchema<ED>);
8
+ protected abstract supportManyToOneJoin(): boolean;
9
+ protected abstract supportMultipleCreate(): boolean;
10
+ protected abstract selectAbjointRow<T extends keyof ED, S extends ED[T]['Selection'], OP extends SelectOption>(entity: T, selection: S, context: Cxt, option?: OP): Promise<SelectRowShape<ED[T]['Schema'], S['data']>[]>;
11
+ protected abstract updateAbjointRow<T extends keyof ED, OP extends OperateOption>(entity: T, operation: DeduceCreateMultipleOperation<ED[T]['Schema']> | DeduceCreateSingleOperation<ED[T]['Schema']> | DeduceUpdateOperation<ED[T]['Schema']> | DeduceRemoveOperation<ED[T]['Schema']>, context: Cxt, option?: OP): Promise<number>;
12
+ protected cascadeSelect<T extends keyof ED, S extends ED[T]['Selection'], OP extends SelectOption>(entity: T, selection: S, context: Cxt, option?: OP): Promise<SelectRowShape<ED[T]['Schema'], S['data']>[]>;
13
+ /**
14
+ * 级联更新
15
+ * A --> B
16
+ 多对一:A CREATE/B CREATE,B data的主键赋到A的data上
17
+ A CREATE/B UPDATE,B filter的主键来自A的data
18
+ A UPDATE/B CREATE,B data的主键赋到A的data上
19
+ A UPDATE/B UPDATE,B filter的主键来自A的row
20
+ A UPDATE/B REMOVE,B filter的主键来自A的row
21
+ A REMOVE/B UPDATE,B filter的主键来自A的row
22
+ A REMOVE/B REMOVE,B filter的主键来自A的row
23
+
24
+ 一对多:A CREATE/B CREATE,A data上的主键赋到B的data上
25
+ A CREATE/B UPDATE,A data上的主键赋到B的data上
26
+ A UPDATE/B CREATE,A filter上的主键赋到B的data上(一定是带主键的filter)
27
+ A UPDATE/B UPDATE,A filter上的主键赋到B的filter上(一定是带主键的filter)
28
+ A UPDATE/B REMOVE,A filter上的主键赋到B的filter上(一定是带主键的filter)
29
+ A REMOVE/B UPDATE,A filter上的主键赋到B的filter上(且B关于A的外键清空)
30
+ A REMOVE/B REMOVE,A filter上的主键赋到B的filter上
31
+ * @param entity
32
+ * @param operation
33
+ * @param context
34
+ * @param option
35
+ */
36
+ protected cascadeUpdate<T extends keyof ED, OP extends OperateOption>(entity: T, operation: DeduceCreateOperation<ED[T]['Schema']> | DeduceUpdateOperation<ED[T]['Schema']> | DeduceRemoveOperation<ED[T]['Schema']>, context: Cxt, option?: OP): Promise<OperationResult<ED>>;
37
+ judgeRelation(entity: keyof ED, attr: string): string | string[] | 1 | 0 | 2;
38
+ }