@kapeta/local-cluster-service 0.48.1 → 0.48.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 +7 -0
- package/dist/cjs/src/storm/codegen.d.ts +2 -0
- package/dist/cjs/src/storm/codegen.js +9 -2
- package/dist/cjs/src/storm/event-parser.js +13 -5
- package/dist/cjs/src/storm/events.d.ts +15 -2
- package/dist/esm/src/storm/codegen.d.ts +2 -0
- package/dist/esm/src/storm/codegen.js +9 -2
- package/dist/esm/src/storm/event-parser.js +13 -5
- package/dist/esm/src/storm/events.d.ts +15 -2
- package/package.json +1 -1
- package/src/storm/codegen.ts +11 -2
- package/src/storm/event-parser.ts +16 -5
- package/src/storm/events.ts +16 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [0.48.2](https://github.com/kapetacom/local-cluster-service/compare/v0.48.1...v0.48.2) (2024-06-03)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Include resource name for api and model ([#157](https://github.com/kapetacom/local-cluster-service/issues/157)) ([b79a704](https://github.com/kapetacom/local-cluster-service/commit/b79a704b74d11cb0ec0fc8346e29ed754b39fb12))
|
7
|
+
|
1
8
|
## [0.48.1](https://github.com/kapetacom/local-cluster-service/compare/v0.48.0...v0.48.1) (2024-06-03)
|
2
9
|
|
3
10
|
|
@@ -10,12 +10,14 @@ export declare class StormCodegen {
|
|
10
10
|
private readonly blocks;
|
11
11
|
private readonly out;
|
12
12
|
private readonly events;
|
13
|
+
private readonly tmpDir;
|
13
14
|
constructor(userPrompt: string, blocks: BlockDefinitionInfo[], events: StormEvent[]);
|
14
15
|
process(): Promise<void>;
|
15
16
|
getStream(): StormStream;
|
16
17
|
private handleTemplateFileOutput;
|
17
18
|
private handleUiOutput;
|
18
19
|
private handleFileOutput;
|
20
|
+
private getBasePath;
|
19
21
|
/**
|
20
22
|
* Generates the code for a block and sends it to the AI
|
21
23
|
*/
|
@@ -43,10 +43,12 @@ class StormCodegen {
|
|
43
43
|
blocks;
|
44
44
|
out = new stream_1.StormStream();
|
45
45
|
events;
|
46
|
+
tmpDir;
|
46
47
|
constructor(userPrompt, blocks, events) {
|
47
48
|
this.userPrompt = userPrompt;
|
48
49
|
this.blocks = blocks;
|
49
50
|
this.events = events;
|
51
|
+
this.tmpDir = node_os_1.default.tmpdir();
|
50
52
|
}
|
51
53
|
async process() {
|
52
54
|
for (const block of this.blocks) {
|
@@ -95,6 +97,9 @@ class StormCodegen {
|
|
95
97
|
};
|
96
98
|
}
|
97
99
|
}
|
100
|
+
getBasePath(blockName) {
|
101
|
+
return path_1.default.join(this.tmpDir, blockName);
|
102
|
+
}
|
98
103
|
/**
|
99
104
|
* Generates the code for a block and sends it to the AI
|
100
105
|
*/
|
@@ -129,7 +134,7 @@ class StormCodegen {
|
|
129
134
|
if (serviceFiles.length > 0) {
|
130
135
|
await this.processTemplates(block.uri, block.aiName, stormClient_1.stormClient.createServiceImplementation.bind(stormClient_1.stormClient), serviceFiles, contextFiles);
|
131
136
|
}
|
132
|
-
const basePath =
|
137
|
+
const basePath = this.getBasePath(block.content.metadata.name);
|
133
138
|
for (const serviceFile of serviceFiles) {
|
134
139
|
const filePath = (0, path_1.join)(basePath, serviceFile.filename);
|
135
140
|
await (0, promises_1.writeFile)(filePath, serviceFile.content);
|
@@ -165,12 +170,14 @@ class StormCodegen {
|
|
165
170
|
});
|
166
171
|
}
|
167
172
|
emitFile(uri, blockName, filename, content, reason = 'File generated') {
|
173
|
+
const basePath = this.getBasePath(uri.fullName);
|
168
174
|
this.out.emit('data', {
|
169
175
|
type: 'FILE',
|
170
176
|
reason,
|
171
177
|
created: Date.now(),
|
172
178
|
payload: {
|
173
179
|
filename: filename,
|
180
|
+
path: (0, path_1.join)(basePath, filename),
|
174
181
|
content: content,
|
175
182
|
blockName,
|
176
183
|
blockRef: uri.toNormalizedString(),
|
@@ -245,7 +252,7 @@ class StormCodegen {
|
|
245
252
|
if (!(await codeGeneratorManager_1.codeGeneratorManager.ensureTarget(yamlContent.spec.target?.kind))) {
|
246
253
|
return;
|
247
254
|
}
|
248
|
-
const basePath =
|
255
|
+
const basePath = this.getBasePath(yamlContent.metadata.name);
|
249
256
|
const codeGenerator = new codegen_1.BlockCodeGenerator(yamlContent);
|
250
257
|
codeGenerator.withOption('AIContext', stormClient_1.STORM_ID);
|
251
258
|
const generatedResult = await codeGenerator.generate();
|
@@ -126,7 +126,9 @@ class StormEventParser {
|
|
126
126
|
* Builds plan and block definitions - and enriches events with relevant refs and ids
|
127
127
|
*/
|
128
128
|
processEvent(handle, evt) {
|
129
|
+
let blockInfo;
|
129
130
|
this.events.push(evt);
|
131
|
+
console.log('Processing event: %s', evt.type);
|
130
132
|
switch (evt.type) {
|
131
133
|
case 'CREATE_PLAN_PROPERTIES':
|
132
134
|
this.planName = evt.payload.name;
|
@@ -150,17 +152,23 @@ class StormEventParser {
|
|
150
152
|
this.error = evt.payload.error;
|
151
153
|
break;
|
152
154
|
case 'CREATE_API':
|
153
|
-
this.blocks[evt.payload.blockName]
|
155
|
+
blockInfo = this.blocks[evt.payload.blockName];
|
156
|
+
blockInfo.apis.push(prettifyKaplang(evt.payload.content));
|
154
157
|
evt.payload.blockRef = this.toRef(handle, evt.payload.blockName).toNormalizedString();
|
155
158
|
evt.payload.instanceId = this.toInstanceIdFromRef(evt.payload.blockRef);
|
159
|
+
const api = blockInfo.resources.find((r) => r.type == 'API');
|
160
|
+
evt.payload.resourceName = api?.name;
|
156
161
|
break;
|
157
|
-
case '
|
158
|
-
this.blocks[evt.payload.blockName]
|
162
|
+
case 'CREATE_MODEL':
|
163
|
+
blockInfo = this.blocks[evt.payload.blockName];
|
164
|
+
blockInfo.models.push(prettifyKaplang(evt.payload.content));
|
159
165
|
evt.payload.blockRef = this.toRef(handle, evt.payload.blockName).toNormalizedString();
|
160
166
|
evt.payload.instanceId = this.toInstanceIdFromRef(evt.payload.blockRef);
|
167
|
+
const database = blockInfo.resources.find((r) => r.type == 'DATABASE');
|
168
|
+
evt.payload.resourceName = database?.name;
|
161
169
|
break;
|
162
|
-
case '
|
163
|
-
this.blocks[evt.payload.blockName].
|
170
|
+
case 'CREATE_TYPE':
|
171
|
+
this.blocks[evt.payload.blockName].types.push(prettifyKaplang(evt.payload.content));
|
164
172
|
evt.payload.blockRef = this.toRef(handle, evt.payload.blockName).toNormalizedString();
|
165
173
|
evt.payload.instanceId = this.toInstanceIdFromRef(evt.payload.blockRef);
|
166
174
|
break;
|
@@ -70,7 +70,7 @@ export interface StormEventPlanRetry {
|
|
70
70
|
};
|
71
71
|
}
|
72
72
|
export interface StormEventCreateDSL {
|
73
|
-
type: '
|
73
|
+
type: 'CREATE_TYPE';
|
74
74
|
reason: string;
|
75
75
|
created: number;
|
76
76
|
payload: {
|
@@ -80,6 +80,18 @@ export interface StormEventCreateDSL {
|
|
80
80
|
instanceId?: string;
|
81
81
|
};
|
82
82
|
}
|
83
|
+
export interface StormEventCreateDSLResource extends Omit<StormEventCreateDSL, 'type'> {
|
84
|
+
type: 'CREATE_API' | 'CREATE_MODEL';
|
85
|
+
reason: string;
|
86
|
+
created: number;
|
87
|
+
payload: {
|
88
|
+
blockName: string;
|
89
|
+
content: string;
|
90
|
+
blockRef?: string;
|
91
|
+
instanceId?: string;
|
92
|
+
resourceName?: string;
|
93
|
+
};
|
94
|
+
}
|
83
95
|
export interface StormEventError {
|
84
96
|
type: 'INVALID_RESPONSE' | 'ERROR_INTERNAL';
|
85
97
|
reason: string;
|
@@ -122,6 +134,7 @@ export interface StormEventFile {
|
|
122
134
|
created: number;
|
123
135
|
payload: {
|
124
136
|
filename: string;
|
137
|
+
path: string;
|
125
138
|
content: string;
|
126
139
|
blockName: string;
|
127
140
|
blockRef: string;
|
@@ -137,4 +150,4 @@ export interface StormEventDefinitionChange {
|
|
137
150
|
created: number;
|
138
151
|
payload: StormDefinitions;
|
139
152
|
}
|
140
|
-
export type StormEvent = StormEventCreateBlock | StormEventCreateConnection | StormEventCreatePlanProperties | StormEventInvalidResponse | StormEventPlanRetry | StormEventCreateDSL | StormEventError | StormEventScreen | StormEventScreenCandidate | StormEventFile | StormEventDone | StormEventDefinitionChange;
|
153
|
+
export type StormEvent = StormEventCreateBlock | StormEventCreateConnection | StormEventCreatePlanProperties | StormEventInvalidResponse | StormEventPlanRetry | StormEventCreateDSL | StormEventCreateDSLResource | StormEventError | StormEventScreen | StormEventScreenCandidate | StormEventFile | StormEventDone | StormEventDefinitionChange;
|
@@ -10,12 +10,14 @@ export declare class StormCodegen {
|
|
10
10
|
private readonly blocks;
|
11
11
|
private readonly out;
|
12
12
|
private readonly events;
|
13
|
+
private readonly tmpDir;
|
13
14
|
constructor(userPrompt: string, blocks: BlockDefinitionInfo[], events: StormEvent[]);
|
14
15
|
process(): Promise<void>;
|
15
16
|
getStream(): StormStream;
|
16
17
|
private handleTemplateFileOutput;
|
17
18
|
private handleUiOutput;
|
18
19
|
private handleFileOutput;
|
20
|
+
private getBasePath;
|
19
21
|
/**
|
20
22
|
* Generates the code for a block and sends it to the AI
|
21
23
|
*/
|
@@ -43,10 +43,12 @@ class StormCodegen {
|
|
43
43
|
blocks;
|
44
44
|
out = new stream_1.StormStream();
|
45
45
|
events;
|
46
|
+
tmpDir;
|
46
47
|
constructor(userPrompt, blocks, events) {
|
47
48
|
this.userPrompt = userPrompt;
|
48
49
|
this.blocks = blocks;
|
49
50
|
this.events = events;
|
51
|
+
this.tmpDir = node_os_1.default.tmpdir();
|
50
52
|
}
|
51
53
|
async process() {
|
52
54
|
for (const block of this.blocks) {
|
@@ -95,6 +97,9 @@ class StormCodegen {
|
|
95
97
|
};
|
96
98
|
}
|
97
99
|
}
|
100
|
+
getBasePath(blockName) {
|
101
|
+
return path_1.default.join(this.tmpDir, blockName);
|
102
|
+
}
|
98
103
|
/**
|
99
104
|
* Generates the code for a block and sends it to the AI
|
100
105
|
*/
|
@@ -129,7 +134,7 @@ class StormCodegen {
|
|
129
134
|
if (serviceFiles.length > 0) {
|
130
135
|
await this.processTemplates(block.uri, block.aiName, stormClient_1.stormClient.createServiceImplementation.bind(stormClient_1.stormClient), serviceFiles, contextFiles);
|
131
136
|
}
|
132
|
-
const basePath =
|
137
|
+
const basePath = this.getBasePath(block.content.metadata.name);
|
133
138
|
for (const serviceFile of serviceFiles) {
|
134
139
|
const filePath = (0, path_1.join)(basePath, serviceFile.filename);
|
135
140
|
await (0, promises_1.writeFile)(filePath, serviceFile.content);
|
@@ -165,12 +170,14 @@ class StormCodegen {
|
|
165
170
|
});
|
166
171
|
}
|
167
172
|
emitFile(uri, blockName, filename, content, reason = 'File generated') {
|
173
|
+
const basePath = this.getBasePath(uri.fullName);
|
168
174
|
this.out.emit('data', {
|
169
175
|
type: 'FILE',
|
170
176
|
reason,
|
171
177
|
created: Date.now(),
|
172
178
|
payload: {
|
173
179
|
filename: filename,
|
180
|
+
path: (0, path_1.join)(basePath, filename),
|
174
181
|
content: content,
|
175
182
|
blockName,
|
176
183
|
blockRef: uri.toNormalizedString(),
|
@@ -245,7 +252,7 @@ class StormCodegen {
|
|
245
252
|
if (!(await codeGeneratorManager_1.codeGeneratorManager.ensureTarget(yamlContent.spec.target?.kind))) {
|
246
253
|
return;
|
247
254
|
}
|
248
|
-
const basePath =
|
255
|
+
const basePath = this.getBasePath(yamlContent.metadata.name);
|
249
256
|
const codeGenerator = new codegen_1.BlockCodeGenerator(yamlContent);
|
250
257
|
codeGenerator.withOption('AIContext', stormClient_1.STORM_ID);
|
251
258
|
const generatedResult = await codeGenerator.generate();
|
@@ -126,7 +126,9 @@ class StormEventParser {
|
|
126
126
|
* Builds plan and block definitions - and enriches events with relevant refs and ids
|
127
127
|
*/
|
128
128
|
processEvent(handle, evt) {
|
129
|
+
let blockInfo;
|
129
130
|
this.events.push(evt);
|
131
|
+
console.log('Processing event: %s', evt.type);
|
130
132
|
switch (evt.type) {
|
131
133
|
case 'CREATE_PLAN_PROPERTIES':
|
132
134
|
this.planName = evt.payload.name;
|
@@ -150,17 +152,23 @@ class StormEventParser {
|
|
150
152
|
this.error = evt.payload.error;
|
151
153
|
break;
|
152
154
|
case 'CREATE_API':
|
153
|
-
this.blocks[evt.payload.blockName]
|
155
|
+
blockInfo = this.blocks[evt.payload.blockName];
|
156
|
+
blockInfo.apis.push(prettifyKaplang(evt.payload.content));
|
154
157
|
evt.payload.blockRef = this.toRef(handle, evt.payload.blockName).toNormalizedString();
|
155
158
|
evt.payload.instanceId = this.toInstanceIdFromRef(evt.payload.blockRef);
|
159
|
+
const api = blockInfo.resources.find((r) => r.type == 'API');
|
160
|
+
evt.payload.resourceName = api?.name;
|
156
161
|
break;
|
157
|
-
case '
|
158
|
-
this.blocks[evt.payload.blockName]
|
162
|
+
case 'CREATE_MODEL':
|
163
|
+
blockInfo = this.blocks[evt.payload.blockName];
|
164
|
+
blockInfo.models.push(prettifyKaplang(evt.payload.content));
|
159
165
|
evt.payload.blockRef = this.toRef(handle, evt.payload.blockName).toNormalizedString();
|
160
166
|
evt.payload.instanceId = this.toInstanceIdFromRef(evt.payload.blockRef);
|
167
|
+
const database = blockInfo.resources.find((r) => r.type == 'DATABASE');
|
168
|
+
evt.payload.resourceName = database?.name;
|
161
169
|
break;
|
162
|
-
case '
|
163
|
-
this.blocks[evt.payload.blockName].
|
170
|
+
case 'CREATE_TYPE':
|
171
|
+
this.blocks[evt.payload.blockName].types.push(prettifyKaplang(evt.payload.content));
|
164
172
|
evt.payload.blockRef = this.toRef(handle, evt.payload.blockName).toNormalizedString();
|
165
173
|
evt.payload.instanceId = this.toInstanceIdFromRef(evt.payload.blockRef);
|
166
174
|
break;
|
@@ -70,7 +70,7 @@ export interface StormEventPlanRetry {
|
|
70
70
|
};
|
71
71
|
}
|
72
72
|
export interface StormEventCreateDSL {
|
73
|
-
type: '
|
73
|
+
type: 'CREATE_TYPE';
|
74
74
|
reason: string;
|
75
75
|
created: number;
|
76
76
|
payload: {
|
@@ -80,6 +80,18 @@ export interface StormEventCreateDSL {
|
|
80
80
|
instanceId?: string;
|
81
81
|
};
|
82
82
|
}
|
83
|
+
export interface StormEventCreateDSLResource extends Omit<StormEventCreateDSL, 'type'> {
|
84
|
+
type: 'CREATE_API' | 'CREATE_MODEL';
|
85
|
+
reason: string;
|
86
|
+
created: number;
|
87
|
+
payload: {
|
88
|
+
blockName: string;
|
89
|
+
content: string;
|
90
|
+
blockRef?: string;
|
91
|
+
instanceId?: string;
|
92
|
+
resourceName?: string;
|
93
|
+
};
|
94
|
+
}
|
83
95
|
export interface StormEventError {
|
84
96
|
type: 'INVALID_RESPONSE' | 'ERROR_INTERNAL';
|
85
97
|
reason: string;
|
@@ -122,6 +134,7 @@ export interface StormEventFile {
|
|
122
134
|
created: number;
|
123
135
|
payload: {
|
124
136
|
filename: string;
|
137
|
+
path: string;
|
125
138
|
content: string;
|
126
139
|
blockName: string;
|
127
140
|
blockRef: string;
|
@@ -137,4 +150,4 @@ export interface StormEventDefinitionChange {
|
|
137
150
|
created: number;
|
138
151
|
payload: StormDefinitions;
|
139
152
|
}
|
140
|
-
export type StormEvent = StormEventCreateBlock | StormEventCreateConnection | StormEventCreatePlanProperties | StormEventInvalidResponse | StormEventPlanRetry | StormEventCreateDSL | StormEventError | StormEventScreen | StormEventScreenCandidate | StormEventFile | StormEventDone | StormEventDefinitionChange;
|
153
|
+
export type StormEvent = StormEventCreateBlock | StormEventCreateConnection | StormEventCreatePlanProperties | StormEventInvalidResponse | StormEventPlanRetry | StormEventCreateDSL | StormEventCreateDSLResource | StormEventError | StormEventScreen | StormEventScreenCandidate | StormEventFile | StormEventDone | StormEventDefinitionChange;
|
package/package.json
CHANGED
package/src/storm/codegen.ts
CHANGED
@@ -23,11 +23,13 @@ export class StormCodegen {
|
|
23
23
|
private readonly blocks: BlockDefinitionInfo[];
|
24
24
|
private readonly out = new StormStream();
|
25
25
|
private readonly events: StormEvent[];
|
26
|
+
private readonly tmpDir: string;
|
26
27
|
|
27
28
|
constructor(userPrompt: string, blocks: BlockDefinitionInfo[], events: StormEvent[]) {
|
28
29
|
this.userPrompt = userPrompt;
|
29
30
|
this.blocks = blocks;
|
30
31
|
this.events = events;
|
32
|
+
this.tmpDir = os.tmpdir();
|
31
33
|
}
|
32
34
|
|
33
35
|
public async process() {
|
@@ -83,6 +85,10 @@ export class StormCodegen {
|
|
83
85
|
}
|
84
86
|
}
|
85
87
|
|
88
|
+
private getBasePath(blockName: string) {
|
89
|
+
return path.join(this.tmpDir, blockName);
|
90
|
+
}
|
91
|
+
|
86
92
|
/**
|
87
93
|
* Generates the code for a block and sends it to the AI
|
88
94
|
*/
|
@@ -135,7 +141,7 @@ export class StormCodegen {
|
|
135
141
|
);
|
136
142
|
}
|
137
143
|
|
138
|
-
const basePath =
|
144
|
+
const basePath = this.getBasePath(block.content.metadata.name);
|
139
145
|
|
140
146
|
for (const serviceFile of serviceFiles) {
|
141
147
|
const filePath = join(basePath, serviceFile.filename);
|
@@ -185,12 +191,15 @@ export class StormCodegen {
|
|
185
191
|
content: string,
|
186
192
|
reason: string = 'File generated'
|
187
193
|
) {
|
194
|
+
const basePath = this.getBasePath(uri.fullName);
|
195
|
+
|
188
196
|
this.out.emit('data', {
|
189
197
|
type: 'FILE',
|
190
198
|
reason,
|
191
199
|
created: Date.now(),
|
192
200
|
payload: {
|
193
201
|
filename: filename,
|
202
|
+
path: join(basePath, filename),
|
194
203
|
content: content,
|
195
204
|
blockName,
|
196
205
|
blockRef: uri.toNormalizedString(),
|
@@ -283,7 +292,7 @@ export class StormCodegen {
|
|
283
292
|
if (!(await codeGeneratorManager.ensureTarget(yamlContent.spec.target?.kind))) {
|
284
293
|
return;
|
285
294
|
}
|
286
|
-
const basePath =
|
295
|
+
const basePath = this.getBasePath(yamlContent.metadata.name);
|
287
296
|
|
288
297
|
const codeGenerator = new BlockCodeGenerator(yamlContent as BlockDefinition);
|
289
298
|
codeGenerator.withOption('AIContext', STORM_ID);
|
@@ -225,7 +225,9 @@ export class StormEventParser {
|
|
225
225
|
* Builds plan and block definitions - and enriches events with relevant refs and ids
|
226
226
|
*/
|
227
227
|
public processEvent(handle: string, evt: StormEvent): StormDefinitions {
|
228
|
+
let blockInfo;
|
228
229
|
this.events.push(evt);
|
230
|
+
console.log('Processing event: %s', evt.type);
|
229
231
|
switch (evt.type) {
|
230
232
|
case 'CREATE_PLAN_PROPERTIES':
|
231
233
|
this.planName = evt.payload.name;
|
@@ -249,17 +251,26 @@ export class StormEventParser {
|
|
249
251
|
this.error = evt.payload.error;
|
250
252
|
break;
|
251
253
|
case 'CREATE_API':
|
252
|
-
this.blocks[evt.payload.blockName]
|
254
|
+
blockInfo = this.blocks[evt.payload.blockName];
|
255
|
+
blockInfo.apis.push(prettifyKaplang(evt.payload.content));
|
253
256
|
evt.payload.blockRef = this.toRef(handle, evt.payload.blockName).toNormalizedString();
|
254
257
|
evt.payload.instanceId = this.toInstanceIdFromRef(evt.payload.blockRef);
|
258
|
+
|
259
|
+
const api = blockInfo.resources.find((r) => r.type == 'API');
|
260
|
+
evt.payload.resourceName = api?.name;
|
255
261
|
break;
|
256
|
-
case '
|
257
|
-
this.blocks[evt.payload.blockName]
|
262
|
+
case 'CREATE_MODEL':
|
263
|
+
blockInfo = this.blocks[evt.payload.blockName];
|
264
|
+
blockInfo.models.push(prettifyKaplang(evt.payload.content));
|
258
265
|
evt.payload.blockRef = this.toRef(handle, evt.payload.blockName).toNormalizedString();
|
259
266
|
evt.payload.instanceId = this.toInstanceIdFromRef(evt.payload.blockRef);
|
267
|
+
|
268
|
+
const database = blockInfo.resources.find((r) => r.type == 'DATABASE');
|
269
|
+
evt.payload.resourceName = database?.name;
|
260
270
|
break;
|
261
|
-
|
262
|
-
|
271
|
+
|
272
|
+
case 'CREATE_TYPE':
|
273
|
+
this.blocks[evt.payload.blockName].types.push(prettifyKaplang(evt.payload.content));
|
263
274
|
evt.payload.blockRef = this.toRef(handle, evt.payload.blockName).toNormalizedString();
|
264
275
|
evt.payload.instanceId = this.toInstanceIdFromRef(evt.payload.blockRef);
|
265
276
|
break;
|
package/src/storm/events.ts
CHANGED
@@ -94,7 +94,7 @@ export interface StormEventPlanRetry {
|
|
94
94
|
}
|
95
95
|
|
96
96
|
export interface StormEventCreateDSL {
|
97
|
-
type: '
|
97
|
+
type: 'CREATE_TYPE';
|
98
98
|
reason: string;
|
99
99
|
created: number;
|
100
100
|
payload: {
|
@@ -105,6 +105,19 @@ export interface StormEventCreateDSL {
|
|
105
105
|
};
|
106
106
|
}
|
107
107
|
|
108
|
+
export interface StormEventCreateDSLResource extends Omit<StormEventCreateDSL, 'type'> {
|
109
|
+
type: 'CREATE_API' | 'CREATE_MODEL';
|
110
|
+
reason: string;
|
111
|
+
created: number;
|
112
|
+
payload: {
|
113
|
+
blockName: string;
|
114
|
+
content: string;
|
115
|
+
blockRef?: string;
|
116
|
+
instanceId?: string;
|
117
|
+
resourceName?: string;
|
118
|
+
};
|
119
|
+
}
|
120
|
+
|
108
121
|
export interface StormEventError {
|
109
122
|
type: 'INVALID_RESPONSE' | 'ERROR_INTERNAL';
|
110
123
|
reason: string;
|
@@ -151,6 +164,7 @@ export interface StormEventFile {
|
|
151
164
|
created: number;
|
152
165
|
payload: {
|
153
166
|
filename: string;
|
167
|
+
path: string;
|
154
168
|
content: string;
|
155
169
|
blockName: string;
|
156
170
|
blockRef: string;
|
@@ -176,6 +190,7 @@ export type StormEvent =
|
|
176
190
|
| StormEventInvalidResponse
|
177
191
|
| StormEventPlanRetry
|
178
192
|
| StormEventCreateDSL
|
193
|
+
| StormEventCreateDSLResource
|
179
194
|
| StormEventError
|
180
195
|
| StormEventScreen
|
181
196
|
| StormEventScreenCandidate
|