@kapeta/local-cluster-service 0.55.1 → 0.55.2

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [0.55.2](https://github.com/kapetacom/local-cluster-service/compare/v0.55.1...v0.55.2) (2024-07-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * recurring create-block events will not overwrite types, apis or models ([f07b2da](https://github.com/kapetacom/local-cluster-service/commit/f07b2da0e0fc286e3eb06af2efcd1746808f2ba9))
7
+
1
8
  ## [0.55.1](https://github.com/kapetacom/local-cluster-service/compare/v0.55.0...v0.55.1) (2024-07-12)
2
9
 
3
10
 
@@ -170,11 +170,14 @@ class StormEventParser {
170
170
  this.planDescription = evt.payload.description;
171
171
  break;
172
172
  case 'CREATE_BLOCK':
173
+ const apis = this.blocks[evt.payload.name]?.apis;
174
+ const models = this.blocks[evt.payload.name]?.models;
175
+ const types = this.blocks[evt.payload.name]?.types;
173
176
  this.blocks[evt.payload.name] = {
174
177
  ...evt.payload,
175
- apis: [],
176
- models: [],
177
- types: [],
178
+ apis: apis ?? [],
179
+ models: models ?? [],
180
+ types: types ?? [],
178
181
  };
179
182
  evt.payload.blockRef = StormEventParser.toRef(handle, evt.payload.name).toNormalizedString();
180
183
  evt.payload.instanceId = StormEventParser.toInstanceIdFromRef(evt.payload.blockRef);
@@ -170,11 +170,14 @@ class StormEventParser {
170
170
  this.planDescription = evt.payload.description;
171
171
  break;
172
172
  case 'CREATE_BLOCK':
173
+ const apis = this.blocks[evt.payload.name]?.apis;
174
+ const models = this.blocks[evt.payload.name]?.models;
175
+ const types = this.blocks[evt.payload.name]?.types;
173
176
  this.blocks[evt.payload.name] = {
174
177
  ...evt.payload,
175
- apis: [],
176
- models: [],
177
- types: [],
178
+ apis: apis ?? [],
179
+ models: models ?? [],
180
+ types: types ?? [],
178
181
  };
179
182
  evt.payload.blockRef = StormEventParser.toRef(handle, evt.payload.name).toNormalizedString();
180
183
  evt.payload.instanceId = StormEventParser.toInstanceIdFromRef(evt.payload.blockRef);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kapeta/local-cluster-service",
3
- "version": "0.55.1",
3
+ "version": "0.55.2",
4
4
  "description": "Manages configuration, ports and service discovery for locally running Kapeta systems",
5
5
  "type": "commonjs",
6
6
  "exports": {
@@ -281,11 +281,15 @@ export class StormEventParser {
281
281
  this.planDescription = evt.payload.description;
282
282
  break;
283
283
  case 'CREATE_BLOCK':
284
+ const apis = this.blocks[evt.payload.name]?.apis;
285
+ const models = this.blocks[evt.payload.name]?.models;
286
+ const types = this.blocks[evt.payload.name]?.types;
287
+
284
288
  this.blocks[evt.payload.name] = {
285
289
  ...evt.payload,
286
- apis: [],
287
- models: [],
288
- types: [],
290
+ apis: apis ?? [],
291
+ models: models ??[],
292
+ types: types ?? [],
289
293
  };
290
294
  evt.payload.blockRef = StormEventParser.toRef(handle, evt.payload.name).toNormalizedString();
291
295
  evt.payload.instanceId = StormEventParser.toInstanceIdFromRef(evt.payload.blockRef);
@@ -685,18 +689,18 @@ export class StormEventParser {
685
689
  }
686
690
  }
687
691
 
688
- if (!exactMatch) {
689
- // if we couldn't place the given api on the exact resource we just park it on the first
690
- // available rest resource
691
- const firstKey = Object.keys(apiResources)[0];
692
- const firstEntry = apiResources[firstKey];
693
- if (firstEntry) {
694
- firstEntry.spec.source.value += api + '\n\n';
695
- } else {
696
- console.warn('Unable to find resource for API', api);
697
- }
692
+ if (!exactMatch) {
693
+ // if we couldn't place the given api on the exact resource we just park it on the first
694
+ // available rest resource
695
+ const firstKey = Object.keys(apiResources)[0];
696
+ const firstEntry = apiResources[firstKey];
697
+ if (firstEntry) {
698
+ firstEntry.spec.source.value += api + '\n\n';
699
+ } else {
700
+ console.warn('Unable to find resource for API', api);
698
701
  }
699
- });
702
+ }
703
+ });
700
704
 
701
705
  blockInfo.types.forEach((type) => {
702
706
  blockSpec.entities!.source!.value += type + '\n';