@expressots/core 2.16.1 → 3.0.0-beta.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 (187) hide show
  1. package/README.md +2 -2
  2. package/lib/CHANGELOG.md +312 -310
  3. package/lib/README.md +2 -2
  4. package/lib/cjs/application/application-container.js +18 -21
  5. package/lib/cjs/application/application-factory.js +4 -5
  6. package/lib/cjs/{common/server-env.types.js → application/application.types.js} +1 -0
  7. package/lib/cjs/application/index.js +3 -1
  8. package/lib/cjs/console/console.js +8 -20
  9. package/lib/cjs/container-module/container-module.js +10 -18
  10. package/lib/cjs/decorator/scope-binding.js +12 -11
  11. package/lib/cjs/di/annotation/decorator_utils.js +121 -0
  12. package/lib/cjs/di/annotation/inject.js +44 -0
  13. package/lib/cjs/di/annotation/inject_base.js +17 -0
  14. package/lib/cjs/di/annotation/injectable.js +43 -0
  15. package/lib/cjs/di/annotation/lazy_service_identifier.js +12 -0
  16. package/lib/cjs/di/annotation/multi_inject.js +30 -0
  17. package/lib/cjs/di/annotation/named.js +34 -0
  18. package/lib/cjs/di/annotation/optional.js +32 -0
  19. package/lib/cjs/di/annotation/post_construct.js +31 -0
  20. package/lib/cjs/di/annotation/pre_destroy.js +31 -0
  21. package/lib/cjs/di/annotation/property_event_decorator.js +15 -0
  22. package/lib/cjs/di/annotation/tagged.js +9 -0
  23. package/lib/cjs/di/annotation/target_name.js +35 -0
  24. package/lib/cjs/di/annotation/unmanaged.js +35 -0
  25. package/lib/cjs/di/binding-decorator/constants.js +7 -0
  26. package/lib/cjs/di/binding-decorator/decorator/fluent_provide.js +20 -0
  27. package/lib/cjs/di/binding-decorator/decorator/provide.js +37 -0
  28. package/lib/cjs/di/binding-decorator/factory/module_factory.js +17 -0
  29. package/lib/cjs/di/binding-decorator/index.js +14 -0
  30. package/lib/cjs/di/binding-decorator/syntax/provide_done_syntax.js +42 -0
  31. package/lib/cjs/di/binding-decorator/syntax/provide_in_syntax.js +33 -0
  32. package/lib/cjs/di/binding-decorator/syntax/provide_in_when_on_syntax.js +64 -0
  33. package/lib/cjs/di/binding-decorator/syntax/provide_on_syntax.js +22 -0
  34. package/lib/cjs/di/binding-decorator/syntax/provide_when_on_syntax.js +57 -0
  35. package/lib/cjs/di/binding-decorator/syntax/provide_when_syntax.js +89 -0
  36. package/lib/cjs/di/binding-decorator/utils/auto_wire.js +18 -0
  37. package/lib/cjs/di/bindings/binding.js +40 -0
  38. package/lib/cjs/di/bindings/binding_count.js +8 -0
  39. package/lib/cjs/di/constants/error_msgs.js +60 -0
  40. package/lib/cjs/di/constants/literal_types.js +26 -0
  41. package/lib/cjs/di/constants/metadata_keys.js +38 -0
  42. package/lib/cjs/di/container/container.js +521 -0
  43. package/lib/cjs/di/container/container_module.js +18 -0
  44. package/lib/cjs/di/container/container_snapshot.js +15 -0
  45. package/lib/cjs/di/container/lookup.js +132 -0
  46. package/lib/cjs/di/container/module_activation_store.js +49 -0
  47. package/lib/cjs/di/interfaces/interfaces.js +2 -0
  48. package/lib/cjs/di/inversify.js +78 -0
  49. package/lib/cjs/di/planning/context.js +17 -0
  50. package/lib/cjs/di/planning/metadata.js +42 -0
  51. package/lib/cjs/di/planning/metadata_reader.js +45 -0
  52. package/lib/cjs/di/planning/plan.js +10 -0
  53. package/lib/cjs/di/planning/planner.js +186 -0
  54. package/lib/cjs/di/planning/queryable_string.js +27 -0
  55. package/lib/cjs/di/planning/reflection_utils.js +178 -0
  56. package/lib/cjs/di/planning/request.js +23 -0
  57. package/lib/cjs/di/planning/target.js +108 -0
  58. package/lib/cjs/di/resolution/instantiation.js +150 -0
  59. package/lib/cjs/di/resolution/resolver.js +188 -0
  60. package/lib/cjs/di/scope/scope.js +50 -0
  61. package/lib/cjs/di/syntax/binding_in_syntax.js +23 -0
  62. package/lib/cjs/di/syntax/binding_in_when_on_syntax.js +75 -0
  63. package/lib/cjs/di/syntax/binding_on_syntax.js +18 -0
  64. package/lib/cjs/di/syntax/binding_to_syntax.js +111 -0
  65. package/lib/cjs/di/syntax/binding_when_on_syntax.js +64 -0
  66. package/lib/cjs/di/syntax/binding_when_syntax.js +84 -0
  67. package/lib/cjs/di/syntax/constraint_helpers.js +68 -0
  68. package/lib/cjs/di/utils/async.js +15 -0
  69. package/lib/cjs/di/utils/binding_utils.js +77 -0
  70. package/lib/cjs/di/utils/clonable.js +9 -0
  71. package/lib/cjs/di/utils/exceptions.js +46 -0
  72. package/lib/cjs/di/utils/factory_type.js +9 -0
  73. package/lib/cjs/di/utils/id.js +7 -0
  74. package/lib/cjs/di/utils/js.js +15 -0
  75. package/lib/cjs/di/utils/serialization.js +132 -0
  76. package/lib/cjs/error/app-error.js +5 -2
  77. package/lib/cjs/error/error-handler-middleware.js +3 -6
  78. package/lib/cjs/error/report.js +24 -15
  79. package/lib/cjs/index.js +1 -2
  80. package/lib/cjs/middleware/middleware-interface.js +2 -0
  81. package/lib/cjs/middleware/middleware-service.js +10 -25
  82. package/lib/cjs/provider/db-in-memory/base-repo.repository.js +3 -8
  83. package/lib/cjs/provider/db-in-memory/db-in-memory.provider.js +8 -5
  84. package/lib/cjs/provider/dto-validator/dto-validator.provider.js +4 -4
  85. package/lib/cjs/provider/dto-validator/package-resolver.js +56 -0
  86. package/lib/cjs/provider/environment/env-validator.provider.js +14 -12
  87. package/lib/cjs/provider/logger/logger.provider.js +10 -5
  88. package/lib/cjs/provider/provider-manager.js +21 -17
  89. package/lib/cjs/types/application/application-container.d.ts +12 -25
  90. package/lib/cjs/types/application/application-factory.d.ts +10 -7
  91. package/lib/cjs/types/{common/server-env.types.d.ts → application/application.types.d.ts} +1 -0
  92. package/lib/cjs/types/application/index.d.ts +1 -0
  93. package/lib/cjs/types/console/console.d.ts +3 -10
  94. package/lib/cjs/types/console/index.d.ts +2 -1
  95. package/lib/cjs/types/container-module/container-module.d.ts +3 -1
  96. package/lib/cjs/types/decorator/scope-binding.d.ts +9 -9
  97. package/lib/cjs/types/di/annotation/decorator_utils.d.ts +16 -0
  98. package/lib/cjs/types/di/annotation/inject.d.ts +16 -0
  99. package/lib/cjs/types/di/annotation/inject_base.d.ts +3 -0
  100. package/lib/cjs/types/di/annotation/injectable.d.ts +7 -0
  101. package/lib/cjs/types/di/annotation/lazy_service_identifier.d.ts +7 -0
  102. package/lib/cjs/types/di/annotation/multi_inject.d.ts +2 -0
  103. package/lib/cjs/types/di/annotation/named.d.ts +2 -0
  104. package/lib/cjs/types/di/annotation/optional.d.ts +2 -0
  105. package/lib/cjs/types/di/annotation/post_construct.d.ts +4 -0
  106. package/lib/cjs/types/di/annotation/pre_destroy.d.ts +4 -0
  107. package/lib/cjs/types/di/annotation/property_event_decorator.d.ts +4 -0
  108. package/lib/cjs/types/di/annotation/tagged.d.ts +2 -0
  109. package/lib/cjs/types/di/annotation/target_name.d.ts +3 -0
  110. package/lib/cjs/types/di/annotation/unmanaged.d.ts +3 -0
  111. package/lib/cjs/types/di/binding-decorator/constants.d.ts +4 -0
  112. package/lib/cjs/types/di/binding-decorator/decorator/fluent_provide.d.ts +4 -0
  113. package/lib/cjs/types/di/binding-decorator/decorator/provide.d.ts +4 -0
  114. package/lib/cjs/types/di/binding-decorator/factory/module_factory.d.ts +4 -0
  115. package/lib/cjs/types/di/binding-decorator/index.d.ts +8 -0
  116. package/lib/cjs/types/di/binding-decorator/interfaces/interfaces.d.ts +39 -0
  117. package/lib/cjs/types/di/binding-decorator/syntax/provide_done_syntax.d.ts +7 -0
  118. package/lib/cjs/types/di/binding-decorator/syntax/provide_in_syntax.d.ts +11 -0
  119. package/lib/cjs/types/di/binding-decorator/syntax/provide_in_when_on_syntax.d.ts +27 -0
  120. package/lib/cjs/types/di/binding-decorator/syntax/provide_on_syntax.d.ts +10 -0
  121. package/lib/cjs/types/di/binding-decorator/syntax/provide_when_on_syntax.d.ts +24 -0
  122. package/lib/cjs/types/di/binding-decorator/syntax/provide_when_syntax.d.ts +23 -0
  123. package/lib/cjs/types/di/binding-decorator/utils/auto_wire.d.ts +3 -0
  124. package/lib/cjs/types/di/bindings/binding.d.ts +20 -0
  125. package/lib/cjs/types/di/bindings/binding_count.d.ts +5 -0
  126. package/lib/cjs/types/di/constants/error_msgs.d.ts +32 -0
  127. package/lib/cjs/types/di/constants/literal_types.d.ts +5 -0
  128. package/lib/cjs/types/di/constants/metadata_keys.d.ts +13 -0
  129. package/lib/cjs/types/di/container/container.d.ts +73 -0
  130. package/lib/cjs/types/di/container/container_module.d.ts +11 -0
  131. package/lib/cjs/types/di/container/container_snapshot.d.ts +10 -0
  132. package/lib/cjs/types/di/container/lookup.d.ts +16 -0
  133. package/lib/cjs/types/di/container/module_activation_store.d.ts +10 -0
  134. package/lib/cjs/types/di/interfaces/interfaces.d.ts +299 -0
  135. package/lib/cjs/types/di/inversify.d.ts +25 -0
  136. package/lib/cjs/types/di/planning/context.d.ts +11 -0
  137. package/lib/cjs/types/di/planning/metadata.d.ts +8 -0
  138. package/lib/cjs/types/di/planning/metadata_reader.d.ts +6 -0
  139. package/lib/cjs/types/di/planning/plan.d.ts +7 -0
  140. package/lib/cjs/types/di/planning/planner.d.ts +5 -0
  141. package/lib/cjs/types/di/planning/queryable_string.d.ts +11 -0
  142. package/lib/cjs/types/di/planning/reflection_utils.d.ts +5 -0
  143. package/lib/cjs/types/di/planning/request.d.ts +14 -0
  144. package/lib/cjs/types/di/planning/target.d.ts +23 -0
  145. package/lib/cjs/types/di/resolution/instantiation.d.ts +3 -0
  146. package/lib/cjs/types/di/resolution/resolver.d.ts +3 -0
  147. package/lib/cjs/types/di/scope/scope.d.ts +3 -0
  148. package/lib/cjs/types/di/syntax/binding_in_syntax.d.ts +9 -0
  149. package/lib/cjs/types/di/syntax/binding_in_when_on_syntax.d.ts +29 -0
  150. package/lib/cjs/types/di/syntax/binding_on_syntax.d.ts +8 -0
  151. package/lib/cjs/types/di/syntax/binding_to_syntax.d.ts +18 -0
  152. package/lib/cjs/types/di/syntax/binding_when_on_syntax.d.ts +25 -0
  153. package/lib/cjs/types/di/syntax/binding_when_syntax.d.ts +21 -0
  154. package/lib/cjs/types/di/syntax/constraint_helpers.d.ts +6 -0
  155. package/lib/cjs/types/di/utils/async.d.ts +3 -0
  156. package/lib/cjs/types/di/utils/binding_utils.d.ts +4 -0
  157. package/lib/cjs/types/di/utils/clonable.d.ts +3 -0
  158. package/lib/cjs/types/di/utils/exceptions.d.ts +2 -0
  159. package/lib/cjs/types/di/utils/factory_type.d.ts +5 -0
  160. package/lib/cjs/types/di/utils/id.d.ts +2 -0
  161. package/lib/cjs/types/di/utils/js.d.ts +1 -0
  162. package/lib/cjs/types/di/utils/serialization.d.ts +10 -0
  163. package/lib/cjs/types/error/error-handler-middleware.d.ts +2 -3
  164. package/lib/cjs/types/error/report.d.ts +7 -5
  165. package/lib/cjs/types/index.d.ts +1 -2
  166. package/lib/cjs/types/middleware/index.d.ts +2 -1
  167. package/lib/cjs/types/middleware/middleware-interface.d.ts +185 -0
  168. package/lib/cjs/types/middleware/middleware-service.d.ts +11 -163
  169. package/lib/cjs/types/provider/db-in-memory/db-in-memory.provider.d.ts +4 -0
  170. package/lib/cjs/types/provider/dto-validator/dto-validator.provider.d.ts +2 -3
  171. package/lib/cjs/types/{common → provider/dto-validator}/package-resolver.d.ts +1 -2
  172. package/lib/cjs/types/provider/environment/env-validator.provider.d.ts +7 -3
  173. package/lib/cjs/types/provider/logger/logger.provider.d.ts +5 -0
  174. package/lib/cjs/types/provider/provider-manager.d.ts +22 -2
  175. package/lib/package.json +9 -15
  176. package/package.json +9 -15
  177. package/lib/cjs/common/index.js +0 -5
  178. package/lib/cjs/common/package-resolver.js +0 -34
  179. package/lib/cjs/controller/base-controller.js +0 -74
  180. package/lib/cjs/controller/index.js +0 -5
  181. package/lib/cjs/types/common/index.d.ts +0 -2
  182. package/lib/cjs/types/common/project-config.d.ts +0 -56
  183. package/lib/cjs/types/controller/base-controller.d.ts +0 -48
  184. package/lib/cjs/types/controller/index.d.ts +0 -1
  185. /package/lib/cjs/{common → console}/color-codes.js +0 -0
  186. /package/lib/cjs/{common/project-config.js → di/binding-decorator/interfaces/interfaces.js} +0 -0
  187. /package/lib/cjs/types/{common → console}/color-codes.d.ts +0 -0
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ /* eslint-disable @typescript-eslint/no-explicit-any */
7
+ const inversify_1 = require("../../inversify");
8
+ const provide_1 = __importDefault(require("../decorator/provide"));
9
+ function autoProvide(container, ...modules) {
10
+ modules.forEach((module) => {
11
+ Object.keys(module).forEach((key) => {
12
+ const entity = module[key];
13
+ const decorator = (0, provide_1.default)(entity);
14
+ (0, inversify_1.decorate)(decorator, entity);
15
+ });
16
+ });
17
+ }
18
+ exports.default = autoProvide;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Binding = void 0;
4
+ const literal_types_1 = require("../constants/literal_types");
5
+ const id_1 = require("../utils/id");
6
+ class Binding {
7
+ constructor(serviceIdentifier, scope) {
8
+ this.id = (0, id_1.id)();
9
+ this.activated = false;
10
+ this.serviceIdentifier = serviceIdentifier;
11
+ this.scope = scope;
12
+ this.type = literal_types_1.BindingTypeEnum.Invalid;
13
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14
+ this.constraint = (request) => true;
15
+ this.implementationType = null;
16
+ this.cache = null;
17
+ this.factory = null;
18
+ this.provider = null;
19
+ this.onActivation = null;
20
+ this.onDeactivation = null;
21
+ this.dynamicValue = null;
22
+ }
23
+ clone() {
24
+ const clone = new Binding(this.serviceIdentifier, this.scope);
25
+ clone.activated =
26
+ clone.scope === literal_types_1.BindingScopeEnum.Singleton ? this.activated : false;
27
+ clone.implementationType = this.implementationType;
28
+ clone.dynamicValue = this.dynamicValue;
29
+ clone.scope = this.scope;
30
+ clone.type = this.type;
31
+ clone.factory = this.factory;
32
+ clone.provider = this.provider;
33
+ clone.constraint = this.constraint;
34
+ clone.onActivation = this.onActivation;
35
+ clone.onDeactivation = this.onDeactivation;
36
+ clone.cache = this.cache;
37
+ return clone;
38
+ }
39
+ }
40
+ exports.Binding = Binding;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BindingCount = void 0;
4
+ exports.BindingCount = {
5
+ MultipleBindingsAvailable: 2,
6
+ NoBindingsAvailable: 0,
7
+ OnlyOneBindingAvailable: 1,
8
+ };
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STACK_OVERFLOW = exports.CIRCULAR_DEPENDENCY_IN_FACTORY = exports.ON_DEACTIVATION_ERROR = exports.PRE_DESTROY_ERROR = exports.POST_CONSTRUCT_ERROR = exports.ASYNC_UNBIND_REQUIRED = exports.MULTIPLE_POST_CONSTRUCT_METHODS = exports.MULTIPLE_PRE_DESTROY_METHODS = exports.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK = exports.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE = exports.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE = exports.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT = exports.ARGUMENTS_LENGTH_MISMATCH = exports.INVALID_DECORATOR_OPERATION = exports.INVALID_TO_SELF_VALUE = exports.LAZY_IN_SYNC = exports.INVALID_FUNCTION_BINDING = exports.INVALID_MIDDLEWARE_RETURN = exports.NO_MORE_SNAPSHOTS_AVAILABLE = exports.INVALID_BINDING_TYPE = exports.NOT_IMPLEMENTED = exports.CIRCULAR_DEPENDENCY = exports.UNDEFINED_INJECT_ANNOTATION = exports.MISSING_INJECT_ANNOTATION = exports.MISSING_INJECTABLE_ANNOTATION = exports.NOT_REGISTERED = exports.CANNOT_UNBIND = exports.AMBIGUOUS_MATCH = exports.KEY_NOT_FOUND = exports.NULL_ARGUMENT = exports.DUPLICATED_METADATA = exports.DUPLICATED_INJECTABLE_DECORATOR = void 0;
4
+ exports.DUPLICATED_INJECTABLE_DECORATOR = "Cannot apply @injectable decorator multiple times.";
5
+ exports.DUPLICATED_METADATA = "Metadata key was used more than once in a parameter:";
6
+ exports.NULL_ARGUMENT = "NULL argument";
7
+ exports.KEY_NOT_FOUND = "Key Not Found";
8
+ exports.AMBIGUOUS_MATCH = "Ambiguous match found for serviceIdentifier:";
9
+ exports.CANNOT_UNBIND = "Could not unbind serviceIdentifier:";
10
+ exports.NOT_REGISTERED = "No matching bindings found for serviceIdentifier:";
11
+ exports.MISSING_INJECTABLE_ANNOTATION = "Missing required @injectable annotation in:";
12
+ exports.MISSING_INJECT_ANNOTATION = "Missing required @inject or @multiInject annotation in:";
13
+ const UNDEFINED_INJECT_ANNOTATION = (name) => `@inject called with undefined this could mean that the class ${name} has ` +
14
+ "a circular dependency problem. You can use a LazyServiceIdentifer to " +
15
+ "overcome this limitation.";
16
+ exports.UNDEFINED_INJECT_ANNOTATION = UNDEFINED_INJECT_ANNOTATION;
17
+ exports.CIRCULAR_DEPENDENCY = "Circular dependency found:";
18
+ exports.NOT_IMPLEMENTED = "Sorry, this feature is not fully implemented yet.";
19
+ exports.INVALID_BINDING_TYPE = "Invalid binding type:";
20
+ exports.NO_MORE_SNAPSHOTS_AVAILABLE = "No snapshot available to restore.";
21
+ exports.INVALID_MIDDLEWARE_RETURN = "Invalid return type in middleware. Middleware must return!";
22
+ exports.INVALID_FUNCTION_BINDING = "Value provided to function binding must be a function!";
23
+ const LAZY_IN_SYNC = (key) => `You are attempting to construct ${keyToString(key)} in a synchronous way ` +
24
+ "but it has asynchronous dependencies.";
25
+ exports.LAZY_IN_SYNC = LAZY_IN_SYNC;
26
+ exports.INVALID_TO_SELF_VALUE = "The toSelf function can only be applied when a constructor is " +
27
+ "used as service identifier";
28
+ exports.INVALID_DECORATOR_OPERATION = "The @inject @multiInject @tagged and @named decorators " +
29
+ "must be applied to the parameters of a class constructor or a class property.";
30
+ const ARGUMENTS_LENGTH_MISMATCH = (...values) => "The number of constructor arguments in the derived class " +
31
+ `${values[0]} must be >= than the number of constructor arguments of its base class.`;
32
+ exports.ARGUMENTS_LENGTH_MISMATCH = ARGUMENTS_LENGTH_MISMATCH;
33
+ exports.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT = "Invalid Container constructor argument. Container options " +
34
+ "must be an object.";
35
+ exports.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE = "Invalid Container option. Default scope must " +
36
+ 'be a string ("singleton" or "transient").';
37
+ exports.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE = "Invalid Container option. Auto bind injectable must " + "be a boolean";
38
+ exports.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK = "Invalid Container option. Skip base check must " + "be a boolean";
39
+ exports.MULTIPLE_PRE_DESTROY_METHODS = "Cannot apply @preDestroy decorator multiple times in the same class";
40
+ exports.MULTIPLE_POST_CONSTRUCT_METHODS = "Cannot apply @postConstruct decorator multiple times in the same class";
41
+ exports.ASYNC_UNBIND_REQUIRED = "Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)";
42
+ const POST_CONSTRUCT_ERROR = (clazz, errorMessage) => `@postConstruct error in class ${clazz}: ${errorMessage}`;
43
+ exports.POST_CONSTRUCT_ERROR = POST_CONSTRUCT_ERROR;
44
+ const PRE_DESTROY_ERROR = (clazz, errorMessage) => `@preDestroy error in class ${clazz}: ${errorMessage}`;
45
+ exports.PRE_DESTROY_ERROR = PRE_DESTROY_ERROR;
46
+ const ON_DEACTIVATION_ERROR = (clazz, errorMessage) => `onDeactivation() error in class ${clazz}: ${errorMessage}`;
47
+ exports.ON_DEACTIVATION_ERROR = ON_DEACTIVATION_ERROR;
48
+ const CIRCULAR_DEPENDENCY_IN_FACTORY = (factoryType, serviceIdentifier) => `It looks like there is a circular dependency in one of the '${factoryType}' bindings. Please investigate bindings with ` +
49
+ `service identifier '${serviceIdentifier}'.`;
50
+ exports.CIRCULAR_DEPENDENCY_IN_FACTORY = CIRCULAR_DEPENDENCY_IN_FACTORY;
51
+ exports.STACK_OVERFLOW = "Maximum call stack size exceeded";
52
+ function keyToString(key) {
53
+ if (typeof key === "function") {
54
+ return `[function/class ${key.name || "<anonymous>"}]`;
55
+ }
56
+ if (typeof key === "symbol") {
57
+ return key.toString();
58
+ }
59
+ return `'${key}'`;
60
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TargetTypeEnum = exports.BindingTypeEnum = exports.BindingScopeEnum = void 0;
4
+ const BindingScopeEnum = {
5
+ Request: "Request",
6
+ Singleton: "Singleton",
7
+ Transient: "Transient",
8
+ };
9
+ exports.BindingScopeEnum = BindingScopeEnum;
10
+ const BindingTypeEnum = {
11
+ ConstantValue: "ConstantValue",
12
+ Constructor: "Constructor",
13
+ DynamicValue: "DynamicValue",
14
+ Factory: "Factory",
15
+ Function: "Function",
16
+ Instance: "Instance",
17
+ Invalid: "Invalid",
18
+ Provider: "Provider",
19
+ };
20
+ exports.BindingTypeEnum = BindingTypeEnum;
21
+ const TargetTypeEnum = {
22
+ ClassProperty: "ClassProperty",
23
+ ConstructorArgument: "ConstructorArgument",
24
+ Variable: "Variable",
25
+ };
26
+ exports.TargetTypeEnum = TargetTypeEnum;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NON_CUSTOM_TAG_KEYS = exports.PRE_DESTROY = exports.POST_CONSTRUCT = exports.DESIGN_PARAM_TYPES = exports.PARAM_TYPES = exports.TAGGED_PROP = exports.TAGGED = exports.MULTI_INJECT_TAG = exports.INJECT_TAG = exports.OPTIONAL_TAG = exports.UNMANAGED_TAG = exports.NAME_TAG = exports.NAMED_TAG = void 0;
4
+ // Used for named bindings
5
+ exports.NAMED_TAG = "named";
6
+ // The name of the target at design time
7
+ exports.NAME_TAG = "name";
8
+ // The for unmanaged injections (in base classes when using inheritance)
9
+ exports.UNMANAGED_TAG = "unmanaged";
10
+ // The for optional injections
11
+ exports.OPTIONAL_TAG = "optional";
12
+ // The type of the binding at design time
13
+ exports.INJECT_TAG = "inject";
14
+ // The type of the binding at design type for multi-injections
15
+ exports.MULTI_INJECT_TAG = "multi_inject";
16
+ // used to store constructor arguments tags
17
+ exports.TAGGED = "inversify:tagged";
18
+ // used to store class properties tags
19
+ exports.TAGGED_PROP = "inversify:tagged_props";
20
+ // used to store types to be injected
21
+ exports.PARAM_TYPES = "inversify:paramtypes";
22
+ // used to access design time types
23
+ exports.DESIGN_PARAM_TYPES = "design:paramtypes";
24
+ // used to identify postConstruct functions
25
+ exports.POST_CONSTRUCT = "post_construct";
26
+ // used to identify preDestroy functions
27
+ exports.PRE_DESTROY = "pre_destroy";
28
+ function getNonCustomTagKeys() {
29
+ return [
30
+ exports.INJECT_TAG,
31
+ exports.MULTI_INJECT_TAG,
32
+ exports.NAME_TAG,
33
+ exports.UNMANAGED_TAG,
34
+ exports.NAMED_TAG,
35
+ exports.OPTIONAL_TAG,
36
+ ];
37
+ }
38
+ exports.NON_CUSTOM_TAG_KEYS = getNonCustomTagKeys();