@kumologica/sdk 3.2.0-beta23 → 3.2.0-beta25

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "productName": "Kumologica Designer",
4
4
  "copyright": "Copyright 2020 Kumologica Pty Ltd, All Rights Reserved.",
5
5
  "author": "Kumologica Pty Ltd <contact@kumologica.com>",
6
- "version": "3.2.0-beta23",
6
+ "version": "3.2.0-beta25",
7
7
  "description": "Kumologica Designer, harnessing Serverless for your cloud integration needs",
8
8
  "main": "src/app/main.js",
9
9
  "files": [
@@ -64,9 +64,9 @@
64
64
  "license": "Proprietary",
65
65
  "dependencies": {
66
66
  "@electron/remote": "^2.0.8",
67
- "@kumologica/builder": "3.2.0-beta23",
68
- "@kumologica/devkit": "3.2.0-beta23",
69
- "@kumologica/runtime": "3.2.0-beta23",
67
+ "@kumologica/builder": "3.2.0-beta25",
68
+ "@kumologica/devkit": "3.2.0-beta25",
69
+ "@kumologica/runtime": "3.2.0-beta25",
70
70
  "adm-zip": "0.4.13",
71
71
  "ajv": "8.10.0",
72
72
  "archive-type": "^4.0.0",
@@ -153,7 +153,6 @@ class AWSDeployer {
153
153
  }
154
154
 
155
155
  const deploymentStart = Date.now();
156
- var lambdaArn;
157
156
 
158
157
  this.log(`Deployment to AWS Started:`);
159
158
  this.log(` ${this.chalk('#F5DEB3', 'flow:')} ${this.chalk('whiteBright', projectInfo.projectFlowName)}`, false);
@@ -212,9 +211,8 @@ class AWSDeployer {
212
211
  }
213
212
  */
214
213
 
215
- lambdaArn = stackDetails.Stacks[0].Outputs[0].OutputValue;
214
+ const res = this.parseStackOutput(stackDetails);
216
215
 
217
- this.log(JSON.stringify(stackDetails));
218
216
  this.log(`${this.chalk('greenBright', 'Deployment successful.')}`);
219
217
  this.log(
220
218
  ` ${this.chalk('#F5DEB3', 'StackId:')} ${this.chalk('whiteBright',
@@ -222,9 +220,11 @@ class AWSDeployer {
222
220
  )}`,
223
221
  false
224
222
  );
225
- this.log(` ${this.chalk('#F5DEB3', 'LambdaArn:')} ${this.chalk('whiteBright',lambdaArn)}`, false);
223
+ this.log(` ${this.chalk('#F5DEB3', 'LambdaArn:')} ${this.chalk('whiteBright',res.LambdaArn)}`, false);
226
224
  this.log('', false);
227
225
 
226
+ this.printSignature(flowListeners, params, res);
227
+
228
228
  // this call to be moved out to the terminals panel
229
229
  /*if (this.cw == false) {
230
230
  this.cwLogs.startCWLogs(settings.functionName, AWS.config.region);
@@ -235,41 +235,65 @@ class AWSDeployer {
235
235
  this.log(`${this.chalk('redBright', 'Deployment failed.')}`);
236
236
  this.log(` ${this.chalk('redBright', error)}`);
237
237
  } finally {
238
- //this.s3.deleteS3Bucket(deploymentBucketName);
239
238
  }
240
239
 
241
- if (lambdaArn) {
242
- // response = await this.runTriggers(params, settings, lambdaArn);
243
- const url = `https://${response.apiId}.execute-api.${AWS.config.region}.amazonaws.com/${response.stage}`;
244
- this.printSignature(url, flowListeners, params);
245
- }
246
240
  }
247
241
 
248
- printSignature(url, s, p) {
242
+ parseStackOutput(stackDetails) {
243
+ let res = {};
244
+ stackDetails.Stacks[0].Outputs.forEach(o => {
245
+ res[o.OutputKey] = o.OutputValue;
246
+ });
247
+ return res;
248
+ }
249
+
250
+ printSignature(s, p, output) {
249
251
  this.log(' ')
250
252
 
251
253
  if (s.api && s.api.length > 0) {
252
- this.log('API Gateway:');
253
- s.api.forEach(a => this.log(` ${(' ' + a.verb.toUpperCase()).slice(-6)} ${url}${a.url}`), this);
254
- this.log('');
254
+ const _api = p.events.find(e => e.source === "api");
255
+
256
+ if (_api) {
257
+ this.log('API Gateway:');
258
+
259
+ let apiId = _api.api;
260
+ let stage = _api.stage;
261
+
262
+ if (_api.api === "create new") {
263
+ apiId = output.RestApiId || "unknown api gateway";
264
+ }
265
+
266
+ let url = `https://${apiId}.execute-api.${AWS.config.region}.amazonaws.com/${stage}`;
267
+ s.api.forEach(a => this.log(` ${(' ' + a.verb.toUpperCase()).slice(-6)} ${url}${a.url}`), this);
268
+ this.log('');
269
+ }
255
270
  }
256
271
 
257
272
  if (s.dynamodb && s.dynamodb.length > 0) {
258
- this.log('DynamoDB Streams:');
259
- s.dynamodb.forEach(a => this.log(` ${a.startingPosition} ${a.stream}`), this);
260
- this.log('');
273
+ const _ddb = p.events.find(e => e.source === "dynamodb");
274
+ if (_ddb) {
275
+ this.log('DynamoDB Streams:');
276
+ s.dynamodb.forEach(a => this.log(` ${a.startingPosition} ${a.stream}`), this);
277
+ this.log('');
278
+ }
261
279
  }
262
280
 
263
281
  if (s.s3 && s.s3.length > 0) {
264
- this.log('S3:');
265
- s.s3.forEach(a => this.log(` ${a.eventType} ${a.bucket}`), this);
266
- this.log('');
282
+ const _s3 = p.events.find(e => e.source === "s3");
283
+ if (_s3) {
284
+ this.log('S3:');
285
+ s.s3.forEach(a => this.log(` ${a.eventType} ${a.bucket}`), this);
286
+ this.log('');
287
+ }
267
288
  }
268
289
 
269
290
  if (s.sns && s.sns.length > 0) {
270
- this.log('SNS Topics:');
271
- s.sns.forEach(a => this.log(` ${a.topic}`), this);
272
- this.log('');
291
+ const _sns = p.events.find(e => e.source === "sns");
292
+ if (_sns) {
293
+ this.log('SNS Topics:');
294
+ s.sns.forEach(a => this.log(` ${a.topic}`), this);
295
+ this.log('');
296
+ }
273
297
  }
274
298
 
275
299
  if (s.iot && s.iot.length > 0) {
@@ -293,22 +317,22 @@ if (p.events && p.events.length > 0) {
293
317
  }
294
318
  }
295
319
 
296
- if (s.alexa && s.alexa.length > 0) {
297
- this.log('Alexa Skills:');
298
- s.alexa.forEach(a => this.log(` ${a.skillId}`), this);
299
- this.log('');
300
- }
301
-
302
320
  if (s.kinesis && s.kinesis.length > 0) {
303
- this.log('Kinesis:');
304
- s.kinesis.forEach(a => this.log(` ${a.startingPosition} ${a.stream}`), this);
305
- this.log('');
321
+ const _k = p.events.find(e => e.source === "kinesis");
322
+ if (_k) {
323
+ this.log('Kinesis:');
324
+ s.kinesis.forEach(a => this.log(` ${a.startingPosition} ${a.stream}`), this);
325
+ this.log('');
326
+ }
306
327
  }
307
328
 
308
329
  if (s.cwevents && s.cwevents.length > 0) {
309
- this.log('Cloud Watch Events Rules:');
310
- s.cwevents.forEach(a => this.log(` ${a.rule}`), this);
311
- this.log('');
330
+ const _ev = p.events.find(e => e.source === "event");
331
+ if (_ev) {
332
+ this.log('Cloud Watch Events Rules:');
333
+ s.cwevents.forEach(a => this.log(` ${a.rule}`), this);
334
+ this.log('');
335
+ }
312
336
  }
313
337
  }
314
338
 
@@ -31083,9 +31083,9 @@ RED.editor = (function () {
31083
31083
  resize: function (dimensions) {
31084
31084
  editTrayWidthCache[type] = dimensions.width;
31085
31085
  $('.editor-tray-content').height(dimensions.height - 50);
31086
- var form = $('.editor-tray-content form').height(
31087
- dimensions.height - 50 - 40
31088
- );
31086
+ // var form = $('.editor-tray-content form').height(
31087
+ // dimensions.height - 50 - 40
31088
+ // );
31089
31089
  if (editing_node && editing_node._def.oneditresize) {
31090
31090
  try {
31091
31091
  editing_node._def.oneditresize.call(editing_node, {