@inversifyjs/core 5.4.0 → 6.0.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 (129) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/lib/cjs/binding/models/BindingConstraintsImplementation.d.ts +1 -0
  3. package/lib/cjs/binding/models/BindingConstraintsImplementation.d.ts.map +1 -1
  4. package/lib/cjs/binding/models/BindingConstraintsImplementation.js +1 -0
  5. package/lib/cjs/binding/models/BindingConstraintsImplementation.js.map +1 -1
  6. package/lib/cjs/binding/services/ActivationsService.d.ts +1 -1
  7. package/lib/cjs/binding/services/ActivationsService.d.ts.map +1 -1
  8. package/lib/cjs/binding/services/ActivationsService.js +7 -7
  9. package/lib/cjs/binding/services/ActivationsService.js.map +1 -1
  10. package/lib/cjs/binding/services/BindingService.d.ts +1 -1
  11. package/lib/cjs/binding/services/BindingService.d.ts.map +1 -1
  12. package/lib/cjs/binding/services/BindingService.js +15 -13
  13. package/lib/cjs/binding/services/BindingService.js.map +1 -1
  14. package/lib/cjs/binding/services/DeactivationsService.d.ts +1 -1
  15. package/lib/cjs/binding/services/DeactivationsService.d.ts.map +1 -1
  16. package/lib/cjs/binding/services/DeactivationsService.js +7 -7
  17. package/lib/cjs/binding/services/DeactivationsService.js.map +1 -1
  18. package/lib/cjs/index.d.ts +9 -3
  19. package/lib/cjs/index.d.ts.map +1 -1
  20. package/lib/cjs/index.js +1 -1
  21. package/lib/cjs/index.js.map +1 -1
  22. package/lib/cjs/planning/actions/cacheNonRootPlanServiceNode.d.ts +5 -0
  23. package/lib/cjs/planning/actions/cacheNonRootPlanServiceNode.d.ts.map +1 -0
  24. package/lib/cjs/planning/actions/cacheNonRootPlanServiceNode.js +17 -0
  25. package/lib/cjs/planning/actions/cacheNonRootPlanServiceNode.js.map +1 -0
  26. package/lib/cjs/planning/actions/cacheNonRootPlanServiceNode.spec.d.ts +2 -0
  27. package/lib/cjs/planning/actions/cacheNonRootPlanServiceNode.spec.d.ts.map +1 -0
  28. package/lib/cjs/planning/actions/plan.d.ts.map +1 -0
  29. package/lib/cjs/planning/actions/plan.int.spec.d.ts.map +1 -0
  30. package/lib/cjs/planning/actions/plan.js +297 -0
  31. package/lib/cjs/planning/actions/plan.js.map +1 -0
  32. package/lib/cjs/planning/actions/plan.spec.d.ts.map +1 -0
  33. package/lib/cjs/planning/calculations/buildFilteredServiceBindings.js +3 -3
  34. package/lib/cjs/planning/calculations/buildFilteredServiceBindings.js.map +1 -1
  35. package/lib/cjs/planning/calculations/buildGetPlanOptionsFromPlanParams.d.ts +4 -0
  36. package/lib/cjs/planning/calculations/buildGetPlanOptionsFromPlanParams.d.ts.map +1 -0
  37. package/lib/cjs/planning/calculations/buildGetPlanOptionsFromPlanParams.js +25 -0
  38. package/lib/cjs/planning/calculations/buildGetPlanOptionsFromPlanParams.js.map +1 -0
  39. package/lib/cjs/planning/calculations/buildGetPlanOptionsFromPlanParams.spec.d.ts +2 -0
  40. package/lib/cjs/planning/calculations/buildGetPlanOptionsFromPlanParams.spec.d.ts.map +1 -0
  41. package/lib/cjs/planning/calculations/buildPlanBindingConstraintsList.d.ts +5 -0
  42. package/lib/cjs/planning/calculations/buildPlanBindingConstraintsList.d.ts.map +1 -0
  43. package/lib/cjs/planning/calculations/buildPlanBindingConstraintsList.js +20 -0
  44. package/lib/cjs/planning/calculations/buildPlanBindingConstraintsList.js.map +1 -0
  45. package/lib/cjs/planning/calculations/buildPlanBindingConstraintsList.spec.d.ts +2 -0
  46. package/lib/cjs/planning/calculations/buildPlanBindingConstraintsList.spec.d.ts.map +1 -0
  47. package/lib/cjs/planning/calculations/checkPlanServiceRedirectionBindingNodeSingleInjectionBindings.d.ts +4 -2
  48. package/lib/cjs/planning/calculations/checkPlanServiceRedirectionBindingNodeSingleInjectionBindings.d.ts.map +1 -1
  49. package/lib/cjs/planning/calculations/checkPlanServiceRedirectionBindingNodeSingleInjectionBindings.js +6 -3
  50. package/lib/cjs/planning/calculations/checkPlanServiceRedirectionBindingNodeSingleInjectionBindings.js.map +1 -1
  51. package/lib/cjs/planning/calculations/checkServiceNodeSingleInjectionBindings.d.ts +3 -3
  52. package/lib/cjs/planning/calculations/checkServiceNodeSingleInjectionBindings.d.ts.map +1 -1
  53. package/lib/cjs/planning/calculations/checkServiceNodeSingleInjectionBindings.js +3 -3
  54. package/lib/cjs/planning/calculations/checkServiceNodeSingleInjectionBindings.js.map +1 -1
  55. package/lib/cjs/planning/calculations/getServiceFromMaybeLazyServiceIdentifier.d.ts +3 -0
  56. package/lib/cjs/planning/calculations/getServiceFromMaybeLazyServiceIdentifier.d.ts.map +1 -0
  57. package/lib/cjs/planning/calculations/getServiceFromMaybeLazyServiceIdentifier.js +10 -0
  58. package/lib/cjs/planning/calculations/getServiceFromMaybeLazyServiceIdentifier.js.map +1 -0
  59. package/lib/cjs/planning/calculations/getServiceFromMaybeLazyServiceIdentifier.spec.d.ts +2 -0
  60. package/lib/cjs/planning/calculations/getServiceFromMaybeLazyServiceIdentifier.spec.d.ts.map +1 -0
  61. package/lib/cjs/planning/calculations/throwErrorWhenUnexpectedBindingsAmountFound.d.ts +4 -3
  62. package/lib/cjs/planning/calculations/throwErrorWhenUnexpectedBindingsAmountFound.d.ts.map +1 -1
  63. package/lib/cjs/planning/calculations/throwErrorWhenUnexpectedBindingsAmountFound.js +33 -35
  64. package/lib/cjs/planning/calculations/throwErrorWhenUnexpectedBindingsAmountFound.js.map +1 -1
  65. package/lib/cjs/planning/calculations/tryBuildGetPlanOptionsFromManagedClassElementMetadata.d.ts +4 -0
  66. package/lib/cjs/planning/calculations/tryBuildGetPlanOptionsFromManagedClassElementMetadata.d.ts.map +1 -0
  67. package/lib/cjs/planning/calculations/tryBuildGetPlanOptionsFromManagedClassElementMetadata.js +43 -0
  68. package/lib/cjs/planning/calculations/tryBuildGetPlanOptionsFromManagedClassElementMetadata.js.map +1 -0
  69. package/lib/cjs/planning/calculations/tryBuildGetPlanOptionsFromManagedClassElementMetadata.spec.d.ts +2 -0
  70. package/lib/cjs/planning/calculations/tryBuildGetPlanOptionsFromManagedClassElementMetadata.spec.d.ts.map +1 -0
  71. package/lib/cjs/planning/calculations/tryBuildGetPlanOptionsFromResolvedValueElementMetadata.d.ts +4 -0
  72. package/lib/cjs/planning/calculations/tryBuildGetPlanOptionsFromResolvedValueElementMetadata.d.ts.map +1 -0
  73. package/lib/cjs/planning/calculations/tryBuildGetPlanOptionsFromResolvedValueElementMetadata.js +42 -0
  74. package/lib/cjs/planning/calculations/tryBuildGetPlanOptionsFromResolvedValueElementMetadata.js.map +1 -0
  75. package/lib/cjs/planning/calculations/tryBuildGetPlanOptionsFromResolvedValueElementMetadata.spec.d.ts +2 -0
  76. package/lib/cjs/planning/calculations/tryBuildGetPlanOptionsFromResolvedValueElementMetadata.spec.d.ts.map +1 -0
  77. package/lib/cjs/planning/models/BaseBindingNode.d.ts +0 -2
  78. package/lib/cjs/planning/models/BaseBindingNode.d.ts.map +1 -1
  79. package/lib/cjs/planning/models/BaseGetPlanOptions.d.ts +10 -0
  80. package/lib/cjs/planning/models/BaseGetPlanOptions.d.ts.map +1 -0
  81. package/lib/cjs/planning/models/BaseGetPlanOptions.js +3 -0
  82. package/lib/cjs/planning/models/BaseGetPlanOptions.js.map +1 -0
  83. package/lib/cjs/planning/models/BasePlanParams.d.ts +3 -7
  84. package/lib/cjs/planning/models/BasePlanParams.d.ts.map +1 -1
  85. package/lib/cjs/planning/models/GetMultipleServicePlanOptions.d.ts +6 -0
  86. package/lib/cjs/planning/models/GetMultipleServicePlanOptions.d.ts.map +1 -0
  87. package/lib/cjs/planning/models/GetMultipleServicePlanOptions.js +3 -0
  88. package/lib/cjs/planning/models/GetMultipleServicePlanOptions.js.map +1 -0
  89. package/lib/cjs/planning/models/GetPlanOptions.d.ts +4 -0
  90. package/lib/cjs/planning/models/GetPlanOptions.d.ts.map +1 -0
  91. package/lib/cjs/planning/models/GetPlanOptions.js +3 -0
  92. package/lib/cjs/planning/models/GetPlanOptions.js.map +1 -0
  93. package/lib/cjs/planning/models/GetPlanOptionsTagConstraint.d.ts +6 -0
  94. package/lib/cjs/planning/models/GetPlanOptionsTagConstraint.d.ts.map +1 -0
  95. package/lib/cjs/planning/models/GetPlanOptionsTagConstraint.js +3 -0
  96. package/lib/cjs/planning/models/GetPlanOptionsTagConstraint.js.map +1 -0
  97. package/lib/cjs/planning/models/GetSingleServicePlanOptions.d.ts +5 -0
  98. package/lib/cjs/planning/models/GetSingleServicePlanOptions.d.ts.map +1 -0
  99. package/lib/cjs/planning/models/GetSingleServicePlanOptions.js +3 -0
  100. package/lib/cjs/planning/models/GetSingleServicePlanOptions.js.map +1 -0
  101. package/lib/cjs/planning/models/LazyPlanServiceNode.d.ts +21 -0
  102. package/lib/cjs/planning/models/LazyPlanServiceNode.d.ts.map +1 -0
  103. package/lib/cjs/planning/models/LazyPlanServiceNode.js +46 -0
  104. package/lib/cjs/planning/models/LazyPlanServiceNode.js.map +1 -0
  105. package/lib/cjs/planning/models/LazyPlanServiceNode.spec.d.ts +9 -0
  106. package/lib/cjs/planning/models/LazyPlanServiceNode.spec.d.ts.map +1 -0
  107. package/lib/cjs/planning/models/PlanParamsOperations.d.ts +16 -0
  108. package/lib/cjs/planning/models/PlanParamsOperations.d.ts.map +1 -0
  109. package/lib/cjs/planning/models/PlanParamsOperations.js +3 -0
  110. package/lib/cjs/planning/models/PlanParamsOperations.js.map +1 -0
  111. package/lib/cjs/planning/models/PlanServiceNode.d.ts +2 -3
  112. package/lib/cjs/planning/models/PlanServiceNode.d.ts.map +1 -1
  113. package/lib/cjs/planning/services/PlanResultCacheService.d.ts +4 -14
  114. package/lib/cjs/planning/services/PlanResultCacheService.d.ts.map +1 -1
  115. package/lib/cjs/planning/services/PlanResultCacheService.js +142 -18
  116. package/lib/cjs/planning/services/PlanResultCacheService.js.map +1 -1
  117. package/lib/esm/index.d.ts +63 -45
  118. package/lib/esm/index.d.ts.map +1 -1
  119. package/lib/esm/index.js +1 -1
  120. package/lib/esm/index.js.map +1 -1
  121. package/package.json +7 -7
  122. package/lib/cjs/planning/calculations/plan.d.ts.map +0 -1
  123. package/lib/cjs/planning/calculations/plan.int.spec.d.ts.map +0 -1
  124. package/lib/cjs/planning/calculations/plan.js +0 -232
  125. package/lib/cjs/planning/calculations/plan.js.map +0 -1
  126. package/lib/cjs/planning/calculations/plan.spec.d.ts.map +0 -1
  127. /package/lib/cjs/planning/{calculations → actions}/plan.d.ts +0 -0
  128. /package/lib/cjs/planning/{calculations → actions}/plan.int.spec.d.ts +0 -0
  129. /package/lib/cjs/planning/{calculations → actions}/plan.spec.d.ts +0 -0
@@ -1,16 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PlanResultCacheService = void 0;
4
+ const BindingType_1 = require("../../binding/models/BindingType");
4
5
  const WeakList_1 = require("../../common/models/WeakList");
5
- var GetPlanBooleanOptionsMask;
6
- (function (GetPlanBooleanOptionsMask) {
7
- GetPlanBooleanOptionsMask[GetPlanBooleanOptionsMask["singleMandatory"] = 0] = "singleMandatory";
8
- GetPlanBooleanOptionsMask[GetPlanBooleanOptionsMask["singleOptional"] = 1] = "singleOptional";
9
- GetPlanBooleanOptionsMask[GetPlanBooleanOptionsMask["multipleMandatory"] = 2] = "multipleMandatory";
10
- GetPlanBooleanOptionsMask[GetPlanBooleanOptionsMask["multipleOptional"] = 3] = "multipleOptional";
11
- // Must be the last one
12
- GetPlanBooleanOptionsMask[GetPlanBooleanOptionsMask["length"] = 4] = "length";
13
- })(GetPlanBooleanOptionsMask || (GetPlanBooleanOptionsMask = {}));
6
+ const LazyPlanServiceNode_1 = require("../models/LazyPlanServiceNode");
7
+ const CHAINED_MASK = 0x4;
8
+ const IS_MULTIPLE_MASK = 0x2;
9
+ const OPTIONAL_MASK = 0x1;
10
+ const MAP_ARRAY_LENGTH = 0x8;
14
11
  /**
15
12
  * Service to cache plans.
16
13
  *
@@ -22,12 +19,14 @@ var GetPlanBooleanOptionsMask;
22
19
  * Ancestor binding constraints are the reason to avoid reusing plans from plan children nodes.
23
20
  */
24
21
  class PlanResultCacheService {
22
+ #serviceIdToNonCachedServiceNodeSetMap;
25
23
  #serviceIdToValuePlanMap;
26
24
  #namedServiceIdToValuePlanMap;
27
25
  #namedTaggedServiceIdToValuePlanMap;
28
26
  #taggedServiceIdToValuePlanMap;
29
27
  #subscribers;
30
28
  constructor() {
29
+ this.#serviceIdToNonCachedServiceNodeSetMap = new Map();
31
30
  this.#serviceIdToValuePlanMap = this.#buildInitializedMapArray();
32
31
  this.#namedServiceIdToValuePlanMap = this.#buildInitializedMapArray();
33
32
  this.#namedTaggedServiceIdToValuePlanMap = this.#buildInitializedMapArray();
@@ -69,6 +68,16 @@ class PlanResultCacheService {
69
68
  }
70
69
  }
71
70
  }
71
+ invalidateService(serviceIdentifier) {
72
+ this.#invalidateServiceMap(serviceIdentifier);
73
+ this.#invalidateNamedServiceMap(serviceIdentifier);
74
+ this.#invalidateNamedTaggedServiceMap(serviceIdentifier);
75
+ this.#invalidateTaggedServiceMap(serviceIdentifier);
76
+ this.#invalidateNonCachedServiceNodeSetMap(serviceIdentifier);
77
+ for (const subscriber of this.#subscribers) {
78
+ subscriber.invalidateService(serviceIdentifier);
79
+ }
80
+ }
72
81
  set(options, planResult) {
73
82
  if (options.name === undefined) {
74
83
  if (options.tag === undefined) {
@@ -87,11 +96,19 @@ class PlanResultCacheService {
87
96
  }
88
97
  }
89
98
  }
99
+ setNonCachedServiceNode(node) {
100
+ let nonCachedSet = this.#serviceIdToNonCachedServiceNodeSetMap.get(node.serviceIdentifier);
101
+ if (nonCachedSet === undefined) {
102
+ nonCachedSet = new Set();
103
+ this.#serviceIdToNonCachedServiceNodeSetMap.set(node.serviceIdentifier, nonCachedSet);
104
+ }
105
+ nonCachedSet.add(node);
106
+ }
90
107
  subscribe(subscriber) {
91
108
  this.#subscribers.push(subscriber);
92
109
  }
93
110
  #buildInitializedMapArray() {
94
- const mapArray = new Array(GetPlanBooleanOptionsMask.length);
111
+ const mapArray = new Array(MAP_ARRAY_LENGTH);
95
112
  for (let i = 0; i < mapArray.length; ++i) {
96
113
  mapArray[i] = new Map();
97
114
  }
@@ -110,6 +127,7 @@ class PlanResultCacheService {
110
127
  }
111
128
  #getMaps() {
112
129
  return [
130
+ this.#serviceIdToNonCachedServiceNodeSetMap,
113
131
  ...this.#serviceIdToValuePlanMap,
114
132
  ...this.#namedServiceIdToValuePlanMap,
115
133
  ...this.#namedTaggedServiceIdToValuePlanMap,
@@ -118,19 +136,125 @@ class PlanResultCacheService {
118
136
  }
119
137
  #getMapArrayIndex(options) {
120
138
  if (options.isMultiple) {
121
- if (options.optional === true) {
122
- return GetPlanBooleanOptionsMask.multipleOptional;
139
+ return ((options.chained ? CHAINED_MASK : 0) |
140
+ (options.optional ? OPTIONAL_MASK : 0) |
141
+ IS_MULTIPLE_MASK);
142
+ }
143
+ else {
144
+ return options.optional ? OPTIONAL_MASK : 0;
145
+ }
146
+ }
147
+ #invalidateNamedServiceMap(serviceIdentifier) {
148
+ for (const map of this.#namedServiceIdToValuePlanMap) {
149
+ const servicePlans = map.get(serviceIdentifier);
150
+ if (servicePlans !== undefined) {
151
+ for (const servicePlan of servicePlans.values()) {
152
+ if (LazyPlanServiceNode_1.LazyPlanServiceNode.is(servicePlan.tree.root)) {
153
+ this.#invalidateNonCachePlanServiceNodeDescendents(servicePlan.tree.root);
154
+ servicePlan.tree.root.invalidate();
155
+ }
156
+ }
123
157
  }
124
- else {
125
- return GetPlanBooleanOptionsMask.multipleMandatory;
158
+ }
159
+ }
160
+ #invalidateNamedTaggedServiceMap(serviceIdentifier) {
161
+ for (const map of this.#namedTaggedServiceIdToValuePlanMap) {
162
+ const servicePlanMapMapMap = map.get(serviceIdentifier);
163
+ if (servicePlanMapMapMap !== undefined) {
164
+ for (const servicePlanMapMap of servicePlanMapMapMap.values()) {
165
+ for (const servicePlanMap of servicePlanMapMap.values()) {
166
+ for (const servicePlan of servicePlanMap.values()) {
167
+ if (LazyPlanServiceNode_1.LazyPlanServiceNode.is(servicePlan.tree.root)) {
168
+ this.#invalidateNonCachePlanServiceNodeDescendents(servicePlan.tree.root);
169
+ servicePlan.tree.root.invalidate();
170
+ }
171
+ }
172
+ }
173
+ }
174
+ }
175
+ }
176
+ }
177
+ #invalidateNonCachePlanBindingNodeDescendents(planBindingNode) {
178
+ switch (planBindingNode.binding.type) {
179
+ case BindingType_1.bindingTypeValues.ServiceRedirection:
180
+ for (const redirection of planBindingNode.redirections) {
181
+ this.#invalidateNonCachePlanBindingNodeDescendents(redirection);
182
+ }
183
+ break;
184
+ case BindingType_1.bindingTypeValues.Instance:
185
+ for (const constructorParam of planBindingNode
186
+ .constructorParams) {
187
+ if (constructorParam !== undefined) {
188
+ this.#invalidateNonCachePlanServiceNode(constructorParam);
189
+ }
190
+ }
191
+ for (const propertyParam of planBindingNode.propertyParams.values()) {
192
+ this.#invalidateNonCachePlanServiceNode(propertyParam);
193
+ }
194
+ break;
195
+ case BindingType_1.bindingTypeValues.ResolvedValue:
196
+ for (const resolvedValue of planBindingNode.params) {
197
+ this.#invalidateNonCachePlanServiceNode(resolvedValue);
198
+ }
199
+ break;
200
+ default:
201
+ }
202
+ }
203
+ #invalidateNonCachePlanServiceNode(planServiceNode) {
204
+ const serviceNonCachedSet = this.#serviceIdToNonCachedServiceNodeSetMap.get(planServiceNode.serviceIdentifier);
205
+ if (serviceNonCachedSet === undefined ||
206
+ !serviceNonCachedSet.has(planServiceNode)) {
207
+ return;
208
+ }
209
+ serviceNonCachedSet.delete(planServiceNode);
210
+ this.#invalidateNonCachePlanServiceNodeDescendents(planServiceNode);
211
+ }
212
+ #invalidateNonCachePlanServiceNodeDescendents(planServiceNode) {
213
+ if (planServiceNode.bindings === undefined) {
214
+ return;
215
+ }
216
+ if (Array.isArray(planServiceNode.bindings)) {
217
+ for (const binding of planServiceNode.bindings) {
218
+ this.#invalidateNonCachePlanBindingNodeDescendents(binding);
126
219
  }
127
220
  }
128
221
  else {
129
- if (options.optional === true) {
130
- return GetPlanBooleanOptionsMask.singleOptional;
222
+ this.#invalidateNonCachePlanBindingNodeDescendents(planServiceNode.bindings);
223
+ }
224
+ }
225
+ #invalidateNonCachedServiceNodeSetMap(serviceIdentifier) {
226
+ const serviceNonCachedServiceNodeSet = this.#serviceIdToNonCachedServiceNodeSetMap.get(serviceIdentifier);
227
+ if (serviceNonCachedServiceNodeSet !== undefined) {
228
+ for (const serviceNode of serviceNonCachedServiceNodeSet) {
229
+ if (LazyPlanServiceNode_1.LazyPlanServiceNode.is(serviceNode)) {
230
+ this.#invalidateNonCachePlanServiceNodeDescendents(serviceNode);
231
+ serviceNode.invalidate();
232
+ }
131
233
  }
132
- else {
133
- return GetPlanBooleanOptionsMask.singleMandatory;
234
+ }
235
+ }
236
+ #invalidateServiceMap(serviceIdentifier) {
237
+ for (const map of this.#serviceIdToValuePlanMap) {
238
+ const servicePlan = map.get(serviceIdentifier);
239
+ if (servicePlan !== undefined &&
240
+ LazyPlanServiceNode_1.LazyPlanServiceNode.is(servicePlan.tree.root)) {
241
+ this.#invalidateNonCachePlanServiceNodeDescendents(servicePlan.tree.root);
242
+ servicePlan.tree.root.invalidate();
243
+ }
244
+ }
245
+ }
246
+ #invalidateTaggedServiceMap(serviceIdentifier) {
247
+ for (const map of this.#taggedServiceIdToValuePlanMap) {
248
+ const servicePlanMapMap = map.get(serviceIdentifier);
249
+ if (servicePlanMapMap !== undefined) {
250
+ for (const servicePlanMap of servicePlanMapMap.values()) {
251
+ for (const servicePlan of servicePlanMap.values()) {
252
+ if (LazyPlanServiceNode_1.LazyPlanServiceNode.is(servicePlan.tree.root)) {
253
+ this.#invalidateNonCachePlanServiceNodeDescendents(servicePlan.tree.root);
254
+ servicePlan.tree.root.invalidate();
255
+ }
256
+ }
257
+ }
134
258
  }
135
259
  }
136
260
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PlanResultCacheService.js","sourceRoot":"","sources":["../../../../src/planning/services/PlanResultCacheService.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I,CAAC,IAAI,CAAC,EAAE,CAAC;4BAClD,IAAI,CAAC,6CAA6C,CAChD,WAAW,CAAC,IAAI,CAAC,IAAI,CACtB,CAAC;4BAEF,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;wBACrC,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAhYD,wDAgYC"}
@@ -147,7 +147,7 @@ interface BindingActivationRelation {
147
147
  declare class ActivationsService implements Cloneable<ActivationsService> {
148
148
  #private;
149
149
  private constructor();
150
- static build(parent: ActivationsService | undefined): ActivationsService;
150
+ static build(getParent: () => ActivationsService | undefined): ActivationsService;
151
151
  add(activation: BindingActivation, relation: BindingActivationRelation): void;
152
152
  clone(): ActivationsService;
153
153
  get(serviceIdentifier: ServiceIdentifier): Iterable<BindingActivation> | undefined;
@@ -158,7 +158,7 @@ declare class ActivationsService implements Cloneable<ActivationsService> {
158
158
  declare class BindingService implements Cloneable<BindingService> {
159
159
  #private;
160
160
  private constructor();
161
- static build(parent: BindingService | undefined): BindingService;
161
+ static build(getParent: () => BindingService | undefined): BindingService;
162
162
  clone(): BindingService;
163
163
  get<TResolved>(serviceIdentifier: ServiceIdentifier): Iterable<Binding<TResolved>> | undefined;
164
164
  getChained<TResolved>(serviceIdentifier: ServiceIdentifier): Generator<Binding<TResolved>, void, unknown>;
@@ -184,7 +184,7 @@ interface BindingDeactivationRelation {
184
184
  declare class DeactivationsService implements Cloneable<DeactivationsService> {
185
185
  #private;
186
186
  private constructor();
187
- static build(parent: DeactivationsService | undefined): DeactivationsService;
187
+ static build(getParent: () => DeactivationsService | undefined): DeactivationsService;
188
188
  add(deactivation: BindingDeactivation, relation: BindingDeactivationRelation): void;
189
189
  clone(): DeactivationsService;
190
190
  get(serviceIdentifier: ServiceIdentifier): Iterable<BindingDeactivation> | undefined;
@@ -273,51 +273,30 @@ interface BasePlanParamsAutobindOptions {
273
273
  scope: BindingScope;
274
274
  }
275
275
 
276
- interface BasePlanParams {
277
- autobindOptions: BasePlanParamsAutobindOptions | undefined;
278
- getBindings: <TInstance>(serviceIdentifier: ServiceIdentifier<TInstance>) => Iterable<Binding<TInstance>> | undefined;
279
- getBindingsChained: <TInstance>(serviceIdentifier: ServiceIdentifier<TInstance>) => Generator<Binding<TInstance>, void, unknown>;
280
- getClassMetadata: (type: Newable) => ClassMetadata;
281
- servicesBranch: ServiceIdentifier[];
282
- setBinding: <TInstance>(binding: Binding<TInstance>) => void;
283
- }
284
-
285
- interface PlanParamsTagConstraint {
276
+ interface GetPlanOptionsTagConstraint {
286
277
  key: MetadataTag;
287
278
  value: unknown;
288
279
  }
289
280
 
290
- interface MultipleBindingPlanParamsConstraint {
291
- chained: boolean;
292
- name?: MetadataName;
293
- isMultiple: true;
294
- isOptional?: true;
295
- serviceIdentifier: ServiceIdentifier;
296
- tag?: PlanParamsTagConstraint;
297
- }
298
-
299
- interface SingleBindingPlanParamsConstraint {
300
- name?: MetadataName;
301
- isMultiple: false;
302
- isOptional?: true;
281
+ interface BaseGetPlanOptions {
303
282
  serviceIdentifier: ServiceIdentifier;
304
- tag?: PlanParamsTagConstraint;
283
+ name: MetadataName | undefined;
284
+ optional: boolean;
285
+ tag: GetPlanOptionsTagConstraint | undefined;
305
286
  }
306
287
 
307
- type PlanParamsConstraint = SingleBindingPlanParamsConstraint | MultipleBindingPlanParamsConstraint;
308
-
309
- interface PlanParams extends BasePlanParams {
310
- rootConstraints: PlanParamsConstraint;
288
+ interface GetMultipleServicePlanOptions extends BaseGetPlanOptions {
289
+ chained: boolean;
290
+ isMultiple: true;
311
291
  }
312
292
 
313
- interface PlanServiceRedirectionBindingNode<TBinding extends ServiceRedirectionBinding<any> = ServiceRedirectionBinding<any>> extends BaseBindingNode<TBinding> {
314
- redirections: PlanBindingNode[];
293
+ interface GetSingleServicePlanOptions extends BaseGetPlanOptions {
294
+ isMultiple: false;
315
295
  }
316
296
 
317
- type BindingNodeParent = PlanServiceNode | PlanServiceRedirectionBindingNode;
297
+ type GetPlanOptions = GetSingleServicePlanOptions | GetMultipleServicePlanOptions;
318
298
 
319
299
  interface BaseBindingNode<TBinding extends Binding<any> = Binding<any>> {
320
- readonly parent: BindingNodeParent;
321
300
  readonly binding: TBinding;
322
301
  }
323
302
 
@@ -335,11 +314,15 @@ interface ResolvedValueBindingNode<TBinding extends ResolvedValueBinding<any> =
335
314
 
336
315
  type PlanServiceNodeParent<TActivated = any> = InstanceBindingNode<InstanceBinding<TActivated>> | ResolvedValueBindingNode<ResolvedValueBinding<TActivated>>;
337
316
 
317
+ interface PlanServiceRedirectionBindingNode<TBinding extends ServiceRedirectionBinding<any> = ServiceRedirectionBinding<any>> extends BaseBindingNode<TBinding> {
318
+ redirections: PlanBindingNode[];
319
+ }
320
+
338
321
  type PlanBindingNode = PlanServiceNodeParent | PlanServiceRedirectionBindingNode | LeafBindingNode;
339
322
 
340
323
  interface PlanServiceNode {
341
- readonly bindings: PlanBindingNode | PlanBindingNode[] | undefined;
342
- readonly parent: PlanServiceNodeParent | undefined;
324
+ bindings: PlanBindingNode | PlanBindingNode[] | undefined;
325
+ isContextFree: boolean;
343
326
  readonly serviceIdentifier: ServiceIdentifier;
344
327
  }
345
328
 
@@ -351,19 +334,52 @@ interface PlanResult {
351
334
  readonly tree: PlanTree;
352
335
  }
353
336
 
354
- declare function plan(params: PlanParams): PlanResult;
337
+ interface PlanParamsOperations {
338
+ getBindings: <TInstance>(serviceIdentifier: ServiceIdentifier<TInstance>) => Iterable<Binding<TInstance>> | undefined;
339
+ getBindingsChained: <TInstance>(serviceIdentifier: ServiceIdentifier<TInstance>) => Generator<Binding<TInstance>, void, unknown>;
340
+ readonly getClassMetadata: (type: Newable) => ClassMetadata;
341
+ readonly getPlan: (options: GetPlanOptions) => PlanResult | undefined;
342
+ setBinding: <TInstance>(binding: Binding<TInstance>) => void;
343
+ readonly setNonCachedServiceNode: (node: PlanServiceNode) => void;
344
+ readonly setPlan: (options: GetPlanOptions, planResult: PlanResult) => void;
345
+ }
355
346
 
356
- interface GetPlanOptionsTagConstraint {
347
+ interface BasePlanParams {
348
+ autobindOptions: BasePlanParamsAutobindOptions | undefined;
349
+ operations: PlanParamsOperations;
350
+ servicesBranch: ServiceIdentifier[];
351
+ }
352
+
353
+ interface PlanParamsTagConstraint {
357
354
  key: MetadataTag;
358
355
  value: unknown;
359
356
  }
360
- interface GetPlanOptions {
357
+
358
+ interface MultipleBindingPlanParamsConstraint {
359
+ chained: boolean;
360
+ name?: MetadataName;
361
+ isMultiple: true;
362
+ isOptional?: true;
361
363
  serviceIdentifier: ServiceIdentifier;
362
- isMultiple: boolean;
363
- name: MetadataName | undefined;
364
- optional: boolean | undefined;
365
- tag: GetPlanOptionsTagConstraint | undefined;
364
+ tag?: PlanParamsTagConstraint;
365
+ }
366
+
367
+ interface SingleBindingPlanParamsConstraint {
368
+ name?: MetadataName;
369
+ isMultiple: false;
370
+ isOptional?: true;
371
+ serviceIdentifier: ServiceIdentifier;
372
+ tag?: PlanParamsTagConstraint;
366
373
  }
374
+
375
+ type PlanParamsConstraint = SingleBindingPlanParamsConstraint | MultipleBindingPlanParamsConstraint;
376
+
377
+ interface PlanParams extends BasePlanParams {
378
+ rootConstraints: PlanParamsConstraint;
379
+ }
380
+
381
+ declare function plan(params: PlanParams): PlanResult;
382
+
367
383
  /**
368
384
  * Service to cache plans.
369
385
  *
@@ -379,7 +395,9 @@ declare class PlanResultCacheService {
379
395
  constructor();
380
396
  clearCache(): void;
381
397
  get(options: GetPlanOptions): PlanResult | undefined;
398
+ invalidateService(serviceIdentifier: ServiceIdentifier): void;
382
399
  set(options: GetPlanOptions, planResult: PlanResult): void;
400
+ setNonCachedServiceNode(node: PlanServiceNode): void;
383
401
  subscribe(subscriber: PlanResultCacheService): void;
384
402
  }
385
403
 
@@ -414,4 +432,4 @@ interface OptionalGetAllOptions extends GetAllOptions {
414
432
  }
415
433
 
416
434
  export { ActivationsService, BindingService, ClassElementMetadataKind, DeactivationsService, PlanResultCacheService, ResolvedValueElementMetadataKind, bindingScopeValues, bindingTypeValues, decorate, getBindingId, getClassMetadata, inject, injectFromBase, injectable, multiInject, named, optional, plan, postConstruct, preDestroy, resolve, resolveBindingsDeactivations, resolveModuleDeactivations, resolveServiceDeactivations, tagged, unmanaged };
417
- export type { BaseBinding, BaseBindingNode, BaseManagedClassElementMetadata, BasePlanParams, Binding, BindingActivation, BindingActivationRelation, BindingConstraints, BindingDeactivation, BindingDeactivationRelation, BindingScope, BindingType, ClassElementMetadata, ClassMetadata, ClassMetadataLifecycle, ConstantValueBinding, DeactivationParams, DynamicValueBinding, DynamicValueBuilder, Factory, FactoryBinding, GetAllOptions, GetOptions, GetOptionsTagConstraint, GetPlanOptions, InstanceBinding, InstanceBindingNode, LeafBindingNode, ManagedClassElementMetadata, MetadataName, MetadataTag, MultiInjectOptions, MultipleBindingPlanParamsConstraint, MultipleInjectionManagedClassElementMetadata, MultipleInjectionResolvedValueElementMetadata, OptionalGetAllOptions, OptionalGetOptions, PlanBindingNode, PlanParams, PlanParamsConstraint, PlanParamsTagConstraint, PlanResult, PlanServiceNode, PlanServiceNodeParent, PlanServiceRedirectionBindingNode, PlanTree, Provider, ProviderBinding, ResolutionContext, ResolutionParams, Resolved, ResolvedValueBinding, ResolvedValueBindingNode, ResolvedValueElementMetadata, ResolvedValueMetadata, ScopedBinding, ServiceRedirectionBinding, SingleBindingPlanParamsConstraint, SingleInjectionManagedClassElementMetadata, SingleInjectionResolvedValueElementMetadata, UnmanagedClassElementMetadata };
435
+ export type { BaseBinding, BaseBindingNode, BaseGetPlanOptions, BaseManagedClassElementMetadata, BasePlanParams, Binding, BindingActivation, BindingActivationRelation, BindingConstraints, BindingDeactivation, BindingDeactivationRelation, BindingScope, BindingType, ClassElementMetadata, ClassMetadata, ClassMetadataLifecycle, ConstantValueBinding, DeactivationParams, DynamicValueBinding, DynamicValueBuilder, Factory, FactoryBinding, GetAllOptions, GetMultipleServicePlanOptions, GetOptions, GetOptionsTagConstraint, GetPlanOptions, GetPlanOptionsTagConstraint, GetSingleServicePlanOptions, InstanceBinding, InstanceBindingNode, LeafBindingNode, ManagedClassElementMetadata, MetadataName, MetadataTag, MultiInjectOptions, MultipleBindingPlanParamsConstraint, MultipleInjectionManagedClassElementMetadata, MultipleInjectionResolvedValueElementMetadata, OptionalGetAllOptions, OptionalGetOptions, PlanBindingNode, PlanParams, PlanParamsConstraint, PlanParamsOperations, PlanParamsTagConstraint, PlanResult, PlanServiceNode, PlanServiceNodeParent, PlanServiceRedirectionBindingNode, PlanTree, Provider, ProviderBinding, ResolutionContext, ResolutionParams, Resolved, ResolvedValueBinding, ResolvedValueBindingNode, ResolvedValueElementMetadata, ResolvedValueMetadata, ScopedBinding, ServiceRedirectionBinding, SingleBindingPlanParamsConstraint, SingleInjectionManagedClassElementMetadata, SingleInjectionResolvedValueElementMetadata, UnmanagedClassElementMetadata };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EACL,YAAY,EACZ,kBAAkB,EACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAs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Y,EACZ,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,OAAO,EACP,cAAc,EACd,aAAa,EACb,6BAA6B,EAC7B,UAAU,EACV,uBAAuB,EACvB,cAAc,EACd,2BAA2B,EAC3B,2BAA2B,EAC3B,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,2BAA2B,EAC3B,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,4CAA4C,EAC5C,6CAA6C,EAC7C,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,iCAAiC,EACjC,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC5B,qBAAqB,EACrB,aAAa,EACb,yBAAyB,EACzB,0CAA0C,EAC1C,2CAA2C,EAC3C,6BAA6B,GAC9B,CAAC;AAEF,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,cAAc,EACd,WAAW,EACX,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,sBAAsB,EACtB,aAAa,EACb,UAAU,EACV,OAAO,EACP,4BAA4B,EAC5B,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,MAAM,EACN,SAAS,EACT,mCAAmC,EACnC,iCAAiC,GAClC,CAAC"}
package/lib/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{getOwnReflectMetadata as e,setReflectMetadata as t,updateOwnReflectMetadata as n}from"@inversifyjs/reflect-metadata-utils";import{getBaseType as i}from"@inversifyjs/prototype-utils";import{stringifyServiceIdentifier as o,LazyServiceIdentifier as r,isPromise as a}from"@inversifyjs/common";const s="@inversifyjs/container/bindingId";function c(){const i=e(Object,s)??0;return i===Number.MAX_SAFE_INTEGER?t(Object,s,Number.MIN_SAFE_INTEGER):n(Object,s,()=>i,e=>e+1),i}const d={Request:"Request",Singleton:"Singleton",Transient:"Transient"},u={ConstantValue:"ConstantValue",DynamicValue:"DynamicValue",Factory:"Factory",Instance:"Instance",Provider:"Provider",ResolvedValue:"ResolvedValue",ServiceRedirection:"ServiceRedirection"};function*l(...e){for(const t of e)yield*t}class p{#e;#t;#n;constructor(e){this.#e=new Map,this.#t={};for(const t of Reflect.ownKeys(e))this.#t[t]=new Map;this.#n=e}add(e,t){this.#i(e).push(t);for(const n of Reflect.ownKeys(t))this.#o(n,t[n]).push(e)}clone(){const e=this.#r(),t=this.#a(),n=Reflect.ownKeys(this.#n),i=this._buildNewInstance(this.#n);this.#s(this.#e,i.#e,e,t);for(const t of n)this.#c(this.#t[t],i.#t[t],e);return i}get(e,t){return this.#t[e].get(t)}getAllKeys(e){return this.#t[e].keys()}removeByRelation(e,t){const n=this.get(e,t);if(void 0===n)return;const i=new Set(n);for(const n of i){const i=this.#e.get(n);if(void 0===i)throw new Error("Expecting model relation, none found");for(const o of i)o[e]===t&&this.#d(n,o);this.#e.delete(n)}}_buildNewInstance(e){return new p(e)}_cloneModel(e){return e}_cloneRelation(e){return e}#r(){const e=new Map;for(const t of this.#e.keys()){const n=this._cloneModel(t);e.set(t,n)}return e}#a(){const e=new Map;for(const t of this.#e.values())for(const n of t){const t=this._cloneRelation(n);e.set(n,t)}return e}#i(e){let t=this.#e.get(e);return void 0===t&&(t=[],this.#e.set(e,t)),t}#o(e,t){let n=this.#t[e].get(t);return void 0===n&&(n=[],this.#t[e].set(t,n)),n}#u(e,t){const n=t.get(e);if(void 0===n)throw new Error("Expecting model to be cloned, none found");return n}#l(e,t){const n=t.get(e);if(void 0===n)throw new Error("Expecting relation to be cloned, none found");return n}#c(e,t,n){for(const[i,o]of e){const e=new Array;for(const t of o)e.push(this.#u(t,n));t.set(i,e)}}#s(e,t,n,i){for(const[o,r]of e){const e=new Array;for(const t of r)e.push(this.#l(t,i));t.set(this.#u(o,n),e)}}#d(e,t){for(const n of Reflect.ownKeys(t))this.#p(e,n,t[n])}#p(e,t,n){const i=this.#t[t].get(n);if(void 0!==i){const o=i.indexOf(e);-1!==o&&i.splice(o,1),0===i.length&&this.#t[t].delete(n)}}}var f,g,h;!function(e){e.moduleId="moduleId",e.serviceId="serviceId"}(f||(f={}));class m{#f;#g;constructor(e,t){this.#f=t??new p({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#g=e}static build(e){return new m(e)}add(e,t){this.#f.add(e,t)}clone(){return new m(this.#g,this.#f.clone())}get(e){const t=[],n=this.#f.get(f.serviceId,e);void 0!==n&&t.push(n);const i=this.#g?.get(e);if(void 0!==i&&t.push(i),0!==t.length)return l(...t)}removeAllByModuleId(e){this.#f.removeByRelation(f.moduleId,e)}removeAllByServiceId(e){this.#f.removeByRelation(f.serviceId,e)}}function v(e){return e.isRight?{isRight:!0,value:e.value}:e}function y(e){switch(e.type){case u.ConstantValue:case u.DynamicValue:return function(e){return{cache:v(e.cache),id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type,value:e.value}}(e);case u.Factory:return function(e){return{cache:v(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case u.Instance:return function(e){return{cache:v(e.cache),id:e.id,implementationType:e.implementationType,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case u.Provider:return function(e){return{cache:v(e.cache),id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,provider:e.provider,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case u.ResolvedValue:return function(e){return{cache:v(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,metadata:e.metadata,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case u.ServiceRedirection:return function(e){return{id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,serviceIdentifier:e.serviceIdentifier,targetServiceIdentifier:e.targetServiceIdentifier,type:e.type}}(e)}}!function(e){e.id="id",e.moduleId="moduleId",e.serviceId="serviceId"}(g||(g={}));class M extends p{_buildNewInstance(e){return new M(e)}_cloneModel(e){return y(e)}}class I{#h;#g;constructor(e,t){this.#h=t??new M({id:{isOptional:!1},moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#g=e}static build(e){return new I(e)}clone(){return new I(this.#g,this.#h.clone())}get(e){return this.getNonParentBindings(e)??this.#g?.get(e)}*getChained(e){const t=this.getNonParentBindings(e);void 0!==t&&(yield*t),void 0!==this.#g&&(yield*this.#g.getChained(e))}getBoundServices(){const e=new Set(this.#h.getAllKeys(g.serviceId));if(void 0!==this.#g)for(const t of this.#g.getBoundServices())e.add(t);return e}getById(e){return this.#h.get(g.id,e)??this.#g?.getById(e)}getByModuleId(e){return this.#h.get(g.moduleId,e)??this.#g?.getByModuleId(e)}getNonParentBindings(e){return this.#h.get(g.serviceId,e)}getNonParentBoundServices(){return this.#h.getAllKeys(g.serviceId)}removeById(e){this.#h.removeByRelation(g.id,e)}removeAllByModuleId(e){this.#h.removeByRelation(g.moduleId,e)}removeAllByServiceId(e){this.#h.removeByRelation(g.serviceId,e)}set(e){const t={[g.id]:e.id,[g.serviceId]:e.serviceIdentifier};void 0!==e.moduleId&&(t[g.moduleId]=e.moduleId),this.#h.add(e,t)}}!function(e){e.moduleId="moduleId",e.serviceId="serviceId"}(h||(h={}));class w{#m;#g;constructor(e,t){this.#m=t??new p({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#g=e}static build(e){return new w(e)}add(e,t){this.#m.add(e,t)}clone(){return new w(this.#g,this.#m.clone())}get(e){const t=[],n=this.#m.get(h.serviceId,e);void 0!==n&&t.push(n);const i=this.#g?.get(e);if(void 0!==i&&t.push(i),0!==t.length)return l(...t)}removeAllByModuleId(e){this.#m.removeByRelation(h.moduleId,e)}removeAllByServiceId(e){this.#m.removeByRelation(h.serviceId,e)}}function b(e,t,n){const i=Array.isArray(e)?e:[e];if(void 0!==n)if("number"!=typeof n)Reflect.decorate(i,t.prototype,n);else for(const e of i)e(t,void 0,n);else Reflect.decorate(i,t)}const j="@inversifyjs/core/classMetadataReflectKey";function S(){return{constructorArguments:[],lifecycle:{postConstructMethodName:void 0,preDestroyMethodName:void 0},properties:new Map,scope:void 0}}const R="@inversifyjs/core/pendingClassMetadataCountReflectKey";const T=Symbol.for("@inversifyjs/core/InversifyCoreError");class C extends Error{[T];kind;constructor(e,t,n){super(t,n),this[T]=!0,this.kind=e}static is(e){return"object"==typeof e&&null!==e&&!0===e[T]}static isErrorOfKind(e,t){return C.is(e)&&e.kind===t}}var A,B,$;function x(t){const n=e(t,j)??S();if(!function(t){const n=e(t,R);return void 0!==n&&0!==n}(t))return function(e,t){const n=[];if(t.length<e.length)throw new C(A.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}". "${e.name}" constructor requires at least ${e.length.toString()} arguments, found ${t.length.toString()} instead.\nAre you using @inject, @multiInject or @unmanaged decorators in every non optional constructor argument?\n\nIf you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`);for(let e=0;e<t.length;++e)void 0===t[e]&&n.push(e);if(n.length>0)throw new C(A.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}" at constructor indexes "${n.join('", "')}".\n\nAre you using @inject, @multiInject or @unmanaged decorators at those indexes?\n\nIf you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`)}(t,n.constructorArguments),n;!function(e,t){const n=[];for(let i=0;i<t.constructorArguments.length;++i){const o=t.constructorArguments[i];void 0!==o&&o.kind!==B.unknown||n.push(` - Missing or incomplete metadata for type "${e.name}" at constructor argument with index ${i.toString()}.\nEvery constructor parameter must be decorated either with @inject, @multiInject or @unmanaged decorator.`)}for(const[i,o]of t.properties)o.kind===B.unknown&&n.push(` - Missing or incomplete metadata for type "${e.name}" at property "${i.toString()}".\nThis property must be decorated either with @inject or @multiInject decorator.`);if(0===n.length)throw new C(A.unknown,`Unexpected class metadata for type "${e.name}" with uncompletion traces.\nThis might be caused by one of the following reasons:\n\n1. A third party library is targeting inversify reflection metadata.\n2. A bug is causing the issue. Consider submiting an issue to fix it.`);throw new C(A.missingInjectionDecorator,`Invalid class metadata at type ${e.name}:\n\n${n.join("\n\n")}`)}(t,n)}function k(){return 0}function D(e){return t=>{void 0!==t&&t.kind===B.unknown&&n(e,R,k,e=>e-1)}}function P(e,t){return(...n)=>i=>{if(void 0===i)return e(...n);if(i.kind===$.unmanaged)throw new C(A.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found");return t(i,...n)}}function O(e){if(e.kind!==B.unknown&&!0!==e.isFromTypescriptParamType)throw new C(A.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found")}!function(e){e[e.injectionDecoratorConflict=0]="injectionDecoratorConflict",e[e.missingInjectionDecorator=1]="missingInjectionDecorator",e[e.planning=2]="planning",e[e.resolution=3]="resolution",e[e.unknown=4]="unknown"}(A||(A={})),function(e){e[e.unknown=32]="unknown"}(B||(B={})),function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection",e[e.unmanaged=2]="unmanaged"}($||($={}));const V=P(function(e,t,n){return e===$.multipleInjection?{chained:n?.chained??!1,kind:e,name:void 0,optional:!1,tags:new Map,value:t}:{kind:e,name:void 0,optional:!1,tags:new Map,value:t}},function(e,t,n,i){return O(e),t===$.multipleInjection?{...e,chained:i?.chained??!1,kind:t,value:n}:{...e,kind:t,value:n}});function F(e,t){return n=>{const i=n.properties.get(t);return n.properties.set(t,e(i)),n}}var E;function N(e,t,n,i){if(C.isErrorOfKind(i,A.injectionDecoratorConflict)){const o=function(e,t,n){if(void 0===n){if(void 0===t)throw new C(A.unknown,"Unexpected undefined property and index values");return{kind:E.property,property:t,targetClass:e.constructor}}return"number"==typeof n?{index:n,kind:E.parameter,targetClass:e}:{kind:E.method,method:t,targetClass:e}}(e,t,n);throw new C(A.injectionDecoratorConflict,`Unexpected injection error.\n\nCause:\n\n${i.message}\n\nDetails\n\n${function(e){switch(e.kind){case E.method:return`[class: "${e.targetClass.name}", method: "${e.method.toString()}"]`;case E.parameter:return`[class: "${e.targetClass.name}", index: "${e.index.toString()}"]`;case E.property:return`[class: "${e.targetClass.name}", property: "${e.property.toString()}"]`}}(o)}`,{cause:i})}throw i}function U(e,t){return(i,o,r)=>{try{void 0===r?function(e,t){const i=K(e,t);return(e,t)=>{n(e.constructor,j,S,F(i(e),t))}}(e,t)(i,o):"number"==typeof r?function(e,t){const i=K(e,t);return(e,t,o)=>{if(!function(e,t){return"function"==typeof e&&void 0===t}(e,t))throw new C(A.injectionDecoratorConflict,`Found an @inject decorator in a non constructor parameter.\nFound @inject decorator at method "${t?.toString()??""}" at class "${e.constructor.name}"`);n(e,j,S,function(e,t){return n=>{const i=n.constructorArguments[t];return n.constructorArguments[t]=e(i),n}}(i(e),o))}}(e,t)(i,o,r):function(e,t){const i=K(e,t);return(e,t,o)=>{if(!function(e){return void 0!==e.set}(o))throw new C(A.injectionDecoratorConflict,`Found an @inject decorator in a non setter property method.\nFound @inject decorator at method "${t.toString()}" at class "${e.constructor.name}"`);n(e.constructor,j,S,F(i(e),t))}}(e,t)(i,o,r)}catch(e){N(i,o,r,e)}}}function K(e,t){return n=>{const i=t(n);return t=>(i(t),e(t))}}function _(e){return U(V($.singleInjection,e),D)}!function(e){e[e.method=0]="method",e[e.parameter=1]="parameter",e[e.property=2]="property"}(E||(E={}));const q="@inversifyjs/core/classIsInjectableFlagReflectKey";const z=[Array,BigInt,Boolean,Function,Number,Object,String];function G(t){const i=e(t,"design:paramtypes");void 0!==i&&n(t,j,S,function(e){return t=>(e.forEach((e,n)=>{var i;void 0!==t.constructorArguments[n]||(i=e,z.includes(i))||(t.constructorArguments[n]=function(e){return{isFromTypescriptParamType:!0,kind:$.singleInjection,name:void 0,optional:!1,tags:new Map,value:e}}(e))}),t)}(i))}function L(i){return o=>{!function(n){if(void 0!==e(n,q))throw new C(A.injectionDecoratorConflict,`Cannot apply @injectable decorator multiple times at class "${n.name}"`);t(n,q,!0)}(o),G(o),void 0!==i&&n(o,j,S,e=>({...e,scope:i}))}}function W(e,t,n){let i;return e.extendConstructorArguments??!0?(i=[...t.constructorArguments],n.constructorArguments.map((e,t)=>{i[t]=e})):i=n.constructorArguments,i}function X(e,t,n){let i;return i=e.extendProperties??!0?new Map(l(t.properties,n.properties)):n.properties,i}function H(e){return t=>{const i=x(e.type);n(t,j,S,function(e,t){const n=n=>({constructorArguments:W(e,t,n),lifecycle:n.lifecycle,properties:X(e,t,n),scope:n.scope});return n}(e,i))}}function J(e){return t=>{const n=i(t);if(void 0===n)throw new C(A.injectionDecoratorConflict,`Expected base type for type "${t.name}", none found.`);H({...e,type:n})(t)}}function Q(e,t){return U(V($.multipleInjection,e,t),D)}function Y(e){return t=>{void 0===t&&n(e,R,k,e=>e+1)}}function Z(e){return t=>{const n=t??{kind:B.unknown,name:void 0,optional:!1,tags:new Map};if(n.kind===$.unmanaged)throw new C(A.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return e(n)}}function ee(e){const t=Z(function(e){return t=>{if(void 0!==t.name)throw new C(A.injectionDecoratorConflict,"Unexpected duplicated named decorator");return t.name=e,t}}(e));return U(t,Y)}function te(e){if(e.optional)throw new C(A.injectionDecoratorConflict,"Unexpected duplicated optional decorator");return e.optional=!0,e}function ne(){return U(Z(te),Y)}function ie(){return(e,t,i)=>{try{n(e.constructor,j,S,(o=t,e=>{if(void 0!==e.lifecycle.postConstructMethodName)throw new C(A.injectionDecoratorConflict,"Unexpected duplicated postConstruct decorator");return e.lifecycle.postConstructMethodName=o,e}))}catch(n){N(e,t,void 0,n)}var o}}function oe(){return(e,t,i)=>{try{n(e.constructor,j,S,(o=t,e=>{if(void 0!==e.lifecycle.preDestroyMethodName)throw new C(A.injectionDecoratorConflict,"Unexpected duplicated preDestroy decorator");return e.lifecycle.preDestroyMethodName=o,e}))}catch(n){N(e,t,void 0,n)}var o}}function re(e,t){const n=Z(function(e,t){return n=>{if(n.tags.has(e))throw new C(A.injectionDecoratorConflict,"Unexpected duplicated tag decorator with existing tag");return n.tags.set(e,t),n}}(e,t));return U(n,Y)}function ae(){return{kind:$.unmanaged}}const se=P(ae,function(e){if(O(e),function(e){return void 0!==e.name||e.optional||e.tags.size>0}(e))throw new C(A.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return ae()});function ce(){return U(se(),D)}var de;!function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection"}(de||(de={}));class ue{#v;constructor(e){this.#v=e}get name(){return this.#v.elem.name}get serviceIdentifier(){return this.#v.elem.serviceIdentifier}get tags(){return this.#v.elem.tags}getAncestor(){if(void 0!==this.#v.previous)return new ue(this.#v.previous)}}class le{last;constructor(e){this.last=e}concat(e){return new le({elem:e,previous:this.last})}[Symbol.iterator](){let e=this.last;return{next:()=>{if(void 0===e)return{done:!0,value:void 0};const t=e.elem;return e=e.previous,{done:!1,value:t}}}}}function pe(e,t,n){const i=n?.customServiceIdentifier??t.serviceIdentifier,o=(!0===n?.chained?[...e.getBindingsChained(i)]:[...e.getBindings(i)??[]]).filter(e=>e.isSatisfiedBy(t));if(0===o.length&&void 0!==e.autobindOptions&&"function"==typeof i){const t=function(e,t){const n=x(t),i=n.scope??e.scope;return{cache:{isRight:!1,value:void 0},id:c(),implementationType:t,isSatisfiedBy:()=>!0,moduleId:void 0,onActivation:void 0,onDeactivation:void 0,scope:i,serviceIdentifier:t,type:u.Instance}}(e.autobindOptions,i);e.setBinding(t),o.push(t)}return o}function fe(e){return void 0!==e.redirections}function ge(e,t,n,i){let r,a;fe(n)?(r=n.binding.targetServiceIdentifier,a=n.binding.serviceIdentifier):(r=n.serviceIdentifier,a=n.parent?.binding.serviceIdentifier),Array.isArray(e)?function(e,t,n,i,r){if(0!==e.length){const t=`Ambiguous bindings found for service: "${o(n)}".\n\nRegistered bindings:\n\n${e.map(e=>function(e){switch(e.type){case u.Instance:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", scope: "${e.scope}", implementationType: "${e.implementationType.name}" ]`;case u.ServiceRedirection:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", redirection: "${o(e.targetServiceIdentifier)}" ]`;default:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", scope: "${e.scope}" ]`}}(e.binding)).join("\n")}\n\nTrying to resolve bindings for "${me(n,i)}".\n\n${ve(r)}`;throw new C(A.planning,t)}t||he(n,i,r)}(e,t,r,a,i):function(e,t,n,i,o){if(void 0!==e||t)return;he(n,i,o)}(e,t,r,a,i)}function he(e,t,n){const i=`No bindings found for service: "${o(e)}".\n\nTrying to resolve bindings for "${me(e,t)}".\n\n${ve(n)}`;throw new C(A.planning,i)}function me(e,t){return void 0===t?`${o(e)} (Root service)`:o(t)}function ve(e){const t=0===e.tags.size?"":`\n- tags:\n - ${[...e.tags.keys()].map(e=>e.toString()).join("\n - ")}`;return`Binding constraints:\n- service identifier: ${o(e.serviceIdentifier)}\n- name: ${e.name?.toString()??"-"}${t}`}function ye(e,t,n){if(1===e.redirections.length){const[i]=e.redirections;return void(fe(i)&&ye(i,t,n))}ge(e.redirections,t,e,n)}function Me(e,t,n,i){if(Array.isArray(e.bindings)&&1===e.bindings.length){const[i]=e.bindings;return void(fe(i)&&ye(i,t,n))}ge(e.bindings,t,e,n)}function Ie(e,t){if(function(e){return e instanceof Error&&(e instanceof RangeError&&/stack space|call stack|too much recursion/i.test(e.message)||"InternalError"===e.name&&/too much recursion/.test(e.message))}(t)){const n=function(e){const t=[...e];if(0===t.length)return"(No dependency trace)";return t.map(o).join(" -> ")}(function(e){const t=new Set;for(const n of e.servicesBranch){if(t.has(n))return[...t,n];t.add(n)}return[...t]}(e));throw new C(A.planning,`Circular dependency found: ${n}`,{cause:t})}throw t}function we(e){try{const t=new Map;void 0!==e.rootConstraints.tag&&t.set(e.rootConstraints.tag.key,e.rootConstraints.tag.value);const n=new le({elem:{name:e.rootConstraints.name,serviceIdentifier:e.rootConstraints.serviceIdentifier,tags:t},previous:void 0}),i=new ue(n.last),o=!!e.rootConstraints.isMultiple&&e.rootConstraints.chained,r=pe(e,i,{chained:o}),a=[],s={bindings:a,parent:void 0,serviceIdentifier:e.rootConstraints.serviceIdentifier};if(a.push(...Te(e,n,r,s,o)),!e.rootConstraints.isMultiple){Me(s,e.rootConstraints.isOptional??!1,i);const[t]=a;s.bindings=t}return{tree:{root:s}}}catch(t){Ie(e,t)}}function be(e,t,n,i){const o={binding:t,classMetadata:e.getClassMetadata(t.implementationType),constructorParams:[],parent:i,propertyParams:new Map};return Ae({autobindOptions:e.autobindOptions,getBindings:e.getBindings,getBindingsChained:e.getBindingsChained,getClassMetadata:e.getClassMetadata,node:o,servicesBranch:e.servicesBranch,setBinding:e.setBinding},n)}function je(e,t,n){if(n.kind===$.unmanaged)return;const i=r.is(n.value)?n.value.unwrap():n.value,o=t.concat({name:n.name,serviceIdentifier:i,tags:n.tags}),a=new ue(o.last),s=n.kind===$.multipleInjection&&n.chained,c=pe(e,a,{chained:s}),d=[],u={bindings:d,parent:e.node,serviceIdentifier:i};if(d.push(...Te(e,o,c,u,s)),n.kind===$.singleInjection){Me(u,n.optional,a);const[e]=d;u.bindings=e}return u}function Se(e,t,n){const i=r.is(n.value)?n.value.unwrap():n.value,o=t.concat({name:n.name,serviceIdentifier:i,tags:n.tags}),a=new ue(o.last),s=n.kind===de.multipleInjection&&n.chained,c=pe(e,a,{chained:s}),d=[],u={bindings:d,parent:e.node,serviceIdentifier:i};if(d.push(...Te(e,o,c,u,s)),n.kind===de.singleInjection){Me(u,n.optional,a);const[e]=d;u.bindings=e}return u}function Re(e,t,n,i){const o={binding:t,params:[],parent:i};return Ae({autobindOptions:e.autobindOptions,getBindings:e.getBindings,getBindingsChained:e.getBindingsChained,getClassMetadata:e.getClassMetadata,node:o,servicesBranch:e.servicesBranch,setBinding:e.setBinding},n)}function Te(e,t,n,i,o){const r=fe(i)?i.binding.targetServiceIdentifier:i.serviceIdentifier;e.servicesBranch.push(r);const a=[];for(const r of n)switch(r.type){case u.Instance:a.push(be(e,r,t,i));break;case u.ResolvedValue:a.push(Re(e,r,t,i));break;case u.ServiceRedirection:{const n=Ce(e,t,r,i,o);a.push(n);break}default:a.push({binding:r,parent:i})}return e.servicesBranch.pop(),a}function Ce(e,t,n,i,o){const r={binding:n,parent:i,redirections:[]},a=pe(e,new ue(t.last),{chained:o,customServiceIdentifier:n.targetServiceIdentifier});return r.redirections.push(...Te(e,t,a,r,o)),r}function Ae(e,t){return e.node.binding.type===u.Instance?function(e,t,n){const i=t.classMetadata;for(const[o,r]of i.constructorArguments.entries())t.constructorParams[o]=je(e,n,r);for(const[o,r]of i.properties){const i=je(e,n,r);void 0!==i&&t.propertyParams.set(o,i)}return e.node}(e,e.node,t):function(e,t,n){const i=t.binding.metadata;for(const[o,r]of i.arguments.entries())t.params[o]=Se(e,n,r);return e.node}(e,e.node,t)}class Be{#y;#M;#I;constructor(){this.#y=[],this.#M=8,this.#I=1024}*[Symbol.iterator](){let e=0;for(const t of this.#y){const n=t.deref();void 0===n?++e:yield n}this.#y.length>=this.#M&&this.#w(e)&&this.#b(e)}push(e){const t=new WeakRef(e);if(this.#y.push(t),this.#y.length>=this.#M&&this.#y.length%this.#I===0){let e=0;for(const t of this.#y)void 0===t.deref()&&++e;this.#w(e)&&this.#b(e)}}#b(e){const t=new Array(this.#y.length-e);let n=0;for(const e of this.#y)e.deref()&&(t[n++]=e);this.#y=t}#w(e){return e>=.5*this.#y.length}}var $e;!function(e){e[e.singleMandatory=0]="singleMandatory",e[e.singleOptional=1]="singleOptional",e[e.multipleMandatory=2]="multipleMandatory",e[e.multipleOptional=3]="multipleOptional",e[e.length=4]="length"}($e||($e={}));class xe{#j;#S;#R;#T;#C;constructor(){this.#j=this.#A(),this.#S=this.#A(),this.#R=this.#A(),this.#T=this.#A(),this.#C=new Be}clearCache(){for(const e of this.#B())e.clear();for(const e of this.#C)e.clearCache()}get(e){return void 0===e.name?void 0===e.tag?this.#$(this.#j,e).get(e.serviceIdentifier):this.#$(this.#T,e).get(e.serviceIdentifier)?.get(e.tag.key)?.get(e.tag.value):void 0===e.tag?this.#$(this.#S,e).get(e.serviceIdentifier)?.get(e.name):this.#$(this.#R,e).get(e.serviceIdentifier)?.get(e.name)?.get(e.tag.key)?.get(e.tag.value)}set(e,t){void 0===e.name?void 0===e.tag?this.#$(this.#j,e).set(e.serviceIdentifier,t):this.#x(this.#x(this.#$(this.#T,e),e.serviceIdentifier),e.tag.key).set(e.tag.value,t):void 0===e.tag?this.#x(this.#$(this.#S,e),e.serviceIdentifier).set(e.name,t):this.#x(this.#x(this.#x(this.#$(this.#R,e),e.serviceIdentifier),e.name),e.tag.key).set(e.tag.value,t)}subscribe(e){this.#C.push(e)}#A(){const e=new Array($e.length);for(let t=0;t<e.length;++t)e[t]=new Map;return e}#x(e,t){let n=e.get(t);return void 0===n&&(n=new Map,e.set(t,n)),n}#$(e,t){return e[this.#k(t)]}#B(){return[...this.#j,...this.#S,...this.#R,...this.#T]}#k(e){return e.isMultiple?!0===e.optional?$e.multipleOptional:$e.multipleMandatory:!0===e.optional?$e.singleOptional:$e.singleMandatory}}function ke(e,t){return a(t)?(e.cache={isRight:!0,value:t},t.then(t=>De(e,t))):De(e,t)}function De(e,t){return e.cache={isRight:!0,value:t},t}function Pe(e,t,n){const i=e.getActivations(t);return void 0===i?n:a(n)?Oe(e,n,i[Symbol.iterator]()):function(e,t,n){let i=t,o=n.next();for(;!0!==o.done;){const t=o.value(e.context,i);if(a(t))return Oe(e,t,n);i=t,o=n.next()}return i}(e,n,i[Symbol.iterator]())}async function Oe(e,t,n){let i=await t,o=n.next();for(;!0!==o.done;)i=await o.value(e.context,i),o=n.next();return i}function Ve(e,t,n){let i=n;if(void 0!==t.onActivation){const n=t.onActivation;i=a(i)?i.then(t=>n(e.context,t)):n(e.context,i)}return Pe(e,t.serviceIdentifier,i)}function Fe(e){return(t,n)=>{if(n.cache.isRight)return n.cache.value;return ke(n,Ve(t,n,e(t,n)))}}const Ee=Fe(function(e,t){return t.value});function Ne(e){return e}function Ue(e,t){return(n,i)=>{const o=e(i);switch(o.scope){case d.Singleton:if(o.cache.isRight)return o.cache.value;return ke(o,Ve(n,o,t(n,i)));case d.Request:{if(n.requestScopeCache.has(o.id))return n.requestScopeCache.get(o.id);const e=Ve(n,o,t(n,i));return n.requestScopeCache.set(o.id,e),e}case d.Transient:return Ve(n,o,t(n,i))}}}const Ke=(e=>Ue(Ne,e))(function(e,t){return t.value(e.context)});const _e=Fe(function(e,t){return t.factory(e.context)});function qe(e,t,n){const i=function(e,t,n){if(void 0===n)return;if(!(n in e))throw new C(A.resolution,`Expecting a "${n.toString()}" property when resolving "${t.implementationType.name}" class @postConstruct decorated method, none found.`);if("function"!=typeof e[n])throw new C(A.resolution,`Expecting a "${n.toString()}" method when resolving "${t.implementationType.name}" class @postConstruct decorated method, a non function property was found instead.`);{let i;try{i=e[n]()}catch(e){throw new C(A.resolution,`Unexpected error found when calling "${n.toString()}" @postConstruct decorated method on class "${t.implementationType.name}"`,{cause:e})}if(a(i))return async function(e,t,n){try{await n}catch(n){throw new C(A.resolution,`Unexpected error found when calling "${t.toString()}" @postConstruct decorated method on class "${e.implementationType.name}"`,{cause:n})}}(t,n,i)}}(e,t,n);return a(i)?i.then(()=>e):e}function ze(e){return(t,n,i)=>{const o=new i.binding.implementationType(...t),r=e(n,o,i);return a(r)?r.then(()=>qe(o,i.binding,i.classMetadata.lifecycle.postConstructMethodName)):qe(o,i.binding,i.classMetadata.lifecycle.postConstructMethodName)}}const Ge=Fe(function(e,t){return t.provider(e.context)});function Le(e){return e.binding}function We(e){return e.binding}const Xe=function(e){return(t,n,i)=>{const o=[];for(const[r,s]of i.propertyParams){const c=i.classMetadata.properties.get(r);if(void 0===c)throw new C(A.resolution,`Expecting metadata at property "${r.toString()}", none found`);c.kind!==$.unmanaged&&void 0!==s.bindings&&(n[r]=e(t,s),a(n[r])&&o.push((async()=>{n[r]=await n[r]})()))}if(o.length>0)return Promise.all(o).then(()=>{})}}(nt),He=function(e){return function t(n,i){const o=[];for(const r of i.redirections)fe(r)?o.push(...t(n,r)):o.push(e(n,r));return o}}(tt),Je=function(e,t,n){return(i,o)=>{const r=e(i,o);return a(r)?t(r,i,o):n(r,i,o)}}(function(e){return(t,n)=>{const i=[];for(const o of n.constructorParams)void 0===o?i.push(void 0):i.push(e(t,o));return i.some(a)?Promise.all(i):i}}(nt),function(e){return async(t,n,i)=>{const o=await t;return e(o,n,i)}}(ze(Xe)),ze(Xe)),Qe=function(e){return(t,n)=>{const i=e(t,n);return a(i)?i.then(e=>n.binding.factory(...e)):n.binding.factory(...i)}}(function(e){return(t,n)=>{const i=[];for(const o of n.params)i.push(e(t,o));return i.some(a)?Promise.all(i):i}}(nt)),Ye=(e=>Ue(Le,e))(Je),Ze=(e=>Ue(We,e))(Qe);function et(e){return nt(e,e.planResult.tree.root)}function tt(e,t){switch(t.binding.type){case u.ConstantValue:return Ee(e,t.binding);case u.DynamicValue:return Ke(e,t.binding);case u.Factory:return _e(e,t.binding);case u.Instance:return Ye(e,t);case u.Provider:return Ge(e,t.binding);case u.ResolvedValue:return Ze(e,t)}}function nt(e,t){if(void 0!==t.bindings)return Array.isArray(t.bindings)?function(e,t){const n=[];for(const i of t)fe(i)?n.push(...He(e,i)):n.push(tt(e,i));if(n.some(a))return Promise.all(n);return n}(e,t.bindings):function(e,t){if(fe(t)){const n=He(e,t);if(1===n.length)return n[0];throw new C(A.resolution,"Unexpected multiple resolved values on single injection")}return tt(e,t)}(e,t.bindings)}function it(e){return void 0!==e.scope}function ot(e,t){if(void 0!==e.lifecycle.preDestroyMethodName&&"function"==typeof t[e.lifecycle.preDestroyMethodName])return t[e.lifecycle.preDestroyMethodName]()}function rt(e,t,n){const i=e.getDeactivations(t);if(void 0!==i)return a(n)?at(n,i[Symbol.iterator]()):function(e,t){let n=t.next();for(;!0!==n.done;){const i=n.value(e);if(a(i))return at(e,t);n=t.next()}}(n,i[Symbol.iterator]())}async function at(e,t){const n=await e;let i=t.next();for(;!0!==i.done;)await i.value(n),i=t.next()}function st(e,t){const n=function(e,t){if(t.type===u.Instance){const n=e.getClassMetadata(t.implementationType),i=t.cache.value;return a(i)?i.then(e=>ot(n,e)):ot(n,i)}}(e,t);return void 0===n?ct(e,t):n.then(()=>ct(e,t))}function ct(e,t){const n=t.cache;return a(n.value)?n.value.then(n=>dt(e,t,n)):dt(e,t,n.value)}function dt(e,t,n){let i;if(void 0!==t.onDeactivation){i=(0,t.onDeactivation)(n)}return void 0===i?rt(e,t.serviceIdentifier,n):i.then(()=>rt(e,t.serviceIdentifier,n))}function ut(e,t){if(void 0===t)return;const n=function(e){const t=[];for(const n of e)it(n)&&n.scope===d.Singleton&&n.cache.isRight&&t.push(n);return t}(t),i=[];for(const t of n){const n=st(e,t);void 0!==n&&i.push(n)}return i.length>0?Promise.all(i).then(()=>{}):void 0}function lt(e,t){const n=e.getBindingsFromModule(t);return ut(e,n)}function pt(e,t){const n=e.getBindings(t);return ut(e,n)}export{m as ActivationsService,I as BindingService,$ as ClassElementMetadataKind,w as DeactivationsService,xe as PlanResultCacheService,de as ResolvedValueElementMetadataKind,d as bindingScopeValues,u as bindingTypeValues,b as decorate,c as getBindingId,x as getClassMetadata,_ as inject,J as injectFromBase,L as injectable,Q as multiInject,ee as named,ne as optional,we as plan,ie as postConstruct,oe as preDestroy,et as resolve,ut as resolveBindingsDeactivations,lt as resolveModuleDeactivations,pt as resolveServiceDeactivations,re as tagged,ce as unmanaged};
1
+ import{getOwnReflectMetadata as e,setReflectMetadata as t,updateOwnReflectMetadata as n}from"@inversifyjs/reflect-metadata-utils";import{getBaseType as i}from"@inversifyjs/prototype-utils";import{stringifyServiceIdentifier as o,LazyServiceIdentifier as r,isPromise as s}from"@inversifyjs/common";const a="@inversifyjs/container/bindingId";function c(){const i=e(Object,a)??0;return i===Number.MAX_SAFE_INTEGER?t(Object,a,Number.MIN_SAFE_INTEGER):n(Object,a,()=>i,e=>e+1),i}const d={Request:"Request",Singleton:"Singleton",Transient:"Transient"},u={ConstantValue:"ConstantValue",DynamicValue:"DynamicValue",Factory:"Factory",Instance:"Instance",Provider:"Provider",ResolvedValue:"ResolvedValue",ServiceRedirection:"ServiceRedirection"};function*l(...e){for(const t of e)yield*t}class p{#e;#t;#n;constructor(e){this.#e=new Map,this.#t={};for(const t of Reflect.ownKeys(e))this.#t[t]=new Map;this.#n=e}add(e,t){this.#i(e).push(t);for(const n of Reflect.ownKeys(t))this.#o(n,t[n]).push(e)}clone(){const e=this.#r(),t=this.#s(),n=Reflect.ownKeys(this.#n),i=this._buildNewInstance(this.#n);this.#a(this.#e,i.#e,e,t);for(const t of n)this.#c(this.#t[t],i.#t[t],e);return i}get(e,t){return this.#t[e].get(t)}getAllKeys(e){return this.#t[e].keys()}removeByRelation(e,t){const n=this.get(e,t);if(void 0===n)return;const i=new Set(n);for(const n of i){const i=this.#e.get(n);if(void 0===i)throw new Error("Expecting model relation, none found");for(const o of i)o[e]===t&&this.#d(n,o);this.#e.delete(n)}}_buildNewInstance(e){return new p(e)}_cloneModel(e){return e}_cloneRelation(e){return e}#r(){const e=new Map;for(const t of this.#e.keys()){const n=this._cloneModel(t);e.set(t,n)}return e}#s(){const e=new Map;for(const t of this.#e.values())for(const n of t){const t=this._cloneRelation(n);e.set(n,t)}return e}#i(e){let t=this.#e.get(e);return void 0===t&&(t=[],this.#e.set(e,t)),t}#o(e,t){let n=this.#t[e].get(t);return void 0===n&&(n=[],this.#t[e].set(t,n)),n}#u(e,t){const n=t.get(e);if(void 0===n)throw new Error("Expecting model to be cloned, none found");return n}#l(e,t){const n=t.get(e);if(void 0===n)throw new Error("Expecting relation to be cloned, none found");return n}#c(e,t,n){for(const[i,o]of e){const e=new Array;for(const t of o)e.push(this.#u(t,n));t.set(i,e)}}#a(e,t,n,i){for(const[o,r]of e){const e=new Array;for(const t of r)e.push(this.#l(t,i));t.set(this.#u(o,n),e)}}#d(e,t){for(const n of Reflect.ownKeys(t))this.#p(e,n,t[n])}#p(e,t,n){const i=this.#t[t].get(n);if(void 0!==i){const o=i.indexOf(e);-1!==o&&i.splice(o,1),0===i.length&&this.#t[t].delete(n)}}}var f,v,h;!function(e){e.moduleId="moduleId",e.serviceId="serviceId"}(f||(f={}));class g{#f;#v;constructor(e,t){this.#f=t??new p({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#v=e}static build(e){return new g(e)}add(e,t){this.#f.add(e,t)}clone(){return new g(this.#v,this.#f.clone())}get(e){const t=[],n=this.#f.get(f.serviceId,e);void 0!==n&&t.push(n);const i=this.#v()?.get(e);if(void 0!==i&&t.push(i),0!==t.length)return l(...t)}removeAllByModuleId(e){this.#f.removeByRelation(f.moduleId,e)}removeAllByServiceId(e){this.#f.removeByRelation(f.serviceId,e)}}function m(e){return e.isRight?{isRight:!0,value:e.value}:e}function y(e){switch(e.type){case u.ConstantValue:case u.DynamicValue:return function(e){return{cache:m(e.cache),id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type,value:e.value}}(e);case u.Factory:return function(e){return{cache:m(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case u.Instance:return function(e){return{cache:m(e.cache),id:e.id,implementationType:e.implementationType,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case u.Provider:return function(e){return{cache:m(e.cache),id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,provider:e.provider,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case u.ResolvedValue:return function(e){return{cache:m(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,metadata:e.metadata,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case u.ServiceRedirection:return function(e){return{id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,serviceIdentifier:e.serviceIdentifier,targetServiceIdentifier:e.targetServiceIdentifier,type:e.type}}(e)}}!function(e){e.id="id",e.moduleId="moduleId",e.serviceId="serviceId"}(v||(v={}));class M extends p{_buildNewInstance(e){return new M(e)}_cloneModel(e){return y(e)}}class I{#h;#v;constructor(e,t){this.#h=t??new M({id:{isOptional:!1},moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#v=e}static build(e){return new I(e)}clone(){return new I(this.#v,this.#h.clone())}get(e){return this.getNonParentBindings(e)??this.#v()?.get(e)}*getChained(e){const t=this.getNonParentBindings(e);void 0!==t&&(yield*t);const n=this.#v();void 0!==n&&(yield*n.getChained(e))}getBoundServices(){const e=new Set(this.#h.getAllKeys(v.serviceId)),t=this.#v();if(void 0!==t)for(const n of t.getBoundServices())e.add(n);return e}getById(e){return this.#h.get(v.id,e)??this.#v()?.getById(e)}getByModuleId(e){return this.#h.get(v.moduleId,e)??this.#v()?.getByModuleId(e)}getNonParentBindings(e){return this.#h.get(v.serviceId,e)}getNonParentBoundServices(){return this.#h.getAllKeys(v.serviceId)}removeById(e){this.#h.removeByRelation(v.id,e)}removeAllByModuleId(e){this.#h.removeByRelation(v.moduleId,e)}removeAllByServiceId(e){this.#h.removeByRelation(v.serviceId,e)}set(e){const t={[v.id]:e.id,[v.serviceId]:e.serviceIdentifier};void 0!==e.moduleId&&(t[v.moduleId]=e.moduleId),this.#h.add(e,t)}}!function(e){e.moduleId="moduleId",e.serviceId="serviceId"}(h||(h={}));class w{#g;#v;constructor(e,t){this.#g=t??new p({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#v=e}static build(e){return new w(e)}add(e,t){this.#g.add(e,t)}clone(){return new w(this.#v,this.#g.clone())}get(e){const t=[],n=this.#g.get(h.serviceId,e);void 0!==n&&t.push(n);const i=this.#v()?.get(e);if(void 0!==i&&t.push(i),0!==t.length)return l(...t)}removeAllByModuleId(e){this.#g.removeByRelation(h.moduleId,e)}removeAllByServiceId(e){this.#g.removeByRelation(h.serviceId,e)}}function b(e,t,n){const i=Array.isArray(e)?e:[e];if(void 0!==n)if("number"!=typeof n)Reflect.decorate(i,t.prototype,n);else for(const e of i)e(t,void 0,n);else Reflect.decorate(i,t)}const S="@inversifyjs/core/classMetadataReflectKey";function C(){return{constructorArguments:[],lifecycle:{postConstructMethodName:void 0,preDestroyMethodName:void 0},properties:new Map,scope:void 0}}const N="@inversifyjs/core/pendingClassMetadataCountReflectKey";const T=Symbol.for("@inversifyjs/core/InversifyCoreError");class j extends Error{[T];kind;constructor(e,t,n){super(t,n),this[T]=!0,this.kind=e}static is(e){return"object"==typeof e&&null!==e&&!0===e[T]}static isErrorOfKind(e,t){return j.is(e)&&e.kind===t}}var P,A,R;function x(t){const n=e(t,S)??C();if(!function(t){const n=e(t,N);return void 0!==n&&0!==n}(t))return function(e,t){const n=[];if(t.length<e.length)throw new j(P.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}". "${e.name}" constructor requires at least ${e.length.toString()} arguments, found ${t.length.toString()} instead.\nAre you using @inject, @multiInject or @unmanaged decorators in every non optional constructor argument?\n\nIf you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`);for(let e=0;e<t.length;++e)void 0===t[e]&&n.push(e);if(n.length>0)throw new j(P.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}" at constructor indexes "${n.join('", "')}".\n\nAre you using @inject, @multiInject or @unmanaged decorators at those indexes?\n\nIf you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`)}(t,n.constructorArguments),n;!function(e,t){const n=[];for(let i=0;i<t.constructorArguments.length;++i){const o=t.constructorArguments[i];void 0!==o&&o.kind!==A.unknown||n.push(` - Missing or incomplete metadata for type "${e.name}" at constructor argument with index ${i.toString()}.\nEvery constructor parameter must be decorated either with @inject, @multiInject or @unmanaged decorator.`)}for(const[i,o]of t.properties)o.kind===A.unknown&&n.push(` - Missing or incomplete metadata for type "${e.name}" at property "${i.toString()}".\nThis property must be decorated either with @inject or @multiInject decorator.`);if(0===n.length)throw new j(P.unknown,`Unexpected class metadata for type "${e.name}" with uncompletion traces.\nThis might be caused by one of the following reasons:\n\n1. A third party library is targeting inversify reflection metadata.\n2. A bug is causing the issue. Consider submiting an issue to fix it.`);throw new j(P.missingInjectionDecorator,`Invalid class metadata at type ${e.name}:\n\n${n.join("\n\n")}`)}(t,n)}function B(){return 0}function $(e){return t=>{void 0!==t&&t.kind===A.unknown&&n(e,N,B,e=>e-1)}}function D(e,t){return(...n)=>i=>{if(void 0===i)return e(...n);if(i.kind===R.unmanaged)throw new j(P.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found");return t(i,...n)}}function k(e){if(e.kind!==A.unknown&&!0!==e.isFromTypescriptParamType)throw new j(P.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found")}!function(e){e[e.injectionDecoratorConflict=0]="injectionDecoratorConflict",e[e.missingInjectionDecorator=1]="missingInjectionDecorator",e[e.planning=2]="planning",e[e.resolution=3]="resolution",e[e.unknown=4]="unknown"}(P||(P={})),function(e){e[e.unknown=32]="unknown"}(A||(A={})),function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection",e[e.unmanaged=2]="unmanaged"}(R||(R={}));const F=D(function(e,t,n){return e===R.multipleInjection?{chained:n?.chained??!1,kind:e,name:void 0,optional:!1,tags:new Map,value:t}:{kind:e,name:void 0,optional:!1,tags:new Map,value:t}},function(e,t,n,i){return k(e),t===R.multipleInjection?{...e,chained:i?.chained??!1,kind:t,value:n}:{...e,kind:t,value:n}});function V(e,t){return n=>{const i=n.properties.get(t);return n.properties.set(t,e(i)),n}}var O;function E(e,t,n,i){if(j.isErrorOfKind(i,P.injectionDecoratorConflict)){const o=function(e,t,n){if(void 0===n){if(void 0===t)throw new j(P.unknown,"Unexpected undefined property and index values");return{kind:O.property,property:t,targetClass:e.constructor}}return"number"==typeof n?{index:n,kind:O.parameter,targetClass:e}:{kind:O.method,method:t,targetClass:e}}(e,t,n);throw new j(P.injectionDecoratorConflict,`Unexpected injection error.\n\nCause:\n\n${i.message}\n\nDetails\n\n${function(e){switch(e.kind){case O.method:return`[class: "${e.targetClass.name}", method: "${e.method.toString()}"]`;case O.parameter:return`[class: "${e.targetClass.name}", index: "${e.index.toString()}"]`;case O.property:return`[class: "${e.targetClass.name}", property: "${e.property.toString()}"]`}}(o)}`,{cause:i})}throw i}function _(e,t){return(i,o,r)=>{try{void 0===r?function(e,t){const i=U(e,t);return(e,t)=>{n(e.constructor,S,C,V(i(e),t))}}(e,t)(i,o):"number"==typeof r?function(e,t){const i=U(e,t);return(e,t,o)=>{if(!function(e,t){return"function"==typeof e&&void 0===t}(e,t))throw new j(P.injectionDecoratorConflict,`Found an @inject decorator in a non constructor parameter.\nFound @inject decorator at method "${t?.toString()??""}" at class "${e.constructor.name}"`);n(e,S,C,function(e,t){return n=>{const i=n.constructorArguments[t];return n.constructorArguments[t]=e(i),n}}(i(e),o))}}(e,t)(i,o,r):function(e,t){const i=U(e,t);return(e,t,o)=>{if(!function(e){return void 0!==e.set}(o))throw new j(P.injectionDecoratorConflict,`Found an @inject decorator in a non setter property method.\nFound @inject decorator at method "${t.toString()}" at class "${e.constructor.name}"`);n(e.constructor,S,C,V(i(e),t))}}(e,t)(i,o,r)}catch(e){E(i,o,r,e)}}}function U(e,t){return n=>{const i=t(n);return t=>(i(t),e(t))}}function z(e){return _(F(R.singleInjection,e),$)}!function(e){e[e.method=0]="method",e[e.parameter=1]="parameter",e[e.property=2]="property"}(O||(O={}));const K="@inversifyjs/core/classIsInjectableFlagReflectKey";const L=[Array,BigInt,Boolean,Function,Number,Object,String];function q(t){const i=e(t,"design:paramtypes");void 0!==i&&n(t,S,C,function(e){return t=>(e.forEach((e,n)=>{var i;void 0!==t.constructorArguments[n]||(i=e,L.includes(i))||(t.constructorArguments[n]=function(e){return{isFromTypescriptParamType:!0,kind:R.singleInjection,name:void 0,optional:!1,tags:new Map,value:e}}(e))}),t)}(i))}function G(i){return o=>{!function(n){if(void 0!==e(n,K))throw new j(P.injectionDecoratorConflict,`Cannot apply @injectable decorator multiple times at class "${n.name}"`);t(n,K,!0)}(o),q(o),void 0!==i&&n(o,S,C,e=>({...e,scope:i}))}}function W(e,t,n){let i;return e.extendConstructorArguments??!0?(i=[...t.constructorArguments],n.constructorArguments.map((e,t)=>{i[t]=e})):i=n.constructorArguments,i}function X(e,t,n){let i;return i=e.extendProperties??!0?new Map(l(t.properties,n.properties)):n.properties,i}function H(e){return t=>{const i=x(e.type);n(t,S,C,function(e,t){const n=n=>({constructorArguments:W(e,t,n),lifecycle:n.lifecycle,properties:X(e,t,n),scope:n.scope});return n}(e,i))}}function J(e){return t=>{const n=i(t);if(void 0===n)throw new j(P.injectionDecoratorConflict,`Expected base type for type "${t.name}", none found.`);H({...e,type:n})(t)}}function Q(e,t){return _(F(R.multipleInjection,e,t),$)}function Y(e){return t=>{void 0===t&&n(e,N,B,e=>e+1)}}function Z(e){return t=>{const n=t??{kind:A.unknown,name:void 0,optional:!1,tags:new Map};if(n.kind===R.unmanaged)throw new j(P.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return e(n)}}function ee(e){const t=Z(function(e){return t=>{if(void 0!==t.name)throw new j(P.injectionDecoratorConflict,"Unexpected duplicated named decorator");return t.name=e,t}}(e));return _(t,Y)}function te(e){if(e.optional)throw new j(P.injectionDecoratorConflict,"Unexpected duplicated optional decorator");return e.optional=!0,e}function ne(){return _(Z(te),Y)}function ie(){return(e,t,i)=>{try{n(e.constructor,S,C,(o=t,e=>{if(void 0!==e.lifecycle.postConstructMethodName)throw new j(P.injectionDecoratorConflict,"Unexpected duplicated postConstruct decorator");return e.lifecycle.postConstructMethodName=o,e}))}catch(n){E(e,t,void 0,n)}var o}}function oe(){return(e,t,i)=>{try{n(e.constructor,S,C,(o=t,e=>{if(void 0!==e.lifecycle.preDestroyMethodName)throw new j(P.injectionDecoratorConflict,"Unexpected duplicated preDestroy decorator");return e.lifecycle.preDestroyMethodName=o,e}))}catch(n){E(e,t,void 0,n)}var o}}function re(e,t){const n=Z(function(e,t){return n=>{if(n.tags.has(e))throw new j(P.injectionDecoratorConflict,"Unexpected duplicated tag decorator with existing tag");return n.tags.set(e,t),n}}(e,t));return _(n,Y)}function se(){return{kind:R.unmanaged}}const ae=D(se,function(e){if(k(e),function(e){return void 0!==e.name||e.optional||e.tags.size>0}(e))throw new j(P.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return se()});function ce(){return _(ae(),$)}var de;!function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection"}(de||(de={}));class ue{#m;constructor(e){this.#m=e}get name(){return this.#m.elem.name}get serviceIdentifier(){return this.#m.elem.serviceIdentifier}get tags(){return this.#m.elem.tags}getAncestor(){if(this.#m.elem.getAncestorsCalled=!0,void 0!==this.#m.previous)return new ue(this.#m.previous)}}function le(e,t,n){const i=n?.customServiceIdentifier??t.serviceIdentifier,o=(!0===n?.chained?[...e.operations.getBindingsChained(i)]:[...e.operations.getBindings(i)??[]]).filter(e=>e.isSatisfiedBy(t));if(0===o.length&&void 0!==e.autobindOptions&&"function"==typeof i){const t=function(e,t){const n=x(t),i=n.scope??e.scope;return{cache:{isRight:!1,value:void 0},id:c(),implementationType:t,isSatisfiedBy:()=>!0,moduleId:void 0,onActivation:void 0,onDeactivation:void 0,scope:i,serviceIdentifier:t,type:u.Instance}}(e.autobindOptions,i);e.operations.setBinding(t),o.push(t)}return o}class pe{last;constructor(e){this.last=e}concat(e){return new pe({elem:e,previous:this.last})}[Symbol.iterator](){let e=this.last;return{next:()=>{if(void 0===e)return{done:!0,value:void 0};const t=e.elem;return e=e.previous,{done:!1,value:t}}}}}function fe(e){return void 0!==e.redirections}function ve(e,t,n,i){const r=n.elem.serviceIdentifier,s=n.previous?.elem.serviceIdentifier;Array.isArray(e)?function(e,t,n,i,r,s){if(0!==e.length){const t=s[s.length-1]??n,a=`Ambiguous bindings found for service: "${o(t)}".${ye(s)}\n\nRegistered bindings:\n\n${e.map(e=>function(e){switch(e.type){case u.Instance:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", scope: "${e.scope}", implementationType: "${e.implementationType.name}" ]`;case u.ServiceRedirection:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", redirection: "${o(e.targetServiceIdentifier)}" ]`;default:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", scope: "${e.scope}" ]`}}(e.binding)).join("\n")}\n\nTrying to resolve bindings for "${ge(n,i)}".${me(r)}`;throw new j(P.planning,a)}t||he(n,i,r,s)}(e,t,r,s,n.elem,i):function(e,t,n,i,o,r){void 0!==e||t||he(n,i,o,r)}(e,t,r,s,n.elem,i)}function he(e,t,n,i){const r=i[i.length-1]??e,s=`No bindings found for service: "${o(r)}".\n\nTrying to resolve bindings for "${ge(e,t)}".${ye(i)}${me(n)}`;throw new j(P.planning,s)}function ge(e,t){return void 0===t?`${o(e)} (Root service)`:o(t)}function me(e){const t=0===e.tags.size?"":`\n- tags:\n - ${[...e.tags.keys()].map(e=>e.toString()).join("\n - ")}`;return`\n\nBinding constraints:\n- service identifier: ${o(e.serviceIdentifier)}\n- name: ${e.name?.toString()??"-"}${t}`}function ye(e){return 0===e.length?"":`\n\n- service redirections:\n - ${e.map(e=>o(e)).join("\n - ")}`}function Me(e,t,n,i){if(1===e.redirections.length){const[o]=e.redirections;return void(fe(o)&&Me(o,t,n,[...i,o.binding.targetServiceIdentifier]))}ve(e.redirections,t,n,i)}function Ie(e,t,n){if(Array.isArray(e.bindings)&&1===e.bindings.length){const[i]=e.bindings;return void(fe(i)&&Me(i,t,n,[i.binding.targetServiceIdentifier]))}ve(e.bindings,t,n,[])}function we(e){return r.is(e)?e.unwrap():e}function be(e,t){if(function(e){return e instanceof Error&&(e instanceof RangeError&&/stack space|call stack|too much recursion/i.test(e.message)||"InternalError"===e.name&&/too much recursion/.test(e.message))}(t)){const n=function(e){const t=[...e];if(0===t.length)return"(No dependency trace)";return t.map(o).join(" -> ")}(function(e){const t=new Set;for(const n of e.servicesBranch){if(t.has(n))return[...t,n];t.add(n)}return[...t]}(e));throw new j(P.planning,`Circular dependency found: ${n}`,{cause:t})}throw t}const Se=Symbol.for("@inversifyjs/core/LazyPlanServiceNode");class Ce{[Se];_serviceIdentifier;_serviceNode;constructor(e){this[Se]=!0,this._serviceIdentifier=e.serviceIdentifier,this._serviceNode=e}get bindings(){return this._getNode().bindings}get isContextFree(){return this._getNode().isContextFree}get serviceIdentifier(){return this._serviceIdentifier}set bindings(e){this._getNode().bindings=e}set isContextFree(e){this._getNode().isContextFree=e}static is(e){return"object"==typeof e&&null!==e&&!0===e[Se]}invalidate(){this._serviceNode=void 0}_getNode(){return void 0===this._serviceNode&&(this._serviceNode=this._buildPlanServiceNode()),this._serviceNode}}function Ne(e,t,n){if(void 0!==e&&n.isContextFree){const i={tree:{root:n}};t.setPlan(e,i)}else t.setNonCachedServiceNode(n)}class Te extends Ce{#y;constructor(e,t){super(t),this.#y=e}_buildPlanServiceNode(){return Ae(this.#y)}}class je extends Ce{#y;#M;#I;constructor(e,t,n,i){super(i),this.#y=e,this.#M=t,this.#I=n}_buildPlanServiceNode(){return Be(this.#y,this.#M,this.#I)}}class Pe extends Ce{#y;#M;#w;constructor(e,t,n,i){super(i),this.#y=e,this.#M=t,this.#w=n}_buildPlanServiceNode(){return $e(this.#y,this.#M,this.#w)}}function Ae(e){const t=function(e){const t=new Map;return void 0!==e.rootConstraints.tag&&t.set(e.rootConstraints.tag.key,e.rootConstraints.tag.value),new pe({elem:{getAncestorsCalled:!1,name:e.rootConstraints.name,serviceIdentifier:e.rootConstraints.serviceIdentifier,tags:t},previous:void 0})}(e),n=new ue(t.last),i=!!e.rootConstraints.isMultiple&&e.rootConstraints.chained,o=le(e,n,{chained:i}),r=[],s={bindings:r,isContextFree:!0,serviceIdentifier:e.rootConstraints.serviceIdentifier};if(r.push(...ke(e,t,o,s,i)),s.isContextFree=!t.last.elem.getAncestorsCalled,!e.rootConstraints.isMultiple){Ie(s,e.rootConstraints.isOptional??!1,t.last);const[n]=r;s.bindings=n}return s}function Re(e){try{const t=function(e){return e.rootConstraints.isMultiple?{chained:e.rootConstraints.chained,isMultiple:!0,name:e.rootConstraints.name,optional:e.rootConstraints.isOptional??!1,serviceIdentifier:e.rootConstraints.serviceIdentifier,tag:e.rootConstraints.tag}:{isMultiple:!1,name:e.rootConstraints.name,optional:e.rootConstraints.isOptional??!1,serviceIdentifier:e.rootConstraints.serviceIdentifier,tag:e.rootConstraints.tag}}(e),n=e.operations.getPlan(t);if(void 0!==n)return n;const i=Ae(e),o={tree:{root:new Te(e,i)}};return e.operations.setPlan(t,o),o}catch(t){be(e,t)}}function xe(e,t,n){const i={binding:t,classMetadata:e.operations.getClassMetadata(t.implementationType),constructorParams:[],propertyParams:new Map};return Ee({autobindOptions:e.autobindOptions,node:i,operations:e.operations,servicesBranch:e.servicesBranch},n)}function Be(e,t,n){const i=we(n.value),o=t.concat({getAncestorsCalled:!1,name:n.name,serviceIdentifier:i,tags:n.tags}),r=new ue(o.last),s=n.kind===R.multipleInjection&&n.chained,a=le(e,r,{chained:s}),c=[],d={bindings:c,isContextFree:!0,serviceIdentifier:i};if(c.push(...ke(e,o,a,d,s)),d.isContextFree=!o.last.elem.getAncestorsCalled,n.kind===R.singleInjection){Ie(d,n.optional,o.last);const[e]=c;d.bindings=e}return d}function $e(e,t,n){const i=we(n.value),o=t.concat({getAncestorsCalled:!1,name:n.name,serviceIdentifier:i,tags:n.tags}),r=new ue(o.last),s=n.kind===de.multipleInjection&&n.chained,a=le(e,r,{chained:s}),c=[],d={bindings:c,isContextFree:!0,serviceIdentifier:i};if(c.push(...ke(e,o,a,d,s)),d.isContextFree=!o.last.elem.getAncestorsCalled,n.kind===de.singleInjection){Ie(d,n.optional,o.last);const[e]=c;d.bindings=e}return d}function De(e,t,n){const i={binding:t,params:[]};return Ee({autobindOptions:e.autobindOptions,node:i,operations:e.operations,servicesBranch:e.servicesBranch},n)}function ke(e,t,n,i,o){const r=fe(i)?i.binding.targetServiceIdentifier:i.serviceIdentifier;e.servicesBranch.push(r);const s=[];for(const i of n)switch(i.type){case u.Instance:s.push(xe(e,i,t));break;case u.ResolvedValue:s.push(De(e,i,t));break;case u.ServiceRedirection:{const n=Fe(e,t,i,o);s.push(n);break}default:s.push({binding:i})}return e.servicesBranch.pop(),s}function Fe(e,t,n,i){const o={binding:n,redirections:[]},r=le(e,new ue(t.last),{chained:i,customServiceIdentifier:n.targetServiceIdentifier});return o.redirections.push(...ke(e,t,r,o,i)),o}function Ve(e,t,n){if(n.kind===R.unmanaged)return;const i=function(e){let t;if(0===e.tags.size)t=void 0;else{if(1!==e.tags.size)return;{const[n,i]=e.tags.entries().next().value;t={key:n,value:i}}}const n=r.is(e.value)?e.value.unwrap():e.value;return e.kind===R.multipleInjection?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}}(n);if(void 0!==i){const t=e.operations.getPlan(i);if(void 0!==t&&t.tree.root.isContextFree)return t.tree.root}const o=Be(e,t,n),s=new je(e,t,n,o);return Ne(i,e.operations,s),s}function Oe(e,t,n){const i=function(e){let t;if(0===e.tags.size)t=void 0;else{if(1!==e.tags.size)return;{const[n,i]=e.tags.entries().next().value;t={key:n,value:i}}}const n=r.is(e.value)?e.value.unwrap():e.value;return e.kind===de.multipleInjection?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}}(n);if(void 0!==i){const t=e.operations.getPlan(i);if(void 0!==t&&t.tree.root.isContextFree)return t.tree.root}const o=$e(e,t,n),s=new Pe(e,t,n,o);return Ne(i,e.operations,s),s}function Ee(e,t){return e.node.binding.type===u.Instance?function(e,t,n){const i=t.classMetadata;for(const[o,r]of i.constructorArguments.entries())t.constructorParams[o]=Ve(e,n,r);for(const[o,r]of i.properties){const i=Ve(e,n,r);void 0!==i&&t.propertyParams.set(o,i)}return e.node}(e,e.node,t):function(e,t,n){const i=t.binding.metadata;for(const[o,r]of i.arguments.entries())t.params[o]=Oe(e,n,r);return e.node}(e,e.node,t)}class _e{#b;#S;#C;constructor(){this.#b=[],this.#S=8,this.#C=1024}*[Symbol.iterator](){let e=0;for(const t of this.#b){const n=t.deref();void 0===n?++e:yield n}this.#b.length>=this.#S&&this.#N(e)&&this.#T(e)}push(e){const t=new WeakRef(e);if(this.#b.push(t),this.#b.length>=this.#S&&this.#b.length%this.#C===0){let e=0;for(const t of this.#b)void 0===t.deref()&&++e;this.#N(e)&&this.#T(e)}}#T(e){const t=new Array(this.#b.length-e);let n=0;for(const e of this.#b)e.deref()&&(t[n++]=e);this.#b=t}#N(e){return e>=.5*this.#b.length}}class Ue{#j;#P;#A;#R;#x;#B;constructor(){this.#j=new Map,this.#P=this.#$(),this.#A=this.#$(),this.#R=this.#$(),this.#x=this.#$(),this.#B=new _e}clearCache(){for(const e of this.#D())e.clear();for(const e of this.#B)e.clearCache()}get(e){return void 0===e.name?void 0===e.tag?this.#k(this.#P,e).get(e.serviceIdentifier):this.#k(this.#x,e).get(e.serviceIdentifier)?.get(e.tag.key)?.get(e.tag.value):void 0===e.tag?this.#k(this.#A,e).get(e.serviceIdentifier)?.get(e.name):this.#k(this.#R,e).get(e.serviceIdentifier)?.get(e.name)?.get(e.tag.key)?.get(e.tag.value)}invalidateService(e){this.#F(e),this.#V(e),this.#O(e),this.#E(e),this.#_(e);for(const t of this.#B)t.invalidateService(e)}set(e,t){void 0===e.name?void 0===e.tag?this.#k(this.#P,e).set(e.serviceIdentifier,t):this.#U(this.#U(this.#k(this.#x,e),e.serviceIdentifier),e.tag.key).set(e.tag.value,t):void 0===e.tag?this.#U(this.#k(this.#A,e),e.serviceIdentifier).set(e.name,t):this.#U(this.#U(this.#U(this.#k(this.#R,e),e.serviceIdentifier),e.name),e.tag.key).set(e.tag.value,t)}setNonCachedServiceNode(e){let t=this.#j.get(e.serviceIdentifier);void 0===t&&(t=new Set,this.#j.set(e.serviceIdentifier,t)),t.add(e)}subscribe(e){this.#B.push(e)}#$(){const e=new Array(8);for(let t=0;t<e.length;++t)e[t]=new Map;return e}#U(e,t){let n=e.get(t);return void 0===n&&(n=new Map,e.set(t,n)),n}#k(e,t){return e[this.#z(t)]}#D(){return[this.#j,...this.#P,...this.#A,...this.#R,...this.#x]}#z(e){return e.isMultiple?(e.chained?4:0)|(e.optional?1:0)|2:e.optional?1:0}#V(e){for(const t of this.#A){const n=t.get(e);if(void 0!==n)for(const e of n.values())Ce.is(e.tree.root)&&(this.#K(e.tree.root),e.tree.root.invalidate())}}#O(e){for(const t of this.#R){const n=t.get(e);if(void 0!==n)for(const e of n.values())for(const t of e.values())for(const e of t.values())Ce.is(e.tree.root)&&(this.#K(e.tree.root),e.tree.root.invalidate())}}#L(e){switch(e.binding.type){case u.ServiceRedirection:for(const t of e.redirections)this.#L(t);break;case u.Instance:for(const t of e.constructorParams)void 0!==t&&this.#q(t);for(const t of e.propertyParams.values())this.#q(t);break;case u.ResolvedValue:for(const t of e.params)this.#q(t)}}#q(e){const t=this.#j.get(e.serviceIdentifier);void 0!==t&&t.has(e)&&(t.delete(e),this.#K(e))}#K(e){if(void 0!==e.bindings)if(Array.isArray(e.bindings))for(const t of e.bindings)this.#L(t);else this.#L(e.bindings)}#_(e){const t=this.#j.get(e);if(void 0!==t)for(const e of t)Ce.is(e)&&(this.#K(e),e.invalidate())}#F(e){for(const t of this.#P){const n=t.get(e);void 0!==n&&Ce.is(n.tree.root)&&(this.#K(n.tree.root),n.tree.root.invalidate())}}#E(e){for(const t of this.#x){const n=t.get(e);if(void 0!==n)for(const e of n.values())for(const t of e.values())Ce.is(t.tree.root)&&(this.#K(t.tree.root),t.tree.root.invalidate())}}}function ze(e,t){return s(t)?(e.cache={isRight:!0,value:t},t.then(t=>Ke(e,t))):Ke(e,t)}function Ke(e,t){return e.cache={isRight:!0,value:t},t}function Le(e,t,n){const i=e.getActivations(t);return void 0===i?n:s(n)?qe(e,n,i[Symbol.iterator]()):function(e,t,n){let i=t,o=n.next();for(;!0!==o.done;){const t=o.value(e.context,i);if(s(t))return qe(e,t,n);i=t,o=n.next()}return i}(e,n,i[Symbol.iterator]())}async function qe(e,t,n){let i=await t,o=n.next();for(;!0!==o.done;)i=await o.value(e.context,i),o=n.next();return i}function Ge(e,t,n){let i=n;if(void 0!==t.onActivation){const n=t.onActivation;i=s(i)?i.then(t=>n(e.context,t)):n(e.context,i)}return Le(e,t.serviceIdentifier,i)}function We(e){return(t,n)=>{if(n.cache.isRight)return n.cache.value;return ze(n,Ge(t,n,e(t,n)))}}const Xe=We(function(e,t){return t.value});function He(e){return e}function Je(e,t){return(n,i)=>{const o=e(i);switch(o.scope){case d.Singleton:if(o.cache.isRight)return o.cache.value;return ze(o,Ge(n,o,t(n,i)));case d.Request:{if(n.requestScopeCache.has(o.id))return n.requestScopeCache.get(o.id);const e=Ge(n,o,t(n,i));return n.requestScopeCache.set(o.id,e),e}case d.Transient:return Ge(n,o,t(n,i))}}}const Qe=(e=>Je(He,e))(function(e,t){return t.value(e.context)});const Ye=We(function(e,t){return t.factory(e.context)});function Ze(e,t,n){const i=function(e,t,n){if(void 0===n)return;if(!(n in e))throw new j(P.resolution,`Expecting a "${n.toString()}" property when resolving "${t.implementationType.name}" class @postConstruct decorated method, none found.`);if("function"!=typeof e[n])throw new j(P.resolution,`Expecting a "${n.toString()}" method when resolving "${t.implementationType.name}" class @postConstruct decorated method, a non function property was found instead.`);{let i;try{i=e[n]()}catch(e){throw new j(P.resolution,`Unexpected error found when calling "${n.toString()}" @postConstruct decorated method on class "${t.implementationType.name}"`,{cause:e})}if(s(i))return async function(e,t,n){try{await n}catch(n){throw new j(P.resolution,`Unexpected error found when calling "${t.toString()}" @postConstruct decorated method on class "${e.implementationType.name}"`,{cause:n})}}(t,n,i)}}(e,t,n);return s(i)?i.then(()=>e):e}function et(e){return(t,n,i)=>{const o=new i.binding.implementationType(...t),r=e(n,o,i);return s(r)?r.then(()=>Ze(o,i.binding,i.classMetadata.lifecycle.postConstructMethodName)):Ze(o,i.binding,i.classMetadata.lifecycle.postConstructMethodName)}}const tt=We(function(e,t){return t.provider(e.context)});function nt(e){return e.binding}function it(e){return e.binding}const ot=function(e){return(t,n,i)=>{const o=[];for(const[r,a]of i.propertyParams){const c=i.classMetadata.properties.get(r);if(void 0===c)throw new j(P.resolution,`Expecting metadata at property "${r.toString()}", none found`);c.kind!==R.unmanaged&&void 0!==a.bindings&&(n[r]=e(t,a),s(n[r])&&o.push((async()=>{n[r]=await n[r]})()))}if(o.length>0)return Promise.all(o).then(()=>{})}}(pt),rt=function(e){return function t(n,i){const o=[];for(const r of i.redirections)fe(r)?o.push(...t(n,r)):o.push(e(n,r));return o}}(lt),st=function(e,t,n){return(i,o)=>{const r=e(i,o);return s(r)?t(r,i,o):n(r,i,o)}}(function(e){return(t,n)=>{const i=[];for(const o of n.constructorParams)void 0===o?i.push(void 0):i.push(e(t,o));return i.some(s)?Promise.all(i):i}}(pt),function(e){return async(t,n,i)=>{const o=await t;return e(o,n,i)}}(et(ot)),et(ot)),at=function(e){return(t,n)=>{const i=e(t,n);return s(i)?i.then(e=>n.binding.factory(...e)):n.binding.factory(...i)}}(function(e){return(t,n)=>{const i=[];for(const o of n.params)i.push(e(t,o));return i.some(s)?Promise.all(i):i}}(pt)),ct=(e=>Je(nt,e))(st),dt=(e=>Je(it,e))(at);function ut(e){return pt(e,e.planResult.tree.root)}function lt(e,t){switch(t.binding.type){case u.ConstantValue:return Xe(e,t.binding);case u.DynamicValue:return Qe(e,t.binding);case u.Factory:return Ye(e,t.binding);case u.Instance:return ct(e,t);case u.Provider:return tt(e,t.binding);case u.ResolvedValue:return dt(e,t)}}function pt(e,t){if(void 0!==t.bindings)return Array.isArray(t.bindings)?function(e,t){const n=[];for(const i of t)fe(i)?n.push(...rt(e,i)):n.push(lt(e,i));if(n.some(s))return Promise.all(n);return n}(e,t.bindings):function(e,t){if(fe(t)){const n=rt(e,t);if(1===n.length)return n[0];throw new j(P.resolution,"Unexpected multiple resolved values on single injection")}return lt(e,t)}(e,t.bindings)}function ft(e){return void 0!==e.scope}function vt(e,t){if(void 0!==e.lifecycle.preDestroyMethodName&&"function"==typeof t[e.lifecycle.preDestroyMethodName])return t[e.lifecycle.preDestroyMethodName]()}function ht(e,t,n){const i=e.getDeactivations(t);if(void 0!==i)return s(n)?gt(n,i[Symbol.iterator]()):function(e,t){let n=t.next();for(;!0!==n.done;){const i=n.value(e);if(s(i))return gt(e,t);n=t.next()}}(n,i[Symbol.iterator]())}async function gt(e,t){const n=await e;let i=t.next();for(;!0!==i.done;)await i.value(n),i=t.next()}function mt(e,t){const n=function(e,t){if(t.type===u.Instance){const n=e.getClassMetadata(t.implementationType),i=t.cache.value;return s(i)?i.then(e=>vt(n,e)):vt(n,i)}}(e,t);return void 0===n?yt(e,t):n.then(()=>yt(e,t))}function yt(e,t){const n=t.cache;return s(n.value)?n.value.then(n=>Mt(e,t,n)):Mt(e,t,n.value)}function Mt(e,t,n){let i;if(void 0!==t.onDeactivation){i=(0,t.onDeactivation)(n)}return void 0===i?ht(e,t.serviceIdentifier,n):i.then(()=>ht(e,t.serviceIdentifier,n))}function It(e,t){if(void 0===t)return;const n=function(e){const t=[];for(const n of e)ft(n)&&n.scope===d.Singleton&&n.cache.isRight&&t.push(n);return t}(t),i=[];for(const t of n){const n=mt(e,t);void 0!==n&&i.push(n)}return i.length>0?Promise.all(i).then(()=>{}):void 0}function wt(e,t){const n=e.getBindingsFromModule(t);return It(e,n)}function bt(e,t){const n=e.getBindings(t);return It(e,n)}export{g as ActivationsService,I as BindingService,R as ClassElementMetadataKind,w as DeactivationsService,Ue as PlanResultCacheService,de as ResolvedValueElementMetadataKind,d as bindingScopeValues,u as bindingTypeValues,b as decorate,c as getBindingId,x as getClassMetadata,z as inject,J as injectFromBase,G as injectable,Q as multiInject,ee as named,ne as optional,Re as plan,ie as postConstruct,oe as preDestroy,ut as resolve,It as resolveBindingsDeactivations,wt as resolveModuleDeactivations,bt as resolveServiceDeactivations,re as tagged,ce as unmanaged};
2
2
  //# sourceMappingURL=index.js.map