@kumologica/sdk 3.2.0-beta12 → 3.2.0-beta14

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.
@@ -158,14 +158,15 @@ Examples:
158
158
  Cloudwatch Event:\n-----------------
159
159
  * schedule - cron expression (minutes hours days-of-month month days-of-week year) or fixed rate expression, required.\n See more: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html
160
160
  * name - the name of event, optional, default value: Event+timestamp if not provided
161
+ * state - state of event rule: ENABLED or DISABLED, default ENABLED
161
162
  * reference - the reference property set for event listener node that should handle event. Optional
162
163
 
163
164
  Examples:
164
165
  1. Creates event trigger using cron expression that runs at 10am UTC every day:\n
165
166
  {"event": {"expression": "cron(0 10 * * ? *)"}}
166
167
 
167
- 2. Creates event trigger using rate expression that runs every minute:\n
168
- {"event": {"expression": "rate(1 minute)"}}\n
168
+ 2. Creates event trigger using rate expression that runs every minute and is initially disabled:\n
169
+ {"event": {"expression": "rate(1 minute), "state": "DISABLED"}}\n
169
170
 
170
171
  3. Creates event trigger using rate expression that runs every minute for event listener with reference "cleanup":\n
171
172
  {"event": {"expression": "rate(1 minute)", "reference": "cleanup"}}\n
@@ -29,6 +29,12 @@ const triggersSchema = {
29
29
  "title": "Event name",
30
30
  "type": "string"
31
31
  },
32
+ "state": {
33
+ "$id": "#root/items/event/state",
34
+ "title": "State",
35
+ "type": "string",
36
+ "enum": ["DISABLED", "ENABLED"]
37
+ },
32
38
  "reference": {
33
39
  "$id": "#root/items/event/reference",
34
40
  "title": "Event Listener reference",
@@ -168,8 +174,52 @@ const triggersSchema = {
168
174
  }
169
175
  }
170
176
  }
177
+ },
178
+ "websocket": {
179
+ "$id": "#root/items/websocket",
180
+ "title": "Api",
181
+ "type": "object",
182
+ required: [],
183
+ additionalProperties: false,
184
+ required: ["apiId"],
185
+ "properties": {
186
+ "apiId": {
187
+ "$id": "#root/items/websocket/apiId",
188
+ "title": "ApiId",
189
+ "type": "string",
190
+ "pattern": "^.*$"
191
+ },
192
+ "apiName": {
193
+ "$id": "#root/items/websocket/apiName",
194
+ "title": "ApiName",
195
+ "type": "string",
196
+ "pattern": "^.*$"
197
+ },
198
+ "stage": {
199
+ "$id": "#root/items/websocket/stage",
200
+ "title": "Stage",
201
+ "type": "string",
202
+ "pattern": "^.*$"
203
+ },
204
+ "authorizerId": {
205
+ "$id": "#root/items/websocket/authorizerId",
206
+ "title": "Authorizerid",
207
+ "type": "string",
208
+ "pattern": "^.*$"
209
+ },
210
+ "authorizerType": {
211
+ "$id": "#root/items/websocket/authorizerType",
212
+ "title": "AuthorizerType",
213
+ "type": "string",
214
+ "pattern": "^.*$"
215
+ },
216
+ "apiKeyRequired": {
217
+ "$id": "#root/items/websocket/apiKeyRequired",
218
+ "title": "ApiKeyRequired",
219
+ "type": "boolean"
220
+ }
221
+ }
171
222
  }
172
-
173
223
  }
174
224
  }
175
225
  };
Binary file
@@ -0,0 +1,23 @@
1
+ {
2
+ "test": {
3
+ "testcase": "e8fb91dc.46c24",
4
+ "environment": "debug",
5
+ "environments": [
6
+ "; ===========================================================",
7
+ "; Environment variables must be defined under one section",
8
+ "; You can define as many sections as you need.",
9
+ "; (Remove the semicolons to uncomment the lines)",
10
+ "; ===========================================================",
11
+ "",
12
+ "; Example:",
13
+ "",
14
+ "[debug]",
15
+ "KUMOLOGICA_LOGLEVEL=DEBUG",
16
+ "",
17
+ "[trace]",
18
+ "KUMOLOGICA_LOGLEVEL=TRACE",
19
+ "; VAR_1=VALUE_1",
20
+ ""
21
+ ]
22
+ }
23
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.0.1",
3
+ "runtime": {
4
+ "loglevel": "info",
5
+ "middlewares": [],
6
+ "plugins": []
7
+ }
8
+ }
9
+
@@ -0,0 +1,442 @@
1
+ [
2
+ {
3
+ "id": "main.flow",
4
+ "type": "tab",
5
+ "label": "main",
6
+ "disabled": false,
7
+ "info": ""
8
+ },
9
+ {
10
+ "id": "test.flow",
11
+ "type": "tab",
12
+ "label": "test",
13
+ "disabled": false,
14
+ "info": ""
15
+ },
16
+ {
17
+ "id": "283c13ba.9eb71c",
18
+ "type": "tab",
19
+ "label": "error-handling",
20
+ "disabled": false,
21
+ "info": ""
22
+ },
23
+ {
24
+ "id": "a37e6a08.e6b738",
25
+ "type": "tab",
26
+ "label": "final-one",
27
+ "disabled": false,
28
+ "info": ""
29
+ },
30
+ {
31
+ "id": "6209bce6.6d3014",
32
+ "type": "tab",
33
+ "label": "tab1",
34
+ "disabled": false,
35
+ "info": ""
36
+ },
37
+ {
38
+ "id": "796666d7.f4deb8",
39
+ "type": "tab",
40
+ "label": "tab2",
41
+ "disabled": false,
42
+ "info": ""
43
+ },
44
+ {
45
+ "id": "e4c443ff.72648",
46
+ "type": "tab",
47
+ "label": "tab3",
48
+ "disabled": false,
49
+ "info": ""
50
+ },
51
+ {
52
+ "id": "3fd1e545.a74b1a",
53
+ "type": "tab",
54
+ "label": "tab4",
55
+ "disabled": false,
56
+ "info": ""
57
+ },
58
+ {
59
+ "id": "b47e62df.22d56",
60
+ "type": "tab",
61
+ "label": "tab-5",
62
+ "disabled": false,
63
+ "info": ""
64
+ },
65
+ {
66
+ "id": "3daf316c.c436de",
67
+ "type": "tab",
68
+ "label": "tab-6",
69
+ "disabled": false,
70
+ "info": ""
71
+ },
72
+ {
73
+ "id": "e50cfed9.d6c61",
74
+ "type": "tab",
75
+ "label": "tab-7",
76
+ "disabled": false,
77
+ "info": ""
78
+ },
79
+ {
80
+ "id": "3e91d1cd.26524e",
81
+ "type": "tab",
82
+ "label": "tab-8",
83
+ "disabled": false,
84
+ "info": ""
85
+ },
86
+ {
87
+ "id": "f8939646.251588",
88
+ "type": "tab",
89
+ "label": "tab-9",
90
+ "disabled": false,
91
+ "info": ""
92
+ },
93
+ {
94
+ "id": "10ff9dae.ea7292",
95
+ "type": "tab",
96
+ "label": "tab-10",
97
+ "disabled": false,
98
+ "info": ""
99
+ },
100
+ {
101
+ "id": "84e85bc4.a089a8",
102
+ "type": "tab",
103
+ "label": "tab-11",
104
+ "disabled": false,
105
+ "info": ""
106
+ },
107
+ {
108
+ "id": "eaa5bd78.1fa18",
109
+ "type": "tab",
110
+ "label": "tab-12",
111
+ "disabled": false,
112
+ "info": ""
113
+ },
114
+ {
115
+ "id": "341ad4b5.79ef4c",
116
+ "type": "tab",
117
+ "label": "tab-13",
118
+ "disabled": false,
119
+ "info": ""
120
+ },
121
+ {
122
+ "id": "eacbb9ef.69d5c8",
123
+ "type": "EventListener",
124
+ "z": "main.flow",
125
+ "name": "GET /hello",
126
+ "provider": "nodejs",
127
+ "eventSource": "api",
128
+ "dynamodbOperation": "",
129
+ "apiMethod": "any",
130
+ "apiUrl": "/hello/:name",
131
+ "albMethod": "any",
132
+ "albUrl": "",
133
+ "bucketName": "",
134
+ "prefix": "",
135
+ "suffix": "",
136
+ "event": "s3:ObjectCreated:*",
137
+ "cognitoTrigger": "any",
138
+ "reference": "",
139
+ "queueName": "",
140
+ "topicName": "",
141
+ "keventSource": "",
142
+ "kapiMethod": "any",
143
+ "kapiUrl": "",
144
+ "kcronexpression": "",
145
+ "kreference": "",
146
+ "kObjectStoreOperation": "all",
147
+ "kObjectStoreName": "",
148
+ "zeventSource": "zapi",
149
+ "zapiMethod": "get",
150
+ "zapiUrl": "",
151
+ "neventSource": "napi",
152
+ "napiMethod": "get",
153
+ "napiUrl": "/hello/:name",
154
+ "x": 72.5,
155
+ "y": 72.5,
156
+ "wires": [
157
+ [
158
+ "23323e00.0f5512"
159
+ ]
160
+ ],
161
+ "caname": "event-handler",
162
+ "category": "general"
163
+ },
164
+ {
165
+ "id": "5eb3cd61.894f04",
166
+ "type": "Logger",
167
+ "z": "main.flow",
168
+ "name": "Log",
169
+ "level": "INFO",
170
+ "message": "Request received",
171
+ "format": "string",
172
+ "headers": {},
173
+ "x": 262.5,
174
+ "y": 72.5,
175
+ "wires": [
176
+ [
177
+ "b5fc6ccd.17dd7"
178
+ ]
179
+ ],
180
+ "caname": "logger",
181
+ "category": "logging"
182
+ },
183
+ {
184
+ "id": "b5fc6ccd.17dd7",
185
+ "type": "EventListener-End",
186
+ "z": "main.flow",
187
+ "name": "Success",
188
+ "statusCode": "200",
189
+ "responseType": "http",
190
+ "headers": {
191
+ "Content-Type": "application/json"
192
+ },
193
+ "payload": "{\"hello\": \"world\"}",
194
+ "eventPayload": "",
195
+ "eventType": "success",
196
+ "x": 357.5,
197
+ "y": 72.5,
198
+ "wires": [],
199
+ "caname": "eventlistenerend",
200
+ "category": "general"
201
+ },
202
+ {
203
+ "id": "b970b7d2.5454c8",
204
+ "type": "Assertion",
205
+ "z": "test.flow",
206
+ "name": "check response",
207
+ "selector": "jsonBody",
208
+ "property": "hello",
209
+ "comparison": "equals",
210
+ "value": "world",
211
+ "x": 265,
212
+ "y": 160,
213
+ "wires": [
214
+ [
215
+ "e0721cc7.653eb"
216
+ ]
217
+ ],
218
+ "caname": "test-assertion",
219
+ "category": "testing"
220
+ },
221
+ {
222
+ "id": "e0721cc7.653eb",
223
+ "type": "TestCaseEnd",
224
+ "z": "test.flow",
225
+ "name": "TestCaseEnd",
226
+ "x": 425,
227
+ "y": 160,
228
+ "wires": [],
229
+ "caname": "test-case-end",
230
+ "category": "testing"
231
+ },
232
+ {
233
+ "id": "e8fb91dc.46c24",
234
+ "type": "HTTPTestCase",
235
+ "z": "test.flow",
236
+ "name": "HTTPTestCase",
237
+ "method": "GET",
238
+ "path": "/hello/javi",
239
+ "headers": {
240
+ "Accept": "application/json"
241
+ },
242
+ "authtype": "none",
243
+ "secUser": "",
244
+ "secPassword": "",
245
+ "secToken": "",
246
+ "payload": "",
247
+ "mocks": [],
248
+ "x": 122.5,
249
+ "y": 160,
250
+ "wires": [
251
+ [
252
+ "b970b7d2.5454c8"
253
+ ]
254
+ ],
255
+ "caname": "http-test-case",
256
+ "category": "testing"
257
+ },
258
+ {
259
+ "id": "23323e00.0f5512",
260
+ "type": "Function",
261
+ "z": "main.flow",
262
+ "name": "Function",
263
+ "noerr": 0,
264
+ "query": "throw new Error(\"Fuck you Wojtek\");",
265
+ "x": 167.5,
266
+ "y": 72.5,
267
+ "wires": [
268
+ [
269
+ "5eb3cd61.894f04"
270
+ ]
271
+ ],
272
+ "caname": "function",
273
+ "category": "transformation"
274
+ },
275
+ {
276
+ "id": "ca7e178c.7f8bd8",
277
+ "type": "Subflow_out",
278
+ "z": "283c13ba.9eb71c",
279
+ "name": "Back to main",
280
+ "links": [],
281
+ "x": 462.5,
282
+ "y": 140,
283
+ "wires": [],
284
+ "caname": "subflow",
285
+ "category": "routing"
286
+ },
287
+ {
288
+ "id": "72118f8f.ee832",
289
+ "type": "Logger",
290
+ "z": "283c13ba.9eb71c",
291
+ "name": "Logger",
292
+ "level": "INFO",
293
+ "message": "Error handled on subflow",
294
+ "format": "string",
295
+ "headers": {},
296
+ "x": 362.5,
297
+ "y": 140,
298
+ "wires": [
299
+ [
300
+ "ca7e178c.7f8bd8"
301
+ ]
302
+ ],
303
+ "caname": "logger",
304
+ "category": "logging"
305
+ },
306
+ {
307
+ "id": "b179322.7f582d",
308
+ "type": "Subflow_in",
309
+ "z": "283c13ba.9eb71c",
310
+ "name": "Subflow In",
311
+ "priority": "50",
312
+ "links": [],
313
+ "scope": "global",
314
+ "x": 222.5,
315
+ "y": 140,
316
+ "wires": [
317
+ [
318
+ "72118f8f.ee832"
319
+ ]
320
+ ],
321
+ "caname": "subflow",
322
+ "category": "routing"
323
+ },
324
+ {
325
+ "id": "1fbd6585.4b536a",
326
+ "type": "catch",
327
+ "z": "main.flow",
328
+ "name": "catch",
329
+ "scope": null,
330
+ "uncaught": false,
331
+ "x": 72.5,
332
+ "y": 167.5,
333
+ "wires": [
334
+ [
335
+ "1d0d9214.31d02e"
336
+ ]
337
+ ],
338
+ "caname": "catch",
339
+ "category": "exception"
340
+ },
341
+ {
342
+ "id": "1d0d9214.31d02e",
343
+ "type": "Subflow",
344
+ "z": "main.flow",
345
+ "untilproptype": "num",
346
+ "proptype": "msg",
347
+ "name": "Subflow",
348
+ "prop": "loop",
349
+ "untilprop": 0,
350
+ "until": "gt",
351
+ "loop": "none",
352
+ "scope": "global",
353
+ "perf": false,
354
+ "seq": false,
355
+ "selectedTargetNode": "b179322.7f582d",
356
+ "targetNode": "b179322.7f582d",
357
+ "initialLoad": "false",
358
+ "x": 167.5,
359
+ "y": 167.5,
360
+ "wires": [
361
+ [
362
+ "3131004.44ba8"
363
+ ]
364
+ ],
365
+ "caname": "subflow",
366
+ "category": "routing"
367
+ },
368
+ {
369
+ "id": "3131004.44ba8",
370
+ "type": "EventListener-End",
371
+ "z": "main.flow",
372
+ "name": "Success",
373
+ "statusCode": "400",
374
+ "headers": {
375
+ "Content-Type": "application/json"
376
+ },
377
+ "payload": "{\"hello\": \"world\"}",
378
+ "x": 262.5,
379
+ "y": 167.5,
380
+ "wires": [],
381
+ "caname": "eventlistenerend",
382
+ "category": "general"
383
+ },
384
+ {
385
+ "id": "27b6799f.7214f6",
386
+ "type": "EventListener",
387
+ "z": "main.flow",
388
+ "name": "GET /bye",
389
+ "provider": "aws",
390
+ "eventSource": "api",
391
+ "dynamodbOperation": "",
392
+ "apiMethod": "get",
393
+ "apiUrl": "/bye/:name",
394
+ "albMethod": "any",
395
+ "albUrl": "",
396
+ "bucketName": "",
397
+ "event": "s3:ObjectCreated:*",
398
+ "cognitoTrigger": "any",
399
+ "reference": "",
400
+ "queueName": "",
401
+ "topicName": "",
402
+ "keventSource": "",
403
+ "kapiMethod": "any",
404
+ "kapiUrl": "",
405
+ "kcronexpression": "",
406
+ "kreference": "",
407
+ "kObjectStoreOperation": "all",
408
+ "kObjectStoreName": "",
409
+ "zeventSource": "",
410
+ "zapiMethod": "any",
411
+ "zapiUrl": "",
412
+ "napiUrl": "",
413
+ "x": 82.5,
414
+ "y": 280,
415
+ "wires": [
416
+ [
417
+ "3dbda329.d0fedc"
418
+ ]
419
+ ],
420
+ "caname": "event-handler",
421
+ "category": "general"
422
+ },
423
+ {
424
+ "id": "3dbda329.d0fedc",
425
+ "type": "EventListener-End",
426
+ "z": "main.flow",
427
+ "name": "EventListener-End",
428
+ "statusCode": "200",
429
+ "responseType": "http",
430
+ "headers": {
431
+ "Content-Type": "application/json"
432
+ },
433
+ "payload": "wrong way",
434
+ "eventPayload": "",
435
+ "eventType": "success",
436
+ "x": 262.5,
437
+ "y": 280,
438
+ "wires": [],
439
+ "caname": "eventlistenerend",
440
+ "category": "general"
441
+ }
442
+ ]
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "hello",
3
+ "version": "1.0.0",
4
+ "description": "Kumologica flow",
5
+ "main": "lambda.js",
6
+ "files": [
7
+ "lambda.js",
8
+ "hello-flow.json",
9
+ "node_modules/**/*"
10
+ ],
11
+ "scripts": {
12
+ },
13
+ "keywords": [],
14
+ "author": "",
15
+ "license": "ISC",
16
+ "dependencies": {
17
+ "@kumologica/runtime": "2.5.0-51"
18
+ },
19
+ "devDependencies": {
20
+ "aws-sdk": "^2.513.0"
21
+ }
22
+ }
23
+
@@ -0,0 +1,8 @@
1
+ Thank you for using kumologica sdk.
2
+
3
+ To open kumologica designer run following command:
4
+
5
+ kl open
6
+
7
+ For help run: kl -h or visit https://docs.kumologica.com/docs/references/cli/Open.html
8
+
package/package.json CHANGED
@@ -3,12 +3,14 @@
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-beta12",
6
+ "version": "3.2.0-beta14",
7
7
  "description": "Kumologica Designer, harnessing Serverless for your cloud integration needs",
8
8
  "main": "src/app/main.js",
9
9
  "files": [
10
10
  "src/**/*",
11
- "cli/**/*"
11
+ "cli/**/*",
12
+ "scripts/**/*",
13
+ "fixtures/**/*"
12
14
  ],
13
15
  "bin": {
14
16
  "kl": "./bin/kl.js"
@@ -62,9 +64,9 @@
62
64
  "license": "Proprietary",
63
65
  "dependencies": {
64
66
  "@electron/remote": "^2.0.8",
65
- "@kumologica/builder": "3.2.0-beta12",
66
- "@kumologica/devkit": "3.2.0-beta12",
67
- "@kumologica/runtime": "3.2.0-beta12",
67
+ "@kumologica/builder": "3.2.0-beta14",
68
+ "@kumologica/devkit": "3.2.0-beta14",
69
+ "@kumologica/runtime": "3.2.0-beta14",
68
70
  "adm-zip": "0.4.13",
69
71
  "ajv": "8.10.0",
70
72
  "archive-type": "^4.0.0",
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+
5
+ fs.readFile('./fixtures/welcome.txt', 'utf8', (err, content) => {
6
+ console.log(content);
7
+ });