Skip to content

Commit

Permalink
fix all lint warnings
Browse files Browse the repository at this point in the history
Signed-off-by: zFernand0 <[email protected]>
  • Loading branch information
zFernand0 committed Mar 5, 2024
1 parent 2bd0cdc commit c0aeb4a
Show file tree
Hide file tree
Showing 26 changed files with 103 additions and 291 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ overrides:
jest/no-standalone-expect: off
jest/no-try-expect: off
unused-imports/no-unused-vars: off
"@typescript-eslint/no-explicit-any": off
"@typescript-eslint/no-magic-numbers": off
parser: "@typescript-eslint/parser"
parserOptions:
Expand Down
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,30 @@ All notable changes to the z/OS FTP Plug-in for Zowe CLI will be documented in t
- `IListJobOption.jobName`
- `IListJobOption.jobId`
- `ITransferMode`
- For a full list of transfer modes, see [TransferMode by zos-node-accessor](https://github.com/IBM/zos-node-accessor/blob/faf55873f37cc40e927f1b1c19f697de8cf08b95/src/zosAccessor.ts#L67)
- For a full list of transfer modes, see [TransferMode by `zos-node-accessor`](https://github.com/IBM/zos-node-accessor/blob/faf55873f37cc40e927f1b1c19f697de8cf08b95/src/zosAccessor.ts#L67)
- `IConnectionOption`
- For a full list of transfer modes, see [ConnectionOption by `zos-node-accessor`](https://github.com/IBM/zos-node-accessor/blob/faf55873f37cc40e927f1b1c19f697de8cf08b95/src/interfaces/ConnectionOption.ts#L17)
- **Breaking**:
- Removed the following constants, interfaces, and other values:
- `IGetSpoolFileOption.jobName`
- `JobUtils.parseJobDetails`
- Added proper typing to the parameters of the following functions:
- `CoreUtils.addLowerCaseKeysToObject`
- Return type changed: `any --> IDatasetEntry`
- `CreateDataset.create`
- `DataSetUtils.listDataSets`
- `FTPConfig.connectFromArguments`
- Return type changed: `Promise<any> --> Promise<ZosAccessor>`
- `FTPConfig.createConfigFromArguments`
- Return type changed: `any --> IConnectionOption`
- `JobUtils.getSpoolFileContent`
- Return type changed: `Promise<Buffer> --> Promise<string>`
- `JobUtils.getSpoolFiles`
- `JobUtils.submitJob`
- `JobUtils.submitJobFromDataset`
- `JobUtils.findJobByID`
- `JobUtils.listJobs`
- `JobUtils.deleteJob`
- `UssUtils.listFiles`
- Return type changed: `Promise<any[]> --> Promise<IDatasetEntry[]>`
- `UssUtils.makeDirectory`
Expand All @@ -36,9 +43,20 @@ All notable changes to the z/OS FTP Plug-in for Zowe CLI will be documented in t
- `UssUtils.downloadFile`
- `UssUtils.uploadFile`
- `UssUtils.deleteDirectory`
- `DataSetUtils.listDataSets`
- Return type changed: `Promise<any[]> --> Promise<IDatasetEntry[]>`
- `DataSetUtils.listMembers`
- Return type changed: `Promise<any[]> --> Promise<IDatasetEntry[]>`
- `DataSetUtils.deleteDataSet`
- `DataSetUtils.renameDataSet`
- `DataSetUtils.downloadDataSet`
- `DataSetUtils.uploadDataSet`
- `DataSetUtils.allocateDataSet`
- `AbstractTemplatedJCL.getJcl`
- The properties in the interfaces below have changed:
- `IDownloadFileOption.transferType?: string` to `IDownloadFileOption.transferType?: ITransferMode`
- `IUploadFileOption.transferType?: string` to `IUploadFileOption.transferType?: ITransferMode`
- `IUploadDataSetOption.transferType?: string` to `IUploadDataSetOption.transferType?: ITransferMode`
- `ISpoolFile.id: string` to `ISpoolFile.id: number`
- `ISpoolFile.stepname: string` to `ISpoolFile.stepName: string`
- `ISpoolFile.procstep: string` to `ISpoolFile.procStep: string`
Expand Down
34 changes: 3 additions & 31 deletions __tests__/__src__/doc/ITestPropertiesSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*
*/

import { ICommandArguments } from "@zowe/imperative";

/**
* Interface representing the values in the custom_properties.yaml file
* see example_properties.yaml for descriptions and more details
Expand All @@ -19,37 +21,7 @@ export interface ITestPropertiesSchema {
* Properties related to basic zos-ftp (zos-node-accessor package) connection
* see zowe profiles create zftp --help for more info
*/
zftp: {
/**
* user ID to connect to FTP with
*/
user: string,
/**
* Password to connect to FTP with
*/
password: string,
/**
* host name for FTP
*/
host: string,
/**
* Port for FTP connection
*/
port?: number,
/**
* See zos-node-accessor doc - specification for secure FTP transfer
*/
secureFtp?: string,
/**
* How long to wait after attempting to connect before FTP connection times out
*/
connectionTimeout?: number
/**
* Local file containing a job card for submitting jobs for commands such as
* create data set
*/
jobCardFile: string;
};
zftp: ICommandArguments;
datasets: {
/**
* A PDS (partitioned data set) that new members can be written to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import { FTPConfig } from "../../../../../src/api/FTPConfig";
import { generateRandomAlphaNumericString, generateRandomBytes } from "../../../../__src__/TestUtils";
import { IO } from "@zowe/imperative";
import { prepareTestJclDataSet } from "../../PrepareTestJclDatasets";
import { ZosAccessor } from "zos-node-accessor";

let connection: any;
let connection: ZosAccessor;
let testEnvironment: ITestEnvironment<ITestPropertiesSchema>;
let iefbr14DataSet: string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import { ITestPropertiesSchema } from "../../../../__src__/doc/ITestPropertiesSc
import { FTPConfig } from "../../../../../src/api/FTPConfig";
import { generateRandomAlphaNumericString, generateRandomBytes } from "../../../../__src__/TestUtils";
import { IO } from "@zowe/imperative";
import { ZosAccessor } from "zos-node-accessor";
import { ITransferMode } from "../../../../../src/api";

let connection: any;
let connection: ZosAccessor;
let ussTestDir: string;
let testEnvironment: ITestEnvironment<ITestPropertiesSchema>;

Expand All @@ -42,7 +44,7 @@ describe("submit job from local file command", () => {
const fileNameLength = 30;
const destination = ussTestDir + "/" + generateRandomAlphaNumericString(fileNameLength) + ".txt";
const uploadContent = generateRandomAlphaNumericString(CONTENT_LENGTH);
await connection.uploadDataset(uploadContent, destination, "ascii");
await connection.uploadDataset(uploadContent, destination, ITransferMode.ASCII);
const downloadFilePath = testEnvironment.workingDir + "/uss.txt";
const result = runCliScript(__dirname + "/__scripts__/command_download_uss_file.sh", testEnvironment,
[destination, downloadFilePath]);
Expand All @@ -59,7 +61,7 @@ describe("submit job from local file command", () => {
const randomContent = await generateRandomBytes(randomContentLength);
const fileNameLength = 30;
const destination = ussTestDir + "/" + generateRandomAlphaNumericString(fileNameLength) + ".bin";
await connection.uploadDataset(randomContent, destination, "binary");
await connection.uploadDataset(randomContent, destination, ITransferMode.BINARY);
const downloadFilePath = testEnvironment.workingDir + "/iefbr14.txt";
const result = runCliScript(__dirname + "/__scripts__/command_download_uss_file_binary.sh", testEnvironment,
[destination, downloadFilePath]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
import { ITestEnvironment, TestEnvironment, runCliScript } from "@zowe/cli-test-utils";
import { ITestPropertiesSchema } from "../../../../__src__/doc/ITestPropertiesSchema";
import { FTPConfig } from "../../../../../src/api/FTPConfig";
import { ZosAccessor } from "zos-node-accessor";

let connection: any;
let connection: ZosAccessor;
let testEnvironment: ITestEnvironment<ITestPropertiesSchema>;

describe("list data-set-members ftp command", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
import { ITestEnvironment, TestEnvironment, runCliScript } from "@zowe/cli-test-utils";
import { ITestPropertiesSchema } from "../../../../__src__/doc/ITestPropertiesSchema";
import { FTPConfig } from "../../../../../src/api/FTPConfig";
import { ZosAccessor } from "zos-node-accessor";

let connection: any;
let connection: ZosAccessor;
let testEnvironment: ITestEnvironment<ITestPropertiesSchema>;

describe("list data-set-classic ftp command", () => {
Expand Down
3 changes: 2 additions & 1 deletion __tests__/__system__/cli/list/job/cli.list.job.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
import { ITestEnvironment, TestEnvironment, runCliScript } from "@zowe/cli-test-utils";
import { ITestPropertiesSchema } from "../../../../__src__/doc/ITestPropertiesSchema";
import { FTPConfig } from "../../../../../src/api/FTPConfig";
import { ZosAccessor } from "zos-node-accessor";

let connection: any;
let connection: ZosAccessor;
let testEnvironment: ITestEnvironment<ITestPropertiesSchema>;

describe("list job ftp command", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ import { ITestPropertiesSchema } from "../../../../__src__/doc/ITestPropertiesSc
import { FTPConfig } from "../../../../../src/api/FTPConfig";
import { CoreUtils } from "../../../../../src/api/CoreUtils";
import { prepareTestJclDataSet } from "../../PrepareTestJclDatasets";
import { ZosAccessor } from "zos-node-accessor";

let connection: any;
let connection: ZosAccessor;
let testEnvironment: ITestEnvironment<ITestPropertiesSchema>;
let iefbr14DataSet: string;

Expand Down
158 changes: 0 additions & 158 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/api/AbstractTemplatedJCL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export abstract class AbstractTemplatedJCL {
* @param substitutionValues -
* @param templateFile - override the default JCL template with a file
*/
public getJcl(jobCardFile: string, substitutionValues: any, templateFile?: string) {

public getJcl(jobCardFile: string, substitutionValues: {[key: string]: string}, templateFile?: string) {
let jcl = IO.readFileSync(jobCardFile).toString();
if (!/\r?\nZ/.test(jcl)) {
// add a newline to the end of the jcl if there is none
Expand Down
Loading

0 comments on commit c0aeb4a

Please sign in to comment.