Skip to content

Commit 855db2b

Browse files
committed
fix lint issues
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
1 parent f616cb1 commit 855db2b

File tree

19 files changed

+732
-728
lines changed

19 files changed

+732
-728
lines changed

Twilio/Twilio-CA-ESP-Sample/.eslintrc.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const maxLines = 150;
12
module.exports = {
23
"root": true,
34
"env": {
@@ -43,14 +44,14 @@ module.exports = {
4344
"unused-imports"
4445
],
4546
"rules": {
46-
"max-len": ["warn", 150],
47+
"max-len": ["warn", maxLines],
4748
"no-console": "off",
4849
"no-multiple-empty-lines": "warn",
4950
"no-trailing-spaces": "warn",
5051
"@typescript-eslint/ban-types": "off",
5152
"@typescript-eslint/comma-dangle": ["warn", "only-multiline"],
5253
"@typescript-eslint/explicit-module-boundary-types": "off",
53-
"@typescript-eslint/indent": ["warn", 4],
54+
"@typescript-eslint/indent": ["warn", 2],
5455
"@typescript-eslint/no-explicit-any": "off",
5556
"@typescript-eslint/no-inferrable-types": "off",
5657
"@typescript-eslint/no-magic-numbers": ["warn", {

Twilio/Twilio-CA-ESP-Sample/config/default.ts

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,56 @@
22
* This program and the accompanying materials are made available and may be used, at your option, under either:
33
* - Eclipse Public License v2.0, available at https://www.eclipse.org/legal/epl-v20.html, OR
44
* - Apache License, version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
5-
*
5+
*
66
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
7-
*
7+
*
88
* Copyright Contributors to the Zowe Project.
9-
*
9+
*
1010
*/
1111

1212
export default {
1313

14-
"templates": "templates/",
15-
"library": "",
16-
"zos_src": {
17-
"local": {
18-
"folder": "zos_src/"
19-
},
20-
"dsn": {
21-
"hlq": "",
22-
"project": "",
23-
"type": ""
24-
}
14+
"templates": "templates/",
15+
"library": "",
16+
"zos_src": {
17+
"local": {
18+
"folder": "zos_src/"
2519
},
26-
"jcl": {
27-
"jobcard": {
28-
"accounting": "",
29-
"class": "",
30-
"msgclass": "",
31-
"msglevel": ""
32-
},
33-
"dsn": {
34-
"hlq": "",
35-
"project": "",
36-
"files": ["FILE1","FILE2","FILE3","FILE4","FILE5","FILE6",
37-
"FILE7","FILE8","FILE9","FILE10"]
38-
}
39-
},
40-
"esp": {
41-
"appl": "",
42-
"jobname": "",
43-
"definition": "",
44-
"definition-loader": "",
45-
"event": {
46-
"id": "",
47-
"system": "",
48-
"member": ""
49-
}
20+
"dsn": {
21+
"hlq": "",
22+
"project": "",
23+
"type": ""
24+
}
25+
},
26+
"jcl": {
27+
"jobcard": {
28+
"accounting": "",
29+
"class": "",
30+
"msgclass": "",
31+
"msglevel": ""
5032
},
51-
"twilio":{
52-
"accountSid": "",
53-
"authToken": "",
54-
"originPhone": "",
55-
"targetPhone": ""
33+
"dsn": {
34+
"hlq": "",
35+
"project": "",
36+
"files": ["FILE1","FILE2","FILE3","FILE4","FILE5","FILE6",
37+
"FILE7","FILE8","FILE9","FILE10"]
38+
}
39+
},
40+
"esp": {
41+
"appl": "",
42+
"jobname": "",
43+
"definition": "",
44+
"definition-loader": "",
45+
"event": {
46+
"id": "",
47+
"system": "",
48+
"member": ""
5649
}
50+
},
51+
"twilio":{
52+
"accountSid": "",
53+
"authToken": "",
54+
"originPhone": "",
55+
"targetPhone": ""
56+
}
5757
};

Twilio/Twilio-CA-ESP-Sample/env_scripts/src/executeCommand.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
* This program and the accompanying materials are made available and may be used, at your option, under either:
33
* - Eclipse Public License v2.0, available at https://www.eclipse.org/legal/epl-v20.html, OR
44
* - Apache License, version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
5-
*
5+
*
66
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
7-
*
7+
*
88
* Copyright Contributors to the Zowe Project.
9-
*
9+
*
1010
*/
1111

1212
import {exec} from "child_process";
1313

1414
export function executeCommand(command: string) {
15-
return new Promise((resolve, reject) => {
16-
exec(command, (err, sdtout, stderr) => {
17-
if (err) reject(err);
18-
if (sdtout) resolve(sdtout);
19-
if (stderr) reject(stderr);
20-
});
15+
return new Promise((resolve, reject) => {
16+
exec(command, (err, sdtout, stderr) => {
17+
if (err) reject(err);
18+
if (sdtout) resolve(sdtout);
19+
if (stderr) reject(stderr);
2120
});
21+
});
2222
}

Twilio/Twilio-CA-ESP-Sample/env_scripts/src/load-event-definitions.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
* This program and the accompanying materials are made available and may be used, at your option, under either:
44
* - Eclipse Public License v2.0, available at https://www.eclipse.org/legal/epl-v20.html, OR
55
* - Apache License, version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
6-
*
6+
*
77
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
8-
*
8+
*
99
* Copyright Contributors to the Zowe Project.
10-
*
10+
*
1111
*/
1212

1313
import {executeCommand} from "./executeCommand";
@@ -21,32 +21,32 @@ const member: string = config.get("esp.definition-loader");
2121
const pdsName: string = `${hlq}.${project}.${type}(${member})`;
2222

2323
submitJobToLoadDefinitions(pdsName)
24-
.then(getReturnCode)
25-
.then(validateReturnCode)
26-
.then((isSuccess) => {
27-
if (isSuccess) {
28-
sendSMS("Definitions successfully loaded into CA ESP. Job is ready to use");
29-
}
30-
})
31-
.catch((err) => console.error(err));
24+
.then(getReturnCode)
25+
.then(validateReturnCode)
26+
.then((isSuccess) => {
27+
if (isSuccess) {
28+
sendSMS("Definitions successfully loaded into CA ESP. Job is ready to use");
29+
}
30+
})
31+
.catch((err) => console.error(err));
3232

3333
async function submitJobToLoadDefinitions(pdsName: string){
34-
const cmd = `zowe jobs submit ds "${pdsName}" --rff {"jobid"} --rft string`;
35-
return await executeCommand(cmd);
34+
const cmd = `zowe jobs submit ds "${pdsName}" --rff {"jobid"} --rft string`;
35+
return await executeCommand(cmd);
3636
}
3737

3838
async function getReturnCode(jobID: any){
39-
console.log(`Traking job: ${jobID}`);
40-
const cmd = `zowe jobs vw --rff {"retcode"} --rft string jsbj "${jobID}"`;
41-
return await executeCommand(cmd);
39+
console.log(`Traking job: ${jobID}`);
40+
const cmd = `zowe jobs vw --rff {"retcode"} --rft string jsbj "${jobID}"`;
41+
return await executeCommand(cmd);
4242
}
4343

4444
function validateReturnCode(returnCode: any) {
45-
if (returnCode.toString().trim() == 'CC 0000') {
46-
console.log(`Job completed! ${returnCode}`);
47-
return true;
48-
} else {
49-
console.log(`Job abended! ${returnCode}`);
50-
return false;
51-
}
45+
if (returnCode.toString().trim() == 'CC 0000') {
46+
console.log(`Job completed! ${returnCode}`);
47+
return true;
48+
} else {
49+
console.log(`Job abended! ${returnCode}`);
50+
return false;
51+
}
5252
}

Twilio/Twilio-CA-ESP-Sample/env_scripts/src/render.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
* This program and the accompanying materials are made available and may be used, at your option, under either:
44
* - Eclipse Public License v2.0, available at https://www.eclipse.org/legal/epl-v20.html, OR
55
* - Apache License, version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
6-
*
6+
*
77
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
8-
*
8+
*
99
* Copyright Contributors to the Zowe Project.
10-
*
10+
*
1111
*/
1212

1313
import * as config from "config";
@@ -18,11 +18,11 @@ const templatesFolder: string = config.get("templates") ;
1818
const renderedFolder: string = config.get("zos_src.local.folder");
1919

2020
fs.readdirSync(templatesFolder).forEach(fileName => {
21-
console.log("Rendering: " + fileName);
22-
const templateFile: string = fs.readFileSync(templatesFolder + fileName).toString();
23-
const compiledFile = handlebars.compile(templateFile);
24-
const renderedFile = compiledFile(config);
25-
if (!fs.existsSync(renderedFolder)) fs.mkdirSync(renderedFolder);
26-
fs.writeFileSync(renderedFolder + fileName, renderedFile);
27-
console.log("Render complete for: " + fileName);
21+
console.log("Rendering: " + fileName);
22+
const templateFile: string = fs.readFileSync(templatesFolder + fileName).toString();
23+
const compiledFile = handlebars.compile(templateFile);
24+
const renderedFile = compiledFile(config);
25+
if (!fs.existsSync(renderedFolder)) fs.mkdirSync(renderedFolder);
26+
fs.writeFileSync(renderedFolder + fileName, renderedFile);
27+
console.log("Render complete for: " + fileName);
2828
});

Twilio/Twilio-CA-ESP-Sample/env_scripts/src/twilio-notification.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
* This program and the accompanying materials are made available and may be used, at your option, under either:
44
* - Eclipse Public License v2.0, available at https://www.eclipse.org/legal/epl-v20.html, OR
55
* - Apache License, version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
6-
*
6+
*
77
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
8-
*
8+
*
99
* Copyright Contributors to the Zowe Project.
10-
*
10+
*
1111
*/
1212

1313
// Script that will send a SMS using the Twilio Service
@@ -21,9 +21,9 @@ const targetPhone: string = config.get("twilio.targetPhone");
2121
const client = twilio(accountSid, authToken);
2222

2323
export function sendSMS(smsBody: string) {
24-
client.messages.create({
25-
body: smsBody,
26-
from: originPhone,
27-
to: targetPhone
28-
}).then(message => console.log('Message sent: ' + message.sid));
24+
client.messages.create({
25+
body: smsBody,
26+
from: originPhone,
27+
to: targetPhone
28+
}).then(message => console.log('Message sent: ' + message.sid));
2929
}

Twilio/Twilio-CA-ESP-Sample/env_scripts/src/upload.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
* This program and the accompanying materials are made available and may be used, at your option, under either:
44
* - Eclipse Public License v2.0, available at https://www.eclipse.org/legal/epl-v20.html, OR
55
* - Apache License, version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
6-
*
6+
*
77
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
8-
*
8+
*
99
* Copyright Contributors to the Zowe Project.
10-
*
10+
*
1111
*/
1212

1313
import * as config from "config";
@@ -24,25 +24,25 @@ const inputSource: string = process.argv[2];
2424
if(inputSource) uploadSource(inputSource, pdsName);
2525

2626
async function uploadSource(filePath: string, pdsName: string) {
27-
if(existsSync(filePath)){
28-
const memberName = basename(filePath, extname(filePath));
29-
const zosTarget = `${pdsName}(${memberName})`;
30-
issueUploadCommand(filePath, zosTarget)
31-
.then((output) => console.log(output))
32-
.catch((err) => console.error(err));
33-
} else {
34-
console.error(`Input source path not found: ${filePath}`);
35-
}
27+
if(existsSync(filePath)){
28+
const memberName = basename(filePath, extname(filePath));
29+
const zosTarget = `${pdsName}(${memberName})`;
30+
issueUploadCommand(filePath, zosTarget)
31+
.then((output) => console.log(output))
32+
.catch((err) => console.error(err));
33+
} else {
34+
console.error(`Input source path not found: ${filePath}`);
35+
}
3636
}
3737

3838
function issueUploadCommand(localFile: string, dataSet: string) {
39-
return new Promise((resolve, reject) =>{
40-
const cmd = `zowe files upload ftds "${localFile}" "${dataSet}"`;
41-
console.log(`Uploading file ${localFile} to PDS ${dataSet}`);
42-
exec(cmd, (err, stdout, stderr) => {
43-
if (err) reject(err);
44-
if (stdout) resolve(stdout.toString());
45-
if (stderr) reject(stderr.toString());
46-
});
39+
return new Promise((resolve, reject) =>{
40+
const cmd = `zowe files upload ftds "${localFile}" "${dataSet}"`;
41+
console.log(`Uploading file ${localFile} to PDS ${dataSet}`);
42+
exec(cmd, (err, stdout, stderr) => {
43+
if (err) reject(err);
44+
if (stdout) resolve(stdout.toString());
45+
if (stderr) reject(stderr.toString());
4746
});
47+
});
4848
}

Twilio/Twilio-CA-ESP-Sample/env_scripts/src/watch.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
* This program and the accompanying materials are made available and may be used, at your option, under either:
44
* - Eclipse Public License v2.0, available at https://www.eclipse.org/legal/epl-v20.html, OR
55
* - Apache License, version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
6-
*
6+
*
77
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
8-
*
8+
*
99
* Copyright Contributors to the Zowe Project.
10-
*
10+
*
1111
*/
1212

1313
// Script used to watch the source folder and upload the changes to z/OS automatically
@@ -16,16 +16,16 @@ import * as config from "config";
1616
const nodemon = require("nodemon");
1717

1818
nodemon({
19-
ext: "jcl rex txt",
20-
watch: config.get("zos_src.local.folder"),
21-
exec: "echo Watching for changes"
19+
ext: "jcl rex txt",
20+
watch: config.get("zos_src.local.folder"),
21+
exec: "echo Watching for changes"
2222
});
2323

2424
nodemon.on('restart', uploadFile);
2525

2626
async function uploadFile(filePath: string) {
27-
const cmd: string = `npm run upload ${filePath}`;
28-
executeCommand(cmd)
29-
.then((output) => console.log(output))
30-
.catch((err) => console.error(err));
27+
const cmd: string = `npm run upload ${filePath}`;
28+
executeCommand(cmd)
29+
.then((output) => console.log(output))
30+
.catch((err) => console.error(err));
3131
}

gulp/batchCobolBuild.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
* This program and the accompanying materials are made available and may be used, at your option, under either:
33
* - Eclipse Public License v2.0, available at https://www.eclipse.org/legal/epl-v20.html, OR
44
* - Apache License, version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
5-
*
5+
*
66
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
7-
*
7+
*
88
* Copyright Contributors to the Zowe Project.
9-
*
9+
*
1010
*/
1111

1212
var gulp = require('gulp-help')(require('gulp'));

0 commit comments

Comments
 (0)