@kumologica/sdk 3.2.0-beta10 → 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.
@@ -37,6 +37,7 @@ const { NetworkConfigStore } = require('./lib/stores/settings-network-store');
37
37
  const AWSProfile = require('./lib/aws/aws-profile');
38
38
  const AWSDeployer = require('./lib/aws');
39
39
  const ServerlessDeployer = require('./lib/serverless');
40
+ const GithubDeployer = require('./lib/github');
40
41
 
41
42
  const Kumohub = require('./lib/kumohub');
42
43
  const deployCli = require('@kumologica/builder');
@@ -48,6 +49,7 @@ const terminalEmitter = new events.EventEmitter();
48
49
  const awsDeployer = new AWSDeployer(terminalEmitter);
49
50
  const awsProfile = new AWSProfile();
50
51
  const serverlessDeployer = new ServerlessDeployer(terminalEmitter);
52
+ const githubDeployer = new GithubDeployer(terminalEmitter);
51
53
 
52
54
  const kumohub = new Kumohub(terminalEmitter);
53
55
 
@@ -133,12 +135,18 @@ async function generateScript(provider, projectInfo, params) {
133
135
  params,
134
136
  alias.profile
135
137
  );
136
- } else if (provider ==window.__kumologica.cloud.provider.serverless) {
138
+ } else if (provider == window.__kumologica.cloud.provider.serverless) {
137
139
  await serverlessDeployer.generateScript(
138
140
  projectInfo,
139
141
  params,
140
142
  alias.profile
141
143
  );
144
+ } else if (provider == window.__kumologica.cloud.provider.github) {
145
+ await githubDeployer.generateScript(
146
+ projectInfo,
147
+ params,
148
+ alias.profile
149
+ );
142
150
  }
143
151
  }
144
152
 
@@ -586,6 +594,8 @@ window.__kumologica.runtime.port = port;
586
594
  window.__kumologica.cloud = {provider: {}};
587
595
  window.__kumologica.cloud.provider.aws = "AWS";
588
596
  window.__kumologica.cloud.provider.serverless = "SERVERLESS";
597
+ window.__kumologica.cloud.provider.github = "GITHUB";
598
+
589
599
  window.__kumologica.cloud.profile = undefined;
590
600
  window.__kumologica.cloud.deploy = deploy;
591
601
  window.__kumologica.cloud.generateScript = generateScript;
@@ -22006,6 +22006,7 @@ RED.view.tools = (function() {
22006
22006
  <span class="option-disabled">Generate script...</span>
22007
22007
  <span id="exportCloudFormationBtn" class="option">AWS CloudFormation</span>
22008
22008
  <span id="exportServerlessBtn" class="option">Serverless</span>
22009
+ <span id="exportGithubActionBtn" class="option">Github Action Workflow</span>
22009
22010
  </div>
22010
22011
  </div>
22011
22012
  </div>
@@ -22069,6 +22070,12 @@ RED.view.tools = (function() {
22069
22070
  });
22070
22071
  //tagsSection.expand();
22071
22072
 
22073
+ // vpc section
22074
+ vpcSection = sections.add({
22075
+ title: 'vpc',
22076
+ collapsible: true,
22077
+ });
22078
+
22072
22079
  // event section
22073
22080
  eventSection = sections.add({
22074
22081
  title: 'Triggers',
@@ -22091,7 +22098,7 @@ RED.view.tools = (function() {
22091
22098
 
22092
22099
  // Function content init
22093
22100
  let functionSectionHtml = `
22094
- <table class="node-info">
22101
+ <table class="node-info">
22095
22102
  <tr class="node-info-node-row">
22096
22103
  <td>Name</td>
22097
22104
  <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>
@@ -22126,7 +22133,10 @@ RED.view.tools = (function() {
22126
22133
  </tr>
22127
22134
  <tr class="node-info-node-row">
22128
22135
  <td>Custom Role</td>
22129
- <td colspan="2" style="background: white; overflow-x:hidden"><input id="cloud-fn-role" list="iamroles-cloud-fn-role-dataList" style="width:100%" class="palette-textinput" placeHolder="optional" type="string"><datalist id="iamroles-cloud-fn-role-dataList"></datalist></td>
22136
+ <td colspan="2" style="background: white; overflow-x:hidden">
22137
+ <input id="cloud-fn-role" list="iamroles-cloud-fn-role-dataList" style="width:100%" class="palette-textinput" placeHolder="optional" type="string">
22138
+ <datalist id="iamroles-cloud-fn-role-dataList"></datalist>
22139
+ </td>
22130
22140
  </tr>
22131
22141
  </table>
22132
22142
  `;
@@ -22171,6 +22181,28 @@ RED.view.tools = (function() {
22171
22181
  $(tagsSectionHtml).appendTo(tagsSection.content);
22172
22182
  tagsSection.container.show();
22173
22183
 
22184
+ // VPC section init
22185
+ let vpcSectionHtml = `
22186
+ <table class="node-info">
22187
+ <tbody>
22188
+ <tr class="node-info-node-row">
22189
+ <td>Security Group Ids</td>
22190
+ <td colspan="2" style="background: white; overflow-x:hidden">
22191
+ <input id="cloud-fn-vpc-security-group" style="width:100%" class="palette-textinput" placeHolder="sg-11111, sg-22222" type="string">
22192
+ </td>
22193
+ </tr>
22194
+ <tr class="node-info-node-row">
22195
+ <td>Subnet Ids</td>
22196
+ <td colspan="2" style="background: white; overflow-x:hidden">
22197
+ <input id="cloud-fn-vpc-subnet" style="width:100%" class="palette-textinput" placeHolder="subnet-111, subnet-222" type="string">
22198
+ </td>
22199
+ </tr>
22200
+ </tbody>
22201
+ </table>
22202
+ `;
22203
+ $(vpcSectionHtml).appendTo(vpcSection.content);
22204
+ vpcSection.container.show();
22205
+
22174
22206
  // Event section init
22175
22207
  $(`
22176
22208
  <div style="display:flex; flex-direction: column; justify-content: flex-start;">
@@ -22180,10 +22212,10 @@ RED.view.tools = (function() {
22180
22212
  <option value="kinesis">Amazon Kinesis</option>
22181
22213
  <option value="sqs">Amazon SQS</option>
22182
22214
  <option disabled>────────────────────</option>
22183
- <option value="alb">Application Load Balancer</option>
22215
+ <!--option value="alb">Application Load Balancer</option-->
22184
22216
  <!--option value="cognito">Amazon Cognito Sync Trigger</option-->
22185
22217
  <!--option value="lex">Amazon Lex</option-->
22186
- <option value="alexa">Amazon Alexa</option>
22218
+ <!--option value="alexa">Amazon Alexa</option-->
22187
22219
  <option selected value="api">Amazon API Gateway</option>
22188
22220
  <!--option value="cf">Amazon CloudFront (Lambda@Edge)</option-->
22189
22221
  <!--option value="firehose">Amazon Kinesis Data Firehose</option-->
@@ -22196,7 +22228,7 @@ RED.view.tools = (function() {
22196
22228
  <option value="cwevents">Amazon CloudWatch Events</option>
22197
22229
  <!--option value="codecommit">Amazon CodeCommit</option-->
22198
22230
  <!--option value="config">Amazon Config</option-->
22199
- <option value="iot">Amazon IoT Events</option>
22231
+ <!--option value="iot">Amazon IoT Events</option-->
22200
22232
  </select>
22201
22233
 
22202
22234
  <a id="add-event" href="#" style="float: right; margin: 0px 0px 0px 5px !important; height: 21px !important;" class="editor-button editor-button-small">
@@ -22285,6 +22317,12 @@ RED.view.tools = (function() {
22285
22317
  if (params.timeout) {
22286
22318
  $('#cloud-fn-timeout').val(params.timeout);
22287
22319
  }
22320
+ if (params.vpcConfig && params.vpcConfig.sg) {
22321
+ $('#cloud-fn-vpc-security-group').val(params.vpcConfig.sg);
22322
+ }
22323
+ if (params.vpcConfig && params.vpcConfig.sn) {
22324
+ $('#cloud-fn-vpc-subnet').val(params.vpcConfig.sn);
22325
+ }
22288
22326
  if (params.reservedConcurrency) {
22289
22327
  $('#cloud-fn-reservedConcurrency').val(params.reservedConcurrency);
22290
22328
  }
@@ -22342,7 +22380,11 @@ RED.view.tools = (function() {
22342
22380
  let fnXray = $('#cloud-fn-x-ray').prop('checked');
22343
22381
  let fnProfile = getProfile();
22344
22382
  let fnRole = $('#cloud-fn-role').val();
22345
-
22383
+ let fnVpcConfig = {
22384
+ sg: $('#cloud-fn-vpc-security-group').val(),
22385
+ sn: $('#cloud-fn-vpc-subnet').val()
22386
+ };
22387
+
22346
22388
  // Environment variables
22347
22389
  let environment = [];
22348
22390
  let envvarRows = $('#cloud-fn-env-table tr');
@@ -22394,7 +22436,7 @@ RED.view.tools = (function() {
22394
22436
  events.push(event);
22395
22437
  });
22396
22438
 
22397
- return {
22439
+ const res = {
22398
22440
  functionName: fnName,
22399
22441
  description: fnDescription,
22400
22442
  memory: fnMemory,
@@ -22406,7 +22448,10 @@ RED.view.tools = (function() {
22406
22448
  environment: environment,
22407
22449
  tags: tags,
22408
22450
  events: events,
22451
+ vpcConfig: fnVpcConfig
22409
22452
  };
22453
+
22454
+ return res;
22410
22455
  }
22411
22456
 
22412
22457
  async function attachDataList(serviceType, itemId, dataListId) {
@@ -22678,8 +22723,7 @@ RED.view.tools = (function() {
22678
22723
  $('#cloud-fn-memory').val('512');
22679
22724
  $('#cloud-fn-timeout').val('20');
22680
22725
 
22681
- $('#cloud-fn-timeout, #cloud-fn-memory, #cloud-fn-description, #cloud-fn-name, #cloud-fn-reservedConcurrency, #cloud-fn-x-ray, #cloud-fn-role'
22682
- ).change(function () {
22726
+ $('#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 () {
22683
22727
  saveSettings();
22684
22728
  });
22685
22729
 
@@ -22848,6 +22892,14 @@ RED.view.tools = (function() {
22848
22892
  exportScript(window.__kumologica.cloud.provider.serverless);
22849
22893
  });
22850
22894
 
22895
+ // Export serverless script
22896
+ $('#exportGithubActionBtn').click((e) => {
22897
+ e.preventDefault();
22898
+ hideMenu();
22899
+ exportScript(window.__kumologica.cloud.provider.github);
22900
+ });
22901
+
22902
+
22851
22903
  $('#cloud-options-dropdown').click((e) => {
22852
22904
  e.stopPropagation();
22853
22905
 
@@ -23195,19 +23247,19 @@ RED.view.tools = (function() {
23195
23247
  function: 'attachDataList',
23196
23248
  },
23197
23249
  ];
23198
- parameterSets['cognito'] = [
23199
- { label: 'Identity Pool ARN', key: 'identityPool', value: '' },
23200
- ];
23201
- parameterSets['iot'] = [
23202
- {
23203
- label: 'Rule Name',
23204
- key: 'rule',
23205
- value: '',
23206
- required: true,
23207
- function: 'attachDataList',
23208
- },
23209
- { label: 'Query', key: 'query', value: '', required: true },
23210
- ];
23250
+ //parameterSets['cognito'] = [
23251
+ // { label: 'Identity Pool ARN', key: 'identityPool', value: '' },
23252
+ //];
23253
+ //parameterSets['iot'] = [
23254
+ // {
23255
+ // label: 'Rule Name',
23256
+ // key: 'rule',
23257
+ // value: '',
23258
+ // required: true,
23259
+ // function: 'attachDataList',
23260
+ // },
23261
+ // { label: 'Query', key: 'query', value: '', required: true },
23262
+ //];
23211
23263
  parameterSets['api'] = [
23212
23264
  {
23213
23265
  label: 'API',
@@ -23216,7 +23268,10 @@ RED.view.tools = (function() {
23216
23268
  required: true,
23217
23269
  function: 'attachDataList',
23218
23270
  },
23219
- { label: 'Deployment Stage', key: 'stage', value: '', required: true }
23271
+ { label: 'Deployment Stage', key: 'stage', value: '', required: true },
23272
+ { label: 'Parent Id', key: 'parentId', value: '', required: false },
23273
+ { label: 'Resource', key: 'resource', value: '', required: false },
23274
+ { label: 'Authorizer Id', key: 'authorizerId', value: '', required: false }
23220
23275
  ];
23221
23276
  parameterSets['alb'] = [
23222
23277
  {
@@ -23232,23 +23287,23 @@ RED.view.tools = (function() {
23232
23287
  ];
23233
23288
  parameterSets['sqs'] = [
23234
23289
  {
23235
- label: 'Queue URL',
23236
- key: 'stream',
23290
+ label: 'Queue Arn',
23291
+ key: 'queueArn',
23237
23292
  value: '',
23238
23293
  required: true,
23239
23294
  function: 'attachDataList',
23240
23295
  },
23241
23296
  { label: 'Batch Size', key: 'batchSize', value: '', min: 1, max: 10 },
23242
23297
  ];
23243
- parameterSets['alexa'] = [
23244
- {
23245
- label: 'Skill ID',
23246
- key: 'skillID',
23247
- value: '',
23248
- required: true,
23249
- function: 'attachDataList',
23250
- },
23251
- ];
23298
+ //parameterSets['alexa'] = [
23299
+ // {
23300
+ // label: 'Skill ID',
23301
+ // key: 'skillID',
23302
+ // value: '',
23303
+ // required: true,
23304
+ // function: 'attachDataList',
23305
+ // },
23306
+ //];
23252
23307
  parameterSets['kinesis'] = [
23253
23308
  { label: 'Stream ARN', key: 'stream', value: '', required: true },
23254
23309
  { label: 'Batch Size', key: 'batchSize', value: '', min: 1, max: 10000 },
@@ -23265,48 +23320,44 @@ RED.view.tools = (function() {
23265
23320
  },
23266
23321
  ];
23267
23322
  parameterSets['cwevents'] = [
23268
- {
23269
- label: 'Rule ARN',
23270
- key: 'rule',
23271
- value: '',
23272
- required: true,
23273
- function: 'attachDataList',
23274
- },
23275
- ];
23276
- parameterSets['cwlogs'] = [
23277
- {
23278
- label: 'Log Group',
23279
- key: 'logGroup',
23280
- value: '',
23281
- required: true,
23282
- function: 'attachDataList',
23283
- },
23284
- { label: 'Filter Name', key: 'filterName', value: '' },
23285
- { label: 'Filter Pattern', key: 'filterPattern', value: '' },
23286
- ];
23287
- parameterSets['codecommit'] = [
23288
- {
23289
- label: 'Repository Name',
23290
- key: 'repository',
23291
- value: '',
23292
- required: true,
23293
- function: 'attachDataList',
23294
- },
23295
- { label: 'Trigger Name', key: 'trigger', value: '', required: true },
23296
- {
23297
- label: 'Events',
23298
- key: 'events',
23299
- value: '',
23300
- list: [
23301
- { k: 'all', v: 'all' },
23302
- { k: 'updateReference', v: 'updateReference' },
23303
- { k: 'createReference', v: 'createReference' },
23304
- { k: 'deleteReference', v: 'deleteReference' },
23305
- ],
23306
- },
23307
- { label: 'Branch Names', key: 'branchNames', value: '' },
23308
- { label: 'Custom Data', key: 'customData', value: '' },
23323
+ { label: 'Expression', key: 'expression', value: 'cron()', required: true },
23324
+ { label: 'Reference', key: 'reference', value: '' },
23325
+ { label: 'Name', key: 'name', value: ''}
23309
23326
  ];
23327
+ //parameterSets['cwlogs'] = [
23328
+ // {
23329
+ // label: 'Log Group',
23330
+ // key: 'logGroup',
23331
+ // value: '',
23332
+ // required: true,
23333
+ // function: 'attachDataList',
23334
+ // },
23335
+ // { label: 'Filter Name', key: 'filterName', value: '' },
23336
+ // { label: 'Filter Pattern', key: 'filterPattern', value: '' },
23337
+ //];
23338
+ //parameterSets['codecommit'] = [
23339
+ // {
23340
+ // label: 'Repository Name',
23341
+ // key: 'repository',
23342
+ // value: '',
23343
+ // required: true,
23344
+ // function: 'attachDataList',
23345
+ // },
23346
+ // { label: 'Trigger Name', key: 'trigger', value: '', required: true },
23347
+ // {
23348
+ // label: 'Events',
23349
+ // key: 'events',
23350
+ // value: '',
23351
+ // list: [
23352
+ // { k: 'all', v: 'all' },
23353
+ // { k: 'updateReference', v: 'updateReference' },
23354
+ // { k: 'createReference', v: 'createReference' },
23355
+ // { k: 'deleteReference', v: 'deleteReference' },
23356
+ // ],
23357
+ // },
23358
+ // { label: 'Branch Names', key: 'branchNames', value: '' },
23359
+ // { label: 'Custom Data', key: 'customData', value: '' },
23360
+ //];
23310
23361
 
23311
23362
  return {
23312
23363
  init: init,