@itentialopensource/adapter-db_mysql 0.1.16 → 0.2.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 +0,0 @@
1
- {"name":"mysql-test1","tasks":{"9711":{"name":"select","summary":"","description":"","location":"Adapter","locationType":"MySQL","app":"MySQL","displayName":"MySQL","type":"automatic","variables":{"incoming":{"sql":"SELECT * FROM Dogs;","adapter_id":"db_mysql"},"outgoing":{"result":null},"error":""},"deprecated":false,"matched":[],"groups":[],"actor":"Pronghorn","x":0.37222222222222223,"y":0.4584103512014787,"scheduled":false},"workflow_start":{"name":"workflow_start","groups":[],"x":0,"y":0.5},"workflow_end":{"name":"workflow_end","groups":[],"x":1,"y":0.5},"4dfc":{"name":"update","summary":"update item into MySQL server.","description":"update item into MySQL server.","location":"Adapter","locationType":"MySQL","app":"MySQL","displayName":"MySQL","type":"automatic","variables":{"incoming":{"sql":"UPDATE Dogs SET Name=\"dogs001\" WHERE DogID=1;","adapter_id":"db_mysql"},"outgoing":{"result":null},"error":""},"deprecated":false,"matched":[],"groups":[],"actor":"Pronghorn","x":0.55,"y":0.25693160813308685,"scheduled":false},"9d3f":{"name":"delete","summary":"delete item from MySQL server.","description":"delete item from MySQL server.","location":"Adapter","locationType":"MySQL","app":"MySQL","displayName":"MySQL","type":"automatic","variables":{"incoming":{"sql":"DELETE FROM Dogs WHERE DogID=1;","adapter_id":"db_mysql"},"outgoing":{"result":null},"error":""},"deprecated":false,"matched":[],"groups":[],"actor":"Pronghorn","x":0.5537037037037037,"y":0.7301293900184843,"scheduled":false},"e077":{"name":"create","summary":"create a table into MySQL server.","description":"create a table into MySQL server.","location":"Adapter","locationType":"MySQL","app":"MySQL","displayName":"MySQL","type":"automatic","variables":{"incoming":{"sql":"CREATE TABLE Dogs (DogID int, Name varchar(255));","adapter_id":"db_mysql"},"outgoing":{"result":null},"error":""},"deprecated":false,"matched":[],"groups":[],"actor":"Pronghorn","x":0.1648148148148148,"y":0.29390018484288355,"scheduled":false},"f00d":{"name":"insert","summary":"insert item into MySQL server.","description":"insert item into MySQL server.","location":"Adapter","locationType":"MySQL","app":"MySQL","displayName":"MySQL","type":"automatic","variables":{"incoming":{"sql":"INSERT INTO Dogs (DogID, Name) VALUES (1, \"dog001\");","adapter_id":"db_mysql"},"outgoing":{"result":null},"error":""},"deprecated":false,"matched":[],"groups":[],"actor":"Pronghorn","x":0.1787037037037037,"y":0.6136783733826248,"scheduled":false},"e4e8":{"name":"drop","summary":"drop table from MySQL server.","description":"drop table from MySQL server.","location":"Adapter","locationType":"MySQL","app":"MySQL","displayName":"MySQL","type":"automatic","variables":{"incoming":{"sql":"DROP TABLE Dogs;","adapter_id":"db_mysql"},"outgoing":{"result":null},"error":""},"deprecated":false,"matched":[],"groups":[],"actor":"Pronghorn","x":0.7814814814814814,"y":0.4787430683918669,"scheduled":false}},"transitions":{"9711":{"4dfc":{"type":"standard","state":"success"}},"workflow_start":{"e077":{"type":"standard","state":"success"}},"workflow_end":{},"4dfc":{"9d3f":{"type":"standard","state":"success"}},"9d3f":{"e4e8":{"type":"standard","state":"success"}},"e077":{"f00d":{"type":"standard","state":"success"}},"f00d":{"9711":{"type":"standard","state":"success"}},"e4e8":{"workflow_end":{"type":"standard","state":"success"}}},"font_size":12,"created":"2019-11-14T20:50:06.537Z","created_by":{"provenance":"Local AAA","username":"admin@pronghorn","firstname":"admin","inactive":false,"email":""},"groups":[],"last_updated":"2019-11-15T21:18:48.929Z","last_updated_by":{"provenance":"Local AAA","username":"admin@pronghorn","firstname":"admin","inactive":false,"email":""},"type":"automation","description":null}