@kumologica/sdk 3.0.27-beta4 → 3.0.27-beta6
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 +4 -4
- package/src/app/lib/aws/cf.js +3 -6
- package/src/app/lib/aws/index.js +12 -7
- package/src/app/main.js +2 -2
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.0.27-
|
|
6
|
+
"version": "3.0.27-beta6",
|
|
7
7
|
"description": "Kumologica Designer, harnessing Serverless for your cloud integration needs",
|
|
8
8
|
"main": "src/app/main.js",
|
|
9
9
|
"files": [
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"license": "Proprietary",
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@electron/remote": "^2.0.8",
|
|
68
|
-
"@kumologica/builder": "3.0.27-
|
|
69
|
-
"@kumologica/devkit": "3.0.27-
|
|
70
|
-
"@kumologica/runtime": "3.0.27-
|
|
68
|
+
"@kumologica/builder": "3.0.27-beta6",
|
|
69
|
+
"@kumologica/devkit": "3.0.27-beta6",
|
|
70
|
+
"@kumologica/runtime": "3.0.27-beta6",
|
|
71
71
|
"adm-zip": "0.4.13",
|
|
72
72
|
"ajv": "8.10.0",
|
|
73
73
|
"aws-sdk": "2.513.0",
|
package/src/app/lib/aws/cf.js
CHANGED
|
@@ -196,8 +196,7 @@ class AWSCFTemplate {
|
|
|
196
196
|
|
|
197
197
|
} else if (nodes[i].type === 'Lambda') {
|
|
198
198
|
//arn:aws:lambda:ap-southeast-2:174450237637:function:kumologica-deployments-flow-lambda
|
|
199
|
-
|
|
200
|
-
let lambdaArn = this.handleValue(lambda, nodes[i].LambdaArn);
|
|
199
|
+
let lambdaArn = this.handleValue(lambda, nodes[i].LambdaArn);
|
|
201
200
|
let lambdaParts = lambdaArn.split(":");
|
|
202
201
|
let lambdaName = '*';
|
|
203
202
|
|
|
@@ -273,6 +272,7 @@ class AWSCFTemplate {
|
|
|
273
272
|
if (!params.role) {
|
|
274
273
|
template.Resources['LambdaRole'] = lambdaRole;
|
|
275
274
|
}
|
|
275
|
+
|
|
276
276
|
return template;
|
|
277
277
|
}
|
|
278
278
|
|
|
@@ -292,7 +292,6 @@ class AWSCFTemplate {
|
|
|
292
292
|
// to determine the value
|
|
293
293
|
handleValue(lambda, key) {
|
|
294
294
|
let value;
|
|
295
|
-
console.log(`key= ${key}`);
|
|
296
295
|
|
|
297
296
|
if (!key) {
|
|
298
297
|
return key;
|
|
@@ -300,7 +299,6 @@ class AWSCFTemplate {
|
|
|
300
299
|
let keyValue = key.replace(/\s+/g, '');
|
|
301
300
|
|
|
302
301
|
if (keyValue.startsWith("env.")) {
|
|
303
|
-
console.log(`keyValue= ${keyValue}`);
|
|
304
302
|
keyValue = keyValue.replace("env.", "");
|
|
305
303
|
value = lambda.Properties.Environment.Variables[keyValue];
|
|
306
304
|
if (!value) {
|
|
@@ -329,7 +327,6 @@ class AWSCFTemplate {
|
|
|
329
327
|
// - updates existing resource policy (if found) with new permissions
|
|
330
328
|
//
|
|
331
329
|
handlePolicy(lambdaRole, policyName, operation, id) {
|
|
332
|
-
console.log(`policyName: ${policyName}`);
|
|
333
330
|
policyName = policyName.replace('/', '-').replace('*', 'all');
|
|
334
331
|
let policy = jp.query(lambdaRole.Properties, `Policies[?(@.PolicyName=='${policyName}')]`);
|
|
335
332
|
|
|
@@ -386,7 +383,7 @@ class AWSCFTemplate {
|
|
|
386
383
|
throw new Error(`Missing Trigger Parameter: SQS url`);
|
|
387
384
|
}
|
|
388
385
|
return {
|
|
389
|
-
PolicyName: '
|
|
386
|
+
PolicyName: 'KLSQSPolicy'+process.hrtime(),
|
|
390
387
|
PolicyDocument: {
|
|
391
388
|
Version: '2012-10-17',
|
|
392
389
|
Statement: [
|
package/src/app/lib/aws/index.js
CHANGED
|
@@ -241,7 +241,7 @@ class AWSDeployer {
|
|
|
241
241
|
);
|
|
242
242
|
|
|
243
243
|
flowListeners = this.processFlow(nodes);
|
|
244
|
-
|
|
244
|
+
|
|
245
245
|
const stackDetails = await this.executeStack(
|
|
246
246
|
settings,
|
|
247
247
|
params,
|
|
@@ -278,7 +278,7 @@ class AWSDeployer {
|
|
|
278
278
|
response = await this.runTriggers(params, settings, lambdaArn);
|
|
279
279
|
if (response) {
|
|
280
280
|
const url = `https://${response.apiId}.execute-api.${AWS.config.region}.amazonaws.com/${response.stage}`;
|
|
281
|
-
this.printSignature(url, flowListeners);
|
|
281
|
+
this.printSignature(url, flowListeners, params);
|
|
282
282
|
}
|
|
283
283
|
} catch (error) {
|
|
284
284
|
this.log(`${this.chalk('redBright', 'Trigger creation failed.')}`);
|
|
@@ -288,8 +288,9 @@ class AWSDeployer {
|
|
|
288
288
|
return response;
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
printSignature(url, s) {
|
|
291
|
+
printSignature(url, s, p) {
|
|
292
292
|
this.log(' ')
|
|
293
|
+
|
|
293
294
|
if (s.api && s.api.length > 0) {
|
|
294
295
|
this.log('API Gateway:');
|
|
295
296
|
s.api.forEach(a => this.log(` ${(' ' + a.verb.toUpperCase()).slice(-6)} ${url}${a.url}`), this);
|
|
@@ -326,10 +327,13 @@ class AWSDeployer {
|
|
|
326
327
|
this.log('');
|
|
327
328
|
}
|
|
328
329
|
|
|
329
|
-
if (
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
330
|
+
if (p.events && p.events.length > 0) {
|
|
331
|
+
const sqs = p.events.filter(i => i.source == 'sqs');
|
|
332
|
+
if (sqs && sqs.length > 0) {
|
|
333
|
+
this.log('SQS URL:');
|
|
334
|
+
sqs.forEach(a => this.log(` ${a.url}`), this);
|
|
335
|
+
this.log('');
|
|
336
|
+
}
|
|
333
337
|
}
|
|
334
338
|
|
|
335
339
|
if (s.alexa && s.alexa.length > 0) {
|
|
@@ -588,6 +592,7 @@ class AWSDeployer {
|
|
|
588
592
|
if (!params.events[i].stream) {
|
|
589
593
|
throw Error(`Missing Trigger Parameter: SQS Queue Url.`);
|
|
590
594
|
}
|
|
595
|
+
params.events[i].url = params.events[i].stream;
|
|
591
596
|
params.events[i].stream = await this.sqs.getQueueArn(
|
|
592
597
|
params.events[i].stream
|
|
593
598
|
);
|
package/src/app/main.js
CHANGED
|
@@ -314,7 +314,7 @@ ipcMain.on('restart-requested', async (event, msg) => {
|
|
|
314
314
|
// reload the nodes available in the palette
|
|
315
315
|
try {
|
|
316
316
|
await requestAsync({
|
|
317
|
-
uri: `http://127.0.0.1:${
|
|
317
|
+
uri: `http://127.0.0.1:${RUNTIME_PORT}/nodes-reload`,
|
|
318
318
|
method: 'POST',
|
|
319
319
|
json: true,
|
|
320
320
|
});
|
|
@@ -330,7 +330,7 @@ ipcMain.on('modal-node-library:restart-requested', async (event, msg) => {
|
|
|
330
330
|
// reload the nodes available in the palette
|
|
331
331
|
try {
|
|
332
332
|
await requestAsync({
|
|
333
|
-
uri: `http://127.0.0.1:${
|
|
333
|
+
uri: `http://127.0.0.1:${RUNTIME_PORT}/nodes-reload`,
|
|
334
334
|
method: 'POST',
|
|
335
335
|
json: true,
|
|
336
336
|
});
|