diff --git a/__tests__/__packages__/cli-test-utils/package.json b/__tests__/__packages__/cli-test-utils/package.json index f40cb78815..9aaf93902b 100644 --- a/__tests__/__packages__/cli-test-utils/package.json +++ b/__tests__/__packages__/cli-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/cli-test-utils", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "description": "Test utilities package for Zowe CLI plug-ins", "author": "Zowe", "license": "EPL-2.0", @@ -43,7 +43,7 @@ "devDependencies": { "@types/js-yaml": "^4.0.9", "@types/uuid": "^9.0.8", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/imperative": "8.0.0-next.202406111958" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" diff --git a/lerna.json b/lerna.json index 50f6ee7065..8917018690 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "command": { "publish": { "ignoreChanges": [ diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 9cdee255fc..7f340926f0 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -52,7 +52,7 @@ }, "__tests__/__packages__/cli-test-utils": { "name": "@zowe/cli-test-utils", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "license": "EPL-2.0", "dependencies": { "find-up": "^5.0.0", @@ -63,7 +63,7 @@ "devDependencies": { "@types/js-yaml": "^4.0.9", "@types/uuid": "^9.0.8", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/imperative": "8.0.0-next.202406111958" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" @@ -12463,11 +12463,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.4", - "license": "MIT", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.3", + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" @@ -17615,21 +17616,21 @@ }, "packages/cli": { "name": "@zowe/cli", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "hasInstallScript": true, "license": "EPL-2.0", "dependencies": { - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600", - "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202406061600", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958", + "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202406111958", "find-process": "1.4.7", "lodash": "4.17.21", "minimatch": "9.0.3", @@ -17642,7 +17643,7 @@ "@types/diff": "^5.0.9", "@types/lodash": "^4.14.202", "@types/tar": "^6.1.11", - "@zowe/cli-test-utils": "8.0.0-next.202406061600", + "@zowe/cli-test-utils": "8.0.0-next.202406111958", "comment-json": "^4.2.3", "strip-ansi": "^6.0.1", "which": "^4.0.0" @@ -17651,7 +17652,7 @@ "node": ">=18.12.0" }, "optionalDependencies": { - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202406061600" + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202406111958" } }, "packages/cli/node_modules/brace-expansion": { @@ -17701,15 +17702,15 @@ }, "packages/core": { "name": "@zowe/core-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "license": "EPL-2.0", "dependencies": { "comment-json": "~4.2.3", "string-width": "^4.2.3" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "engines": { "node": ">=18.12.0" @@ -17720,7 +17721,7 @@ }, "packages/imperative": { "name": "@zowe/imperative", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "license": "EPL-2.0", "dependencies": { "@types/yargs": "^17.0.32", @@ -17772,7 +17773,7 @@ "@types/pacote": "^11.1.8", "@types/progress": "^2.0.7", "@types/stack-trace": "^0.0.29", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202406061600", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202406111958", "concurrently": "^8.0.0", "cowsay": "^1.6.0", "deep-diff": "^1.0.0", @@ -17889,16 +17890,16 @@ }, "packages/provisioning": { "name": "@zowe/provisioning-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "license": "EPL-2.0", "dependencies": { "js-yaml": "^4.1.0" }, "devDependencies": { "@types/js-yaml": "^4.0.9", - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "engines": { "node": ">=18.12.0" @@ -17910,7 +17911,7 @@ }, "packages/secrets": { "name": "@zowe/secrets-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "hasInstallScript": true, "license": "EPL-2.0", "devDependencies": { @@ -17923,15 +17924,15 @@ }, "packages/workflows": { "name": "@zowe/zos-workflows-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202406061600" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202406111958" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "engines": { "node": ">=18.12.0" @@ -17943,12 +17944,12 @@ }, "packages/zosconsole": { "name": "@zowe/zos-console-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "engines": { "node": ">=18.12.0" @@ -17960,16 +17961,16 @@ }, "packages/zosfiles": { "name": "@zowe/zos-files-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "license": "EPL-2.0", "dependencies": { "minimatch": "^9.0.3" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202406111958" }, "engines": { "node": ">=18.12.0" @@ -18002,15 +18003,15 @@ }, "packages/zosjobs": { "name": "@zowe/zos-jobs-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202406061600" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202406111958" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "engines": { "node": ">=18.12.0" @@ -18022,12 +18023,12 @@ }, "packages/zoslogs": { "name": "@zowe/zos-logs-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "engines": { "node": ">=18.12.0" @@ -18039,12 +18040,12 @@ }, "packages/zosmf": { "name": "@zowe/zosmf-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "engines": { "node": ">=18.12.0" @@ -18056,15 +18057,15 @@ }, "packages/zostso": { "name": "@zowe/zos-tso-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "license": "EPL-2.0", "dependencies": { - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202406061600" + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202406111958" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "engines": { "node": ">=18.12.0" @@ -18076,15 +18077,15 @@ }, "packages/zosuss": { "name": "@zowe/zos-uss-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "license": "EPL-2.0", "dependencies": { "ssh2": "^1.15.0" }, "devDependencies": { "@types/ssh2": "^1.11.19", - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "engines": { "node": ">=18.12.0" diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index e2035ed795..a620059010 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -97,7 +97,6 @@ LTS Breaking: Removed the following previously deprecated items: [#1981](https:/ - Removed zosmfProfile from `ZosFilesBase.handler.ts` - Removed statCmdFlag as an export from Shell.ts - ## `8.0.0-next.202401262128` - Enhancement: Adding `--binary` and `--encoding` options to `zosfiles edit` @@ -132,6 +131,10 @@ LTS Breaking: Removed the following previously deprecated items: [#1981](https:/ - Major: First major version bump for V3 +## `7.25.1` + +- BugFix: Updated `braces` dependency for technical currency. [#2157](https://github.com/zowe/zowe-cli/pull/2157) + ## `7.25.0` - Enhancement: Added the ability to set JCL reader properties for `--jobRecordLength`, `--jobRecordFormat` and `--jobEncoding` on the `zowe jobs submit local-file` and `zowe jobs submit stdin` commands. [#2139](https://github.com/zowe/zowe-cli/pull/2139) diff --git a/packages/cli/package.json b/packages/cli/package.json index 1acef98db8..2d13de3cf4 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/cli", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "zoweVersion": "V3", "description": "Zowe CLI is a command line interface (CLI) that provides a simple and streamlined way to interact with IBM z/OS.", "author": "Zowe", @@ -58,17 +58,17 @@ "preshrinkwrap": "node ../../scripts/rewriteShrinkwrap.js" }, "dependencies": { - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600", - "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202406061600", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958", + "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202406111958", "find-process": "1.4.7", "lodash": "4.17.21", "minimatch": "9.0.3", @@ -78,13 +78,13 @@ "@types/diff": "^5.0.9", "@types/lodash": "^4.14.202", "@types/tar": "^6.1.11", - "@zowe/cli-test-utils": "8.0.0-next.202406061600", + "@zowe/cli-test-utils": "8.0.0-next.202406111958", "comment-json": "^4.2.3", "strip-ansi": "^6.0.1", "which": "^4.0.0" }, "optionalDependencies": { - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202406061600" + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202406111958" }, "engines": { "node": ">=18.12.0" diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index a025cd1dce..a2b0f93b3b 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -2,11 +2,14 @@ All notable changes to the Zowe core SDK package will be documented in this file. +## `8.0.0-next.202406111958` + +- BugFix: Deprecated the IHeaderContent interface - use `IHeaderContent` from `@zowe/imperative`. [#2083](https://github.com/zowe/zowe-cli/issues/2083) + ## `8.0.0-next.202406061600` - Enhancement: Modified Services.ts to have commented properties end with commas. [#1049](https://github.com/zowe/zowe-cli/issues/1049) - ## `8.0.0-next.202403041352` - BugFix: Updated engine to Node 18.12.0. [#2074](https://github.com/zowe/zowe-cli/pull/2074) @@ -36,6 +39,10 @@ All notable changes to the Zowe core SDK package will be documented in this file - Major: First major version bump for V3 +## `7.25.2` + +- Enhancement: Modified Services.ts to have commented properties end with commas. [#1049](https://github.com/zowe/zowe-cli/issues/1049) + ## `7.25.0` - Enhancement: Added `X_IBM_INTRDR_FILE_ENCODING` header to `ZosmfHeaders` [#2139](https://github.com/zowe/zowe-cli/pull/2139) @@ -55,7 +62,7 @@ All notable changes to the Zowe core SDK package will be documented in this file ## `7.17.0` - Enhancement: Set properties for z/OSMF REST errors for use in a more user-friendly format with the ZOWE_V3_ERR_FORMAT environment variable. [zowe-cli#935](https://github.com/zowe/zowe-cli/issues/935) -- + ## `7.16.5` - BugFix: Fixed confusing error message "Token is not valid or expired" when APIML token is used to connect direct-to-service with `ZosmfRestClient`. [Imperative #978](https://github.com/zowe/imperative/issues/978) diff --git a/packages/core/package.json b/packages/core/package.json index 76e1670b1d..9ff7d35216 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/core-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "description": "Core libraries shared by Zowe SDK packages", "author": "Zowe", "license": "EPL-2.0", @@ -49,8 +49,8 @@ "string-width": "^4.2.3" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" diff --git a/packages/core/src/rest/ZosmfHeaders.ts b/packages/core/src/rest/ZosmfHeaders.ts index 1a7421ff46..ae4025174e 100644 --- a/packages/core/src/rest/ZosmfHeaders.ts +++ b/packages/core/src/rest/ZosmfHeaders.ts @@ -9,7 +9,7 @@ * */ -import { IHeaderContent } from "./doc/IHeaderContent"; +import { IHeaderContent } from "@zowe/imperative"; /** * Class to contain default z/OSMF headers diff --git a/packages/core/src/rest/doc/IHeaderContent.ts b/packages/core/src/rest/doc/IHeaderContent.ts index 776e788566..c71a8e9307 100644 --- a/packages/core/src/rest/doc/IHeaderContent.ts +++ b/packages/core/src/rest/doc/IHeaderContent.ts @@ -12,6 +12,7 @@ /** * Interface to add index signature to http headers * @export + * @deprecated - use Imperative's IHeaderContent instead * @interface IHeaderContent */ export interface IHeaderContent { diff --git a/packages/core/src/utils/CoreUtils.ts b/packages/core/src/utils/CoreUtils.ts index a75104e42f..a16aa7ca4b 100644 --- a/packages/core/src/utils/CoreUtils.ts +++ b/packages/core/src/utils/CoreUtils.ts @@ -20,6 +20,7 @@ const stringWidth = require("string-width"); * @param {string} str - string to add the padding to * @param {number} len - final length of the padded string * @param {string} [padChar=" "] - Padding character + * @deprecated - use string.padStart instead * @return {string} Padded string */ export function padLeft(str: string, len: number, padChar: string = " "): string { @@ -93,16 +94,16 @@ export function getErrorContext(content: string | string[], lineIndex: number): // Gather the line before in case we are able to get it if (lineIndex > 0) { - retValue += trimLineToTerminalWidth(`\n ${padLeft(lineIndex.toString(), maxLineIndexLength)} | ${lines[lineIndex - 1]}`); + retValue += trimLineToTerminalWidth(`\n ${lineIndex.toString().padStart(maxLineIndexLength)} | ${lines[lineIndex - 1]}`); } // Format the current line of the retValue += - trimLineToTerminalWidth(`\n > ${TextUtils.chalk.red(padLeft((lineIndex + 1).toString(), maxLineIndexLength))} | ${lines[lineIndex]}`); + trimLineToTerminalWidth(`\n > ${TextUtils.chalk.red((lineIndex + 1).toString().padStart(maxLineIndexLength))} | ${lines[lineIndex]}`); // Gather the next line in case we are able to get it if (lineIndex + 1 < lines.length) { - retValue += trimLineToTerminalWidth(`\n ${padLeft((lineIndex + 2).toString(), maxLineIndexLength)} | ${lines[lineIndex + 1]}`); + retValue += trimLineToTerminalWidth(`\n ${(lineIndex + 2).toString().padStart(maxLineIndexLength)} | ${lines[lineIndex + 1]}`); } return retValue; diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 636a885ceb..ed1c383058 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,6 +2,56 @@ All notable changes to the Imperative package will be documented in this file. +## `8.0.0-next.202406111958` + +- LTS Breaking: Modified the @zowe/imperative SDK [#2083](https://github.com/zowe/zowe-cli/issues/2083) + - Removed the following exported classes: + - AbstractAuthHandler + - AbstractCommandYargs + - AbstractHelpGenerator + - AbstractHelpGeneratorFactory + - CommandPreparer + - CommandProcessor + - CommandUtils + - CommandYargs + - CompressionUtils + - ConfigAutoStore + - ConfigurationLoader + - ConfigurationValidator + - DefinitionTreeResolver + - FailedCommandHandler + - GroupCommandYargs + - HelpConstants + - HelpGeneratorFactory + - ImperativeReject + - LoggerConfigBuilder + - LoggerUtils + - RestStandAloneUtils + - SharedOptions + - SyntaxValidator + - WebHelpManager + - YargsConfigurer + - YargsDefiner + - Removed the following exported interfaces: + - ICommandHandlerResponseChecker + - ICommandHandlerResponseValidator + - ICommandValidatorError + - ICommandValidatorResponse + - IConstructor + - IHelpGenerator + - IHelpGeneratorFactory + - IYargsParms + - IYargsResponse + - Deprecated the following classes: + - Operation + - Operations + +## `8.0.0-next.202406111728` + +- Enhancement: Added `BufferBuilder` utility class to provide convenient way of downloading to a stream that can be read as a buffer. [#2167](https://github.com/zowe/zowe-cli/pull/2167) +- BugFix: Fixed error in REST client that when using stream could cause small data sets to download with incomplete contents. [#744](https://github.com/zowe/zowe-cli/issues/744) +- BugFix: Updated `micromatch` dependency for technical currency. [#2167](https://github.com/zowe/zowe-cli/pull/2167) + ## `8.0.0-next.202406061600` - BugFix: Updated `braces` dependency for technical currency. [#2158](https://github.com/zowe/zowe-cli/pull/2158) @@ -335,6 +385,20 @@ All notable changes to the Imperative package will be documented in this file. - Major: First major version bump for V3 +## `5.24.0` + +- Enhancement: Added `BufferBuilder` utility class to provide convenient way of downloading to a stream that can be read as a buffer. [#2167](https://github.com/zowe/zowe-cli/pull/2167) +- BugFix: Fixed error in REST client that when using stream could cause small data sets to download with incomplete contents. [#744](https://github.com/zowe/zowe-cli/issues/744) +- BugFix: Updated `micromatch` dependency for technical currency. [#2167](https://github.com/zowe/zowe-cli/pull/2167) + +## `5.23.4` + +- BugFix: Updated `braces` dependency for technical currency. [#2157](https://github.com/zowe/zowe-cli/pull/2157) + +## `5.23.3` + +- BugFix: Modified error text in SyntaxValidator.invalidOptionError. [#2138](https://github.com/zowe/zowe-cli/issues/2138) + ## `5.23.2` - BugFix: Updated error text for invalid command options so that allowable values are displayed as strings instead of regular expressions when possible. [#1863](https://github.com/zowe/zowe-cli/issues/1863) diff --git a/packages/imperative/__tests__/__integration__/imperative/__tests__/__integration__/cli/test/cli.imperative-test-cli.test.logging.integration.test.ts b/packages/imperative/__tests__/__integration__/imperative/__tests__/__integration__/cli/test/cli.imperative-test-cli.test.logging.integration.test.ts index e86ee2d981..b50db96221 100644 --- a/packages/imperative/__tests__/__integration__/imperative/__tests__/__integration__/cli/test/cli.imperative-test-cli.test.logging.integration.test.ts +++ b/packages/imperative/__tests__/__integration__/imperative/__tests__/__integration__/cli/test/cli.imperative-test-cli.test.logging.integration.test.ts @@ -15,7 +15,7 @@ import { runCliScript } from "../../../../../../src/TestUtil"; import { SetupTestEnvironment } from "../../../../../../__src__/environment/SetupTestEnvironment"; import { ITestEnvironment } from "../../../../../../__src__/environment/doc/response/ITestEnvironment"; import { TestLogger } from "../../../../../../src/TestLogger"; -import { LoggerConfigBuilder } from "../../../../../../../src"; +import { LoggerConfigBuilder } from "../../../../../../../src/logger/src/LoggerConfigBuilder"; // Test Environment populated in the beforeAll(); let TEST_ENVIRONMENT: ITestEnvironment; diff --git a/packages/imperative/__tests__/src/packages/cmd/__integration__/SyntaxValidator.integration.test.ts b/packages/imperative/__tests__/src/packages/cmd/__integration__/SyntaxValidator.integration.test.ts index 6f80c0c2c0..6032192a6b 100644 --- a/packages/imperative/__tests__/src/packages/cmd/__integration__/SyntaxValidator.integration.test.ts +++ b/packages/imperative/__tests__/src/packages/cmd/__integration__/SyntaxValidator.integration.test.ts @@ -10,7 +10,8 @@ */ /* eslint-disable jest/expect-expect */ -import { CommandProcessor, ICommandDefinition, ICommandResponse } from "../../../../../src/cmd/index"; +import { CommandProcessor } from "../../../../../src/cmd/src/CommandProcessor"; +import { ICommandDefinition, ICommandResponse } from "../../../../../src/cmd/index"; import { ValidationTestCommand } from "../ValidationTestCommand"; import { Constants } from "../../../../../src/constants/index"; import { Imperative } from "../../../../../src/imperative/src/Imperative"; diff --git a/packages/imperative/package.json b/packages/imperative/package.json index e0583352d0..4748c9ffc9 100644 --- a/packages/imperative/package.json +++ b/packages/imperative/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/imperative", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "description": "framework for building configurable CLIs", "author": "Zowe", "license": "EPL-2.0", @@ -92,7 +92,7 @@ "@types/pacote": "^11.1.8", "@types/progress": "^2.0.7", "@types/stack-trace": "^0.0.29", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202406061600", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202406111958", "concurrently": "^8.0.0", "cowsay": "^1.6.0", "deep-diff": "^1.0.0", diff --git a/packages/imperative/src/cmd/__tests__/utils/CommandUtils.unit.test.ts b/packages/imperative/src/cmd/__tests__/utils/CommandUtils.unit.test.ts index c92e854337..481617c959 100644 --- a/packages/imperative/src/cmd/__tests__/utils/CommandUtils.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/utils/CommandUtils.unit.test.ts @@ -15,7 +15,8 @@ import { ICommandOptionDefinition } from "../../src/doc/option/ICommandOptionDef import { COMPLEX_COMMAND, COMPLEX_COMMAND_WITH_ALIASES, MULTIPLE_GROUPS } from "../__resources__/CommandDefinitions"; import { TestLogger } from "../../../../__tests__/src/TestLogger"; import { inspect } from "util"; -import { CommandUtils, ICommandTreeEntry } from "../../"; +import { CommandUtils } from "../../src/utils/CommandUtils"; +import { ICommandTreeEntry } from "../../src/utils/CommandUtils"; import { cloneDeep } from "lodash"; // UnitTestUtils.replaceIt(); diff --git a/packages/imperative/src/cmd/__tests__/yargs/YargsConfigurer.unit.test.ts b/packages/imperative/src/cmd/__tests__/yargs/YargsConfigurer.unit.test.ts index a8fdb33957..45ce0c0c45 100644 --- a/packages/imperative/src/cmd/__tests__/yargs/YargsConfigurer.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/yargs/YargsConfigurer.unit.test.ts @@ -10,7 +10,8 @@ */ import { CommandProcessor } from "../../src/CommandProcessor"; -import { Constants, ImperativeConfig, YargsConfigurer } from "../../.."; +import { Constants, ImperativeConfig } from "../../.."; +import { YargsConfigurer } from "../../src/yargs/YargsConfigurer"; jest.mock("yargs"); jest.mock("../../src/CommandProcessor"); diff --git a/packages/imperative/src/cmd/index.ts b/packages/imperative/src/cmd/index.ts index 98b2d91411..db5ee98923 100644 --- a/packages/imperative/src/cmd/index.ts +++ b/packages/imperative/src/cmd/index.ts @@ -13,8 +13,8 @@ export * from "./src/doc/profiles/definition/ICommandProfileSchema"; export * from "./src/doc/profiles/definition/ICommandProfileProperty"; export * from "./src/doc/profiles/definition/ICommandProfileTypeConfiguration"; export * from "./src/doc/handler/ICommandHandler"; -export * from "./src/doc/handler/ICommandHandlerResponseChecker"; -export * from "./src/doc/handler/ICommandHandlerResponseValidator"; +// export * from "./src/doc/handler/ICommandHandlerResponseChecker"; +// export * from "./src/doc/handler/ICommandHandlerResponseValidator"; export * from "./src/doc/handler/IHandlerParameters"; export * from "./src/doc/handler/IChainedHandlerEntry"; export * from "./src/doc/handler/IChainedHandlerArgumentMapping"; @@ -26,8 +26,8 @@ export * from "./src/doc/option/ICommandPositionalDefinition"; export * from "./src/doc/response/response/ICommandResponse"; export * from "./src/doc/response/parms/ICommandResponseParms"; -export * from "./src/doc/response/response/ICommandValidatorError"; -export * from "./src/doc/response/response/ICommandValidatorResponse"; +// export * from "./src/doc/response/response/ICommandValidatorError"; +// export * from "./src/doc/response/response/ICommandValidatorResponse"; export * from "./src/doc/ICommandDefinition"; export * from "./src/doc/ICommandDefinitionPassOn"; @@ -36,46 +36,44 @@ export * from "./src/doc/IPartialCommandDefinition"; export * from "./src/doc/args/ICommandArguments"; -export * from "./src/handlers/FailedCommandHandler"; +// export * from "./src/handlers/FailedCommandHandler"; -export * from "./src/help/abstract/AbstractHelpGenerator"; -export * from "./src/help/abstract/AbstractHelpGeneratorFactory"; +// export * from "./src/help/abstract/AbstractHelpGenerator"; +// export * from "./src/help/abstract/AbstractHelpGeneratorFactory"; -export * from "./src/help/doc/IHelpGeneratorFactory"; +// export * from "./src/help/doc/IHelpGeneratorFactory"; export * from "./src/help/doc/IHelpGeneratorFactoryParms"; export * from "./src/help/doc/IHelpGeneratorParms"; export * from "./src/help/DefaultHelpGenerator"; -export * from "./src/help/HelpConstants"; -export * from "./src/help/HelpGeneratorFactory"; -export * from "./src/help/doc/IHelpGenerator"; +// export * from "./src/help/HelpConstants"; +// export * from "./src/help/HelpGeneratorFactory"; +// export * from "./src/help/doc/IHelpGenerator"; +// export * from "./src/help/WebHelpManager"; export * from "./src/help/WebHelpGenerator"; -export * from "./src/help/WebHelpManager"; export * from "./src/doc/profiles/definition/ICommandProfile"; export * from "./src/doc/profiles/definition/ICommandProfileTypeConfiguration"; export * from "./src/profiles/CliProfileManager"; -export * from "./src/syntax/SyntaxValidator"; +// export * from "./src/syntax/SyntaxValidator"; -export * from "./src/utils/CommandUtils"; -export * from "./src/utils/SharedOptions"; +// export * from "./src/utils/CommandUtils"; +// export * from "./src/utils/SharedOptions"; -export * from "./src/yargs/doc/IYargsParms"; -export * from "./src/yargs/doc/IYargsResponse"; +// export * from "./src/yargs/doc/IYargsParms"; +// export * from "./src/yargs/doc/IYargsResponse"; -export * from "./src/yargs/AbstractCommandYargs"; -export * from "./src/yargs/CommandYargs"; -export * from "./src/yargs/GroupCommandYargs"; -export * from "./src/yargs/YargsConfigurer"; -export * from "./src/yargs/YargsDefiner"; +// export * from "./src/yargs/AbstractCommandYargs"; +// export * from "./src/yargs/CommandYargs"; +// export * from "./src/yargs/GroupCommandYargs"; +// export * from "./src/yargs/YargsConfigurer"; +// export * from "./src/yargs/YargsDefiner"; -export * from "./src/CommandPreparer"; -export * from "./src/CommandProcessor"; -export * from "./src/response/CommandResponse"; +// export * from "./src/CommandPreparer"; +// export * from "./src/CommandProcessor"; export * from "./src/profiles/CommandProfiles"; - export * from "./src/response/CommandResponse"; export * from "./src/response/HandlerResponse"; diff --git a/packages/imperative/src/cmd/src/response/CommandResponse.ts b/packages/imperative/src/cmd/src/response/CommandResponse.ts index 736def62a4..d35af49898 100644 --- a/packages/imperative/src/cmd/src/response/CommandResponse.ts +++ b/packages/imperative/src/cmd/src/response/CommandResponse.ts @@ -34,7 +34,8 @@ import * as tty from "tty"; import { IPromptOptions } from "../doc/response/api/handler/IPromptOptions"; import { DaemonRequest } from "../../../utilities/src/DaemonRequest"; import { IDaemonResponse } from "../../../utilities/src/doc/IDaemonResponse"; -import { Logger, LoggerUtils } from "../../../logger"; +import { Logger } from "../../../logger"; +import { LoggerUtils } from "../../../logger/src/LoggerUtils"; const DataObjectParser = require("dataobject-parser"); diff --git a/packages/imperative/src/cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts b/packages/imperative/src/cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts index 2d8c31330c..5d9b50eea0 100644 --- a/packages/imperative/src/cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts +++ b/packages/imperative/src/cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts @@ -15,7 +15,8 @@ import { TextUtils } from "../../../../utilities"; jest.mock("../../../../imperative/src/Imperative"); import { inspect } from "util"; import { TestLogger } from "../../../../../__tests__/src/TestLogger"; -import { CommandResponse, ICommandDefinition, ICommandValidatorResponse } from "../../../"; +import { ICommandValidatorResponse } from "../../doc/response/response/ICommandValidatorResponse"; +import { CommandResponse, ICommandDefinition } from "../../../"; import { ValidationTestCommand } from "../../../../../__tests__/src/packages/cmd/ValidationTestCommand"; import { SyntaxValidator } from "../SyntaxValidator"; import { Constants } from "../../../../constants"; diff --git a/packages/imperative/src/config/__tests__/ConfigAutoStore.unit.test.ts b/packages/imperative/src/config/__tests__/ConfigAutoStore.unit.test.ts index 73a22e7908..71f0fa1f85 100644 --- a/packages/imperative/src/config/__tests__/ConfigAutoStore.unit.test.ts +++ b/packages/imperative/src/config/__tests__/ConfigAutoStore.unit.test.ts @@ -12,7 +12,7 @@ jest.mock("../../logger/src/LoggerUtils"); jest.mock("../../events/src/ImperativeEventEmitter"); -import { AbstractAuthHandler } from "../../imperative"; +import { AbstractAuthHandler } from "../../imperative/src/auth/handlers/AbstractAuthHandler"; import { SessConstants } from "../../rest"; import { ImperativeConfig } from "../../utilities"; import { ConfigAutoStore } from "../src/ConfigAutoStore"; diff --git a/packages/imperative/src/config/index.ts b/packages/imperative/src/config/index.ts index 4fa8da4708..60e5d41778 100644 --- a/packages/imperative/src/config/index.ts +++ b/packages/imperative/src/config/index.ts @@ -10,7 +10,7 @@ */ export * from "./src/Config"; -export * from "./src/ConfigAutoStore"; +// export * from "./src/ConfigAutoStore"; export * from "./src/ConfigBuilder"; export * from "./src/ConfigConstants"; export * from "./src/ConfigSchema"; diff --git a/packages/imperative/src/config/src/ProfileInfo.ts b/packages/imperative/src/config/src/ProfileInfo.ts index df546c63d3..3e4d45a976 100644 --- a/packages/imperative/src/config/src/ProfileInfo.ts +++ b/packages/imperative/src/config/src/ProfileInfo.ts @@ -39,7 +39,8 @@ import { IProfileLoaded, IProfileProperty, IProfileSchema } from "../../profiles // for imperative operations import { CliUtils, ImperativeConfig } from "../../utilities"; import { ImperativeExpect } from "../../expect"; -import { Logger, LoggerUtils } from "../../logger"; +import { Logger } from "../../logger"; +import { LoggerUtils } from "../../logger/src/LoggerUtils"; import { IOptionsForAddConnProps, ISession, Session, SessConstants, ConnectionPropsForSessCfg } from "../../rest"; diff --git a/packages/imperative/src/imperative/__tests__/ConfigValidator.unit.test.ts b/packages/imperative/src/imperative/__tests__/ConfigValidator.unit.test.ts index 6bce5294c1..43646c805e 100644 --- a/packages/imperative/src/imperative/__tests__/ConfigValidator.unit.test.ts +++ b/packages/imperative/src/imperative/__tests__/ConfigValidator.unit.test.ts @@ -9,7 +9,8 @@ * */ -import { ConfigurationValidator, IImperativeConfig } from "../index"; +import { IImperativeConfig } from ".."; +import { ConfigurationValidator } from "../src/ConfigurationValidator"; describe("Imperative should validate config provided by the consumer", () => { diff --git a/packages/imperative/src/imperative/__tests__/ConfigurationLoader.unit.test.ts b/packages/imperative/src/imperative/__tests__/ConfigurationLoader.unit.test.ts index ed29e8905b..de23bdb8d4 100644 --- a/packages/imperative/src/imperative/__tests__/ConfigurationLoader.unit.test.ts +++ b/packages/imperative/src/imperative/__tests__/ConfigurationLoader.unit.test.ts @@ -9,7 +9,7 @@ * */ -import { ConfigurationLoader } from ".."; +import { ConfigurationLoader } from "../src/ConfigurationLoader"; import { IImperativeOverrides } from "../src/doc/IImperativeOverrides"; import { IApimlSvcAttrs } from "../src/doc/IApimlSvcAttrs"; import { homedir } from "os"; diff --git a/packages/imperative/src/imperative/__tests__/handlers/DefaultRootCommandHandler.unit.test.ts b/packages/imperative/src/imperative/__tests__/handlers/DefaultRootCommandHandler.unit.test.ts index b98317b2aa..f9f931687d 100644 --- a/packages/imperative/src/imperative/__tests__/handlers/DefaultRootCommandHandler.unit.test.ts +++ b/packages/imperative/src/imperative/__tests__/handlers/DefaultRootCommandHandler.unit.test.ts @@ -13,7 +13,8 @@ jest.mock("../../../utilities/src/ImperativeConfig"); jest.mock("../../../imperative/src/Imperative"); import { TestLogger } from "../../../../__tests__/src/TestLogger"; -import { ICommandDefinition, CommandResponse, CommandPreparer, ICommandHandler } from "../../../cmd"; +import { CommandPreparer } from "../../../cmd/src/CommandPreparer"; +import { ICommandDefinition, CommandResponse, ICommandHandler } from "../../../cmd"; import { ICommandHandlerRequire } from "../../../cmd/src/doc/handler/ICommandHandlerRequire"; import { ImperativeConfig } from "../../../utilities/src/ImperativeConfig"; diff --git a/packages/imperative/src/imperative/index.ts b/packages/imperative/src/imperative/index.ts index b93c2a3f00..e34d98c792 100644 --- a/packages/imperative/src/imperative/index.ts +++ b/packages/imperative/src/imperative/index.ts @@ -17,14 +17,14 @@ export * from "./src/doc/IImperativeEnvironmentalVariableSettings"; export * from "./src/doc/IImperativeConfig"; export * from "./src/doc/IImperativeLoggingConfig"; export * from "./src/doc/IImperativeVersions"; -export * from "./src/ConfigurationLoader"; -export * from "./src/ConfigurationValidator"; -export * from "./src/DefinitionTreeResolver"; +// export * from "./src/ConfigurationLoader"; +// export * from "./src/ConfigurationValidator"; +// export * from "./src/DefinitionTreeResolver"; export * from "./src/Imperative"; export * from "./src/LoggingConfigurer"; export * from "./src/plugins/AbstractPluginLifeCycle"; export * from "./src/plugins/PluginManagementFacility"; export * from "./src/auth/doc/IAuthHandlerApi"; -export * from "./src/auth/handlers/AbstractAuthHandler"; +// export * from "./src/auth/handlers/AbstractAuthHandler"; export * from "./src/auth/handlers/BaseAuthHandler"; export * from "./src/config/cmd/auto-init/handlers/BaseAutoInitHandler"; diff --git a/packages/imperative/src/imperative/src/__mocks__/Imperative.ts b/packages/imperative/src/imperative/src/__mocks__/Imperative.ts index c35c52b03f..17cd5bc59e 100644 --- a/packages/imperative/src/imperative/src/__mocks__/Imperative.ts +++ b/packages/imperative/src/imperative/src/__mocks__/Imperative.ts @@ -10,7 +10,9 @@ */ import { TextUtils } from "../../../utilities/"; -import { AbstractHelpGenerator, DefaultHelpGenerator, IHelpGeneratorParms, ICommandDefinition } from "../../../cmd"; +import { AbstractHelpGenerator } from "../../../cmd/src/help/abstract/AbstractHelpGenerator"; +import { IHelpGeneratorParms } from "../../../cmd/src/help/doc/IHelpGeneratorParms"; +import { DefaultHelpGenerator, ICommandDefinition } from "../../../cmd"; import { IImperativeConfig } from "../doc/IImperativeConfig"; const PRIMARY_COLOR: string = "yellow"; diff --git a/packages/imperative/src/imperative/src/config/cmd/secure/secure.handler.ts b/packages/imperative/src/imperative/src/config/cmd/secure/secure.handler.ts index 9398585097..582be79f75 100644 --- a/packages/imperative/src/imperative/src/config/cmd/secure/secure.handler.ts +++ b/packages/imperative/src/imperative/src/config/cmd/secure/secure.handler.ts @@ -10,7 +10,8 @@ */ import { ICommandArguments, ICommandHandler, IHandlerParameters } from "../../../../../cmd"; -import { Config, ConfigAutoStore, ConfigConstants, ConfigSchema } from "../../../../../config"; +import { Config, ConfigConstants, ConfigSchema } from "../../../../../config"; +import { ConfigAutoStore } from "../../../../../config/src/ConfigAutoStore"; import { ConfigUtils } from "../../../../../config/src/ConfigUtils"; import { ImperativeError } from "../../../../../error"; import { Logger } from "../../../../../logger"; diff --git a/packages/imperative/src/imperative/src/handlers/DefaultRootCommandHandler.ts b/packages/imperative/src/imperative/src/handlers/DefaultRootCommandHandler.ts index 55cbba6e05..3232c829cb 100644 --- a/packages/imperative/src/imperative/src/handlers/DefaultRootCommandHandler.ts +++ b/packages/imperative/src/imperative/src/handlers/DefaultRootCommandHandler.ts @@ -10,7 +10,9 @@ */ import { Imperative } from "../../../imperative/src/Imperative"; -import { ICommandHandler, IHandlerParameters, ICommandTreeEntry, CommandUtils } from "../../../cmd"; +import { ICommandTreeEntry } from "../../../cmd/src/utils/CommandUtils"; +import { CommandUtils } from "../../../cmd/src/utils/CommandUtils"; +import { ICommandHandler, IHandlerParameters } from "../../../cmd"; import { ImperativeConfig, TextUtils } from "../../../utilities"; import { WebHelpManager } from "../../../cmd/src/help/WebHelpManager"; import { IImperativeVersions } from "../doc/IImperativeVersions"; diff --git a/packages/imperative/src/imperative/src/help/ImperativeHelpGeneratorFactory.ts b/packages/imperative/src/imperative/src/help/ImperativeHelpGeneratorFactory.ts index 3b3d585f30..605a7181b5 100644 --- a/packages/imperative/src/imperative/src/help/ImperativeHelpGeneratorFactory.ts +++ b/packages/imperative/src/imperative/src/help/ImperativeHelpGeneratorFactory.ts @@ -9,10 +9,10 @@ * */ -import { IHelpGenerator, - HelpGeneratorFactory, - IHelpGeneratorParms, - AbstractHelpGeneratorFactory } from "../../../cmd"; +import { IHelpGenerator } from "../../../cmd/src/help/doc/IHelpGenerator"; +import { HelpGeneratorFactory } from "../../../cmd/src/help/HelpGeneratorFactory"; +import { IHelpGeneratorParms } from "../../../cmd/src/help/doc/IHelpGeneratorParms"; +import { AbstractHelpGeneratorFactory } from "../../../cmd/src/help/abstract/AbstractHelpGeneratorFactory"; import { IImperativeConfig } from "../doc/IImperativeConfig"; /** * Imperative Help generator factory passed to yargs to build help generators where needed. diff --git a/packages/imperative/src/index.ts b/packages/imperative/src/index.ts index 08493bc401..4fe4232ed7 100644 --- a/packages/imperative/src/index.ts +++ b/packages/imperative/src/index.ts @@ -17,11 +17,11 @@ export * from "./events"; export * from "./error"; export * from "./expect"; export * from "./imperative"; +// export * from "./interfaces"; export * from "./io"; export * from "./logger"; export * from "./messages"; export * from "./operations"; -export * from "./interfaces"; export * from "./profiles"; export * from "./rest"; export * from "./security"; diff --git a/packages/imperative/src/logger/__tests__/LoggerConfigBuilder.unit.test.ts b/packages/imperative/src/logger/__tests__/LoggerConfigBuilder.unit.test.ts index 2bbf952ec5..8190706149 100644 --- a/packages/imperative/src/logger/__tests__/LoggerConfigBuilder.unit.test.ts +++ b/packages/imperative/src/logger/__tests__/LoggerConfigBuilder.unit.test.ts @@ -9,7 +9,7 @@ * */ -import { LoggerConfigBuilder } from "../../logger"; +import { LoggerConfigBuilder } from "../src/LoggerConfigBuilder"; import * as os from "os"; import * as path from "path"; diff --git a/packages/imperative/src/logger/__tests__/LoggerUtils.unit.test.ts b/packages/imperative/src/logger/__tests__/LoggerUtils.unit.test.ts index fe82898085..f1a6d8380f 100644 --- a/packages/imperative/src/logger/__tests__/LoggerUtils.unit.test.ts +++ b/packages/imperative/src/logger/__tests__/LoggerUtils.unit.test.ts @@ -10,7 +10,7 @@ */ import { EnvironmentalVariableSettings } from "../../imperative/src/env/EnvironmentalVariableSettings"; -import { LoggerUtils } from "../../logger"; +import { LoggerUtils } from "../src/LoggerUtils"; import { ImperativeConfig } from "../../utilities/src/ImperativeConfig"; describe("LoggerUtils tests", () => { diff --git a/packages/imperative/src/logger/index.ts b/packages/imperative/src/logger/index.ts index d5f79edc41..9374b82aa8 100644 --- a/packages/imperative/src/logger/index.ts +++ b/packages/imperative/src/logger/index.ts @@ -14,5 +14,5 @@ export * from "./src/doc/ILog4jsAppender"; export * from "./src/doc/ILog4jsConfig"; export * from "./src/doc/ILog4jsLayout"; export * from "./src/Logger"; -export * from "./src/LoggerConfigBuilder"; -export * from "./src/LoggerUtils"; +// export * from "./src/LoggerConfigBuilder"; +// export * from "./src/LoggerUtils"; diff --git a/packages/imperative/src/operations/src/Operation.ts b/packages/imperative/src/operations/src/Operation.ts index 7e8bedd4ce..cb9ceabfe6 100644 --- a/packages/imperative/src/operations/src/Operation.ts +++ b/packages/imperative/src/operations/src/Operation.ts @@ -28,6 +28,9 @@ export type IOperationUndoCompleted = export type IOperationResultReady = (output: T, operationResults: IOperationResult) => void; +/** + * @deprecated + */ export abstract class Operation implements ITaskWithStatus { public static readonly NO_PARMS: any = null; diff --git a/packages/imperative/src/operations/src/Operations.ts b/packages/imperative/src/operations/src/Operations.ts index 507ded9d01..e5c372c661 100644 --- a/packages/imperative/src/operations/src/Operations.ts +++ b/packages/imperative/src/operations/src/Operations.ts @@ -15,6 +15,7 @@ import { TextUtils } from "../../utilities"; import { TaskProgress } from "./TaskProgress"; /** + * @deprecated * The Operations class extends Operation and is used to create a 'string' of operations that must * be completed in serial order. * diff --git a/packages/imperative/src/profiles/index.ts b/packages/imperative/src/profiles/index.ts index 9c83cea9cb..5d88f7458d 100644 --- a/packages/imperative/src/profiles/index.ts +++ b/packages/imperative/src/profiles/index.ts @@ -24,7 +24,6 @@ export * from "./src/doc/response/IProfileLoaded"; export * from "./src/utils/V1ProfileRead"; export * from "./src/utils/ProfileUtils"; -export * from "./src/utils"; export * from "./src/validation/doc/IProfileValidationPlan"; export * from "./src/validation/doc/IProfileValidationReport"; diff --git a/packages/imperative/src/profiles/src/utils/index.ts b/packages/imperative/src/profiles/src/utils/index.ts deleted file mode 100644 index 4061927db0..0000000000 --- a/packages/imperative/src/profiles/src/utils/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* -* This program and the accompanying materials are made available under the terms of the -* Eclipse Public License v2.0 which accompanies this distribution, and is available at -* https://www.eclipse.org/legal/epl-v20.html -* -* SPDX-License-Identifier: EPL-2.0 -* -* Copyright Contributors to the Zowe Project. -* -*/ - -export * from "./V1ProfileRead"; -export * from "./ProfileUtils"; diff --git a/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts b/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts index aaacbba40d..39dd1caa19 100644 --- a/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts +++ b/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts @@ -17,7 +17,8 @@ import { VALIDATION_OUTCOME } from "../doc/IProfileValidationTask"; import { IProfileValidationTaskResult } from "../doc/IProfileValidationTaskResult"; -import { Logger, LoggerUtils } from "../../../../logger"; +import { Logger } from "../../../../logger"; +import { LoggerUtils } from "../../../../logger/src/LoggerUtils"; import { TextUtils } from "../../../../utilities"; import { IPromiseWithProgress, ITaskWithStatus, TaskProgress, TaskStage } from "../../../../operations"; import { ICommandOptionDefinition } from "../../../../cmd"; diff --git a/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts b/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts index 0860187746..bee872c8a7 100644 --- a/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts +++ b/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts @@ -464,7 +464,7 @@ describe("AbstractRestClient tests", () => { const fakeResponseStream: any = { write: jest.fn(), on: jest.fn(), - end: jest.fn(), + end: jest.fn((cb: any) => cb()), writableFinished: true }; const fakeRequestStream: any = { diff --git a/packages/imperative/src/rest/index.ts b/packages/imperative/src/rest/index.ts index b5f48dbe18..27c81369cf 100644 --- a/packages/imperative/src/rest/index.ts +++ b/packages/imperative/src/rest/index.ts @@ -18,10 +18,10 @@ export * from "./src/client/doc/IRestClientResponse"; export * from "./src/client/doc/IRestOptions"; export * from "./src/client/Headers"; export * from "./src/client/AbstractRestClient"; -export * from "./src/client/CompressionUtils"; +// export * from "./src/client/CompressionUtils"; export * from "./src/client/RestClient"; export * from "./src/client/RestConstants"; -export * from "./src/client/RestStandAloneUtils"; +// export * from "./src/client/RestStandAloneUtils"; export * from "./src/client/RestClientError"; export * as SessConstants from "./src/session/SessConstants"; diff --git a/packages/imperative/src/rest/src/client/AbstractRestClient.ts b/packages/imperative/src/rest/src/client/AbstractRestClient.ts index 469613cd5f..832268c55e 100644 --- a/packages/imperative/src/rest/src/client/AbstractRestClient.ts +++ b/packages/imperative/src/rest/src/client/AbstractRestClient.ts @@ -789,10 +789,6 @@ export abstract class AbstractRestClient { this.mTask.percentComplete = TaskProgress.ONE_HUNDRED_PERCENT; this.mTask.stageName = TaskStage.COMPLETE; } - if (this.mResponseStream != null) { - this.log.debug("Ending response stream"); - this.mResponseStream.end(); - } if (this.mContentEncoding != null && this.mData.length > 0) { this.log.debug("Decompressing encoded response"); try { @@ -801,22 +797,25 @@ export abstract class AbstractRestClient { this.mReject(err); } } - if (this.requestFailure) { - // Reject the promise with an error - const httpStatus = this.response == null ? undefined : this.response.statusCode; - this.mReject(this.populateError({ - msg: "Rest API failure with HTTP(S) status " + httpStatus, - causeErrors: this.dataString, - source: "http" - })); - } else if (this.mResponseStream != null && this.mResponseStream.writableEnded) { - // This will correct any instances where the finished event does not get emitted - // even though the stream processing has ended. - this.mResolve(this.dataString); - } else if (this.mResponseStream != null && !this.mResponseStream.writableFinished) { - this.mResponseStream.on("finish", () => this.mResolve(this.dataString)); + + const requestEnd = () => { + if (this.requestFailure) { + // Reject the promise with an error + const httpStatus = this.response == null ? undefined : this.response.statusCode; + this.mReject(this.populateError({ + msg: "Rest API failure with HTTP(S) status " + httpStatus, + causeErrors: this.dataString, + source: "http" + })); + } else { + this.mResolve(this.dataString); + } + }; + if (this.mResponseStream != null) { + this.log.debug("Ending response stream"); + this.mResponseStream.end(requestEnd); } else { - this.mResolve(this.dataString); + requestEnd(); } } diff --git a/packages/imperative/src/rest/src/client/doc/IHeaderContent.ts b/packages/imperative/src/rest/src/client/doc/IHeaderContent.ts index 0a6d69dade..776e788566 100644 --- a/packages/imperative/src/rest/src/client/doc/IHeaderContent.ts +++ b/packages/imperative/src/rest/src/client/doc/IHeaderContent.ts @@ -9,6 +9,11 @@ * */ +/** + * Interface to add index signature to http headers + * @export + * @interface IHeaderContent + */ export interface IHeaderContent { [key: string]: string; } diff --git a/packages/imperative/src/utilities/__tests__/BufferBuilder.unit.test.ts b/packages/imperative/src/utilities/__tests__/BufferBuilder.unit.test.ts new file mode 100644 index 0000000000..554c79bfa9 --- /dev/null +++ b/packages/imperative/src/utilities/__tests__/BufferBuilder.unit.test.ts @@ -0,0 +1,30 @@ +/* +* This program and the accompanying materials are made available under the terms of the +* Eclipse Public License v2.0 which accompanies this distribution, and is available at +* https://www.eclipse.org/legal/epl-v20.html +* +* SPDX-License-Identifier: EPL-2.0 +* +* Copyright Contributors to the Zowe Project. +* +*/ + +import { BufferBuilder } from "../src/BufferBuilder"; + +describe("BufferBuilder", () => { + it("calls the given callback on write", () => { + const bufBuilder = new BufferBuilder(); + const callbackMock = jest.fn(); + bufBuilder._write(new Uint8Array([1, 2, 3]), "binary", callbackMock); + expect(callbackMock).toHaveBeenCalled(); + }); + + it("calls 'push' on read", () => { + const bufBuilder = new BufferBuilder(); + const callbackMock = jest.fn(); + const pushMock = jest.spyOn(bufBuilder, "push"); + bufBuilder._write(new Uint8Array([1, 2, 3]), "binary", callbackMock); + bufBuilder._read(3); + expect(pushMock).toHaveBeenCalledTimes(2); + }); +}); diff --git a/packages/imperative/src/utilities/index.ts b/packages/imperative/src/utilities/index.ts index 50422471b8..b3464e1879 100644 --- a/packages/imperative/src/utilities/index.ts +++ b/packages/imperative/src/utilities/index.ts @@ -11,6 +11,7 @@ export * from "./src/doc/IDaemonRequest"; export * from "./src/doc/IDaemonResponse"; +export * from "./src/BufferBuilder"; export * from "./src/DaemonRequest"; export * from "./src/ExecUtils"; export * from "./src/ImperativeConfig"; diff --git a/packages/imperative/src/utilities/src/BufferBuilder.ts b/packages/imperative/src/utilities/src/BufferBuilder.ts new file mode 100644 index 0000000000..6dbfc00286 --- /dev/null +++ b/packages/imperative/src/utilities/src/BufferBuilder.ts @@ -0,0 +1,32 @@ +/* +* This program and the accompanying materials are made available under the terms of the +* Eclipse Public License v2.0 which accompanies this distribution, and is available at +* https://www.eclipse.org/legal/epl-v20.html +* +* SPDX-License-Identifier: EPL-2.0 +* +* Copyright Contributors to the Zowe Project. +* +*/ + +import { Duplex } from "stream"; + +export class BufferBuilder extends Duplex { + private chunks: Uint8Array[]; + + public constructor() { + super(); + this.chunks = []; + } + + public _write(chunk: any, _encoding: BufferEncoding, callback: (error?: Error) => void): void { + this.chunks.push(chunk); + callback(); + } + + public _read(_size: number): void { + const concatBuf = Buffer.concat(this.chunks); + this.push(concatBuf); + this.push(null); + } +} diff --git a/packages/provisioning/package.json b/packages/provisioning/package.json index 200499d98f..f7abb54fdd 100644 --- a/packages/provisioning/package.json +++ b/packages/provisioning/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/provisioning-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "description": "Zowe SDK to interact with the z/OS provisioning APIs", "author": "Zowe", "license": "EPL-2.0", @@ -49,9 +49,9 @@ }, "devDependencies": { "@types/js-yaml": "^4.0.9", - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/secrets/package.json b/packages/secrets/package.json index 0221cd27e2..750ed1bbd7 100644 --- a/packages/secrets/package.json +++ b/packages/secrets/package.json @@ -3,7 +3,7 @@ "description": "Credential management facilities for Imperative, Zowe CLI, and extenders.", "repository": "https://github.com/zowe/zowe-cli.git", "author": "Zowe", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "homepage": "https://github.com/zowe/zowe-cli/tree/master/packages/secrets#readme", "bugs": { "url": "https://github.com/zowe/zowe-cli/issues" diff --git a/packages/workflows/package.json b/packages/workflows/package.json index 9114c2f870..9d0f8f05c4 100644 --- a/packages/workflows/package.json +++ b/packages/workflows/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-workflows-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "description": "Zowe SDK to interact with the z/OS workflows APIs", "author": "Zowe", "license": "EPL-2.0", @@ -45,12 +45,12 @@ "prepack": "node ../../scripts/prepareLicenses.js" }, "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202406061600" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202406111958" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosconsole/package.json b/packages/zosconsole/package.json index 86fbe097b5..42ef2c50cb 100644 --- a/packages/zosconsole/package.json +++ b/packages/zosconsole/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-console-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "description": "Zowe SDK to interact with the z/OS console", "author": "Zowe", "license": "EPL-2.0", @@ -45,9 +45,9 @@ "prepack": "node ../../scripts/prepareLicenses.js" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosfiles/CHANGELOG.md b/packages/zosfiles/CHANGELOG.md index a78bb2725f..2c4075dd0c 100644 --- a/packages/zosfiles/CHANGELOG.md +++ b/packages/zosfiles/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to the Zowe z/OS files SDK package will be documented in this file. +## `8.0.0-next.202406111958` + +- LTS Breaking: Modified the zos-files SDK. [#2083](https://github.com/zowe/zowe-cli/issues/2083) + - Deprecated the following interfaces: + - IOptionsFullResponse - use `IOptionsFullResponse` from `@zowe/imperative`. + - IRestClientResponse - use `IRestClientResponse` from `@zowe/imperative`. + +## `8.0.0-next.202406111728` + +- BugFix: Fixed error where `Get.dataSet` and `Get.USSFile` methods could silently fail when downloading large data sets or files. [#2167](https://github.com/zowe/zowe-cli/pull/2167) + ## `8.0.0-next.202405202020` - BugFix: Fixed a bug where a data set search would not return a search term if it was at the beginning of a line. [#2147](https://github.com/zowe/zowe-cli/pull/2147) @@ -51,6 +62,14 @@ All notable changes to the Zowe z/OS files SDK package will be documented in thi - Major: First major version bump for V3 +## `7.26.1` + +- BugFix: Fixed `Get.dataSet` and `Get.USSFile` methods so that they return an empty buffer instead of null for empty files. [#2173](https://github.com/zowe/zowe-cli/pull/2173) + +## `7.26.0` + +- BugFix: Fixed error where `Get.dataSet` and `Get.USSFile` methods could silently fail when downloading large data sets or files. [#2167](https://github.com/zowe/zowe-cli/pull/2167) + ## `7.24.0` - BugFix: Fixed error that could occur when listing data set members that contain control characters in the name. [#2104](https://github.com/zowe/zowe-cli/pull/2104) diff --git a/packages/zosfiles/__tests__/__unit__/methods/get/Get.unit.test.ts b/packages/zosfiles/__tests__/__unit__/methods/get/Get.unit.test.ts index 077ef6389c..be310e301a 100644 --- a/packages/zosfiles/__tests__/__unit__/methods/get/Get.unit.test.ts +++ b/packages/zosfiles/__tests__/__unit__/methods/get/Get.unit.test.ts @@ -109,6 +109,32 @@ describe("z/OS Files - View", () => { })); }); + it("should get data set content when empty", async () => { + let response; + let caughtError; + zosmfExpectSpy.mockImplementationOnce(async (_session, options) => { + options.responseStream?.end(); + return {}; + }); + + try { + response = await Get.dataSet(dummySession, dsname); + } catch (e) { + caughtError = e; + } + + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_DS_FILES, dsname); + + expect(caughtError).toBeUndefined(); + expect(response).toEqual(Buffer.alloc(0)); + + expect(zosmfExpectSpy).toHaveBeenCalledTimes(1); + expect(zosmfExpectSpy).toHaveBeenCalledWith(dummySession, expect.objectContaining({ + reqHeaders: [ZosmfHeaders.ACCEPT_ENCODING, ZosmfHeaders.TEXT_PLAIN], + resource: endpoint + })); + }); + it("should get data set content in binary mode", async () => { let response; let caughtError; @@ -369,6 +395,32 @@ describe("z/OS Files - View", () => { })); }); + it("should get uss file content when empty", async () => { + let response; + let caughtError; + zosmfExpectSpy.mockImplementationOnce(async (_session, options) => { + options.responseStream?.end(); + return {}; + }); + + try { + response = await Get.USSFile(dummySession, ussfile); + } catch (e) { + caughtError = e; + } + + const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, ussfile); + + expect(caughtError).toBeUndefined(); + expect(response).toEqual(Buffer.alloc(0)); + + expect(zosmfExpectSpy).toHaveBeenCalledTimes(1); + expect(zosmfExpectSpy).toHaveBeenCalledWith(dummySession, expect.objectContaining({ + reqHeaders: [ZosmfHeaders.ACCEPT_ENCODING, ZosmfHeaders.TEXT_PLAIN], + resource: endpoint + })); + }); + it("should get uss file content in binary mode", async () => { let response; let caughtError; diff --git a/packages/zosfiles/package.json b/packages/zosfiles/package.json index 7bcc33ada7..da898f1c1c 100644 --- a/packages/zosfiles/package.json +++ b/packages/zosfiles/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-files-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "description": "Zowe SDK to interact with files and data sets on z/OS", "author": "Zowe", "license": "EPL-2.0", @@ -49,10 +49,10 @@ "minimatch": "^9.0.3" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202406111958" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosfiles/src/doc/IOptionsFullResponse.ts b/packages/zosfiles/src/doc/IOptionsFullResponse.ts index cbd8ace04e..a93f8d349a 100644 --- a/packages/zosfiles/src/doc/IOptionsFullResponse.ts +++ b/packages/zosfiles/src/doc/IOptionsFullResponse.ts @@ -15,6 +15,7 @@ import { CLIENT_PROPERTY } from "./types/ZosmfRestClientProperties"; /** * Interface to define input options for RestClient GET|POST|PUT|DELETE ExpectFullResponse methods * @export + * @deprecated - Use Imperative's IOptionsFullResponse instead * @interface IOptionsFullResponse */ export interface IOptionsFullResponse { diff --git a/packages/zosfiles/src/doc/IRestClientResponse.ts b/packages/zosfiles/src/doc/IRestClientResponse.ts index 31efe05774..207fab5ea5 100644 --- a/packages/zosfiles/src/doc/IRestClientResponse.ts +++ b/packages/zosfiles/src/doc/IRestClientResponse.ts @@ -15,6 +15,7 @@ import { Session, Logger } from "@zowe/imperative"; /** * Interface to map client's REST call response * @export + * @deprecated - Use Imperative's IRestClientResponse instead * @interface IRestClientResponse */ export interface IRestClientResponse { diff --git a/packages/zosfiles/src/index.ts b/packages/zosfiles/src/index.ts index ed5ca05ae6..0f74955d11 100644 --- a/packages/zosfiles/src/index.ts +++ b/packages/zosfiles/src/index.ts @@ -42,8 +42,4 @@ export * from "./methods/upload"; export * from "./methods/utilities"; export * from "./utils/ZosFilesAttributes"; -export * from "./utils/ZosFilesUtils"; -export * from "./doc/IOptionsFullResponse"; -export * from "./doc/IRestClientResponse"; -export * from "./doc/IOptions"; -export * from "./doc/types/ZosmfRestClientProperties"; \ No newline at end of file +export * from "./utils/ZosFilesUtils"; \ No newline at end of file diff --git a/packages/zosfiles/src/methods/download/Download.ts b/packages/zosfiles/src/methods/download/Download.ts index 6962d4b855..5944f6b6ee 100644 --- a/packages/zosfiles/src/methods/download/Download.ts +++ b/packages/zosfiles/src/methods/download/Download.ts @@ -9,7 +9,8 @@ * */ -import { AbstractSession, Headers, ImperativeExpect, IO, Logger, TaskProgress, ImperativeError, TextUtils, IHeaderContent } from "@zowe/imperative"; +import { AbstractSession, Headers, ImperativeExpect, IO, Logger, TaskProgress, ImperativeError, + TextUtils, IHeaderContent, IOptionsFullResponse, IRestClientResponse } from "@zowe/imperative"; import { posix, join, relative } from "path"; import * as fs from "fs"; @@ -22,9 +23,7 @@ import { IZosFilesResponse } from "../../doc/IZosFilesResponse"; import { ZosFilesUtils } from "../../utils/ZosFilesUtils"; import { List } from "../list/List"; import { IDownloadOptions, IDownloadSingleOptions } from "./doc/IDownloadOptions"; -import { IRestClientResponse } from "../../doc/IRestClientResponse"; import { CLIENT_PROPERTY } from "../../doc/types/ZosmfRestClientProperties"; -import { IOptionsFullResponse } from "../../doc/IOptionsFullResponse"; import { Utilities } from "../utilities"; import { IZosmfListResponse } from "../list/doc/IZosmfListResponse"; import { IDownloadDsmResult } from "./doc/IDownloadDsmResult"; diff --git a/packages/zosfiles/src/methods/get/Get.ts b/packages/zosfiles/src/methods/get/Get.ts index 6bb0aeb362..8996fefeca 100644 --- a/packages/zosfiles/src/methods/get/Get.ts +++ b/packages/zosfiles/src/methods/get/Get.ts @@ -9,9 +9,7 @@ * */ -import { PassThrough } from "stream"; -import { buffer } from 'stream/consumers'; -import { AbstractSession, ImperativeExpect } from "@zowe/imperative"; +import { AbstractSession, BufferBuilder, ImperativeExpect } from "@zowe/imperative"; import { ZosFilesMessages } from "../../constants/ZosFiles.messages"; import { Download } from "../download/Download"; import { IGetOptions } from "./doc/IGetOptions"; @@ -37,12 +35,12 @@ export class Get { ImperativeExpect.toNotBeNullOrUndefined(dataSetName, ZosFilesMessages.missingDatasetName.message); ImperativeExpect.toNotBeEqual(dataSetName, "", ZosFilesMessages.missingDatasetName.message); - const responseStream = new PassThrough(); + const responseStream = new BufferBuilder(); await Download.dataSet(session, dataSetName, { ...options, stream: responseStream }); - return buffer(responseStream); + return responseStream.read() ?? Buffer.alloc(0); } /** @@ -61,11 +59,11 @@ export class Get { ImperativeExpect.toNotBeEqual(USSFileName, "", ZosFilesMessages.missingUSSFileName.message); ImperativeExpect.toNotBeEqual(options.record, true, ZosFilesMessages.unsupportedDataType.message); // This should never exist for USS files - const responseStream = new PassThrough(); + const responseStream = new BufferBuilder(); await Download.ussFile(session, USSFileName, { ...options, stream: responseStream }); - return buffer(responseStream); + return responseStream.read() ?? Buffer.alloc(0); } } diff --git a/packages/zosfiles/src/methods/upload/Upload.ts b/packages/zosfiles/src/methods/upload/Upload.ts index 87d5ead3e0..985cf0455c 100644 --- a/packages/zosfiles/src/methods/upload/Upload.ts +++ b/packages/zosfiles/src/methods/upload/Upload.ts @@ -9,7 +9,8 @@ * */ -import { AbstractSession, Headers, ImperativeError, ImperativeExpect, IO, Logger, TaskProgress, IHeaderContent } from "@zowe/imperative"; +import { AbstractSession, Headers, ImperativeError, ImperativeExpect, IO, Logger, + TaskProgress, IHeaderContent, IOptionsFullResponse, IRestClientResponse } from "@zowe/imperative"; import * as fs from "fs"; import * as path from "path"; @@ -27,8 +28,6 @@ import { IUploadFile } from "./doc/IUploadFile"; import { IUploadDir } from "./doc/IUploadDir"; import { Utilities, Tag } from "../utilities"; import { Readable } from "stream"; -import { IOptionsFullResponse } from "../../doc/IOptionsFullResponse"; -import { IRestClientResponse } from "../../doc/IRestClientResponse"; import { CLIENT_PROPERTY } from "../../doc/types/ZosmfRestClientProperties"; import { TransferMode } from "../../utils/ZosFilesAttributes"; diff --git a/packages/zosjobs/CHANGELOG.md b/packages/zosjobs/CHANGELOG.md index 461c409a11..3a9e34e18c 100644 --- a/packages/zosjobs/CHANGELOG.md +++ b/packages/zosjobs/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Zowe z/OS jobs SDK package will be documented in this file. +## `8.0.0-next.202406111728` + +- BugFix: Fixed error in `DownloadJobs.downloadSpoolContentCommon` method when encoding parameter is not specified. [#2173](https://github.com/zowe/zowe-cli/pull/2173) + ## `8.0.0-next.202403131702` - BugFix: Removing stack trace for zosjobs errors. Added constant to JobsMessages.ts for error handling. [#2078](https://github.com/zowe/zowe-cli/pull/2078) @@ -27,6 +31,10 @@ All notable changes to the Zowe z/OS jobs SDK package will be documented in this - Major: First major version bump for V3 +## `7.26.1` + +- BugFix: Fixed error in `DownloadJobs.downloadSpoolContentCommon` method when encoding parameter is not specified. [#2173](https://github.com/zowe/zowe-cli/pull/2173) + ## `7.25.0` - Enhancement: Added the ability to set `internalReaderFileEncoding` on the `submitJcl`, `submitJclString`, `submitJclCommon`, `submitJclNotify`, and `submitJclNotifyCommon` Jobs APIs [#2139](https://github.com/zowe/zowe-cli/pull/2139) diff --git a/packages/zosjobs/__tests__/__unit__/DownloadJobs.unit.test.ts b/packages/zosjobs/__tests__/__unit__/DownloadJobs.unit.test.ts index e226f35cad..9f8497ca1a 100644 --- a/packages/zosjobs/__tests__/__unit__/DownloadJobs.unit.test.ts +++ b/packages/zosjobs/__tests__/__unit__/DownloadJobs.unit.test.ts @@ -103,6 +103,10 @@ describe("DownloadJobs", () => { describe("downloadAllSpoolContentCommon", () => { it("should allow users to call downloadAllSpoolContentCommon with correct parameters", async () => { + let uri: string = ""; + ZosmfRestClient.getStreamed = jest.fn(async (session: AbstractSession, resource: string, reqHeaders?: any[]): Promise => { + uri = resource; + }); const allSpoolParms: IDownloadAllSpoolContentParms = { jobid: fakeJobID, jobname: fakeJobName, @@ -116,6 +120,7 @@ describe("DownloadJobs", () => { expect(GetJobs.getSpoolFiles).toHaveBeenCalled(); expect(IO.createDirsSyncFromFilePath).toHaveBeenCalledWith(expectedFile); + expect(uri).not.toContain("fileEncoding"); }); it("should allow users to call downloadAllSpoolContentCommon with correct parameters and binary mode", async () => { diff --git a/packages/zosjobs/package.json b/packages/zosjobs/package.json index 5ded8d91f0..b2bfc9fb8f 100644 --- a/packages/zosjobs/package.json +++ b/packages/zosjobs/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-jobs-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "description": "Zowe SDK to interact with jobs on z/OS", "author": "Zowe", "license": "EPL-2.0", @@ -46,12 +46,12 @@ "prepack": "node ../../scripts/prepareLicenses.js" }, "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202406061600" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202406111958" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosjobs/src/DownloadJobs.ts b/packages/zosjobs/src/DownloadJobs.ts index 996714dc6d..b305d05394 100644 --- a/packages/zosjobs/src/DownloadJobs.ts +++ b/packages/zosjobs/src/DownloadJobs.ts @@ -123,7 +123,7 @@ export class DownloadJobs { parameters += "?mode=record"; } - if (!parms.binary && !parms.record && parms.encoding && parms.encoding.trim() != "") { + if (!parms.binary && !parms.record && parms.encoding?.trim()) { parameters += "?fileEncoding=" + parms.encoding; } diff --git a/packages/zoslogs/package.json b/packages/zoslogs/package.json index a02413e298..c12b100a2b 100644 --- a/packages/zoslogs/package.json +++ b/packages/zoslogs/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-logs-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "description": "Zowe SDK to interact with the z/OS logs", "author": "Zowe", "license": "EPL-2.0", @@ -45,9 +45,9 @@ "prepack": "node ../../scripts/prepareLicenses.js" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosmf/package.json b/packages/zosmf/package.json index 6c462af0ef..92f7d2879d 100644 --- a/packages/zosmf/package.json +++ b/packages/zosmf/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zosmf-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "description": "Zowe SDK to interact with the z/OS Management Facility", "author": "Zowe", "license": "EPL-2.0", @@ -44,9 +44,9 @@ "prepack": "node ../../scripts/prepareLicenses.js" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zostso/package.json b/packages/zostso/package.json index ded30c01ac..c43773878c 100644 --- a/packages/zostso/package.json +++ b/packages/zostso/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-tso-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "description": "Zowe SDK to interact with TSO on z/OS", "author": "Zowe", "license": "EPL-2.0", @@ -45,12 +45,12 @@ "prepack": "node ../../scripts/prepareLicenses.js" }, "dependencies": { - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202406061600" + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202406111958" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosuss/package.json b/packages/zosuss/package.json index 177121ab2d..a625f11b61 100644 --- a/packages/zosuss/package.json +++ b/packages/zosuss/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zos-uss-for-zowe-sdk", - "version": "8.0.0-next.202406061600", + "version": "8.0.0-next.202406111958", "description": "Zowe SDK to interact with USS on z/OS", "author": "Zowe", "license": "EPL-2.0", @@ -49,8 +49,8 @@ }, "devDependencies": { "@types/ssh2": "^1.11.19", - "@zowe/cli-test-utils": "8.0.0-next.202406061600", - "@zowe/imperative": "8.0.0-next.202406061600" + "@zowe/cli-test-utils": "8.0.0-next.202406111958", + "@zowe/imperative": "8.0.0-next.202406111958" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next"