@itentialopensource/adapter-db_sybase 0.2.1 → 0.3.1

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.
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  /* @copyright Itential, LLC 2019 */
3
3
 
4
+ const execute = require('child_process').exec;
4
5
  const fs = require('fs-extra');
5
6
  const rl = require('readline-sync');
6
- const execute = require('child_process').exec;
7
7
 
8
8
  /**
9
9
  * This script will determine the type of integration test to run
@@ -47,11 +47,11 @@ function replaceTestVars(test) {
47
47
  let intTest = fs.readFileSync(test, 'utf8');
48
48
 
49
49
  // replace stub variable but check if it exists first
50
- let sindex = intTest.indexOf('const stub');
50
+ let sindex = intTest.indexOf('samProps.stub');
51
51
  let eindex = intTest.indexOf(';', sindex);
52
52
  let replStr = intTest.substring(sindex, eindex + 1);
53
53
  if (sindex > -1) {
54
- intTest = intTest.replace(replStr, `const stub = ${stub};`);
54
+ intTest = intTest.replace(replStr, `samProps.stub = ${stub};`);
55
55
  }
56
56
 
57
57
  // replace isRapidFail variable but check if it exists first
@@ -71,46 +71,46 @@ function replaceTestVars(test) {
71
71
  }
72
72
 
73
73
  // replace host variable
74
- sindex = intTest.indexOf('const host');
74
+ sindex = intTest.indexOf('samProps.host');
75
75
  eindex = intTest.indexOf(';', sindex);
76
76
  replStr = intTest.substring(sindex, eindex + 1);
77
- intTest = intTest.replace(replStr, `const host = '${host}';`);
77
+ intTest = intTest.replace(replStr, `samProps.host = '${host}';`);
78
78
 
79
79
  // replace username variable
80
- sindex = intTest.indexOf('const username');
80
+ sindex = intTest.indexOf('samProps.authentication.username');
81
81
  eindex = intTest.indexOf(';', sindex);
82
82
  replStr = intTest.substring(sindex, eindex + 1);
83
- intTest = intTest.replace(replStr, `const username = '${username}';`);
83
+ intTest = intTest.replace(replStr, `samProps.authentication.username = '${username}';`);
84
84
 
85
85
  // replace password variable
86
- sindex = intTest.indexOf('const password');
86
+ sindex = intTest.indexOf('samProps.authentication.password');
87
87
  eindex = intTest.indexOf(';', sindex);
88
88
  replStr = intTest.substring(sindex, eindex + 1);
89
- intTest = intTest.replace(replStr, `const password = '${password}';`);
89
+ intTest = intTest.replace(replStr, `samProps.authentication.password = '${password}';`);
90
90
 
91
91
  // replace protocol variable
92
- sindex = intTest.indexOf('const protocol');
92
+ sindex = intTest.indexOf('samProps.protocol');
93
93
  eindex = intTest.indexOf(';', sindex);
94
94
  replStr = intTest.substring(sindex, eindex + 1);
95
- intTest = intTest.replace(replStr, `const protocol = '${protocol}';`);
95
+ intTest = intTest.replace(replStr, `samProps.protocol = '${protocol}';`);
96
96
 
97
97
  // replace port variable
98
- sindex = intTest.indexOf('const port');
98
+ sindex = intTest.indexOf('samProps.port');
99
99
  eindex = intTest.indexOf(';', sindex);
100
100
  replStr = intTest.substring(sindex, eindex + 1);
101
- intTest = intTest.replace(replStr, `const port = ${port};`);
101
+ intTest = intTest.replace(replStr, `samProps.port = ${port};`);
102
102
 
103
103
  // replace sslenable variable
104
- sindex = intTest.indexOf('const sslenable');
104
+ sindex = intTest.indexOf('samProps.ssl.enabled');
105
105
  eindex = intTest.indexOf(';', sindex);
106
106
  replStr = intTest.substring(sindex, eindex + 1);
107
- intTest = intTest.replace(replStr, `const sslenable = ${sslenable};`);
107
+ intTest = intTest.replace(replStr, `samProps.ssl.enabled = ${sslenable};`);
108
108
 
109
109
  // replace sslinvalid variable
110
- sindex = intTest.indexOf('const sslinvalid');
110
+ sindex = intTest.indexOf('samProps.ssl.accept_invalid_cert');
111
111
  eindex = intTest.indexOf(';', sindex);
112
112
  replStr = intTest.substring(sindex, eindex + 1);
113
- intTest = intTest.replace(replStr, `const sslinvalid = ${sslinvalid};`);
113
+ intTest = intTest.replace(replStr, `samProps.ssl.accept_invalid_cert = ${sslinvalid};`);
114
114
 
115
115
  console.log(`Updates to ${test} complete`);
116
116
  fs.writeFileSync(test, intTest);
@@ -1,3 +0,0 @@
1
- # Adapter Workflows
2
-
3
- This directory contains workflows that support the adapter use cases. These workflows can be imported into IAP. If the adapter is installed using App-Artifact the workflows should be automatically imported.
@@ -1,470 +0,0 @@
1
- {
2
- "name": "test SQL Server",
3
- "tasks": {
4
- "1121": {
5
- "name": "drop",
6
- "canvasName": "drop",
7
- "summary": "drop table from MicrosoftSQL server.",
8
- "description": "drop table from MicrosoftSQL server.",
9
- "location": "Adapter",
10
- "locationType": "MicrosoftSQL",
11
- "app": "MicrosoftSQL",
12
- "type": "automatic",
13
- "displayName": "MicrosoftSQL",
14
- "variables": {
15
- "incoming": {
16
- "sql": "DROP TABLE test.dbo.test_table;",
17
- "adapter_id": "test-sql-server"
18
- },
19
- "outgoing": {
20
- "result": null
21
- },
22
- "error": ""
23
- },
24
- "deprecated": false,
25
- "matched": [
26
- {
27
- "key": "displayName",
28
- "highlightString": "Microsoft<span class='highlight-string'>SQL</span>"
29
- },
30
- {
31
- "key": "summary",
32
- "highlightString": "drop table from Microsoft<span class='highlight-string'>SQL</span> server."
33
- },
34
- {
35
- "key": "description",
36
- "highlightString": "drop table from Microsoft<span class='highlight-string'>SQL</span> server."
37
- }
38
- ],
39
- "groups": [],
40
- "actor": "Pronghorn",
41
- "x": 1.809153713298791,
42
- "y": 0.07195301027900147,
43
- "scheduled": false
44
- },
45
- "8575": {
46
- "name": "select",
47
- "canvasName": "select",
48
- "summary": "select item from MicrosoftSQL server",
49
- "description": "select item from MicrosoftSQL server",
50
- "location": "Adapter",
51
- "locationType": "MicrosoftSQL",
52
- "app": "MicrosoftSQL",
53
- "type": "automatic",
54
- "displayName": "MicrosoftSQL",
55
- "variables": {
56
- "incoming": {
57
- "sql": "SELECT * FROM test.dbo.test_table;",
58
- "adapter_id": "test-sql-server"
59
- },
60
- "outgoing": {
61
- "result": null
62
- },
63
- "error": ""
64
- },
65
- "deprecated": false,
66
- "matched": [
67
- {
68
- "key": "displayName",
69
- "highlightString": "Microsoft<span class='highlight-string'>SQL</span>"
70
- },
71
- {
72
- "key": "summary",
73
- "highlightString": "select item from Microsoft<span class='highlight-string'>SQL</span> server"
74
- },
75
- {
76
- "key": "description",
77
- "highlightString": "select item from Microsoft<span class='highlight-string'>SQL</span> server"
78
- }
79
- ],
80
- "groups": [],
81
- "actor": "Pronghorn",
82
- "x": 1.116580310880829,
83
- "y": 0.06461086637298091,
84
- "scheduled": false
85
- },
86
- "workflow_start": {
87
- "name": "workflow_start",
88
- "groups": [],
89
- "x": -0.17184801381692574,
90
- "y": 0.048458149779735685
91
- },
92
- "workflow_end": {
93
- "name": "workflow_end",
94
- "groups": [],
95
- "x": 1.9663212435233162,
96
- "y": 0.0763582966226138
97
- },
98
- "e61d": {
99
- "name": "query",
100
- "canvasName": "query",
101
- "summary": "query the MicrosoftSQL server.",
102
- "description": "query the MicrosoftSQL server.",
103
- "location": "Adapter",
104
- "locationType": "MicrosoftSQL",
105
- "app": "MicrosoftSQL",
106
- "type": "automatic",
107
- "displayName": "MicrosoftSQL",
108
- "variables": {
109
- "incoming": {
110
- "sql": "SELECT GETDATE()",
111
- "adapter_id": "test-sql-server"
112
- },
113
- "outgoing": {
114
- "result": null
115
- },
116
- "error": ""
117
- },
118
- "deprecated": false,
119
- "matched": [
120
- {
121
- "key": "canvasName",
122
- "highlightString": "<span class='highlight-string'>query</span>"
123
- },
124
- {
125
- "key": "summary",
126
- "highlightString": "<span class='highlight-string'>query</span> the MicrosoftSQL server."
127
- },
128
- {
129
- "key": "description",
130
- "highlightString": "<span class='highlight-string'>query</span> the MicrosoftSQL server."
131
- }
132
- ],
133
- "groups": [],
134
- "actor": "Pronghorn",
135
- "x": -0.018134715025906734,
136
- "y": 0.055800293685756244,
137
- "scheduled": false
138
- },
139
- "2c40": {
140
- "name": "create",
141
- "canvasName": "create",
142
- "summary": "create a table into MicrosoftSQL server.",
143
- "description": "create a table into MicrosoftSQL server.",
144
- "location": "Adapter",
145
- "locationType": "MicrosoftSQL",
146
- "app": "MicrosoftSQL",
147
- "type": "automatic",
148
- "displayName": "MicrosoftSQL",
149
- "variables": {
150
- "incoming": {
151
- "sql": "CREATE TABLE test.dbo.test_table (\n id INT PRIMARY KEY,\n first_name VARCHAR(100) NOT NULL,\n last_name VARCHAR(100) NOT NULL\n);",
152
- "adapter_id": "test-sql-server"
153
- },
154
- "outgoing": {
155
- "result": null
156
- },
157
- "error": ""
158
- },
159
- "deprecated": false,
160
- "matched": [
161
- {
162
- "key": "displayName",
163
- "highlightString": "Microsoft<span class='highlight-string'>SQL</span>"
164
- },
165
- {
166
- "key": "summary",
167
- "highlightString": "create a table into Microsoft<span class='highlight-string'>SQL</span> server."
168
- },
169
- {
170
- "key": "description",
171
- "highlightString": "create a table into Microsoft<span class='highlight-string'>SQL</span> server."
172
- }
173
- ],
174
- "groups": [],
175
- "actor": "Pronghorn",
176
- "x": 0.20207253886010362,
177
- "y": 0.05726872246696035,
178
- "scheduled": false
179
- },
180
- "4a45": {
181
- "name": "select",
182
- "canvasName": "select",
183
- "summary": "select item from MicrosoftSQL server",
184
- "description": "select item from MicrosoftSQL server",
185
- "location": "Adapter",
186
- "locationType": "MicrosoftSQL",
187
- "app": "MicrosoftSQL",
188
- "type": "automatic",
189
- "displayName": "MicrosoftSQL",
190
- "variables": {
191
- "incoming": {
192
- "sql": "SELECT * FROM test.dbo.test_table;",
193
- "adapter_id": "test-sql-server"
194
- },
195
- "outgoing": {
196
- "result": null
197
- },
198
- "error": ""
199
- },
200
- "deprecated": false,
201
- "matched": [
202
- {
203
- "key": "displayName",
204
- "highlightString": "Microsoft<span class='highlight-string'>SQL</span>"
205
- },
206
- {
207
- "key": "summary",
208
- "highlightString": "select item from Microsoft<span class='highlight-string'>SQL</span> server"
209
- },
210
- {
211
- "key": "description",
212
- "highlightString": "select item from Microsoft<span class='highlight-string'>SQL</span> server"
213
- }
214
- ],
215
- "groups": [],
216
- "actor": "Pronghorn",
217
- "x": 0.6744386873920553,
218
- "y": 0.06167400881057269,
219
- "scheduled": false
220
- },
221
- "b724": {
222
- "name": "insert",
223
- "canvasName": "insert",
224
- "summary": "insert item into MicrosoftSQL server.",
225
- "description": "insert item into MicrosoftSQL server.",
226
- "location": "Adapter",
227
- "locationType": "MicrosoftSQL",
228
- "app": "MicrosoftSQL",
229
- "type": "automatic",
230
- "displayName": "MicrosoftSQL",
231
- "variables": {
232
- "incoming": {
233
- "sql": "INSERT INTO test.dbo.test_table (id, first_name, last_name) VALUES (1, 'John', 'Smith');",
234
- "adapter_id": "test-sql-server"
235
- },
236
- "outgoing": {
237
- "result": null
238
- },
239
- "error": ""
240
- },
241
- "deprecated": false,
242
- "matched": [
243
- {
244
- "key": "displayName",
245
- "highlightString": "Microsoft<span class='highlight-string'>SQL</span>"
246
- },
247
- {
248
- "key": "summary",
249
- "highlightString": "insert item into Microsoft<span class='highlight-string'>SQL</span> server."
250
- },
251
- {
252
- "key": "description",
253
- "highlightString": "insert item into Microsoft<span class='highlight-string'>SQL</span> server."
254
- }
255
- ],
256
- "groups": [],
257
- "actor": "Pronghorn",
258
- "x": 0.4430051813471503,
259
- "y": 0.05433186490455213,
260
- "scheduled": false
261
- },
262
- "1d9": {
263
- "name": "update",
264
- "canvasName": "update",
265
- "summary": "update item into MicrosoftSQL server.",
266
- "description": "update item into MicrosoftSQL server.",
267
- "location": "Adapter",
268
- "locationType": "MicrosoftSQL",
269
- "app": "MicrosoftSQL",
270
- "type": "automatic",
271
- "displayName": "MicrosoftSQL",
272
- "variables": {
273
- "incoming": {
274
- "sql": "UPDATE test.dbo.test_table SET first_name = 'Jane' WHERE first_name = 'John';",
275
- "adapter_id": "test-sql-server"
276
- },
277
- "outgoing": {
278
- "result": null
279
- },
280
- "error": ""
281
- },
282
- "deprecated": false,
283
- "matched": [
284
- {
285
- "key": "displayName",
286
- "highlightString": "Microsoft<span class='highlight-string'>SQL</span>"
287
- },
288
- {
289
- "key": "summary",
290
- "highlightString": "update item into Microsoft<span class='highlight-string'>SQL</span> server."
291
- },
292
- {
293
- "key": "description",
294
- "highlightString": "update item into Microsoft<span class='highlight-string'>SQL</span> server."
295
- }
296
- ],
297
- "groups": [],
298
- "actor": "Pronghorn",
299
- "x": 0.8946459412780656,
300
- "y": 0.07195301027900147,
301
- "scheduled": false
302
- },
303
- "6eed": {
304
- "name": "delete",
305
- "canvasName": "delete",
306
- "summary": "delete item from MicrosoftSQL server.",
307
- "description": "delete item from MicrosoftSQL server.",
308
- "location": "Adapter",
309
- "locationType": "MicrosoftSQL",
310
- "app": "MicrosoftSQL",
311
- "type": "automatic",
312
- "displayName": "MicrosoftSQL",
313
- "variables": {
314
- "incoming": {
315
- "sql": "DELETE FROM test.dbo.test_table;",
316
- "adapter_id": "test-sql-server"
317
- },
318
- "outgoing": {
319
- "result": null
320
- },
321
- "error": ""
322
- },
323
- "deprecated": false,
324
- "matched": [
325
- {
326
- "key": "displayName",
327
- "highlightString": "Microsoft<span class='highlight-string'>SQL</span>"
328
- },
329
- {
330
- "key": "summary",
331
- "highlightString": "delete item from Microsoft<span class='highlight-string'>SQL</span> server."
332
- },
333
- {
334
- "key": "description",
335
- "highlightString": "delete item from Microsoft<span class='highlight-string'>SQL</span> server."
336
- }
337
- ],
338
- "groups": [],
339
- "actor": "Pronghorn",
340
- "x": 1.3385146804835923,
341
- "y": 0.06607929515418502,
342
- "scheduled": false
343
- },
344
- "f2d9": {
345
- "name": "select",
346
- "canvasName": "select",
347
- "summary": "select item from MicrosoftSQL server",
348
- "description": "select item from MicrosoftSQL server",
349
- "location": "Adapter",
350
- "locationType": "MicrosoftSQL",
351
- "app": "MicrosoftSQL",
352
- "type": "automatic",
353
- "displayName": "MicrosoftSQL",
354
- "variables": {
355
- "incoming": {
356
- "sql": "SELECT * FROM test.dbo.test_table;",
357
- "adapter_id": "test-sql-server"
358
- },
359
- "outgoing": {
360
- "result": null
361
- },
362
- "error": ""
363
- },
364
- "deprecated": false,
365
- "matched": [
366
- {
367
- "key": "displayName",
368
- "highlightString": "Microsoft<span class='highlight-string'>SQL</span>"
369
- },
370
- {
371
- "key": "summary",
372
- "highlightString": "select item from Microsoft<span class='highlight-string'>SQL</span> server"
373
- },
374
- {
375
- "key": "description",
376
- "highlightString": "select item from Microsoft<span class='highlight-string'>SQL</span> server"
377
- }
378
- ],
379
- "groups": [],
380
- "actor": "Pronghorn",
381
- "x": 1.579447322970639,
382
- "y": 0.06901615271659324,
383
- "scheduled": false
384
- }
385
- },
386
- "transitions": {
387
- "1121": {
388
- "workflow_end": {
389
- "type": "standard",
390
- "state": "success"
391
- }
392
- },
393
- "8575": {
394
- "6eed": {
395
- "type": "standard",
396
- "state": "success"
397
- }
398
- },
399
- "workflow_start": {
400
- "e61d": {
401
- "type": "standard",
402
- "state": "success"
403
- }
404
- },
405
- "workflow_end": {},
406
- "e61d": {
407
- "2c40": {
408
- "type": "standard",
409
- "state": "success"
410
- }
411
- },
412
- "2c40": {
413
- "b724": {
414
- "type": "standard",
415
- "state": "success"
416
- }
417
- },
418
- "4a45": {
419
- "1d9": {
420
- "type": "standard",
421
- "state": "success"
422
- }
423
- },
424
- "b724": {
425
- "4a45": {
426
- "type": "standard",
427
- "state": "success"
428
- }
429
- },
430
- "1d9": {
431
- "8575": {
432
- "type": "standard",
433
- "state": "success"
434
- }
435
- },
436
- "6eed": {
437
- "f2d9": {
438
- "type": "standard",
439
- "state": "success"
440
- }
441
- },
442
- "f2d9": {
443
- "1121": {
444
- "type": "standard",
445
- "state": "success"
446
- }
447
- }
448
- },
449
- "font_size": 12,
450
- "created": "2020-04-23T18:21:28.989Z",
451
- "created_by": {
452
- "provenance": "Local AAA",
453
- "username": "admin@pronghorn",
454
- "firstname": "admin",
455
- "inactive": false
456
- },
457
- "createdVersion": "5.5.9-2019.3.14.0",
458
- "groups": [],
459
- "last_updated": "2020-04-23T18:28:55.564Z",
460
- "last_updated_by": {
461
- "provenance": "Local AAA",
462
- "username": "admin@pronghorn",
463
- "firstname": "admin",
464
- "inactive": false
465
- },
466
- "lastUpdatedVersion": "5.5.9-2019.3.14.0",
467
- "type": "automation",
468
- "description": null,
469
- "tags": []
470
- }