@kumologica/sdk 3.2.0-beta1 → 3.2.0-beta11
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/cli/commands/deploy-commands/kumohub.js +4 -2
- package/cli/commands/deploy.js +3 -2
- package/cli/commands/export-commands/github-commands/aws.js +374 -0
- package/cli/commands/export-commands/github.js +6 -0
- package/package.json +18 -8
- package/src/app/lib/aws/ca-sqs-api.js +5 -1
- package/src/app/lib/aws/index.js +135 -175
- package/src/app/lib/github/index.js +242 -0
- package/src/app/preload.js +11 -1
- package/src/app/ui/editor-client/public/red/red.js +295 -216
- package/src/app/ui/editor-client/public/red/red.min.js +1 -1
- package/src/app/ui/editor-client/public/vendor/jsonata/jsonata.min.js +8 -1
- package/src/app/ui/editor-client/src/js/ui/editors/expression.js +169 -141
- package/src/app/ui/editor-client/src/js/ui/tab-awsDeploy.js +126 -75
- package/src/app/ui/editor-client/src/vendor/jsonata/formatter.js +8 -1
|
@@ -118,6 +118,7 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
118
118
|
<span class="option-disabled">Generate script...</span>
|
|
119
119
|
<span id="exportCloudFormationBtn" class="option">AWS CloudFormation</span>
|
|
120
120
|
<span id="exportServerlessBtn" class="option">Serverless</span>
|
|
121
|
+
<span id="exportGithubActionBtn" class="option">Github Action Workflow</span>
|
|
121
122
|
</div>
|
|
122
123
|
</div>
|
|
123
124
|
</div>
|
|
@@ -181,6 +182,12 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
181
182
|
});
|
|
182
183
|
//tagsSection.expand();
|
|
183
184
|
|
|
185
|
+
// vpc section
|
|
186
|
+
vpcSection = sections.add({
|
|
187
|
+
title: 'vpc',
|
|
188
|
+
collapsible: true,
|
|
189
|
+
});
|
|
190
|
+
|
|
184
191
|
// event section
|
|
185
192
|
eventSection = sections.add({
|
|
186
193
|
title: 'Triggers',
|
|
@@ -203,7 +210,7 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
203
210
|
|
|
204
211
|
// Function content init
|
|
205
212
|
let functionSectionHtml = `
|
|
206
|
-
<table class="node-info">
|
|
213
|
+
<table class="node-info">
|
|
207
214
|
<tr class="node-info-node-row">
|
|
208
215
|
<td>Name</td>
|
|
209
216
|
<td colspan="2" style="background: white"><input style="width:100%" id="cloud-fn-name" class="palette-textinput" pattern="[a-zA-Z0-9-_]{1,64}" type="text"></td>
|
|
@@ -238,7 +245,10 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
238
245
|
</tr>
|
|
239
246
|
<tr class="node-info-node-row">
|
|
240
247
|
<td>Custom Role</td>
|
|
241
|
-
<td colspan="2" style="background: white; overflow-x:hidden"
|
|
248
|
+
<td colspan="2" style="background: white; overflow-x:hidden">
|
|
249
|
+
<input id="cloud-fn-role" list="iamroles-cloud-fn-role-dataList" style="width:100%" class="palette-textinput" placeHolder="optional" type="string">
|
|
250
|
+
<datalist id="iamroles-cloud-fn-role-dataList"></datalist>
|
|
251
|
+
</td>
|
|
242
252
|
</tr>
|
|
243
253
|
</table>
|
|
244
254
|
`;
|
|
@@ -283,6 +293,28 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
283
293
|
$(tagsSectionHtml).appendTo(tagsSection.content);
|
|
284
294
|
tagsSection.container.show();
|
|
285
295
|
|
|
296
|
+
// VPC section init
|
|
297
|
+
let vpcSectionHtml = `
|
|
298
|
+
<table class="node-info">
|
|
299
|
+
<tbody>
|
|
300
|
+
<tr class="node-info-node-row">
|
|
301
|
+
<td>Security Group Ids</td>
|
|
302
|
+
<td colspan="2" style="background: white; overflow-x:hidden">
|
|
303
|
+
<input id="cloud-fn-vpc-security-group" style="width:100%" class="palette-textinput" placeHolder="sg-11111, sg-22222" type="string">
|
|
304
|
+
</td>
|
|
305
|
+
</tr>
|
|
306
|
+
<tr class="node-info-node-row">
|
|
307
|
+
<td>Subnet Ids</td>
|
|
308
|
+
<td colspan="2" style="background: white; overflow-x:hidden">
|
|
309
|
+
<input id="cloud-fn-vpc-subnet" style="width:100%" class="palette-textinput" placeHolder="subnet-111, subnet-222" type="string">
|
|
310
|
+
</td>
|
|
311
|
+
</tr>
|
|
312
|
+
</tbody>
|
|
313
|
+
</table>
|
|
314
|
+
`;
|
|
315
|
+
$(vpcSectionHtml).appendTo(vpcSection.content);
|
|
316
|
+
vpcSection.container.show();
|
|
317
|
+
|
|
286
318
|
// Event section init
|
|
287
319
|
$(`
|
|
288
320
|
<div style="display:flex; flex-direction: column; justify-content: flex-start;">
|
|
@@ -292,10 +324,10 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
292
324
|
<option value="kinesis">Amazon Kinesis</option>
|
|
293
325
|
<option value="sqs">Amazon SQS</option>
|
|
294
326
|
<option disabled>────────────────────</option>
|
|
295
|
-
|
|
327
|
+
<!--option value="alb">Application Load Balancer</option-->
|
|
296
328
|
<!--option value="cognito">Amazon Cognito Sync Trigger</option-->
|
|
297
329
|
<!--option value="lex">Amazon Lex</option-->
|
|
298
|
-
|
|
330
|
+
<!--option value="alexa">Amazon Alexa</option-->
|
|
299
331
|
<option selected value="api">Amazon API Gateway</option>
|
|
300
332
|
<!--option value="cf">Amazon CloudFront (Lambda@Edge)</option-->
|
|
301
333
|
<!--option value="firehose">Amazon Kinesis Data Firehose</option-->
|
|
@@ -308,7 +340,7 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
308
340
|
<option value="cwevents">Amazon CloudWatch Events</option>
|
|
309
341
|
<!--option value="codecommit">Amazon CodeCommit</option-->
|
|
310
342
|
<!--option value="config">Amazon Config</option-->
|
|
311
|
-
|
|
343
|
+
<!--option value="iot">Amazon IoT Events</option-->
|
|
312
344
|
</select>
|
|
313
345
|
|
|
314
346
|
<a id="add-event" href="#" style="float: right; margin: 0px 0px 0px 5px !important; height: 21px !important;" class="editor-button editor-button-small">
|
|
@@ -397,6 +429,12 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
397
429
|
if (params.timeout) {
|
|
398
430
|
$('#cloud-fn-timeout').val(params.timeout);
|
|
399
431
|
}
|
|
432
|
+
if (params.vpcConfig && params.vpcConfig.sg) {
|
|
433
|
+
$('#cloud-fn-vpc-security-group').val(params.vpcConfig.sg);
|
|
434
|
+
}
|
|
435
|
+
if (params.vpcConfig && params.vpcConfig.sn) {
|
|
436
|
+
$('#cloud-fn-vpc-subnet').val(params.vpcConfig.sn);
|
|
437
|
+
}
|
|
400
438
|
if (params.reservedConcurrency) {
|
|
401
439
|
$('#cloud-fn-reservedConcurrency').val(params.reservedConcurrency);
|
|
402
440
|
}
|
|
@@ -454,7 +492,11 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
454
492
|
let fnXray = $('#cloud-fn-x-ray').prop('checked');
|
|
455
493
|
let fnProfile = getProfile();
|
|
456
494
|
let fnRole = $('#cloud-fn-role').val();
|
|
457
|
-
|
|
495
|
+
let fnVpcConfig = {
|
|
496
|
+
sg: $('#cloud-fn-vpc-security-group').val(),
|
|
497
|
+
sn: $('#cloud-fn-vpc-subnet').val()
|
|
498
|
+
};
|
|
499
|
+
|
|
458
500
|
// Environment variables
|
|
459
501
|
let environment = [];
|
|
460
502
|
let envvarRows = $('#cloud-fn-env-table tr');
|
|
@@ -506,7 +548,7 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
506
548
|
events.push(event);
|
|
507
549
|
});
|
|
508
550
|
|
|
509
|
-
|
|
551
|
+
const res = {
|
|
510
552
|
functionName: fnName,
|
|
511
553
|
description: fnDescription,
|
|
512
554
|
memory: fnMemory,
|
|
@@ -518,7 +560,10 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
518
560
|
environment: environment,
|
|
519
561
|
tags: tags,
|
|
520
562
|
events: events,
|
|
563
|
+
vpcConfig: fnVpcConfig
|
|
521
564
|
};
|
|
565
|
+
|
|
566
|
+
return res;
|
|
522
567
|
}
|
|
523
568
|
|
|
524
569
|
async function attachDataList(serviceType, itemId, dataListId) {
|
|
@@ -790,8 +835,7 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
790
835
|
$('#cloud-fn-memory').val('512');
|
|
791
836
|
$('#cloud-fn-timeout').val('20');
|
|
792
837
|
|
|
793
|
-
$('#cloud-fn-timeout, #cloud-fn-memory, #cloud-fn-description, #cloud-fn-name, #cloud-fn-reservedConcurrency, #cloud-fn-x-ray, #cloud-fn-role'
|
|
794
|
-
).change(function () {
|
|
838
|
+
$('#cloud-fn-timeout, #cloud-fn-memory, #cloud-fn-description, #cloud-fn-name, #cloud-fn-reservedConcurrency, #cloud-fn-x-ray, #cloud-fn-role, #cloud-fn-vpc-subnet, #cloud-fn-security-group').change(function () {
|
|
795
839
|
saveSettings();
|
|
796
840
|
});
|
|
797
841
|
|
|
@@ -960,6 +1004,14 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
960
1004
|
exportScript(window.__kumologica.cloud.provider.serverless);
|
|
961
1005
|
});
|
|
962
1006
|
|
|
1007
|
+
// Export serverless script
|
|
1008
|
+
$('#exportGithubActionBtn').click((e) => {
|
|
1009
|
+
e.preventDefault();
|
|
1010
|
+
hideMenu();
|
|
1011
|
+
exportScript(window.__kumologica.cloud.provider.github);
|
|
1012
|
+
});
|
|
1013
|
+
|
|
1014
|
+
|
|
963
1015
|
$('#cloud-options-dropdown').click((e) => {
|
|
964
1016
|
e.stopPropagation();
|
|
965
1017
|
|
|
@@ -1307,19 +1359,19 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
1307
1359
|
function: 'attachDataList',
|
|
1308
1360
|
},
|
|
1309
1361
|
];
|
|
1310
|
-
parameterSets['cognito'] = [
|
|
1311
|
-
|
|
1312
|
-
];
|
|
1313
|
-
parameterSets['iot'] = [
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
];
|
|
1362
|
+
//parameterSets['cognito'] = [
|
|
1363
|
+
// { label: 'Identity Pool ARN', key: 'identityPool', value: '' },
|
|
1364
|
+
//];
|
|
1365
|
+
//parameterSets['iot'] = [
|
|
1366
|
+
// {
|
|
1367
|
+
// label: 'Rule Name',
|
|
1368
|
+
// key: 'rule',
|
|
1369
|
+
// value: '',
|
|
1370
|
+
// required: true,
|
|
1371
|
+
// function: 'attachDataList',
|
|
1372
|
+
// },
|
|
1373
|
+
// { label: 'Query', key: 'query', value: '', required: true },
|
|
1374
|
+
//];
|
|
1323
1375
|
parameterSets['api'] = [
|
|
1324
1376
|
{
|
|
1325
1377
|
label: 'API',
|
|
@@ -1328,7 +1380,10 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
1328
1380
|
required: true,
|
|
1329
1381
|
function: 'attachDataList',
|
|
1330
1382
|
},
|
|
1331
|
-
{ label: 'Deployment Stage', key: 'stage', value: '', required: true }
|
|
1383
|
+
{ label: 'Deployment Stage', key: 'stage', value: '', required: true },
|
|
1384
|
+
{ label: 'Parent Id', key: 'parentId', value: '', required: false },
|
|
1385
|
+
{ label: 'Resource', key: 'resource', value: '', required: false },
|
|
1386
|
+
{ label: 'Authorizer Id', key: 'authorizerId', value: '', required: false }
|
|
1332
1387
|
];
|
|
1333
1388
|
parameterSets['alb'] = [
|
|
1334
1389
|
{
|
|
@@ -1344,23 +1399,23 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
1344
1399
|
];
|
|
1345
1400
|
parameterSets['sqs'] = [
|
|
1346
1401
|
{
|
|
1347
|
-
label: 'Queue
|
|
1348
|
-
key: '
|
|
1402
|
+
label: 'Queue Arn',
|
|
1403
|
+
key: 'queueArn',
|
|
1349
1404
|
value: '',
|
|
1350
1405
|
required: true,
|
|
1351
1406
|
function: 'attachDataList',
|
|
1352
1407
|
},
|
|
1353
1408
|
{ label: 'Batch Size', key: 'batchSize', value: '', min: 1, max: 10 },
|
|
1354
1409
|
];
|
|
1355
|
-
parameterSets['alexa'] = [
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
];
|
|
1410
|
+
//parameterSets['alexa'] = [
|
|
1411
|
+
// {
|
|
1412
|
+
// label: 'Skill ID',
|
|
1413
|
+
// key: 'skillID',
|
|
1414
|
+
// value: '',
|
|
1415
|
+
// required: true,
|
|
1416
|
+
// function: 'attachDataList',
|
|
1417
|
+
// },
|
|
1418
|
+
//];
|
|
1364
1419
|
parameterSets['kinesis'] = [
|
|
1365
1420
|
{ label: 'Stream ARN', key: 'stream', value: '', required: true },
|
|
1366
1421
|
{ label: 'Batch Size', key: 'batchSize', value: '', min: 1, max: 10000 },
|
|
@@ -1377,48 +1432,44 @@ RED.sidebar.awsDeploy = (function () {
|
|
|
1377
1432
|
},
|
|
1378
1433
|
];
|
|
1379
1434
|
parameterSets['cwevents'] = [
|
|
1380
|
-
{
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
value: '',
|
|
1384
|
-
required: true,
|
|
1385
|
-
function: 'attachDataList',
|
|
1386
|
-
},
|
|
1387
|
-
];
|
|
1388
|
-
parameterSets['cwlogs'] = [
|
|
1389
|
-
{
|
|
1390
|
-
label: 'Log Group',
|
|
1391
|
-
key: 'logGroup',
|
|
1392
|
-
value: '',
|
|
1393
|
-
required: true,
|
|
1394
|
-
function: 'attachDataList',
|
|
1395
|
-
},
|
|
1396
|
-
{ label: 'Filter Name', key: 'filterName', value: '' },
|
|
1397
|
-
{ label: 'Filter Pattern', key: 'filterPattern', value: '' },
|
|
1398
|
-
];
|
|
1399
|
-
parameterSets['codecommit'] = [
|
|
1400
|
-
{
|
|
1401
|
-
label: 'Repository Name',
|
|
1402
|
-
key: 'repository',
|
|
1403
|
-
value: '',
|
|
1404
|
-
required: true,
|
|
1405
|
-
function: 'attachDataList',
|
|
1406
|
-
},
|
|
1407
|
-
{ label: 'Trigger Name', key: 'trigger', value: '', required: true },
|
|
1408
|
-
{
|
|
1409
|
-
label: 'Events',
|
|
1410
|
-
key: 'events',
|
|
1411
|
-
value: '',
|
|
1412
|
-
list: [
|
|
1413
|
-
{ k: 'all', v: 'all' },
|
|
1414
|
-
{ k: 'updateReference', v: 'updateReference' },
|
|
1415
|
-
{ k: 'createReference', v: 'createReference' },
|
|
1416
|
-
{ k: 'deleteReference', v: 'deleteReference' },
|
|
1417
|
-
],
|
|
1418
|
-
},
|
|
1419
|
-
{ label: 'Branch Names', key: 'branchNames', value: '' },
|
|
1420
|
-
{ label: 'Custom Data', key: 'customData', value: '' },
|
|
1435
|
+
{ label: 'Expression', key: 'expression', value: 'cron()', required: true },
|
|
1436
|
+
{ label: 'Reference', key: 'reference', value: '' },
|
|
1437
|
+
{ label: 'Name', key: 'name', value: ''}
|
|
1421
1438
|
];
|
|
1439
|
+
//parameterSets['cwlogs'] = [
|
|
1440
|
+
// {
|
|
1441
|
+
// label: 'Log Group',
|
|
1442
|
+
// key: 'logGroup',
|
|
1443
|
+
// value: '',
|
|
1444
|
+
// required: true,
|
|
1445
|
+
// function: 'attachDataList',
|
|
1446
|
+
// },
|
|
1447
|
+
// { label: 'Filter Name', key: 'filterName', value: '' },
|
|
1448
|
+
// { label: 'Filter Pattern', key: 'filterPattern', value: '' },
|
|
1449
|
+
//];
|
|
1450
|
+
//parameterSets['codecommit'] = [
|
|
1451
|
+
// {
|
|
1452
|
+
// label: 'Repository Name',
|
|
1453
|
+
// key: 'repository',
|
|
1454
|
+
// value: '',
|
|
1455
|
+
// required: true,
|
|
1456
|
+
// function: 'attachDataList',
|
|
1457
|
+
// },
|
|
1458
|
+
// { label: 'Trigger Name', key: 'trigger', value: '', required: true },
|
|
1459
|
+
// {
|
|
1460
|
+
// label: 'Events',
|
|
1461
|
+
// key: 'events',
|
|
1462
|
+
// value: '',
|
|
1463
|
+
// list: [
|
|
1464
|
+
// { k: 'all', v: 'all' },
|
|
1465
|
+
// { k: 'updateReference', v: 'updateReference' },
|
|
1466
|
+
// { k: 'createReference', v: 'createReference' },
|
|
1467
|
+
// { k: 'deleteReference', v: 'deleteReference' },
|
|
1468
|
+
// ],
|
|
1469
|
+
// },
|
|
1470
|
+
// { label: 'Branch Names', key: 'branchNames', value: '' },
|
|
1471
|
+
// { label: 'Custom Data', key: 'customData', value: '' },
|
|
1472
|
+
//];
|
|
1422
1473
|
|
|
1423
1474
|
return {
|
|
1424
1475
|
init: init,
|
|
@@ -166,7 +166,14 @@
|
|
|
166
166
|
'$uppercase':{ args:[ 'str' ]},
|
|
167
167
|
'$zip':{ args:[ 'array1' ]},
|
|
168
168
|
'$vars': {args:['string']},
|
|
169
|
-
'$single': {args:['array','function']}
|
|
169
|
+
'$single': {args:['array','function']},
|
|
170
|
+
'$maskjson':{ args:[ 'object','object' ]},
|
|
171
|
+
'$maskemail':{ args:[ 'string','object' ]},
|
|
172
|
+
'$maskcard':{ args:[ 'string','object' ]},
|
|
173
|
+
'$maskphone':{ args:[ 'string','object' ]},
|
|
174
|
+
'$maskpassword':{ args:[ 'string','object' ]},
|
|
175
|
+
'$queryparam': { args:[ 'string']},
|
|
176
|
+
'$uriparam': { args:[ 'string']}
|
|
170
177
|
}
|
|
171
178
|
jsonata.getFunctionSnippet = function(fn) {
|
|
172
179
|
var snippetText = "";
|