@zlink-systems/nestjs 0.32.2 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -69,6 +69,9 @@ interface FrameworkIntegrationModule {
69
69
  registerActorFactory(options: {
70
70
  actorFactories?: Record<string, Type>;
71
71
  }, actorType: string, factoryType: Type): void;
72
+ registerLocationStore(options: {
73
+ storeInstance?: import('@zlink-systems/framework').ZLinkLocationStore;
74
+ }, store: import('@zlink-systems/framework').ZLinkLocationStore): void;
72
75
  registerRelocationStore(options: {
73
76
  relocationStoreInstance?: import('@zlink-systems/framework').ZLinkRelocationStore;
74
77
  }, store: import('@zlink-systems/framework').ZLinkRelocationStore): void;
@@ -85,13 +85,9 @@ class ZLinkNestOptionsBuilder {
85
85
  return framework_loader_1.framework.createIntegrationInboundDispatchOptionsBuilder(options);
86
86
  }
87
87
  addLocationStore(store) {
88
- this.state.additionalOptions = {
89
- ...this.state.additionalOptions,
90
- locations: {
91
- ...(this.state.additionalOptions.locations ?? {}),
92
- storeInstance: store
93
- }
94
- };
88
+ const locations = { ...(this.state.additionalOptions.locations ?? {}) };
89
+ framework_loader_1.framework.registerLocationStore(locations, store);
90
+ this.state.additionalOptions = { ...this.state.additionalOptions, locations };
95
91
  return this;
96
92
  }
97
93
  addRelocationStore(store) {
@@ -29,11 +29,16 @@ class SpotNodeHandlerRegistry {
29
29
  return this.nodes;
30
30
  }
31
31
  entrySpotTargets(entrySpotType, missingMessage) {
32
- return this.requireTargets((node) => node.entrySpotType === entrySpotType, missingMessage);
32
+ const exact = Object.values(this.nodes).filter((node) => node.entrySpotType === entrySpotType);
33
+ if (exact.length > 0)
34
+ return exact;
35
+ return this.requireTargets((node) => node.entrySpotType !== undefined && node.entrySpotType.prototype instanceof entrySpotType, missingMessage);
33
36
  }
34
37
  spotTargets(spotType, missingMessage) {
35
- return this.requireTargets((node) => (node.spotFactories ?? []).includes(spotType) ||
36
- Object.values(node.instanceSpotFactories ?? {}).includes(spotType), missingMessage);
38
+ const exact = Object.values(this.nodes).filter((node) => [...(node.spotFactories ?? []), ...Object.values(node.instanceSpotFactories ?? {})].includes(spotType));
39
+ if (exact.length > 0)
40
+ return exact;
41
+ return this.requireTargets((node) => [...(node.spotFactories ?? []), ...Object.values(node.instanceSpotFactories ?? {})].some((type) => type.prototype instanceof spotType), missingMessage);
37
42
  }
38
43
  addEntrySpotTimer(node, registration) {
39
44
  node.entrySpotTimerHandlers = [...(node.entrySpotTimerHandlers ?? []), registration];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zlink-systems/nestjs",
3
- "version": "0.32.2",
4
- "license": "SEE LICENSE IN LICENSE",
3
+ "version": "0.34.0",
4
+ "license": "Elastic-2.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/zlink-systems/zlink.git",
@@ -21,8 +21,8 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@nestjs/common": "^10.4.22",
24
- "@zlink-systems/framework": "0.32.2",
25
- "@zlink-systems/http-client": "0.32.2",
24
+ "@zlink-systems/framework": "0.34.0",
25
+ "@zlink-systems/http-client": "0.34.0",
26
26
  "reflect-metadata": "^0.2.2",
27
27
  "rxjs": "^7.8.2"
28
28
  },