@adaas/a-concept 0.2.13 → 0.3.1

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 (141) hide show
  1. package/.conf/tsconfig.base.json +91 -0
  2. package/.conf/tsconfig.browser.json +36 -0
  3. package/.conf/tsconfig.node.json +40 -0
  4. package/dist/browser/index.d.mts +4166 -212
  5. package/dist/browser/index.mjs +2 -67
  6. package/dist/browser/index.mjs.map +1 -1
  7. package/dist/node/index.cjs +5761 -0
  8. package/dist/node/index.cjs.map +1 -0
  9. package/dist/node/index.d.mts +4193 -212
  10. package/dist/node/index.d.ts +4193 -212
  11. package/dist/node/index.mjs +5699 -66
  12. package/dist/node/index.mjs.map +1 -1
  13. package/jest.config.ts +30 -15
  14. package/package.json +19 -18
  15. package/src/env/env-browser.ts +38 -1
  16. package/src/env/env-node.ts +26 -2
  17. package/src/env/env.base.ts +20 -1
  18. package/src/env/global.browser.d.ts +1 -1
  19. package/src/helpers/A_BasicTypeGuards.helper.ts +81 -0
  20. package/src/helpers/A_Common.helper.ts +2 -2
  21. package/src/helpers/A_Identity.helper.ts +2 -4
  22. package/src/helpers/A_TypeGuards.helper.ts +45 -30
  23. package/src/helpers/index.ts +5 -0
  24. package/src/index.ts +21 -94
  25. package/src/{global → lib}/A-Abstraction/A-Abstraction-Extend.decorator.ts +18 -13
  26. package/src/{global → lib}/A-Abstraction/A-Abstraction.class.ts +5 -5
  27. package/src/{global → lib}/A-Abstraction/A-Abstraction.error.ts +1 -1
  28. package/src/{global → lib}/A-Abstraction/A-Abstraction.types.ts +5 -5
  29. package/src/lib/A-Abstraction/index.ts +8 -0
  30. package/src/{global → lib}/A-Caller/A_Caller.class.ts +3 -4
  31. package/src/{global → lib}/A-Caller/A_Caller.error.ts +1 -4
  32. package/src/{global → lib}/A-Caller/A_Caller.types.ts +4 -4
  33. package/src/lib/A-Caller/index.ts +3 -0
  34. package/src/{global → lib}/A-Component/A-Component.class.ts +2 -3
  35. package/src/{global → lib}/A-Component/A-Component.meta.ts +5 -5
  36. package/src/{global → lib}/A-Component/A-Component.types.ts +5 -5
  37. package/src/lib/A-Component/index.ts +5 -0
  38. package/src/{global → lib}/A-Concept/A-Concept.class.ts +9 -7
  39. package/src/{global → lib}/A-Concept/A-Concept.meta.ts +2 -2
  40. package/src/{global → lib}/A-Concept/A-Concept.types.ts +7 -7
  41. package/src/lib/A-Concept/index.ts +4 -0
  42. package/src/{global → lib}/A-Container/A-Container.class.ts +3 -3
  43. package/src/{global → lib}/A-Container/A-Container.meta.ts +11 -6
  44. package/src/{global → lib}/A-Container/A-Container.types.ts +9 -6
  45. package/src/lib/A-Container/index.ts +5 -0
  46. package/src/{global → lib}/A-Context/A-Context.class.ts +41 -33
  47. package/src/{global → lib}/A-Context/A-Context.error.ts +1 -1
  48. package/src/lib/A-Context/A-Context.types.ts +14 -0
  49. package/src/lib/A-Context/index.ts +5 -0
  50. package/src/{global → lib}/A-Dependency/A-Dependency-All.decorator.ts +11 -11
  51. package/src/{global → lib}/A-Dependency/A-Dependency-Default.decorator.ts +11 -9
  52. package/src/{global → lib}/A-Dependency/A-Dependency-Flat.decorator.ts +11 -8
  53. package/src/{global → lib}/A-Dependency/A-Dependency-Load.decorator.ts +11 -9
  54. package/src/{global → lib}/A-Dependency/A-Dependency-Parent.decorator.ts +11 -9
  55. package/src/{global → lib}/A-Dependency/A-Dependency-Require.decorator.ts +11 -9
  56. package/src/{global → lib}/A-Dependency/A-Dependency.class.ts +9 -3
  57. package/src/{global → lib}/A-Dependency/A-Dependency.error.ts +1 -1
  58. package/src/{global → lib}/A-Dependency/A-Dependency.types.ts +9 -9
  59. package/src/lib/A-Dependency/index.ts +17 -0
  60. package/src/{global → lib}/A-Entity/A-Entity.class.ts +11 -9
  61. package/src/{global → lib}/A-Entity/A-Entity.error.ts +1 -1
  62. package/src/{global → lib}/A-Entity/A-Entity.meta.ts +3 -3
  63. package/src/{global → lib}/A-Entity/A-Entity.types.ts +5 -5
  64. package/src/lib/A-Entity/index.ts +5 -0
  65. package/src/{global → lib}/A-Error/A_Error.class.ts +13 -13
  66. package/src/{global → lib}/A-Error/A_Error.types.ts +2 -2
  67. package/src/lib/A-Error/index.ts +3 -0
  68. package/src/{global → lib}/A-Feature/A-Feature-Define.decorator.ts +16 -10
  69. package/src/{global → lib}/A-Feature/A-Feature-Extend.decorator.ts +13 -9
  70. package/src/{global → lib}/A-Feature/A-Feature.class.ts +15 -13
  71. package/src/{global → lib}/A-Feature/A-Feature.error.ts +2 -2
  72. package/src/{global → lib}/A-Feature/A-Feature.types.ts +21 -12
  73. package/src/lib/A-Feature/index.ts +13 -0
  74. package/src/{global → lib}/A-Fragment/A-Fragment.class.ts +0 -2
  75. package/src/{global → lib}/A-Fragment/A-Fragment.types.ts +1 -1
  76. package/src/lib/A-Fragment/index.ts +5 -0
  77. package/src/{global → lib}/A-Inject/A-Inject.decorator.ts +42 -24
  78. package/src/{global → lib}/A-Inject/A-Inject.error.ts +1 -1
  79. package/src/{global → lib}/A-Inject/A-Inject.types.ts +3 -9
  80. package/src/lib/A-Inject/index.ts +3 -0
  81. package/src/{global → lib}/A-Meta/A-Meta.decorator.ts +2 -2
  82. package/src/{global → lib}/A-Meta/A-Meta.types.ts +18 -10
  83. package/src/lib/A-Meta/index.ts +11 -0
  84. package/src/{global → lib}/A-Scope/A-Scope.class.ts +34 -24
  85. package/src/{global → lib}/A-Scope/A-Scope.error.ts +1 -1
  86. package/src/{global → lib}/A-Scope/A-Scope.types.ts +22 -14
  87. package/src/lib/A-Scope/index.ts +5 -0
  88. package/src/{global → lib}/A-Stage/A-Stage.class.ts +9 -10
  89. package/src/{global → lib}/A-Stage/A-Stage.error.ts +1 -1
  90. package/src/{global → lib}/A-Stage/A-Stage.types.ts +1 -4
  91. package/src/lib/A-Stage/index.ts +5 -0
  92. package/src/{global → lib}/A-StepManager/A-StepManager.class.ts +8 -4
  93. package/src/{global → lib}/A-StepManager/A-StepManager.error.ts +1 -1
  94. package/src/lib/A-StepManager/index.ts +4 -0
  95. package/src/{global → lib}/ASEID/ASEID.class.ts +20 -23
  96. package/src/lib/ASEID/ASEID.error.ts +12 -0
  97. package/src/lib/ASEID/index.ts +4 -0
  98. package/src/types/A_identity.types.ts +4 -0
  99. package/src/types/index.ts +2 -0
  100. package/tests/A-Abstraction.test.ts +6 -6
  101. package/tests/A-Common.test.ts +6 -4
  102. package/tests/A-Component.test.ts +7 -5
  103. package/tests/A-Concept.test.ts +13 -11
  104. package/tests/A-Container.test.ts +4 -3
  105. package/tests/A-Dependency.test.ts +6 -1
  106. package/tests/A-Entity.test.ts +7 -5
  107. package/tests/A-Error.test.ts +7 -4
  108. package/tests/A-Feature.test.ts +12 -8
  109. package/tests/A-Fragment.test.ts +1 -2
  110. package/tests/A-Inject.test.ts +4 -1
  111. package/tests/A-Meta.test.ts +12 -10
  112. package/tests/A-Scope.test.ts +11 -10
  113. package/tests/A-StepManager.test.ts +3 -3
  114. package/tests/ASEID.test.ts +2 -2
  115. package/tests/jest.setup.ts +23 -23
  116. package/tsconfig.json +59 -97
  117. package/tsup.config.ts +25 -13
  118. package/dist/browser/A-Context.types-BtR_HJ0j.d.mts +0 -3828
  119. package/dist/browser/env.d.mts +0 -64
  120. package/dist/browser/env.mjs +0 -3
  121. package/dist/browser/env.mjs.map +0 -1
  122. package/dist/node/A-Context.types-BtR_HJ0j.d.mts +0 -3828
  123. package/dist/node/A-Context.types-BtR_HJ0j.d.ts +0 -3828
  124. package/dist/node/env.d.mts +0 -91
  125. package/dist/node/env.d.ts +0 -91
  126. package/dist/node/env.js +0 -12
  127. package/dist/node/env.js.map +0 -1
  128. package/dist/node/env.mjs +0 -3
  129. package/dist/node/env.mjs.map +0 -1
  130. package/dist/node/index.js +0 -387
  131. package/dist/node/index.js.map +0 -1
  132. package/src/global/A-Context/A-Context.types.ts +0 -14
  133. package/src/global/ASEID/ASEID.error.ts +0 -12
  134. /package/src/{global → lib}/A-Component/A-Component.constants.ts +0 -0
  135. /package/src/{global → lib}/A-Concept/A-Concept.constants.ts +0 -0
  136. /package/src/{global → lib}/A-Container/A-Container.constants.ts +0 -0
  137. /package/src/{global → lib}/A-Entity/A-Entity.constants.ts +0 -0
  138. /package/src/{global → lib}/A-Error/A_Error.constants.ts +0 -0
  139. /package/src/{global → lib}/A-Meta/A-Meta.class.ts +0 -0
  140. /package/src/{global → lib}/ASEID/ASEID.constants.ts +0 -0
  141. /package/src/{global → lib}/ASEID/ASEID.types.ts +0 -0
package/jest.config.ts CHANGED
@@ -2,22 +2,37 @@ import type { Config } from '@jest/types';
2
2
 
3
3
  // Sync object
4
4
  const config: Config.InitialOptions = {
5
- verbose: true,
5
+ displayName: 'adaas-a-concept',
6
+ preset: 'ts-jest',
7
+ testEnvironment: 'node',
8
+ resetModules: true,
9
+ rootDir: '.',
10
+ testMatch: ['<rootDir>/tests/**/*.test.ts'],
6
11
  setupFilesAfterEnv: ['<rootDir>/tests/jest.setup.ts'],
7
- roots: ['<rootDir>/tests'],
8
- transform: {
9
- '^.+\\.tsx?$': 'ts-jest'
10
- },
11
12
  moduleNameMapper: {
12
- "@adaas/a-concept/constants/(.*)": ["<rootDir>/src/constants/$1"],
13
- "@adaas/a-concept/env": ["<rootDir>/src/env/index.node.ts"],
14
- "@adaas/a-concept/global/(.*)": ["<rootDir>/src/global/$1"],
15
- "@adaas/a-concept/types/(.*)": ["<rootDir>/src/types/$1"],
16
- "@adaas/a-concept/helpers/(.*)": ["<rootDir>/src/helpers/$1"],
17
- "@adaas/a-concept/decorators/(.*)": ["<rootDir>/src/decorators/$1"],
18
- "@adaas/a-concept/base/(.*)": ["<rootDir>/src/base/$1"],
19
- "@adaas/a-concept/utils/(.*)": ["<rootDir>/src/utils/$1"]
20
- }
21
-
13
+ '^@adaas/a-concept/constants/(.*)$': '<rootDir>/src/constants/$1',
14
+ '^@adaas/a-concept/utils/(.*)$': '<rootDir>/src/utils/$1',
15
+ '^@adaas/a-concept/env$': '<rootDir>/src/env/index.node.ts',
16
+ '^@adaas/a-concept/helpers/(.*)$': '<rootDir>/src/helpers/$1',
17
+ '^@adaas/a-concept/types$': '<rootDir>/src/types',
18
+ '^@adaas/a-concept/a-abstraction$': '<rootDir>/src/lib/A-Abstraction',
19
+ '^@adaas/a-concept/a-caller$': '<rootDir>/src/lib/A-Caller',
20
+ '^@adaas/a-concept/a-component$': '<rootDir>/src/lib/A-Component',
21
+ '^@adaas/a-concept/a-concept$': '<rootDir>/src/lib/A-Concept',
22
+ '^@adaas/a-concept/a-container$': '<rootDir>/src/lib/A-Container',
23
+ '^@adaas/a-concept/a-context$': '<rootDir>/src/lib/A-Context',
24
+ '^@adaas/a-concept/a-dependency$': '<rootDir>/src/lib/A-Dependency',
25
+ '^@adaas/a-concept/a-entity$': '<rootDir>/src/lib/A-Entity',
26
+ '^@adaas/a-concept/a-error$': '<rootDir>/src/lib/A-Error',
27
+ '^@adaas/a-concept/a-feature$': '<rootDir>/src/lib/A-Feature',
28
+ '^@adaas/a-concept/a-fragment$': '<rootDir>/src/lib/A-Fragment',
29
+ '^@adaas/a-concept/a-inject$': '<rootDir>/src/lib/A-Inject',
30
+ '^@adaas/a-concept/a-meta$': '<rootDir>/src/lib/A-Meta',
31
+ '^@adaas/a-concept/a-scope$': '<rootDir>/src/lib/A-Scope',
32
+ '^@adaas/a-concept/a-stage$': '<rootDir>/src/lib/A-Stage',
33
+ '^@adaas/a-concept/a-step-manager$': '<rootDir>/src/lib/A-StepManager',
34
+ '^@adaas/a-concept/aseid$': '<rootDir>/src/lib/ASEID',
35
+ },
36
+ collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts'],
22
37
  };
23
38
  export default config;
package/package.json CHANGED
@@ -1,25 +1,8 @@
1
1
  {
2
2
  "name": "@adaas/a-concept",
3
- "version": "0.2.13",
3
+ "version": "0.3.1",
4
4
  "description": "A-Concept is a framework of the new generation that is tailored to use AI, enabling developers to create AI-powered applications with ease. It provides a structured approach to building, managing, and deploying AI-driven solutions.",
5
5
  "license": "Apache-2.0",
6
- "main": "./dist/node/index.cjs",
7
- "module": "./dist/node/index.mjs",
8
- "types": "./dist/node/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "browser": "./dist/browser/index.mjs",
12
- "import": "./dist/node/index.mjs",
13
- "require": "./dist/node/index.cjs",
14
- "types": "./dist/node/index.d.ts"
15
- },
16
- "./env": {
17
- "browser": "./dist/browser/env.mjs",
18
- "import": "./dist/node/env.mjs",
19
- "require": "./dist/node/env.cjs",
20
- "types": "./dist/node/env.d.ts"
21
- }
22
- },
23
6
  "author": {
24
7
  "name": "ADAAS YAZILIM LİMİTED ŞİRKETİ",
25
8
  "email": "contact-us@adaas.org"
@@ -37,6 +20,24 @@
37
20
  "bugs": {
38
21
  "url": "https://github.com/ADAAS-org/adaas-a-concept/issues"
39
22
  },
23
+ "exports": {
24
+ ".": {
25
+ "browser": {
26
+ "types": "./dist/browser/index.d.mts",
27
+ "import": "./dist/browser/index.mjs"
28
+ },
29
+ "node": {
30
+ "types": "./dist/node/index.d.ts",
31
+ "import": "./dist/node/index.mjs",
32
+ "require": "./dist/node/index.cjs"
33
+ },
34
+ "default": {
35
+ "types": "./dist/node/index.d.ts",
36
+ "import": "./dist/node/index.mjs",
37
+ "require": "./dist/node/index.cjs"
38
+ }
39
+ }
40
+ },
40
41
  "sideEffects": false,
41
42
  "nodemonConfig": {
42
43
  "ignore": [
@@ -1,5 +1,6 @@
1
- import { A_TYPES__ContextEnvironment } from "../global/A-Context/A-Context.types";
1
+ import { A_TYPES__ContextEnvironment } from "@adaas/a-concept/a-context";
2
2
  import { A_CONCEPT_BASE_ENV } from "./env.base";
3
+ import { A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY } from "../constants/env.constants";
3
4
 
4
5
 
5
6
  export class A_CONCEPT_ENV extends A_CONCEPT_BASE_ENV {
@@ -30,4 +31,40 @@ export class A_CONCEPT_ENV extends A_CONCEPT_BASE_ENV {
30
31
  }
31
32
  window.__A_CONCEPT_ENVIRONMENT_ENV__[name] = value;
32
33
  }
34
+
35
+ static getAll<T extends Record<string, string>>(): T {
36
+ const allEnv: Record<string, string> = {};
37
+
38
+ // Get all environment variables from the window object
39
+ if (window.__A_CONCEPT_ENVIRONMENT_ENV__) {
40
+ Object.keys(window.__A_CONCEPT_ENVIRONMENT_ENV__).forEach(key => {
41
+ allEnv[key] = window.__A_CONCEPT_ENVIRONMENT_ENV__![key];
42
+ });
43
+ }
44
+
45
+ // Get all default environment variables from the class
46
+ A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY.forEach(variable => {
47
+ allEnv[variable] = this.get(variable) as string;
48
+ });
49
+
50
+ return allEnv as T;
51
+ }
52
+
53
+ static getAllKeys<T extends Array<string>>(): T {
54
+ const keys = new Set<string>();
55
+
56
+ // Get all keys from the window object
57
+ if (window.__A_CONCEPT_ENVIRONMENT_ENV__) {
58
+ Object.keys(window.__A_CONCEPT_ENVIRONMENT_ENV__).forEach(key => {
59
+ keys.add(key);
60
+ });
61
+ }
62
+
63
+ // Get all default environment variable keys from the class
64
+ A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY.forEach(variable => {
65
+ keys.add(variable);
66
+ });
67
+
68
+ return Array.from(keys) as T;
69
+ }
33
70
  };
@@ -1,5 +1,5 @@
1
- import { A_CONSTANTS__DEFAULT_ENV_VARIABLES } from "../constants/env.constants";
2
- import { A_TYPES__ContextEnvironment } from "../global/A-Context/A-Context.types";
1
+ import { A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY } from "@adaas/a-concept/constants/env.constants";
2
+ import { A_TYPES__ContextEnvironment } from "@adaas/a-concept/a-context";
3
3
  import { A_CONCEPT_BASE_ENV } from "./env.base";
4
4
 
5
5
  export class A_CONCEPT_ENV extends A_CONCEPT_BASE_ENV {
@@ -63,4 +63,28 @@ export class A_CONCEPT_ENV extends A_CONCEPT_BASE_ENV {
63
63
  static set(name: string, value: string): void {
64
64
  process.env[name] = value;
65
65
  }
66
+
67
+
68
+ static getAll<T extends Record<string, any>>(): T {
69
+ const allEnv: Record<string, any> = {};
70
+
71
+ // Get all environment variables from process.env
72
+ for (const key in process.env) {
73
+ allEnv[key] = process.env[key];
74
+ }
75
+
76
+ // Get all default environment variables defined in A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY
77
+ A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY.forEach((variable) => {
78
+ allEnv[variable] = this.get(variable);
79
+ });
80
+
81
+ return allEnv as T
82
+ }
83
+
84
+ static getAllKeys<T extends Array<string>>(): T {
85
+ return [
86
+ ...Object.keys(process.env),
87
+ ...A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY
88
+ ] as T;
89
+ }
66
90
  }
@@ -1,4 +1,5 @@
1
- import { A_TYPES__ContextEnvironment } from "../global/A-Context/A-Context.types";
1
+ import { A_TYPES__ContextEnvironment } from "@adaas/a-concept/a-context";
2
+ import { A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY } from "../constants/env.constants";
2
3
 
3
4
  export class A_CONCEPT_BASE_ENV {
4
5
  // ----------------------------------------------------------
@@ -73,4 +74,22 @@ export class A_CONCEPT_BASE_ENV {
73
74
  (this as any)[name] = value;
74
75
  }
75
76
 
77
+ /**
78
+ * This method returns all the environment variables that are available in the application. It combines the variables from process.env and the default environment variables defined in A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY.
79
+ *
80
+ * @returns
81
+ */
82
+ static getAll<T extends Record<string, any>>(): T {
83
+ return {} as T;
84
+ }
85
+
86
+ /**
87
+ * This method returns all the keys of the environment variables that are available in the application. It combines the keys from process.env and the default environment variables defined in A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY.
88
+ *
89
+ * @returns
90
+ */
91
+ static getAllKeys<T extends Array<string>>(): T {
92
+ return [] as any as T;
93
+ }
94
+
76
95
  }
@@ -1,4 +1,4 @@
1
- import { A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_TYPES__ConceptENVVariables } from "../constants/env.constants";
1
+ import { A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_TYPES__ConceptENVVariables } from "@adaas/a-concept/types";
2
2
  import type { RuntimeEnv } from "./env.base";
3
3
 
4
4
 
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Basic TypeGuards that don't create circular dependencies
3
+ * These are used by A_Error and other core classes
4
+ */
5
+ export class A_BasicTypeGuards {
6
+
7
+ /**
8
+ * Check if value is a string
9
+ *
10
+ * @param value
11
+ * @returns
12
+ */
13
+ static isString(value: any): value is string {
14
+ return typeof value === 'string' || value instanceof String;
15
+ }
16
+
17
+ /**
18
+ * Check if value is a number
19
+ *
20
+ * @param value
21
+ * @returns
22
+ */
23
+ static isNumber(value: any): value is number {
24
+ return typeof value === 'number' && isFinite(value);
25
+ }
26
+
27
+ /**
28
+ * Check if value is a boolean
29
+ *
30
+ * @param value
31
+ * @returns
32
+ */
33
+ static isBoolean(value: any): value is boolean {
34
+ return typeof value === 'boolean';
35
+ }
36
+
37
+ /**
38
+ * Check if value is an object
39
+ *
40
+ * @param value
41
+ * @returns
42
+ */
43
+ static isObject<T = object>(value: any): value is T {
44
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
45
+ }
46
+
47
+ /**
48
+ * Check if value is an array
49
+ *
50
+ * @param value
51
+ * @returns
52
+ */
53
+ static isArray(value: any): value is any[] {
54
+ return Array.isArray(value);
55
+ }
56
+
57
+ /**
58
+ * Allows to check if the provided param is of constructor type.
59
+ *
60
+ * @param param
61
+ * @returns
62
+ */
63
+ static isErrorConstructorType<T = any>(param: any): param is T {
64
+ return !!param && A_BasicTypeGuards.isObject(param) && !(param instanceof Error) && "title" in param;
65
+ }
66
+
67
+ static isErrorSerializedType<T = any>(param: any): param is T {
68
+ return !!param && A_BasicTypeGuards.isObject(param) && !(param instanceof Error) && "aseid" in param && A_BasicTypeGuards.isString((param as any).aseid);
69
+ }
70
+
71
+ /**
72
+ * Check if scope is of type A_Scope instance
73
+ *
74
+ * @param scope
75
+ * @returns
76
+ */
77
+ static isScopeInstance(scope: any): boolean {
78
+ // Basic check without importing A_Scope to avoid circular dependency
79
+ return !!scope && typeof scope === 'object' && 'name' in scope && 'aseid' in scope;
80
+ }
81
+ }
@@ -1,4 +1,4 @@
1
- import { A_TYPES__DeepPartial } from "../types/A_Common.types";
1
+ import { A_TYPES__DeepPartial } from "@adaas/a-concept/types";
2
2
 
3
3
  export class A_CommonHelper {
4
4
 
@@ -312,7 +312,7 @@ export class A_CommonHelper {
312
312
  if (fnAny.displayName) return String(fnAny.displayName);
313
313
  if (fnAny.name) return String(fnAny.name);
314
314
 
315
- if(fnAny.constructor && fnAny.constructor.name) {
315
+ if (fnAny.constructor && fnAny.constructor.name) {
316
316
  return String(fnAny.constructor.name);
317
317
  }
318
318
 
@@ -1,8 +1,6 @@
1
+ import { A_ID_TYPES__TimeId_Parts } from "@adaas/a-concept/types";
2
+
1
3
 
2
- export type A_ID_TYPES__TimeId_Parts = {
3
- timestamp: Date;
4
- random: string;
5
- }
6
4
 
7
5
 
8
6
  export class A_IdentityHelper {
@@ -1,36 +1,51 @@
1
+ import { A_CommonHelper } from "./A_Common.helper";
1
2
  import {
2
3
  A_TYPES__Feature_Constructor,
3
4
  A_TYPES__FeatureAvailableComponents,
4
5
  A_TYPES__FeatureExtendDecoratorTarget
5
- } from "../global/A-Feature/A-Feature.types";
6
+ } from "@adaas/a-concept/a-feature";
6
7
  import {
7
8
  A_TYPES__Error_Constructor,
8
9
  A_TYPES__Error_Init,
9
10
  A_TYPES__Error_Serialized
10
- } from "../global/A-Error/A_Error.types";
11
- import { A_Component } from "../global/A-Component/A-Component.class";
12
- import { A_ComponentMeta } from "../global/A-Component/A-Component.meta";
13
- import { A_TYPES__Component_Constructor } from "../global/A-Component/A-Component.types";
14
- import { A_Container } from "../global/A-Container/A-Container.class";
15
- import { A_ContainerMeta } from "../global/A-Container/A-Container.meta";
16
- import { A_TYPES__Container_Constructor } from "../global/A-Container/A-Container.types";
17
- import { A_Entity } from "../global/A-Entity/A-Entity.class";
18
- import { A_EntityMeta } from "../global/A-Entity/A-Entity.meta";
19
- import { A_TYPES__Entity_Constructor } from "../global/A-Entity/A-Entity.types";
20
- import { A_Feature } from "../global/A-Feature/A-Feature.class";
21
- import { A_Fragment } from "../global/A-Fragment/A-Fragment.class";
22
- import { A_TYPES__Fragment_Constructor } from "../global/A-Fragment/A-Fragment.types";
23
- import { A_Scope } from "../global/A-Scope/A-Scope.class";
24
- import { A_Caller } from "../global/A-Caller/A_Caller.class";
25
- import { A_TYPES__Caller_Constructor } from "../global/A-Caller/A_Caller.types";
26
- import { A_Error } from "../global/A-Error/A_Error.class";
27
- import { A_CommonHelper } from "./A_Common.helper";
28
- import { A_TYPES__AbstractionAvailableComponents } from "../global/A-Abstraction/A-Abstraction.types";
29
- import { A_TYPES__Scope_Constructor, A_TYPES__ScopeLinkedComponents, A_TYPES__ScopeLinkedConstructors } from "../global/A-Scope/A-Scope.types";
30
- import { A_TYPES__InjectableTargets } from "../global/A-Inject/A-Inject.types";
31
- import { ASEID } from "../global/ASEID/ASEID.class";
32
- import { A_Dependency } from "../global/A-Dependency/A-Dependency.class";
33
- import { A_TYPES__A_DependencyInjectable } from "../global/A-Dependency/A-Dependency.types";
11
+ } from "@adaas/a-concept/a-error";
12
+ import {
13
+ A_Component,
14
+ A_ComponentMeta,
15
+ A_TYPES__Component_Constructor
16
+ } from "@adaas/a-concept/a-component";
17
+ import {
18
+ A_Container,
19
+ A_ContainerMeta,
20
+ A_TYPES__Container_Constructor
21
+ } from "@adaas/a-concept/a-container";
22
+ import {
23
+ A_Entity,
24
+ A_EntityMeta,
25
+ A_TYPES__Entity_Constructor
26
+ } from "@adaas/a-concept/a-entity";
27
+ import { A_Feature } from "@adaas/a-concept/a-feature";
28
+ import {
29
+ A_TYPES__Fragment_Constructor,
30
+ A_Fragment
31
+ } from "@adaas/a-concept/a-fragment";
32
+ import {
33
+ A_Scope,
34
+ A_TYPES__Scope_Constructor,
35
+ A_TYPES__ScopeLinkedComponents,
36
+ A_TYPES__ScopeLinkedConstructors
37
+ } from "@adaas/a-concept/a-scope";
38
+ import {
39
+ A_Caller,
40
+ A_TYPES__Caller_Constructor
41
+ } from "@adaas/a-concept/a-caller";
42
+ import { A_TYPES__AbstractionAvailableComponents } from "@adaas/a-concept/a-abstraction";
43
+ import { A_TYPES__InjectableTargets } from "@adaas/a-concept/a-inject";
44
+ import { ASEID } from "@adaas/a-concept/aseid";
45
+ import {
46
+ A_Dependency,
47
+ A_TYPES__A_DependencyInjectable
48
+ } from "@adaas/a-concept/a-dependency";
34
49
 
35
50
 
36
51
 
@@ -157,7 +172,7 @@ export class A_TypeGuards {
157
172
  * @returns
158
173
  */
159
174
  static isErrorConstructor(ctor: any): ctor is A_TYPES__Error_Constructor {
160
- return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Error);
175
+ return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, Error);
161
176
  }
162
177
  /**
163
178
  * Type guard to check if the constructor is of type A_Feature
@@ -259,8 +274,8 @@ export class A_TypeGuards {
259
274
  * @param instance
260
275
  * @returns
261
276
  */
262
- static isErrorInstance(instance: any): instance is A_Error {
263
- return instance instanceof A_Error;
277
+ static isErrorInstance(instance: any): boolean {
278
+ return instance instanceof Error;
264
279
  }
265
280
  /**
266
281
  * Type guard to check if the instance is of type A_ComponentMeta
@@ -295,8 +310,8 @@ export class A_TypeGuards {
295
310
  // ==========================================================================
296
311
  // ========================= SPECIAL Type Guards =============================
297
312
  // ===========================================================================
298
- static hasASEID(value: any): value is A_Entity | A_Error {
299
- return value && typeof value === 'object' && 'aseid' && (A_TypeGuards.isEntityInstance(value) || A_TypeGuards.isErrorInstance(value));
313
+ static hasASEID(value: any): value is A_Entity | { aseid: any } {
314
+ return value && typeof value === 'object' && 'aseid' in value && (A_TypeGuards.isEntityInstance(value) || A_TypeGuards.isErrorInstance(value));
300
315
  }
301
316
 
302
317
 
@@ -0,0 +1,5 @@
1
+ export { A_CommonHelper } from './A_Common.helper';
2
+ export { A_FormatterHelper } from './A_Formatter.helper';
3
+ export { A_IdentityHelper } from './A_Identity.helper';
4
+ export { A_TypeGuards } from './A_TypeGuards.helper';
5
+ export { A_BasicTypeGuards } from './A_BasicTypeGuards.helper';
package/src/index.ts CHANGED
@@ -1,95 +1,22 @@
1
- // =================================================================================================
2
- // ============================= Export Framework Components =======================================
3
- // =================================================================================================
4
- export * from './constants/env.constants';
5
- export * from './types/A_Common.types';
6
-
7
- // ---------------------- Major Components ----------------------
8
- export { A_Context } from './global/A-Context/A-Context.class';
9
- export { A_ContextError } from './global/A-Context/A-Context.error';
10
- export * from './global/A-Context/A-Context.types';
11
-
12
- export { A_Concept } from './global/A-Concept/A-Concept.class';
13
- export { A_ConceptMeta } from './global/A-Concept/A-Concept.meta';
14
- export * from './global/A-Concept/A-Concept.types';
15
- export * from './global/A-Concept/A-Concept.constants';
16
-
17
- export { A_Container } from './global/A-Container/A-Container.class';
18
- export { A_ContainerMeta } from './global/A-Container/A-Container.meta';
19
- export * from './global/A-Container/A-Container.types';
20
- export * from './global/A-Container/A-Container.constants';
21
-
22
- export { A_Component } from './global/A-Component/A-Component.class';
23
- export { A_ComponentMeta } from './global/A-Component/A-Component.meta';
24
- export * from './global/A-Component/A-Component.types';
25
- export * from './global/A-Component/A-Component.constants';
26
-
27
- export { A_Entity } from './global/A-Entity/A-Entity.class';
28
- export { A_EntityError } from './global/A-Entity/A-Entity.error';
29
- export { A_EntityMeta } from './global/A-Entity/A-Entity.meta';
30
- export * from './global/A-Entity/A-Entity.types';
31
- export * from './global/A-Entity/A-Entity.constants';
32
-
33
-
34
- // ---------------------- Common Components ----------------------
35
- export { A_Abstraction } from './global/A-Abstraction/A-Abstraction.class';
36
- export { A_AbstractionError } from './global/A-Abstraction/A-Abstraction.error';
37
- export { A_Abstraction_Extend } from './global/A-Abstraction/A-Abstraction-Extend.decorator';
38
- export * from './global/A-Abstraction/A-Abstraction.types';
39
-
40
- export { A_Caller } from './global/A-Caller/A_Caller.class';
41
- export { A_CallerError } from './global/A-Caller/A_Caller.error';
42
- export * from './global/A-Caller/A_Caller.types';
43
-
44
- export { A_Error } from './global/A-Error/A_Error.class';
45
- export * from './global/A-Error/A_Error.types';
46
- export * from './global/A-Error/A_Error.constants';
47
-
48
- export { ASEID } from './global/ASEID/ASEID.class';
49
- export { ASEID_Error } from './global/ASEID/ASEID.error';
50
- export * from './global/ASEID/ASEID.types';
51
- // export * from './global/ASEID/ASEID.constants';
52
-
53
- export { A_Feature } from './global/A-Feature/A-Feature.class';
54
- export { A_FeatureError } from './global/A-Feature/A-Feature.error';
55
- export { A_Feature_Define } from './global/A-Feature/A-Feature-Define.decorator';
56
- export { A_Feature_Extend } from './global/A-Feature/A-Feature-Extend.decorator';
57
- export * from './global/A-Feature/A-Feature.types';
58
-
59
- export { A_Stage } from './global/A-Stage/A-Stage.class';
60
- export { A_StageError } from './global/A-Stage/A-Stage.error';
61
- export * from './global/A-Stage/A-Stage.types';
62
-
63
- export { A_Scope } from './global/A-Scope/A-Scope.class';
64
- export { A_ScopeError } from './global/A-Scope/A-Scope.error';
65
- export * from './global/A-Scope/A-Scope.types';
66
-
67
- export { A_Meta } from './global/A-Meta/A-Meta.class';
68
- export { A_MetaDecorator } from './global/A-Meta/A-Meta.decorator';
69
- export * from './global/A-Meta/A-Meta.types';
70
-
71
- export { A_Fragment } from './global/A-Fragment/A-Fragment.class';
72
- export * from './global/A-Fragment/A-Fragment.types';
73
-
74
- export { A_Dependency } from './global/A-Dependency/A-Dependency.class';
75
- export { A_DependencyError } from './global/A-Dependency/A-Dependency.error';
76
- export { A_Dependency_Require } from './global/A-Dependency/A-Dependency-Require.decorator';
77
- export { A_Dependency_Load } from './global/A-Dependency/A-Dependency-Load.decorator';
78
- export { A_Dependency_Default } from './global/A-Dependency/A-Dependency-Default.decorator';
79
- export * from './global/A-Dependency/A-Dependency.types';
80
-
81
- export { A_InjectError } from './global/A-Inject/A-Inject.error';
82
- export { A_Inject } from './global/A-Inject/A-Inject.decorator';
83
- export * from './global/A-Inject/A-Inject.types';
84
-
85
-
86
- // =================================================================================================
87
- // =============================== Export Helpers ================================================
88
- // =================================================================================================
89
- export { A_CommonHelper } from './helpers/A_Common.helper';
90
- export { A_FormatterHelper } from './helpers/A_Formatter.helper';
91
- export { A_IdentityHelper, A_ID_TYPES__TimeId_Parts } from './helpers/A_Identity.helper';
92
- export { A_StepsManager } from './global/A-StepManager/A-StepManager.class';
93
- export { A_StepManagerError } from './global/A-StepManager/A-StepManager.error';
94
- export { A_TypeGuards } from './helpers/A_TypeGuards.helper';
95
1
 
2
+ export * from '@adaas/a-concept/a-abstraction';
3
+ export * from '@adaas/a-concept/a-component';
4
+ export * from '@adaas/a-concept/a-container';
5
+ export * from '@adaas/a-concept/a-concept';
6
+ export * from '@adaas/a-concept/a-context';
7
+ export * from '@adaas/a-concept/a-dependency';
8
+ export * from '@adaas/a-concept/a-entity';
9
+ export * from '@adaas/a-concept/a-error';
10
+ export * from '@adaas/a-concept/a-inject';
11
+ export * from '@adaas/a-concept/a-meta';
12
+ export * from '@adaas/a-concept/env';
13
+ export * from '@adaas/a-concept/helpers/index';
14
+ export * from '@adaas/a-concept/types';
15
+ export * from '@adaas/a-concept/a-scope';
16
+ export * from '@adaas/a-concept/a-caller';
17
+ export * from '@adaas/a-concept/a-feature';
18
+ export * from '@adaas/a-concept/a-fragment';
19
+ export * from '@adaas/a-concept/a-stage';
20
+ export * from '@adaas/a-concept/a-step-manager';
21
+ export * from '@adaas/a-concept/aseid';
22
+ export * from '@adaas/a-concept/constants/env.constants';
@@ -2,20 +2,25 @@ import {
2
2
  A_TYPES__AbstractionDecoratorConfig,
3
3
  A_TYPES__AbstractionDecoratorDescriptor
4
4
  } from "./A-Abstraction.types";
5
- import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
6
- import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
7
- import { A_Container } from "@adaas/a-concept/global/A-Container/A-Container.class";
8
- import { A_ContainerMeta } from "@adaas/a-concept/global/A-Container/A-Container.meta";
9
- import { A_ComponentMeta } from "@adaas/a-concept/global/A-Component/A-Component.meta";
10
- import { A_Meta } from "@adaas/a-concept/global/A-Meta/A-Meta.class";
11
- import { A_TYPES__ConceptAbstractions } from "@adaas/a-concept/global/A-Concept/A-Concept.constants";
12
- import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/global/A-Container/A-Container.constants";
13
- import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/global/A-Component/A-Component.constants";
14
- import { A_TYPES__ConceptAbstraction } from "@adaas/a-concept/global/A-Concept/A-Concept.types";
5
+ import { A_Context } from "@adaas/a-concept/a-context";
6
+ import { A_Meta } from "@adaas/a-concept/a-meta";
7
+ import {
8
+ A_Container,
9
+ A_ContainerMeta,
10
+ A_TYPES__ContainerMetaKey
11
+ } from "@adaas/a-concept/a-container";
12
+ import {
13
+ A_Component,
14
+ A_TYPES__ComponentMetaKey,
15
+ A_ComponentMeta
16
+ } from "@adaas/a-concept/a-component";
17
+ import {
18
+ A_TYPES__ConceptAbstraction,
19
+ A_TYPES__ConceptAbstractions
20
+ } from "@adaas/a-concept/a-concept";
15
21
  import { A_AbstractionError } from "./A-Abstraction.error";
16
- import { A_TypeGuards } from "@adaas/a-concept/helpers/A_TypeGuards.helper";
17
- import { A_CommonHelper } from "@adaas/a-concept/helpers/A_Common.helper";
18
-
22
+ import { A_TypeGuards} from "@adaas/a-concept/helpers/A_TypeGuards.helper";
23
+ import { A_CommonHelper} from "@adaas/a-concept/helpers/A_Common.helper";
19
24
 
20
25
  /**
21
26
  * A-Abstraction Extend decorator allows to extends behavior of each concept abstraction execution.
@@ -1,9 +1,9 @@
1
- import { A_Abstraction_Extend } from "@adaas/a-concept/global/A-Abstraction/A-Abstraction-Extend.decorator";
2
- import { A_Feature } from "../A-Feature/A-Feature.class";
1
+ import { A_Abstraction_Extend } from "./A-Abstraction-Extend.decorator";
2
+ import { A_Feature } from "@adaas/a-concept/a-feature";
3
3
  import { A_TYPES__Abstraction_Init } from "./A-Abstraction.types";
4
- import { A_Scope } from "../A-Scope/A-Scope.class";
5
- import { A_Context } from "../A-Context/A-Context.class";
6
- import { A_TYPES__ConceptAbstractions } from "../A-Concept/A-Concept.constants";
4
+ import { A_Scope } from "@adaas/a-concept/a-scope";
5
+ import { A_Context } from "@adaas/a-concept/a-context";
6
+ import { A_TYPES__ConceptAbstractions } from "@adaas/a-concept/a-concept";
7
7
 
8
8
 
9
9
 
@@ -1,4 +1,4 @@
1
- import { A_Error } from "../A-Error/A_Error.class";
1
+ import { A_Error } from "@adaas/a-concept/a-error";
2
2
 
3
3
  export class A_AbstractionError extends A_Error {
4
4
  /**