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,7 @@
1
+ export declare type OakErrorDef = [number, string];
2
+ export declare type OakErrorDefDict = Record<string, OakErrorDef>;
3
+ export declare class OakError extends Error {
4
+ $$level: string;
5
+ $$code?: number;
6
+ constructor(level: string, def?: OakErrorDef, message?: string);
7
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.OakError = void 0;
19
+ var OakError = /** @class */ (function (_super) {
20
+ __extends(OakError, _super);
21
+ function OakError(level, def, message) {
22
+ var _this = _super.call(this, message ? message : def && def[1]) || this;
23
+ _this.$$level = level;
24
+ _this.$$code = def && def[0];
25
+ return _this;
26
+ }
27
+ return OakError;
28
+ }(Error));
29
+ exports.OakError = OakError;
@@ -0,0 +1,6 @@
1
+ import { ActionDef } from '../types/Action';
2
+ export declare type GenericAction = 'create' | 'update' | 'remove' | 'select' | 'count' | 'stat' | 'download';
3
+ export declare const genericActions: string[];
4
+ export declare type AbleAction = 'enable' | 'disable';
5
+ export declare type AbleState = 'enabled' | 'disabled';
6
+ export declare const makeAbleActionDef: (initialState?: AbleState) => ActionDef<AbleAction, AbleState>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeAbleActionDef = exports.genericActions = void 0;
4
+ exports.genericActions = ['create', 'update', 'remove', 'count', 'stat', 'download', 'select'];
5
+ var makeAbleActionDef = function (initialState) { return ({
6
+ stm: {
7
+ enable: ['disabled', 'enabled'],
8
+ disable: ['enabled', 'disabled'],
9
+ },
10
+ is: initialState,
11
+ }); };
12
+ exports.makeAbleActionDef = makeAbleActionDef;
@@ -0,0 +1 @@
1
+ export declare type GenericRelation = 'owner';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ export declare const LIB_OAK_DOMAIN = "oak-domain";
2
+ export declare const ROOT_PATH_IN_OAK_DOMAIN: () => string;
3
+ export declare const ENTITY_PATH_IN_OAK_GENERAL_BUSINESS: () => string;
4
+ export declare const TYPE_PATH_IN_OAK_DOMAIN: () => string;
5
+ export declare const ACTION_CONSTANT_IN_OAK_DOMAIN: () => string;
6
+ export declare const RESERVED_ENTITIES: string[];
7
+ export declare const STRING_LITERAL_MAX_LENGTH = 16;
8
+ export declare const NUMERICAL_LITERL_DEFAULT_PRECISION = 8;
9
+ export declare const NUMERICAL_LITERL_DEFAULT_SCALE = 2;
10
+ export declare const INT_LITERL_DEFAULT_WIDTH = 4;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INT_LITERL_DEFAULT_WIDTH = exports.NUMERICAL_LITERL_DEFAULT_SCALE = exports.NUMERICAL_LITERL_DEFAULT_PRECISION = exports.STRING_LITERAL_MAX_LENGTH = exports.RESERVED_ENTITIES = exports.ACTION_CONSTANT_IN_OAK_DOMAIN = exports.TYPE_PATH_IN_OAK_DOMAIN = exports.ENTITY_PATH_IN_OAK_GENERAL_BUSINESS = exports.ROOT_PATH_IN_OAK_DOMAIN = exports.LIB_OAK_DOMAIN = void 0;
4
+ exports.LIB_OAK_DOMAIN = 'oak-domain';
5
+ var LIB_OAK_GENERAL_BUSINESS = 'oak-general-business';
6
+ var ROOT_PATH_IN_OAK_DOMAIN = function () { return 'lib'; };
7
+ exports.ROOT_PATH_IN_OAK_DOMAIN = ROOT_PATH_IN_OAK_DOMAIN;
8
+ var LEVEL_PREFIX = ['.', '..', '../..', '../../..', '../../../..'];
9
+ var ENTITY_PATH_IN_OAK_GENERAL_BUSINESS = function () {
10
+ return "".concat(LIB_OAK_GENERAL_BUSINESS, "/").concat((0, exports.ROOT_PATH_IN_OAK_DOMAIN)(), "/entities/");
11
+ };
12
+ exports.ENTITY_PATH_IN_OAK_GENERAL_BUSINESS = ENTITY_PATH_IN_OAK_GENERAL_BUSINESS;
13
+ var TYPE_PATH_IN_OAK_DOMAIN = function () {
14
+ return "".concat(exports.LIB_OAK_DOMAIN, "/").concat((0, exports.ROOT_PATH_IN_OAK_DOMAIN)(), "/types/");
15
+ };
16
+ exports.TYPE_PATH_IN_OAK_DOMAIN = TYPE_PATH_IN_OAK_DOMAIN;
17
+ var ACTION_CONSTANT_IN_OAK_DOMAIN = function () {
18
+ return "".concat(exports.LIB_OAK_DOMAIN, "/").concat((0, exports.ROOT_PATH_IN_OAK_DOMAIN)(), "/actions/action");
19
+ };
20
+ exports.ACTION_CONSTANT_IN_OAK_DOMAIN = ACTION_CONSTANT_IN_OAK_DOMAIN;
21
+ // export const OUTPUT_PATH = 'app-domain/entities';
22
+ exports.RESERVED_ENTITIES = ['Schema', 'Filter', 'Query', 'SubQuery', 'Entity', 'Selection', 'Operation', 'File', 'Common', 'Locale', 'Projection', 'Data'];
23
+ exports.STRING_LITERAL_MAX_LENGTH = 16;
24
+ exports.NUMERICAL_LITERL_DEFAULT_PRECISION = 8;
25
+ exports.NUMERICAL_LITERL_DEFAULT_SCALE = 2;
26
+ exports.INT_LITERL_DEFAULT_WIDTH = 4;
@@ -0,0 +1,2 @@
1
+ export declare function analyzeEntities(inputDir: string): void;
2
+ export declare function buildSchema(outputDir: string): void;