@kapeta/local-cluster-service 0.62.0 → 0.62.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.
- package/CHANGELOG.md +7 -0
- package/dist/cjs/src/storm/event-parser.js +11 -0
- package/dist/cjs/src/storm/events.d.ts +5 -1
- package/dist/cjs/src/storm/routes.js +1 -0
- package/dist/esm/src/storm/event-parser.js +11 -0
- package/dist/esm/src/storm/events.d.ts +5 -1
- package/dist/esm/src/storm/routes.js +1 -0
- package/package.json +1 -1
- package/src/storm/event-parser.ts +12 -0
- package/src/storm/events.ts +7 -1
- package/src/storm/routes.ts +1 -0
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [0.62.1](https://github.com/kapetacom/local-cluster-service/compare/v0.62.0...v0.62.1) (2024-08-14)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* add openapi spec streaming for a sense of progress ([95eff45](https://github.com/kapetacom/local-cluster-service/commit/95eff4504fd83a2440f4343f608383299fa50326))
|
7
|
+
|
1
8
|
# [0.62.0](https://github.com/kapetacom/local-cluster-service/compare/v0.61.2...v0.62.0) (2024-08-13)
|
2
9
|
|
3
10
|
|
@@ -236,6 +236,17 @@ class StormEventParser {
|
|
236
236
|
this.blocks[evt.payload.blockName].models = [];
|
237
237
|
}
|
238
238
|
break;
|
239
|
+
case 'API_STREAM_CHUNK':
|
240
|
+
case 'API_STREAM_CHUNK_RESET':
|
241
|
+
case 'API_STREAM_DONE':
|
242
|
+
case 'API_STREAM_FAILED':
|
243
|
+
case 'API_STREAM_STATE':
|
244
|
+
case 'API_STREAM_START':
|
245
|
+
if ('blockName' in evt.payload) {
|
246
|
+
evt.payload.blockRef = StormEventParser.toRef(handle, evt.payload.blockName).toNormalizedString();
|
247
|
+
evt.payload.instanceId = StormEventParser.toInstanceIdFromRef(evt.payload.blockRef);
|
248
|
+
}
|
249
|
+
break;
|
239
250
|
}
|
240
251
|
return await this.toResult(handle);
|
241
252
|
}
|
@@ -218,6 +218,10 @@ export interface StormEventFileChunk extends StormEventFileBase {
|
|
218
218
|
lineNumber: number;
|
219
219
|
};
|
220
220
|
}
|
221
|
+
export interface StormEventApiBase {
|
222
|
+
type: 'API_STREAM_CHUNK' | 'API_STREAM_DONE' | 'API_STREAM_FAILED' | 'API_STREAM_STATE' | 'API_STREAM_START' | 'API_STREAM_CHUNK_RESET';
|
223
|
+
payload: StormEventFileBasePayload;
|
224
|
+
}
|
221
225
|
export interface StormEventBlockReady {
|
222
226
|
type: 'BLOCK_READY';
|
223
227
|
reason: string;
|
@@ -371,5 +375,5 @@ export interface StormEventReferenceClassification {
|
|
371
375
|
created: number;
|
372
376
|
payload: ReferenceClassification;
|
373
377
|
}
|
374
|
-
export type StormEvent = StormEventCreateBlock | StormEventCreateConnection | StormEventCreatePlanProperties | StormEventInvalidResponse | StormEventPlanRetry | StormEventCreateDSL | StormEventCreateDSLResource | StormEventError | StormEventScreen | StormEventScreenCandidate | StormEventFileLogical | StormEventFileState | StormEventFileDone | StormEventFileFailed | StormEventFileChunk | StormEventDone | StormEventDefinitionChange | StormEventErrorClassifier | StormEventCodeFix | StormEventErrorDetails | StormEventBlockReady | StormEventPhases | StormEventBlockStatus | StormEventCreateDSLRetry | StormEventUserJourney | StormEventUIShell | StormEventPage | StormEventPageUrl | StormEventPromptImprove | StormEventLandingPage | StormEventReferenceClassification;
|
378
|
+
export type StormEvent = StormEventCreateBlock | StormEventCreateConnection | StormEventCreatePlanProperties | StormEventInvalidResponse | StormEventPlanRetry | StormEventCreateDSL | StormEventCreateDSLResource | StormEventError | StormEventScreen | StormEventScreenCandidate | StormEventFileLogical | StormEventFileState | StormEventFileDone | StormEventFileFailed | StormEventFileChunk | StormEventDone | StormEventDefinitionChange | StormEventErrorClassifier | StormEventCodeFix | StormEventErrorDetails | StormEventBlockReady | StormEventPhases | StormEventBlockStatus | StormEventCreateDSLRetry | StormEventUserJourney | StormEventUIShell | StormEventPage | StormEventPageUrl | StormEventPromptImprove | StormEventLandingPage | StormEventReferenceClassification | StormEventApiBase;
|
375
379
|
export {};
|
@@ -236,6 +236,17 @@ class StormEventParser {
|
|
236
236
|
this.blocks[evt.payload.blockName].models = [];
|
237
237
|
}
|
238
238
|
break;
|
239
|
+
case 'API_STREAM_CHUNK':
|
240
|
+
case 'API_STREAM_CHUNK_RESET':
|
241
|
+
case 'API_STREAM_DONE':
|
242
|
+
case 'API_STREAM_FAILED':
|
243
|
+
case 'API_STREAM_STATE':
|
244
|
+
case 'API_STREAM_START':
|
245
|
+
if ('blockName' in evt.payload) {
|
246
|
+
evt.payload.blockRef = StormEventParser.toRef(handle, evt.payload.blockName).toNormalizedString();
|
247
|
+
evt.payload.instanceId = StormEventParser.toInstanceIdFromRef(evt.payload.blockRef);
|
248
|
+
}
|
249
|
+
break;
|
239
250
|
}
|
240
251
|
return await this.toResult(handle);
|
241
252
|
}
|
@@ -218,6 +218,10 @@ export interface StormEventFileChunk extends StormEventFileBase {
|
|
218
218
|
lineNumber: number;
|
219
219
|
};
|
220
220
|
}
|
221
|
+
export interface StormEventApiBase {
|
222
|
+
type: 'API_STREAM_CHUNK' | 'API_STREAM_DONE' | 'API_STREAM_FAILED' | 'API_STREAM_STATE' | 'API_STREAM_START' | 'API_STREAM_CHUNK_RESET';
|
223
|
+
payload: StormEventFileBasePayload;
|
224
|
+
}
|
221
225
|
export interface StormEventBlockReady {
|
222
226
|
type: 'BLOCK_READY';
|
223
227
|
reason: string;
|
@@ -371,5 +375,5 @@ export interface StormEventReferenceClassification {
|
|
371
375
|
created: number;
|
372
376
|
payload: ReferenceClassification;
|
373
377
|
}
|
374
|
-
export type StormEvent = StormEventCreateBlock | StormEventCreateConnection | StormEventCreatePlanProperties | StormEventInvalidResponse | StormEventPlanRetry | StormEventCreateDSL | StormEventCreateDSLResource | StormEventError | StormEventScreen | StormEventScreenCandidate | StormEventFileLogical | StormEventFileState | StormEventFileDone | StormEventFileFailed | StormEventFileChunk | StormEventDone | StormEventDefinitionChange | StormEventErrorClassifier | StormEventCodeFix | StormEventErrorDetails | StormEventBlockReady | StormEventPhases | StormEventBlockStatus | StormEventCreateDSLRetry | StormEventUserJourney | StormEventUIShell | StormEventPage | StormEventPageUrl | StormEventPromptImprove | StormEventLandingPage | StormEventReferenceClassification;
|
378
|
+
export type StormEvent = StormEventCreateBlock | StormEventCreateConnection | StormEventCreatePlanProperties | StormEventInvalidResponse | StormEventPlanRetry | StormEventCreateDSL | StormEventCreateDSLResource | StormEventError | StormEventScreen | StormEventScreenCandidate | StormEventFileLogical | StormEventFileState | StormEventFileDone | StormEventFileFailed | StormEventFileChunk | StormEventDone | StormEventDefinitionChange | StormEventErrorClassifier | StormEventCodeFix | StormEventErrorDetails | StormEventBlockReady | StormEventPhases | StormEventBlockStatus | StormEventCreateDSLRetry | StormEventUserJourney | StormEventUIShell | StormEventPage | StormEventPageUrl | StormEventPromptImprove | StormEventLandingPage | StormEventReferenceClassification | StormEventApiBase;
|
375
379
|
export {};
|
package/package.json
CHANGED
@@ -357,6 +357,18 @@ export class StormEventParser {
|
|
357
357
|
this.blocks[evt.payload.blockName].models = [];
|
358
358
|
}
|
359
359
|
break;
|
360
|
+
|
361
|
+
case 'API_STREAM_CHUNK':
|
362
|
+
case 'API_STREAM_CHUNK_RESET':
|
363
|
+
case 'API_STREAM_DONE':
|
364
|
+
case 'API_STREAM_FAILED':
|
365
|
+
case 'API_STREAM_STATE':
|
366
|
+
case 'API_STREAM_START':
|
367
|
+
if ('blockName' in evt.payload) {
|
368
|
+
evt.payload.blockRef = StormEventParser.toRef(handle, evt.payload.blockName).toNormalizedString();
|
369
|
+
evt.payload.instanceId = StormEventParser.toInstanceIdFromRef(evt.payload.blockRef);
|
370
|
+
}
|
371
|
+
break;
|
360
372
|
}
|
361
373
|
|
362
374
|
return await this.toResult(handle);
|
package/src/storm/events.ts
CHANGED
@@ -263,6 +263,11 @@ export interface StormEventFileChunk extends StormEventFileBase {
|
|
263
263
|
};
|
264
264
|
}
|
265
265
|
|
266
|
+
export interface StormEventApiBase {
|
267
|
+
type: 'API_STREAM_CHUNK' | 'API_STREAM_DONE' | 'API_STREAM_FAILED' | 'API_STREAM_STATE' | 'API_STREAM_START' | 'API_STREAM_CHUNK_RESET';
|
268
|
+
payload: StormEventFileBasePayload;
|
269
|
+
}
|
270
|
+
|
266
271
|
export interface StormEventBlockReady {
|
267
272
|
type: 'BLOCK_READY';
|
268
273
|
reason: string;
|
@@ -471,4 +476,5 @@ export type StormEvent =
|
|
471
476
|
| StormEventPageUrl
|
472
477
|
| StormEventPromptImprove
|
473
478
|
| StormEventLandingPage
|
474
|
-
| StormEventReferenceClassification
|
479
|
+
| StormEventReferenceClassification
|
480
|
+
| StormEventApiBase;
|
package/src/storm/routes.ts
CHANGED
@@ -483,6 +483,7 @@ router.post('/:handle/all', async (req: KapetaBodyRequest, res: Response) => {
|
|
483
483
|
const result = await eventParser.processEvent(handle, data);
|
484
484
|
|
485
485
|
switch (data.type) {
|
486
|
+
case 'API_STREAM_START':
|
486
487
|
case 'CREATE_API':
|
487
488
|
case 'CREATE_MODEL':
|
488
489
|
case 'CREATE_TYPE':
|