From a0fb714ce74fb17d0d4c0dea74498e6d8ff5b8c4 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 20 Aug 2024 15:32:01 -0400 Subject: [PATCH 01/34] Implement fix for #1881 Signed-off-by: Andrew W. Harn --- packages/imperative/CHANGELOG.md | 4 ++ .../src/cmd/src/syntax/SyntaxValidator.ts | 10 +++-- .../__tests__/SyntaxValidator.unit.test.ts | 43 ++++++++++++++++++- .../src/cmd/src/yargs/CommandYargs.ts | 7 ++- .../src/cmd/src/yargs/YargsConfigurer.ts | 6 +++ 5 files changed, 61 insertions(+), 9 deletions(-) diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 4d862a2abc..5c60a7778a 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Imperative package will be documented in this file. +## Recent Changes + +- LTS Breaking: Fixed command parsing error where `string` typed options would be converted into `number`s if the value provided by the user consists only of numeric characters. [#1881](https://github.com/zowe/zowe-cli/issues/1881) + ## `8.0.0-next.202408191401` - Update: See `5.26.3` and `5.27.0` for details diff --git a/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts b/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts index e572f2d338..8c415b995e 100644 --- a/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts +++ b/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts @@ -234,6 +234,8 @@ export class SyntaxValidator { } if (positional.type === "number") { valid = this.validateNumeric(commandArguments[positional.name], positional, responseObject, true) && valid; + // Convert to number for backwards compatability + if (valid) { commandArguments[positional.name] = parseInt(commandArguments[positional.name]); } } if (!(positional.stringLengthRange == null) && @@ -373,11 +375,11 @@ export class SyntaxValidator { commandArguments[optionDef.name]); } } else if (optionDef.type === "boolean") { - valid = this.validateBoolean(commandArguments[optionDef.name], optionDef, - responseObject) && valid; + valid = this.validateBoolean(commandArguments[optionDef.name], optionDef, responseObject) && valid; } else if (optionDef.type === "number") { - valid = this.validateNumeric(commandArguments[optionDef.name], optionDef, - responseObject) && valid; + valid = this.validateNumeric(commandArguments[optionDef.name], optionDef, responseObject) && valid; + // Convert to numbers for backwards compatibility + if (valid) { commandArguments[optionDef.name] = parseInt(commandArguments[optionDef.name]); } } /** * Validate that the option's value is valid json. 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 5d9b50eea0..aa8321b6e4 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 @@ -20,10 +20,14 @@ import { CommandResponse, ICommandDefinition } from "../../../"; import { ValidationTestCommand } from "../../../../../__tests__/src/packages/cmd/ValidationTestCommand"; import { SyntaxValidator } from "../SyntaxValidator"; import { Constants } from "../../../../constants"; +import { YargsConfigurer } from "../../yargs/YargsConfigurer"; describe("Imperative should provide advanced syntax validation rules", () => { const logger = TestLogger.getTestLogger(); + const configuration = { + configuration: YargsConfigurer.yargsConfiguration + }; describe("Advanced syntax validation for commands using a test command", () => { const yargsParser = require("yargs-parser"); @@ -33,7 +37,7 @@ describe("Imperative should provide advanced syntax validation rules", () => { function tryOptions(optionString: string, shouldSucceed: boolean, expectedText?: string[]) { - const options = yargsParser(optionString); + const options = yargsParser(optionString, configuration); options._ = ["test", "validation-test"].concat(options._ || []); // fake out command structure options[Constants.JSON_OPTION] = true; delete options["--"]; // delete extra yargs parse field @@ -362,6 +366,43 @@ describe("Imperative should provide advanced syntax validation rules", () => { minValidOptions + "--always-required-string hello", false, ["multiple", "--always-required-string"])(); }); + + it("should validate that typed numbers are numbers, and convert strings that are numbers", async () => { + const options = yargsParser(minValidOptions + " --should-be-number 4", configuration); + options._ = ["test", "validation-test"].concat(options._ || []); // fake out command structure + options[Constants.JSON_OPTION] = true; + delete options["--"]; // delete extra yargs parse field + logger.debug("Executing test syntax command with arguments: " + inspect(options)); + const response = new CommandResponse({responseFormat: "json"}); + const fakeParent: ICommandDefinition = { + name: undefined, + description: "", type: "group", + children: [ValidationTestCommand] + }; + const svResponse = await new SyntaxValidator(ValidationTestCommand, fakeParent).validate(response, options); + expect(options["should-be-number"]).toBe(4); + expect(options["should-be-number"]).not.toBe("4"); + expect(svResponse.valid).toEqual(true); + }); + + it("should validate that typed strings are strings and not numbers", async () => { + const options = yargsParser(minValidOptions + " --fluffy 9001", configuration); + options._ = ["test", "validation-test"].concat(options._ || []); // fake out command structure + options[Constants.JSON_OPTION] = true; + delete options["--"]; // delete extra yargs parse field + logger.debug("Executing test syntax command with arguments: " + inspect(options)); + const response = new CommandResponse({responseFormat: "json"}); + const fakeParent: ICommandDefinition = { + name: undefined, + description: "", type: "group", + children: [ValidationTestCommand] + }; + const svResponse = await new SyntaxValidator(ValidationTestCommand, fakeParent).validate(response, options); + expect(options["fluffy"]).toBe("9001"); + expect(options["fluffy"]).not.toBe(9001); + expect(svResponse.valid).toEqual(true); + }); + describe("We should be able to validate positional arguments of type 'number'", () => { const numberCommand: ICommandDefinition = { name: "gimme-number", aliases: [], diff --git a/packages/imperative/src/cmd/src/yargs/CommandYargs.ts b/packages/imperative/src/cmd/src/yargs/CommandYargs.ts index f955fe691d..637e8389d3 100644 --- a/packages/imperative/src/cmd/src/yargs/CommandYargs.ts +++ b/packages/imperative/src/cmd/src/yargs/CommandYargs.ts @@ -41,11 +41,10 @@ export class CommandYargs extends AbstractCommandYargs { if (!(option.type == null)) { // don't let yargs handle any types that we are validating ourselves // and don't use custom types as the yargs type since yargs won't understand - if (option.type !== "number" && - option.type !== "json") { - definition.type = option.type as any; - } else if (option.type === "json") { + if (option.type === "json" || option.type === "number") { definition.type = "string"; + } else { + definition.type = option.type as any; } } // If this is a boolean type option, default it to undefined so that we can distinguish diff --git a/packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts b/packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts index 5b97f3836e..08f6de5217 100644 --- a/packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts +++ b/packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts @@ -40,6 +40,11 @@ export class YargsConfigurer { ) { } + public static yargsConfiguration: Record = { + "parse-numbers": false, + "parse-positional-numbers": false + }; + public configure() { /** @@ -50,6 +55,7 @@ export class YargsConfigurer { this.yargs.help(false); this.yargs.version(false); this.yargs.showHelpOnFail(false); + this.yargs.parserConfiguration(YargsConfigurer.yargsConfiguration); // finally, catch any undefined commands this.yargs.command({ command: "*", From 2a2d446947a66801bec68b09606d78c444418b3d Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 20 Aug 2024 16:30:13 -0400 Subject: [PATCH 02/34] Handle floating point values in addition to integers Signed-off-by: Andrew W. Harn --- .../src/cmd/src/syntax/SyntaxValidator.ts | 4 ++-- .../__tests__/SyntaxValidator.unit.test.ts | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts b/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts index 8c415b995e..eec05320a3 100644 --- a/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts +++ b/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts @@ -235,7 +235,7 @@ export class SyntaxValidator { if (positional.type === "number") { valid = this.validateNumeric(commandArguments[positional.name], positional, responseObject, true) && valid; // Convert to number for backwards compatability - if (valid) { commandArguments[positional.name] = parseInt(commandArguments[positional.name]); } + if (valid) { commandArguments[positional.name] = parseFloat(commandArguments[positional.name]); } } if (!(positional.stringLengthRange == null) && @@ -379,7 +379,7 @@ export class SyntaxValidator { } else if (optionDef.type === "number") { valid = this.validateNumeric(commandArguments[optionDef.name], optionDef, responseObject) && valid; // Convert to numbers for backwards compatibility - if (valid) { commandArguments[optionDef.name] = parseInt(commandArguments[optionDef.name]); } + if (valid) { commandArguments[optionDef.name] = parseFloat(commandArguments[optionDef.name]); } } /** * Validate that the option's value is valid json. 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 aa8321b6e4..42d2e8924f 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 @@ -385,6 +385,24 @@ describe("Imperative should provide advanced syntax validation rules", () => { expect(svResponse.valid).toEqual(true); }); + it("should validate that typed numbers are numbers, and convert strings that are numbers that are floats", async () => { + const options = yargsParser(minValidOptions + " --should-be-number 3.1415926", configuration); + options._ = ["test", "validation-test"].concat(options._ || []); // fake out command structure + options[Constants.JSON_OPTION] = true; + delete options["--"]; // delete extra yargs parse field + logger.debug("Executing test syntax command with arguments: " + inspect(options)); + const response = new CommandResponse({responseFormat: "json"}); + const fakeParent: ICommandDefinition = { + name: undefined, + description: "", type: "group", + children: [ValidationTestCommand] + }; + const svResponse = await new SyntaxValidator(ValidationTestCommand, fakeParent).validate(response, options); + expect(options["should-be-number"]).toBe(3.1415926); + expect(options["should-be-number"]).not.toBe("3.1415926"); + expect(svResponse.valid).toEqual(true); + }); + it("should validate that typed strings are strings and not numbers", async () => { const options = yargsParser(minValidOptions + " --fluffy 9001", configuration); options._ = ["test", "validation-test"].concat(options._ || []); // fake out command structure From 4712e6369e8fe40cd9ec8c4b3a73fce8345f5634 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Wed, 21 Aug 2024 07:30:03 -0400 Subject: [PATCH 03/34] Rename Proxy class to ProxySettings Signed-off-by: Timothy Johnson --- packages/imperative/CHANGELOG.md | 4 ++++ ...unit.test.ts => ProxySettings.unit.test.ts} | 18 +++++++++--------- packages/imperative/src/rest/index.ts | 2 +- .../src/rest/src/client/AbstractRestClient.ts | 8 ++++---- .../src/client/{Proxy.ts => ProxySettings.ts} | 16 ++++++++-------- 5 files changed, 26 insertions(+), 22 deletions(-) rename packages/imperative/src/rest/__tests__/client/{Proxy.unit.test.ts => ProxySettings.unit.test.ts} (82%) rename packages/imperative/src/rest/src/client/{Proxy.ts => ProxySettings.ts} (96%) diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 4d862a2abc..81f7b0b02f 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Imperative package will be documented in this file. +## Recent Changes + +- LTS Breaking: Renamed `Proxy` class to `ProxySettings` to avoid name conflict with JS built-in `Proxy` object. [#2230](https://github.com/zowe/zowe-cli/issues/2230) + ## `8.0.0-next.202408191401` - Update: See `5.26.3` and `5.27.0` for details diff --git a/packages/imperative/src/rest/__tests__/client/Proxy.unit.test.ts b/packages/imperative/src/rest/__tests__/client/ProxySettings.unit.test.ts similarity index 82% rename from packages/imperative/src/rest/__tests__/client/Proxy.unit.test.ts rename to packages/imperative/src/rest/__tests__/client/ProxySettings.unit.test.ts index 1e0bff2a57..68d5291c4b 100644 --- a/packages/imperative/src/rest/__tests__/client/Proxy.unit.test.ts +++ b/packages/imperative/src/rest/__tests__/client/ProxySettings.unit.test.ts @@ -11,7 +11,7 @@ import * as process from "process"; -import { Proxy } from "../../src/client/Proxy"; +import { ProxySettings } from "../../src/client/ProxySettings"; import { HTTPS_PROTOCOL, HTTP_PROTOCOL } from "../../src/session/SessConstants"; import { HttpsProxyAgent } from "https-proxy-agent"; @@ -25,7 +25,7 @@ describe("Proxy tests", () => { port: 443, rejectUnauthorized: false } as ISession; - const privateProxy = Proxy as any; + const privateProxy = ProxySettings as any; const httpUrl = "http://www.zowe.com"; const httpsUrl = "https://www.zowe.com"; const noProxyList = "www.zowe.com, fake.com,ibm.com,broadcom.com "; @@ -44,7 +44,7 @@ describe("Proxy tests", () => { proxyUrl: httpUrl, protocol: HTTP_PROTOCOL }); - expect(JSON.stringify(Proxy.getProxyAgent(session))).toEqual(JSON.stringify(expected)); + expect(JSON.stringify(ProxySettings.getProxyAgent(session))).toEqual(JSON.stringify(expected)); }); it("Should retrieve the HTTPS proxy agent", () => { @@ -53,7 +53,7 @@ describe("Proxy tests", () => { proxyUrl: httpsUrl, protocol: HTTPS_PROTOCOL }); - expect(JSON.stringify(Proxy.getProxyAgent(session))).toEqual(JSON.stringify(expected)); + expect(JSON.stringify(ProxySettings.getProxyAgent(session))).toEqual(JSON.stringify(expected)); }); }); @@ -68,7 +68,7 @@ describe("Proxy tests", () => { proxyUrl: httpsUrl, protocol: HTTPS_PROTOCOL }); - expect(Proxy.getSystemProxyUrl(session)).toEqual(httpsUrl); + expect(ProxySettings.getSystemProxyUrl(session)).toEqual(httpsUrl); }); }); @@ -84,7 +84,7 @@ describe("Proxy tests", () => { protocol: HTTPS_PROTOCOL }; checkUrlSpy.mockReturnValue(httpsUrl); - expect(Proxy["getProxySettings"](session)).toEqual(expected); + expect(ProxySettings["getProxySettings"](session)).toEqual(expected); }); }); @@ -96,7 +96,7 @@ describe("Proxy tests", () => { it("Should return the HTTP environment variables if they exist", () => { const expected = httpUrl; process.env["HTTP_PROXY"] = expected; - expect(Proxy["getHttpEnvVariables"]()).toEqual(expected); + expect(ProxySettings["getHttpEnvVariables"]()).toEqual(expected); process.env["HTTP_PROXY"] = undefined; }); }); @@ -105,7 +105,7 @@ describe("Proxy tests", () => { it("Should match session hostname with no_proxy", () => { const expected = true; process.env["NO_PROXY"] = noProxyList; - expect(Proxy["matchesNoProxySettings"](session)).toEqual(expected); + expect(ProxySettings["matchesNoProxySettings"](session)).toEqual(expected); process.env["NO_PROXY"] = undefined; }); @@ -113,7 +113,7 @@ describe("Proxy tests", () => { const expected = false; process.env["NO_PROXY"] = noProxyList; session.hostname = "microsoft.com"; - expect(Proxy["matchesNoProxySettings"](session)).toEqual(expected); + expect(ProxySettings["matchesNoProxySettings"](session)).toEqual(expected); process.env["NO_PROXY"] = undefined; }); }); diff --git a/packages/imperative/src/rest/index.ts b/packages/imperative/src/rest/index.ts index 2b7c2ae485..72ab85c224 100644 --- a/packages/imperative/src/rest/index.ts +++ b/packages/imperative/src/rest/index.ts @@ -17,7 +17,7 @@ export * from "./src/client/doc/IRestClientError"; export * from "./src/client/doc/IRestClientResponse"; export * from "./src/client/doc/IRestOptions"; export * from "./src/client/Headers"; -export * from "./src/client/Proxy"; +export * from "./src/client/ProxySettings"; export * from "./src/client/AbstractRestClient"; // export * from "./src/client/CompressionUtils"; export * from "./src/client/RestClient"; diff --git a/packages/imperative/src/rest/src/client/AbstractRestClient.ts b/packages/imperative/src/rest/src/client/AbstractRestClient.ts index bb9280be54..46b6eec4b3 100644 --- a/packages/imperative/src/rest/src/client/AbstractRestClient.ts +++ b/packages/imperative/src/rest/src/client/AbstractRestClient.ts @@ -33,7 +33,7 @@ import { TextUtils } from "../../../utilities"; import { IRestOptions } from "./doc/IRestOptions"; import * as SessConstants from "../session/SessConstants"; import { CompressionUtils } from "./CompressionUtils"; -import { Proxy } from "./Proxy"; +import { ProxySettings } from "./ProxySettings"; export type RestClientResolve = (data: string) => void; @@ -461,13 +461,13 @@ export abstract class AbstractRestClient { // NOTE(Kelosky): This cannot be set for http requests // options.agent = new https.Agent({secureProtocol: this.session.ISession.secureProtocol}); - const proxyUrl = Proxy.getSystemProxyUrl(this.session.ISession); + const proxyUrl = ProxySettings.getSystemProxyUrl(this.session.ISession); if (proxyUrl) { - if (Proxy.matchesNoProxySettings(this.session.ISession)) { + if (ProxySettings.matchesNoProxySettings(this.session.ISession)) { this.mLogger.info(`Proxy setting "${proxyUrl.href}" will not be used as hostname was found listed under "no_proxy" setting.`); } else { this.mLogger.info(`Using the following proxy setting for the request: ${proxyUrl.href}`); - options.agent = Proxy.getProxyAgent(this.session.ISession); + options.agent = ProxySettings.getProxyAgent(this.session.ISession); } } diff --git a/packages/imperative/src/rest/src/client/Proxy.ts b/packages/imperative/src/rest/src/client/ProxySettings.ts similarity index 96% rename from packages/imperative/src/rest/src/client/Proxy.ts rename to packages/imperative/src/rest/src/client/ProxySettings.ts index 67ac9d685a..f535bc00d4 100644 --- a/packages/imperative/src/rest/src/client/Proxy.ts +++ b/packages/imperative/src/rest/src/client/ProxySettings.ts @@ -32,7 +32,7 @@ import { ISession } from '../session/doc/ISession'; * variables NO_PROXY or no_proxy. These work with a simple comma separated list of hostnames that need * to match with the hostname of the Zowe profile. */ -export class Proxy { +export class ProxySettings { /** * Retrieve an appropriate http.agent instance if proxy environment variables can be found. @@ -41,7 +41,7 @@ export class Proxy { * Uses the session's `rejectUnauthorized` also for the proxy connection. * @returns an instance of an appropriate subclass of node's https.agent if proxy * settings were found. Returns `undefined` if no proxy settings are found. - * @memberof Proxy + * @memberof ProxySettings */ public static getProxyAgent(session: ISession): Agent | undefined { const proxySetting = this.getProxySettings(session); @@ -60,7 +60,7 @@ export class Proxy { * @static * @param session Zowe `ISession` containing the hostname for the http request. * @returns `URL` to proxy server - * @memberof Proxy + * @memberof ProxySettings */ public static getSystemProxyUrl(session: ISession): URL | undefined { return this.getProxySettings(session)?.proxyUrl; @@ -75,7 +75,7 @@ export class Proxy { * @param session Zowe `ISession` containing the hostname for the http request. * @returns `true` if the Zowe session host matches an entry in the comma separated * list of hostnames in the environment variable. `false` otherwise. - * @memberof Proxy + * @memberof ProxySettings */ public static matchesNoProxySettings(session: ISession): boolean { const noProxyValues = this.getNoProxyEnvVariables(); @@ -94,7 +94,7 @@ export class Proxy { * @static * @param session Zowe `ISession` containing the hostname for the http request. * @returns instance of private `ProxySetting` or `undefined` - * @memberof Proxy + * @memberof ProxySettings */ private static getProxySettings(session: ISession): ProxySetting | undefined { if (this.matchesNoProxySettings(session)) { @@ -119,7 +119,7 @@ export class Proxy { * @private * @static * @returns `string` if valid variable is found or undefined. - * @memberof Proxy + * @memberof ProxySettings */ private static getHttpEnvVariables(): string | undefined { return env.HTTP_PROXY ?? env.http_proxy; @@ -130,7 +130,7 @@ export class Proxy { * @private * @static * @returns `string` if valid variable is found or undefined. - * @memberof Proxy + * @memberof ProxySettings */ private static getHttpsEnvVariables(): string | undefined { return env.HTTPS_PROXY ?? env.https_proxy ?? this.getHttpEnvVariables(); @@ -142,7 +142,7 @@ export class Proxy { * @static * @returns `string[]` of all hostnames found in the comma separated list * in lowercase without white spaces. - * @memberof Proxy + * @memberof ProxySettings */ private static getNoProxyEnvVariables(): string[] | undefined { const noProxyValue = env.NO_PROXY ?? env.no_proxy; From 12d117e6ab9df2ef028eaf4256e3cc1762ad8f04 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Wed, 21 Aug 2024 08:09:34 -0400 Subject: [PATCH 04/34] Fix import in AbstractRestClient unit test Signed-off-by: Timothy Johnson --- .../rest/__tests__/client/AbstractRestClient.unit.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 61045414d5..d77a854961 100644 --- a/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts +++ b/packages/imperative/src/rest/__tests__/client/AbstractRestClient.unit.test.ts @@ -31,7 +31,7 @@ import { AbstractRestClient } from "../../src/client/AbstractRestClient"; import * as os from "os"; import { join } from "path"; import { IO } from "../../../io"; -import { Proxy } from "../../src/client/Proxy"; +import { ProxySettings } from "../../src/client/ProxySettings"; import { HttpsProxyAgent } from "https-proxy-agent"; /** @@ -1436,8 +1436,8 @@ describe("AbstractRestClient tests", () => { beforeEach(() => { jest.clearAllMocks(); - getSystemProxyUrlSpy = jest.spyOn(Proxy, "getSystemProxyUrl"); - getProxyAgentSpy = jest.spyOn(Proxy, "getProxyAgent"); + getSystemProxyUrlSpy = jest.spyOn(ProxySettings, "getSystemProxyUrl"); + getProxyAgentSpy = jest.spyOn(ProxySettings, "getProxyAgent"); setCertPemAuthSpy = jest.spyOn(privateRestClient, "setCertPemAuth"); }); From e5e55bb0e3613ed9edc42a2080577f2f47418e32 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Wed, 21 Aug 2024 08:32:22 -0400 Subject: [PATCH 05/34] Make yargsConfiguration readonly Signed-off-by: Andrew W. Harn --- packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts b/packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts index 08f6de5217..c627b9fc1f 100644 --- a/packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts +++ b/packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts @@ -40,7 +40,7 @@ export class YargsConfigurer { ) { } - public static yargsConfiguration: Record = { + public static readonly yargsConfiguration: Record = { "parse-numbers": false, "parse-positional-numbers": false }; From 184bb4c58f322e2e67695b84348c5b5d130ae6bc Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Wed, 21 Aug 2024 08:55:05 -0400 Subject: [PATCH 06/34] Make yargsConfiguration values readonly Signed-off-by: Andrew W. Harn --- packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts b/packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts index c627b9fc1f..2e6b1cfee7 100644 --- a/packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts +++ b/packages/imperative/src/cmd/src/yargs/YargsConfigurer.ts @@ -40,7 +40,7 @@ export class YargsConfigurer { ) { } - public static readonly yargsConfiguration: Record = { + public static readonly yargsConfiguration: Readonly> = { "parse-numbers": false, "parse-positional-numbers": false }; From 6ce1d1a9045c5a200c6da874cfcfbf90977719da Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Wed, 21 Aug 2024 10:55:28 -0400 Subject: [PATCH 07/34] WIP Remove remaining references to V1 profiles Signed-off-by: Timothy Johnson --- .../cli-test-utils/src/TestUtils.ts | 4 +- __tests__/__src__/TestConstants.ts | 25 ++ __tests__/__src__/mocks/ZosmfProfileMock.ts | 55 ---- .../DeleteInstance.handler.unit.test.ts | 8 +- .../CatalogTemplates.handler.unit.test.ts | 8 +- .../InstanceInfo.handler.unit.test.ts | 8 +- .../InstanceVariables.handler.unit.test.ts | 8 +- .../RegistryInstances.handler.unit.test.ts | 8 +- .../TemplateInfo.handler.unit.test.ts | 8 +- .../action/Action.handler.unit.test.ts | 8 +- .../template/Template.handler.unit.test.ts | 8 +- .../compare/ds/Dataset.handler.unit.test.ts | 2 +- .../LocalfileDataset.handler.unit.test.ts | 2 +- .../LocalfileSpooldd.handler.unit.test.ts | 2 +- .../lf-uss/LocalfileUss.handler.unit.test.ts | 2 +- .../compare/sdd/Spooldd.handler.unit.test.ts | 2 +- .../compare/uss/UssFile.handler.unit.test.ts | 2 +- .../dsclp/TargetProfile.handler.unit.test.ts | 8 +- .../binaryPds/BinaryPDS.handler.unit.test.ts | 2 +- .../create/cPds/CPDS.handler.unit.test.ts | 2 +- .../ClassicPDS.handler.unit.test.ts | 2 +- .../create/ds/ds.handler.unit.test.ts | 2 +- .../create/pds/Pds.handler.unit.test.ts | 2 +- .../create/ps/Ps.handler.unit.test.ts | 2 +- .../create/ussDir/ussDir.handler.unit.test.ts | 2 +- .../ussFile/ussFile.handler.unit.test.ts | 2 +- .../create/vsam/Vsam.handler.unit.test.ts | 2 +- .../create/zfs/zfs.handler.unit.test.ts | 2 +- .../am/AllMembers.handler.unit.test.ts | 2 +- .../download/ds/Dataset.handler.unit.test.ts | 2 +- .../dsm/DataSetMatching.handler.unit.test.ts | 5 +- .../download/uss/UssFile.handler.unit.test.ts | 2 +- .../ussdir/UssDir.handler.unit.test.ts | 2 +- .../__unit__/edit/Edit.handler.unit.test.ts | 5 +- .../__unit__/edit/Edit.utils.unit.test.ts | 8 +- .../amsFile/AmsFile.handler.unit.test.ts | 2 +- .../AmsStatements.handler.unit.test.ts | 2 +- .../list/am/AllMembers.handler.unit.test.ts | 2 +- .../list/ds/Dataset.handler.unit.test.ts | 2 +- .../__unit__/list/fs/Fs.handler.unit.test.ts | 2 +- .../list/uss/Uss.handler.unit.test.ts | 2 +- .../__unit__/mount/fs/fs.handler.unit.test.ts | 2 +- .../search/ds/Datasets.handler.unit.test.ts | 2 +- .../upload/dtp/DirToPds.handler.unit.test.ts | 2 +- .../upload/dtu/DirToUSS.handler.unit.test.ts | 2 +- .../ftds/FileToDataSet.handler.unit.test.ts | 2 +- .../upload/ftu/FileToUSS.handler.unit.test.ts | 2 +- .../stds/StdinToDataSet.handler.unit.test.ts | 2 +- .../view/ds/Dataset.handler.unit.test.ts | 2 +- .../view/uss/USSFiles.handler.unit.test.ts | 2 +- .../cancel/job/Job.handler.unit.test.ts | 8 +- .../delete/job/Job.handler.unit.test.ts | 8 +- .../old-jobs/OldJobs.handler.unit.test.ts | 8 +- .../Output.handler.unit.test.ts | 8 +- .../list/jobs/Jobs.handler.unit.test.ts | 8 +- .../SpoolFilesByJobid.handler.unit.test.ts | 8 +- .../modify/job/Job.handler.unit.test.ts | 8 +- .../search/job/JobSearch.handler.unit.test.ts | 8 +- .../submit/Submit.shared.handler.unit.test.ts | 14 +- .../AllSpoolContent.handler.unit.test.ts | 5 +- .../job/JobStatusByJobid.handler.unit.test.ts | 8 +- .../SpoolFileById.handler.unit.test.ts | 5 +- .../list/logs/Logs.handler.unit.test.ts | 8 +- .../check/status/Status.handler.unit.test.ts | 8 +- .../list/systems/Systems.handler.unit.test.ts | 8 +- .../command/Command.handler.unit.test.ts | 9 +- .../AddressSpace.handler.unit.test.ts | 8 +- .../AddressSpace.handler.unit.test.ts | 8 +- .../AddressSpace.handler.unit.test.ts | 28 +- .../AddressSpace.handler.unit.test.ts | 8 +- .../issue/ssh/Ssh.handler.unit.test.ts | 55 +--- ...i.invalid.profile-spec.integration.test.ts | 40 --- .../cli/invalid/__scripts__/profile-spec.sh | 3 - .../Cmd.cli.root.integration.test.ts.snap | 9 - .../cmd/src/cli/invalid/Invalid.definition.ts | 4 +- .../profile-spec/ProfileSpec.definition.ts | 21 -- .../profile-spec/ProfileSpec.handler.ts | 19 -- .../cmd/src/cli/read/Read.definition.ts | 23 -- .../cli/read/profile/Profile.definition.ts | 23 -- .../src/cli/read/profile/Profile.handler.ts | 20 -- .../CliProfileManager.integration.test.ts | 2 + .../__tests__/CommandProcessor.unit.test.ts | 309 ++---------------- .../profiles/CliProfileManager.unit.test.ts | 2 + .../CommandProfileLoader.unit.test.ts | 2 + .../profiles/CommandProfiles.unit.test.ts | 2 + .../profileHandlers/AddTwoNumbersHandler.ts | 20 -- .../profileHandlers/DoNothingHandler.ts | 19 -- .../profileHandlers/ThrowErrorHandler.ts | 18 - .../src/cmd/src/CommandProcessor.ts | 179 +++------- .../cmd/src/doc/handler/IHandlerParameters.ts | 10 - .../doc/response/response/ICommandPrepared.ts | 33 -- .../src/cmd/src/profiles/CliProfileManager.ts | 1 + .../cmd/src/profiles/CommandProfileLoader.ts | 4 + .../src/cmd/src/profiles/CommandProfiles.ts | 1 + .../DefaultRootCommandHandler.unit.test.ts | 3 - .../src/imperative/src/api/ImperativeApi.ts | 15 - .../utilities/__tests__/CliUtils.unit.test.ts | 9 + .../imperative/src/utilities/src/CliUtils.ts | 82 ++++- .../__unit__/SshBaseHandler.unit.test.ts | 55 +--- 99 files changed, 310 insertions(+), 1098 deletions(-) create mode 100644 __tests__/__src__/TestConstants.ts delete mode 100644 __tests__/__src__/mocks/ZosmfProfileMock.ts delete mode 100644 packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/invalid/Cmd.cli.invalid.profile-spec.integration.test.ts delete mode 100644 packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/invalid/__scripts__/profile-spec.sh delete mode 100644 packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/profile-spec/ProfileSpec.definition.ts delete mode 100644 packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/profile-spec/ProfileSpec.handler.ts delete mode 100644 packages/imperative/__tests__/__integration__/cmd/src/cli/read/Read.definition.ts delete mode 100644 packages/imperative/__tests__/__integration__/cmd/src/cli/read/profile/Profile.definition.ts delete mode 100644 packages/imperative/__tests__/__integration__/cmd/src/cli/read/profile/Profile.handler.ts delete mode 100644 packages/imperative/src/cmd/__tests__/profiles/profileHandlers/AddTwoNumbersHandler.ts delete mode 100644 packages/imperative/src/cmd/__tests__/profiles/profileHandlers/DoNothingHandler.ts delete mode 100644 packages/imperative/src/cmd/__tests__/profiles/profileHandlers/ThrowErrorHandler.ts delete mode 100644 packages/imperative/src/cmd/src/doc/response/response/ICommandPrepared.ts diff --git a/__tests__/__packages__/cli-test-utils/src/TestUtils.ts b/__tests__/__packages__/cli-test-utils/src/TestUtils.ts index 30d3fc0eb6..6952abcc7c 100644 --- a/__tests__/__packages__/cli-test-utils/src/TestUtils.ts +++ b/__tests__/__packages__/cli-test-utils/src/TestUtils.ts @@ -12,7 +12,7 @@ import * as fs from "fs"; import { spawnSync, SpawnSyncReturns, ExecFileException } from "child_process"; import { ITestEnvironment } from "./environment/doc/response/ITestEnvironment"; -import { CommandProfiles, ICommandDefinition, IHandlerParameters } from "@zowe/imperative"; +import { ICommandDefinition, IHandlerParameters } from "@zowe/imperative"; /** * Execute a CLI script @@ -135,8 +135,6 @@ export function mockHandlerParameters(params: PartialHandlerParameters): IHandle ...params.arguments || {} }, positionals: params.positionals || [], - // eslint-disable-next-line deprecation/deprecation - profiles: params.profiles || new CommandProfiles(new Map()), definition: params.definition, fullDefinition: params.definition, stdin: process.stdin, diff --git a/__tests__/__src__/TestConstants.ts b/__tests__/__src__/TestConstants.ts new file mode 100644 index 0000000000..e87e89998a --- /dev/null +++ b/__tests__/__src__/TestConstants.ts @@ -0,0 +1,25 @@ +/* +* 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. +* +*/ + +// Some test constants that are needed by multiple packages for unit tests + +// Mocked profile options to be added to args +export const UNIT_TEST_ZOSMF_PROF_OPTS = { + host: "somewhere.com", + port: "43443", + user: "someone", + password: "somesecret" +}; + +export const UNIT_TEST_TSO_PROF_OPTS = { + password: "fake", + account: "fake" +}; diff --git a/__tests__/__src__/mocks/ZosmfProfileMock.ts b/__tests__/__src__/mocks/ZosmfProfileMock.ts deleted file mode 100644 index 844d10a7f6..0000000000 --- a/__tests__/__src__/mocks/ZosmfProfileMock.ts +++ /dev/null @@ -1,55 +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. -* -*/ - -import { IProfile, CommandProfiles } from "@zowe/imperative"; -// Some test constants that are needed by multiple packages for unit tests - -// Mocked profile options to be added to args -export const UNIT_TEST_ZOSMF_PROF_OPTS = { - host: "somewhere.com", - port: "43443", - user: "someone", - password: "somesecret" -}; - -export const UNIT_TEST_TSO_PROF_OPTS = { - password: "fake", - account: "fake" -}; - -// A mocked profile map with zosmf profile -export const UNIT_TEST_PROFILE_MAP = new Map(); -UNIT_TEST_PROFILE_MAP.set( - "zosmf", [{ - name: "zosmf", - type: "zosmf", - ...UNIT_TEST_ZOSMF_PROF_OPTS - }] -); -export const UNIT_TEST_PROFILES_ZOSMF: CommandProfiles = new CommandProfiles(UNIT_TEST_PROFILE_MAP); - -// A mocked profile map with both -export const UNIT_TEST_PROFILE_MAP_ZOSMF_TSO = new Map(); -UNIT_TEST_PROFILE_MAP_ZOSMF_TSO.set( - "zosmf", [{ - name: "zosmf", - type: "zosmf", - ...UNIT_TEST_ZOSMF_PROF_OPTS - }] -); -UNIT_TEST_PROFILE_MAP_ZOSMF_TSO.set( - "tso", [{ - name: "tso", - type: "tso", - ...UNIT_TEST_TSO_PROF_OPTS - }] -); -export const UNIT_TEST_PROFILES_ZOSMF_TSO: CommandProfiles = new CommandProfiles(UNIT_TEST_PROFILE_MAP_ZOSMF_TSO); diff --git a/packages/cli/__tests__/provisioning/__unit__/delete/instance/DeleteInstance.handler.unit.test.ts b/packages/cli/__tests__/provisioning/__unit__/delete/instance/DeleteInstance.handler.unit.test.ts index 383b7df853..a82af61b33 100644 --- a/packages/cli/__tests__/provisioning/__unit__/delete/instance/DeleteInstance.handler.unit.test.ts +++ b/packages/cli/__tests__/provisioning/__unit__/delete/instance/DeleteInstance.handler.unit.test.ts @@ -19,17 +19,13 @@ import { ListRegistryInstances, ProvisioningConstants } from "@zowe/provisioning-for-zowe-sdk"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["provisioning", "delete", "instance"], - definition: DeleteInstanceDefinition.DeleteInstanceDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: DeleteInstanceDefinition.DeleteInstanceDefinition }); describe("delete deprovisioned instance handler tests", () => { diff --git a/packages/cli/__tests__/provisioning/__unit__/list/catalogTemplates/CatalogTemplates.handler.unit.test.ts b/packages/cli/__tests__/provisioning/__unit__/list/catalogTemplates/CatalogTemplates.handler.unit.test.ts index ee68d4ddc1..ad11da8448 100644 --- a/packages/cli/__tests__/provisioning/__unit__/list/catalogTemplates/CatalogTemplates.handler.unit.test.ts +++ b/packages/cli/__tests__/provisioning/__unit__/list/catalogTemplates/CatalogTemplates.handler.unit.test.ts @@ -14,10 +14,7 @@ import { ListCatalogTemplates } from "@zowe/provisioning-for-zowe-sdk"; import { IHandlerParameters } from "@zowe/imperative"; import * as Handler from "../../../../../src/provisioning/list/catalogTemplates/CatalogTemplates.handler"; import { catalogTemplates } from "../../../../../src/provisioning/list/catalogTemplates/CatalogTemplates.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; jest.mock("../../../../../../../packages/provisioning/src/ListCatalogTemplates"); @@ -25,8 +22,7 @@ jest.mock("../../../../../../../packages/provisioning/src/ListCatalogTemplates") const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["provisioning", "list", "catalog-templates"], - definition: catalogTemplates, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: catalogTemplates }); describe("list catalog templates handler tests", () => { diff --git a/packages/cli/__tests__/provisioning/__unit__/list/instanceInfo/InstanceInfo.handler.unit.test.ts b/packages/cli/__tests__/provisioning/__unit__/list/instanceInfo/InstanceInfo.handler.unit.test.ts index a590bc1d97..b0c60c198d 100644 --- a/packages/cli/__tests__/provisioning/__unit__/list/instanceInfo/InstanceInfo.handler.unit.test.ts +++ b/packages/cli/__tests__/provisioning/__unit__/list/instanceInfo/InstanceInfo.handler.unit.test.ts @@ -18,17 +18,13 @@ import { import * as Handler from "../../../../../src/provisioning/list/instanceInfo/InstanceInfo.handler"; import { instanceInfo } from "../../../../../src/provisioning/list/instanceInfo/InstanceInfo.definition"; import { ProvisioningListMocks } from "../../../__resources__/ProvisioningListMocks"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["provisioning", "list", "instance-info"], - definition: instanceInfo, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: instanceInfo }); describe("list instance info handler tests", () => { diff --git a/packages/cli/__tests__/provisioning/__unit__/list/instanceVars/InstanceVariables.handler.unit.test.ts b/packages/cli/__tests__/provisioning/__unit__/list/instanceVars/InstanceVariables.handler.unit.test.ts index 631ec695a0..ac0b24d4b9 100644 --- a/packages/cli/__tests__/provisioning/__unit__/list/instanceVars/InstanceVariables.handler.unit.test.ts +++ b/packages/cli/__tests__/provisioning/__unit__/list/instanceVars/InstanceVariables.handler.unit.test.ts @@ -16,17 +16,13 @@ import { IHandlerParameters } from "@zowe/imperative"; import * as Handler from "../../../../../src/provisioning/list/instanceVariables/InstanceVariables.handler"; import { instanceVariables } from "../../../../../src/provisioning/list/instanceVariables/InstanceVariables.definition"; import { ProvisioningListMocks } from "../../../__resources__/ProvisioningListMocks"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["provisioning", "list", "instance-variables"], - definition: instanceVariables, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: instanceVariables }); describe("list instance variables handler tests", () => { diff --git a/packages/cli/__tests__/provisioning/__unit__/list/registryInstances/RegistryInstances.handler.unit.test.ts b/packages/cli/__tests__/provisioning/__unit__/list/registryInstances/RegistryInstances.handler.unit.test.ts index b333e6cb3b..8136f7560b 100644 --- a/packages/cli/__tests__/provisioning/__unit__/list/registryInstances/RegistryInstances.handler.unit.test.ts +++ b/packages/cli/__tests__/provisioning/__unit__/list/registryInstances/RegistryInstances.handler.unit.test.ts @@ -13,10 +13,7 @@ import { ListRegistryInstances } from "@zowe/provisioning-for-zowe-sdk"; import { IHandlerParameters } from "@zowe/imperative"; import * as Handler from "../../../../../src/provisioning/list/registry/RegistryInstances.handler"; import { registryInstances } from "../../../../../src/provisioning/list/registry/RegistryInstances.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; jest.mock("@zowe/provisioning-for-zowe-sdk"); @@ -24,8 +21,7 @@ jest.mock("@zowe/provisioning-for-zowe-sdk"); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["provisioning", "list", "catalog-templates"], - definition: registryInstances, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: registryInstances }); describe("list registry instances handler tests", () => { diff --git a/packages/cli/__tests__/provisioning/__unit__/list/templateInfo/TemplateInfo.handler.unit.test.ts b/packages/cli/__tests__/provisioning/__unit__/list/templateInfo/TemplateInfo.handler.unit.test.ts index 21165a3998..35b25fb87e 100644 --- a/packages/cli/__tests__/provisioning/__unit__/list/templateInfo/TemplateInfo.handler.unit.test.ts +++ b/packages/cli/__tests__/provisioning/__unit__/list/templateInfo/TemplateInfo.handler.unit.test.ts @@ -14,17 +14,13 @@ import { ListTemplateInfo } from "@zowe/provisioning-for-zowe-sdk"; import { IHandlerParameters } from "@zowe/imperative"; import * as Handler from "../../../../../src/provisioning/list/templateInfo/TemplateInfo.handler"; import { templateInfo } from "../../../../../src/provisioning/list/templateInfo/TemplateInfo.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["provisioning", "list", "catalog-templates"], - definition: templateInfo, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: templateInfo }); describe("list template info handler tests", () => { diff --git a/packages/cli/__tests__/provisioning/__unit__/perform/action/Action.handler.unit.test.ts b/packages/cli/__tests__/provisioning/__unit__/perform/action/Action.handler.unit.test.ts index fed787cf42..6f52fccf58 100644 --- a/packages/cli/__tests__/provisioning/__unit__/perform/action/Action.handler.unit.test.ts +++ b/packages/cli/__tests__/provisioning/__unit__/perform/action/Action.handler.unit.test.ts @@ -20,17 +20,13 @@ import { import { IHandlerParameters } from "@zowe/imperative"; import * as ActionHandler from "../../../../../src/provisioning/perform/action/Action.handler"; import * as ActionDefinition from "../../../../../src/provisioning/perform/action/Action.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["provisioning", "perform", "action"], - definition: ActionDefinition.ActionDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: ActionDefinition.ActionDefinition }); describe("perform action handler tests", () => { diff --git a/packages/cli/__tests__/provisioning/__unit__/provision/template/Template.handler.unit.test.ts b/packages/cli/__tests__/provisioning/__unit__/provision/template/Template.handler.unit.test.ts index dc8d39cb4d..42337c91ce 100644 --- a/packages/cli/__tests__/provisioning/__unit__/provision/template/Template.handler.unit.test.ts +++ b/packages/cli/__tests__/provisioning/__unit__/provision/template/Template.handler.unit.test.ts @@ -18,17 +18,13 @@ import { ProvisionTemplateData } from "../../../__resources__/ProvisionTemplateD import { IHandlerParameters, ImperativeError } from "@zowe/imperative"; import * as TemplateHandler from "../../../../../src/provisioning/provision/template/Template.handler"; import * as TemplateDefinition from "../../../../../src/provisioning/provision/template/Template.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["provisioning", "provision", "template"], - definition: TemplateDefinition.TemplateDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: TemplateDefinition.TemplateDefinition }); describe("provision template handler tests", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/compare/ds/Dataset.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/compare/ds/Dataset.handler.unit.test.ts index 74d90159a8..c831d710a5 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/compare/ds/Dataset.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/compare/ds/Dataset.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Get } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { DiffUtils, IDiffOptions, ImperativeError } from "@zowe/imperative"; describe("Compare data set handler", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/compare/lf-ds/LocalfileDataset.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/compare/lf-ds/LocalfileDataset.handler.unit.test.ts index 108b0544fc..c5f1f32ccb 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/compare/lf-ds/LocalfileDataset.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/compare/lf-ds/LocalfileDataset.handler.unit.test.ts @@ -12,7 +12,7 @@ jest.mock("fs"); import { Get } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { DiffUtils, IDiffOptions, ImperativeError } from "@zowe/imperative"; import * as fs from "fs"; describe("Compare local-file and data-set handler", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/compare/lf-sdd/LocalfileSpooldd.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/compare/lf-sdd/LocalfileSpooldd.handler.unit.test.ts index 79eadc9972..e7c137a664 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/compare/lf-sdd/LocalfileSpooldd.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/compare/lf-sdd/LocalfileSpooldd.handler.unit.test.ts @@ -12,7 +12,7 @@ jest.mock("fs"); import { GetJobs } from "@zowe/zos-jobs-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { DiffUtils, IDiffOptions, ImperativeError } from "@zowe/imperative"; import * as fs from "fs"; diff --git a/packages/cli/__tests__/zosfiles/__unit__/compare/lf-uss/LocalfileUss.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/compare/lf-uss/LocalfileUss.handler.unit.test.ts index 2fd4591f18..567d13e921 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/compare/lf-uss/LocalfileUss.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/compare/lf-uss/LocalfileUss.handler.unit.test.ts @@ -12,7 +12,7 @@ jest.mock("fs"); import { Get } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { DiffUtils, IDiffOptions } from "@zowe/imperative"; import * as fs from "fs"; diff --git a/packages/cli/__tests__/zosfiles/__unit__/compare/sdd/Spooldd.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/compare/sdd/Spooldd.handler.unit.test.ts index d71b72dd4f..9b71ec2b96 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/compare/sdd/Spooldd.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/compare/sdd/Spooldd.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { GetJobs } from "@zowe/zos-jobs-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { DiffUtils, IDiffOptions, ImperativeError } from "@zowe/imperative"; describe("Compare spooldd handler", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/compare/uss/UssFile.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/compare/uss/UssFile.handler.unit.test.ts index de4ac64f24..8117ec2719 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/compare/uss/UssFile.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/compare/uss/UssFile.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Get } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { DiffUtils, IDiffOptions, ImperativeError } from "@zowe/imperative"; describe("Compare data set handler", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/copy/dsclp/TargetProfile.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/copy/dsclp/TargetProfile.handler.unit.test.ts index 4a756e9d0d..9feccd3f0f 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/copy/dsclp/TargetProfile.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/copy/dsclp/TargetProfile.handler.unit.test.ts @@ -12,17 +12,13 @@ import { IHandlerParameters, ImperativeConfig, ImperativeError } from "@zowe/imperative"; import TargetProfileHandler from "../../../../../src/zosfiles/copy/dsclp/TargetProfile.handler"; import { DsclpDefinition } from "../../../../../src/zosfiles/copy/dsclp/Dsclp.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["files", "copy", "data-set-cross-lpar"], - definition: DsclpDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: DsclpDefinition }); describe("TargetProfileHandler", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/create/binaryPds/BinaryPDS.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/create/binaryPds/BinaryPDS.handler.unit.test.ts index 04231126d3..44c96a8651 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/create/binaryPds/BinaryPDS.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/create/binaryPds/BinaryPDS.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Create, CreateDataSetTypeEnum } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Create binary PDS data set handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/create/cPds/CPDS.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/create/cPds/CPDS.handler.unit.test.ts index 52ea562e68..56b9800230 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/create/cPds/CPDS.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/create/cPds/CPDS.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Create, CreateDataSetTypeEnum } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Create C-code PDS data set handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/create/classicPds/ClassicPDS.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/create/classicPds/ClassicPDS.handler.unit.test.ts index 100a1f0269..6bf9932aa7 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/create/classicPds/ClassicPDS.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/create/classicPds/ClassicPDS.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Create, CreateDataSetTypeEnum } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Create classic PDS data set handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/create/ds/ds.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/create/ds/ds.handler.unit.test.ts index 1c8ce8705e..998ca33757 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/create/ds/ds.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/create/ds/ds.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Create, CreateDataSetTypeEnum } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Create data set handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/create/pds/Pds.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/create/pds/Pds.handler.unit.test.ts index 2f389193ac..d59d95b08b 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/create/pds/Pds.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/create/pds/Pds.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Create, CreateDataSetTypeEnum } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Create PDS data set handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/create/ps/Ps.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/create/ps/Ps.handler.unit.test.ts index e830b6cf71..0ebd8da55e 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/create/ps/Ps.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/create/ps/Ps.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Create, CreateDataSetTypeEnum } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Create PS data set handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/create/ussDir/ussDir.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/create/ussDir/ussDir.handler.unit.test.ts index 299a0b6d28..8062b8d143 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/create/ussDir/ussDir.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/create/ussDir/ussDir.handler.unit.test.ts @@ -11,7 +11,7 @@ import { Create, IZosFilesOptions } from "@zowe/zos-files-for-zowe-sdk"; // import { CreateDataSetTypeEnum } from "../../../../src/api/methods/create/CreateDataSetType.enum"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Create USS Directory", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/create/ussFile/ussFile.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/create/ussFile/ussFile.handler.unit.test.ts index 765570d70d..05ebca4e72 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/create/ussFile/ussFile.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/create/ussFile/ussFile.handler.unit.test.ts @@ -11,7 +11,7 @@ import { Create, IZosFilesOptions } from "@zowe/zos-files-for-zowe-sdk"; // import { CreateDataSetTypeEnum } from "../../../../src/api/methods/create/CreateDataSetType.enum"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Create USS file", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/create/vsam/Vsam.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/create/vsam/Vsam.handler.unit.test.ts index 85a782fde4..cdcdf06c1d 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/create/vsam/Vsam.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/create/vsam/Vsam.handler.unit.test.ts @@ -11,7 +11,7 @@ import { Create } from "@zowe/zos-files-for-zowe-sdk"; import { ImperativeError } from "@zowe/imperative"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; const message: string = "Dummy error message"; diff --git a/packages/cli/__tests__/zosfiles/__unit__/create/zfs/zfs.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/create/zfs/zfs.handler.unit.test.ts index 2c789f1fc7..d206a06c20 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/create/zfs/zfs.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/create/zfs/zfs.handler.unit.test.ts @@ -11,7 +11,7 @@ import { Create } from "@zowe/zos-files-for-zowe-sdk"; import { ImperativeError } from "@zowe/imperative"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; const message: string = "Dummy error message"; diff --git a/packages/cli/__tests__/zosfiles/__unit__/download/am/AllMembers.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/download/am/AllMembers.handler.unit.test.ts index f838bc33a1..42a1e5352b 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/download/am/AllMembers.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/download/am/AllMembers.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Download } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Download AllMembers handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/download/ds/Dataset.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/download/ds/Dataset.handler.unit.test.ts index 372231a04e..0bc6a28354 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/download/ds/Dataset.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/download/ds/Dataset.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Download } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Download data set handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/download/dsm/DataSetMatching.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/download/dsm/DataSetMatching.handler.unit.test.ts index 3f8b8c87ca..ce1ae9cb95 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/download/dsm/DataSetMatching.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/download/dsm/DataSetMatching.handler.unit.test.ts @@ -13,14 +13,13 @@ import { IHandlerParameters, Session } from "@zowe/imperative"; import { Download, IDownloadOptions, IDsmListOptions, List } from "@zowe/zos-files-for-zowe-sdk"; import * as DataSetMatchingDefinition from "../../../../../src/zosfiles/download/dsm/DataSetMatching.definition"; import * as DataSetMatchingHandler from "../../../../../src/zosfiles/download/dsm/DataSetMatching.handler"; -import { UNIT_TEST_ZOSMF_PROF_OPTS, UNIT_TEST_PROFILES_ZOSMF } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "download", "output"], - definition: DataSetMatchingDefinition.DataSetMatchingDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: DataSetMatchingDefinition.DataSetMatchingDefinition }); const fakeListOptions: IDsmListOptions = { diff --git a/packages/cli/__tests__/zosfiles/__unit__/download/uss/UssFile.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/download/uss/UssFile.handler.unit.test.ts index e99676bec2..55afdf6edf 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/download/uss/UssFile.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/download/uss/UssFile.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Download } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Download uss file handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/download/ussdir/UssDir.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/download/ussdir/UssDir.handler.unit.test.ts index 64857d28ba..9619831883 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/download/ussdir/UssDir.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/download/ussdir/UssDir.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Download, IDownloadOptions, IUSSListOptions } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; const defaultListObj: IUSSListOptions = { name: "*", diff --git a/packages/cli/__tests__/zosfiles/__unit__/edit/Edit.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/edit/Edit.handler.unit.test.ts index e60b145612..7a30a79836 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/edit/Edit.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/edit/Edit.handler.unit.test.ts @@ -15,7 +15,7 @@ import {ILocalFile, import { mockHandlerParameters } from "@zowe/cli-test-utils"; import { EditDefinition } from "../../../../src/zosfiles/edit/Edit.definition"; import EditHandler from "../../../../src/zosfiles/edit/Edit.handler"; -import { UNIT_TEST_PROFILES_ZOSMF, UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../__tests__/__src__/TestConstants"; import stripAnsi = require("strip-ansi"); describe("Files Edit Group Handler", () => { @@ -27,8 +27,7 @@ describe("Files Edit Group Handler", () => { const commandParameters: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-files", "edit", "ds"], - definition: EditDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: EditDefinition }); const localFile: ILocalFile = { diff --git a/packages/cli/__tests__/zosfiles/__unit__/edit/Edit.utils.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/edit/Edit.utils.unit.test.ts index ade6752d11..a68cb87fa2 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/edit/Edit.utils.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/edit/Edit.utils.unit.test.ts @@ -11,7 +11,7 @@ import { mockHandlerParameters } from "@zowe/cli-test-utils"; import { AbstractSession, CliUtils, GuiResult, IHandlerParameters, ImperativeError, ProcessUtils } from "@zowe/imperative"; -import { UNIT_TEST_ZOSMF_PROF_OPTS, UNIT_TEST_PROFILES_ZOSMF } from "../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../__tests__/__src__/TestConstants"; import { EditDefinition } from "../../../../src/zosfiles/edit/Edit.definition"; import { EditUtilities, ILocalFile, Prompt } from "../../../../src/zosfiles/edit/Edit.utils"; import { cloneDeep } from "lodash"; @@ -26,15 +26,13 @@ describe("Files Edit Utilities", () => { const commandParametersDs: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-files", "edit", "ds"], - definition: EditDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: EditDefinition }); const commandParametersUss: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-files", "edit", "uss"], - definition: EditDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: EditDefinition }); commandParametersDs.arguments["dataSetName"] = commandParametersUss.arguments["file"] = 'fake'; diff --git a/packages/cli/__tests__/zosfiles/__unit__/invoke/amsFile/AmsFile.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/invoke/amsFile/AmsFile.handler.unit.test.ts index 5d84602ce3..f915990226 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/invoke/amsFile/AmsFile.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/invoke/amsFile/AmsFile.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Invoke, IZosFilesOptions } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Invoke AMS files handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/invoke/amsStatements/AmsStatements.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/invoke/amsStatements/AmsStatements.handler.unit.test.ts index df59cc5cff..4b3773a186 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/invoke/amsStatements/AmsStatements.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/invoke/amsStatements/AmsStatements.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Invoke } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Invoke AMS statements handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/list/am/AllMembers.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/list/am/AllMembers.handler.unit.test.ts index 55871bc2ab..cf11e3a249 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/list/am/AllMembers.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/list/am/AllMembers.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { List } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { IHandlerParameters } from "@zowe/imperative"; describe("List AllMembers handler", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/list/ds/Dataset.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/list/ds/Dataset.handler.unit.test.ts index e87a31e6d2..75f217a634 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/list/ds/Dataset.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/list/ds/Dataset.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { List } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("List Dataset handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/list/fs/Fs.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/list/fs/Fs.handler.unit.test.ts index 53e27e5c44..a052f68a63 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/list/fs/Fs.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/list/fs/Fs.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { List } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("fs handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/list/uss/Uss.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/list/uss/Uss.handler.unit.test.ts index 20ab8f4c07..54f0eba9de 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/list/uss/Uss.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/list/uss/Uss.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { List } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("USS file handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/mount/fs/fs.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/mount/fs/fs.handler.unit.test.ts index 5340676739..2a4fdee14a 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/mount/fs/fs.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/mount/fs/fs.handler.unit.test.ts @@ -11,7 +11,7 @@ import { Mount } from "@zowe/zos-files-for-zowe-sdk"; import { ImperativeError } from "@zowe/imperative"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; const message: string = "Dummy error message"; diff --git a/packages/cli/__tests__/zosfiles/__unit__/search/ds/Datasets.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/search/ds/Datasets.handler.unit.test.ts index 521d47f2d4..d3ed3f18c0 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/search/ds/Datasets.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/search/ds/Datasets.handler.unit.test.ts @@ -11,7 +11,7 @@ import { Search } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { TaskStage } from "@zowe/imperative"; describe("Search Datasets handler", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/upload/dtp/DirToPds.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/upload/dtp/DirToPds.handler.unit.test.ts index aba9173262..a544f56b6c 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/upload/dtp/DirToPds.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/upload/dtp/DirToPds.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Upload } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Upload dir-to-pds handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/upload/dtu/DirToUSS.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/upload/dtu/DirToUSS.handler.unit.test.ts index a90a269155..f1965a7d8d 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/upload/dtu/DirToUSS.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/upload/dtu/DirToUSS.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Upload, ZosFilesAttributes } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import * as fs from "fs"; describe("Upload dir-to-uss handler", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/upload/ftds/FileToDataSet.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/upload/ftds/FileToDataSet.handler.unit.test.ts index cddbc54373..c71ada1d52 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/upload/ftds/FileToDataSet.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/upload/ftds/FileToDataSet.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Upload } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Upload file-to-data-set handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/upload/ftu/FileToUSS.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/upload/ftu/FileToUSS.handler.unit.test.ts index 9e027cd02c..c4eedd2bd4 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/upload/ftu/FileToUSS.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/upload/ftu/FileToUSS.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Upload } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Upload file-to-uss handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/upload/stds/StdinToDataSet.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/upload/stds/StdinToDataSet.handler.unit.test.ts index 51b8e92c49..fbd3bdd65f 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/upload/stds/StdinToDataSet.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/upload/stds/StdinToDataSet.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Upload } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("Upload stdin-to-data-set handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/view/ds/Dataset.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/view/ds/Dataset.handler.unit.test.ts index 828246841e..a2b544a611 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/view/ds/Dataset.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/view/ds/Dataset.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Get } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("View data set handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosfiles/__unit__/view/uss/USSFiles.handler.unit.test.ts b/packages/cli/__tests__/zosfiles/__unit__/view/uss/USSFiles.handler.unit.test.ts index cdb40f7868..a3069f959c 100644 --- a/packages/cli/__tests__/zosfiles/__unit__/view/uss/USSFiles.handler.unit.test.ts +++ b/packages/cli/__tests__/zosfiles/__unit__/view/uss/USSFiles.handler.unit.test.ts @@ -10,7 +10,7 @@ */ import { Get } from "@zowe/zos-files-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; describe("View USS file handler", () => { describe("process method", () => { diff --git a/packages/cli/__tests__/zosjobs/__unit__/cancel/job/Job.handler.unit.test.ts b/packages/cli/__tests__/zosjobs/__unit__/cancel/job/Job.handler.unit.test.ts index df8c2da150..4c6a80e43b 100644 --- a/packages/cli/__tests__/zosjobs/__unit__/cancel/job/Job.handler.unit.test.ts +++ b/packages/cli/__tests__/zosjobs/__unit__/cancel/job/Job.handler.unit.test.ts @@ -15,10 +15,7 @@ import { GetJobs, CancelJobs, IJobFeedback } from "@zowe/zos-jobs-for-zowe-sdk"; import { GetJobsData } from "../../../__resources__/GetJobsData"; import * as JobHandler from "../../../../../src/zosjobs/cancel/job/Job.handler"; import * as JobDefinition from "../../../../../src/zosjobs/cancel/job/Job.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; process.env.FORCE_COLOR = "0"; @@ -26,8 +23,7 @@ process.env.FORCE_COLOR = "0"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "cancel", "job"], - definition: JobDefinition.JobDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: JobDefinition.JobDefinition }); const DEFAULT_RESPONSE_FEEDBACK: IJobFeedback = { diff --git a/packages/cli/__tests__/zosjobs/__unit__/delete/job/Job.handler.unit.test.ts b/packages/cli/__tests__/zosjobs/__unit__/delete/job/Job.handler.unit.test.ts index 4ac9c09ec3..d1945ef98f 100644 --- a/packages/cli/__tests__/zosjobs/__unit__/delete/job/Job.handler.unit.test.ts +++ b/packages/cli/__tests__/zosjobs/__unit__/delete/job/Job.handler.unit.test.ts @@ -15,10 +15,7 @@ import { GetJobs, DeleteJobs, IJobFeedback } from "@zowe/zos-jobs-for-zowe-sdk"; import { GetJobsData } from "../../../__resources__/GetJobsData"; import * as JobHandler from "../../../../../src/zosjobs/delete/job/Job.handler"; import * as JobDefinition from "../../../../../src/zosjobs/delete/job/Job.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; process.env.FORCE_COLOR = "0"; @@ -26,8 +23,7 @@ process.env.FORCE_COLOR = "0"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "delete", "job"], - definition: JobDefinition.JobDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: JobDefinition.JobDefinition }); const DEFAULT_RESPONSE_FEEDBACK: IJobFeedback = { diff --git a/packages/cli/__tests__/zosjobs/__unit__/delete/old-jobs/OldJobs.handler.unit.test.ts b/packages/cli/__tests__/zosjobs/__unit__/delete/old-jobs/OldJobs.handler.unit.test.ts index bc43ad6499..608efa2c0d 100644 --- a/packages/cli/__tests__/zosjobs/__unit__/delete/old-jobs/OldJobs.handler.unit.test.ts +++ b/packages/cli/__tests__/zosjobs/__unit__/delete/old-jobs/OldJobs.handler.unit.test.ts @@ -15,10 +15,7 @@ import { GetJobs, DeleteJobs } from "@zowe/zos-jobs-for-zowe-sdk"; import { GetJobsData } from "../../../__resources__/GetJobsData"; import * as OldJobsHandler from "../../../../../src/zosjobs/delete/old-jobs/OldJobs.handler"; import * as OldJobsDefinition from "../../../../../src/zosjobs/delete/old-jobs/OldJobs.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; process.env.FORCE_COLOR = "0"; @@ -26,8 +23,7 @@ process.env.FORCE_COLOR = "0"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "delete", "old-jobs"], - definition: OldJobsDefinition.OldJobsDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: OldJobsDefinition.OldJobsDefinition }); describe("delete old-jobs handler tests", () => { diff --git a/packages/cli/__tests__/zosjobs/__unit__/download/download-output/Output.handler.unit.test.ts b/packages/cli/__tests__/zosjobs/__unit__/download/download-output/Output.handler.unit.test.ts index ea7378a4ff..b2bc1e02a9 100644 --- a/packages/cli/__tests__/zosjobs/__unit__/download/download-output/Output.handler.unit.test.ts +++ b/packages/cli/__tests__/zosjobs/__unit__/download/download-output/Output.handler.unit.test.ts @@ -16,10 +16,7 @@ jest.mock("@zowe/zos-jobs-for-zowe-sdk"); import { IHandlerParameters, ImperativeError, Session } from "@zowe/imperative"; import * as OutputHandler from "../../../../../src/zosjobs/download/download-output/Output.handler"; import * as OutputDefinition from "../../../../../src/zosjobs/download/download-output/Output.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; process.env.FORCE_COLOR = "0"; @@ -27,8 +24,7 @@ process.env.FORCE_COLOR = "0"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "download", "output"], - definition: OutputDefinition.OutputDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: OutputDefinition.OutputDefinition }); describe("download output handler tests", () => { diff --git a/packages/cli/__tests__/zosjobs/__unit__/list/jobs/Jobs.handler.unit.test.ts b/packages/cli/__tests__/zosjobs/__unit__/list/jobs/Jobs.handler.unit.test.ts index 1dbca8370e..edad84edbc 100644 --- a/packages/cli/__tests__/zosjobs/__unit__/list/jobs/Jobs.handler.unit.test.ts +++ b/packages/cli/__tests__/zosjobs/__unit__/list/jobs/Jobs.handler.unit.test.ts @@ -16,10 +16,7 @@ jest.mock("@zowe/zos-jobs-for-zowe-sdk"); import { IHandlerParameters, ImperativeError, Session } from "@zowe/imperative"; import * as JobsHandler from "../../../../../src/zosjobs/list/jobs/Jobs.handler"; import * as JobsDefinition from "../../../../../src/zosjobs/list/jobs/Jobs.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; process.env.FORCE_COLOR = "0"; @@ -27,8 +24,7 @@ process.env.FORCE_COLOR = "0"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "view", "job"], - definition: JobsDefinition.JobsDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: JobsDefinition.JobsDefinition }); describe("list jobs handler tests", () => { diff --git a/packages/cli/__tests__/zosjobs/__unit__/list/spool-files-by-jobid/SpoolFilesByJobid.handler.unit.test.ts b/packages/cli/__tests__/zosjobs/__unit__/list/spool-files-by-jobid/SpoolFilesByJobid.handler.unit.test.ts index 18e8e481d1..88f1d40a60 100644 --- a/packages/cli/__tests__/zosjobs/__unit__/list/spool-files-by-jobid/SpoolFilesByJobid.handler.unit.test.ts +++ b/packages/cli/__tests__/zosjobs/__unit__/list/spool-files-by-jobid/SpoolFilesByJobid.handler.unit.test.ts @@ -15,10 +15,7 @@ import { GetJobs } from "@zowe/zos-jobs-for-zowe-sdk"; import { GetJobsData } from "../../../__resources__/GetJobsData"; import { SpoolFilesByJobidDefinition } from "../../../../../src/zosjobs/list/spool-files-by-jobid/SpoolFilesByJobid.definition"; import * as SpoolFilesHandler from "../../../../../src/zosjobs/list/spool-files-by-jobid/SpoolFilesByJobid.handler"; -import { - UNIT_TEST_PROFILES_ZOSMF, - UNIT_TEST_ZOSMF_PROF_OPTS -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; // Disable coloring for the snapshots @@ -27,8 +24,7 @@ process.env.FORCE_COLOR = "0"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "list", "spool-files"], - definition: SpoolFilesByJobidDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: SpoolFilesByJobidDefinition }); describe("zos-jobs list spool-files-by-jobid handler", () => { diff --git a/packages/cli/__tests__/zosjobs/__unit__/modify/job/Job.handler.unit.test.ts b/packages/cli/__tests__/zosjobs/__unit__/modify/job/Job.handler.unit.test.ts index fc0b1a4d2a..b703740e85 100644 --- a/packages/cli/__tests__/zosjobs/__unit__/modify/job/Job.handler.unit.test.ts +++ b/packages/cli/__tests__/zosjobs/__unit__/modify/job/Job.handler.unit.test.ts @@ -14,10 +14,7 @@ import { IHandlerParameters, ImperativeError } from "@zowe/imperative"; import { GetJobs, IJob, IJobFeedback, ModifyJobs } from "@zowe/zos-jobs-for-zowe-sdk"; import * as ModifyDefintion from "../../../../../src/zosjobs/modify/job/Job.definition"; import * as ModifyHandler from "../../../../../src/zosjobs/modify/job/Job.handler"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; process.env.FORCE_COLOR = "0"; @@ -25,8 +22,7 @@ process.env.FORCE_COLOR = "0"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "modify", "job"], - definition: ModifyDefintion.JobDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: ModifyDefintion.JobDefinition }); const SAMPLE_COMPLETE_JOB: IJob= { diff --git a/packages/cli/__tests__/zosjobs/__unit__/search/job/JobSearch.handler.unit.test.ts b/packages/cli/__tests__/zosjobs/__unit__/search/job/JobSearch.handler.unit.test.ts index 1d9a126d96..9b426a8201 100644 --- a/packages/cli/__tests__/zosjobs/__unit__/search/job/JobSearch.handler.unit.test.ts +++ b/packages/cli/__tests__/zosjobs/__unit__/search/job/JobSearch.handler.unit.test.ts @@ -14,10 +14,7 @@ import { IHandlerParameters, ImperativeError } from "@zowe/imperative"; import { SearchJobs } from "@zowe/zos-jobs-for-zowe-sdk"; import * as JobHandler from "../../../../../src/zosjobs/search/job/Job.handler"; import * as JobDefinition from "../../../../../src/zosjobs/search/job/Job.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; process.env.FORCE_COLOR = "0"; @@ -28,8 +25,7 @@ const mockSearchData: string = "This job contains RC=0000"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "search", "job"], - definition: JobDefinition.JobDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: JobDefinition.JobDefinition }); describe("search job handler tests", () => { diff --git a/packages/cli/__tests__/zosjobs/__unit__/submit/Submit.shared.handler.unit.test.ts b/packages/cli/__tests__/zosjobs/__unit__/submit/Submit.shared.handler.unit.test.ts index dc0135c776..a6ec8b0933 100644 --- a/packages/cli/__tests__/zosjobs/__unit__/submit/Submit.shared.handler.unit.test.ts +++ b/packages/cli/__tests__/zosjobs/__unit__/submit/Submit.shared.handler.unit.test.ts @@ -13,10 +13,7 @@ jest.mock("@zowe/zos-jobs-for-zowe-sdk"); import { MonitorJobs, SubmitJobs, ISubmitJobUSSParms, ISubmitJobParms } from "@zowe/zos-jobs-for-zowe-sdk"; import { IHandlerParameters, ImperativeError, IO } from "@zowe/imperative"; import * as SubmitDefinition from "../../../../src/zosjobs/submit/Submit.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; process.env.FORCE_COLOR = "0"; @@ -29,22 +26,19 @@ describe("submit shared handler", () => { DEFAULT_PARAMETERS = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "submit", "data-set"], - definition: SubmitDefinition.SubmitDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: SubmitDefinition.SubmitDefinition }); USSFILE_PARAMETERS = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "submit", "uss-file"], - definition: SubmitDefinition.SubmitDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: SubmitDefinition.SubmitDefinition }); LOCALFILE_PARAMETERS = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "submit", "local-file"], - definition: SubmitDefinition.SubmitDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: SubmitDefinition.SubmitDefinition }); }); diff --git a/packages/cli/__tests__/zosjobs/__unit__/view/all-spool-content/AllSpoolContent.handler.unit.test.ts b/packages/cli/__tests__/zosjobs/__unit__/view/all-spool-content/AllSpoolContent.handler.unit.test.ts index c7cb2b4b33..432c0b22dd 100644 --- a/packages/cli/__tests__/zosjobs/__unit__/view/all-spool-content/AllSpoolContent.handler.unit.test.ts +++ b/packages/cli/__tests__/zosjobs/__unit__/view/all-spool-content/AllSpoolContent.handler.unit.test.ts @@ -16,7 +16,7 @@ import { GetJobsData } from "../../../__resources__/GetJobsData"; import { AllSpoolContentDefinition } from "../../../../../src/zosjobs/view/all-spool-content/AllSpoolContent.definition"; import * as fs from "fs"; import { ZosmfSession } from "@zowe/zosmf-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS, UNIT_TEST_PROFILES_ZOSMF } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; import * as AllSpoolContentHandler from "../../../../../src/zosjobs/view/all-spool-content/AllSpoolContent.handler"; @@ -27,8 +27,7 @@ const TEST_RESOURCES_DIR = __dirname + "/../../../__resources__"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "view", "spool-file-by-id"], - definition: AllSpoolContentDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF, + definition: AllSpoolContentDefinition }); describe("zos-jobs view all-spool-content handler", () => { diff --git a/packages/cli/__tests__/zosjobs/__unit__/view/job/JobStatusByJobid.handler.unit.test.ts b/packages/cli/__tests__/zosjobs/__unit__/view/job/JobStatusByJobid.handler.unit.test.ts index 6e23fc4557..305b21e1ae 100644 --- a/packages/cli/__tests__/zosjobs/__unit__/view/job/JobStatusByJobid.handler.unit.test.ts +++ b/packages/cli/__tests__/zosjobs/__unit__/view/job/JobStatusByJobid.handler.unit.test.ts @@ -15,10 +15,7 @@ import { GetJobs } from "@zowe/zos-jobs-for-zowe-sdk"; import { GetJobsData } from "../../../__resources__/GetJobsData"; import * as JobStatusByJobidHandler from "../../../../../src/zosjobs/view/job-status-by-jobid/JobStatusByJobid.handler"; import * as JobStatusByJobidDefinition from "../../../../../src/zosjobs/view/job-status-by-jobid/JobStatusByJobid.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; process.env.FORCE_COLOR = "0"; @@ -27,8 +24,7 @@ process.env.FORCE_COLOR = "0"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "view", "job"], - definition: JobStatusByJobidDefinition.JobStatusByJobidDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: JobStatusByJobidDefinition.JobStatusByJobidDefinition }); describe("view job-status-by-jobid handler tests", () => { diff --git a/packages/cli/__tests__/zosjobs/__unit__/view/spool-file-by-id/SpoolFileById.handler.unit.test.ts b/packages/cli/__tests__/zosjobs/__unit__/view/spool-file-by-id/SpoolFileById.handler.unit.test.ts index 094cc6e9ed..6d6582727f 100644 --- a/packages/cli/__tests__/zosjobs/__unit__/view/spool-file-by-id/SpoolFileById.handler.unit.test.ts +++ b/packages/cli/__tests__/zosjobs/__unit__/view/spool-file-by-id/SpoolFileById.handler.unit.test.ts @@ -17,7 +17,7 @@ import { SpoolFilesByJobidDefinition } from "../../../../../src/zosjobs/list/spo import * as SpoolFileByIdHandler from "../../../../../src/zosjobs/view/spool-file-by-id/SpoolFileById.handler"; import * as fs from "fs"; import { ZosmfSession } from "@zowe/zosmf-for-zowe-sdk"; -import { UNIT_TEST_ZOSMF_PROF_OPTS, UNIT_TEST_PROFILES_ZOSMF } from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; import { cloneDeep } from "lodash"; @@ -28,8 +28,7 @@ const TEST_RESOURCES_DIR = __dirname + "/../../../__resources__"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-jobs", "view", "spool-file-by-id"], - definition: SpoolFilesByJobidDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: SpoolFilesByJobidDefinition }); describe("zos-jobs view spool-file-by-id handler", () => { diff --git a/packages/cli/__tests__/zoslogs/__unit__/list/logs/Logs.handler.unit.test.ts b/packages/cli/__tests__/zoslogs/__unit__/list/logs/Logs.handler.unit.test.ts index f262d4d8ce..5fb4912fc3 100644 --- a/packages/cli/__tests__/zoslogs/__unit__/list/logs/Logs.handler.unit.test.ts +++ b/packages/cli/__tests__/zoslogs/__unit__/list/logs/Logs.handler.unit.test.ts @@ -15,10 +15,7 @@ import { IHandlerParameters, ImperativeError, Session, Imperative } from "@zowe/ import * as LogsHandler from "../../../../../src/zoslogs/list/logs/Logs.handler"; import * as LogsDefinition from "../../../../../src/zoslogs/list/logs/Logs.definition"; import { GetZosLog, IZosLogParms } from "@zowe/zos-logs-for-zowe-sdk"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; process.env.FORCE_COLOR = "0"; @@ -29,8 +26,7 @@ const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ ...UNIT_TEST_ZOSMF_PROF_OPTS }, positionals: ["zos-logs", "list", "logs"], - definition: LogsDefinition.LogsDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: LogsDefinition.LogsDefinition }); describe("get logs handler tests", () => { diff --git a/packages/cli/__tests__/zosmf/__unit__/check/status/Status.handler.unit.test.ts b/packages/cli/__tests__/zosmf/__unit__/check/status/Status.handler.unit.test.ts index 6741cf64ca..e3800ce919 100644 --- a/packages/cli/__tests__/zosmf/__unit__/check/status/Status.handler.unit.test.ts +++ b/packages/cli/__tests__/zosmf/__unit__/check/status/Status.handler.unit.test.ts @@ -14,17 +14,13 @@ import { CheckStatus } from "@zowe/zosmf-for-zowe-sdk"; import { ICommandHandler, IHandlerParameters } from "@zowe/imperative"; import CmdHandler from "../../../../../src/zosmf/check/status/Status.handler"; import * as cmdDef from "../../../../../src/zosmf/check/status/Status.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const goodCmdParms: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zosmf", "check", "status"], - definition: cmdDef.StatusDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: cmdDef.StatusDefinition }); let checkStatHandler: ICommandHandler = null; diff --git a/packages/cli/__tests__/zosmf/__unit__/list/systems/Systems.handler.unit.test.ts b/packages/cli/__tests__/zosmf/__unit__/list/systems/Systems.handler.unit.test.ts index c25c6c7280..fa2c8e5a32 100644 --- a/packages/cli/__tests__/zosmf/__unit__/list/systems/Systems.handler.unit.test.ts +++ b/packages/cli/__tests__/zosmf/__unit__/list/systems/Systems.handler.unit.test.ts @@ -15,17 +15,13 @@ import { ListDefinedSystems } from "@zowe/zosmf-for-zowe-sdk"; import { ICommandHandler, IHandlerParameters } from "@zowe/imperative"; import CmdHandler from "../../../../../src/zosmf/list/systems/Systems.handler"; import * as cmdDef from "../../../../../src/zosmf/list/systems/Systems.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const goodCmdParms: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zosmf", "check", "status"], - definition: cmdDef.SystemsDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: cmdDef.SystemsDefinition }); let listSystemsHandler: ICommandHandler = null; diff --git a/packages/cli/__tests__/zostso/__unit__/issue/command/Command.handler.unit.test.ts b/packages/cli/__tests__/zostso/__unit__/issue/command/Command.handler.unit.test.ts index 6bf449c70d..7d82689383 100644 --- a/packages/cli/__tests__/zostso/__unit__/issue/command/Command.handler.unit.test.ts +++ b/packages/cli/__tests__/zostso/__unit__/issue/command/Command.handler.unit.test.ts @@ -15,11 +15,7 @@ import { IHandlerParameters, ImperativeError } from "@zowe/imperative"; import * as Command from "../../../../../src/zostso/issue/command/Command.handler"; import { CommandDefinition } from "../../../../../src/zostso/issue/command/Command.definition"; import { StartTsoData } from "../../../__resources__/StartTsoData"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF_TSO, - UNIT_TEST_TSO_PROF_OPTS -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS, UNIT_TEST_TSO_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ @@ -28,8 +24,7 @@ const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ ...UNIT_TEST_TSO_PROF_OPTS }, positionals: ["zos-tso", "issue", "address-space"], - definition: CommandDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF_TSO + definition: CommandDefinition }); describe("issue command handler tests", () => { diff --git a/packages/cli/__tests__/zostso/__unit__/ping/address-space/AddressSpace.handler.unit.test.ts b/packages/cli/__tests__/zostso/__unit__/ping/address-space/AddressSpace.handler.unit.test.ts index d8a0b0aa38..1c63e55c73 100644 --- a/packages/cli/__tests__/zostso/__unit__/ping/address-space/AddressSpace.handler.unit.test.ts +++ b/packages/cli/__tests__/zostso/__unit__/ping/address-space/AddressSpace.handler.unit.test.ts @@ -16,17 +16,13 @@ import { PingTso } from "@zowe/zos-tso-for-zowe-sdk"; import { IHandlerParameters, ImperativeError } from "@zowe/imperative"; import * as PingAddressSpaceHandler from "../../../../../src/zostso/ping/address_space/PingAddressSpace.handler"; import { PingAddressSpaceCommandDefinition } from "../../../../../src/zostso/ping/address_space/PingAddressSpace.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-tso", "ping", "address-space"], - definition: PingAddressSpaceCommandDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: PingAddressSpaceCommandDefinition }); describe("ping address-space handler tests", () => { diff --git a/packages/cli/__tests__/zostso/__unit__/send/address-space/AddressSpace.handler.unit.test.ts b/packages/cli/__tests__/zostso/__unit__/send/address-space/AddressSpace.handler.unit.test.ts index c439ca7aee..584e3ab655 100644 --- a/packages/cli/__tests__/zostso/__unit__/send/address-space/AddressSpace.handler.unit.test.ts +++ b/packages/cli/__tests__/zostso/__unit__/send/address-space/AddressSpace.handler.unit.test.ts @@ -16,17 +16,13 @@ import { SendTso } from "@zowe/zos-tso-for-zowe-sdk"; import { IHandlerParameters, ImperativeError } from "@zowe/imperative"; import * as SendToAddressSpace from "../../../../../src/zostso/send/address_space/SendToAddressSpace.handler"; import { SendToAddressSpaceCommandDefinition } from "../../../../../src/zostso/send/address_space/SendToAddressSpace.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-tso", "send", "address-space"], - definition: SendToAddressSpaceCommandDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: SendToAddressSpaceCommandDefinition }); describe("send address-space handler tests", () => { diff --git a/packages/cli/__tests__/zostso/__unit__/start/address-space/AddressSpace.handler.unit.test.ts b/packages/cli/__tests__/zostso/__unit__/start/address-space/AddressSpace.handler.unit.test.ts index 5bd864a64f..3b9411ee08 100644 --- a/packages/cli/__tests__/zostso/__unit__/start/address-space/AddressSpace.handler.unit.test.ts +++ b/packages/cli/__tests__/zostso/__unit__/start/address-space/AddressSpace.handler.unit.test.ts @@ -11,23 +11,12 @@ import { StartTso } from "@zowe/zos-tso-for-zowe-sdk"; import { StartTsoData } from "../../../__resources__/StartTsoData"; -import { CommandProfiles, IHandlerParameters, ImperativeError, IProfile } from "@zowe/imperative"; +import { IHandlerParameters, ImperativeError } from "@zowe/imperative"; import * as AddressSpaceHandler from "../../../../../src/zostso/start/address-space/AddressSpace.handler"; import * as AddressSpaceDefinition from "../../../../../src/zostso/start/address-space/AddressSpace.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; -const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "zosmf", [{ - name: "zosmf", - type: "zosmf", - ...UNIT_TEST_ZOSMF_PROF_OPTS - }] -); - const TSO_PROF_OPTS = { logonProcedure: "IZUFPROC", characterSet: "697", @@ -38,21 +27,10 @@ const TSO_PROF_OPTS = { account: "DEFAULT" }; -PROFILE_MAP.set( - "tso", [{ - name: "tso", - type: "tso", - ...TSO_PROF_OPTS - }] -); - -const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); - const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-tso", "start", "address-space"], - definition: AddressSpaceDefinition.AddressSpaceDefinition, - profiles: PROFILES + definition: AddressSpaceDefinition.AddressSpaceDefinition }); describe("start address-space handler tests", () => { diff --git a/packages/cli/__tests__/zostso/__unit__/stop/address-space/AddressSpace.handler.unit.test.ts b/packages/cli/__tests__/zostso/__unit__/stop/address-space/AddressSpace.handler.unit.test.ts index 978f739e01..80c78c1acf 100644 --- a/packages/cli/__tests__/zostso/__unit__/stop/address-space/AddressSpace.handler.unit.test.ts +++ b/packages/cli/__tests__/zostso/__unit__/stop/address-space/AddressSpace.handler.unit.test.ts @@ -15,17 +15,13 @@ import { StopTsoData } from "../../../__resources__/StopTsoData"; import { IHandlerParameters, ImperativeError } from "@zowe/imperative"; import * as AddressSpaceHandler from "../../../../../src/zostso/stop/address-space/AddressSpace.handler"; import * as AddressSpaceDefinition from "../../../../../src/zostso/stop/address-space/AddressSpace.definition"; -import { - UNIT_TEST_ZOSMF_PROF_OPTS, - UNIT_TEST_PROFILES_ZOSMF -} from "../../../../../../../__tests__/__src__/mocks/ZosmfProfileMock"; +import { UNIT_TEST_ZOSMF_PROF_OPTS } from "../../../../../../../__tests__/__src__/TestConstants"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_ZOSMF_PROF_OPTS, positionals: ["zos-tso", "stop", "address-space"], - definition: AddressSpaceDefinition.AddressSpaceDefinition, - profiles: UNIT_TEST_PROFILES_ZOSMF + definition: AddressSpaceDefinition.AddressSpaceDefinition }); describe("stop address-space handler tests", () => { diff --git a/packages/cli/__tests__/zosuss/__unit__/issue/ssh/Ssh.handler.unit.test.ts b/packages/cli/__tests__/zosuss/__unit__/issue/ssh/Ssh.handler.unit.test.ts index 58c1fedba0..c7bdc2efab 100644 --- a/packages/cli/__tests__/zosuss/__unit__/issue/ssh/Ssh.handler.unit.test.ts +++ b/packages/cli/__tests__/zosuss/__unit__/issue/ssh/Ssh.handler.unit.test.ts @@ -11,7 +11,7 @@ jest.mock("../../../../../../zosuss/lib/Shell"); -import { IHandlerParameters, IProfile, CommandProfiles, ConnectionPropsForSessCfg } from "@zowe/imperative"; +import { IHandlerParameters, ConnectionPropsForSessCfg } from "@zowe/imperative"; import SshHandler from "../../../../../src/zosuss/issue/ssh/Ssh.handler"; import * as SshDefinition from "../../../../../src/zosuss/issue/ssh/Ssh.definition"; import { Shell } from "@zowe/zos-uss-for-zowe-sdk"; @@ -47,73 +47,28 @@ const UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER = { keyPassPhrase: "dummyPassPhrase123" }; - -// A mocked profile map with ssh profile -const UNIT_TEST_PROFILE_MAP = new Map(); -UNIT_TEST_PROFILE_MAP.set( - "ssh", [{ - name: "ssh", - type: "ssh", - ...UNIT_TEST_SSH_PROF_OPTS - }] -); -const UNIT_TEST_PROFILES_SSH = new CommandProfiles(UNIT_TEST_PROFILE_MAP); - -const UNIT_TEST_PROFILE_MAP_PRIVATE_KEY = new Map(); -UNIT_TEST_PROFILE_MAP_PRIVATE_KEY.set( - "ssh", [{ - name: "ssh", - type: "ssh", - ...UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY - }] -); -const UNIT_TEST_PROFILE_MAP_PRIVATE_KEY_WITH_PASSPHRASE = new Map(); -UNIT_TEST_PROFILE_MAP_PRIVATE_KEY_WITH_PASSPHRASE.set( - "ssh", [{ - name: "ssh", - type: "ssh", - ...UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY_WITH_PASSPHRASE - }] -); -const UNIT_TEST_PROFILE_MAP_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER = new Map(); -UNIT_TEST_PROFILE_MAP_PRIVATE_KEY_WITH_PASSPHRASE.set( - "ssh", [{ - name: "ssh", - type: "ssh", - ...UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER - }] -); - -const UNIT_TEST_PROFILES_SSH_PRIVATE_KEY = new CommandProfiles(UNIT_TEST_PROFILE_MAP_PRIVATE_KEY); -const UNIT_TEST_PROFILES_SSH_PRIVATE_KEY_WITH_PASSPHRASE = new CommandProfiles(UNIT_TEST_PROFILE_MAP_PRIVATE_KEY_WITH_PASSPHRASE); -const UNIT_TEST_PROFILES_SSH_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER = new CommandProfiles(UNIT_TEST_PROFILE_MAP_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER); - // Mocked parameters for the unit tests const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_SSH_PROF_OPTS, positionals: ["zos-uss", "issue", "ssh"], - definition: SshDefinition.SshDefinition, - profiles: UNIT_TEST_PROFILES_SSH + definition: SshDefinition.SshDefinition }); const DEFAULT_PARAMETERS_PRIVATE_KEY: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY, positionals: ["zos-uss", "issue", "ssh"], - definition: SshDefinition.SshDefinition, - profiles: UNIT_TEST_PROFILES_SSH_PRIVATE_KEY + definition: SshDefinition.SshDefinition }); const DEFAULT_PARAMETERS_KEY_PASSPHRASE: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY_WITH_PASSPHRASE, positionals: ["zos-uss", "issue", "ssh"], - definition: SshDefinition.SshDefinition, - profiles: UNIT_TEST_PROFILES_SSH_PRIVATE_KEY_WITH_PASSPHRASE, + definition: SshDefinition.SshDefinition }); const DEFAULT_PARAMETERS_KEY_PASSPHRASE_NO_USER: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER, positionals: ["zos-uss", "issue", "ssh"], - definition: SshDefinition.SshDefinition, - profiles: UNIT_TEST_PROFILES_SSH_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER, + definition: SshDefinition.SshDefinition }); const testOutput = "TEST OUTPUT"; diff --git a/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/invalid/Cmd.cli.invalid.profile-spec.integration.test.ts b/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/invalid/Cmd.cli.invalid.profile-spec.integration.test.ts deleted file mode 100644 index fb1f2c2c38..0000000000 --- a/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/invalid/Cmd.cli.invalid.profile-spec.integration.test.ts +++ /dev/null @@ -1,40 +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. -* -*/ - -import { ITestEnvironment } from "../../../../../../__src__/environment/doc/response/ITestEnvironment"; -import { SetupTestEnvironment } from "../../../../../../__src__/environment/SetupTestEnvironment"; -import { runCliScript } from "../../../../../../src/TestUtil"; - - -let TEST_ENVIRONMENT: ITestEnvironment; - -describe("cmd-cli invalid profile-spec", () => { - // Create the unique test environment - beforeAll(async () => { - TEST_ENVIRONMENT = await SetupTestEnvironment.createTestEnv({ - cliHomeEnvVar: "CMD_CLI_CLI_HOME", - testName: "cmd_cli_invalid_profile_spec" - }); - }); - - it("should fail the command if the profile property is not supplied and the handler requests a profile", () => { - const response = runCliScript(__dirname + "/__scripts__/profile-spec.sh", TEST_ENVIRONMENT.workingDir); - expect(response.stdout.toString()).toBe(''); - expect(response.stderr.toString()).toContain('Internal Error: No profiles of type "blah" were loaded for this command.'); - expect(response.status).toBe(1); - expect(response.stderr.toString()).toContain('This error can occur for one of two reasons:'); - expect(response.stderr.toString()).toContain('- The "profile" property on the command definition document ' + - 'does NOT specify the requested profile type'); - expect(response.stderr.toString()).toContain('- The profile type is marked "optional", ' + - 'no profiles of type "blah" have been created, ' + - 'and the command handler requested a profile of type "blah" with "failNotFound=true"'); - }); -}); diff --git a/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/invalid/__scripts__/profile-spec.sh b/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/invalid/__scripts__/profile-spec.sh deleted file mode 100644 index 1879d239cd..0000000000 --- a/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/invalid/__scripts__/profile-spec.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -cmd-cli invalid profile-spec -exit $? \ No newline at end of file diff --git a/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/root/__snapshots__/Cmd.cli.root.integration.test.ts.snap b/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/root/__snapshots__/Cmd.cli.root.integration.test.ts.snap index 8606fe3568..0a4eb0e99b 100644 --- a/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/root/__snapshots__/Cmd.cli.root.integration.test.ts.snap +++ b/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/root/__snapshots__/Cmd.cli.root.integration.test.ts.snap @@ -196,11 +196,6 @@ cmd-cli invalid no-handler This will never get invoked. No handler specified on this definition. -cmd-cli invalid profile-spec - - Command handler attempts to load a profile that wasn't specified on the command - definition - cmd-cli invoke exit-143 Test handler that exits with status code 143 @@ -260,10 +255,6 @@ cmd-cli profile mapping-positional Tests Imperative's profile to CLI mapping capabilities. -cmd-cli read profile - - Read some profiles - cmd-cli respond with-data-array Formulates a string array object to pass back when response format JSON is diff --git a/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/Invalid.definition.ts b/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/Invalid.definition.ts index d6ca7fef31..6c0fa036ba 100644 --- a/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/Invalid.definition.ts +++ b/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/Invalid.definition.ts @@ -12,15 +12,13 @@ import { ICommandDefinition } from "../../../../../../lib/index"; import { NoHandlerDefinition } from "./no-handler/NoHandler.definition"; import { InvalidHandlerDefinition } from "./invalid-handler/InvalidHandler.definition"; -import { ProfileSpecDefinition } from "./profile-spec/ProfileSpec.definition"; export const definition: ICommandDefinition = { name: "invalid", description: "Attempt to invoke commands that have poorly coded definitions.", summary: "Invalid definitions", type: "group", - children: [NoHandlerDefinition, InvalidHandlerDefinition, - ProfileSpecDefinition] + children: [NoHandlerDefinition, InvalidHandlerDefinition] }; module.exports = definition; diff --git a/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/profile-spec/ProfileSpec.definition.ts b/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/profile-spec/ProfileSpec.definition.ts deleted file mode 100644 index a14f67bb4c..0000000000 --- a/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/profile-spec/ProfileSpec.definition.ts +++ /dev/null @@ -1,21 +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. -* -*/ - -import { ICommandDefinition } from "../../../../../../../lib"; - - -export const ProfileSpecDefinition: ICommandDefinition = { - name: "profile-spec", - aliases: ["ao"], - description: "Command handler attempts to load a profile that wasn't specified on the command definition", - type: "command", - handler: __dirname + "/ProfileSpec.handler" -}; diff --git a/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/profile-spec/ProfileSpec.handler.ts b/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/profile-spec/ProfileSpec.handler.ts deleted file mode 100644 index 750248d6c4..0000000000 --- a/packages/imperative/__tests__/__integration__/cmd/src/cli/invalid/profile-spec/ProfileSpec.handler.ts +++ /dev/null @@ -1,19 +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. -* -*/ - -import { ICommandHandler, IHandlerParameters } from "../../../../../../../lib"; - -export default class ProfileSpecHandler implements ICommandHandler { - public async process(params: IHandlerParameters): Promise { - // eslint-disable-next-line deprecation/deprecation - params.profiles.get("blah"); - } -} diff --git a/packages/imperative/__tests__/__integration__/cmd/src/cli/read/Read.definition.ts b/packages/imperative/__tests__/__integration__/cmd/src/cli/read/Read.definition.ts deleted file mode 100644 index d10a2b8121..0000000000 --- a/packages/imperative/__tests__/__integration__/cmd/src/cli/read/Read.definition.ts +++ /dev/null @@ -1,23 +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. -* -*/ - -import { ICommandDefinition } from "../../../../../../lib"; -import { ProfileCommand } from "./profile/Profile.definition"; - -export const definition: ICommandDefinition = { - name: "read", - description: "Read some profiles", - summary: "Read some profiles", - type: "group", - children: [ProfileCommand], -}; - -module.exports = definition; diff --git a/packages/imperative/__tests__/__integration__/cmd/src/cli/read/profile/Profile.definition.ts b/packages/imperative/__tests__/__integration__/cmd/src/cli/read/profile/Profile.definition.ts deleted file mode 100644 index f8a0337eef..0000000000 --- a/packages/imperative/__tests__/__integration__/cmd/src/cli/read/profile/Profile.definition.ts +++ /dev/null @@ -1,23 +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. -* -*/ - -import { ICommandDefinition } from "../../../../../../../lib"; - -export const ProfileCommand: ICommandDefinition = { - name: "profile", - description: "Read some profiles", - summary: "Read some profiles", - type: "command", - handler: __dirname + "/Profile.handler", - profile: { - required: ["insecure"] - } -}; diff --git a/packages/imperative/__tests__/__integration__/cmd/src/cli/read/profile/Profile.handler.ts b/packages/imperative/__tests__/__integration__/cmd/src/cli/read/profile/Profile.handler.ts deleted file mode 100644 index 18da0fe758..0000000000 --- a/packages/imperative/__tests__/__integration__/cmd/src/cli/read/profile/Profile.handler.ts +++ /dev/null @@ -1,20 +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. -* -*/ - -import { IHandlerParameters, ICommandHandler, TextUtils } from "../../../../../../../lib/index"; - -export default class FirstGroupCommandOneHandler implements ICommandHandler { - public async process(params: IHandlerParameters): Promise { - // eslint-disable-next-line deprecation/deprecation - const prof = params.profiles.get("insecure"); - params.response.console.log(TextUtils.prettyJson(prof)); - } -} diff --git a/packages/imperative/__tests__/src/packages/cmd/__integration__/CliProfileManager.integration.test.ts b/packages/imperative/__tests__/src/packages/cmd/__integration__/CliProfileManager.integration.test.ts index 22ebad1b72..4f5ce662af 100644 --- a/packages/imperative/__tests__/src/packages/cmd/__integration__/CliProfileManager.integration.test.ts +++ b/packages/imperative/__tests__/src/packages/cmd/__integration__/CliProfileManager.integration.test.ts @@ -9,6 +9,8 @@ * */ +/* eslint-disable deprecation/deprecation */ + import * as TestUtil from "../../../TestUtil"; import { TestLogger } from "../../../../src/TestLogger"; import { CliProfileManager } from "../../../../../src/cmd/src/profiles/CliProfileManager"; diff --git a/packages/imperative/src/cmd/__tests__/CommandProcessor.unit.test.ts b/packages/imperative/src/cmd/__tests__/CommandProcessor.unit.test.ts index be3f7bfe2a..a333af0ebf 100644 --- a/packages/imperative/src/cmd/__tests__/CommandProcessor.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/CommandProcessor.unit.test.ts @@ -18,7 +18,6 @@ import { IHelpGenerator } from "../src/help/doc/IHelpGenerator"; import { ImperativeError } from "../../error"; import { ICommandValidatorResponse } from "../src/doc/response/response/ICommandValidatorResponse"; import { SharedOptions } from "../src/utils/SharedOptions"; -import { CommandProfileLoader } from "../src/profiles/CommandProfileLoader"; import { CliUtils } from "../../utilities/src/CliUtils"; import { WebHelpManager } from "../src/help/WebHelpManager"; import { ImperativeConfig } from "../../utilities/src/ImperativeConfig"; @@ -789,43 +788,6 @@ describe("Command Processor", () => { expect(logOutput).toContain("--user **** --password **** --token-value **** --cert-file-passphrase **** --cert-key-file ****"); }); - it("should handle an error thrown from the profile loader", async () => { - // Allocate the command processor - const processor: CommandProcessor = new CommandProcessor({ - envVariablePrefix: ENV_VAR_PREFIX, - fullDefinition: SAMPLE_COMPLEX_COMMAND, - definition: SAMPLE_COMMAND_REAL_HANDLER, - helpGenerator: FAKE_HELP_GENERATOR, - rootCommandName: SAMPLE_ROOT_COMMAND, - commandLine: "", - promptPhrase: "dummydummy" - }); - - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - - // Mock the profile loader - CommandProfileLoader.loader = jest.fn((args) => { - throw new ImperativeError({ msg: "Profile loading failed!" }); - }); - - const parms: any = { - arguments: { _: ["check", "for", "banana"], $0: "", valid: true }, - responseFormat: "json", silent: true - }; - const commandResponse: ICommandResponse = await processor.invoke(parms); - - expect(commandResponse).toBeDefined(); - const stderrText = (commandResponse.stderr as Buffer).toString(); - expect(stderrText).toContain("Command Preparation Failed:"); - expect(stderrText).toContain("Profile loading failed!"); - expect(commandResponse.message).toEqual("Profile loading failed!"); - expect(commandResponse.error?.msg).toEqual("Profile loading failed!"); - expect(commandResponse.error?.additionalDetails).not.toBeDefined(); - }); - it("should handle not being able to instantiate the handler", async () => { // Allocate the command processor const processor: CommandProcessor = new CommandProcessor({ @@ -843,15 +805,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -897,15 +850,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -948,15 +892,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1008,15 +943,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1050,15 +976,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1100,15 +1017,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1150,15 +1058,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1200,15 +1099,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1253,15 +1143,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1301,15 +1182,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1342,15 +1214,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1484,15 +1347,6 @@ describe("Command Processor", () => { config: ImperativeConfig.instance.config }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - return; - } - }; - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1595,15 +1449,6 @@ describe("Command Processor", () => { config: ImperativeConfig.instance.config }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - return; - } - }; - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1667,19 +1512,8 @@ describe("Command Processor", () => { config: ImperativeConfig.instance.config }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - return; - } - }; - }); - // return the "fake" args object with values from profile - CliUtils.getOptValueFromProfiles = jest.fn((cmdProfiles, profileDef, allOpts) => { - return {}; - }); + CliUtils.getOptValuesFromConfig = jest.fn().mockReturnValue({}); const parms: any = { arguments: { @@ -1767,15 +1601,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - jest.spyOn(process, "chdir"); const mockConfigReload = jest.fn(); jest.spyOn(ImperativeConfig, "instance", "get").mockReturnValue({ @@ -1833,15 +1658,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - jest.spyOn(process, "chdir"); const mockConfigReload = jest.fn(); jest.spyOn(ImperativeConfig, "instance", "get").mockReturnValue({ @@ -1886,7 +1702,8 @@ describe("Command Processor", () => { helpGenerator: FAKE_HELP_GENERATOR, rootCommandName: SAMPLE_ROOT_COMMAND, commandLine: "", - promptPhrase: "dummydummy" + promptPhrase: "dummydummy", + config: ImperativeConfig.instance.config }); // Mock read stdin @@ -1894,21 +1711,8 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - return; - } - }; - }); - // return the "fake" args object with values from profile - CliUtils.getOptValueFromProfiles = jest.fn((cmdProfiles, profileDef, allOpts) => { - return { - color: "yellow" - }; - }); + CliUtils.getOptValuesFromConfig = jest.fn().mockReturnValue({ color: "yellow" }); const parms: any = { arguments: { @@ -1920,7 +1724,7 @@ describe("Command Processor", () => { }; const commandResponse: ICommandResponse = await processor.invoke(parms); - expect(CliUtils.getOptValueFromProfiles).toHaveBeenCalledTimes(1); + expect(CliUtils.getOptValuesFromConfig).toHaveBeenCalledTimes(1); expect(commandResponse.stdout.toString()).toMatchSnapshot(); expect(commandResponse).toBeDefined(); expect(commandResponse).toMatchSnapshot(); @@ -1942,19 +1746,8 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - return; - } - }; - }); - // return the "fake" args object with values from profile - CliUtils.getOptValueFromProfiles = jest.fn((cmdProfiles, profileDef, allOpts) => { - return {}; - }); + CliUtils.getOptValuesFromConfig = jest.fn().mockReturnValue({}); const parms: any = { arguments: { @@ -1979,7 +1772,8 @@ describe("Command Processor", () => { helpGenerator: FAKE_HELP_GENERATOR, rootCommandName: SAMPLE_ROOT_COMMAND, commandLine: "", - promptPhrase: "dummydummy" + promptPhrase: "dummydummy", + config: ImperativeConfig.instance.config }); // Mock read stdin @@ -1987,21 +1781,8 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - return; - } - }; - }); - // return the "fake" args object with values from profile - CliUtils.getOptValueFromProfiles = jest.fn((cmdProfiles, profileDef, allOpts) => { - return { - color: "yellow" - }; - }); + CliUtils.getOptValuesFromConfig = jest.fn().mockReturnValue({ color: "yellow" }); const parms: any = { arguments: { @@ -2013,7 +1794,7 @@ describe("Command Processor", () => { }; const commandResponse: ICommandResponse = await processor.invoke(parms); - expect(CliUtils.getOptValueFromProfiles).toHaveBeenCalledTimes(1); + expect(CliUtils.getOptValuesFromConfig).toHaveBeenCalledTimes(1); expect(commandResponse.stdout.toString()).toMatchSnapshot(); expect(commandResponse).toBeDefined(); expect(commandResponse).toMatchSnapshot(); @@ -2027,7 +1808,8 @@ describe("Command Processor", () => { helpGenerator: FAKE_HELP_GENERATOR, rootCommandName: SAMPLE_ROOT_COMMAND, commandLine: "", - promptPhrase: "dummydummy" + promptPhrase: "dummydummy", + config: ImperativeConfig.instance.config }); // Mock read stdin @@ -2035,21 +1817,8 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - return; - } - }; - }); - // return the "fake" args object with values from profile - CliUtils.getOptValueFromProfiles = jest.fn((cmdProfiles, profileDef, allOpts) => { - return { - color: "yellow" - }; - }); + CliUtils.getOptValuesFromConfig = jest.fn().mockReturnValue({ color: "yellow" }); const parms: any = { arguments: { @@ -2062,7 +1831,7 @@ describe("Command Processor", () => { }; const commandResponse: ICommandResponse = await processor.invoke(parms); - expect(CliUtils.getOptValueFromProfiles).toHaveBeenCalledTimes(1); + expect(CliUtils.getOptValuesFromConfig).toHaveBeenCalledTimes(1); expect(commandResponse.stdout.toString()).toMatchSnapshot(); expect(commandResponse).toBeDefined(); expect(commandResponse).toMatchSnapshot(); @@ -2076,7 +1845,8 @@ describe("Command Processor", () => { helpGenerator: FAKE_HELP_GENERATOR, rootCommandName: SAMPLE_ROOT_COMMAND, commandLine: "", - promptPhrase: "dummydummy" + promptPhrase: "dummydummy", + config: ImperativeConfig.instance.config }); // Mock read stdin @@ -2084,21 +1854,8 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - return; - } - }; - }); - // return the "fake" args object with values from profile - CliUtils.getOptValueFromProfiles = jest.fn((cmdProfiles, profileDef, allOpts) => { - return { - color: "yellow" - }; - }); + CliUtils.getOptValuesFromConfig = jest.fn().mockReturnValue({ color: "yellow" }); const parms: any = { arguments: { @@ -2111,7 +1868,7 @@ describe("Command Processor", () => { }; const commandResponse: ICommandResponse = await processor.invoke(parms); - expect(CliUtils.getOptValueFromProfiles).toHaveBeenCalledTimes(1); + expect(CliUtils.getOptValuesFromConfig).toHaveBeenCalledTimes(1); expect(commandResponse.stdout.toString()).toMatchSnapshot(); expect(commandResponse).toBeDefined(); expect(commandResponse).toMatchSnapshot(); @@ -2171,15 +1928,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - const parms: any = { arguments: { _: [], @@ -2215,15 +1963,6 @@ describe("Command Processor", () => { // Nothing to do }); - // Mock the profile loader - (CommandProfileLoader.loader as any) = jest.fn((args) => { - return { - loadProfiles: (profArgs: any) => { - // Nothing to do - } - }; - }); - const parms: any = { arguments: { _: [], @@ -2419,22 +2158,22 @@ describe("Command Processor", () => { }); it("should find profile that matches name specified in arguments", async () => { - const commandPrepared = await (processor as any).prepare(null, { + const preparedArgs = await (processor as any).prepare(null, { "banana-profile": "ripe" }); - expect(commandPrepared.args.color).toBe("yellow"); + expect(preparedArgs.color).toBe("yellow"); }); it("should find profile with type prefix that matches name specified in arguments", async () => { - const commandPrepared = await (processor as any).prepare(null, { + const preparedArgs = await (processor as any).prepare(null, { "banana-profile": "old" }); - expect(commandPrepared.args.color).toBe("brown"); + expect(preparedArgs.color).toBe("brown"); }); it("should find default profile that matches type", async () => { - const commandPrepared = await (processor as any).prepare(null, {}); - expect(commandPrepared.args.color).toBe("green"); + const preparedArgs = await (processor as any).prepare(null, {}); + expect(preparedArgs.color).toBe("green"); }); }); }); diff --git a/packages/imperative/src/cmd/__tests__/profiles/CliProfileManager.unit.test.ts b/packages/imperative/src/cmd/__tests__/profiles/CliProfileManager.unit.test.ts index 8985e6b2a0..714dfc7d44 100644 --- a/packages/imperative/src/cmd/__tests__/profiles/CliProfileManager.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/profiles/CliProfileManager.unit.test.ts @@ -9,6 +9,8 @@ * */ +/* eslint-disable deprecation/deprecation */ + import { ImperativeError } from "../../../error"; import { TestLogger } from "../../../../__tests__/src/TestLogger"; import { APPLE_PROFILE_TYPE, ONLY_APPLE } from "./TestConstants"; diff --git a/packages/imperative/src/cmd/__tests__/profiles/CommandProfileLoader.unit.test.ts b/packages/imperative/src/cmd/__tests__/profiles/CommandProfileLoader.unit.test.ts index 0f5cea376b..a23e844942 100644 --- a/packages/imperative/src/cmd/__tests__/profiles/CommandProfileLoader.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/profiles/CommandProfileLoader.unit.test.ts @@ -9,6 +9,8 @@ * */ +/* eslint-disable deprecation/deprecation */ + import { CommandProfileLoader } from "../../src/profiles/CommandProfileLoader"; import { ICommandDefinition } from "../../src/doc/ICommandDefinition"; import { TestLogger } from "../../../../__tests__/src/TestLogger"; diff --git a/packages/imperative/src/cmd/__tests__/profiles/CommandProfiles.unit.test.ts b/packages/imperative/src/cmd/__tests__/profiles/CommandProfiles.unit.test.ts index 48352581fc..a8d2397c8a 100644 --- a/packages/imperative/src/cmd/__tests__/profiles/CommandProfiles.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/profiles/CommandProfiles.unit.test.ts @@ -9,6 +9,8 @@ * */ +/* eslint-disable deprecation/deprecation */ + import { IProfile, IProfileLoaded } from "../../../profiles"; import { CommandProfiles } from "../../src/profiles/CommandProfiles"; import { ImperativeError } from "../../../error"; diff --git a/packages/imperative/src/cmd/__tests__/profiles/profileHandlers/AddTwoNumbersHandler.ts b/packages/imperative/src/cmd/__tests__/profiles/profileHandlers/AddTwoNumbersHandler.ts deleted file mode 100644 index 0f3db4eef3..0000000000 --- a/packages/imperative/src/cmd/__tests__/profiles/profileHandlers/AddTwoNumbersHandler.ts +++ /dev/null @@ -1,20 +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. -* -*/ - -import { ICommandHandler, IHandlerParameters } from "../../../"; - -export default class AddTwoNumbersHandler implements ICommandHandler { - public async process(params: IHandlerParameters): Promise { - const sum = params.arguments.a + params.arguments.b; - params.response.console.log("updated sum to: " + sum); - params.response.data.setObj({sum}); - } -} diff --git a/packages/imperative/src/cmd/__tests__/profiles/profileHandlers/DoNothingHandler.ts b/packages/imperative/src/cmd/__tests__/profiles/profileHandlers/DoNothingHandler.ts deleted file mode 100644 index ab19d2da81..0000000000 --- a/packages/imperative/src/cmd/__tests__/profiles/profileHandlers/DoNothingHandler.ts +++ /dev/null @@ -1,19 +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. -* -*/ - -import { ICommandHandler, IHandlerParameters } from "../../../"; - -export default class DoNothingHandler implements ICommandHandler { - public async process(params: IHandlerParameters): Promise { - params.response.console.log("Doing nothing "); - params.response.data.setObj({}); - } -} diff --git a/packages/imperative/src/cmd/__tests__/profiles/profileHandlers/ThrowErrorHandler.ts b/packages/imperative/src/cmd/__tests__/profiles/profileHandlers/ThrowErrorHandler.ts deleted file mode 100644 index 021b5f32d2..0000000000 --- a/packages/imperative/src/cmd/__tests__/profiles/profileHandlers/ThrowErrorHandler.ts +++ /dev/null @@ -1,18 +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. -* -*/ - -import { ICommandHandler, IHandlerParameters } from "../../../"; - -export default class ThrowErrorHandler implements ICommandHandler { - public async process(params: IHandlerParameters): Promise { - throw new Error("threw an error"); - } -} diff --git a/packages/imperative/src/cmd/src/CommandProcessor.ts b/packages/imperative/src/cmd/src/CommandProcessor.ts index 5adfe0ad0e..bdb78ee99d 100644 --- a/packages/imperative/src/cmd/src/CommandProcessor.ts +++ b/packages/imperative/src/cmd/src/CommandProcessor.ts @@ -17,11 +17,8 @@ import { ICommandHandler } from "./doc/handler/ICommandHandler"; import { couldNotInstantiateCommandHandler, unexpectedCommandError } from "../../messages"; import { SharedOptions } from "./utils/SharedOptions"; import { IImperativeError, ImperativeError } from "../../error"; -import { ProfileUtils } from "../../profiles"; import { SyntaxValidator } from "./syntax/SyntaxValidator"; -import { CommandProfileLoader } from "./profiles/CommandProfileLoader"; import { IHelpGenerator } from "./help/doc/IHelpGenerator"; -import { ICommandPrepared } from "./doc/response/response/ICommandPrepared"; import { CommandResponse } from "./response/CommandResponse"; import { ICommandResponse } from "./doc/response/response/ICommandResponse"; import { Logger } from "../../logger"; @@ -40,7 +37,6 @@ import { Constants } from "../../constants"; import { ICommandArguments } from "./doc/args/ICommandArguments"; import { CliUtils } from "../../utilities/src/CliUtils"; import { WebHelpManager } from "./help/WebHelpManager"; -import { ICommandProfile } from "./doc/profiles/definition/ICommandProfile"; import { Config } from "../../config/src/Config"; import { ConfigUtils } from "../../config/src/ConfigUtils"; import { ConfigConstants } from "../../config/src/ConfigConstants"; @@ -409,7 +405,7 @@ export class CommandProcessor { prepareResponse.succeeded(); // Prepare for command processing - load profiles, stdin, etc. - let prepared: ICommandPrepared; + let preparedArgs: ICommandArguments; try { // Build the response object, base args object, and the entire array of options for this command // Assume that the command succeed, it will be marked otherwise under the appropriate failure conditions @@ -442,7 +438,7 @@ export class CommandProcessor { } this.log.info(`Preparing (loading profiles, reading stdin, etc.) execution of "${this.definition.name}" command...`); - prepared = await this.prepare(prepareResponse, params.arguments); + preparedArgs = await this.prepare(prepareResponse, params.arguments); } catch (prepareErr) { // Indicate that the command has failed @@ -475,7 +471,7 @@ export class CommandProcessor { } // Recreate the response object with the update params from prepare. - params.arguments = prepared.args; + params.arguments = preparedArgs; const response = this.constructResponseObject(params); response.succeeded(); @@ -488,36 +484,36 @@ export class CommandProcessor { // convert if positional is an array designated by "..." const positionalName = positional.name.replace("...", ""); // check if value provided - if (prepared.args[positionalName] != null) { + if (preparedArgs[positionalName] != null) { // string processing - if (typeof prepared.args[positionalName] === "string" && - prepared.args[positionalName].toUpperCase() === this.promptPhrase.toUpperCase()) { + if (typeof preparedArgs[positionalName] === "string" && + preparedArgs[positionalName].toUpperCase() === this.promptPhrase.toUpperCase()) { // prompt has been requested for a positional this.log.debug("Prompting for positional %s which was requested by passing the value %s", positionalName, this.promptPhrase); - prepared.args[positionalName] = + preparedArgs[positionalName] = await response.console.prompt(`"${positionalName}" Description: ` + `${positional.description}\nPlease enter "${positionalName}":`, { hideText: true, secToWait: 0 }); } // array processing else { - if (prepared.args[positionalName] != null && - Array.isArray(prepared.args[positionalName]) && - prepared.args[positionalName][0] != null && - typeof prepared.args[positionalName][0] === "string" && - prepared.args[positionalName][0].toUpperCase() === this.promptPhrase.toUpperCase()) { + if (preparedArgs[positionalName] != null && + Array.isArray(preparedArgs[positionalName]) && + preparedArgs[positionalName][0] != null && + typeof preparedArgs[positionalName][0] === "string" && + preparedArgs[positionalName][0].toUpperCase() === this.promptPhrase.toUpperCase()) { // prompt has been requested for a positional this.log.debug("Prompting for positional %s which was requested by passing the value %s", - prepared.args[positionalName][0], this.promptPhrase); - prepared.args[positionalName][0] = + preparedArgs[positionalName][0], this.promptPhrase); + preparedArgs[positionalName][0] = await response.console.prompt(`"${positionalName}" Description: ` + `${positional.description}\nPlease enter "${positionalName}":`, { hideText: true, secToWait: 0 }); // prompting enters as string but need to place it in array - const array = prepared.args[positionalName][0].split(" "); - prepared.args[positionalName] = array; + const array = preparedArgs[positionalName][0].split(" "); + preparedArgs[positionalName] = array; } } } @@ -527,48 +523,48 @@ export class CommandProcessor { if (this.definition.options != null && this.definition.options.length > 0) { for (const option of this.definition.options) { // check if value provided - if (prepared.args[option.name] != null) { + if (preparedArgs[option.name] != null) { // string processing - if (typeof prepared.args[option.name] === "string" && - prepared.args[option.name].toUpperCase() === this.promptPhrase.toUpperCase()) { + if (typeof preparedArgs[option.name] === "string" && + preparedArgs[option.name].toUpperCase() === this.promptPhrase.toUpperCase()) { // prompt has been requested for an --option this.log.debug("Prompting for option %s which was requested by passing the value %s", option.name, this.promptPhrase); - prepared.args[option.name] = + preparedArgs[option.name] = await response.console.prompt(`"${option.name}" Description: ` + `${option.description}\nPlease enter "${option.name}":`, { hideText: true, secToWait: 0 }); const camelCase = CliUtils.getOptionFormat(option.name).camelCase; - prepared.args[camelCase] = prepared.args[option.name]; + preparedArgs[camelCase] = preparedArgs[option.name]; if (option.aliases != null) { for (const alias of option.aliases) { // set each alias of the args object as well - prepared.args[alias] = prepared.args[option.name]; + preparedArgs[alias] = preparedArgs[option.name]; } } } // array processing else { - if (Array.isArray(prepared.args[option.name]) && - prepared.args[option.name][0] != null && - typeof prepared.args[option.name][0] === "string" && - prepared.args[option.name][0].toUpperCase() === this.promptPhrase.toUpperCase()) { + if (Array.isArray(preparedArgs[option.name]) && + preparedArgs[option.name][0] != null && + typeof preparedArgs[option.name][0] === "string" && + preparedArgs[option.name][0].toUpperCase() === this.promptPhrase.toUpperCase()) { // prompt has been requested for an --option this.log.debug("Prompting for option %s which was requested by passing the value %s", option.name, this.promptPhrase); - prepared.args[option.name][0] = + preparedArgs[option.name][0] = await response.console.prompt(`"${option.name}" Description: ` + `${option.description}\nPlease enter "${option.name}":`, { hideText: true, secToWait: 0 }); - const array = prepared.args[option.name][0].split(" "); - prepared.args[option.name] = array; + const array = preparedArgs[option.name][0].split(" "); + preparedArgs[option.name] = array; const camelCase = CliUtils.getOptionFormat(option.name).camelCase; - prepared.args[camelCase] = prepared.args[option.name]; + preparedArgs[camelCase] = preparedArgs[option.name]; if (option.aliases != null) { for (const alias of option.aliases) { // set each alias of the args object as well - prepared.args[alias] = prepared.args[option.name]; + preparedArgs[alias] = preparedArgs[option.name]; } } } @@ -595,7 +591,7 @@ export class CommandProcessor { // Validate that the syntax is correct for the command let validator: ICommandValidatorResponse; try { - validator = await this.validate(prepared.args, response); + validator = await this.validate(preparedArgs, response); } catch (e) { const errMsg: string = `Unexpected syntax validation error`; const errReason: string = errMsg + ": " + e.message; @@ -630,9 +626,8 @@ export class CommandProcessor { const handlerParms: IHandlerParameters = { response, - profiles: prepared.profiles, - arguments: prepared.args, - positionals: prepared.args._, + arguments: preparedArgs, + positionals: preparedArgs._, definition: this.definition, fullDefinition: this.fullDefinition, stdin: this.getStdinStream() @@ -696,16 +691,15 @@ export class CommandProcessor { try { await handler.process({ response: chainedResponse, - profiles: prepared.profiles, arguments: ChainedHandlerService.getArguments( this.mCommandRootName, this.definition.chainedHandlers, chainedHandlerIndex, chainedResponses, - prepared.args, + preparedArgs, this.log ), - positionals: prepared.args._, + positionals: preparedArgs._, definition: this.definition, fullDefinition: this.fullDefinition, stdin: this.getStdinStream(), @@ -882,9 +876,9 @@ export class CommandProcessor { * the command handler is invoked. * @param {CommandResponse} response: The response object for command messaging. * @param {yargs.Arguments} commandArguments: The arguments specified on the command line. - * @return {Promise}: Promise to fulfill when complete. + * @return {Promise}: Promise to fulfill when complete. */ - private async prepare(response: CommandResponse, commandArguments: Arguments): Promise { + private async prepare(response: CommandResponse, commandArguments: Arguments): Promise { // Construct the imperative arguments - replacement/wrapper for Yargs to insulate handlers against any // changes made to Yargs let args: ICommandArguments = CliUtils.buildBaseArgs(commandArguments); @@ -905,100 +899,11 @@ export class CommandProcessor { this.log.trace(`Reading stdin for "${this.definition.name}" command...`); await SharedOptions.readStdinIfRequested(commandArguments, response, this.definition.type); - // Build a list of all profile types - this will help us search the CLI - // options for profiles specified by the user - let allTypes: string[] = []; - if (this.definition.profile != null) { - if (this.definition.profile.required != null) - allTypes = allTypes.concat(this.definition.profile.required); - if (this.definition.profile.optional != null) - allTypes = allTypes.concat(this.definition.profile.optional); - } - // Build an object that contains all the options loaded from config - const fulfilled: string[] = []; - let fromCnfg: any = {}; if (this.mConfig != null) { - for (const profileType of allTypes) { - const opt = ProfileUtils.getProfileOptionAndAlias(profileType)[0]; - // If the config contains the requested profiles, then "remember" - // that this type has been fulfilled - so that we do NOT load from - // the traditional profile location - const profileTypePrefix = profileType + "_"; - let p: any = {}; - if (args[opt] != null && this.mConfig.api.profiles.exists(args[opt])) { - fulfilled.push(profileType); - p = this.mConfig.api.profiles.get(args[opt]); - } else if (args[opt] != null && !args[opt].startsWith(profileTypePrefix) && - this.mConfig.api.profiles.exists(profileTypePrefix + args[opt])) { - fulfilled.push(profileType); - p = this.mConfig.api.profiles.get(profileTypePrefix + args[opt]); - } else if (args[opt] == null && - this.mConfig.properties.defaults[profileType] != null && - this.mConfig.api.profiles.exists(this.mConfig.properties.defaults[profileType])) { - fulfilled.push(profileType); - p = this.mConfig.api.profiles.defaultGet(profileType); - } - fromCnfg = { ...p, ...fromCnfg }; - } - } - - // Convert each property extracted from the config to the correct yargs - // style cases for the command handler (kebab and camel) - allOpts.forEach((opt) => { - const cases = CliUtils.getOptionFormat(opt.name); - const profileKebab = fromCnfg[cases.kebabCase]; - const profileCamel = fromCnfg[cases.camelCase]; - - if ((profileCamel !== undefined || profileKebab !== undefined) && - (!Object.prototype.hasOwnProperty.call(args, cases.kebabCase) && - !Object.prototype.hasOwnProperty.call(args, cases.camelCase))) { - - // If both case properties are present in the profile, use the one that matches - // the option name explicitly - const value = profileKebab !== undefined && profileCamel !== undefined ? - opt.name === cases.kebabCase ? profileKebab : profileCamel : - profileKebab !== undefined ? profileKebab : profileCamel; - const keys = CliUtils.setOptionValue(opt.name, - "aliases" in opt ? opt.aliases : [], - value - ); - fromCnfg = { ...fromCnfg, ...keys }; - } - }); - - // Merge the arguments from the config into the CLI args - this.log.trace(`Arguments extracted from the config:\n${inspect(fromCnfg)}`); - args = CliUtils.mergeArguments(fromCnfg, args); - - // Load all profiles for the command - this.log.trace(`Loading profiles for "${this.definition.name}" command. ` + - `Profile definitions: ${inspect(this.definition.profile, { depth: null })}`); - - const profiles = await CommandProfileLoader.loader({ - commandDefinition: this.definition - }).loadProfiles(args); - this.log.trace(`Profiles loaded for "${this.definition.name}" command:\n${inspect(profiles, { depth: null })}`); - - // If we have profiles listed on the command definition (the would be loaded already) - // we can extract values from them for options arguments - if (this.definition.profile != null) { - - // "fake out" the cli util to only populate options for profiles - // that have not been fulfilled by the config - const p: ICommandProfile = { - required: [], - optional: [], - suppressOptions: this.definition.profile.suppressOptions - }; - - if (this.definition.profile.required) - p.required = this.definition.profile.required.filter(type => fulfilled.indexOf(type) < 0); - if (this.definition.profile.optional) - p.optional = this.definition.profile.optional.filter(type => fulfilled.indexOf(type) < 0); - - const profArgs = CliUtils.getOptValueFromProfiles(profiles, p, allOpts); - this.log.trace(`Arguments extract from the profile:\n${inspect(profArgs)}`); + // Merge the arguments from the config into the CLI args + const profArgs = CliUtils.getOptValuesFromConfig(this.mConfig, this.definition, args, allOpts); + this.log.trace(`Arguments extracted from the config:\n${inspect(profArgs)}`); args = CliUtils.mergeArguments(profArgs, args); } @@ -1020,7 +925,7 @@ export class CommandProcessor { // Log for debugging this.log.trace(`Full argument object constructed:\n${inspect(args)}`); - return { profiles, args }; + return args; } /** diff --git a/packages/imperative/src/cmd/src/doc/handler/IHandlerParameters.ts b/packages/imperative/src/cmd/src/doc/handler/IHandlerParameters.ts index 247b68bcde..d2c960091f 100644 --- a/packages/imperative/src/cmd/src/doc/handler/IHandlerParameters.ts +++ b/packages/imperative/src/cmd/src/doc/handler/IHandlerParameters.ts @@ -11,7 +11,6 @@ import * as stream from "stream"; import { ICommandDefinition } from "../ICommandDefinition"; -import { CommandProfiles } from "../../profiles/CommandProfiles"; import { IHandlerResponseApi } from "../../doc/response/api/handler/IHandlerResponseApi"; import { ICommandArguments } from "../args/ICommandArguments"; @@ -52,15 +51,6 @@ export interface IHandlerParameters { */ positionals: (string | number)[]; - /** - * The set of profiles loaded for this command handler - the map is built with the key being the type and it - * returns the set of profiles loaded of that type. Multiple profiles can be loaded of the same type - depending - * on the request and the 0th entry is the first loaded. - * @type {Map} - * @memberof IHandlerParameters - */ - profiles: CommandProfiles; - /** * The command definition node that defines the command being issued. * @type {ICommandDefinition} diff --git a/packages/imperative/src/cmd/src/doc/response/response/ICommandPrepared.ts b/packages/imperative/src/cmd/src/doc/response/response/ICommandPrepared.ts deleted file mode 100644 index 636e0fbc58..0000000000 --- a/packages/imperative/src/cmd/src/doc/response/response/ICommandPrepared.ts +++ /dev/null @@ -1,33 +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. -* -*/ - -import { CommandProfiles } from "../../../../src/profiles/CommandProfiles"; -import { ICommandArguments } from "../../../../src/doc/args/ICommandArguments"; -/** - * Command Processor prepare response. - * @export - * @interface ICommandPrepared - */ -export interface ICommandPrepared { - /** - * The profile map object for all profiles loaded for commands. - * @type {CommandProfiles} - * @memberof ICommandPrepared - */ - profiles: CommandProfiles; - /** - * Imperative arguments object. Starts with arguments passed parsed by - * Yargs as a base and fills in the rest from ENV/profile/defaults. - * Eventually passed to handlers. - * @type {ICommandArguments} - */ - args: ICommandArguments; -} diff --git a/packages/imperative/src/cmd/src/profiles/CliProfileManager.ts b/packages/imperative/src/cmd/src/profiles/CliProfileManager.ts index f71896074e..0989f2435c 100644 --- a/packages/imperative/src/cmd/src/profiles/CliProfileManager.ts +++ b/packages/imperative/src/cmd/src/profiles/CliProfileManager.ts @@ -27,6 +27,7 @@ import { * * The Profile Manager no longer reads V1 profile from disk. It only processes profile information from a * command's definition. The Config class now handles reading profiles from disk stored in a zowe.config.json file. + * @deprecated Use the `V1ProfileRead` class if you still need to read V1 profiles */ export class CliProfileManager { /** diff --git a/packages/imperative/src/cmd/src/profiles/CommandProfileLoader.ts b/packages/imperative/src/cmd/src/profiles/CommandProfileLoader.ts index 516b688a9f..2db7b75422 100644 --- a/packages/imperative/src/cmd/src/profiles/CommandProfileLoader.ts +++ b/packages/imperative/src/cmd/src/profiles/CommandProfileLoader.ts @@ -24,6 +24,7 @@ import { ImperativeExpect } from "../../../expect"; * command handlers usage). * @internal * @class CommandProfileLoader + * @deprecated Use the `V1ProfileRead` class if you still need to read V1 profiles */ export class CommandProfileLoader { /** @@ -34,6 +35,7 @@ export class CommandProfileLoader { * @memberof CommandProfileLoader */ public static loader(parms: ICommandProfileLoaderParms) { + // eslint-disable-next-line deprecation/deprecation return new CommandProfileLoader(parms.commandDefinition, parms.logger || Logger.getImperativeLogger()); } @@ -76,6 +78,7 @@ export class CommandProfileLoader { * Imperative error * @memberof CommandProfileLoader */ + // eslint-disable-next-line deprecation/deprecation public async loadProfiles(commandArguments: Arguments): Promise { // Validate parms ImperativeExpect.toNotBeNullOrUndefined(commandArguments, `Could not load profiles. No command arguments supplied.`); @@ -89,6 +92,7 @@ export class CommandProfileLoader { const profileMetaMap: Map = new Map(); // We no longer read V1 profile files, so just return empty maps + // eslint-disable-next-line deprecation/deprecation return new CommandProfiles(profileMap, profileMetaMap); } diff --git a/packages/imperative/src/cmd/src/profiles/CommandProfiles.ts b/packages/imperative/src/cmd/src/profiles/CommandProfiles.ts index 919d384350..e57a267d41 100644 --- a/packages/imperative/src/cmd/src/profiles/CommandProfiles.ts +++ b/packages/imperative/src/cmd/src/profiles/CommandProfiles.ts @@ -17,6 +17,7 @@ import { ImperativeExpect } from "../../../expect"; * Profiles map created by the command profile loader and passed to the handler via parameters. Handlers can * retrieve loaded profiles from the map via the profile type. * @class CommandProfiles + * @deprecated Use the `V1ProfileRead` class if you still need to read V1 profiles */ export class CommandProfiles { /** 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 f9f931687d..f61dbf32f5 100644 --- a/packages/imperative/src/imperative/__tests__/handlers/DefaultRootCommandHandler.unit.test.ts +++ b/packages/imperative/src/imperative/__tests__/handlers/DefaultRootCommandHandler.unit.test.ts @@ -116,7 +116,6 @@ describe("Default Root Command Handler", () => { arguments: {_: [], $0: ""}, definition: prepared.children?.[0].children?.[0] as any, fullDefinition: prepared, - profiles: undefined as any, positionals: [], stdin: process.stdin }); @@ -136,7 +135,6 @@ describe("Default Root Command Handler", () => { arguments: {_: [], $0: "", availableCommands: true}, definition: MULTIPLE_GROUPS, fullDefinition: MULTIPLE_GROUPS, - profiles: undefined as any, positionals: [], stdin: process.stdin }); @@ -159,7 +157,6 @@ describe("Default Root Command Handler", () => { arguments: {_: [], $0: "", version: true}, definition: MULTIPLE_GROUPS.children?.[0].children?.[0] as any, fullDefinition: MULTIPLE_GROUPS, - profiles: undefined as any, positionals: [], stdin: process.stdin }); diff --git a/packages/imperative/src/imperative/src/api/ImperativeApi.ts b/packages/imperative/src/imperative/src/api/ImperativeApi.ts index 358cbec56a..3fb75a82d9 100644 --- a/packages/imperative/src/imperative/src/api/ImperativeApi.ts +++ b/packages/imperative/src/imperative/src/api/ImperativeApi.ts @@ -12,7 +12,6 @@ import { IImperativeConfig } from "../doc/IImperativeConfig"; import { IImperativeApi } from "./doc/IImperativeApi"; import { Logger } from "../../../logger"; -import { CliProfileManager } from "../../../cmd"; export class ImperativeApi { /** @@ -63,18 +62,4 @@ export class ImperativeApi { public addAdditionalLogger(name: string, logger: Logger): void { this.mCustomLoggerMap[name] = logger; } - - /** - * Return an instance of a profile manager for a given profile type - * See ProfileManager.ts for more details - * @internal - */ - public profileManager(type: string): CliProfileManager { - return new CliProfileManager({ - type, - typeConfigurations: this.mConfig.profiles, - logger: this.imperativeLogger, - productDisplayName: this.mConfig.productDisplayName - }); - } } diff --git a/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts b/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts index ea94d6435c..b53c83c35c 100644 --- a/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts +++ b/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts @@ -294,6 +294,7 @@ describe("CliUtils", () => { let error; try { const args = CliUtils.getOptValueFromProfiles( + // eslint-disable-next-line deprecation/deprecation new CommandProfiles(new Map()), { required: ["banana"] }, FAKE_OPTS); @@ -307,6 +308,7 @@ describe("CliUtils", () => { it("should return nothing if a profile was optional and not loaded", () => { const args = CliUtils.getOptValueFromProfiles( + // eslint-disable-next-line deprecation/deprecation new CommandProfiles(new Map()), { optional: ["banana"] }, FAKE_OPTS); @@ -317,6 +319,7 @@ describe("CliUtils", () => { const map = new Map(); map.set("banana", [{ type: "banana", name: "fakebanana", nohyphen: "specified in profile" }]); const args = CliUtils.getOptValueFromProfiles( + // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), { optional: ["banana"] }, FAKE_OPTS); @@ -332,6 +335,7 @@ describe("CliUtils", () => { "could-be-either": "should not be me" }]); const args = CliUtils.getOptValueFromProfiles( + // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), { optional: ["banana"] }, FAKE_OPTS); @@ -347,6 +351,7 @@ describe("CliUtils", () => { "fake-string-opt": "should be me" }]); const args = CliUtils.getOptValueFromProfiles( + // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), { optional: ["banana"] }, FAKE_OPTS); @@ -361,6 +366,7 @@ describe("CliUtils", () => { "could-be-either": "should be me" }]); const args = CliUtils.getOptValueFromProfiles( + // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), { optional: ["banana"] }, FAKE_OPTS); @@ -375,6 +381,7 @@ describe("CliUtils", () => { fakeStringOpt: "should be me" }]); const args = CliUtils.getOptValueFromProfiles( + // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), { optional: ["banana"] }, FAKE_OPTS); @@ -389,6 +396,7 @@ describe("CliUtils", () => { withAlias: "should have 'w' on args object too" }]); const args = CliUtils.getOptValueFromProfiles( + // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), { optional: ["banana"] }, FAKE_OPTS); @@ -403,6 +411,7 @@ describe("CliUtils", () => { username: "fake" }]); const args = CliUtils.getOptValueFromProfiles( + // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), { optional: ["banana"] }, FAKE_OPTS); diff --git a/packages/imperative/src/utilities/src/CliUtils.ts b/packages/imperative/src/utilities/src/CliUtils.ts index 8b2612f7da..460d025750 100644 --- a/packages/imperative/src/utilities/src/CliUtils.ts +++ b/packages/imperative/src/utilities/src/CliUtils.ts @@ -18,10 +18,13 @@ import { CommandProfiles, ICommandOptionDefinition, ICommandPositionalDefinition ICommandProfile, IHandlerParameters } from "../../cmd"; import { ICommandArguments } from "../../cmd/src/doc/args/ICommandArguments"; -import { IProfile } from "../../profiles"; +import { IProfile } from "../../profiles/src/doc/definition/IProfile"; +import { ProfileUtils } from "../../profiles/src/utils/ProfileUtils"; import { IPromptOptions } from "../../cmd/src/doc/response/api/handler/IPromptOptions"; import { read } from "read"; import { ICommandDefinition } from "../../cmd"; +import { Config } from "../../config"; + /** * Cli Utils contains a set of static methods/helpers that are CLI related (forming options, censoring args, etc.) * @export @@ -117,6 +120,7 @@ export class CliUtils { * * @memberof CliUtils */ + // eslint-disable-next-line deprecation/deprecation public static getOptValueFromProfiles(profiles: CommandProfiles, definitions: ICommandProfile, options: Array): any { let args: any = {}; @@ -185,6 +189,82 @@ export class CliUtils { return args; } + /** + * Searches properties in team configuration and attempts to match the option names supplied with profile keys. + * @param {Config} config - Team config API + * @param {ICommandDefinition} definition - Definition of invoked command + * @param {ICommandArguments} args - Arguments from command line and environment + * @param {(Array)} allOpts - the full set of command options + * for the command being processed + * + * @returns {*} + * + * @memberof CliUtils + */ + public static getOptValuesFromConfig(config: Config, definition: ICommandDefinition, args: ICommandArguments, + allOpts: Array): any { + // Build a list of all profile types - this will help us search the CLI + // options for profiles specified by the user + let allTypes: string[] = []; + if (definition.profile != null) { + if (definition.profile.required != null) + allTypes = allTypes.concat(definition.profile.required); + if (definition.profile.optional != null) + allTypes = allTypes.concat(definition.profile.optional); + } + + // Build an object that contains all the options loaded from config + const fulfilled: string[] = []; + let fromCnfg: any = {}; + for (const profileType of allTypes) { + const opt = ProfileUtils.getProfileOptionAndAlias(profileType)[0]; + // If the config contains the requested profiles, then "remember" + // that this type has been fulfilled - so that we do NOT load from + // the traditional profile location + const profileTypePrefix = profileType + "_"; + let p: any = {}; + if (args[opt] != null && config.api.profiles.exists(args[opt])) { + fulfilled.push(profileType); + p = config.api.profiles.get(args[opt]); + } else if (args[opt] != null && !args[opt].startsWith(profileTypePrefix) && + config.api.profiles.exists(profileTypePrefix + args[opt])) { + fulfilled.push(profileType); + p = config.api.profiles.get(profileTypePrefix + args[opt]); + } else if (args[opt] == null && + config.properties.defaults[profileType] != null && + config.api.profiles.exists(config.properties.defaults[profileType])) { + fulfilled.push(profileType); + p = config.api.profiles.defaultGet(profileType); + } + fromCnfg = { ...p, ...fromCnfg }; + } + + // Convert each property extracted from the config to the correct yargs + // style cases for the command handler (kebab and camel) + allOpts.forEach((opt) => { + const cases = CliUtils.getOptionFormat(opt.name); + const profileKebab = fromCnfg[cases.kebabCase]; + const profileCamel = fromCnfg[cases.camelCase]; + + if ((profileCamel !== undefined || profileKebab !== undefined) && + (!Object.prototype.hasOwnProperty.call(args, cases.kebabCase) && + !Object.prototype.hasOwnProperty.call(args, cases.camelCase))) { + + // If both case properties are present in the profile, use the one that matches + // the option name explicitly + const value = profileKebab !== undefined && profileCamel !== undefined ? + opt.name === cases.kebabCase ? profileKebab : profileCamel : + profileKebab !== undefined ? profileKebab : profileCamel; + const keys = CliUtils.setOptionValue(opt.name, + "aliases" in opt ? opt.aliases : [], + value + ); + fromCnfg = { ...fromCnfg, ...keys }; + } + }); + return fromCnfg; + } + /** * Using Object.assign(), merges objects in the order they appear in call. Object.assign() copies and overwrites * existing properties in the target object, meaning property precedence is least to most (left to right). diff --git a/packages/zosuss/__tests__/__unit__/SshBaseHandler.unit.test.ts b/packages/zosuss/__tests__/__unit__/SshBaseHandler.unit.test.ts index 5e9365250a..3f8ee619f4 100644 --- a/packages/zosuss/__tests__/__unit__/SshBaseHandler.unit.test.ts +++ b/packages/zosuss/__tests__/__unit__/SshBaseHandler.unit.test.ts @@ -9,7 +9,7 @@ * */ -import { IHandlerParameters, IProfile, CommandProfiles, ConnectionPropsForSessCfg } from "@zowe/imperative"; +import { IHandlerParameters, ConnectionPropsForSessCfg } from "@zowe/imperative"; import { mockHandlerParameters } from "@zowe/cli-test-utils"; import { join, normalize } from "path"; import { Shell } from "../../src/Shell"; @@ -45,73 +45,28 @@ const UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER = { keyPassPhrase: "dummyPassPhrase123" }; - -// A mocked profile map with ssh profile -const UNIT_TEST_PROFILE_MAP = new Map(); -UNIT_TEST_PROFILE_MAP.set( - "ssh", [{ - name: "ssh", - type: "ssh", - ...UNIT_TEST_SSH_PROF_OPTS - }] -); -const UNIT_TEST_PROFILES_SSH = new CommandProfiles(UNIT_TEST_PROFILE_MAP); - -const UNIT_TEST_PROFILE_MAP_PRIVATE_KEY = new Map(); -UNIT_TEST_PROFILE_MAP_PRIVATE_KEY.set( - "ssh", [{ - name: "ssh", - type: "ssh", - ...UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY - }] -); -const UNIT_TEST_PROFILE_MAP_PRIVATE_KEY_WITH_PASSPHRASE = new Map(); -UNIT_TEST_PROFILE_MAP_PRIVATE_KEY_WITH_PASSPHRASE.set( - "ssh", [{ - name: "ssh", - type: "ssh", - ...UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY_WITH_PASSPHRASE - }] -); -const UNIT_TEST_PROFILE_MAP_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER = new Map(); -UNIT_TEST_PROFILE_MAP_PRIVATE_KEY_WITH_PASSPHRASE.set( - "ssh", [{ - name: "ssh", - type: "ssh", - ...UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER - }] -); - -const UNIT_TEST_PROFILES_SSH_PRIVATE_KEY = new CommandProfiles(UNIT_TEST_PROFILE_MAP_PRIVATE_KEY); -const UNIT_TEST_PROFILES_SSH_PRIVATE_KEY_WITH_PASSPHRASE = new CommandProfiles(UNIT_TEST_PROFILE_MAP_PRIVATE_KEY_WITH_PASSPHRASE); -const UNIT_TEST_PROFILES_SSH_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER = new CommandProfiles(UNIT_TEST_PROFILE_MAP_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER); - // Mocked parameters for the unit tests const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_SSH_PROF_OPTS, positionals: ["zos-uss", "issue", "ssh"], - definition: {} as any, - profiles: UNIT_TEST_PROFILES_SSH + definition: {} as any }); const DEFAULT_PARAMETERS_PRIVATE_KEY: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY, positionals: ["zos-uss", "issue", "ssh"], - definition: {} as any, - profiles: UNIT_TEST_PROFILES_SSH_PRIVATE_KEY + definition: {} as any }); const DEFAULT_PARAMETERS_KEY_PASSPHRASE: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY_WITH_PASSPHRASE, positionals: ["zos-uss", "issue", "ssh"], - definition: {} as any, - profiles: UNIT_TEST_PROFILES_SSH_PRIVATE_KEY_WITH_PASSPHRASE, + definition: {} as any }); const DEFAULT_PARAMETERS_KEY_PASSPHRASE_NO_USER: IHandlerParameters = mockHandlerParameters({ arguments: UNIT_TEST_SSH_PROF_OPTS_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER, positionals: ["zos-uss", "issue", "ssh"], - definition: {} as any, - profiles: UNIT_TEST_PROFILES_SSH_PRIVATE_KEY_WITH_PASSPHRASE_NO_USER, + definition: {} as any }); class myHandler extends SshBaseHandler { From 708e04c297af71dd202391fb9e920299542118e2 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Wed, 21 Aug 2024 11:51:16 -0400 Subject: [PATCH 08/34] Also set aliases, camel case, and kebab case options Signed-off-by: Andrew W. Harn --- .../src/cmd/src/syntax/SyntaxValidator.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts b/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts index eec05320a3..ea0b0be56b 100644 --- a/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts +++ b/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts @@ -235,7 +235,13 @@ export class SyntaxValidator { if (positional.type === "number") { valid = this.validateNumeric(commandArguments[positional.name], positional, responseObject, true) && valid; // Convert to number for backwards compatability - if (valid) { commandArguments[positional.name] = parseFloat(commandArguments[positional.name]); } + if (valid) { + const changedOptions: ICommandArguments = CliUtils.setOptionValue(positional.name, + [], parseFloat(commandArguments[positional.name])); + for (const [k, v] of Object.entries(changedOptions)) { + commandArguments[k] = v; + } + } } if (!(positional.stringLengthRange == null) && @@ -378,8 +384,14 @@ export class SyntaxValidator { valid = this.validateBoolean(commandArguments[optionDef.name], optionDef, responseObject) && valid; } else if (optionDef.type === "number") { valid = this.validateNumeric(commandArguments[optionDef.name], optionDef, responseObject) && valid; - // Convert to numbers for backwards compatibility - if (valid) { commandArguments[optionDef.name] = parseFloat(commandArguments[optionDef.name]); } + // Convert to numbers for backwards compatibility - sets all possible values + if (valid) { + const changedOptions: ICommandArguments = CliUtils.setOptionValue(optionDef.name, + optionDef.aliases ?? [], parseFloat(commandArguments[optionDef.name])); + for (const [k, v] of Object.entries(changedOptions)) { + commandArguments[k] = v; + } + } } /** * Validate that the option's value is valid json. From 7e4dd5d737f625218945290f7e95549a07400196 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Wed, 21 Aug 2024 12:59:12 -0400 Subject: [PATCH 09/34] Add additional syntax validation checks for aliases and camelCase Signed-off-by: Andrew W. Harn --- .../src/packages/cmd/ValidationTestCommand.ts | 1 + .../__tests__/SyntaxValidator.unit.test.ts | 118 ++++++++++++++++-- 2 files changed, 112 insertions(+), 7 deletions(-) diff --git a/packages/imperative/__tests__/src/packages/cmd/ValidationTestCommand.ts b/packages/imperative/__tests__/src/packages/cmd/ValidationTestCommand.ts index 633374e0d8..31922285ab 100644 --- a/packages/imperative/__tests__/src/packages/cmd/ValidationTestCommand.ts +++ b/packages/imperative/__tests__/src/packages/cmd/ValidationTestCommand.ts @@ -68,6 +68,7 @@ export const ValidationTestCommand: ICommandDefinition = { name: "should-be-number", description: "should be a numerical value", type: "number", + aliases: ["sbn"] }, { name: "dog-type", 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 42d2e8924f..575a64cb0b 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 @@ -25,8 +25,16 @@ import { YargsConfigurer } from "../../yargs/YargsConfigurer"; describe("Imperative should provide advanced syntax validation rules", () => { const logger = TestLogger.getTestLogger(); + const aliases: Record = {}; + // We define ValidationTestCommand. Options is always defined. + for (const option of ValidationTestCommand.options) { + if (option.aliases) { + aliases[option.name] = option.aliases; + } + } const configuration = { - configuration: YargsConfigurer.yargsConfiguration + configuration: YargsConfigurer.yargsConfiguration, + alias: aliases }; describe("Advanced syntax validation for commands using a test command", () => { @@ -37,7 +45,7 @@ describe("Imperative should provide advanced syntax validation rules", () => { function tryOptions(optionString: string, shouldSucceed: boolean, expectedText?: string[]) { - const options = yargsParser(optionString, configuration); + const options = yargsParser.detailed(optionString, configuration).argv; options._ = ["test", "validation-test"].concat(options._ || []); // fake out command structure options[Constants.JSON_OPTION] = true; delete options["--"]; // delete extra yargs parse field @@ -367,8 +375,52 @@ describe("Imperative should provide advanced syntax validation rules", () => { false, ["multiple", "--always-required-string"])(); }); - it("should validate that typed numbers are numbers, and convert strings that are numbers", async () => { - const options = yargsParser(minValidOptions + " --should-be-number 4", configuration); + it("should validate that typed numbers are numbers, and convert strings that are numbers 1", async () => { + const options = yargsParser.detailed(minValidOptions + " --should-be-number 4", configuration).argv; + options._ = ["test", "validation-test"].concat(options._ || []); // fake out command structure + options[Constants.JSON_OPTION] = true; + delete options["--"]; // delete extra yargs parse field + logger.debug("Executing test syntax command with arguments: " + inspect(options)); + const response = new CommandResponse({responseFormat: "json"}); + const fakeParent: ICommandDefinition = { + name: undefined, + description: "", type: "group", + children: [ValidationTestCommand] + }; + const svResponse = await new SyntaxValidator(ValidationTestCommand, fakeParent).validate(response, options); + expect(options["should-be-number"]).toBe(4); + expect(options["shouldBeNumber"]).toBe(4); + expect(options["sbn"]).toBe(4); + expect(options["should-be-number"]).not.toBe("4"); + expect(options["shouldBeNumber"]).not.toBe("4"); + expect(options["sbn"]).not.toBe("4"); + expect(svResponse.valid).toEqual(true); + }); + + it("should validate that typed numbers are numbers, and convert strings that are numbers 2", async () => { + const options = yargsParser.detailed(minValidOptions + " --shouldBeNumber 4", configuration).argv; + options._ = ["test", "validation-test"].concat(options._ || []); // fake out command structure + options[Constants.JSON_OPTION] = true; + delete options["--"]; // delete extra yargs parse field + logger.debug("Executing test syntax command with arguments: " + inspect(options)); + const response = new CommandResponse({responseFormat: "json"}); + const fakeParent: ICommandDefinition = { + name: undefined, + description: "", type: "group", + children: [ValidationTestCommand] + }; + const svResponse = await new SyntaxValidator(ValidationTestCommand, fakeParent).validate(response, options); + expect(options["should-be-number"]).toBe(4); + expect(options["shouldBeNumber"]).toBe(4); + expect(options["sbn"]).toBe(4); + expect(options["should-be-number"]).not.toBe("4"); + expect(options["shouldBeNumber"]).not.toBe("4"); + expect(options["sbn"]).not.toBe("4"); + expect(svResponse.valid).toEqual(true); + }); + + it("should validate that typed numbers are numbers, and convert strings that are numbers 3", async () => { + const options = yargsParser.detailed(minValidOptions + " --sbn 4", configuration).argv; options._ = ["test", "validation-test"].concat(options._ || []); // fake out command structure options[Constants.JSON_OPTION] = true; delete options["--"]; // delete extra yargs parse field @@ -381,12 +433,60 @@ describe("Imperative should provide advanced syntax validation rules", () => { }; const svResponse = await new SyntaxValidator(ValidationTestCommand, fakeParent).validate(response, options); expect(options["should-be-number"]).toBe(4); + expect(options["shouldBeNumber"]).toBe(4); + expect(options["sbn"]).toBe(4); expect(options["should-be-number"]).not.toBe("4"); + expect(options["shouldBeNumber"]).not.toBe("4"); + expect(options["sbn"]).not.toBe("4"); + expect(svResponse.valid).toEqual(true); + }); + + it("should validate that typed numbers are numbers, and convert strings that are numbers that are floats 1", async () => { + const options = yargsParser.detailed(minValidOptions + " --should-be-number 3.1415926", configuration).argv; + options._ = ["test", "validation-test"].concat(options._ || []); // fake out command structure + options[Constants.JSON_OPTION] = true; + delete options["--"]; // delete extra yargs parse field + logger.debug("Executing test syntax command with arguments: " + inspect(options)); + const response = new CommandResponse({responseFormat: "json"}); + const fakeParent: ICommandDefinition = { + name: undefined, + description: "", type: "group", + children: [ValidationTestCommand] + }; + const svResponse = await new SyntaxValidator(ValidationTestCommand, fakeParent).validate(response, options); + expect(options["should-be-number"]).toBe(3.1415926); + expect(options["shouldBeNumber"]).toBe(3.1415926); + expect(options["sbn"]).toBe(3.1415926); + expect(options["should-be-number"]).not.toBe("3.1415926"); + expect(options["shouldBeNumber"]).not.toBe("3.1415926"); + expect(options["sbn"]).not.toBe("3.1415926"); + expect(svResponse.valid).toEqual(true); + }); + + it("should validate that typed numbers are numbers, and convert strings that are numbers that are floats 2", async () => { + const options = yargsParser.detailed(minValidOptions + " --shouldBeNumber 3.1415926", configuration).argv; + options._ = ["test", "validation-test"].concat(options._ || []); // fake out command structure + options[Constants.JSON_OPTION] = true; + delete options["--"]; // delete extra yargs parse field + logger.debug("Executing test syntax command with arguments: " + inspect(options)); + const response = new CommandResponse({responseFormat: "json"}); + const fakeParent: ICommandDefinition = { + name: undefined, + description: "", type: "group", + children: [ValidationTestCommand] + }; + const svResponse = await new SyntaxValidator(ValidationTestCommand, fakeParent).validate(response, options); + expect(options["should-be-number"]).toBe(3.1415926); + expect(options["shouldBeNumber"]).toBe(3.1415926); + expect(options["sbn"]).toBe(3.1415926); + expect(options["should-be-number"]).not.toBe("3.1415926"); + expect(options["shouldBeNumber"]).not.toBe("3.1415926"); + expect(options["sbn"]).not.toBe("3.1415926"); expect(svResponse.valid).toEqual(true); }); - it("should validate that typed numbers are numbers, and convert strings that are numbers that are floats", async () => { - const options = yargsParser(minValidOptions + " --should-be-number 3.1415926", configuration); + it("should validate that typed numbers are numbers, and convert strings that are numbers that are floats 3", async () => { + const options = yargsParser.detailed(minValidOptions + " --sbn 3.1415926", configuration).argv; options._ = ["test", "validation-test"].concat(options._ || []); // fake out command structure options[Constants.JSON_OPTION] = true; delete options["--"]; // delete extra yargs parse field @@ -399,12 +499,16 @@ describe("Imperative should provide advanced syntax validation rules", () => { }; const svResponse = await new SyntaxValidator(ValidationTestCommand, fakeParent).validate(response, options); expect(options["should-be-number"]).toBe(3.1415926); + expect(options["shouldBeNumber"]).toBe(3.1415926); + expect(options["sbn"]).toBe(3.1415926); expect(options["should-be-number"]).not.toBe("3.1415926"); + expect(options["shouldBeNumber"]).not.toBe("3.1415926"); + expect(options["sbn"]).not.toBe("3.1415926"); expect(svResponse.valid).toEqual(true); }); it("should validate that typed strings are strings and not numbers", async () => { - const options = yargsParser(minValidOptions + " --fluffy 9001", configuration); + const options = yargsParser.detailed(minValidOptions + " --fluffy 9001", configuration).argv; options._ = ["test", "validation-test"].concat(options._ || []); // fake out command structure options[Constants.JSON_OPTION] = true; delete options["--"]; // delete extra yargs parse field From 1de341edaab16690a9fdfd3b2cd63bee9e49b69d Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Wed, 21 Aug 2024 13:22:38 -0400 Subject: [PATCH 10/34] Assert to typescript that we know better. Signed-off-by: Andrew W. Harn --- .../src/cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 575a64cb0b..58bf12a29c 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 @@ -27,7 +27,7 @@ describe("Imperative should provide advanced syntax validation rules", () => { const logger = TestLogger.getTestLogger(); const aliases: Record = {}; // We define ValidationTestCommand. Options is always defined. - for (const option of ValidationTestCommand.options) { + for (const option of ValidationTestCommand.options!) { if (option.aliases) { aliases[option.name] = option.aliases; } From 29776af0dbbd5ea52868d444e1ed775b1a0c12b1 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 22 Aug 2024 15:51:40 -0400 Subject: [PATCH 11/34] Remove V1 profiles from integration tests Signed-off-by: Timothy Johnson --- .../Cmd.cli.root.integration.test.ts.snap | 4 +- packages/imperative/__tests__/src/TestUtil.ts | 8 +- .../with_bin_package/ProfileBinExampleCLI.ts | 2 +- .../ProfileBinExampleConfiguration.ts | 30 ++- .../ExampleDefinitions.integration.test.ts} | 4 +- .../ExampleLogging.integration.test.ts} | 4 +- .../HelpCommands.integration.test.ts} | 44 ++-- .../handlers/LogMessagesHandler.ts | 4 +- .../with_bin_package/tsconfig.json | 3 + .../with_profiles/ProfileExampleCLI.ts | 11 +- .../ProfileExampleConfiguration.ts | 217 ------------------ .../WithProfiles.integration.test.ts | 21 -- ...atedProfileCommands.integration.subtest.ts | 38 --- .../ExampleProfiles.integration.subtest.ts | 23 -- .../many-field-profile_meta.yaml | 40 ---- .../autoGenProfiles/profile-a/first.yaml | 2 - .../autoGenProfiles/profile-a/good.yaml | 2 - .../profile-a/profile-a_meta.yaml | 35 --- .../autoGenProfiles/profile-a/second.yaml | 2 - .../autoGenProfiles/profile-b/first.yaml | 1 - .../profile-b/profile-b_meta.yaml | 19 -- .../autoGenProfiles/profile-b/second.yaml | 1 - .../profile-c/profile-c_meta.yaml | 19 -- .../profile-with-dependency/big_profile.yaml | 5 - .../profile-with-dependency_meta.yaml | 25 -- .../definitions/a/ADefinition.ts | 34 --- .../definitions/b/BDefinition.ts | 33 --- .../definitions/c/CDefinition.ts | 33 --- .../definitions/d/DDefinition.ts | 33 --- .../definitions/d/DoNotIncludeMe.ts | 33 --- .../handlers/LogMessagesHandler.ts | 27 --- .../handlers/OptionalProfileCHandler.ts | 20 -- .../handlers/UseDependentProfileHandler.ts | 23 -- .../handlers/UseProfileAHandler.ts | 21 -- .../handlers/UseProfileBHandler.ts | 22 -- .../example_clis/with_profiles/package.json | 29 --- .../plans/ManyFieldValidationPlan.ts | 44 ---- .../profileHandlers/AddTwoNumbersHandler.ts | 20 -- .../__tests__/CommandProcessor.unit.test.ts | 20 +- .../src/imperative/src/api/ImperativeApi.ts | 16 ++ .../doc/config/IProfileTypeConfiguration.ts | 1 + .../src/validation/api/ProfileValidator.ts | 1 + 42 files changed, 100 insertions(+), 874 deletions(-) mode change 100644 => 100755 packages/imperative/__tests__/src/example_clis/with_bin_package/ProfileBinExampleCLI.ts rename packages/imperative/__tests__/src/example_clis/{with_profiles/__integration__/ExampleDefinitions.integration.subtest.ts => with_bin_package/__integration__/ExampleDefinitions.integration.test.ts} (94%) rename packages/imperative/__tests__/src/example_clis/{with_profiles/__integration__/ExampleLogging.integration.subtest.ts => with_bin_package/__integration__/ExampleLogging.integration.test.ts} (96%) rename packages/imperative/__tests__/src/{packages/cmd/__integration__/HelpCommands.integration.subtest.ts => example_clis/with_bin_package/__integration__/HelpCommands.integration.test.ts} (51%) create mode 100644 packages/imperative/__tests__/src/example_clis/with_bin_package/tsconfig.json mode change 100644 => 100755 packages/imperative/__tests__/src/example_clis/with_profiles/ProfileExampleCLI.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/ProfileExampleConfiguration.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/WithProfiles.integration.test.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/AutoGeneratedProfileCommands.integration.subtest.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/ExampleProfiles.integration.subtest.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/many-field-profile/many-field-profile_meta.yaml delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/first.yaml delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/good.yaml delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/profile-a_meta.yaml delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/second.yaml delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-b/first.yaml delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-b/profile-b_meta.yaml delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-b/second.yaml delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-c/profile-c_meta.yaml delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-with-dependency/big_profile.yaml delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-with-dependency/profile-with-dependency_meta.yaml delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/definitions/a/ADefinition.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/definitions/b/BDefinition.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/definitions/c/CDefinition.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/definitions/d/DDefinition.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/definitions/d/DoNotIncludeMe.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/handlers/LogMessagesHandler.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/handlers/OptionalProfileCHandler.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseDependentProfileHandler.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileAHandler.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileBHandler.ts delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/package.json delete mode 100644 packages/imperative/__tests__/src/example_clis/with_profiles/plans/ManyFieldValidationPlan.ts delete mode 100644 packages/imperative/__tests__/src/packages/cmd/profileHandlers/AddTwoNumbersHandler.ts diff --git a/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/root/__snapshots__/Cmd.cli.root.integration.test.ts.snap b/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/root/__snapshots__/Cmd.cli.root.integration.test.ts.snap index 0a4eb0e99b..669c13bad7 100644 --- a/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/root/__snapshots__/Cmd.cli.root.integration.test.ts.snap +++ b/packages/imperative/__tests__/__integration__/cmd/__tests__/integration/cli/root/__snapshots__/Cmd.cli.root.integration.test.ts.snap @@ -26,7 +26,6 @@ exports[`cmd-cli should display the help 1`] = ` invoke Invoke handlers to test promise reject/fulfill nested Test a complex structure profile Validate profile mapping - read Read some profiles respond Invoke handlers that will produce messages validate Validate syntax checking @@ -81,7 +80,6 @@ exports[`cmd-cli should display the help 1`] = ` invoke Invoke handlers to test promise reject/fulfill nested Test a complex structure profile Validate profile mapping - read Read some profiles respond Invoke handlers that will produce messages validate Validate syntax checking @@ -116,7 +114,7 @@ exports[`cmd-cli should display the help 1`] = ` \\"success\\": true, \\"exitCode\\": 0, \\"message\\": \\"\\", - \\"stdout\\": \\"\\\\n DESCRIPTION\\\\n -----------\\\\n\\\\n A test CLI for the 'cmd' imperative package\\\\n\\\\n USAGE\\\\n -----\\\\n\\\\n cmd-cli \\\\n\\\\n Where is one of the following:\\\\n\\\\n GROUPS\\\\n ------\\\\n\\\\n auth Connect to token-based authentication services\\\\n auto-format Invoke handlers to test auto-format \\\\n chained chained handler test commands \\\\n gen-help Commands to test help generator \\\\n invalid Invalid definitions \\\\n invoke Invoke handlers to test promise reject/fulfill\\\\n nested Test a complex structure \\\\n profile Validate profile mapping \\\\n read Read some profiles \\\\n respond Invoke handlers that will produce messages \\\\n validate Validate syntax checking \\\\n\\\\n OPTIONS\\\\n -------\\\\n\\\\n --version | -V (boolean)\\\\n\\\\n Display the current version of Cmd Package CLI\\\\n\\\\n --available-commands | --ac (boolean)\\\\n\\\\n Displays a list of available commands\\\\n\\\\n GLOBAL OPTIONS\\\\n --------------\\\\n\\\\n --response-format-json | --rfj (boolean)\\\\n\\\\n Produce JSON formatted data from a command\\\\n\\\\n --help | -h (boolean)\\\\n\\\\n Display help text\\\\n\\\\n --help-web | --hw (boolean)\\\\n\\\\n Display HTML help in browser\\\\n\\\\n\\", + \\"stdout\\": \\"\\\\n DESCRIPTION\\\\n -----------\\\\n\\\\n A test CLI for the 'cmd' imperative package\\\\n\\\\n USAGE\\\\n -----\\\\n\\\\n cmd-cli \\\\n\\\\n Where is one of the following:\\\\n\\\\n GROUPS\\\\n ------\\\\n\\\\n auth Connect to token-based authentication services\\\\n auto-format Invoke handlers to test auto-format \\\\n chained chained handler test commands \\\\n gen-help Commands to test help generator \\\\n invalid Invalid definitions \\\\n invoke Invoke handlers to test promise reject/fulfill\\\\n nested Test a complex structure \\\\n profile Validate profile mapping \\\\n respond Invoke handlers that will produce messages \\\\n validate Validate syntax checking \\\\n\\\\n OPTIONS\\\\n -------\\\\n\\\\n --version | -V (boolean)\\\\n\\\\n Display the current version of Cmd Package CLI\\\\n\\\\n --available-commands | --ac (boolean)\\\\n\\\\n Displays a list of available commands\\\\n\\\\n GLOBAL OPTIONS\\\\n --------------\\\\n\\\\n --response-format-json | --rfj (boolean)\\\\n\\\\n Produce JSON formatted data from a command\\\\n\\\\n --help | -h (boolean)\\\\n\\\\n Display help text\\\\n\\\\n --help-web | --hw (boolean)\\\\n\\\\n Display HTML help in browser\\\\n\\\\n\\", \\"stderr\\": \\"\\", \\"data\\": {} }" diff --git a/packages/imperative/__tests__/src/TestUtil.ts b/packages/imperative/__tests__/src/TestUtil.ts index 93e0ceab01..1bb7373060 100644 --- a/packages/imperative/__tests__/src/TestUtil.ts +++ b/packages/imperative/__tests__/src/TestUtil.ts @@ -170,10 +170,14 @@ export function executeTestCLICommand(cliBinModule: string, testContext: any, ar execDir?: string, pipeContent?: string | Buffer, env: { [key: string]: string } = process.env): SpawnSyncReturns { const testLogger = TestLogger.getTestLogger(); - const nodeCommand = "node"; + const isLocalFile = fs.existsSync(cliBinModule); + const nodeCommand = isLocalFile ? "node" : "npx"; // run the command with ts-node/register - const starterArguments = ["--require", "ts-node/register", cliBinModule]; + const starterArguments = isLocalFile ? ["--require", "ts-node/register", cliBinModule] : [cliBinModule]; args = starterArguments.concat(args); + if (!isLocalFile) { + execDir ??= nodePath.dirname(expect.getState().testPath); + } const commandExecutionMessage = "Executing " + nodeCommand + " " + args.join(" "); diff --git a/packages/imperative/__tests__/src/example_clis/with_bin_package/ProfileBinExampleCLI.ts b/packages/imperative/__tests__/src/example_clis/with_bin_package/ProfileBinExampleCLI.ts old mode 100644 new mode 100755 index c142ccd093..cedeaa80b0 --- a/packages/imperative/__tests__/src/example_clis/with_bin_package/ProfileBinExampleCLI.ts +++ b/packages/imperative/__tests__/src/example_clis/with_bin_package/ProfileBinExampleCLI.ts @@ -1,3 +1,4 @@ +#!/usr/bin/env ts-node /* * 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 @@ -16,4 +17,3 @@ Imperative.init({configurationModule: __dirname + "/ProfileBinExampleConfigurati }).catch((error) => { process.stderr.write(`An error occurred parsing or initing: ${error.message}`); }); - diff --git a/packages/imperative/__tests__/src/example_clis/with_bin_package/ProfileBinExampleConfiguration.ts b/packages/imperative/__tests__/src/example_clis/with_bin_package/ProfileBinExampleConfiguration.ts index e8a7a20675..86520ee8f7 100644 --- a/packages/imperative/__tests__/src/example_clis/with_bin_package/ProfileBinExampleConfiguration.ts +++ b/packages/imperative/__tests__/src/example_clis/with_bin_package/ProfileBinExampleConfiguration.ts @@ -11,8 +11,32 @@ import { IImperativeConfig } from "../../../../src/imperative"; -const binConfig: IImperativeConfig = { - commandModuleGlobs: ["definitions/*/*Definition.ts"], +const config: IImperativeConfig = { + definitions: [ + { + name: "log", + description: "Log example messages", + type: "group", + children: [ + { + name: "messages", + description: "Log example messages", + type: "command", + handler: __dirname + "/handlers/LogMessagesHandler", + options: [ + { + name: "level", + allowableValues: {values: ["trace", "debug", "info", "warn", "error", "fatal"]}, + type: "string", + description: "The level to log messages at.", + required: true + } + ] + } + ] + } + ], + commandModuleGlobs: ["../with_bin_package/definitions/*/*Definition.ts"], rootCommandDescription: "Sample command line interface", defaultHome: __dirname + "/../../../__results__/.examplewithprofiles", // defaultHome: createUniqueTestDataDir(), @@ -40,4 +64,4 @@ const binConfig: IImperativeConfig = { }] }; -module.exports = binConfig; +module.exports = config; diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/ExampleDefinitions.integration.subtest.ts b/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/ExampleDefinitions.integration.test.ts similarity index 94% rename from packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/ExampleDefinitions.integration.subtest.ts rename to packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/ExampleDefinitions.integration.test.ts index de7af85799..3b651f9a24 100644 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/ExampleDefinitions.integration.subtest.ts +++ b/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/ExampleDefinitions.integration.test.ts @@ -15,8 +15,8 @@ import * as T from "../../../TestUtil"; describe("We should provide the ability to define commands through Javascript objects passed through the config " + "or globs that match modules locally, " + "tested through an example CLI", function () { - const cliBin = __dirname + "/../ProfileExampleCLI.ts"; - const config: IImperativeConfig = require(__dirname + "/../ProfileExampleConfiguration"); + const cliBin = __dirname + "/../ProfileBinExampleCLI.ts"; + const config: IImperativeConfig = require(__dirname + "/../ProfileBinExampleConfiguration"); it("All commands defined through module globs should be accurately defined, " + "and a definition module in the same directory that does not ", diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/ExampleLogging.integration.subtest.ts b/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/ExampleLogging.integration.test.ts similarity index 96% rename from packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/ExampleLogging.integration.subtest.ts rename to packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/ExampleLogging.integration.test.ts index fbfc1d2804..8e3508a54a 100644 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/ExampleLogging.integration.subtest.ts +++ b/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/ExampleLogging.integration.test.ts @@ -15,8 +15,8 @@ import { IImperativeConfig } from "../../../../../src/imperative"; describe("We should provide the ability to create, manage, and use profiles, " + "tested through an example CLI", function () { - const cliBin = __dirname + "/../ProfileExampleCLI.ts"; - const config: IImperativeConfig = require(__dirname + "/../ProfileExampleConfiguration"); + const cliBin = __dirname + "/../ProfileBinExampleCLI.ts"; + const config: IImperativeConfig = require(__dirname + "/../ProfileBinExampleConfiguration"); const logFile = path.join(config.defaultHome as string, "logs", config.name + ".log"); afterEach(function () { diff --git a/packages/imperative/__tests__/src/packages/cmd/__integration__/HelpCommands.integration.subtest.ts b/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/HelpCommands.integration.test.ts similarity index 51% rename from packages/imperative/__tests__/src/packages/cmd/__integration__/HelpCommands.integration.subtest.ts rename to packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/HelpCommands.integration.test.ts index 19139af974..d062798e23 100644 --- a/packages/imperative/__tests__/src/packages/cmd/__integration__/HelpCommands.integration.subtest.ts +++ b/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/HelpCommands.integration.test.ts @@ -9,12 +9,14 @@ * */ +import * as fs from "fs"; import * as T from "../../../TestUtil"; import { IImperativeConfig } from "../../../../../src/imperative/index"; describe("Imperative help should be available for a range of definitions", function () { - const withBinPackageCliBin = __dirname + "/../../../example_clis/with_bin_package/ProfileBinExampleCLI"; - const profileCliBin = __dirname + "/../../../example_clis/with_profiles/ProfileExampleCLI"; + const cliWithBin = Object.keys(require(__dirname + "/../package.json").bin)[0]; + const cliWithoutBin = __dirname + "/../../with_profiles/ProfileExampleCLI.ts"; + const config: IImperativeConfig = require(__dirname + "/../ProfileBinExampleConfiguration"); /** * Clean up the home directory before and after each test. */ @@ -22,39 +24,41 @@ describe("Imperative help should be available for a range of definitions", funct T.rimraf(T.TEST_HOME); }); afterEach(function () { - T.rimraf(T.TEST_HOME); }); - const config: IImperativeConfig = require(__dirname + "/../../../example_clis/with_profiles/ProfileExampleConfiguration"); - const binConfig: IImperativeConfig = require(__dirname + "/../../../example_clis/with_bin_package/ProfileBinExampleConfiguration"); - - it("We should be able to get --help for our example CLI - no bin specified in package", function () { - T.findExpectedOutputInCommand(profileCliBin, ["--help"], + it("We should be able to get --help for our example CLI - without bin script", function () { + T.findExpectedOutputInCommand(cliWithoutBin, ["--help"], [config.productDisplayName, "log"], "stdout", true, - this, T.CMD_TYPE.INTERACTIVE); - T.findExpectedOutputInCommand(profileCliBin, ["log", "--help"], + this, T.CMD_TYPE.INTERACTIVE, undefined, undefined, { + IMPERATIVE_CALLER_LOCATION: T.TEST_HOME + }); + T.findExpectedOutputInCommand(cliWithoutBin, ["log", "--help"], ["ProfileExampleCLI.ts", "Log example messages", "messages"], "stdout", true, - this, T.CMD_TYPE.INTERACTIVE); - T.findExpectedOutputInCommand(profileCliBin, ["log", "messages", "--help"], + this, T.CMD_TYPE.INTERACTIVE, undefined, undefined, { + IMPERATIVE_CALLER_LOCATION: T.TEST_HOME + }); + T.findExpectedOutputInCommand(cliWithoutBin, ["log", "messages", "--help"], ["ProfileExampleCLI.ts", "Log example messages", "messages", "level"], "stdout", true, - this, T.CMD_TYPE.INTERACTIVE); + this, T.CMD_TYPE.INTERACTIVE, undefined, undefined, { + IMPERATIVE_CALLER_LOCATION: T.TEST_HOME + }); }); it("should display --version in the root help", function () { - T.findExpectedOutputInCommand(withBinPackageCliBin, ["--help"], - [binConfig.productDisplayName, "--version"], "stdout", true, + T.findExpectedOutputInCommand(cliWithBin, ["--help"], + [config.productDisplayName, "--version"], "stdout", true, this, T.CMD_TYPE.INTERACTIVE); }); - it("We should be able to get --help for our example CLI - with bin in package", function () { - T.findExpectedOutputInCommand(withBinPackageCliBin, ["--help"], - [binConfig.productDisplayName, "ape", "bat", "cat"], "stdout", true, + it("We should be able to get --help for our example CLI - with bin script", function () { + T.findExpectedOutputInCommand(cliWithBin, ["--help"], + [config.productDisplayName, "ape", "bat", "cat"], "stdout", true, this, T.CMD_TYPE.INTERACTIVE); - T.findExpectedOutputInCommand(withBinPackageCliBin, ["ape", "--help"], + T.findExpectedOutputInCommand(cliWithBin, ["ape", "--help"], ["sample-with-bin", "An ape eats grapes"], "stdout", true, this, T.CMD_TYPE.INTERACTIVE); - T.findExpectedOutputInCommand(withBinPackageCliBin, ["ape", "grape", "--help"], + T.findExpectedOutputInCommand(cliWithBin, ["ape", "grape", "--help"], ["sample-with-bin", "--grape-color", "the color of the grapes eaten by the ape"], "stdout", true, this, T.CMD_TYPE.INTERACTIVE); }); diff --git a/packages/imperative/__tests__/src/example_clis/with_bin_package/handlers/LogMessagesHandler.ts b/packages/imperative/__tests__/src/example_clis/with_bin_package/handlers/LogMessagesHandler.ts index 08fef83eec..8c3647b681 100644 --- a/packages/imperative/__tests__/src/example_clis/with_bin_package/handlers/LogMessagesHandler.ts +++ b/packages/imperative/__tests__/src/example_clis/with_bin_package/handlers/LogMessagesHandler.ts @@ -13,7 +13,7 @@ import { ICommandHandler, IHandlerParameters } from "../../../../../src/cmd"; import { Imperative } from "../../../../../src/imperative"; -class ProduceLogMessagesHandler implements ICommandHandler { +export default class ProduceLogMessagesHandler implements ICommandHandler { public async process(params: IHandlerParameters): Promise { Imperative.api.appLogger.level = params.arguments.level; Imperative.api.appLogger.trace("This is a trace message"); @@ -25,5 +25,3 @@ class ProduceLogMessagesHandler implements ICommandHandler { params.response.console.log("Log messages were written"); } } - -module.exports = ProduceLogMessagesHandler; diff --git a/packages/imperative/__tests__/src/example_clis/with_bin_package/tsconfig.json b/packages/imperative/__tests__/src/example_clis/with_bin_package/tsconfig.json new file mode 100644 index 0000000000..64498cb3a3 --- /dev/null +++ b/packages/imperative/__tests__/src/example_clis/with_bin_package/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../../tsconfig.json" +} \ No newline at end of file diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/ProfileExampleCLI.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/ProfileExampleCLI.ts old mode 100644 new mode 100755 index 8ca0edeb9c..7aff87c698 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/ProfileExampleCLI.ts +++ b/packages/imperative/__tests__/src/example_clis/with_profiles/ProfileExampleCLI.ts @@ -11,10 +11,9 @@ import { Imperative } from "../../../../src/imperative"; - -process.on("unhandledRejection", (err) => { - process.stderr.write("Err: " + err + "\n"); +// Reuse "with_bin_package" configuration without bin script +Imperative.init({configurationModule: __dirname + "/../with_bin_package/ProfileBinExampleConfiguration.ts"}).then(() => { + Imperative.parse(); +}).catch((error) => { + process.stderr.write(`An error occurred parsing or initing: ${error.message}`); }); - -Imperative.init({configurationModule: __dirname + "/ProfileExampleConfiguration.ts"}).then(() => Imperative.parse()); -// Imperative.parse(); diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/ProfileExampleConfiguration.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/ProfileExampleConfiguration.ts deleted file mode 100644 index 3fe9563ca5..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/ProfileExampleConfiguration.ts +++ /dev/null @@ -1,217 +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. -* -*/ - -import { IImperativeConfig } from "../../../../src/imperative"; - -const config: IImperativeConfig = { - definitions: [ - { - name: "log", - description: "Log example messages", - type: "group", - children: [ - { - name: "messages", - description: "Log example messages", - type: "command", - handler: __dirname + "/handlers/LogMessagesHandler", - options: [ - { - name: "level", - allowableValues: {values: ["trace", "debug", "info", "warn", "error", "fatal"]}, - type: "string", - description: "The level to log messages at.", - required: true - } - ] - } - ] - }, - { - name: "use-profile-a", - description: "Use a profile of type A", - type: "command", - profile: { - required: ["profile-a"] - }, - handler: __dirname + "/handlers/UseProfileAHandler" - }, - { - name: "use-profile-b", - description: "Use a profile of type B", - type: "command", - profile: { - required: ["profile-b"] - }, - handler: __dirname + "/handlers/UseProfileBHandler" - }, - { - name: "optional-profile-c", - description: "Use a profile of type C", - type: "command", - profile: { - optional: ["profile-c"] - }, - handler: __dirname + "/handlers/OptionalProfileCHandler" - }, - { - name: "use-dependent-profile", - description: "Use a profile of type profile-with-dependency", - type: "command", - profile: { - required: ["profile-with-dependency"] - }, - handler: __dirname + "/handlers/UseDependentProfileHandler" - } - ], - commandModuleGlobs: ["definitions/*/*Definition.ts"], - rootCommandDescription: "Sample command line interface", - defaultHome: __dirname + "/../../../__results__/.examplewithprofiles", - // defaultHome: createUniqueTestDataDir(), - productDisplayName: "Test CLI with Profiles", - name: "example_with_profiles", - profiles: [ - { - type: "profile-a", - schema: { - type: "object", - title: "Example profile type A", - description: "Example profile type A", - properties: { - animal: { - optionDefinition: { - description: "The animal", - type: "string", - name: "animal", aliases: ["a"], - required: true - }, - type: "string", - }, - numberWithDefault: { - optionDefinition: { - defaultValue: 8080, - name: "number-with-default", - type: "number", - description: "A number field with default value", - }, - type: "number" - } - }, - required: ["animal", "numberWithDefault"] - } - }, - { - type: "profile-b", - schema: { - type: "object", - title: "Example profile type B", - description: "Example profile type B", - properties: { - bumblebee: { - optionDefinition: { - description: "The bumblebee", - type: "string", - name: "bumblebee", aliases: ["b"], - required: true - }, - type: "string", - }, - }, - required: ["bumblebee"] - }, - }, - { - type: "profile-c", - schema: { - type: "object", - title: "Example profile type C", - description: "Example profile type C", - properties: { - animal: { - optionDefinition: { - description: "The animal", - type: "string", - name: "animal", aliases: ["a"], - required: true - }, - type: "string", - }, - }, - required: ["animal"] - }, - }, - { - type: "profile-with-dependency", - schema: { - type: "object", - title: "Example profile with dependent profiles", - description: "Example profile type with dependent profiles", - properties: { - ghost: { - optionDefinition: { - description: "The ghost", - type: "string", - name: "ghost", aliases: ["g"], - required: true - }, - type: "string", - }, - }, - required: ["ghost", "dependencies"] - }, - dependencies: [{ - description: "The profile-a profile to use as a dependency.", - type: "profile-a", - required: true - }] - }, - { - type: "many-field-profile", - validationPlanModule: __dirname + "/plans/ManyFieldValidationPlan", - schema: { - type: "object", - title: "Example profile with multiple fields", - description: "Example profile type with multiple fields", - properties: { - tea: { - optionDefinition: { - description: "The tea", - type: "string", - name: "tea", aliases: ["t"], - required: true - }, - type: "string", - }, - soda: { - optionDefinition: { - description: "The soda", - type: "string", - name: "soda", aliases: ["s"], - required: true - }, - type: "string", - }, - water: { - optionDefinition: { - description: "The water", - type: "string", - name: "water", aliases: ["w"], - required: true - }, - type: "string", - }, - }, - required: ["tea", "soda", "water"] - }, - }] -}; - -export = config; diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/WithProfiles.integration.test.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/WithProfiles.integration.test.ts deleted file mode 100644 index 0de0e5180c..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/WithProfiles.integration.test.ts +++ /dev/null @@ -1,21 +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. -* -*/ - -// The test order is important - some tests depend on other tests not running first - do not change it -/* eslint-disable max-len */ - -describe("Imperative With Profiles Tests", () => { - require("./__integration__/AutoGeneratedProfileCommands.integration.subtest"); - require("./__integration__/ExampleDefinitions.integration.subtest"); - require("./__integration__/ExampleLogging.integration.subtest"); - require("./__integration__/ExampleProfiles.integration.subtest"); - require("../../packages/cmd/__integration__/HelpCommands.integration.subtest"); -}); diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/AutoGeneratedProfileCommands.integration.subtest.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/AutoGeneratedProfileCommands.integration.subtest.ts deleted file mode 100644 index b2772f5a17..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/AutoGeneratedProfileCommands.integration.subtest.ts +++ /dev/null @@ -1,38 +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. -* -*/ - -import * as T from "../../../TestUtil"; - -describe("We should provide auto-generated profile commands for convenience, " + - "so that Imperative-based CLIs can let users manage configuration profiles", () => { - const cliBin = __dirname + "/../ProfileExampleCLI.ts"; - - it("should fail to load a V1 dependent profile", () => { - const result = T.executeTestCLICommand(cliBin, this, ["use-dependent-profile"]); - - /* Since we no longer read V1 profiles from disk, such an operation will always return an error. - Note that Zowe client code no longer attempts to do such an operation. - */ - expect(result.stderr).toContain( - 'Profile of type "profile-with-dependency" does not exist ' + - 'within the loaded profiles for the command and it is marked as required' - ); - expect(result.status).toBe(1); - }); - - it("should not fail a command where the profile is listed as optional and not specified", () => { - // Optional profiles shouldn't cause a handler or other failure - const output = T.findExpectedOutputInCommand(cliBin, ["optional-profile-c"], // second profile should be used - ["Profile Cs loaded: undefined"], - "stdout", true, this, T.CMD_TYPE.JSON, {ignoreCase: true}); - expect(output.stderr).toEqual(""); - }); -}); diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/ExampleProfiles.integration.subtest.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/ExampleProfiles.integration.subtest.ts deleted file mode 100644 index 25bdc3b950..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/ExampleProfiles.integration.subtest.ts +++ /dev/null @@ -1,23 +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. -* -*/ - -import * as T from "../../../TestUtil"; -import { IImperativeConfig } from "../../../../../src/imperative"; - -describe("We should provide the ability access profiles from an example CLI definition", function () { - - const config: IImperativeConfig = require(__dirname + "/../ProfileExampleConfiguration"); - it("We should be able to get --help for our example CLI", function () { - T.findExpectedOutputInCommand(__dirname + "/../ProfileExampleCLI", ["--help"], - [config.productDisplayName, "log"], "stdout", true, - this, T.CMD_TYPE.INTERACTIVE); - }); -}); diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/many-field-profile/many-field-profile_meta.yaml b/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/many-field-profile/many-field-profile_meta.yaml deleted file mode 100644 index 2eacfe0579..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/many-field-profile/many-field-profile_meta.yaml +++ /dev/null @@ -1,40 +0,0 @@ -defaultProfile: null -configuration: - type: many-field-profile - validationPlanModule: /home/stduser/repos/zowe-cli/packages/imperative/__tests__/src/example_clis/with_profiles/plans/ManyFieldValidationPlan - schema: - type: object - title: 'Example profile with multiple fields' - description: 'Example profile type with multiple fields' - properties: - tea: - optionDefinition: - description: 'The tea' - type: string - name: tea - aliases: - - t - required: true - type: string - soda: - optionDefinition: - description: 'The soda' - type: string - name: soda - aliases: - - s - required: true - type: string - water: - optionDefinition: - description: 'The water' - type: string - name: water - aliases: - - w - required: true - type: string - required: - - tea - - soda - - water diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/first.yaml b/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/first.yaml deleted file mode 100644 index 80f1e54e7c..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/first.yaml +++ /dev/null @@ -1,2 +0,0 @@ -animal: doggy -numberWithDefault: 8080 diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/good.yaml b/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/good.yaml deleted file mode 100644 index 80f1e54e7c..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/good.yaml +++ /dev/null @@ -1,2 +0,0 @@ -animal: doggy -numberWithDefault: 8080 diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/profile-a_meta.yaml b/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/profile-a_meta.yaml deleted file mode 100644 index 3186d43175..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/profile-a_meta.yaml +++ /dev/null @@ -1,35 +0,0 @@ -defaultProfile: good -configuration: - type: profile-a - schema: - type: object - title: 'Example profile type A' - description: 'Example profile type A' - properties: - animal: - optionDefinition: - description: 'The animal' - type: string - name: animal - aliases: - - a - required: true - type: string - numberWithDefault: - optionDefinition: - defaultValue: 8080 - name: number-with-default - type: number - description: 'A number field with default value' - type: number - required: - - animal - - numberWithDefault - createProfileExamples: - - - options: '--animal doggy' - description: 'Create a profile-a profile with a doggy as the animal' - updateProfileExamples: - - - options: '--animal froggy' - description: 'Update a profile-a profile to use froggy as the animal' diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/second.yaml b/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/second.yaml deleted file mode 100644 index 9b70f0f916..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-a/second.yaml +++ /dev/null @@ -1,2 +0,0 @@ -animal: sloth -numberWithDefault: 8080 diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-b/first.yaml b/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-b/first.yaml deleted file mode 100644 index 2add236402..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-b/first.yaml +++ /dev/null @@ -1 +0,0 @@ -bumblebee: dumbledore diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-b/profile-b_meta.yaml b/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-b/profile-b_meta.yaml deleted file mode 100644 index 0606ccecb9..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-b/profile-b_meta.yaml +++ /dev/null @@ -1,19 +0,0 @@ -defaultProfile: null -configuration: - type: profile-b - schema: - type: object - title: 'Example profile type B' - description: 'Example profile type B' - properties: - bumblebee: - optionDefinition: - description: 'The bumblebee' - type: string - name: bumblebee - aliases: - - b - required: true - type: string - required: - - bumblebee diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-b/second.yaml b/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-b/second.yaml deleted file mode 100644 index 90ad5c49d9..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-b/second.yaml +++ /dev/null @@ -1 +0,0 @@ -bumblebee: seinfeld diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-c/profile-c_meta.yaml b/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-c/profile-c_meta.yaml deleted file mode 100644 index 2192f53d30..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-c/profile-c_meta.yaml +++ /dev/null @@ -1,19 +0,0 @@ -defaultProfile: null -configuration: - type: profile-c - schema: - type: object - title: 'Example profile type C' - description: 'Example profile type C' - properties: - animal: - optionDefinition: - description: 'The animal' - type: string - name: animal - aliases: - - a - required: true - type: string - required: - - animal diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-with-dependency/big_profile.yaml b/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-with-dependency/big_profile.yaml deleted file mode 100644 index 2b11630ebd..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-with-dependency/big_profile.yaml +++ /dev/null @@ -1,5 +0,0 @@ -ghost: lenore -dependencies: - - - type: profile-a - name: good diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-with-dependency/profile-with-dependency_meta.yaml b/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-with-dependency/profile-with-dependency_meta.yaml deleted file mode 100644 index 296d066641..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/__integration__/__resources__/autoGenProfiles/profile-with-dependency/profile-with-dependency_meta.yaml +++ /dev/null @@ -1,25 +0,0 @@ -defaultProfile: big_profile -configuration: - type: profile-with-dependency - schema: - type: object - title: 'Example profile with dependent profiles' - description: 'Example profile type with dependent profiles' - properties: - ghost: - optionDefinition: - description: 'The ghost' - type: string - name: ghost - aliases: - - g - required: true - type: string - required: - - ghost - - dependencies - dependencies: - - - description: 'The profile-a profile to use as a dependency.' - type: profile-a - required: true diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/a/ADefinition.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/a/ADefinition.ts deleted file mode 100644 index 7aa077568e..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/a/ADefinition.ts +++ /dev/null @@ -1,34 +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. -* -*/ - -import { ICommandDefinition } from "../../../../../../src/cmd"; - -const definition: ICommandDefinition = { - name: "ape", - type: "group", - description: "Ape commands", - children: [ - { - name: "grape", - type: "command", - description: "An ape eats grapes", - options: [ - { - name: "grape-color", - type: "string", - description: "the color of the grapes eaten by the ape" - } - ] - } - ] -}; - -module.exports = definition; diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/b/BDefinition.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/b/BDefinition.ts deleted file mode 100644 index ba5dd4b3f3..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/b/BDefinition.ts +++ /dev/null @@ -1,33 +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. -* -*/ - -import { ICommandDefinition } from "../../../../../../src/cmd"; - -const definition: ICommandDefinition = { - name: "bat", - type: "group", - description: "Bat commands", - children: [ - { - name: "rat", - type: "command", - description: "A bat eats rats", - options: [ - { - name: "rat-color", - type: "string", - description: "the color of the rat eaten by the bat" - } - ] - } - ] -}; -module.exports = definition; diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/c/CDefinition.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/c/CDefinition.ts deleted file mode 100644 index d0aee7aafc..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/c/CDefinition.ts +++ /dev/null @@ -1,33 +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. -* -*/ - -import { ICommandDefinition } from "../../../../../../src/cmd"; - -const definition: ICommandDefinition = { - name: "cat", - type: "group", - description: "Cat commands", - children: [ - { - name: "splat", - type: "command", - description: "A cat eats splats", - options: [ - { - name: "splat-color", - type: "string", - description: "the color of the splat eaten by the cat" - } - ] - } - ] -}; -module.exports = definition; diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/d/DDefinition.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/d/DDefinition.ts deleted file mode 100644 index 2a7f746fac..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/d/DDefinition.ts +++ /dev/null @@ -1,33 +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. -* -*/ - -import { ICommandDefinition } from "../../../../../../src/cmd"; - -const definition: ICommandDefinition = { - name: "dog", - type: "group", - description: "Dog commands", - children: [ - { - name: "log", - type: "command", - description: "A dog eats logs", - options: [ - { - name: "log-color", - type: "string", - description: "the color of the log eaten by the dog" - } - ] - } - ] -}; -module.exports = definition; diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/d/DoNotIncludeMe.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/d/DoNotIncludeMe.ts deleted file mode 100644 index bea26ce1c2..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/definitions/d/DoNotIncludeMe.ts +++ /dev/null @@ -1,33 +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. -* -*/ - -import { ICommandDefinition } from "../../../../../../src/cmd"; - -const definition: ICommandDefinition = { - name: "do-not-include-this", - type: "group", - description: "These commands should not match the glob and thus should not be defined", - children: [ - { - name: "or-this", - type: "command", - description: "Don't include this either", - options: [ - { - name: "this-color", - type: "string", - description: "the color of the this that you shouldn't include" - } - ] - } - ] -}; -module.exports = definition; diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/LogMessagesHandler.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/LogMessagesHandler.ts deleted file mode 100644 index 8c3647b681..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/LogMessagesHandler.ts +++ /dev/null @@ -1,27 +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. -* -*/ - -import { ICommandHandler, IHandlerParameters } from "../../../../../src/cmd"; -import { Imperative } from "../../../../../src/imperative"; - - -export default class ProduceLogMessagesHandler implements ICommandHandler { - public async process(params: IHandlerParameters): Promise { - Imperative.api.appLogger.level = params.arguments.level; - Imperative.api.appLogger.trace("This is a trace message"); - Imperative.api.appLogger.debug("This is a debug message"); - Imperative.api.appLogger.info("This is an info message"); - Imperative.api.appLogger.warn("This is a warn message"); - Imperative.api.appLogger.error("This is an error message"); - Imperative.api.appLogger.fatal("This is a fatal message"); - params.response.console.log("Log messages were written"); - } -} diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/OptionalProfileCHandler.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/OptionalProfileCHandler.ts deleted file mode 100644 index 6122fd06a4..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/OptionalProfileCHandler.ts +++ /dev/null @@ -1,20 +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. -* -*/ - -import { ICommandHandler, IHandlerParameters } from "../../../../../src/cmd"; - -export default class OptionalProfileCHandler implements ICommandHandler { - public async process(params: IHandlerParameters) { - // eslint-disable-next-line deprecation/deprecation - const profile = params.profiles.get("profile-c", false); - params.response.console.log(`Profile Cs loaded: ${profile}`); - } -} diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseDependentProfileHandler.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseDependentProfileHandler.ts deleted file mode 100644 index 94722840a3..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseDependentProfileHandler.ts +++ /dev/null @@ -1,23 +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. -* -*/ - -import { ICommandHandler, IHandlerParameters } from "../../../../../src/cmd"; - -export default class UseDependentProfile implements ICommandHandler { - public async process(params: IHandlerParameters) { - // eslint-disable-next-line deprecation/deprecation - const dependencyProfile = params.profiles.get("profile-a"); - params.response.console.log("Loaded profile dependency of type profile-a"); - // eslint-disable-next-line deprecation/deprecation - const mainProfile = params.profiles.get("profile-with-dependency"); - params.response.console.log("Loaded main profile of type profile-with-dependency"); - } -} diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileAHandler.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileAHandler.ts deleted file mode 100644 index 1745880c01..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileAHandler.ts +++ /dev/null @@ -1,21 +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. -* -*/ - -import { ICommandHandler, IHandlerParameters } from "../../../../../src/cmd"; - -export default class UseProfileAHandler implements ICommandHandler { - public async process(params: IHandlerParameters) { - // eslint-disable-next-line deprecation/deprecation - const profile = params.profiles.get("profile-a"); - params.response.console.log("Loaded profile {{name}} of type {{type}}", - {name: profile.name, type: profile.type}); - } -} diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileBHandler.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileBHandler.ts deleted file mode 100644 index 246abae3c1..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/handlers/UseProfileBHandler.ts +++ /dev/null @@ -1,22 +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. -* -*/ - -import { ICommandHandler, IHandlerParameters } from "../../../../../src/cmd"; - -export default class UseProfileAHandler implements ICommandHandler { - public async process(params: IHandlerParameters): Promise { - // eslint-disable-next-line deprecation/deprecation - const profile = params.profiles.get("profile-b"); - params.response.console.log("Loaded profile {{name}} of type {{type}}", - {name: profile.name, type: profile.type}); - } -} - diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/package.json b/packages/imperative/__tests__/src/example_clis/with_profiles/package.json deleted file mode 100644 index feedaf6726..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "profile-example-cli", - "version": "0.0.0", - "description": "Test Imperative CLI with Profiles", - "license": "EPL 2.0", - "repository": "", - "author": { - "name": "", - "email": "", - "url": "" - }, - "keywords": [ - "" - ], - "files": [ - "lib" - ], - "main": "lib/index.js", - "typings": "lib/index.d.ts", - "scripts": { - }, - "dependencies": { - }, - "devDependencies": { - }, - "engines": { - "node": ">=6.0.0" - } -} diff --git a/packages/imperative/__tests__/src/example_clis/with_profiles/plans/ManyFieldValidationPlan.ts b/packages/imperative/__tests__/src/example_clis/with_profiles/plans/ManyFieldValidationPlan.ts deleted file mode 100644 index 8e8b8d9d74..0000000000 --- a/packages/imperative/__tests__/src/example_clis/with_profiles/plans/ManyFieldValidationPlan.ts +++ /dev/null @@ -1,44 +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. -* -*/ - -import { IProfileValidationPlan, IProfileValidationTask } from "../../../../../src/profiles"; -import { IProfileValidationTaskResult } from "../../../../../src/profiles/src/validation/doc/IProfileValidationTaskResult"; - -export = class ManyFieldValidationPlan implements IProfileValidationPlan { - - public get tasks(): IProfileValidationTask[] { - return [ - { - description: "Tea should be earl_grey", - name: "Tea color", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - let result: IProfileValidationTaskResult; - if (profile.tea == null || profile.tea !== "earl_grey") { - result = { - outcome: "Failed", - resultDescription: "Tea was not earl_grey" - }; - } else { - result = { - outcome: "OK", - resultDescription: "Tea was earl_grey" - }; - } - done(result); - } - } - ]; - } - - public get failureSuggestions(): string { - return "Get earl grey tea"; - } -}; diff --git a/packages/imperative/__tests__/src/packages/cmd/profileHandlers/AddTwoNumbersHandler.ts b/packages/imperative/__tests__/src/packages/cmd/profileHandlers/AddTwoNumbersHandler.ts deleted file mode 100644 index 117d409014..0000000000 --- a/packages/imperative/__tests__/src/packages/cmd/profileHandlers/AddTwoNumbersHandler.ts +++ /dev/null @@ -1,20 +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. -* -*/ - -import { ICommandHandler, IHandlerParameters } from "../../../../../src/cmd"; - -export default class AddTwoNumbersHandler implements ICommandHandler { - public async process(params: IHandlerParameters): Promise { - const sum = params.arguments.a + params.arguments.b; - params.response.console.log("updated sum to: " + sum); - params.response.data.setObj({sum}); - } -} diff --git a/packages/imperative/src/cmd/__tests__/CommandProcessor.unit.test.ts b/packages/imperative/src/cmd/__tests__/CommandProcessor.unit.test.ts index a333af0ebf..76d56a8b4f 100644 --- a/packages/imperative/src/cmd/__tests__/CommandProcessor.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/CommandProcessor.unit.test.ts @@ -1513,7 +1513,7 @@ describe("Command Processor", () => { }); // return the "fake" args object with values from profile - CliUtils.getOptValuesFromConfig = jest.fn().mockReturnValue({}); + jest.spyOn(CliUtils, "getOptValuesFromConfig").mockReturnValueOnce({}); const parms: any = { arguments: { @@ -1712,7 +1712,7 @@ describe("Command Processor", () => { }); // return the "fake" args object with values from profile - CliUtils.getOptValuesFromConfig = jest.fn().mockReturnValue({ color: "yellow" }); + const getOptValuesSpy = jest.spyOn(CliUtils, "getOptValuesFromConfig").mockReturnValueOnce({ color: "yellow" }); const parms: any = { arguments: { @@ -1724,7 +1724,7 @@ describe("Command Processor", () => { }; const commandResponse: ICommandResponse = await processor.invoke(parms); - expect(CliUtils.getOptValuesFromConfig).toHaveBeenCalledTimes(1); + expect(getOptValuesSpy).toHaveBeenCalledTimes(1); expect(commandResponse.stdout.toString()).toMatchSnapshot(); expect(commandResponse).toBeDefined(); expect(commandResponse).toMatchSnapshot(); @@ -1747,7 +1747,7 @@ describe("Command Processor", () => { }); // return the "fake" args object with values from profile - CliUtils.getOptValuesFromConfig = jest.fn().mockReturnValue({}); + jest.spyOn(CliUtils, "getOptValuesFromConfig").mockReturnValueOnce({}); const parms: any = { arguments: { @@ -1782,7 +1782,7 @@ describe("Command Processor", () => { }); // return the "fake" args object with values from profile - CliUtils.getOptValuesFromConfig = jest.fn().mockReturnValue({ color: "yellow" }); + const getOptValuesSpy = jest.spyOn(CliUtils, "getOptValuesFromConfig").mockReturnValueOnce({ color: "yellow" }); const parms: any = { arguments: { @@ -1794,7 +1794,7 @@ describe("Command Processor", () => { }; const commandResponse: ICommandResponse = await processor.invoke(parms); - expect(CliUtils.getOptValuesFromConfig).toHaveBeenCalledTimes(1); + expect(getOptValuesSpy).toHaveBeenCalledTimes(1); expect(commandResponse.stdout.toString()).toMatchSnapshot(); expect(commandResponse).toBeDefined(); expect(commandResponse).toMatchSnapshot(); @@ -1818,7 +1818,7 @@ describe("Command Processor", () => { }); // return the "fake" args object with values from profile - CliUtils.getOptValuesFromConfig = jest.fn().mockReturnValue({ color: "yellow" }); + const getOptValuesSpy = jest.spyOn(CliUtils, "getOptValuesFromConfig").mockReturnValueOnce({ color: "yellow" }); const parms: any = { arguments: { @@ -1831,7 +1831,7 @@ describe("Command Processor", () => { }; const commandResponse: ICommandResponse = await processor.invoke(parms); - expect(CliUtils.getOptValuesFromConfig).toHaveBeenCalledTimes(1); + expect(getOptValuesSpy).toHaveBeenCalledTimes(1); expect(commandResponse.stdout.toString()).toMatchSnapshot(); expect(commandResponse).toBeDefined(); expect(commandResponse).toMatchSnapshot(); @@ -1855,7 +1855,7 @@ describe("Command Processor", () => { }); // return the "fake" args object with values from profile - CliUtils.getOptValuesFromConfig = jest.fn().mockReturnValue({ color: "yellow" }); + const getOptValuesSpy = jest.spyOn(CliUtils, "getOptValuesFromConfig").mockReturnValueOnce({ color: "yellow" }); const parms: any = { arguments: { @@ -1868,7 +1868,7 @@ describe("Command Processor", () => { }; const commandResponse: ICommandResponse = await processor.invoke(parms); - expect(CliUtils.getOptValuesFromConfig).toHaveBeenCalledTimes(1); + expect(getOptValuesSpy).toHaveBeenCalledTimes(1); expect(commandResponse.stdout.toString()).toMatchSnapshot(); expect(commandResponse).toBeDefined(); expect(commandResponse).toMatchSnapshot(); diff --git a/packages/imperative/src/imperative/src/api/ImperativeApi.ts b/packages/imperative/src/imperative/src/api/ImperativeApi.ts index 3fb75a82d9..8350358884 100644 --- a/packages/imperative/src/imperative/src/api/ImperativeApi.ts +++ b/packages/imperative/src/imperative/src/api/ImperativeApi.ts @@ -12,6 +12,7 @@ import { IImperativeConfig } from "../doc/IImperativeConfig"; import { IImperativeApi } from "./doc/IImperativeApi"; import { Logger } from "../../../logger"; +import { CliProfileManager } from "../../../cmd"; export class ImperativeApi { /** @@ -62,4 +63,19 @@ export class ImperativeApi { public addAdditionalLogger(name: string, logger: Logger): void { this.mCustomLoggerMap[name] = logger; } + + /** + * Return an instance of a profile manager for a given profile type + * See ProfileManager.ts for more details + * @internal + * @deprecated Use the `V1ProfileRead` class if you still need to read V1 profiles + */ + public profileManager(type: string): CliProfileManager { + return new CliProfileManager({ + type, + typeConfigurations: this.mConfig.profiles, + logger: this.imperativeLogger, + productDisplayName: this.mConfig.productDisplayName + }); + } } diff --git a/packages/imperative/src/profiles/src/doc/config/IProfileTypeConfiguration.ts b/packages/imperative/src/profiles/src/doc/config/IProfileTypeConfiguration.ts index af454d6ee4..94d389de23 100644 --- a/packages/imperative/src/profiles/src/doc/config/IProfileTypeConfiguration.ts +++ b/packages/imperative/src/profiles/src/doc/config/IProfileTypeConfiguration.ts @@ -46,6 +46,7 @@ export interface IProfileTypeConfiguration { * * @type {IProfileDependency[]} * @memberof IProfileTypeConfiguration + * @deprecated */ dependencies?: IProfileDependency[]; /** diff --git a/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts b/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts index 39dd1caa19..7d6dd08166 100644 --- a/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts +++ b/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts @@ -29,6 +29,7 @@ import { CliUtils } from "../../../../utilities/src/CliUtils"; * API for going through the full validation test for a Zowe CLI profile * and producing validation report * @internal + * @deprecated */ export class ProfileValidator { From c37e3b01b8b88872623e89cf005937766ac8b71d Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 22 Aug 2024 15:53:56 -0400 Subject: [PATCH 12/34] Fix lint errors Signed-off-by: Timothy Johnson --- .../__integration__/HelpCommands.integration.test.ts | 1 - packages/imperative/src/cmd/src/profiles/CliProfileManager.ts | 3 +++ packages/imperative/src/imperative/src/api/ImperativeApi.ts | 2 ++ .../src/validation/__tests__/ProfileValidation.unit.test.ts | 1 + .../src/profiles/src/validation/api/ProfileValidator.ts | 2 +- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/HelpCommands.integration.test.ts b/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/HelpCommands.integration.test.ts index d062798e23..bc9bd15454 100644 --- a/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/HelpCommands.integration.test.ts +++ b/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/HelpCommands.integration.test.ts @@ -9,7 +9,6 @@ * */ -import * as fs from "fs"; import * as T from "../../../TestUtil"; import { IImperativeConfig } from "../../../../../src/imperative/index"; diff --git a/packages/imperative/src/cmd/src/profiles/CliProfileManager.ts b/packages/imperative/src/cmd/src/profiles/CliProfileManager.ts index 0989f2435c..82c97f0c94 100644 --- a/packages/imperative/src/cmd/src/profiles/CliProfileManager.ts +++ b/packages/imperative/src/cmd/src/profiles/CliProfileManager.ts @@ -177,10 +177,13 @@ export class CliProfileManager { ImperativeExpect.keysToBeDefined(typeConfiguration, ["schema"], `The profile type configuration document for ` + `"${typeConfiguration.type}" does NOT contain a schema.`); this.validateSchema(typeConfiguration.schema, typeConfiguration.type); + // eslint-disable-next-line deprecation/deprecation if (!(typeConfiguration.dependencies == null)) { + // eslint-disable-next-line deprecation/deprecation ImperativeExpect.toBeAnArray(typeConfiguration.dependencies, `The profile type configuration for "${typeConfiguration.type}" contains a "dependencies" property, ` + `but it is not an array (ill-formed)`); + // eslint-disable-next-line deprecation/deprecation for (const dep of typeConfiguration.dependencies) { ImperativeExpect.keysToBeDefinedAndNonBlank(dep, ["type"], "A dependency specified for the " + "profile definitions did not contain a type."); diff --git a/packages/imperative/src/imperative/src/api/ImperativeApi.ts b/packages/imperative/src/imperative/src/api/ImperativeApi.ts index 8350358884..3f9e3b49a4 100644 --- a/packages/imperative/src/imperative/src/api/ImperativeApi.ts +++ b/packages/imperative/src/imperative/src/api/ImperativeApi.ts @@ -70,7 +70,9 @@ export class ImperativeApi { * @internal * @deprecated Use the `V1ProfileRead` class if you still need to read V1 profiles */ + // eslint-disable-next-line deprecation/deprecation public profileManager(type: string): CliProfileManager { + // eslint-disable-next-line deprecation/deprecation return new CliProfileManager({ type, typeConfigurations: this.mConfig.profiles, diff --git a/packages/imperative/src/profiles/src/validation/__tests__/ProfileValidation.unit.test.ts b/packages/imperative/src/profiles/src/validation/__tests__/ProfileValidation.unit.test.ts index 8b74413713..f5744c9a65 100644 --- a/packages/imperative/src/profiles/src/validation/__tests__/ProfileValidation.unit.test.ts +++ b/packages/imperative/src/profiles/src/validation/__tests__/ProfileValidation.unit.test.ts @@ -8,6 +8,7 @@ * Copyright Contributors to the Zowe Project. * */ +/* eslint-disable deprecation/deprecation */ import { inspect } from "util"; import { TestLogger } from "../../../../../__tests__/src/TestLogger"; diff --git a/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts b/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts index 7d6dd08166..d363596ac7 100644 --- a/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts +++ b/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts @@ -29,7 +29,7 @@ import { CliUtils } from "../../../../utilities/src/CliUtils"; * API for going through the full validation test for a Zowe CLI profile * and producing validation report * @internal - * @deprecated + * @deprecated Use the `V1ProfileRead` class if you still need to read V1 profiles */ export class ProfileValidator { From cad2e864ef9a7914adb73392546ef566884dc963 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 22 Aug 2024 17:49:09 -0400 Subject: [PATCH 13/34] Restore help commands test to old location Signed-off-by: Timothy Johnson --- packages/imperative/__tests__/src/TestUtil.ts | 15 ++++++++----- .../HelpCommands.integration.test.ts | 22 +++++++------------ 2 files changed, 17 insertions(+), 20 deletions(-) rename packages/imperative/__tests__/src/{example_clis/with_bin_package => packages/cmd}/__integration__/HelpCommands.integration.test.ts (72%) diff --git a/packages/imperative/__tests__/src/TestUtil.ts b/packages/imperative/__tests__/src/TestUtil.ts index 1bb7373060..1f2693f558 100644 --- a/packages/imperative/__tests__/src/TestUtil.ts +++ b/packages/imperative/__tests__/src/TestUtil.ts @@ -170,13 +170,16 @@ export function executeTestCLICommand(cliBinModule: string, testContext: any, ar execDir?: string, pipeContent?: string | Buffer, env: { [key: string]: string } = process.env): SpawnSyncReturns { const testLogger = TestLogger.getTestLogger(); - const isLocalFile = fs.existsSync(cliBinModule); + const isLocalFile = fs.existsSync(cliBinModule) && fs.statSync(cliBinModule).isFile(); const nodeCommand = isLocalFile ? "node" : "npx"; - // run the command with ts-node/register - const starterArguments = isLocalFile ? ["--require", "ts-node/register", cliBinModule] : [cliBinModule]; - args = starterArguments.concat(args); - if (!isLocalFile) { - execDir ??= nodePath.dirname(expect.getState().testPath); + if (isLocalFile) { + // run the command with ts-node/register if local file specified + const starterArguments = ["--require", "ts-node/register", cliBinModule]; + args = starterArguments.concat(args); + } else { + // run the command with package bin script if directory specified + args.unshift(Object.keys(require(cliBinModule + "/package.json").bin).pop()); + execDir ??= cliBinModule; } const commandExecutionMessage = "Executing " + nodeCommand + " " + args.join(" "); diff --git a/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/HelpCommands.integration.test.ts b/packages/imperative/__tests__/src/packages/cmd/__integration__/HelpCommands.integration.test.ts similarity index 72% rename from packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/HelpCommands.integration.test.ts rename to packages/imperative/__tests__/src/packages/cmd/__integration__/HelpCommands.integration.test.ts index bc9bd15454..4ea5996a96 100644 --- a/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/HelpCommands.integration.test.ts +++ b/packages/imperative/__tests__/src/packages/cmd/__integration__/HelpCommands.integration.test.ts @@ -13,9 +13,9 @@ import * as T from "../../../TestUtil"; import { IImperativeConfig } from "../../../../../src/imperative/index"; describe("Imperative help should be available for a range of definitions", function () { - const cliWithBin = Object.keys(require(__dirname + "/../package.json").bin)[0]; - const cliWithoutBin = __dirname + "/../../with_profiles/ProfileExampleCLI.ts"; - const config: IImperativeConfig = require(__dirname + "/../ProfileBinExampleConfiguration"); + const cliWithBin = __dirname + "/../../../example_clis/with_bin_package"; + const cliWithoutBin = __dirname + "/../../../example_clis/with_profiles/ProfileExampleCLI.ts"; + const config: IImperativeConfig = require(__dirname + "/../../../example_clis/with_bin_package/ProfileBinExampleConfiguration"); /** * Clean up the home directory before and after each test. */ @@ -26,22 +26,16 @@ describe("Imperative help should be available for a range of definitions", funct T.rimraf(T.TEST_HOME); }); - it("We should be able to get --help for our example CLI - without bin script", function () { + it("We should be able to get --help for our example CLI - no bin specified in package", function () { T.findExpectedOutputInCommand(cliWithoutBin, ["--help"], [config.productDisplayName, "log"], "stdout", true, - this, T.CMD_TYPE.INTERACTIVE, undefined, undefined, { - IMPERATIVE_CALLER_LOCATION: T.TEST_HOME - }); + this, T.CMD_TYPE.INTERACTIVE); T.findExpectedOutputInCommand(cliWithoutBin, ["log", "--help"], ["ProfileExampleCLI.ts", "Log example messages", "messages"], "stdout", true, - this, T.CMD_TYPE.INTERACTIVE, undefined, undefined, { - IMPERATIVE_CALLER_LOCATION: T.TEST_HOME - }); + this, T.CMD_TYPE.INTERACTIVE); T.findExpectedOutputInCommand(cliWithoutBin, ["log", "messages", "--help"], ["ProfileExampleCLI.ts", "Log example messages", "messages", "level"], "stdout", true, - this, T.CMD_TYPE.INTERACTIVE, undefined, undefined, { - IMPERATIVE_CALLER_LOCATION: T.TEST_HOME - }); + this, T.CMD_TYPE.INTERACTIVE); }); it("should display --version in the root help", function () { @@ -50,7 +44,7 @@ describe("Imperative help should be available for a range of definitions", funct this, T.CMD_TYPE.INTERACTIVE); }); - it("We should be able to get --help for our example CLI - with bin script", function () { + it("We should be able to get --help for our example CLI - with bin in package", function () { T.findExpectedOutputInCommand(cliWithBin, ["--help"], [config.productDisplayName, "ape", "bat", "cat"], "stdout", true, this, T.CMD_TYPE.INTERACTIVE); From 96723b654fef6d5e5dc9a39452b87a0582079816 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 22 Aug 2024 18:49:26 -0400 Subject: [PATCH 14/34] Add prompting unit tests and deprecate more V1 stuff Signed-off-by: Timothy Johnson --- .../__tests__/CommandProcessor.unit.test.ts | 215 ++++++++++-------- .../doc/config/IProfileTypeConfiguration.ts | 3 +- 2 files changed, 117 insertions(+), 101 deletions(-) diff --git a/packages/imperative/src/cmd/__tests__/CommandProcessor.unit.test.ts b/packages/imperative/src/cmd/__tests__/CommandProcessor.unit.test.ts index 76d56a8b4f..b48f3c2d23 100644 --- a/packages/imperative/src/cmd/__tests__/CommandProcessor.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/CommandProcessor.unit.test.ts @@ -192,6 +192,11 @@ const FAKE_HELP_GENERATOR: IHelpGenerator = { const ENV_VAR_PREFIX: string = "UNIT_TEST"; describe("Command Processor", () => { + beforeEach(() => { + // Mock read stdin + jest.spyOn(SharedOptions, "readStdinIfRequested").mockResolvedValueOnce(false); + }); + // Restore everything after each test afterEach(() => { process.stdout.write = ORIGINAL_STDOUT_WRITE; @@ -800,11 +805,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -845,11 +845,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -887,11 +882,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -938,11 +928,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -971,11 +956,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1012,11 +992,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1053,11 +1028,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1094,11 +1064,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1138,11 +1103,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1177,11 +1137,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1209,11 +1164,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - const parms: any = { arguments: { _: ["check", "for", "banana"], @@ -1596,11 +1546,6 @@ describe("Command Processor", () => { } }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - jest.spyOn(process, "chdir"); const mockConfigReload = jest.fn(); jest.spyOn(ImperativeConfig, "instance", "get").mockReturnValue({ @@ -1653,11 +1598,6 @@ describe("Command Processor", () => { } }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - jest.spyOn(process, "chdir"); const mockConfigReload = jest.fn(); jest.spyOn(ImperativeConfig, "instance", "get").mockReturnValue({ @@ -1706,11 +1646,6 @@ describe("Command Processor", () => { config: ImperativeConfig.instance.config }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - // return the "fake" args object with values from profile const getOptValuesSpy = jest.spyOn(CliUtils, "getOptValuesFromConfig").mockReturnValueOnce({ color: "yellow" }); @@ -1741,11 +1676,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - // return the "fake" args object with values from profile jest.spyOn(CliUtils, "getOptValuesFromConfig").mockReturnValueOnce({}); @@ -1776,11 +1706,6 @@ describe("Command Processor", () => { config: ImperativeConfig.instance.config }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - // return the "fake" args object with values from profile const getOptValuesSpy = jest.spyOn(CliUtils, "getOptValuesFromConfig").mockReturnValueOnce({ color: "yellow" }); @@ -1812,11 +1737,6 @@ describe("Command Processor", () => { config: ImperativeConfig.instance.config }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - // return the "fake" args object with values from profile const getOptValuesSpy = jest.spyOn(CliUtils, "getOptValuesFromConfig").mockReturnValueOnce({ color: "yellow" }); @@ -1849,11 +1769,6 @@ describe("Command Processor", () => { config: ImperativeConfig.instance.config }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - // return the "fake" args object with values from profile const getOptValuesSpy = jest.spyOn(CliUtils, "getOptValuesFromConfig").mockReturnValueOnce({ color: "yellow" }); @@ -1923,11 +1838,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - const parms: any = { arguments: { _: [], @@ -1958,11 +1868,6 @@ describe("Command Processor", () => { promptPhrase: "dummydummy" }); - // Mock read stdin - (SharedOptions.readStdinIfRequested as any) = jest.fn((args, response, type) => { - // Nothing to do - }); - const parms: any = { arguments: { _: [], @@ -2176,4 +2081,114 @@ describe("Command Processor", () => { expect(preparedArgs.color).toBe("green"); }); }); + + describe("prompting", () => { + const invokeParms: any = { + arguments: { + _: ["check", "for", "banana"], + $0: "", + valid: true + }, + silent: true + }; + function buildProcessor(definition: ICommandDefinition): CommandProcessor { + return new CommandProcessor({ + envVariablePrefix: ENV_VAR_PREFIX, + fullDefinition: SAMPLE_CMD_WITH_OPTS_AND_PROF, + definition, + helpGenerator: FAKE_HELP_GENERATOR, + rootCommandName: SAMPLE_ROOT_COMMAND, + commandLine: "", + promptPhrase: "please" + }); + } + + it("should prompt for missing positional with string type", async () => { + // Allocate the command processor + const processor = buildProcessor(SAMPLE_COMMAND_REAL_HANDLER_WITH_POS_OPT); + + const promptMock = jest.fn().mockResolvedValue("yellow"); + jest.spyOn(CommandResponse.prototype, "console", "get").mockReturnValueOnce({ + prompt: promptMock + } as any); + + invokeParms.arguments.color = "please"; + const commandResponse: ICommandResponse = await processor.invoke(invokeParms); + expect(commandResponse).toBeDefined(); + expect(promptMock).toHaveBeenCalledTimes(1); + expect(promptMock.mock.calls[0][0]).toContain(`Please enter "color"`); + expect(invokeParms.arguments.color).toBe("yellow"); + }); + + it("should prompt for missing positional with array type", async () => { + // Allocate the command processor + const processor = buildProcessor({ + ...SAMPLE_COMMAND_REAL_HANDLER_WITH_POS_OPT, + positionals: [ + { + name: "color", + type: "array", + description: "The banana colors.", + required: true + } + ], + }); + + const promptMock = jest.fn().mockResolvedValue("yellow brown"); + jest.spyOn(CommandResponse.prototype, "console", "get").mockReturnValueOnce({ + prompt: promptMock + } as any); + + invokeParms.arguments.color = ["please"]; + const commandResponse: ICommandResponse = await processor.invoke(invokeParms); + expect(commandResponse).toBeDefined(); + expect(promptMock).toHaveBeenCalledTimes(1); + expect(promptMock.mock.calls[0][0]).toContain(`Please enter "color"`); + expect(invokeParms.arguments.color).toEqual(["yellow", "brown"]); + }); + + it("should prompt for missing option with string type", async () => { + // Allocate the command processor + const processor = buildProcessor(SAMPLE_COMMAND_REAL_HANDLER_WITH_OPT); + + const promptMock = jest.fn().mockResolvedValue("yellow"); + jest.spyOn(CommandResponse.prototype, "console", "get").mockReturnValueOnce({ + prompt: promptMock + } as any); + + invokeParms.arguments.color = "please"; + const commandResponse: ICommandResponse = await processor.invoke(invokeParms); + expect(commandResponse).toBeDefined(); + expect(promptMock).toHaveBeenCalledTimes(1); + expect(promptMock.mock.calls[0][0]).toContain(`Please enter "color"`); + expect(invokeParms.arguments.color).toBe("yellow"); + }); + + it("should prompt for missing option with array type", async () => { + // Allocate the command processor + const processor = buildProcessor({ + ...SAMPLE_COMMAND_REAL_HANDLER_WITH_OPT, + options: [ + { + name: "color", + type: "array", + description: "The banana colors.", + required: true + } + ], + }); + + const promptMock = jest.fn().mockResolvedValue("yellow brown"); + jest.spyOn(CommandResponse.prototype, "console", "get").mockReturnValueOnce({ + prompt: promptMock + } as any); + + invokeParms.arguments.color = ["please"]; + const commandResponse: ICommandResponse = await processor.invoke(invokeParms); + expect(commandResponse).toBeDefined(); + expect(promptMock).toHaveBeenCalledTimes(1); + expect(promptMock.mock.calls[0][0]).toContain(`Please enter "color"`); + expect(invokeParms.arguments.color).toEqual(["yellow", "brown"]); + }); + }); }); diff --git a/packages/imperative/src/profiles/src/doc/config/IProfileTypeConfiguration.ts b/packages/imperative/src/profiles/src/doc/config/IProfileTypeConfiguration.ts index 94d389de23..a4777ba354 100644 --- a/packages/imperative/src/profiles/src/doc/config/IProfileTypeConfiguration.ts +++ b/packages/imperative/src/profiles/src/doc/config/IProfileTypeConfiguration.ts @@ -46,7 +46,7 @@ export interface IProfileTypeConfiguration { * * @type {IProfileDependency[]} * @memberof IProfileTypeConfiguration - * @deprecated + * @deprecated Only applies to V1 profiles. For team config, use nested profiles instead. */ dependencies?: IProfileDependency[]; /** @@ -56,6 +56,7 @@ export interface IProfileTypeConfiguration { * * @type {string} * @memberof IProfileTypeConfiguration + * @deprecated Only applies to V1 profiles. For team config, validate with JSON schema instead. */ validationPlanModule?: string; } From 48fa3dacbdb3d77ce8c0670534617bbb15a6ccc5 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Fri, 23 Aug 2024 08:09:18 -0400 Subject: [PATCH 15/34] Fix code smells and update changelog Signed-off-by: Timothy Johnson --- .../__packages__/cli-test-utils/CHANGELOG.md | 4 + packages/imperative/CHANGELOG.md | 11 +++ .../ExampleDefinitions.integration.test.ts | 2 - .../src/cmd/src/CommandProcessor.ts | 76 +++++++++---------- .../__tests__/ProfileValidation.unit.test.ts | 1 + .../utilities/__tests__/CliUtils.unit.test.ts | 9 +++ .../imperative/src/utilities/src/CliUtils.ts | 15 ++-- 7 files changed, 67 insertions(+), 51 deletions(-) diff --git a/__tests__/__packages__/cli-test-utils/CHANGELOG.md b/__tests__/__packages__/cli-test-utils/CHANGELOG.md index 552e7898f5..d50a15e407 100644 --- a/__tests__/__packages__/cli-test-utils/CHANGELOG.md +++ b/__tests__/__packages__/cli-test-utils/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Zowe CLI test utils package will be documented in this file. +## Recent Changes + +- BugFix: Removed obsolete V1 `profiles` property from the parameters object returned by `mockHandlerParameters` method. + ## `8.0.0-next.202408131445` - Update: See `7.28.3` for details diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 4d862a2abc..58e7ead1da 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to the Imperative package will be documented in this file. +## Recent Changes + +- LTS Breaking: [#2231](https://github.com/zowe/zowe-cli/issues/2231) + - Removed the obsolete V1 `profiles` property from `IHandlerParameters` interface + - Deprecated the following obsolete V1 profile interfaces: + - `IProfileTypeConfiguration.dependencies` - For team config, use nested profiles instead + - `IProfileTypeConfiguration.validationPlanModule` - For team config, validate with JSON schema instead + - Deprecated the following obsolete V1 profile classes/functions: + - `CliUtils.getOptValueFromProfiles` - Use `getOptValuesFromConfig` instead to load from team config + - `CommandProfiles` - Use the `V1ProfileRead` class if you still need to read V1 profiles + ## `8.0.0-next.202408191401` - Update: See `5.26.3` and `5.27.0` for details diff --git a/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/ExampleDefinitions.integration.test.ts b/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/ExampleDefinitions.integration.test.ts index 3b651f9a24..98a734a3aa 100644 --- a/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/ExampleDefinitions.integration.test.ts +++ b/packages/imperative/__tests__/src/example_clis/with_bin_package/__integration__/ExampleDefinitions.integration.test.ts @@ -9,14 +9,12 @@ * */ -import { IImperativeConfig } from "../../../../../src/imperative"; import * as T from "../../../TestUtil"; describe("We should provide the ability to define commands through Javascript objects passed through the config " + "or globs that match modules locally, " + "tested through an example CLI", function () { const cliBin = __dirname + "/../ProfileBinExampleCLI.ts"; - const config: IImperativeConfig = require(__dirname + "/../ProfileBinExampleConfiguration"); it("All commands defined through module globs should be accurately defined, " + "and a definition module in the same directory that does not ", diff --git a/packages/imperative/src/cmd/src/CommandProcessor.ts b/packages/imperative/src/cmd/src/CommandProcessor.ts index bdb78ee99d..5ff82ff5eb 100644 --- a/packages/imperative/src/cmd/src/CommandProcessor.ts +++ b/packages/imperative/src/cmd/src/CommandProcessor.ts @@ -497,24 +497,22 @@ export class CommandProcessor { { hideText: true, secToWait: 0 }); } // array processing - else { - if (preparedArgs[positionalName] != null && - Array.isArray(preparedArgs[positionalName]) && - preparedArgs[positionalName][0] != null && - typeof preparedArgs[positionalName][0] === "string" && - preparedArgs[positionalName][0].toUpperCase() === this.promptPhrase.toUpperCase()) { - // prompt has been requested for a positional - this.log.debug("Prompting for positional %s which was requested by passing the value %s", - preparedArgs[positionalName][0], this.promptPhrase); - preparedArgs[positionalName][0] = - await response.console.prompt(`"${positionalName}" Description: ` + - `${positional.description}\nPlease enter "${positionalName}":`, - { hideText: true, secToWait: 0 }); - // prompting enters as string but need to place it in array - - const array = preparedArgs[positionalName][0].split(" "); - preparedArgs[positionalName] = array; - } + else if (preparedArgs[positionalName] != null && + Array.isArray(preparedArgs[positionalName]) && + preparedArgs[positionalName][0] != null && + typeof preparedArgs[positionalName][0] === "string" && + preparedArgs[positionalName][0].toUpperCase() === this.promptPhrase.toUpperCase()) { + // prompt has been requested for a positional + this.log.debug("Prompting for positional %s which was requested by passing the value %s", + preparedArgs[positionalName][0], this.promptPhrase); + preparedArgs[positionalName][0] = + await response.console.prompt(`"${positionalName}" Description: ` + + `${positional.description}\nPlease enter "${positionalName}":`, + { hideText: true, secToWait: 0 }); + // prompting enters as string but need to place it in array + + const array = preparedArgs[positionalName][0].split(" "); + preparedArgs[positionalName] = array; } } } @@ -544,28 +542,26 @@ export class CommandProcessor { } } // array processing - else { - if (Array.isArray(preparedArgs[option.name]) && - preparedArgs[option.name][0] != null && - typeof preparedArgs[option.name][0] === "string" && - preparedArgs[option.name][0].toUpperCase() === this.promptPhrase.toUpperCase()) { - // prompt has been requested for an --option - this.log.debug("Prompting for option %s which was requested by passing the value %s", - option.name, this.promptPhrase); - preparedArgs[option.name][0] = - await response.console.prompt(`"${option.name}" Description: ` + - `${option.description}\nPlease enter "${option.name}":`, - { hideText: true, secToWait: 0 }); - - const array = preparedArgs[option.name][0].split(" "); - preparedArgs[option.name] = array; - const camelCase = CliUtils.getOptionFormat(option.name).camelCase; - preparedArgs[camelCase] = preparedArgs[option.name]; - if (option.aliases != null) { - for (const alias of option.aliases) { - // set each alias of the args object as well - preparedArgs[alias] = preparedArgs[option.name]; - } + else if (Array.isArray(preparedArgs[option.name]) && + preparedArgs[option.name][0] != null && + typeof preparedArgs[option.name][0] === "string" && + preparedArgs[option.name][0].toUpperCase() === this.promptPhrase.toUpperCase()) { + // prompt has been requested for an --option + this.log.debug("Prompting for option %s which was requested by passing the value %s", + option.name, this.promptPhrase); + preparedArgs[option.name][0] = + await response.console.prompt(`"${option.name}" Description: ` + + `${option.description}\nPlease enter "${option.name}":`, + { hideText: true, secToWait: 0 }); + + const array = preparedArgs[option.name][0].split(" "); + preparedArgs[option.name] = array; + const camelCase = CliUtils.getOptionFormat(option.name).camelCase; + preparedArgs[camelCase] = preparedArgs[option.name]; + if (option.aliases != null) { + for (const alias of option.aliases) { + // set each alias of the args object as well + preparedArgs[alias] = preparedArgs[option.name]; } } } diff --git a/packages/imperative/src/profiles/src/validation/__tests__/ProfileValidation.unit.test.ts b/packages/imperative/src/profiles/src/validation/__tests__/ProfileValidation.unit.test.ts index f5744c9a65..a36defb065 100644 --- a/packages/imperative/src/profiles/src/validation/__tests__/ProfileValidation.unit.test.ts +++ b/packages/imperative/src/profiles/src/validation/__tests__/ProfileValidation.unit.test.ts @@ -8,6 +8,7 @@ * Copyright Contributors to the Zowe Project. * */ + /* eslint-disable deprecation/deprecation */ import { inspect } from "util"; diff --git a/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts b/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts index b53c83c35c..cf92150b13 100644 --- a/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts +++ b/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts @@ -293,6 +293,7 @@ describe("CliUtils", () => { it("should throw an imperative error if a required profile is not present", () => { let error; try { + // eslint-disable-next-line deprecation/deprecation const args = CliUtils.getOptValueFromProfiles( // eslint-disable-next-line deprecation/deprecation new CommandProfiles(new Map()), @@ -307,6 +308,7 @@ describe("CliUtils", () => { }); it("should return nothing if a profile was optional and not loaded", () => { + // eslint-disable-next-line deprecation/deprecation const args = CliUtils.getOptValueFromProfiles( // eslint-disable-next-line deprecation/deprecation new CommandProfiles(new Map()), @@ -318,6 +320,7 @@ describe("CliUtils", () => { it("should return args (from definitions with no hyphen in name) extracted from loaded profile", () => { const map = new Map(); map.set("banana", [{ type: "banana", name: "fakebanana", nohyphen: "specified in profile" }]); + // eslint-disable-next-line deprecation/deprecation const args = CliUtils.getOptValueFromProfiles( // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), @@ -334,6 +337,7 @@ describe("CliUtils", () => { "couldBeEither": "should be me", "could-be-either": "should not be me" }]); + // eslint-disable-next-line deprecation/deprecation const args = CliUtils.getOptValueFromProfiles( // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), @@ -350,6 +354,7 @@ describe("CliUtils", () => { "fakeStringOpt": "should not be me", "fake-string-opt": "should be me" }]); + // eslint-disable-next-line deprecation/deprecation const args = CliUtils.getOptValueFromProfiles( // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), @@ -365,6 +370,7 @@ describe("CliUtils", () => { "name": "fakebanana", "could-be-either": "should be me" }]); + // eslint-disable-next-line deprecation/deprecation const args = CliUtils.getOptValueFromProfiles( // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), @@ -380,6 +386,7 @@ describe("CliUtils", () => { name: "fakebanana", fakeStringOpt: "should be me" }]); + // eslint-disable-next-line deprecation/deprecation const args = CliUtils.getOptValueFromProfiles( // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), @@ -395,6 +402,7 @@ describe("CliUtils", () => { name: "fakebanana", withAlias: "should have 'w' on args object too" }]); + // eslint-disable-next-line deprecation/deprecation const args = CliUtils.getOptValueFromProfiles( // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), @@ -410,6 +418,7 @@ describe("CliUtils", () => { name: "fakebanana", username: "fake" }]); + // eslint-disable-next-line deprecation/deprecation const args = CliUtils.getOptValueFromProfiles( // eslint-disable-next-line deprecation/deprecation new CommandProfiles(map), diff --git a/packages/imperative/src/utilities/src/CliUtils.ts b/packages/imperative/src/utilities/src/CliUtils.ts index 460d025750..115548af5e 100644 --- a/packages/imperative/src/utilities/src/CliUtils.ts +++ b/packages/imperative/src/utilities/src/CliUtils.ts @@ -108,6 +108,8 @@ export class CliUtils { /** * Accepts the full set of loaded profiles and attempts to match the option names supplied with profile keys. * + * @deprecated Use `getOptValuesFromConfig` instead to load from team config + * * @param {Map} profiles - the map of type to loaded profiles. The key is the profile type * and the value is an array of profiles loaded for that type. * @@ -214,7 +216,6 @@ export class CliUtils { } // Build an object that contains all the options loaded from config - const fulfilled: string[] = []; let fromCnfg: any = {}; for (const profileType of allTypes) { const opt = ProfileUtils.getProfileOptionAndAlias(profileType)[0]; @@ -224,16 +225,13 @@ export class CliUtils { const profileTypePrefix = profileType + "_"; let p: any = {}; if (args[opt] != null && config.api.profiles.exists(args[opt])) { - fulfilled.push(profileType); p = config.api.profiles.get(args[opt]); } else if (args[opt] != null && !args[opt].startsWith(profileTypePrefix) && config.api.profiles.exists(profileTypePrefix + args[opt])) { - fulfilled.push(profileType); p = config.api.profiles.get(profileTypePrefix + args[opt]); } else if (args[opt] == null && config.properties.defaults[profileType] != null && config.api.profiles.exists(config.properties.defaults[profileType])) { - fulfilled.push(profileType); p = config.api.profiles.defaultGet(profileType); } fromCnfg = { ...p, ...fromCnfg }; @@ -247,14 +245,13 @@ export class CliUtils { const profileCamel = fromCnfg[cases.camelCase]; if ((profileCamel !== undefined || profileKebab !== undefined) && - (!Object.prototype.hasOwnProperty.call(args, cases.kebabCase) && - !Object.prototype.hasOwnProperty.call(args, cases.camelCase))) { + (!Object.hasOwn(args, cases.kebabCase) && !Object.hasOwn(args, cases.camelCase))) { // If both case properties are present in the profile, use the one that matches // the option name explicitly - const value = profileKebab !== undefined && profileCamel !== undefined ? - opt.name === cases.kebabCase ? profileKebab : profileCamel : - profileKebab !== undefined ? profileKebab : profileCamel; + const shouldUseKebab = profileKebab !== undefined && profileCamel !== undefined ? + opt.name === cases.kebabCase : profileKebab !== undefined; + const value = shouldUseKebab ? profileKebab : profileCamel; const keys = CliUtils.setOptionValue(opt.name, "aliases" in opt ? opt.aliases : [], value From 3b712a1d96b2ea40ac1af4d0ca7f66ebe207b115 Mon Sep 17 00:00:00 2001 From: zowe-robot Date: Fri, 23 Aug 2024 18:32:48 +0000 Subject: [PATCH 16/34] Bump version to 8.0.0-next.202408231832 [ci skip] Signed-off-by: zowe-robot --- .../__packages__/cli-test-utils/package.json | 4 +- lerna.json | 2 +- npm-shrinkwrap.json | 122 +++++++++--------- packages/cli/package.json | 28 ++-- packages/core/package.json | 6 +- packages/imperative/CHANGELOG.md | 2 +- packages/imperative/package.json | 4 +- packages/provisioning/package.json | 8 +- packages/secrets/package.json | 2 +- packages/workflows/package.json | 10 +- packages/zosconsole/package.json | 8 +- packages/zosfiles/package.json | 10 +- packages/zosjobs/package.json | 10 +- packages/zoslogs/package.json | 8 +- packages/zosmf/package.json | 8 +- packages/zostso/package.json | 10 +- packages/zosuss/package.json | 6 +- 17 files changed, 124 insertions(+), 124 deletions(-) diff --git a/__tests__/__packages__/cli-test-utils/package.json b/__tests__/__packages__/cli-test-utils/package.json index 9f1bc5defa..7c59a0b44a 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.202408191401", + "version": "8.0.0-next.202408231832", "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": "^10.0.0", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/imperative": "8.0.0-next.202408231832" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" diff --git a/lerna.json b/lerna.json index 8fd25b0c38..14501554b5 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "command": { "publish": { "ignoreChanges": [ diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 45ea4ee25e..63b8d3d5ca 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.202408191401", + "version": "8.0.0-next.202408231832", "license": "EPL-2.0", "dependencies": { "find-up": "^5.0.0", @@ -63,7 +63,7 @@ "devDependencies": { "@types/js-yaml": "^4.0.9", "@types/uuid": "^10.0.0", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/imperative": "8.0.0-next.202408231832" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" @@ -16350,21 +16350,21 @@ }, "packages/cli": { "name": "@zowe/cli", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "hasInstallScript": true, "license": "EPL-2.0", "dependencies": { - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401", - "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408191401", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832", + "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408231832", "find-process": "1.4.7", "lodash": "4.17.21", "minimatch": "9.0.5", @@ -16377,7 +16377,7 @@ "@types/diff": "^5.0.9", "@types/lodash": "^4.17.6", "@types/tar": "^6.1.11", - "@zowe/cli-test-utils": "8.0.0-next.202408191401", + "@zowe/cli-test-utils": "8.0.0-next.202408231832", "comment-json": "^4.2.3", "strip-ansi": "^6.0.1", "which": "^4.0.0" @@ -16386,7 +16386,7 @@ "node": ">=18.12.0" }, "optionalDependencies": { - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408191401" + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408231832" } }, "packages/cli/node_modules/brace-expansion": { @@ -16433,15 +16433,15 @@ }, "packages/core": { "name": "@zowe/core-for-zowe-sdk", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "license": "EPL-2.0", "dependencies": { "comment-json": "~4.2.3", "string-width": "^4.2.3" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "engines": { "node": ">=18.12.0" @@ -16452,7 +16452,7 @@ }, "packages/imperative": { "name": "@zowe/imperative", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "license": "EPL-2.0", "dependencies": { "@types/yargs": "^17.0.32", @@ -16505,7 +16505,7 @@ "@types/pacote": "^11.1.8", "@types/progress": "^2.0.7", "@types/stack-trace": "^0.0.33", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408191401", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408231832", "concurrently": "^8.0.0", "cowsay": "^1.6.0", "deep-diff": "^1.0.0", @@ -16646,16 +16646,16 @@ }, "packages/provisioning": { "name": "@zowe/provisioning-for-zowe-sdk", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "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.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "engines": { "node": ">=18.12.0" @@ -16667,7 +16667,7 @@ }, "packages/secrets": { "name": "@zowe/secrets-for-zowe-sdk", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "hasInstallScript": true, "license": "EPL-2.0", "devDependencies": { @@ -16680,15 +16680,15 @@ }, "packages/workflows": { "name": "@zowe/zos-workflows-for-zowe-sdk", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408191401" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408231832" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "engines": { "node": ">=18.12.0" @@ -16700,12 +16700,12 @@ }, "packages/zosconsole": { "name": "@zowe/zos-console-for-zowe-sdk", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "engines": { "node": ">=18.12.0" @@ -16717,16 +16717,16 @@ }, "packages/zosfiles": { "name": "@zowe/zos-files-for-zowe-sdk", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "license": "EPL-2.0", "dependencies": { "minimatch": "^9.0.5" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408231832" }, "engines": { "node": ">=18.12.0" @@ -16758,15 +16758,15 @@ }, "packages/zosjobs": { "name": "@zowe/zos-jobs-for-zowe-sdk", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408191401" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408231832" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "engines": { "node": ">=18.12.0" @@ -16778,12 +16778,12 @@ }, "packages/zoslogs": { "name": "@zowe/zos-logs-for-zowe-sdk", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "engines": { "node": ">=18.12.0" @@ -16795,12 +16795,12 @@ }, "packages/zosmf": { "name": "@zowe/zosmf-for-zowe-sdk", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "engines": { "node": ">=18.12.0" @@ -16812,15 +16812,15 @@ }, "packages/zostso": { "name": "@zowe/zos-tso-for-zowe-sdk", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "license": "EPL-2.0", "dependencies": { - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408191401" + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408231832" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "engines": { "node": ">=18.12.0" @@ -16832,15 +16832,15 @@ }, "packages/zosuss": { "name": "@zowe/zos-uss-for-zowe-sdk", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "license": "EPL-2.0", "dependencies": { "ssh2": "^1.15.0" }, "devDependencies": { "@types/ssh2": "^1.11.19", - "@zowe/cli-test-utils": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "engines": { "node": ">=18.12.0" diff --git a/packages/cli/package.json b/packages/cli/package.json index 1ee9e42aa7..2c4e4240f3 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/cli", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "zoweVersion": "v3.0.0-prerelease", "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.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401", - "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408191401", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832", + "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408231832", "find-process": "1.4.7", "lodash": "4.17.21", "minimatch": "9.0.5", @@ -78,13 +78,13 @@ "@types/diff": "^5.0.9", "@types/lodash": "^4.17.6", "@types/tar": "^6.1.11", - "@zowe/cli-test-utils": "8.0.0-next.202408191401", + "@zowe/cli-test-utils": "8.0.0-next.202408231832", "comment-json": "^4.2.3", "strip-ansi": "^6.0.1", "which": "^4.0.0" }, "optionalDependencies": { - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408191401" + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408231832" }, "engines": { "node": ">=18.12.0" diff --git a/packages/core/package.json b/packages/core/package.json index dcf050a434..d426f0d684 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.202408191401", + "version": "8.0.0-next.202408231832", "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.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index fce85b547f..8617d720d6 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Imperative package will be documented in this file. -## Recent Changes +## `8.0.0-next.202408231832` - LTS Breaking: Fixed command parsing error where `string` typed options would be converted into `number`s if the value provided by the user consists only of numeric characters. [#1881](https://github.com/zowe/zowe-cli/issues/1881) - LTS Breaking: Renamed `Proxy` class to `ProxySettings` to avoid name conflict with JS built-in `Proxy` object. [#2230](https://github.com/zowe/zowe-cli/issues/2230) diff --git a/packages/imperative/package.json b/packages/imperative/package.json index fb3a322cde..a24f91f009 100644 --- a/packages/imperative/package.json +++ b/packages/imperative/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/imperative", - "version": "8.0.0-next.202408191401", + "version": "8.0.0-next.202408231832", "description": "framework for building configurable CLIs", "author": "Zowe", "license": "EPL-2.0", @@ -95,7 +95,7 @@ "@types/pacote": "^11.1.8", "@types/progress": "^2.0.7", "@types/stack-trace": "^0.0.33", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408191401", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408231832", "concurrently": "^8.0.0", "cowsay": "^1.6.0", "deep-diff": "^1.0.0", diff --git a/packages/provisioning/package.json b/packages/provisioning/package.json index 028cf4f2bf..1c8b9f7449 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.202408191401", + "version": "8.0.0-next.202408231832", "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.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/secrets/package.json b/packages/secrets/package.json index 824219d649..66cdc9bd08 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.202408191401", + "version": "8.0.0-next.202408231832", "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 029611229f..2557c0a3e2 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.202408191401", + "version": "8.0.0-next.202408231832", "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.202408191401" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408231832" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosconsole/package.json b/packages/zosconsole/package.json index f776488554..6652de33dc 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.202408191401", + "version": "8.0.0-next.202408231832", "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.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosfiles/package.json b/packages/zosfiles/package.json index d8ee838c2c..6faf53bcf2 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.202408191401", + "version": "8.0.0-next.202408231832", "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.5" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408231832" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosjobs/package.json b/packages/zosjobs/package.json index 126ecf21af..07fab4e6f6 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.202408191401", + "version": "8.0.0-next.202408231832", "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.202408191401" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408231832" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zoslogs/package.json b/packages/zoslogs/package.json index 434f949d4b..5146ad5486 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.202408191401", + "version": "8.0.0-next.202408231832", "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.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosmf/package.json b/packages/zosmf/package.json index b090324ac6..a671dc2389 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.202408191401", + "version": "8.0.0-next.202408231832", "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.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zostso/package.json b/packages/zostso/package.json index 96f6eef354..0df807a3d4 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.202408191401", + "version": "8.0.0-next.202408231832", "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.202408191401" + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408231832" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408191401", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosuss/package.json b/packages/zosuss/package.json index de4ac14a34..822242ce56 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.202408191401", + "version": "8.0.0-next.202408231832", "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.202408191401", - "@zowe/imperative": "8.0.0-next.202408191401" + "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/imperative": "8.0.0-next.202408231832" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" From e6f738e2e48e980dc6e8380dbcf03f49a366683b Mon Sep 17 00:00:00 2001 From: zFernand0 <37381190+zFernand0@users.noreply.github.com> Date: Fri, 23 Aug 2024 16:59:31 -0400 Subject: [PATCH 17/34] feat: add secureFieldsWithDetails :yum: Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com> --- .../imperative/src/config/src/ProfileInfo.ts | 55 ++++++++++++++++++- .../src/config/src/api/ConfigSecure.ts | 12 ++++ .../src/config/src/doc/IConfigSecure.ts | 10 ++++ 3 files changed, 75 insertions(+), 2 deletions(-) diff --git a/packages/imperative/src/config/src/ProfileInfo.ts b/packages/imperative/src/config/src/ProfileInfo.ts index 54dcc32713..bca1c0f791 100644 --- a/packages/imperative/src/config/src/ProfileInfo.ts +++ b/packages/imperative/src/config/src/ProfileInfo.ts @@ -16,7 +16,7 @@ import * as lodash from "lodash"; import * as semver from "semver"; // for ProfileInfo structures -import { IProfArgAttrs } from "./doc/IProfArgAttrs"; +import { IProfArgAttrs, IProfDataType } from "./doc/IProfArgAttrs"; import { IProfAttrs } from "./doc/IProfAttrs"; import { IArgTeamConfigLoc, IProfLoc, IProfLocOsLoc, IProfLocOsLocLayer, ProfLocType } from "./doc/IProfLoc"; import { IProfMergeArgOpts } from "./doc/IProfMergeArgOpts"; @@ -50,7 +50,7 @@ import { IProfInfoRemoveKnownPropOpts } from "./doc/IProfInfoRemoveKnownPropOpts import { ConfigUtils } from "./ConfigUtils"; import { ConfigBuilder } from "./ConfigBuilder"; import { IAddProfTypeResult, IExtenderTypeInfo, IExtendersJsonOpts } from "./doc/IExtenderOpts"; -import { IConfigLayer } from ".."; +import { IConfigLayer, ISecureFieldDetails } from ".."; import { Constants } from "../../constants"; /** @@ -1388,6 +1388,57 @@ export class ProfileInfo { return finalSchema; } + // _______________________________________________________________________ + /** + * List of secure properties with more details, like value, location, and type + * + * @param opts The user and global flags that specify one of the four + * config files (aka layers). + * @returns Array of secure property details + */ + public secureFieldsWithDetails(opts?: { user: boolean; global: boolean }): ISecureFieldDetails[] { + const config = this.getTeamConfig(); + const layer = opts ? config.findLayer(opts.user, opts.global) : config.layerActive(); + const fields = config.api.secure.findSecure(layer.properties.profiles, "profiles"); + const vault = config.api.secure.getSecureFieldsForLayer(layer.path); + + const response: ISecureFieldDetails[] = []; + + // Search the vault for each secure field + fields.forEach(fieldPath => { + // Scan the cached contents of the vault + for (const [loc, val] of Object.entries(vault)) { + // Search inside the secure fields for this layer + Object.entries(val).map(([propPath, propValue]) => { + if (propPath === fieldPath) { + response.push({ + path: fieldPath, + name: fieldPath.split(".properties.")[1], + type: this.argDataType(typeof propValue), + value: propValue as IProfDataType, + loc, + }); + } + }); + } + }); + + fields.forEach(fieldPath => { + if (response.find(details => details.path === fieldPath) == null) { + response.push({ + path: fieldPath, + name: fieldPath.split(".properties.")[1], + type: undefined, + value: undefined, + loc: undefined + }); + } + }); + + return response; + } + + // _______________________________________________________________________ /** * Get all of the subprofiles in the configuration. diff --git a/packages/imperative/src/config/src/api/ConfigSecure.ts b/packages/imperative/src/config/src/api/ConfigSecure.ts index 7586cfaab1..8a6178234f 100644 --- a/packages/imperative/src/config/src/api/ConfigSecure.ts +++ b/packages/imperative/src/config/src/api/ConfigSecure.ts @@ -22,6 +22,7 @@ import { CredentialManagerFactory } from "../../../security"; import { ConfigUtils } from "../ConfigUtils"; import { ZoweUserEvents } from "../../../events/src/EventConstants"; import { EventOperator } from "../../../events/src/EventOperator"; +import { IConfigLayer } from "../doc/IConfigLayer"; /** * API Class for manipulating config layers. @@ -242,6 +243,17 @@ export class ConfigSecure extends ConfigApi { return secureProps; } + /** + * Retrieve secure properties for a givne layer path + * + * @param layerPath Path of the layer to get secure properties for + * @returns the secure properties for the given layer + */ + public getSecureFieldsForLayer(layerPath: string): IConfigSecureProperties { + const secureLayer = Object.keys(this.mConfig.mSecure).find(osLocation => osLocation === layerPath); + return secureLayer ? { [secureLayer] : this.mConfig.mSecure[secureLayer] } : null; + } + /** * Retrieve info that can be used to store a profile property securely. * diff --git a/packages/imperative/src/config/src/doc/IConfigSecure.ts b/packages/imperative/src/config/src/doc/IConfigSecure.ts index 283054446e..b66a96b4ca 100644 --- a/packages/imperative/src/config/src/doc/IConfigSecure.ts +++ b/packages/imperative/src/config/src/doc/IConfigSecure.ts @@ -9,6 +9,16 @@ * */ +import { IProfArgValue, IProfDataType } from "./IProfArgAttrs"; + export type IConfigSecureProperties = { [key: string]: any }; export type IConfigSecure = { [path: string]: IConfigSecureProperties }; + +export interface ISecureFieldDetails { + path: string; + name: string; + type: IProfDataType; + value: IProfArgValue; + loc: string; +} \ No newline at end of file From 29607bd928e0d14e224736d4cefb58d74aaf8bd2 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Mon, 26 Aug 2024 08:19:13 -0400 Subject: [PATCH 18/34] Update micromatch dependency Signed-off-by: Timothy Johnson --- npm-shrinkwrap.json | 19 +++++++++++++++++-- packages/cli/CHANGELOG.md | 4 ++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 63b8d3d5ca..306fafbda0 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -8703,6 +8703,20 @@ "dev": true, "license": "ISC" }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-arguments": { "version": "1.0.9", "dev": true, @@ -11354,8 +11368,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "license": "MIT", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 80703facc8..9efe4581e8 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Zowe CLI package will be documented in this file. +## Recent Changes + +- BugFix: Updated `micromatch` dependency for technical currency. [#2242](https://github.com/zowe/zowe-cli/pull/2242) + ## `8.0.0-next.202408131445` - Update: See `7.28.3` for details From 7461902fe909a1b359aa016d299081264b2bbf3b Mon Sep 17 00:00:00 2001 From: zFernand0 <37381190+zFernand0@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:01:13 -0400 Subject: [PATCH 19/34] Use the IProfArgAttrs interface (tentative) :yum: Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com> --- .../imperative/src/config/src/ProfileInfo.ts | 35 +++++++++++-------- .../src/config/src/api/ConfigSecure.ts | 5 ++- .../src/config/src/doc/IConfigSecure.ts | 10 ------ 3 files changed, 23 insertions(+), 27 deletions(-) diff --git a/packages/imperative/src/config/src/ProfileInfo.ts b/packages/imperative/src/config/src/ProfileInfo.ts index bca1c0f791..1afe64e2e1 100644 --- a/packages/imperative/src/config/src/ProfileInfo.ts +++ b/packages/imperative/src/config/src/ProfileInfo.ts @@ -50,7 +50,7 @@ import { IProfInfoRemoveKnownPropOpts } from "./doc/IProfInfoRemoveKnownPropOpts import { ConfigUtils } from "./ConfigUtils"; import { ConfigBuilder } from "./ConfigBuilder"; import { IAddProfTypeResult, IExtenderTypeInfo, IExtendersJsonOpts } from "./doc/IExtenderOpts"; -import { IConfigLayer, ISecureFieldDetails } from ".."; +import { IConfigLayer } from ".."; import { Constants } from "../../constants"; /** @@ -1396,13 +1396,13 @@ export class ProfileInfo { * config files (aka layers). * @returns Array of secure property details */ - public secureFieldsWithDetails(opts?: { user: boolean; global: boolean }): ISecureFieldDetails[] { + public secureFieldsWithDetails(opts?: { user: boolean; global: boolean }): IProfArgAttrs[] { const config = this.getTeamConfig(); const layer = opts ? config.findLayer(opts.user, opts.global) : config.layerActive(); const fields = config.api.secure.findSecure(layer.properties.profiles, "profiles"); const vault = config.api.secure.getSecureFieldsForLayer(layer.path); - const response: ISecureFieldDetails[] = []; + const response: IProfArgAttrs[] = []; // Search the vault for each secure field fields.forEach(fieldPath => { @@ -1412,11 +1412,15 @@ export class ProfileInfo { Object.entries(val).map(([propPath, propValue]) => { if (propPath === fieldPath) { response.push({ - path: fieldPath, - name: fieldPath.split(".properties.")[1], - type: this.argDataType(typeof propValue), - value: propValue as IProfDataType, - loc, + argName: fieldPath.split(".properties.")[1], + // name: , + dataType: this.argDataType(typeof propValue), + argValue: propValue as IProfDataType, + argLoc: { + locType: ProfLocType.TEAM_CONFIG, + osLoc: [loc], + jsonLoc: fieldPath + }, }); } }); @@ -1424,13 +1428,16 @@ export class ProfileInfo { }); fields.forEach(fieldPath => { - if (response.find(details => details.path === fieldPath) == null) { + if (response.find(details => details.argLoc.jsonLoc === fieldPath) == null) { response.push({ - path: fieldPath, - name: fieldPath.split(".properties.")[1], - type: undefined, - value: undefined, - loc: undefined + argName: fieldPath.split(".properties.")[1], + dataType: undefined, + argValue: undefined, + argLoc: { + locType: ProfLocType.TEAM_CONFIG, + osLoc: [], + jsonLoc: fieldPath + } }); } }); diff --git a/packages/imperative/src/config/src/api/ConfigSecure.ts b/packages/imperative/src/config/src/api/ConfigSecure.ts index 8a6178234f..0c67f833aa 100644 --- a/packages/imperative/src/config/src/api/ConfigSecure.ts +++ b/packages/imperative/src/config/src/api/ConfigSecure.ts @@ -22,7 +22,6 @@ import { CredentialManagerFactory } from "../../../security"; import { ConfigUtils } from "../ConfigUtils"; import { ZoweUserEvents } from "../../../events/src/EventConstants"; import { EventOperator } from "../../../events/src/EventOperator"; -import { IConfigLayer } from "../doc/IConfigLayer"; /** * API Class for manipulating config layers. @@ -244,10 +243,10 @@ export class ConfigSecure extends ConfigApi { } /** - * Retrieve secure properties for a givne layer path + * Retrieve secure properties for a given layer path * * @param layerPath Path of the layer to get secure properties for - * @returns the secure properties for the given layer + * @returns the secure properties for the given layer, or null if not found */ public getSecureFieldsForLayer(layerPath: string): IConfigSecureProperties { const secureLayer = Object.keys(this.mConfig.mSecure).find(osLocation => osLocation === layerPath); diff --git a/packages/imperative/src/config/src/doc/IConfigSecure.ts b/packages/imperative/src/config/src/doc/IConfigSecure.ts index b66a96b4ca..283054446e 100644 --- a/packages/imperative/src/config/src/doc/IConfigSecure.ts +++ b/packages/imperative/src/config/src/doc/IConfigSecure.ts @@ -9,16 +9,6 @@ * */ -import { IProfArgValue, IProfDataType } from "./IProfArgAttrs"; - export type IConfigSecureProperties = { [key: string]: any }; export type IConfigSecure = { [path: string]: IConfigSecureProperties }; - -export interface ISecureFieldDetails { - path: string; - name: string; - type: IProfDataType; - value: IProfArgValue; - loc: string; -} \ No newline at end of file From 1b289164d20d598a8fb35bfe8975155660c88889 Mon Sep 17 00:00:00 2001 From: zFernand0 <37381190+zFernand0@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:05:48 -0400 Subject: [PATCH 20/34] update changelog Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com> --- packages/imperative/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index fce85b547f..dad4cf2b1f 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to the Imperative package will be documented in this file. - LTS Breaking: Fixed command parsing error where `string` typed options would be converted into `number`s if the value provided by the user consists only of numeric characters. [#1881](https://github.com/zowe/zowe-cli/issues/1881) - LTS Breaking: Renamed `Proxy` class to `ProxySettings` to avoid name conflict with JS built-in `Proxy` object. [#2230](https://github.com/zowe/zowe-cli/issues/2230) +- Enhancement: Added a new SDK method (`ConfigSecure.getSecureFieldsForLayer`) to allow developers to get vault content in the context of the specified layer. [#2206](https://github.com/zowe/zowe-cli/issues/2206) +- Enhancement: Added a new SDK method (`ProfileInfo.secureFieldsWithDetails`) to allow developers to the more details regarding the securely stored properties. [#2206](https://github.com/zowe/zowe-cli/issues/2206) ## `8.0.0-next.202408191401` From 9e77bf9e4549b5aa87ec0daa266199d792bf4486 Mon Sep 17 00:00:00 2001 From: zFernand0 <37381190+zFernand0@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:08:49 -0400 Subject: [PATCH 21/34] audit: update dev dependency version :yum: Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com> --- npm-shrinkwrap.json | 19 ++++++++++++++++++- packages/imperative/CHANGELOG.md | 7 +++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 63b8d3d5ca..ec28a4025e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -8703,6 +8703,21 @@ "dev": true, "license": "ISC" }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-arguments": { "version": "1.0.9", "dev": true, @@ -11354,7 +11369,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "license": "MIT", "dependencies": { "braces": "^3.0.3", diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 16d1e069c2..3f265eac66 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,12 +2,15 @@ All notable changes to the Imperative package will be documented in this file. +## Recent Changes + +- Enhancement: Added a new SDK method (`ConfigSecure.getSecureFieldsForLayer`) to allow developers to get vault content in the context of the specified layer. [#2206](https://github.com/zowe/zowe-cli/issues/2206) +- Enhancement: Added a new SDK method (`ProfileInfo.secureFieldsWithDetails`) to allow developers to the more details regarding the securely stored properties. [#2206](https://github.com/zowe/zowe-cli/issues/2206) + ## `8.0.0-next.202408231832` - LTS Breaking: Fixed command parsing error where `string` typed options would be converted into `number`s if the value provided by the user consists only of numeric characters. [#1881](https://github.com/zowe/zowe-cli/issues/1881) - LTS Breaking: Renamed `Proxy` class to `ProxySettings` to avoid name conflict with JS built-in `Proxy` object. [#2230](https://github.com/zowe/zowe-cli/issues/2230) -- Enhancement: Added a new SDK method (`ConfigSecure.getSecureFieldsForLayer`) to allow developers to get vault content in the context of the specified layer. [#2206](https://github.com/zowe/zowe-cli/issues/2206) -- Enhancement: Added a new SDK method (`ProfileInfo.secureFieldsWithDetails`) to allow developers to the more details regarding the securely stored properties. [#2206](https://github.com/zowe/zowe-cli/issues/2206) ## `8.0.0-next.202408191401` From cf06aa06f4ae1de21a360cc7827828cc2d164ba3 Mon Sep 17 00:00:00 2001 From: zFernand0 <37381190+zFernand0@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:23:55 -0400 Subject: [PATCH 22/34] tests: rename function in ConfigSecure and add unit tests :yum: Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com> --- packages/imperative/CHANGELOG.md | 2 +- .../__tests__/Config.secure.unit.test.ts | 23 +++++++++++++++---- .../imperative/src/config/src/ProfileInfo.ts | 2 +- .../src/config/src/api/ConfigSecure.ts | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 3f265eac66..8eec0c2ea9 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Imperative package will be documented in this file. ## Recent Changes -- Enhancement: Added a new SDK method (`ConfigSecure.getSecureFieldsForLayer`) to allow developers to get vault content in the context of the specified layer. [#2206](https://github.com/zowe/zowe-cli/issues/2206) +- Enhancement: Added a new SDK method (`ConfigSecure.secureFieldsForLayer`) to allow developers to get vault content in the context of the specified layer. [#2206](https://github.com/zowe/zowe-cli/issues/2206) - Enhancement: Added a new SDK method (`ProfileInfo.secureFieldsWithDetails`) to allow developers to the more details regarding the securely stored properties. [#2206](https://github.com/zowe/zowe-cli/issues/2206) ## `8.0.0-next.202408231832` diff --git a/packages/imperative/src/config/__tests__/Config.secure.unit.test.ts b/packages/imperative/src/config/__tests__/Config.secure.unit.test.ts index 72b632c70a..bce9b9693a 100644 --- a/packages/imperative/src/config/__tests__/Config.secure.unit.test.ts +++ b/packages/imperative/src/config/__tests__/Config.secure.unit.test.ts @@ -80,7 +80,7 @@ describe("Config secure tests", () => { config.mLayers = [ { path: "fake fakety fake", - properties: { profiles: {fake: { secure: ["fake"], properties: {fake: "fake"}}}} + properties: { profiles: { fake: { secure: ["fake"], properties: { fake: "fake" } } } } } ]; config.mVault = mockVault; @@ -137,10 +137,10 @@ describe("Config secure tests", () => { jest.spyOn(fs, "readFileSync"); let secureError: any; const vault: IConfigVault = { - load: jest.fn().mockRejectedValue(new ImperativeError({msg: "The vault failed"})), + load: jest.fn().mockRejectedValue(new ImperativeError({ msg: "The vault failed" })), save: jest.fn() }; - const config = await Config.load(MY_APP, {noLoad: true, vault: vault}); + const config = await Config.load(MY_APP, { noLoad: true, vault: vault }); config.mVault = vault; try { await config.api.secure.load(vault); @@ -167,6 +167,21 @@ describe("Config secure tests", () => { ]); }); + it("should list all secure fields for a layer", async () => { + jest.spyOn(Config, "search").mockReturnValue(projectConfigPath); + jest.spyOn(fs, "existsSync") + .mockReturnValueOnce(false) // Project user layer + .mockReturnValueOnce(true) // Project layer + .mockReturnValueOnce(false) // User layer + .mockReturnValueOnce(false); // Global layer + jest.spyOn(fs, "readFileSync"); + const config = await Config.load(MY_APP); + config.mSecure = secureConfigs; + expect(config.api.secure.secureFieldsForLayer(projectConfigPath)).toEqual({ [projectConfigPath]: { [securePropPath]: "area51" } }); + expect(config.api.secure.secureFieldsForLayer(projectUserConfigPath)).toEqual(null); + config.mSecure = {}; + }); + it("should list all secure fields for a profile", async () => { jest.spyOn(Config, "search").mockReturnValue(projectConfigPath).mockReturnValueOnce(projectUserConfigPath); jest.spyOn(fs, "existsSync") @@ -282,7 +297,7 @@ describe("Config secure tests", () => { it("rmUnusedProps should delete properties for files that do not exist", () => { const config = new (Config as any)(); - config.mSecure = {...secureConfigs}; + config.mSecure = { ...secureConfigs }; jest.spyOn(fs, "existsSync").mockReturnValueOnce(true).mockReturnValueOnce(false); const prunedFiles = config.api.secure.rmUnusedProps(); expect(prunedFiles).toEqual(["fakePath"]); diff --git a/packages/imperative/src/config/src/ProfileInfo.ts b/packages/imperative/src/config/src/ProfileInfo.ts index 1afe64e2e1..88ffbe623e 100644 --- a/packages/imperative/src/config/src/ProfileInfo.ts +++ b/packages/imperative/src/config/src/ProfileInfo.ts @@ -1400,7 +1400,7 @@ export class ProfileInfo { const config = this.getTeamConfig(); const layer = opts ? config.findLayer(opts.user, opts.global) : config.layerActive(); const fields = config.api.secure.findSecure(layer.properties.profiles, "profiles"); - const vault = config.api.secure.getSecureFieldsForLayer(layer.path); + const vault = config.api.secure.secureFieldsForLayer(layer.path); const response: IProfArgAttrs[] = []; diff --git a/packages/imperative/src/config/src/api/ConfigSecure.ts b/packages/imperative/src/config/src/api/ConfigSecure.ts index 0c67f833aa..b1bcc7ba27 100644 --- a/packages/imperative/src/config/src/api/ConfigSecure.ts +++ b/packages/imperative/src/config/src/api/ConfigSecure.ts @@ -248,7 +248,7 @@ export class ConfigSecure extends ConfigApi { * @param layerPath Path of the layer to get secure properties for * @returns the secure properties for the given layer, or null if not found */ - public getSecureFieldsForLayer(layerPath: string): IConfigSecureProperties { + public secureFieldsForLayer(layerPath: string): IConfigSecureProperties { const secureLayer = Object.keys(this.mConfig.mSecure).find(osLocation => osLocation === layerPath); return secureLayer ? { [secureLayer] : this.mConfig.mSecure[secureLayer] } : null; } From 71392878cdbf09c6104f004938a48bff53ac4728 Mon Sep 17 00:00:00 2001 From: zFernand0 <37381190+zFernand0@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:38:28 -0400 Subject: [PATCH 23/34] fix: simplify both APIs adn added unit test :yum: Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com> --- .../__tests__/Config.secure.unit.test.ts | 2 +- .../ProfileInfo.TeamConfig.unit.test.ts | 61 ++++++++++++++++--- .../ProfInfoApp.config.json | 5 ++ .../imperative/src/config/src/ProfileInfo.ts | 36 +++++------ .../src/config/src/api/ConfigSecure.ts | 2 +- 5 files changed, 77 insertions(+), 29 deletions(-) diff --git a/packages/imperative/src/config/__tests__/Config.secure.unit.test.ts b/packages/imperative/src/config/__tests__/Config.secure.unit.test.ts index bce9b9693a..276531d6a9 100644 --- a/packages/imperative/src/config/__tests__/Config.secure.unit.test.ts +++ b/packages/imperative/src/config/__tests__/Config.secure.unit.test.ts @@ -177,7 +177,7 @@ describe("Config secure tests", () => { jest.spyOn(fs, "readFileSync"); const config = await Config.load(MY_APP); config.mSecure = secureConfigs; - expect(config.api.secure.secureFieldsForLayer(projectConfigPath)).toEqual({ [projectConfigPath]: { [securePropPath]: "area51" } }); + expect(config.api.secure.secureFieldsForLayer(projectConfigPath)).toEqual({ [securePropPath]: "area51" }); expect(config.api.secure.secureFieldsForLayer(projectUserConfigPath)).toEqual(null); config.mSecure = {}; }); diff --git a/packages/imperative/src/config/__tests__/ProfileInfo.TeamConfig.unit.test.ts b/packages/imperative/src/config/__tests__/ProfileInfo.TeamConfig.unit.test.ts index ab7a40eac2..5df7c00507 100644 --- a/packages/imperative/src/config/__tests__/ProfileInfo.TeamConfig.unit.test.ts +++ b/packages/imperative/src/config/__tests__/ProfileInfo.TeamConfig.unit.test.ts @@ -33,7 +33,6 @@ import { IExtendersJsonOpts } from "../src/doc/IExtenderOpts"; import { ConfigSchema } from "../src/ConfigSchema"; import { Logger } from "../../logger/src/Logger"; - const testAppNm = "ProfInfoApp"; const testEnvPrefix = testAppNm.toUpperCase(); const profileTypes = ["zosmf", "tso", "base", "dummy"]; @@ -331,7 +330,7 @@ describe("TeamConfig ProfileInfo tests", () => { it("should return true if credentials are not secure", async () => { // ensure that we are not in the team project directory const profInfo = createNewProfInfo(origDir); - (profInfo as any).mCredentials = {isSecured: false}; + (profInfo as any).mCredentials = { isSecured: false }; const response = await profInfo.profileManagerWillLoad(); expect(response).toEqual(true); }); @@ -366,6 +365,52 @@ describe("TeamConfig ProfileInfo tests", () => { }); }); + describe("secureFieldsWithDetails", () => { + it("should return an empty array if there are no secure fields in the given layer or if the layer does not exist", async () => { + const profInfo = createNewProfInfo(teamProjDir); + await profInfo.readProfilesFromDisk(); + + // Project User does not exist + expect(profInfo.secureFieldsWithDetails({ user: true, global: false })).toEqual([]); + + // Project Team dos exist, but has no secure properties + expect(profInfo.secureFieldsWithDetails({ user: false, global: false })).toEqual([]); + }); + fit("should return secure fields for the active layer even if they have no secure values stored in the vault", async () => { + const profInfo = createNewProfInfo(teamProjDir); + await profInfo.readProfilesFromDisk(); + + const securePropPath = "profiles.LPAR007.properties."; + const teamProjDirJson = path.join(teamProjDir, testAppNm + ".config.json"); + profInfo.getTeamConfig().mSecure = { + [teamProjDirJson]: { + [securePropPath + "string"]: "area51", + [securePropPath + "boolean"]: true, + [securePropPath + "number"]: 1234, + }, + }; + + const getPropAttr = (name: string | any, value: any, type?: string | null): IProfArgAttrs => ({ + argLoc: { osLoc: [teamProjDirJson], locType: 1, jsonLoc: securePropPath + name }, + argName: name, + argValue: value, + dataType: type !== undefined ? type : name, + }); + + expect(profInfo.secureFieldsWithDetails()).toEqual([ + getPropAttr("string", "area51"), + getPropAttr("boolean", true), + getPropAttr("number", 1234), + getPropAttr("missing", undefined, null), + getPropAttr("host", undefined, "string"), + getPropAttr("port", undefined, "number"), + getPropAttr("responseFormatHeader", undefined, "boolean"), + ]); + + profInfo.getTeamConfig().mSecure = {}; + }); + }); + describe("getAllProfiles", () => { it("should return all profiles if no type is specified", async () => { const expectedDefaultProfiles = 4; @@ -1116,7 +1161,7 @@ describe("TeamConfig ProfileInfo tests", () => { expect(storeSpy).toHaveBeenCalledWith({ config: profInfo.getTeamConfig(), profileName: "LPAR4", profileType: "dummy", defaultBaseProfileName: "base_glob", - propsToStore: [ "DOES_NOT_EXIST" ], sessCfg: { "DOES_NOT_EXIST": true }, setSecure : undefined, + propsToStore: ["DOES_NOT_EXIST"], sessCfg: { "DOES_NOT_EXIST": true }, setSecure: undefined, }); }); @@ -1196,7 +1241,7 @@ describe("TeamConfig ProfileInfo tests", () => { expect(storeSpy).toHaveBeenCalledWith({ config: profInfo.getTeamConfig(), profileName: "typeless", profileType: null, defaultBaseProfileName: "base_glob", - propsToStore: [ "areBirdsReal" ], sessCfg: { "areBirdsReal": true }, setSecure : undefined, + propsToStore: ["areBirdsReal"], sessCfg: { "areBirdsReal": true }, setSecure: undefined, }); }); @@ -1242,7 +1287,7 @@ describe("TeamConfig ProfileInfo tests", () => { expect(storeSpy).toHaveBeenCalledWith({ config: profInfo.getTeamConfig(), profileName: "typeless_new", profileType: null, defaultBaseProfileName: "base_glob", - propsToStore: [ "areBirdsReal" ], sessCfg: { "areBirdsReal": true }, setSecure : undefined, + propsToStore: ["areBirdsReal"], sessCfg: { "areBirdsReal": true }, setSecure: undefined, }); }); }); @@ -1683,8 +1728,10 @@ describe("TeamConfig ProfileInfo tests", () => { } } }, - res: { success: false, info: "Both the old and new schemas are unversioned for some-type, but the schemas are different. " - .concat("The new schema was not written to disk, but will still be accessible in-memory.") } + res: { + success: false, info: "Both the old and new schemas are unversioned for some-type, but the schemas are different. " + .concat("The new schema was not written to disk, but will still be accessible in-memory.") + } } ); }); diff --git a/packages/imperative/src/config/__tests__/__resources__/ProfInfoApp_team_config_proj/ProfInfoApp.config.json b/packages/imperative/src/config/__tests__/__resources__/ProfInfoApp_team_config_proj/ProfInfoApp.config.json index 0823095788..b5a8c4b30f 100644 --- a/packages/imperative/src/config/__tests__/__resources__/ProfInfoApp_team_config_proj/ProfInfoApp.config.json +++ b/packages/imperative/src/config/__tests__/__resources__/ProfInfoApp_team_config_proj/ProfInfoApp.config.json @@ -72,6 +72,11 @@ }, "typeless": { "properties": {} + }, + "LPAR007": { + "type": "zosmf", + "properties": {}, + "secure": ["string", "boolean", "number", "missing", "host", "port", "responseFormatHeader"] } }, "defaults": { diff --git a/packages/imperative/src/config/src/ProfileInfo.ts b/packages/imperative/src/config/src/ProfileInfo.ts index 88ffbe623e..916c9be357 100644 --- a/packages/imperative/src/config/src/ProfileInfo.ts +++ b/packages/imperative/src/config/src/ProfileInfo.ts @@ -1406,25 +1406,21 @@ export class ProfileInfo { // Search the vault for each secure field fields.forEach(fieldPath => { - // Scan the cached contents of the vault - for (const [loc, val] of Object.entries(vault)) { - // Search inside the secure fields for this layer - Object.entries(val).map(([propPath, propValue]) => { - if (propPath === fieldPath) { - response.push({ - argName: fieldPath.split(".properties.")[1], - // name: , - dataType: this.argDataType(typeof propValue), - argValue: propValue as IProfDataType, - argLoc: { - locType: ProfLocType.TEAM_CONFIG, - osLoc: [loc], - jsonLoc: fieldPath - }, - }); - } - }); - } + // Search inside the secure fields for this layer + Object.entries(vault).map(([propPath, propValue]) => { + if (propPath === fieldPath) { + response.push({ + argName: fieldPath.split(".properties.")[1], + dataType: this.argDataType(typeof propValue), + argValue: propValue as IProfDataType, + argLoc: { + locType: ProfLocType.TEAM_CONFIG, + osLoc: [layer.path], + jsonLoc: fieldPath + }, + }); + } + }); }); fields.forEach(fieldPath => { @@ -1435,7 +1431,7 @@ export class ProfileInfo { argValue: undefined, argLoc: { locType: ProfLocType.TEAM_CONFIG, - osLoc: [], + osLoc: [layer.path], jsonLoc: fieldPath } }); diff --git a/packages/imperative/src/config/src/api/ConfigSecure.ts b/packages/imperative/src/config/src/api/ConfigSecure.ts index b1bcc7ba27..ba43bfc143 100644 --- a/packages/imperative/src/config/src/api/ConfigSecure.ts +++ b/packages/imperative/src/config/src/api/ConfigSecure.ts @@ -250,7 +250,7 @@ export class ConfigSecure extends ConfigApi { */ public secureFieldsForLayer(layerPath: string): IConfigSecureProperties { const secureLayer = Object.keys(this.mConfig.mSecure).find(osLocation => osLocation === layerPath); - return secureLayer ? { [secureLayer] : this.mConfig.mSecure[secureLayer] } : null; + return secureLayer ? this.mConfig.mSecure[secureLayer] : null; } /** From 8d81d9ebbfebdb64f71e18fa9f41951bfe5885cf Mon Sep 17 00:00:00 2001 From: zowe-robot Date: Mon, 26 Aug 2024 15:44:02 +0000 Subject: [PATCH 24/34] Bump version to 8.0.0-next.202408261543 [ci skip] Signed-off-by: zowe-robot --- .../__packages__/cli-test-utils/package.json | 4 +- lerna.json | 2 +- npm-shrinkwrap.json | 122 +++++++++--------- packages/cli/CHANGELOG.md | 2 +- packages/cli/package.json | 28 ++-- packages/core/package.json | 6 +- packages/imperative/package.json | 4 +- packages/provisioning/package.json | 8 +- packages/secrets/package.json | 2 +- packages/workflows/package.json | 10 +- packages/zosconsole/package.json | 8 +- packages/zosfiles/package.json | 10 +- packages/zosjobs/package.json | 10 +- packages/zoslogs/package.json | 8 +- packages/zosmf/package.json | 8 +- packages/zostso/package.json | 10 +- packages/zosuss/package.json | 6 +- 17 files changed, 124 insertions(+), 124 deletions(-) diff --git a/__tests__/__packages__/cli-test-utils/package.json b/__tests__/__packages__/cli-test-utils/package.json index 7c59a0b44a..8363c55f51 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.202408231832", + "version": "8.0.0-next.202408261543", "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": "^10.0.0", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/imperative": "8.0.0-next.202408261543" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" diff --git a/lerna.json b/lerna.json index 14501554b5..3e5f67613d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "command": { "publish": { "ignoreChanges": [ diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 306fafbda0..0d484ccf50 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.202408231832", + "version": "8.0.0-next.202408261543", "license": "EPL-2.0", "dependencies": { "find-up": "^5.0.0", @@ -63,7 +63,7 @@ "devDependencies": { "@types/js-yaml": "^4.0.9", "@types/uuid": "^10.0.0", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/imperative": "8.0.0-next.202408261543" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" @@ -16365,21 +16365,21 @@ }, "packages/cli": { "name": "@zowe/cli", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "hasInstallScript": true, "license": "EPL-2.0", "dependencies": { - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832", - "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543", + "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408261543", "find-process": "1.4.7", "lodash": "4.17.21", "minimatch": "9.0.5", @@ -16392,7 +16392,7 @@ "@types/diff": "^5.0.9", "@types/lodash": "^4.17.6", "@types/tar": "^6.1.11", - "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/cli-test-utils": "8.0.0-next.202408261543", "comment-json": "^4.2.3", "strip-ansi": "^6.0.1", "which": "^4.0.0" @@ -16401,7 +16401,7 @@ "node": ">=18.12.0" }, "optionalDependencies": { - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408231832" + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408261543" } }, "packages/cli/node_modules/brace-expansion": { @@ -16448,15 +16448,15 @@ }, "packages/core": { "name": "@zowe/core-for-zowe-sdk", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "license": "EPL-2.0", "dependencies": { "comment-json": "~4.2.3", "string-width": "^4.2.3" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "engines": { "node": ">=18.12.0" @@ -16467,7 +16467,7 @@ }, "packages/imperative": { "name": "@zowe/imperative", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "license": "EPL-2.0", "dependencies": { "@types/yargs": "^17.0.32", @@ -16520,7 +16520,7 @@ "@types/pacote": "^11.1.8", "@types/progress": "^2.0.7", "@types/stack-trace": "^0.0.33", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408261543", "concurrently": "^8.0.0", "cowsay": "^1.6.0", "deep-diff": "^1.0.0", @@ -16661,16 +16661,16 @@ }, "packages/provisioning": { "name": "@zowe/provisioning-for-zowe-sdk", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "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.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "engines": { "node": ">=18.12.0" @@ -16682,7 +16682,7 @@ }, "packages/secrets": { "name": "@zowe/secrets-for-zowe-sdk", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "hasInstallScript": true, "license": "EPL-2.0", "devDependencies": { @@ -16695,15 +16695,15 @@ }, "packages/workflows": { "name": "@zowe/zos-workflows-for-zowe-sdk", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408231832" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408261543" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "engines": { "node": ">=18.12.0" @@ -16715,12 +16715,12 @@ }, "packages/zosconsole": { "name": "@zowe/zos-console-for-zowe-sdk", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "engines": { "node": ">=18.12.0" @@ -16732,16 +16732,16 @@ }, "packages/zosfiles": { "name": "@zowe/zos-files-for-zowe-sdk", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "license": "EPL-2.0", "dependencies": { "minimatch": "^9.0.5" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408261543" }, "engines": { "node": ">=18.12.0" @@ -16773,15 +16773,15 @@ }, "packages/zosjobs": { "name": "@zowe/zos-jobs-for-zowe-sdk", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408231832" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408261543" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "engines": { "node": ">=18.12.0" @@ -16793,12 +16793,12 @@ }, "packages/zoslogs": { "name": "@zowe/zos-logs-for-zowe-sdk", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "engines": { "node": ">=18.12.0" @@ -16810,12 +16810,12 @@ }, "packages/zosmf": { "name": "@zowe/zosmf-for-zowe-sdk", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "engines": { "node": ">=18.12.0" @@ -16827,15 +16827,15 @@ }, "packages/zostso": { "name": "@zowe/zos-tso-for-zowe-sdk", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "license": "EPL-2.0", "dependencies": { - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408231832" + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408261543" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "engines": { "node": ">=18.12.0" @@ -16847,15 +16847,15 @@ }, "packages/zosuss": { "name": "@zowe/zos-uss-for-zowe-sdk", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "license": "EPL-2.0", "dependencies": { "ssh2": "^1.15.0" }, "devDependencies": { "@types/ssh2": "^1.11.19", - "@zowe/cli-test-utils": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "engines": { "node": ">=18.12.0" diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 9efe4581e8..ced8ed2a89 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Zowe CLI package will be documented in this file. -## Recent Changes +## `8.0.0-next.202408261543` - BugFix: Updated `micromatch` dependency for technical currency. [#2242](https://github.com/zowe/zowe-cli/pull/2242) diff --git a/packages/cli/package.json b/packages/cli/package.json index 2c4e4240f3..54d85535dd 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/cli", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "zoweVersion": "v3.0.0-prerelease", "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.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832", - "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543", + "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408261543", "find-process": "1.4.7", "lodash": "4.17.21", "minimatch": "9.0.5", @@ -78,13 +78,13 @@ "@types/diff": "^5.0.9", "@types/lodash": "^4.17.6", "@types/tar": "^6.1.11", - "@zowe/cli-test-utils": "8.0.0-next.202408231832", + "@zowe/cli-test-utils": "8.0.0-next.202408261543", "comment-json": "^4.2.3", "strip-ansi": "^6.0.1", "which": "^4.0.0" }, "optionalDependencies": { - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408231832" + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408261543" }, "engines": { "node": ">=18.12.0" diff --git a/packages/core/package.json b/packages/core/package.json index d426f0d684..53e9d868d0 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.202408231832", + "version": "8.0.0-next.202408261543", "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.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" diff --git a/packages/imperative/package.json b/packages/imperative/package.json index a24f91f009..6aac843275 100644 --- a/packages/imperative/package.json +++ b/packages/imperative/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/imperative", - "version": "8.0.0-next.202408231832", + "version": "8.0.0-next.202408261543", "description": "framework for building configurable CLIs", "author": "Zowe", "license": "EPL-2.0", @@ -95,7 +95,7 @@ "@types/pacote": "^11.1.8", "@types/progress": "^2.0.7", "@types/stack-trace": "^0.0.33", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408231832", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408261543", "concurrently": "^8.0.0", "cowsay": "^1.6.0", "deep-diff": "^1.0.0", diff --git a/packages/provisioning/package.json b/packages/provisioning/package.json index 1c8b9f7449..cca4e1b5e9 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.202408231832", + "version": "8.0.0-next.202408261543", "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.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/secrets/package.json b/packages/secrets/package.json index 66cdc9bd08..4cf2cde288 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.202408231832", + "version": "8.0.0-next.202408261543", "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 2557c0a3e2..efd53faea2 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.202408231832", + "version": "8.0.0-next.202408261543", "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.202408231832" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408261543" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosconsole/package.json b/packages/zosconsole/package.json index 6652de33dc..4753c599a6 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.202408231832", + "version": "8.0.0-next.202408261543", "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.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosfiles/package.json b/packages/zosfiles/package.json index 6faf53bcf2..691ae84976 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.202408231832", + "version": "8.0.0-next.202408261543", "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.5" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408261543" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosjobs/package.json b/packages/zosjobs/package.json index 07fab4e6f6..66e6b378a7 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.202408231832", + "version": "8.0.0-next.202408261543", "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.202408231832" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408261543" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zoslogs/package.json b/packages/zoslogs/package.json index 5146ad5486..19dc00e7ed 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.202408231832", + "version": "8.0.0-next.202408261543", "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.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosmf/package.json b/packages/zosmf/package.json index a671dc2389..4ff6f46fb0 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.202408231832", + "version": "8.0.0-next.202408261543", "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.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zostso/package.json b/packages/zostso/package.json index 0df807a3d4..5d4b778e98 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.202408231832", + "version": "8.0.0-next.202408261543", "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.202408231832" + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408261543" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408231832", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosuss/package.json b/packages/zosuss/package.json index 822242ce56..bfddc27559 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.202408231832", + "version": "8.0.0-next.202408261543", "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.202408231832", - "@zowe/imperative": "8.0.0-next.202408231832" + "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/imperative": "8.0.0-next.202408261543" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" From ed4498a4cca7e3b694a1bb33394818d008032e45 Mon Sep 17 00:00:00 2001 From: zFernand0 <37381190+zFernand0@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:46:08 -0400 Subject: [PATCH 25/34] fix: add types to all missing arguments based on schema definition Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com> --- .../ProfileInfo.TeamConfig.unit.test.ts | 14 ++++--- .../ProfInfoApp.config.json | 10 ++++- .../imperative/src/config/src/ProfileInfo.ts | 41 +++++++++++-------- 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/packages/imperative/src/config/__tests__/ProfileInfo.TeamConfig.unit.test.ts b/packages/imperative/src/config/__tests__/ProfileInfo.TeamConfig.unit.test.ts index 88439d924b..420972d432 100644 --- a/packages/imperative/src/config/__tests__/ProfileInfo.TeamConfig.unit.test.ts +++ b/packages/imperative/src/config/__tests__/ProfileInfo.TeamConfig.unit.test.ts @@ -370,12 +370,16 @@ describe("TeamConfig ProfileInfo tests", () => { const profInfo = createNewProfInfo(teamProjDir); await profInfo.readProfilesFromDisk(); + // Temporarily assume that there are no secure properties for this test only + profInfo.getTeamConfig().mLayers[1].properties.profiles["LPAR007"].secure = []; + // Project User does not exist expect(profInfo.secureFieldsWithDetails({ user: true, global: false })).toEqual([]); // Project Team dos exist, but has no secure properties expect(profInfo.secureFieldsWithDetails({ user: false, global: false })).toEqual([]); }); + it("should return secure fields for the active layer even if they have no secure values stored in the vault", async () => { const profInfo = createNewProfInfo(teamProjDir); await profInfo.readProfilesFromDisk(); @@ -401,10 +405,10 @@ describe("TeamConfig ProfileInfo tests", () => { getPropAttr("string", "area51"), getPropAttr("boolean", true), getPropAttr("number", 1234), - getPropAttr("missing", undefined, null), + getPropAttr("missing-after-this", undefined, null), getPropAttr("host", undefined, "string"), getPropAttr("port", undefined, "number"), - getPropAttr("responseFormatHeader", undefined, "boolean"), + getPropAttr("rejectUnauthorized", undefined, "boolean"), ]); profInfo.getTeamConfig().mSecure = {}; @@ -420,7 +424,7 @@ describe("TeamConfig ProfileInfo tests", () => { const expectedDefaultProfileNameDummy = "LPAR4"; let actualDefaultProfiles = 0; let expectedProfileNames = ["LPAR1", "LPAR2", "LPAR3", "LPAR1.tsoProfName", "LPAR1.tsoProfName.tsoSubProfName", - "base_glob", "LPAR4", "LPAR5"]; + "base_glob", "LPAR4", "LPAR5", "LPAR007"]; const profInfo = createNewProfInfo(teamProjDir); await profInfo.readProfilesFromDisk(); @@ -460,7 +464,7 @@ describe("TeamConfig ProfileInfo tests", () => { const desiredProfType = "zosmf"; const expectedName = "LPAR1"; const expectedDefaultProfiles = 1; - let expectedProfileNames = ["LPAR1", "LPAR2", "LPAR3", "LPAR2_home", "LPAR5"]; + let expectedProfileNames = ["LPAR1", "LPAR2", "LPAR3", "LPAR2_home", "LPAR5", "LPAR007"]; let actualDefaultProfiles = 0; const profInfo = createNewProfInfo(teamProjDir); @@ -494,7 +498,7 @@ describe("TeamConfig ProfileInfo tests", () => { const desiredProfType = "zosmf"; const expectedName = "LPAR1"; const expectedDefaultProfiles = 1; - let expectedProfileNames = ["LPAR1", "LPAR2", "LPAR3", "LPAR5"]; + let expectedProfileNames = ["LPAR1", "LPAR2", "LPAR3", "LPAR5", "LPAR007"]; let actualDefaultProfiles = 0; const profInfo = createNewProfInfo(teamProjDir); diff --git a/packages/imperative/src/config/__tests__/__resources__/ProfInfoApp_team_config_proj/ProfInfoApp.config.json b/packages/imperative/src/config/__tests__/__resources__/ProfInfoApp_team_config_proj/ProfInfoApp.config.json index b5a8c4b30f..669c188f06 100644 --- a/packages/imperative/src/config/__tests__/__resources__/ProfInfoApp_team_config_proj/ProfInfoApp.config.json +++ b/packages/imperative/src/config/__tests__/__resources__/ProfInfoApp_team_config_proj/ProfInfoApp.config.json @@ -76,7 +76,15 @@ "LPAR007": { "type": "zosmf", "properties": {}, - "secure": ["string", "boolean", "number", "missing", "host", "port", "responseFormatHeader"] + "secure": [ + "string", + "boolean", + "number", + "missing-after-this", + "host", + "port", + "rejectUnauthorized" + ] } }, "defaults": { diff --git a/packages/imperative/src/config/src/ProfileInfo.ts b/packages/imperative/src/config/src/ProfileInfo.ts index 916c9be357..84641b89f5 100644 --- a/packages/imperative/src/config/src/ProfileInfo.ts +++ b/packages/imperative/src/config/src/ProfileInfo.ts @@ -1170,7 +1170,7 @@ export class ProfileInfo { if (semver.major(typeInfo.schema.version) != semver.major(prevTypeVersion)) { // Warn user if new major schema version is specified infoMsg = - `Profile type ${profileType} was updated from schema version ${prevTypeVersion} to ${typeInfo.schema.version}.\n` + + `Profile type ${profileType} was updated from schema version ${prevTypeVersion} to ${typeInfo.schema.version}.\n` + `The following applications may be affected: ${typeMetadata.from.filter((src) => src !== typeInfo.sourceApp)}`; } } else if (semver.major(prevTypeVersion) > semver.major(typeInfo.schema.version)) { @@ -1405,29 +1405,34 @@ export class ProfileInfo { const response: IProfArgAttrs[] = []; // Search the vault for each secure field - fields.forEach(fieldPath => { - // Search inside the secure fields for this layer - Object.entries(vault).map(([propPath, propValue]) => { - if (propPath === fieldPath) { - response.push({ - argName: fieldPath.split(".properties.")[1], - dataType: this.argDataType(typeof propValue), - argValue: propValue as IProfDataType, - argLoc: { - locType: ProfLocType.TEAM_CONFIG, - osLoc: [layer.path], - jsonLoc: fieldPath - }, - }); - } + if (vault) { + fields.forEach(fieldPath => { + // Search inside the secure fields for this layer + Object.entries(vault).map(([propPath, propValue]) => { + if (propPath === fieldPath) { + const dataType = ConfigSchema.findPropertyType(fieldPath, layer.properties, this.buildSchema([], layer)) as IProfDataType; + + response.push({ + argName: fieldPath.split(".properties.")[1], + dataType: dataType ?? this.argDataType(typeof propValue), + argValue: propValue as IProfDataType, + argLoc: { + locType: ProfLocType.TEAM_CONFIG, + osLoc: [layer.path], + jsonLoc: fieldPath + }, + }); + } + }); }); - }); + } fields.forEach(fieldPath => { if (response.find(details => details.argLoc.jsonLoc === fieldPath) == null) { + const dataType = ConfigSchema.findPropertyType(fieldPath, layer.properties, this.buildSchema([], layer)) as IProfDataType ?? null; response.push({ argName: fieldPath.split(".properties.")[1], - dataType: undefined, + dataType, argValue: undefined, argLoc: { locType: ProfLocType.TEAM_CONFIG, From 25ee4da4a255efbcccedc354648550e822bfba14 Mon Sep 17 00:00:00 2001 From: zowe-robot Date: Tue, 27 Aug 2024 13:30:29 +0000 Subject: [PATCH 26/34] Bump version to 8.0.0-next.202408271330 [ci skip] Signed-off-by: zowe-robot --- .../__packages__/cli-test-utils/CHANGELOG.md | 2 +- .../__packages__/cli-test-utils/package.json | 4 +- lerna.json | 2 +- npm-shrinkwrap.json | 122 +++++++++--------- packages/cli/package.json | 28 ++-- packages/core/package.json | 6 +- packages/imperative/CHANGELOG.md | 2 +- packages/imperative/package.json | 4 +- packages/provisioning/package.json | 8 +- packages/secrets/package.json | 2 +- packages/workflows/package.json | 10 +- packages/zosconsole/package.json | 8 +- packages/zosfiles/package.json | 10 +- packages/zosjobs/package.json | 10 +- packages/zoslogs/package.json | 8 +- packages/zosmf/package.json | 8 +- packages/zostso/package.json | 10 +- packages/zosuss/package.json | 6 +- 18 files changed, 125 insertions(+), 125 deletions(-) diff --git a/__tests__/__packages__/cli-test-utils/CHANGELOG.md b/__tests__/__packages__/cli-test-utils/CHANGELOG.md index d50a15e407..baec97cf76 100644 --- a/__tests__/__packages__/cli-test-utils/CHANGELOG.md +++ b/__tests__/__packages__/cli-test-utils/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Zowe CLI test utils package will be documented in this file. -## Recent Changes +## `8.0.0-next.202408271330` - BugFix: Removed obsolete V1 `profiles` property from the parameters object returned by `mockHandlerParameters` method. diff --git a/__tests__/__packages__/cli-test-utils/package.json b/__tests__/__packages__/cli-test-utils/package.json index 8363c55f51..5d4cab14a7 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.202408261543", + "version": "8.0.0-next.202408271330", "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": "^10.0.0", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/imperative": "8.0.0-next.202408271330" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" diff --git a/lerna.json b/lerna.json index 3e5f67613d..415822a4f4 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "command": { "publish": { "ignoreChanges": [ diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0d484ccf50..0c90e33f11 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.202408261543", + "version": "8.0.0-next.202408271330", "license": "EPL-2.0", "dependencies": { "find-up": "^5.0.0", @@ -63,7 +63,7 @@ "devDependencies": { "@types/js-yaml": "^4.0.9", "@types/uuid": "^10.0.0", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/imperative": "8.0.0-next.202408271330" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" @@ -16365,21 +16365,21 @@ }, "packages/cli": { "name": "@zowe/cli", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "hasInstallScript": true, "license": "EPL-2.0", "dependencies": { - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543", - "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330", + "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408271330", "find-process": "1.4.7", "lodash": "4.17.21", "minimatch": "9.0.5", @@ -16392,7 +16392,7 @@ "@types/diff": "^5.0.9", "@types/lodash": "^4.17.6", "@types/tar": "^6.1.11", - "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/cli-test-utils": "8.0.0-next.202408271330", "comment-json": "^4.2.3", "strip-ansi": "^6.0.1", "which": "^4.0.0" @@ -16401,7 +16401,7 @@ "node": ">=18.12.0" }, "optionalDependencies": { - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408261543" + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408271330" } }, "packages/cli/node_modules/brace-expansion": { @@ -16448,15 +16448,15 @@ }, "packages/core": { "name": "@zowe/core-for-zowe-sdk", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "license": "EPL-2.0", "dependencies": { "comment-json": "~4.2.3", "string-width": "^4.2.3" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "engines": { "node": ">=18.12.0" @@ -16467,7 +16467,7 @@ }, "packages/imperative": { "name": "@zowe/imperative", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "license": "EPL-2.0", "dependencies": { "@types/yargs": "^17.0.32", @@ -16520,7 +16520,7 @@ "@types/pacote": "^11.1.8", "@types/progress": "^2.0.7", "@types/stack-trace": "^0.0.33", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408271330", "concurrently": "^8.0.0", "cowsay": "^1.6.0", "deep-diff": "^1.0.0", @@ -16661,16 +16661,16 @@ }, "packages/provisioning": { "name": "@zowe/provisioning-for-zowe-sdk", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "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.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "engines": { "node": ">=18.12.0" @@ -16682,7 +16682,7 @@ }, "packages/secrets": { "name": "@zowe/secrets-for-zowe-sdk", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "hasInstallScript": true, "license": "EPL-2.0", "devDependencies": { @@ -16695,15 +16695,15 @@ }, "packages/workflows": { "name": "@zowe/zos-workflows-for-zowe-sdk", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408261543" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408271330" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "engines": { "node": ">=18.12.0" @@ -16715,12 +16715,12 @@ }, "packages/zosconsole": { "name": "@zowe/zos-console-for-zowe-sdk", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "engines": { "node": ">=18.12.0" @@ -16732,16 +16732,16 @@ }, "packages/zosfiles": { "name": "@zowe/zos-files-for-zowe-sdk", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "license": "EPL-2.0", "dependencies": { "minimatch": "^9.0.5" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408271330" }, "engines": { "node": ">=18.12.0" @@ -16773,15 +16773,15 @@ }, "packages/zosjobs": { "name": "@zowe/zos-jobs-for-zowe-sdk", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408261543" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408271330" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "engines": { "node": ">=18.12.0" @@ -16793,12 +16793,12 @@ }, "packages/zoslogs": { "name": "@zowe/zos-logs-for-zowe-sdk", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "engines": { "node": ">=18.12.0" @@ -16810,12 +16810,12 @@ }, "packages/zosmf": { "name": "@zowe/zosmf-for-zowe-sdk", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "engines": { "node": ">=18.12.0" @@ -16827,15 +16827,15 @@ }, "packages/zostso": { "name": "@zowe/zos-tso-for-zowe-sdk", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "license": "EPL-2.0", "dependencies": { - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408261543" + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408271330" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "engines": { "node": ">=18.12.0" @@ -16847,15 +16847,15 @@ }, "packages/zosuss": { "name": "@zowe/zos-uss-for-zowe-sdk", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "license": "EPL-2.0", "dependencies": { "ssh2": "^1.15.0" }, "devDependencies": { "@types/ssh2": "^1.11.19", - "@zowe/cli-test-utils": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "engines": { "node": ">=18.12.0" diff --git a/packages/cli/package.json b/packages/cli/package.json index 54d85535dd..d4d842218c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/cli", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "zoweVersion": "v3.0.0-prerelease", "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.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543", - "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330", + "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408271330", "find-process": "1.4.7", "lodash": "4.17.21", "minimatch": "9.0.5", @@ -78,13 +78,13 @@ "@types/diff": "^5.0.9", "@types/lodash": "^4.17.6", "@types/tar": "^6.1.11", - "@zowe/cli-test-utils": "8.0.0-next.202408261543", + "@zowe/cli-test-utils": "8.0.0-next.202408271330", "comment-json": "^4.2.3", "strip-ansi": "^6.0.1", "which": "^4.0.0" }, "optionalDependencies": { - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408261543" + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408271330" }, "engines": { "node": ">=18.12.0" diff --git a/packages/core/package.json b/packages/core/package.json index 53e9d868d0..bce2840be6 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.202408261543", + "version": "8.0.0-next.202408271330", "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.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 0204ab62f4..6b10c766c1 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Imperative package will be documented in this file. -## Recent Changes +## `8.0.0-next.202408271330` - LTS Breaking: [#2231](https://github.com/zowe/zowe-cli/issues/2231) - Removed the obsolete V1 `profiles` property from `IHandlerParameters` interface diff --git a/packages/imperative/package.json b/packages/imperative/package.json index 6aac843275..dad7f36ad3 100644 --- a/packages/imperative/package.json +++ b/packages/imperative/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/imperative", - "version": "8.0.0-next.202408261543", + "version": "8.0.0-next.202408271330", "description": "framework for building configurable CLIs", "author": "Zowe", "license": "EPL-2.0", @@ -95,7 +95,7 @@ "@types/pacote": "^11.1.8", "@types/progress": "^2.0.7", "@types/stack-trace": "^0.0.33", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408261543", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408271330", "concurrently": "^8.0.0", "cowsay": "^1.6.0", "deep-diff": "^1.0.0", diff --git a/packages/provisioning/package.json b/packages/provisioning/package.json index cca4e1b5e9..9b0d1ec793 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.202408261543", + "version": "8.0.0-next.202408271330", "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.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/secrets/package.json b/packages/secrets/package.json index 4cf2cde288..2c19496383 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.202408261543", + "version": "8.0.0-next.202408271330", "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 efd53faea2..470ea2ff14 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.202408261543", + "version": "8.0.0-next.202408271330", "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.202408261543" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408271330" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosconsole/package.json b/packages/zosconsole/package.json index 4753c599a6..7df35d2a55 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.202408261543", + "version": "8.0.0-next.202408271330", "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.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosfiles/package.json b/packages/zosfiles/package.json index 691ae84976..b92d684360 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.202408261543", + "version": "8.0.0-next.202408271330", "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.5" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408271330" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosjobs/package.json b/packages/zosjobs/package.json index 66e6b378a7..77bb62055d 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.202408261543", + "version": "8.0.0-next.202408271330", "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.202408261543" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408271330" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zoslogs/package.json b/packages/zoslogs/package.json index 19dc00e7ed..60c39014c3 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.202408261543", + "version": "8.0.0-next.202408271330", "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.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosmf/package.json b/packages/zosmf/package.json index 4ff6f46fb0..9bfb60253f 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.202408261543", + "version": "8.0.0-next.202408271330", "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.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zostso/package.json b/packages/zostso/package.json index 5d4b778e98..1e31fa5d82 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.202408261543", + "version": "8.0.0-next.202408271330", "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.202408261543" + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408271330" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408261543", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosuss/package.json b/packages/zosuss/package.json index bfddc27559..1aa904d690 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.202408261543", + "version": "8.0.0-next.202408271330", "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.202408261543", - "@zowe/imperative": "8.0.0-next.202408261543" + "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/imperative": "8.0.0-next.202408271330" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" From 8e8dee3315e008840902e31f33f00512dead87f0 Mon Sep 17 00:00:00 2001 From: zowe-robot Date: Thu, 29 Aug 2024 15:44:41 +0000 Subject: [PATCH 27/34] Bump version to 8.0.0-next.202408291544 [ci skip] Signed-off-by: zowe-robot --- .../__packages__/cli-test-utils/package.json | 4 +- lerna.json | 2 +- npm-shrinkwrap.json | 122 +++++++++--------- packages/cli/package.json | 28 ++-- packages/core/package.json | 6 +- packages/imperative/CHANGELOG.md | 2 +- packages/imperative/package.json | 4 +- packages/provisioning/package.json | 8 +- packages/secrets/package.json | 2 +- packages/workflows/package.json | 10 +- packages/zosconsole/package.json | 8 +- packages/zosfiles/package.json | 10 +- packages/zosjobs/package.json | 10 +- packages/zoslogs/package.json | 8 +- packages/zosmf/package.json | 8 +- packages/zostso/package.json | 10 +- packages/zosuss/package.json | 6 +- 17 files changed, 124 insertions(+), 124 deletions(-) diff --git a/__tests__/__packages__/cli-test-utils/package.json b/__tests__/__packages__/cli-test-utils/package.json index 5d4cab14a7..d313d72c5a 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.202408271330", + "version": "8.0.0-next.202408291544", "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": "^10.0.0", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/imperative": "8.0.0-next.202408291544" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" diff --git a/lerna.json b/lerna.json index 415822a4f4..a0c03b25f8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "command": { "publish": { "ignoreChanges": [ diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0c90e33f11..afc2d16c49 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.202408271330", + "version": "8.0.0-next.202408291544", "license": "EPL-2.0", "dependencies": { "find-up": "^5.0.0", @@ -63,7 +63,7 @@ "devDependencies": { "@types/js-yaml": "^4.0.9", "@types/uuid": "^10.0.0", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/imperative": "8.0.0-next.202408291544" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" @@ -16365,21 +16365,21 @@ }, "packages/cli": { "name": "@zowe/cli", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "hasInstallScript": true, "license": "EPL-2.0", "dependencies": { - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330", - "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544", + "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408291544", "find-process": "1.4.7", "lodash": "4.17.21", "minimatch": "9.0.5", @@ -16392,7 +16392,7 @@ "@types/diff": "^5.0.9", "@types/lodash": "^4.17.6", "@types/tar": "^6.1.11", - "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/cli-test-utils": "8.0.0-next.202408291544", "comment-json": "^4.2.3", "strip-ansi": "^6.0.1", "which": "^4.0.0" @@ -16401,7 +16401,7 @@ "node": ">=18.12.0" }, "optionalDependencies": { - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408271330" + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408291544" } }, "packages/cli/node_modules/brace-expansion": { @@ -16448,15 +16448,15 @@ }, "packages/core": { "name": "@zowe/core-for-zowe-sdk", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "license": "EPL-2.0", "dependencies": { "comment-json": "~4.2.3", "string-width": "^4.2.3" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "engines": { "node": ">=18.12.0" @@ -16467,7 +16467,7 @@ }, "packages/imperative": { "name": "@zowe/imperative", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "license": "EPL-2.0", "dependencies": { "@types/yargs": "^17.0.32", @@ -16520,7 +16520,7 @@ "@types/pacote": "^11.1.8", "@types/progress": "^2.0.7", "@types/stack-trace": "^0.0.33", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408291544", "concurrently": "^8.0.0", "cowsay": "^1.6.0", "deep-diff": "^1.0.0", @@ -16661,16 +16661,16 @@ }, "packages/provisioning": { "name": "@zowe/provisioning-for-zowe-sdk", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "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.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "engines": { "node": ">=18.12.0" @@ -16682,7 +16682,7 @@ }, "packages/secrets": { "name": "@zowe/secrets-for-zowe-sdk", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "hasInstallScript": true, "license": "EPL-2.0", "devDependencies": { @@ -16695,15 +16695,15 @@ }, "packages/workflows": { "name": "@zowe/zos-workflows-for-zowe-sdk", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408271330" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408291544" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "engines": { "node": ">=18.12.0" @@ -16715,12 +16715,12 @@ }, "packages/zosconsole": { "name": "@zowe/zos-console-for-zowe-sdk", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "engines": { "node": ">=18.12.0" @@ -16732,16 +16732,16 @@ }, "packages/zosfiles": { "name": "@zowe/zos-files-for-zowe-sdk", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "license": "EPL-2.0", "dependencies": { "minimatch": "^9.0.5" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408291544" }, "engines": { "node": ">=18.12.0" @@ -16773,15 +16773,15 @@ }, "packages/zosjobs": { "name": "@zowe/zos-jobs-for-zowe-sdk", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408271330" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408291544" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "engines": { "node": ">=18.12.0" @@ -16793,12 +16793,12 @@ }, "packages/zoslogs": { "name": "@zowe/zos-logs-for-zowe-sdk", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "engines": { "node": ">=18.12.0" @@ -16810,12 +16810,12 @@ }, "packages/zosmf": { "name": "@zowe/zosmf-for-zowe-sdk", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "engines": { "node": ">=18.12.0" @@ -16827,15 +16827,15 @@ }, "packages/zostso": { "name": "@zowe/zos-tso-for-zowe-sdk", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "license": "EPL-2.0", "dependencies": { - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408271330" + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408291544" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "engines": { "node": ">=18.12.0" @@ -16847,15 +16847,15 @@ }, "packages/zosuss": { "name": "@zowe/zos-uss-for-zowe-sdk", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "license": "EPL-2.0", "dependencies": { "ssh2": "^1.15.0" }, "devDependencies": { "@types/ssh2": "^1.11.19", - "@zowe/cli-test-utils": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "engines": { "node": ">=18.12.0" diff --git a/packages/cli/package.json b/packages/cli/package.json index d4d842218c..f3cd980826 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/cli", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "zoweVersion": "v3.0.0-prerelease", "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.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330", - "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544", + "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408291544", "find-process": "1.4.7", "lodash": "4.17.21", "minimatch": "9.0.5", @@ -78,13 +78,13 @@ "@types/diff": "^5.0.9", "@types/lodash": "^4.17.6", "@types/tar": "^6.1.11", - "@zowe/cli-test-utils": "8.0.0-next.202408271330", + "@zowe/cli-test-utils": "8.0.0-next.202408291544", "comment-json": "^4.2.3", "strip-ansi": "^6.0.1", "which": "^4.0.0" }, "optionalDependencies": { - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408271330" + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408291544" }, "engines": { "node": ">=18.12.0" diff --git a/packages/core/package.json b/packages/core/package.json index bce2840be6..fab341dedf 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.202408271330", + "version": "8.0.0-next.202408291544", "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.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index e96d73655f..31e3b1db54 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Imperative package will be documented in this file. -## Recent Changes +## `8.0.0-next.202408291544` - Enhancement: Added a new SDK method (`ConfigSecure.secureFieldsForLayer`) to allow developers to get vault content in the context of the specified layer. [#2206](https://github.com/zowe/zowe-cli/issues/2206) - Enhancement: Added a new SDK method (`ProfileInfo.secureFieldsWithDetails`) to allow developers to the more details regarding the securely stored properties. [#2206](https://github.com/zowe/zowe-cli/issues/2206) diff --git a/packages/imperative/package.json b/packages/imperative/package.json index dad7f36ad3..a726a4e4c8 100644 --- a/packages/imperative/package.json +++ b/packages/imperative/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/imperative", - "version": "8.0.0-next.202408271330", + "version": "8.0.0-next.202408291544", "description": "framework for building configurable CLIs", "author": "Zowe", "license": "EPL-2.0", @@ -95,7 +95,7 @@ "@types/pacote": "^11.1.8", "@types/progress": "^2.0.7", "@types/stack-trace": "^0.0.33", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408271330", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408291544", "concurrently": "^8.0.0", "cowsay": "^1.6.0", "deep-diff": "^1.0.0", diff --git a/packages/provisioning/package.json b/packages/provisioning/package.json index 9b0d1ec793..0b5e370e95 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.202408271330", + "version": "8.0.0-next.202408291544", "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.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/secrets/package.json b/packages/secrets/package.json index 2c19496383..1d849e396d 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.202408271330", + "version": "8.0.0-next.202408291544", "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 470ea2ff14..b1e637f2ff 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.202408271330", + "version": "8.0.0-next.202408291544", "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.202408271330" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408291544" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosconsole/package.json b/packages/zosconsole/package.json index 7df35d2a55..be7342265e 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.202408271330", + "version": "8.0.0-next.202408291544", "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.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosfiles/package.json b/packages/zosfiles/package.json index b92d684360..77a63402a5 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.202408271330", + "version": "8.0.0-next.202408291544", "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.5" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408291544" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosjobs/package.json b/packages/zosjobs/package.json index 77bb62055d..d435f4a579 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.202408271330", + "version": "8.0.0-next.202408291544", "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.202408271330" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408291544" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zoslogs/package.json b/packages/zoslogs/package.json index 60c39014c3..583a095194 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.202408271330", + "version": "8.0.0-next.202408291544", "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.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosmf/package.json b/packages/zosmf/package.json index 9bfb60253f..5424557ca3 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.202408271330", + "version": "8.0.0-next.202408291544", "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.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zostso/package.json b/packages/zostso/package.json index 1e31fa5d82..20a41c55de 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.202408271330", + "version": "8.0.0-next.202408291544", "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.202408271330" + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408291544" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408271330", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosuss/package.json b/packages/zosuss/package.json index 1aa904d690..50d438ab12 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.202408271330", + "version": "8.0.0-next.202408291544", "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.202408271330", - "@zowe/imperative": "8.0.0-next.202408271330" + "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/imperative": "8.0.0-next.202408291544" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" From 1557332cdbb83342d0558c78d83a996641ffcc7c Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 29 Aug 2024 14:45:09 -0400 Subject: [PATCH 28/34] Remove remaining references to V1 profiles pt 2 Signed-off-by: Timothy Johnson --- packages/imperative/CHANGELOG.md | 9 +- .../CliProfileManager.integration.test.ts | 112 ----- .../CliProfileManagerTestConstants.ts | 124 ----- .../profiles/CliProfileManager.unit.test.ts | 182 -------- .../CommandProfileLoader.unit.test.ts | 113 ----- .../profiles/CommandProfiles.unit.test.ts | 91 ---- .../CommandProfiles.unit.test.ts.snap | 46 -- packages/imperative/src/cmd/index.ts | 3 - .../src/cmd/src/CommandProcessor.ts | 2 +- .../src/cmd/src/profiles/CliProfileManager.ts | 193 -------- .../cmd/src/profiles/CommandProfileLoader.ts | 120 ----- .../src/cmd/src/profiles/CommandProfiles.ts | 155 ------- .../src/imperative/src/api/ImperativeApi.ts | 18 - packages/imperative/src/profiles/index.ts | 6 - .../utils/__tests__/ProfileUtils.unit.test.ts | 2 +- .../src/utils/__tests__}/TestConstants.ts | 2 +- .../__tests__/V1ProfileRead.unit.test.ts | 2 +- .../__tests__/ProfileValidation.unit.test.ts | 429 ------------------ .../src/validation/api/ProfileValidator.ts | 415 ----------------- .../validation/doc/IProfileValidationPlan.ts | 29 -- .../doc/IProfileValidationReport.ts | 36 -- .../validation/doc/IProfileValidationTask.ts | 55 --- .../doc/IProfileValidationTaskResult.ts | 46 -- .../utilities/__tests__/CliUtils.unit.test.ts | 222 +++++---- .../__snapshots__/CliUtils.unit.test.ts.snap | 14 +- .../imperative/src/utilities/src/CliUtils.ts | 137 ++---- 26 files changed, 173 insertions(+), 2390 deletions(-) delete mode 100644 packages/imperative/__tests__/src/packages/cmd/__integration__/CliProfileManager.integration.test.ts delete mode 100644 packages/imperative/__tests__/src/packages/cmd/__integration__/CliProfileManagerTestConstants.ts delete mode 100644 packages/imperative/src/cmd/__tests__/profiles/CliProfileManager.unit.test.ts delete mode 100644 packages/imperative/src/cmd/__tests__/profiles/CommandProfileLoader.unit.test.ts delete mode 100644 packages/imperative/src/cmd/__tests__/profiles/CommandProfiles.unit.test.ts delete mode 100644 packages/imperative/src/cmd/__tests__/profiles/__snapshots__/CommandProfiles.unit.test.ts.snap delete mode 100644 packages/imperative/src/cmd/src/profiles/CliProfileManager.ts delete mode 100644 packages/imperative/src/cmd/src/profiles/CommandProfileLoader.ts delete mode 100644 packages/imperative/src/cmd/src/profiles/CommandProfiles.ts rename packages/imperative/src/{cmd/__tests__/profiles => profiles/src/utils/__tests__}/TestConstants.ts (99%) delete mode 100644 packages/imperative/src/profiles/src/validation/__tests__/ProfileValidation.unit.test.ts delete mode 100644 packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts delete mode 100644 packages/imperative/src/profiles/src/validation/doc/IProfileValidationPlan.ts delete mode 100644 packages/imperative/src/profiles/src/validation/doc/IProfileValidationReport.ts delete mode 100644 packages/imperative/src/profiles/src/validation/doc/IProfileValidationTask.ts delete mode 100644 packages/imperative/src/profiles/src/validation/doc/IProfileValidationTaskResult.ts diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 6b10c766c1..3896820ac4 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to the Imperative package will be documented in this file. +## Recent Changes + +- LTS Breaking: Removed the following obsolete V1 profile classes/functions: + - `CliProfileManager`, `CommandProfiles`, `ProfileValidator` - Use the `V1ProfileRead` class if you still need to read V1 profiles + - `CliUtils.getOptValueFromProfiles` - Use `getOptValuesFromConfig` instead to load from team config +- Next Breaking: Changed 2nd parameter of `CliUtils.getOptValuesFromConfig` method from type `ICommandDefinition` to `ICommandProfile`. + ## `8.0.0-next.202408271330` - LTS Breaking: [#2231](https://github.com/zowe/zowe-cli/issues/2231) @@ -10,8 +17,8 @@ All notable changes to the Imperative package will be documented in this file. - `IProfileTypeConfiguration.dependencies` - For team config, use nested profiles instead - `IProfileTypeConfiguration.validationPlanModule` - For team config, validate with JSON schema instead - Deprecated the following obsolete V1 profile classes/functions: + - `CliProfileManager`, `CommandProfiles`, `ProfileValidator` - Use the `V1ProfileRead` class if you still need to read V1 profiles - `CliUtils.getOptValueFromProfiles` - Use `getOptValuesFromConfig` instead to load from team config - - `CommandProfiles` - Use the `V1ProfileRead` class if you still need to read V1 profiles ## `8.0.0-next.202408231832` diff --git a/packages/imperative/__tests__/src/packages/cmd/__integration__/CliProfileManager.integration.test.ts b/packages/imperative/__tests__/src/packages/cmd/__integration__/CliProfileManager.integration.test.ts deleted file mode 100644 index 4f5ce662af..0000000000 --- a/packages/imperative/__tests__/src/packages/cmd/__integration__/CliProfileManager.integration.test.ts +++ /dev/null @@ -1,112 +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. -* -*/ - -/* eslint-disable deprecation/deprecation */ - -import * as TestUtil from "../../../TestUtil"; -import { TestLogger } from "../../../../src/TestLogger"; -import { CliProfileManager } from "../../../../../src/cmd/src/profiles/CliProfileManager"; -import { ICommandProfileTypeConfiguration } from "../../../../../src/cmd"; -import { ProfileUtils } from "../../../../../src/profiles"; -import { ITestEnvironment } from "../../../../__src__/environment/doc/response/ITestEnvironment"; -import { SetupTestEnvironment } from "../../../../__src__/environment/SetupTestEnvironment"; -import { bananaProfile, getConfig, PROFILE_TYPE } from "./CliProfileManagerTestConstants"; - -let TEST_ENVIRONMENT: ITestEnvironment; - -describe("Cli Profile Manager", () => { - const testLogger = TestLogger.getTestLogger(); - const profileTypeOne = "banana"; - - beforeAll(async () => { - TEST_ENVIRONMENT = await SetupTestEnvironment.createTestEnv({ - cliHomeEnvVar: "CMD_CLI_CLI_HOME", - testName: "basic_profile_mgr" - }); - }); - - afterAll(() => { - TestUtil.rimraf(TEST_ENVIRONMENT.workingDir); - }); - - it("should create a profile manager", async () => { - let caughtError: Error = new Error(""); - let newProfMgr; - - try { - // Create a manager instance - newProfMgr = new CliProfileManager({ - logger: TestLogger.getTestLogger(), - type: PROFILE_TYPE.BANANA, - typeConfigurations: [bananaProfile] - }); - } catch (e) { - caughtError = e; - TestLogger.error(caughtError.message); - } - - expect(newProfMgr).not.toBeNull(); - expect(caughtError.message).toEqual(""); - }); - - it("should be able to retrieve all defined types after init", async function () { - const Imperative = require("../../../../../src/imperative/src/Imperative").Imperative; - const ImperativeConfig = require("../../../../../src/utilities/src/ImperativeConfig").ImperativeConfig; - - const config = getConfig(TEST_ENVIRONMENT.workingDir); - await Imperative.init(config); - expect(ProfileUtils.getAllTypeNames(ImperativeConfig.instance.loadedConfig.profiles).length).toEqual(Object.keys(PROFILE_TYPE).length); - expect(ProfileUtils.getAllTypeNames(ImperativeConfig.instance.loadedConfig.profiles)).toContain("banana"); - }); - - it("should be able to automatically map command line options to " + - "profile fields without a handler for a simple single layer " + - "profile schema", async () => { - // use different option names than the field names - // of the profile to test that the properties are associated - // with the correct command line options - const configs: ICommandProfileTypeConfiguration[] = [{ - type: profileTypeOne, - schema: { - type: "object", - title: "test profile", - description: "test profile", - properties: { - property1: { - type: "number", - optionDefinition: { - name: "differentProperty1", type: "number", description: "property1" - } - }, - property2: { - type: "string", - optionDefinition: { - name: "differentProperty2", type: "string", description: "property2" - } - } - }, - required: ["property1"] - }, - }]; - - let caughtError; - try { - new CliProfileManager({ - type: profileTypeOne, - logger: testLogger, - typeConfigurations: configs - }); - } catch (error) { - caughtError = error; - } - expect(caughtError).toBeUndefined(); - }); -}); diff --git a/packages/imperative/__tests__/src/packages/cmd/__integration__/CliProfileManagerTestConstants.ts b/packages/imperative/__tests__/src/packages/cmd/__integration__/CliProfileManagerTestConstants.ts deleted file mode 100644 index a7e71d764f..0000000000 --- a/packages/imperative/__tests__/src/packages/cmd/__integration__/CliProfileManagerTestConstants.ts +++ /dev/null @@ -1,124 +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. -* -*/ - -import { IImperativeConfig } from "../../../../../src/index"; -import * as TestUtils from "../../../TestUtil"; -import { ICommandProfileTypeConfiguration } from "../../../../../src/cmd"; - -/** - * Get a config and set the home directory. - * @export - * @param {string} home - * @returns - */ -export function getConfig(home: string) { - const copy = JSON.parse(JSON.stringify(SAMPLE_IMPERATIVE_CONFIG_WITH_PROFILES)); - copy.defaultHome = home; - return copy; -} - -export const PROFILE_TYPE = { - BANANA: "banana", - SECURE_ORANGE: "secure_orange", - STRAWBERRY: "strawberry" -}; - -export const bananaProfile: ICommandProfileTypeConfiguration = { - type: PROFILE_TYPE.BANANA, - schema: { - type: "object", - title: "The Banana command profile schema", - description: "The Banana command profile schema", - properties: { - age: { - optionDefinition: { - description: "The age of the Banana", - type: "number", - name: "age", aliases: ["a"], - required: true - }, - type: "number", - }, - }, - required: ["age"] - } -}; - -const secureOrangeProfile: ICommandProfileTypeConfiguration = { - type: PROFILE_TYPE.SECURE_ORANGE, - schema: { - type: "object", - title: "The secure_orange command profile schema", - description: "The secure_orange command profile schema", - properties: { - username: { - optionDefinition: { - description: "The username of the secure_orange", - type: "string", - name: "username", - }, - type: "string", - }, - password: { - optionDefinition: { - description: "The password of the secure_orange", - type: "string", - name: "password", - }, - type: "string", - }, - }, - required: [] - } -}; - -const strawberryProfile: ICommandProfileTypeConfiguration = { - type: PROFILE_TYPE.STRAWBERRY, - schema: { - type: "object", - title: "The strawberry command profile schema", - description: "The strawberry command profile schema", - properties: { - age: { - optionDefinition: { - description: "The age of the strawberry", - type: "number", - name: "age", aliases: ["a"], - required: true - }, - type: "number", - }, - }, - required: ["age"] - } -}; - -export const PROFILE_TYPE_CONFIGURATION: ICommandProfileTypeConfiguration[] = [ - bananaProfile, - secureOrangeProfile, - strawberryProfile -]; - -export const BANANA_AGE: number = 1000; -export const SAMPLE_IMPERATIVE_CONFIG_WITH_PROFILES: IImperativeConfig = { - definitions: [ - { - name: "hello", - type: "command", - options: [], - description: "my command" - } - ], - productDisplayName: "My product (packagejson)", - defaultHome: TestUtils.TEST_HOME, - rootCommandDescription: "My Product CLI", - profiles: PROFILE_TYPE_CONFIGURATION -}; diff --git a/packages/imperative/src/cmd/__tests__/profiles/CliProfileManager.unit.test.ts b/packages/imperative/src/cmd/__tests__/profiles/CliProfileManager.unit.test.ts deleted file mode 100644 index 714dfc7d44..0000000000 --- a/packages/imperative/src/cmd/__tests__/profiles/CliProfileManager.unit.test.ts +++ /dev/null @@ -1,182 +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. -* -*/ - -/* eslint-disable deprecation/deprecation */ - -import { ImperativeError } from "../../../error"; -import { TestLogger } from "../../../../__tests__/src/TestLogger"; -import { APPLE_PROFILE_TYPE, ONLY_APPLE } from "./TestConstants"; -import { CliProfileManager } from "../../src/profiles/CliProfileManager"; -import { IProfileTypeConfiguration } from "../../../profiles/src/doc/config/IProfileTypeConfiguration"; - -describe("Basic Profile Manager Constructor", () => { - it("should detect no parms when instantiating", () => { - let error; - try { - new CliProfileManager(undefined as any); - } catch (e) { - error = e; - TestLogger.info(error); - } - expect(error instanceof ImperativeError).toBe(true); - expect(error.message).toContain("Expect Error: Profile Manager input parms not supplied"); - }); - - it("should detect that no type configuration is supplied", () => { - let error; - try { - new CliProfileManager({ - typeConfigurations: undefined, - type: APPLE_PROFILE_TYPE, - logger: TestLogger.getTestLogger() - }); - } catch (e) { - error = e; - TestLogger.info(error); - } - expect(error instanceof ImperativeError).toBe(true); - expect(error.message).toContain("V1 profiles are no longer read from disk. " + - "You can supply the profile type configurations to the profile manager constructor" - ); - }); - - it("should detect that the type configuration is an empty array", () => { - let error; - try { - new CliProfileManager({ - typeConfigurations: [], - type: APPLE_PROFILE_TYPE, - logger: TestLogger.getTestLogger() - }); - } catch (e) { - error = e; - TestLogger.info(error); - } - expect(error instanceof ImperativeError).toBe(true); - expect(error.message).toContain("V1 profiles are no longer read from disk. " + - "You can supply the profile type configurations to the profile manager constructor" - ); - }); - - it("should detect if the type is undefined", () => { - let error; - try { - new CliProfileManager({ - typeConfigurations: ONLY_APPLE, - type: undefined as any, - logger: TestLogger.getTestLogger() - }); - } catch (e) { - error = e; - TestLogger.info(error); - } - expect(error instanceof ImperativeError).toBe(true); - expect(error.message).toContain("Expect Error: No profile type supplied on the profile manager parameters"); - }); - - it("should detect if the type is blank", () => { - let error; - try { - new CliProfileManager({ - typeConfigurations: ONLY_APPLE, - type: " ", - logger: TestLogger.getTestLogger() - }); - } catch (e) { - error = e; - TestLogger.info(error); - } - expect(error instanceof ImperativeError).toBe(true); - expect(error.message).toContain("Expect Error: No profile type supplied on the profile manager parameters"); - }); - - it("should detect that a type not found within the configurations", () => { - let error; - try { - new CliProfileManager({ - typeConfigurations: ONLY_APPLE, - type: "bad_apple", - logger: TestLogger.getTestLogger() - }); - } catch (e) { - error = e; - TestLogger.info(error); - } - expect(error instanceof ImperativeError).toBe(true); - expect(error.message).toContain( - "Expect Error: Could not locate the profile type configuration for \"bad_apple\" within the input configuration list passed." - ); - }); - - it("should allow us to instantiate the cli profile manager", () => { - let error; - try { - new CliProfileManager({ - typeConfigurations: ONLY_APPLE, - type: APPLE_PROFILE_TYPE, - logger: TestLogger.getTestLogger() - }); - TestLogger.info("Profile Manager Created"); - } catch (e) { - error = e; - TestLogger.error(e); - } - expect(error).toBeUndefined(); - }); - - it("should detect that a schema definition document is attempting to overload 'type'", () => { - const copy: IProfileTypeConfiguration[] = JSON.parse(JSON.stringify(ONLY_APPLE)); - copy[0].schema.properties.type = {type: "boolean"}; - let caughtError; - try { - new CliProfileManager({ - typeConfigurations: ONLY_APPLE, - type: APPLE_PROFILE_TYPE, - logger: TestLogger.getTestLogger() - }); - } catch (error) { - caughtError = error; - } - expect(caughtError).toBeUndefined(); - }); - - it("should detect that a schema definition document is attempting to overload 'name'", () => { - const copy: IProfileTypeConfiguration[] = JSON.parse(JSON.stringify(ONLY_APPLE)); - copy[0].schema.properties.name = {type: "boolean"}; - let caughtError; - try { - new CliProfileManager({ - typeConfigurations: ONLY_APPLE, - type: APPLE_PROFILE_TYPE, - logger: TestLogger.getTestLogger() - }); - } catch (error) { - caughtError = error; - } - expect(caughtError).toBeUndefined(); - }); - - it("should detect that a schema definition document is attempting to overload 'dependencies'", () => { - const copy: IProfileTypeConfiguration[] = JSON.parse(JSON.stringify(ONLY_APPLE)); - copy[0].schema.properties.dependencies = {type: "boolean"}; - let caughtError; - try { - new CliProfileManager({ - typeConfigurations: ONLY_APPLE, - type: APPLE_PROFILE_TYPE, - logger: TestLogger.getTestLogger() - }); - } catch (error) { - caughtError = error; - } - expect(caughtError).toBeUndefined(); - }); -}); diff --git a/packages/imperative/src/cmd/__tests__/profiles/CommandProfileLoader.unit.test.ts b/packages/imperative/src/cmd/__tests__/profiles/CommandProfileLoader.unit.test.ts deleted file mode 100644 index a23e844942..0000000000 --- a/packages/imperative/src/cmd/__tests__/profiles/CommandProfileLoader.unit.test.ts +++ /dev/null @@ -1,113 +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. -* -*/ - -/* eslint-disable deprecation/deprecation */ - -import { CommandProfileLoader } from "../../src/profiles/CommandProfileLoader"; -import { ICommandDefinition } from "../../src/doc/ICommandDefinition"; -import { TestLogger } from "../../../../__tests__/src/TestLogger"; -import { CommandProfiles } from "../../src/profiles/CommandProfiles"; -import { ImperativeError } from "../../../error"; -import { IProfile, IProfileLoaded } from "../../../profiles"; - -const PROFILE_BANANA_TYPE: string = "banana"; - -const SAMPLE_COMMAND_NO_PROFILE: ICommandDefinition = { - name: PROFILE_BANANA_TYPE, - description: "The banana command", - type: "command" -}; - -const SAMPLE_COMMAND_PROFILE: ICommandDefinition = { - name: PROFILE_BANANA_TYPE, - description: "The banana command", - type: "command", - profile: { - required: [PROFILE_BANANA_TYPE] - } -}; - -describe("Command Profile Loader", () => { - - it("should allow us to create an instance", () => { - const loader = CommandProfileLoader.loader({ - commandDefinition: SAMPLE_COMMAND_NO_PROFILE, - logger: TestLogger.getTestLogger() - }); - expect(loader).toBeDefined(); - }); - - it("should allow us to create an instance and load nothing", async () => { - const loaded: CommandProfiles = await CommandProfileLoader.loader({ - commandDefinition: SAMPLE_COMMAND_NO_PROFILE, - logger: TestLogger.getTestLogger() - }).loadProfiles({ _: undefined as any, $0: undefined as any }); - expect(loaded).toBeDefined(); - }); - - it("should allow us to create an instance without a logger", () => { - const loader = CommandProfileLoader.loader({ - commandDefinition: SAMPLE_COMMAND_NO_PROFILE, - }); - expect(loader).toBeDefined(); - }); - - it("should allow us to create an instance (directly with constructor)", () => { - const loader = new CommandProfileLoader(SAMPLE_COMMAND_NO_PROFILE); - expect(loader).toBeDefined(); - }); - - it("should detect a bad logger instance", () => { - let error; - try { - let logger: any = TestLogger.getTestLogger(); - logger = {bad: "logger"}; - CommandProfileLoader.loader({ - commandDefinition: SAMPLE_COMMAND_NO_PROFILE, - logger - }); - } catch (e) { - error = e; - } - expect(error).toBeDefined(); - expect(error instanceof ImperativeError).toBe(true); - expect(error.message).toContain('Expect Error: Could not construct the profile loader. The "logger" supplied is not of type Logger.'); - }); - - it("should detect missing command definitions when creating the loader", () => { - let error; - try { - CommandProfileLoader.loader({ - commandDefinition: undefined as any, - logger: TestLogger.getTestLogger() - }); - } catch (e) { - error = e; - } - expect(error).toBeDefined(); - expect(error instanceof ImperativeError).toBe(true); - expect(error.message).toContain("Expect Error: Could not construct the profile loader. No command definition supplied."); - }); - - it("should never read V1 profiles", async () => { - const emptyProfileMap: Map = new Map(); - const emptyProfileMetaMap: Map = new Map(); - const noProfilesLoaded = new CommandProfiles(emptyProfileMap, emptyProfileMetaMap); - - // because we have a team config, we should load no old-scemptyProfileMaphool profiles - const loadedCmdProfiles: CommandProfiles = await CommandProfileLoader.loader({ - commandDefinition: SAMPLE_COMMAND_PROFILE, - logger: TestLogger.getTestLogger() - }).loadProfiles({ _: undefined as any, $0: undefined as any }); - - expect(loadedCmdProfiles).toEqual(noProfilesLoaded); - }); -}); diff --git a/packages/imperative/src/cmd/__tests__/profiles/CommandProfiles.unit.test.ts b/packages/imperative/src/cmd/__tests__/profiles/CommandProfiles.unit.test.ts deleted file mode 100644 index a8d2397c8a..0000000000 --- a/packages/imperative/src/cmd/__tests__/profiles/CommandProfiles.unit.test.ts +++ /dev/null @@ -1,91 +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. -* -*/ - -/* eslint-disable deprecation/deprecation */ - -import { IProfile, IProfileLoaded } from "../../../profiles"; -import { CommandProfiles } from "../../src/profiles/CommandProfiles"; -import { ImperativeError } from "../../../error"; - -const BANANA_PROFILE_TYPE: string = "banana"; -const STRAWBERRY_PROFILE_TYPE: string = "strawberry"; - -describe("Command Profiles", () => { - it("should should allow us to create an instance", () => { - let caughtError; - try { - const profiles = new CommandProfiles(new Map()); - } catch (error) { - caughtError = error; - } - expect(caughtError).toBeUndefined(); - }); - - it("should allow us to create an instance with map values", () => { - const map = new Map(); - map.set(STRAWBERRY_PROFILE_TYPE, [{ - name: "great", - type: STRAWBERRY_PROFILE_TYPE, - age: 1 - }, { - name: "awesome", - type: STRAWBERRY_PROFILE_TYPE, - age: 2 - }]); - const metaMap = new Map(); - metaMap.set(STRAWBERRY_PROFILE_TYPE, [{ - name: "great", - type: STRAWBERRY_PROFILE_TYPE, - profile: { - age: 1 - }, - message: "just right", - failNotFound: false - }, - { - name: "gross", - type: STRAWBERRY_PROFILE_TYPE, - profile: { - age: 3 - }, - message: "too old", - failNotFound: false - }]); - - const profiles = new CommandProfiles(map, metaMap); - expect(profiles).toMatchSnapshot(); - }); - - it("should detect missing parameters", () => { - let error; - try { - new CommandProfiles(undefined); - } catch (e) { - error = e; - } - expect(error).toBeDefined(); - expect(error instanceof ImperativeError).toBe(true); - expect(error.message).toMatchSnapshot(); - }); - - it("should detect that the parameters are not a map", () => { - let error; - try { - const map = { not: "a-map" }; - new CommandProfiles(map as any); - } catch (e) { - error = e; - } - expect(error).toBeDefined(); - expect(error instanceof ImperativeError).toBe(true); - expect(error.message).toMatchSnapshot(); - }); -}); diff --git a/packages/imperative/src/cmd/__tests__/profiles/__snapshots__/CommandProfiles.unit.test.ts.snap b/packages/imperative/src/cmd/__tests__/profiles/__snapshots__/CommandProfiles.unit.test.ts.snap deleted file mode 100644 index ce0dc5c975..0000000000 --- a/packages/imperative/src/cmd/__tests__/profiles/__snapshots__/CommandProfiles.unit.test.ts.snap +++ /dev/null @@ -1,46 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Command Profiles should allow us to create an instance with map values 1`] = ` -CommandProfiles { - "mMap": Map { - "strawberry" => Array [ - Object { - "age": 1, - "name": "great", - "type": "strawberry", - }, - Object { - "age": 2, - "name": "awesome", - "type": "strawberry", - }, - ], - }, - "mMetaMap": Map { - "strawberry" => Array [ - Object { - "failNotFound": false, - "message": "just right", - "name": "great", - "profile": Object { - "age": 1, - }, - "type": "strawberry", - }, - Object { - "failNotFound": false, - "message": "too old", - "name": "gross", - "profile": Object { - "age": 3, - }, - "type": "strawberry", - }, - ], - }, -} -`; - -exports[`Command Profiles should detect missing parameters 1`] = `"Expect Error: Command Profiles Internal Error: No map was supplied."`; - -exports[`Command Profiles should detect that the parameters are not a map 1`] = `"Expect Error: Command Profiles Internal Error: The \\"map\\" supplied is not an instance of a map."`; diff --git a/packages/imperative/src/cmd/index.ts b/packages/imperative/src/cmd/index.ts index db5ee98923..d09801e1dc 100644 --- a/packages/imperative/src/cmd/index.ts +++ b/packages/imperative/src/cmd/index.ts @@ -54,8 +54,6 @@ export * from "./src/help/WebHelpGenerator"; 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/utils/CommandUtils"; @@ -73,7 +71,6 @@ export * from "./src/profiles/CliProfileManager"; // 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/CommandProcessor.ts b/packages/imperative/src/cmd/src/CommandProcessor.ts index 5ff82ff5eb..a3d0f077d0 100644 --- a/packages/imperative/src/cmd/src/CommandProcessor.ts +++ b/packages/imperative/src/cmd/src/CommandProcessor.ts @@ -898,7 +898,7 @@ export class CommandProcessor { // Build an object that contains all the options loaded from config if (this.mConfig != null) { // Merge the arguments from the config into the CLI args - const profArgs = CliUtils.getOptValuesFromConfig(this.mConfig, this.definition, args, allOpts); + const profArgs = CliUtils.getOptValuesFromConfig(this.mConfig, this.definition.profile, args, allOpts); this.log.trace(`Arguments extracted from the config:\n${inspect(profArgs)}`); args = CliUtils.mergeArguments(profArgs, args); } diff --git a/packages/imperative/src/cmd/src/profiles/CliProfileManager.ts b/packages/imperative/src/cmd/src/profiles/CliProfileManager.ts deleted file mode 100644 index 82c97f0c94..0000000000 --- a/packages/imperative/src/cmd/src/profiles/CliProfileManager.ts +++ /dev/null @@ -1,193 +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. -* -*/ - -import { ImperativeExpect } from "../../../expect"; -import { inspect } from "util"; -import { Logger } from "../../../logger"; -import { ImperativeError } from "../../../error"; -import { ICommandProfileTypeConfiguration } from "../doc/profiles/definition/ICommandProfileTypeConfiguration"; -import { - IProfileManager, - IProfileSchema, -} from "../../../profiles/src/doc"; - -/** - * The CLI profile manager contains methods to manage Zowe profiles. Profiles - * are user configuration documents intended to be used on commands, as a convenience, to supply a slew of additional - * input and configuration (normally more than would be feasible as command arguments). See the "IProfile" interface - * for a detailed description of profiles, their use case, and examples. - * - * The Profile Manager no longer reads V1 profile from disk. It only processes profile information from a - * command's definition. The Config class now handles reading profiles from disk stored in a zowe.config.json file. - * @deprecated Use the `V1ProfileRead` class if you still need to read V1 profiles - */ -export class CliProfileManager { - /** - * Parameters passed on the constructor (normally used to create additional instances of profile manager objects) - * @private - * @type {IProfileManager} - * @memberof CliProfileManager - */ - private mConstructorParms: IProfileManager; - - /** - * The full set of profile type configurations. The manager needs to ensure that A) the profile type configuration - * is among the set (because it contains schema and dependency specifications) and B) That other type configurations - * are available. - * @private - * @type {ICommandProfileTypeConfiguration[]} - * @memberof CliProfileManager - */ - private mProfileTypeConfigurations: ICommandProfileTypeConfiguration[]; - - /** - * The profile "type" for this manager - indicating the profile/schema that this manager is working directly with. - * @private - * @type {string} - * @memberof CliProfileManager - */ - private mProfileType: string; - - /** - * Product display name of the CLI. - * @private - * @type {string} - * @memberof CliProfileManager - */ - private mProductDisplayName: string; - - /** - * Logger instance - must be log4js compatible. Can be the Imperative logger (normally), but is required for - * profile manager operation. - * @private - * @type {Logger} - * @memberof CliProfileManager - */ - private mLogger: Logger = Logger.getImperativeLogger(); - - /** - * Creates an instance of ProfileManager - Performs basic parameter validation. - * It accepts the type definitions passed on the constructor parameters. - * - * @param {IProfileManager} parms - See the interface for details. - * @memberof ProfileManager - */ - constructor(parms: IProfileManager) { - ImperativeExpect.toNotBeNullOrUndefined(parms, "Profile Manager input parms not supplied."); - ImperativeExpect.keysToBeDefinedAndNonBlank(parms, ["type"], - "No profile type supplied on the profile manager parameters."); - this.mLogger = parms.logger == null ? this.mLogger : parms.logger; - this.mProfileType = parms.type; - this.mProfileTypeConfigurations = parms.typeConfigurations; - this.mProductDisplayName = parms.productDisplayName; - if (this.profileTypeConfigurations == null || this.profileTypeConfigurations.length === 0) { - throw new ImperativeError({ - msg: "V1 profiles are no longer read from disk. " + - "You can supply the profile type configurations to the profile manager constructor." - }); - } - this.mConstructorParms = parms; - ImperativeExpect.arrayToContain(this.mProfileTypeConfigurations, (entry) => { - return entry.type === this.mProfileType; - }, `Could not locate the profile type configuration for "${this.profileType}" within the input configuration list passed.` + - `\n${inspect(this.profileTypeConfigurations, { depth: null })}`); - for (const config of this.profileTypeConfigurations) { - this.validateConfigurationDocument(config); - } - } - - /** - * Accessor for the logger instance - passed on the constructor - * @readonly - * @protected - * @type {Logger} - * @memberof CliProfileManager - */ - protected get log(): Logger { - return this.mLogger; - } - - /** - * Accessor for the profile type specified on the constructor. - * @readonly - * @protected - * @type {string} - * @memberof CliProfileManager - */ - protected get profileType(): string { - return this.mProfileType; - } - - /** - * Accesor for the product display name. - * @readonly - * @protected - * @type {string} - * @memberof CliProfileManager - */ - protected get productDisplayName(): string { - return this.mProductDisplayName; - } - - /** - * Accessor for the full set of type configurations - passed on the constructor. - * @readonly - * @protected - * @type {ICommandProfileTypeConfiguration[]} - * @memberof CliProfileManager - */ - protected get profileTypeConfigurations(): ICommandProfileTypeConfiguration[] { - return this.mProfileTypeConfigurations; - } - - /** - * Validate that the schema document passed is well formed for the profile manager usage. Ensures that the - * schema is not overloading reserved properties. - * @private - * @param {IProfileSchema} schema - The schema document to validate. - * @param type - the type of profile for the schema - defaults to the current type for this manager - * @memberof CliProfileManager - */ - private validateSchema(schema: IProfileSchema, type = this.profileType) { - ImperativeExpect.keysToBeDefined(schema, ["properties"], `The schema document supplied for the profile type ` + - `("${type}") does NOT contain properties.`); - ImperativeExpect.keysToBeUndefined(schema, ["properties.dependencies"], `The schema "properties" property ` + - `(on configuration document for type "${type}") contains "dependencies". ` + - `"dependencies" is must be supplied as part of the "type" configuration document (no need to formulate the dependencies ` + - `schema yourself).`); - } - - /** - * Validates the basic configuration document to ensure it contains all the proper fields - * @private - * @param {ICommandProfileTypeConfiguration} typeConfiguration - The type configuration document - * @memberof CliProfileManager - */ - private validateConfigurationDocument(typeConfiguration: ICommandProfileTypeConfiguration) { - ImperativeExpect.keysToBeDefinedAndNonBlank(typeConfiguration, ["type"], `The profile type configuration document for ` + - `"${typeConfiguration.type}" does NOT contain a type.`); - ImperativeExpect.keysToBeDefined(typeConfiguration, ["schema"], `The profile type configuration document for ` + - `"${typeConfiguration.type}" does NOT contain a schema.`); - this.validateSchema(typeConfiguration.schema, typeConfiguration.type); - // eslint-disable-next-line deprecation/deprecation - if (!(typeConfiguration.dependencies == null)) { - // eslint-disable-next-line deprecation/deprecation - ImperativeExpect.toBeAnArray(typeConfiguration.dependencies, - `The profile type configuration for "${typeConfiguration.type}" contains a "dependencies" property, ` + - `but it is not an array (ill-formed)`); - // eslint-disable-next-line deprecation/deprecation - for (const dep of typeConfiguration.dependencies) { - ImperativeExpect.keysToBeDefinedAndNonBlank(dep, ["type"], "A dependency specified for the " + - "profile definitions did not contain a type."); - } - } - } -} diff --git a/packages/imperative/src/cmd/src/profiles/CommandProfileLoader.ts b/packages/imperative/src/cmd/src/profiles/CommandProfileLoader.ts deleted file mode 100644 index 2db7b75422..0000000000 --- a/packages/imperative/src/cmd/src/profiles/CommandProfileLoader.ts +++ /dev/null @@ -1,120 +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. -* -*/ - -import { Arguments } from "yargs"; -import { ICommandDefinition } from "../doc/ICommandDefinition"; -import { IProfile, IProfileLoaded } from "../../../profiles"; -import { CommandProfiles } from "./CommandProfiles"; -import { inspect } from "util"; -import { ICommandProfileLoaderParms } from "../doc/profiles/parms/ICommandProfileLoaderParms"; -import { Logger } from "../../../logger"; -import { ImperativeExpect } from "../../../expect"; - -/** - * The command processor profile loader loads all profiles that are required (or optional) given a command - * definitions requirements. It returns the CommandProfiles object (which contains the map and getters for the - * command handlers usage). - * @internal - * @class CommandProfileLoader - * @deprecated Use the `V1ProfileRead` class if you still need to read V1 profiles - */ -export class CommandProfileLoader { - /** - * Create a new instance of the profile loader - * @static - * @param {ICommandProfileLoaderParms} parms - contains command definition and logger - * @returns - * @memberof CommandProfileLoader - */ - public static loader(parms: ICommandProfileLoaderParms) { - // eslint-disable-next-line deprecation/deprecation - return new CommandProfileLoader(parms.commandDefinition, parms.logger || Logger.getImperativeLogger()); - } - - /** - * The input command definition for the command being issued. - * @private - * @type {ICommandDefinition} - * @memberof CommandProfileLoader - */ - private mCommandDefinition: ICommandDefinition; - - /** - * Logger - supplied on the constructor - but defaults to the Imperative logger. - * @private - * @type {Logger} - * @memberof CommandProfileLoader - */ - private mLog: Logger; - - /** - * Creates an instance of CommandProfileLoader. - * @param {ICommandDefinition} commandDefinition - The input command definition for the command being issued. - * @param {any} [logger=Logger.getImperativeLogger()] - A log4js instance - * @memberof CommandProfileLoader - */ - constructor(commandDefinition: ICommandDefinition, logger = Logger.getImperativeLogger()) { - const err: string = "Could not construct the profile loader."; - ImperativeExpect.toNotBeNullOrUndefined(commandDefinition, `${err} No command definition supplied.`); - this.mCommandDefinition = commandDefinition; - ImperativeExpect.toBeEqual(logger instanceof Logger, true, `${err} The "logger" supplied is not of type Logger.`); - this.mLog = logger; - this.log.trace(`Profile loader created for command: ${commandDefinition.name}`); - } - - /** - * Load the profiles for the command - the command arguments are supplied to grab the profile names from - * the arguments supplied by the user. - * @param {Arguments} commandArguments - The command arguments supplied on this command invocation (Yargs style) - * @returns {Promise} - The promise is fulfilled with the map object OR rejected with an - * Imperative error - * @memberof CommandProfileLoader - */ - // eslint-disable-next-line deprecation/deprecation - public async loadProfiles(commandArguments: Arguments): Promise { - // Validate parms - ImperativeExpect.toNotBeNullOrUndefined(commandArguments, `Could not load profiles. No command arguments supplied.`); - - // Log the API call - this.log.info(`Request to load profiles for command: ${this.definition.name}...`); - this.log.trace(`Profile load arguments supplied:\n${inspect(commandArguments, {depth: null})}`); - - // Create the map that eventually will be returned - const profileMap: Map = new Map(); - const profileMetaMap: Map = new Map(); - - // We no longer read V1 profile files, so just return empty maps - // eslint-disable-next-line deprecation/deprecation - return new CommandProfiles(profileMap, profileMetaMap); - } - - /** - * Accessor for the command definition document - * @readonly - * @private - * @type {ICommandDefinition} - * @memberof CommandProfileLoader - */ - private get definition(): ICommandDefinition { - return this.mCommandDefinition; - } - - /** - * Accessor for the logging object - * @readonly - * @private - * @type {Logger} - * @memberof CommandProfileLoader - */ - private get log(): Logger { - return this.mLog; - } -} diff --git a/packages/imperative/src/cmd/src/profiles/CommandProfiles.ts b/packages/imperative/src/cmd/src/profiles/CommandProfiles.ts deleted file mode 100644 index e57a267d41..0000000000 --- a/packages/imperative/src/cmd/src/profiles/CommandProfiles.ts +++ /dev/null @@ -1,155 +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. -* -*/ - -import { ImperativeError } from "../../../error"; -import { IProfile, IProfileLoaded } from "../../../profiles"; -import { ImperativeExpect } from "../../../expect"; - -/** - * Profiles map created by the command profile loader and passed to the handler via parameters. Handlers can - * retrieve loaded profiles from the map via the profile type. - * @class CommandProfiles - * @deprecated Use the `V1ProfileRead` class if you still need to read V1 profiles - */ -export class CommandProfiles { - /** - * The loaded profiles map - profiles are retrieved via the type key. More than one profile of a particular type - * can be loaded by the command processor (depending on dependencies, etc.) - * @private - * @type {Map} - * @memberof CommandProfiles - */ - private mMap: Map; - - /** - * The loaded profiles map with meta info - profiles are retrieved via the type key. More than one profile of a particular type - * can be loaded by the command processor (depending on dependencies, etc.) - * @private - * @type {Map} - * @memberof CommandProfiles - */ - private mMetaMap: Map = new Map(); - - /** - * Creates an instance of CommandProfiles. - * @param {Map} map - The map of profiles - * @memberof CommandProfiles - */ - constructor(map: Map, metaMap?: Map) { - // Simple validation of input parameters - const err: string = "Command Profiles Internal Error:"; - ImperativeExpect.toNotBeNullOrUndefined(map, `${err} No map was supplied.`); - ImperativeExpect.toBeEqual(map instanceof Map, true, `${err} The "map" supplied is not an instance of a map.`); - - // Ensure the correctness of each map entry - map.forEach((value, key) => { - ImperativeExpect.toBeAnArray(value, `${err} The "profiles" supplied for type "${key}" is NOT an array.`); - ImperativeExpect.toBeEqual(value.length > 0, true, `${err} No profiles supplied for type "${key}".`); - }); - this.mMap = map; - - if (metaMap) { - this.addMeta(metaMap); - } - } - - /** - * Add to an instance of CommandProfiles - * @private - * @param {Map} map - The map of profiles with meta information - * @memberof CommandProfiles - */ - private addMeta(map: Map) { - // Simple validation of input parameters - const err: string = "Command Profiles Internal Error:"; - ImperativeExpect.toNotBeNullOrUndefined(map, `${err} No map was supplied.`); - ImperativeExpect.toBeEqual(map instanceof Map, true, `${err} The "map" supplied is not an instance of a map.`); - - // Ensure the correctness of each map entry - map.forEach((value, key) => { - ImperativeExpect.toBeAnArray(value, `${err} The "profiles" supplied for type "${key}" is NOT an array.`); - ImperativeExpect.toBeEqual(value.length > 0, true, `${err} No profiles supplied for type "${key}".`); - }); - this.mMetaMap = map; - } - - /** - * Internal accessor for the map - * @readonly - * @private - * @type {Map} - The profile Map - * @memberof CommandProfiles - */ - private get map(): Map { - return this.mMap; - } - - /** - * Gets the first (or by name) profile in the map - automatically throws an exception (unless disabled) - * @template T - The expected profile mapping to be returned - * @param {string} type - The profile type - * @param {string} [name=""] - The name of the profile to retrieve - * @param {boolean} [failNotFound=true] - Automatically throws an imperative exception if not profiles are not - * found - this is provided as convince for the handlers (will fail your command if not found) - This would - * normally be the result of a command configuration problem. - * @returns {T} - The first profile in the map (or the one located by name) - * @memberof CommandProfiles - */ - public get(type: string, failNotFound = true, name = ""): T { - let profile: IProfile; - // If a profile is returned for the type, then we'll check if a profile of a specific name was requseted - // if not, just return the first profile found (first loaded) - if (this.map.get(type) != null) { - if (name != null && name.trim().length > 0) { - for (const prof of this.map.get(type)) { - - if (prof.name === name) { - profile = prof; - break; - } - } - } else { - profile = this.map.get(type)[0]; - } - } else if (failNotFound) { - this.fail(type); - } - return profile as T; - } - - /** - * Internal accessor for the meta map - * @readonly - * @private - * @type {Map} - The profile Map - * @memberof CommandProfiles - */ - private get metaMap(): Map { - return this.mMetaMap; - } - - /** - * Throw an error failing the get(requested by the caller if no profiles are available) - * @private - * @param {string} type - the profile type to get from the map - * @memberof CommandProfiles - */ - private fail(type: string) { - throw new ImperativeError({ - msg: `Internal Error: No profiles of type "${type}" were loaded for this command.`, - additionalDetails: `This error can occur for one of two reasons:\n` + - ` - The "profile" property on the command definition document ` + - `does NOT specify the requested profile type\n` + - ` - The profile type is marked "optional", no profiles of type "${type}" have been created, ` + - `and the command handler requested a profile of type "${type}" with "failNotFound=true"` - }); - } -} diff --git a/packages/imperative/src/imperative/src/api/ImperativeApi.ts b/packages/imperative/src/imperative/src/api/ImperativeApi.ts index 3f9e3b49a4..3fb75a82d9 100644 --- a/packages/imperative/src/imperative/src/api/ImperativeApi.ts +++ b/packages/imperative/src/imperative/src/api/ImperativeApi.ts @@ -12,7 +12,6 @@ import { IImperativeConfig } from "../doc/IImperativeConfig"; import { IImperativeApi } from "./doc/IImperativeApi"; import { Logger } from "../../../logger"; -import { CliProfileManager } from "../../../cmd"; export class ImperativeApi { /** @@ -63,21 +62,4 @@ export class ImperativeApi { public addAdditionalLogger(name: string, logger: Logger): void { this.mCustomLoggerMap[name] = logger; } - - /** - * Return an instance of a profile manager for a given profile type - * See ProfileManager.ts for more details - * @internal - * @deprecated Use the `V1ProfileRead` class if you still need to read V1 profiles - */ - // eslint-disable-next-line deprecation/deprecation - public profileManager(type: string): CliProfileManager { - // eslint-disable-next-line deprecation/deprecation - return new CliProfileManager({ - type, - typeConfigurations: this.mConfig.profiles, - logger: this.imperativeLogger, - productDisplayName: this.mConfig.productDisplayName - }); - } } diff --git a/packages/imperative/src/profiles/index.ts b/packages/imperative/src/profiles/index.ts index 5d88f7458d..ec970a46f5 100644 --- a/packages/imperative/src/profiles/index.ts +++ b/packages/imperative/src/profiles/index.ts @@ -24,9 +24,3 @@ export * from "./src/doc/response/IProfileLoaded"; export * from "./src/utils/V1ProfileRead"; export * from "./src/utils/ProfileUtils"; - -export * from "./src/validation/doc/IProfileValidationPlan"; -export * from "./src/validation/doc/IProfileValidationReport"; -export * from "./src/validation/doc/IProfileValidationTask"; -export * from "./src/validation/doc/IProfileValidationTaskResult"; - diff --git a/packages/imperative/src/profiles/src/utils/__tests__/ProfileUtils.unit.test.ts b/packages/imperative/src/profiles/src/utils/__tests__/ProfileUtils.unit.test.ts index bfec2d8667..3b778b7e64 100644 --- a/packages/imperative/src/profiles/src/utils/__tests__/ProfileUtils.unit.test.ts +++ b/packages/imperative/src/profiles/src/utils/__tests__/ProfileUtils.unit.test.ts @@ -16,7 +16,7 @@ import * as path from "path"; import { IProfileLoaded } from "../../../../index"; import { APPLE_TWO_REQ_DEP_BANANA_ONE_REQ_DEP_GRAPE_ONE_REQ_DEP, BLUEBERRY_PROFILE_TYPE -} from "../../../../cmd/__tests__/profiles/TestConstants"; +} from "./TestConstants"; const mocks = { normalize: path.normalize as unknown as Mock diff --git a/packages/imperative/src/cmd/__tests__/profiles/TestConstants.ts b/packages/imperative/src/profiles/src/utils/__tests__/TestConstants.ts similarity index 99% rename from packages/imperative/src/cmd/__tests__/profiles/TestConstants.ts rename to packages/imperative/src/profiles/src/utils/__tests__/TestConstants.ts index 1258fa22a0..06a6eb8c18 100644 --- a/packages/imperative/src/cmd/__tests__/profiles/TestConstants.ts +++ b/packages/imperative/src/profiles/src/utils/__tests__/TestConstants.ts @@ -9,7 +9,7 @@ * */ -import { IProfileTypeConfiguration } from "../../../profiles/src/doc/config/IProfileTypeConfiguration"; +import { IProfileTypeConfiguration } from "../../../src/doc/config/IProfileTypeConfiguration"; export const TEST_PROFILE_ROOT_DIR: string = "__tests__/__results__/test_profiles/root/dir/"; diff --git a/packages/imperative/src/profiles/src/utils/__tests__/V1ProfileRead.unit.test.ts b/packages/imperative/src/profiles/src/utils/__tests__/V1ProfileRead.unit.test.ts index 2e96d07811..7596d3cafe 100644 --- a/packages/imperative/src/profiles/src/utils/__tests__/V1ProfileRead.unit.test.ts +++ b/packages/imperative/src/profiles/src/utils/__tests__/V1ProfileRead.unit.test.ts @@ -23,7 +23,7 @@ import { BLUEBERRY_PROFILE_TYPE, BLUEBERRY_TYPE_SCHEMA, STRAWBERRY_PROFILE_TYPE -} from "../../../../cmd/__tests__/profiles/TestConstants"; +} from "./TestConstants"; import { IProfile } from "../../../../index"; import { ImperativeConfig } from "../../../../utilities"; diff --git a/packages/imperative/src/profiles/src/validation/__tests__/ProfileValidation.unit.test.ts b/packages/imperative/src/profiles/src/validation/__tests__/ProfileValidation.unit.test.ts deleted file mode 100644 index a36defb065..0000000000 --- a/packages/imperative/src/profiles/src/validation/__tests__/ProfileValidation.unit.test.ts +++ /dev/null @@ -1,429 +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. -* -*/ - -/* eslint-disable deprecation/deprecation */ - -import { inspect } from "util"; -import { TestLogger } from "../../../../../__tests__/src/TestLogger"; -import { IProfile } from "../../doc/definition/IProfile"; -import { IProfileValidationPlan } from "../doc/IProfileValidationPlan"; -import { IProfileValidationReport } from "../doc/IProfileValidationReport"; -import { IProfileValidationTaskResult } from "../doc/IProfileValidationTaskResult"; -import { ProfileValidator } from "../api/ProfileValidator"; -import { IProfileValidationTask } from "../../.."; - -jest.mock("../../../../imperative/src/Imperative"); - - -const oldForceColorOption = process.env.FORCE_COLOR; - -describe("We should provide the ability to validate Imperative CLI profiles by trying out different APIs", () => { - beforeAll(async () => { - process.env.FORCE_COLOR = "0"; - }); - const displayName = "dummy"; - afterAll(() => { - process.env.FORCE_COLOR = oldForceColorOption; - } - ); - const dummyProfile: IProfile = {name: "dummy", type: "dummy"}; - - it("If we have a mock plan with a failing parent test, the validation should fail and " + - "none of the tasks dependent on the failing task should run ", () => { - let anyTaskRun = false; - const plan: IProfileValidationPlan = { - tasks: [{ - name: "Master task", - description: "This will fail, and none of the rest should run ", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - done({ - outcome: "Failed", - resultDescription: "Failing master task" - }); - }, - dependentTasks: [ - { - name: "Task one", - description: "First task which should not run", - taskFunction: async (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - anyTaskRun = true; // shouldn't happen! - done({ - outcome: "Warning", - resultDescription: "This should not run!" - }); - }, - dependentTasks: [ - { - name: "Task two", - description: "Two level nested task", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - anyTaskRun = true; // shouldn't happen! - done({ - outcome: "Warning", - resultDescription: "This should not run!" - }); - } - }] - }, { - name: "Task three", - description: "Second task which should not run", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - anyTaskRun = true; // shouldn't happen! - done({ - outcome: "Warning", - resultDescription: "This should not run!" - }); - } - } - ] - }] - }; - - return ProfileValidator.validate(dummyProfile, plan, displayName).then((report: IProfileValidationReport) => { - const textReport = ProfileValidator.getTextDisplayForReport(report, plan, displayName, "yellow", - "dummy", "dummy"); - TestLogger.info(textReport); - expect(report.overallResult).toEqual("Failed"); - expect(anyTaskRun).toBeFalsy(); - - }); - }); - - it("If we have a mock plan with a parent test that gets a warning, the validation should fail and " + - "none of the tasks dependent on the failing task should run ", () => { - let anyTaskRun = false; - const plan: IProfileValidationPlan = { - tasks: [{ - name: "Master task", - description: "This will fail, and none of the rest should run ", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - done({ - outcome: "Warning", - resultDescription: "Failing master task" - }); - }, - dependentTasks: [ - { - name: "Task one", - description: "First task which should not run", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - anyTaskRun = true; // shouldn't happen! - done({ - outcome: "Warning", - resultDescription: "This should not run!" - }); - }, - dependentTasks: [ - { - name: "Task two", - description: "Two level nested task", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - anyTaskRun = true; // shouldn't happen! - done({ - outcome: "Warning", - resultDescription: "This should not run!" - }); - } - }] - }, { - name: "Task three", - description: "Second task which should not run", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - anyTaskRun = true; // shouldn't happen! - done({ - outcome: "Warning", - resultDescription: "This should not run!" - }); - } - } - ] - }] - }; - - return ProfileValidator.validate(dummyProfile, plan, displayName) - .then((report: IProfileValidationReport) => { - const textReport = ProfileValidator.getTextDisplayForReport(report, plan, displayName, "yellow", - "dummy", "dummy"); - expect(report.overallResult).toEqual("Warning"); - expect(anyTaskRun).toBeFalsy(); - expect(textReport).toContain("ambiguous results"); - }); - }); - - it("If we have a mock plan with a passing parent test, one failing task and two passing tasks, " + - "the overall result should be failure ", () => { - - const plan: IProfileValidationPlan = { - - tasks: [{ - name: "Master task", - description: "This will fail, and none of the rest should run ", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - done({ - outcome: "OK", - resultDescription: "This should pass" - }); - }, - dependentTasks: [ - { - name: "Task one", - description: "First task which succeeds", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - done({ - outcome: "OK", - resultDescription: "Passes" - }); - }, - }, - { - name: "Task two", - description: "Second task which fails", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - done({ - outcome: "Failed", - resultDescription: "Fails" - }); - }, - - }, { - name: "Task three", - description: "Third task which succeeds", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - done({ - outcome: "OK", - resultDescription: "Passes" - }); - } - } - ] - }] - }; - - return ProfileValidator.validate(dummyProfile, plan, displayName).then((report: IProfileValidationReport) => { - const textReport = ProfileValidator.getTextDisplayForReport(report, plan, displayName, "yellow", - "dummy", "dummy"); - expect(report.overallResult).toEqual("Failed"); - expect(textReport).toContain("will not function"); - }); - }); - - const goodPlan: IProfileValidationPlan = { - tasks: [{ - name: "Master task", - description: "This will succeed, the rest should run", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - done({ - outcome: "OK", - resultDescription: "This should pass" - }); - }, - dependentTasks: [ - { - name: "Task one", - description: "First task which succeeds", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - done({ - outcome: "OK", - resultDescription: "This should pass" - }); - } - }, - { - name: "Task two", - description: "Second task which fails", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - done({ - outcome: "OK", - resultDescription: "This should pass" - }); - }, - - }, { - name: "Task three", - description: "Third task which succeeds", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - done({ - outcome: "OK", - resultDescription: "This should pass" - }); - } - } - ] - }] - }; - it("If we have a mock plan with all passing tests, the result should be a successful validation", () => { - - - return ProfileValidator.validate(dummyProfile, goodPlan, displayName).then((report: IProfileValidationReport) => { - const textReport = ProfileValidator.getTextDisplayForReport(report, goodPlan, displayName, "yellow", - "dummy", "dummy"); - TestLogger.info(textReport); - expect(report.overallResult).toEqual("OK"); - expect(textReport).toContain("valid and ready"); - }); - }); - - it("If we have a mock plan with a parent test that throws an unexpected exception, " + - "the dependent tasks should still be skipped and we should still get " + - "a report ", () => { - let anyTaskRun = false; - const errorMessage = "This shouldn't disrupt the flow"; - const plan: IProfileValidationPlan = { - tasks: [{ - name: "Master task", - description: "This will fail, and none of the rest should run ", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - throw new Error(errorMessage); - }, - dependentTasks: [ - { - name: "Task one", - description: "First task which should not run", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - anyTaskRun = true; // shouldn't happen! - done({ - outcome: "Warning", - resultDescription: "This should not run!" - }); - }, - dependentTasks: [ - { - name: "Task two", - description: "Two level nested task", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - anyTaskRun = true; // shouldn't happen! - done({ - outcome: "Warning", - resultDescription: "This should not run!" - }); - } - }] - }, { - name: "Task three", - description: "Second task which should not run", - taskFunction: (profile: any, done: (result: IProfileValidationTaskResult) => void) => { - anyTaskRun = true; // shouldn't happen! - done({ - outcome: "Warning", - resultDescription: "This should not run!" - }); - } - } - ] - }] - }; - - return ProfileValidator.validate(dummyProfile, plan, displayName).then((report: IProfileValidationReport) => { - const textReport = ProfileValidator.getTextDisplayForReport(report, plan, displayName, "yellow", - "dummy", "dummy"); - TestLogger.info(textReport); - expect(report.taskResults[0].resultDescription).toContain(errorMessage); - expect(report.overallResult).toEqual("Failed"); - expect(anyTaskRun).toBeFalsy(); - }); - }); - - it("If we get a text report for a validation plan, the report should contain all of the descriptions " + - "for each task", () => { - let expectedWords: string[] = []; - const findExpectedWordsInTask = (task: IProfileValidationTask) => { - expectedWords = expectedWords.concat(task.description.split(" ")); - for (const dependent of task.dependentTasks || []) { - findExpectedWordsInTask(dependent); - } - }; - for (const task of goodPlan.tasks) { - findExpectedWordsInTask(task); - } - const textPlanReport = ProfileValidator.getTextDisplayForPlan(goodPlan, dummyProfile, "yellow"); - for (const word of expectedWords) { - expect(textPlanReport).toContain(word); - } - }); - - it("If we try to validate with a plan with no tasks in it, an error should be thrown to let " + - "profile/module contributors know that their plan is invalid ", async () => { - const plan: IProfileValidationPlan = {tasks: []}; - let caughtError; - try { - await ProfileValidator.validate(dummyProfile, plan, displayName); - } catch (error) { - caughtError = error; - TestLogger.info("Got an error during validation as expected: " + inspect(error)); - } - expect(caughtError).toBeDefined(); - expect(caughtError.message).toContain("tasks"); - }); - - it("If we validate a profile with a result description that is too long, it should be truncated", async () => { - const thirtyTimes = 30; - const longDescription = Array(thirtyTimes) - .join("ABCDEFGHIJKLMNOPQRSTUVABCDEFGHIJKLMNOPQRSTUVABCDEFGHIJKLMNOPQRSTUV"); - const plan: IProfileValidationPlan = { - tasks: [{ - name: "Task one", - description: "Task which has a long result description", - taskFunction: (profile: any, taskDone: (result: IProfileValidationTaskResult) => void) => { - taskDone({ - outcome: "Warning", - resultDescription: longDescription - }); - } - }] - }; - let textReport: string; - let caughtError; - try { - const report = await ProfileValidator.validate(dummyProfile, plan, displayName); - textReport = ProfileValidator.getTextDisplayForReport(report, plan, displayName, "yellow", "dummy", "dummy"); - } catch (error) { - caughtError = error; - TestLogger.info("Got an error during unexpected validation: " + inspect(error)); - } - expect(caughtError).toBeUndefined(); - expect(textReport).toContain(longDescription.substring(0, 10)); // expect the report to have - // at least ten characters in a row of the description (Could test more but it's in a tabular format - // so the characters don't appear together - expect(textReport).toContain("..."); // expect it to be truncated - }); - - it("a failed profile validation report should include specified failure suggestions", async () => { - const failureSuggestion = "Try fixing whatever is wrong"; - const plan: IProfileValidationPlan = { - tasks: [{ - name: "Task one", - description: "Task which has a long result description", - taskFunction: (profile: any, taskDone: (result: IProfileValidationTaskResult) => void) => { - taskDone({ - outcome: "Failed", - resultDescription: "The task failed" - }); - } - }], - failureSuggestions: failureSuggestion - }; - let textReport: string; - let caughtError; - try { - const report = await ProfileValidator.validate(dummyProfile, plan, displayName); - textReport = ProfileValidator.getTextDisplayForReport(report, plan, displayName, "yellow", "dummy", "dummy"); - } catch (error) { - caughtError = error; - TestLogger.info("Got an error during unexpected validation: " + inspect(error)); - } - expect(caughtError).toBeUndefined(); - // each word of the failure suggestions should appear (tabular format - // so the characters don't appear together) - for (const word of failureSuggestion.split(" ")) { - expect(textReport).toContain(word); - } - }); -}); diff --git a/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts b/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts deleted file mode 100644 index d363596ac7..0000000000 --- a/packages/imperative/src/profiles/src/validation/api/ProfileValidator.ts +++ /dev/null @@ -1,415 +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. -* -*/ - -import { IProfileValidationReport } from "../doc/IProfileValidationReport"; -import { IProfileValidationPlan } from "../doc/IProfileValidationPlan"; -import { - IProfileValidationTask, - IProfileValidationTaskFunction, - VALIDATION_OUTCOME -} from "../doc/IProfileValidationTask"; -import { IProfileValidationTaskResult } from "../doc/IProfileValidationTaskResult"; -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"; -import { IProfile } from "../../doc/definition/IProfile"; -import { CliUtils } from "../../../../utilities/src/CliUtils"; - -/** - * API for going through the full validation test for a Zowe CLI profile - * and producing validation report - * @internal - * @deprecated Use the `V1ProfileRead` class if you still need to read V1 profiles - */ -export class ProfileValidator { - - /** - * The key used to access the filename for the type containing the profile - * validation plan object. On your profile validation command definition, - * specify the filename in .customize[CUSTOMIZE_PLAN_KEY] - * @type {string} - */ - public static readonly CUSTOMIZE_PLAN_KEY = "validationPlanModule"; - - /** - * The command line option for printing the validation plan only - */ - public static get PRINT_PLAN_OPTION(): ICommandOptionDefinition { - return { - name: "print-plan-only", aliases: ["plan", "p"], - description: "Instead of validating your profile, print out " + - "a table of the tasks used for validation. This will explain the different services and " + - "functionality that will be tested during profile validation.", - type: "boolean" - }; - } - - /** - * Produce a profile validation report for a specific profile - * @param {IProfile} profile the profile to validate - * @param {IProfileValidationPlan} plan - the profile validation testing plan - * @param productDisplayName - the display name for your CLI - * @returns {IPromiseWithProgress} a promise of the validation report, with an additional field - * that can be used to create a progress bar or track progress in another UI - */ - public static validate(profile: IProfile, - plan: IProfileValidationPlan, - productDisplayName: string): IPromiseWithProgress { - const log = Logger.getImperativeLogger(); - const progress: ITaskWithStatus = { - stageName: TaskStage.IN_PROGRESS, - percentComplete: TaskProgress.ZERO_PERCENT, - statusMessage: "Preparing to validate profile" - }; - const promise: any = new Promise((validationComplete) => { - const report: IProfileValidationReport = { - overallResult: "OK", // start with success and change it if there are any failures - taskResults: [], - overallMessage: "Your profile is valid and ready for use with " + - productDisplayName, - profile - }; - log.debug("Validating profile with %d tasks", plan.tasks.length); - - let tasksCompleted = 0; - let numTasksToComplete = 0; - const countTasks = (task: IProfileValidationTask) => { - numTasksToComplete++; - if (!(task.dependentTasks == null)) { - for (const dependent of task.dependentTasks) { - countTasks(dependent); - } - } - }; - for (const task of plan.tasks) { - countTasks(task); // get the total number of tasks - } - if (numTasksToComplete === 0) { - throw new Error("Validation plan has no tasks! If you want to validate a profile, " + - "you need at least one task in your plan."); - } - - let tasksToRun = [].concat(plan.tasks); - - // define how tasks will be handled when we run them - const runTask = () => { - const currentTask = tasksToRun[0]; - tasksToRun = tasksToRun.slice(1); // take off the task we're working on now - - const skipDependentTask = (dependentTask: IProfileValidationTask, result: IProfileValidationTaskResult) => { - // add a 'skipped task' result for each descendant dependent task - const skippedResult: IProfileValidationTaskResult = { - taskName: dependentTask.name, - associatedEndpoints: dependentTask.associatedEndpoints, - outcome: "Warning", - resultDescription: TextUtils.formatMessage( - "Skipped due to '%s' getting a result of %s", - currentTask.name, this.outcomeToString(result.outcome)) - }; - report.taskResults.push(skippedResult); - tasksCompleted++; - if (!(dependentTask.dependentTasks == null)) { - for (const grandDependent of dependentTask.dependentTasks) { - skipDependentTask(grandDependent, result); - } - } - }; - - const taskFunction: IProfileValidationTaskFunction = currentTask.taskFunction; - progress.percentComplete = tasksCompleted / numTasksToComplete * TaskProgress.ONE_HUNDRED_PERCENT; - progress.statusMessage = TextUtils.formatMessage("Checking '%s' (%d of %d)", currentTask.name, - tasksCompleted + 1, numTasksToComplete); - try { - taskFunction(profile, (result: IProfileValidationTaskResult) => { - result.associatedEndpoints = currentTask.associatedEndpoints; - result.taskName = currentTask.name; - // task is complete, store off the results - tasksCompleted++; - report.taskResults.push(result); - log.debug("Profile validation task result: task name: %s, outcome %s, description %s, associated endpoints: %s", - result.taskName, this.outcomeToString(result.outcome), result.resultDescription, - result.associatedEndpoints == null ? "none" : result.associatedEndpoints.join(", ")); - - // set the overall status of the validation based on this outcome - // only 100% success is considered a successful validation - if (result.outcome === "Warning" && report.overallResult === "OK") { - report.overallResult = "Warning"; - - } else if (result.outcome === "Failed") { - // mark the validation failed if any task fails - report.overallResult = "Failed"; - } - if (!(currentTask.dependentTasks == null)) { - if (result.outcome === "Failed" || result.outcome === "Warning") { - log.warn("Parent task %s failed, skipping dependent tasks", - currentTask.name); - for (const dependent of currentTask.dependentTasks) { - skipDependentTask(dependent, result); - } - } else { - // add the dependent tasks as the next tasks to execute - log.debug("Adding dependent tasks of %s to the lists of tasks to run", - currentTask.name); - tasksToRun = currentTask.dependentTasks.concat(tasksToRun); - } - } - if (tasksCompleted < numTasksToComplete) { - // if there are more tasks, run the next one - runTask(); - } else { - log.info("All profile validation tasks have completed. The profile's validity: %s", - this.outcomeToString(report.overallResult)); - validationComplete(report); - } - }); - } - /** - * Catch unexpected exceptions within the task function - */ catch (e) { - tasksCompleted++; - report.overallResult = "Failed"; - log.error("Error during profile validation: %s\n%s", e.message, e.stack); - const result: IProfileValidationTaskResult = { - outcome: "Failed", - resultDescription: "Encountered an unexpected exception: " + e.message, - associatedEndpoints: currentTask.associatedEndpoints, - taskName: currentTask.taskName - }; - report.taskResults.push(result); - log.warn("Parent task %s failed, skipping dependent tasks", - currentTask.name); - for (const dependent of currentTask.dependentTasks) { - skipDependentTask(dependent, result); - } - if (tasksCompleted < numTasksToComplete) { - // if there are more tasks, run the next one - runTask(); - } else { - log.info("All profile validation tasks have completed. The profile's validity: %s", - this.outcomeToString(report.overallResult)); - validationComplete(report); - } - - } - }; - runTask(); - }); - - promise.progress = progress; - return promise; - } - - /** - * Get a printed/tabular version of your validation report - * @param {IProfileValidationReport} report - your completed validation result - * @param plan - the validation plan to use - * @param productDisplayName - the display name for your CLI used in the final result text - * @param primaryHighlightColor - color used to highlight headings and tables (used with chalk package) - * @param profileName - the name of the profile that was validated - * @param profileType - the type of the profile that was validated - * @returns {string} - the formatted report - */ - public static getTextDisplayForReport(report: IProfileValidationReport, plan: IProfileValidationPlan, - productDisplayName: string, primaryHighlightColor: string, - profileName: string, profileType: string): string { - const log = Logger.getImperativeLogger(); - let text = ""; - - let {failed, undetermined, succeeded} = this.countOutcomes(report); - - text += CliUtils.formatHelpHeader("Profile Summary", undefined, primaryHighlightColor) + "\n\n"; - const censoredProfile = LoggerUtils.censorYargsArguments(report.profile as any); - text += TextUtils.prettyJson(censoredProfile); - text += CliUtils.formatHelpHeader("Profile Validation Results", undefined, primaryHighlightColor) + "\n\n"; - - /** - * Get a colored summary of the total numbers of failed, warning, and succeeded tests - */ - if (failed === 0) { - failed = TextUtils.chalk.gray(failed); - } else { - failed = TextUtils.chalk.red(failed); - } - if (undetermined === 0) { - undetermined = TextUtils.chalk.gray(undetermined); - } else { - undetermined = TextUtils.chalk.yellow(undetermined); - } - if (succeeded === 0) { - succeeded = TextUtils.chalk.gray(succeeded); - } else { - succeeded = TextUtils.chalk.green(succeeded); - } - - interface ITaskResultRow { - Task: string; - Status: string; - Description: string; - Endpoint: string; - } - - const tableObject: ITaskResultRow[] = report.taskResults.map((taskResult) => { - let statusChar = ""; - if (taskResult.outcome === "OK") { - statusChar = TextUtils.chalk.green("OK"); - } else if (taskResult.outcome === "Warning") { - statusChar = TextUtils.chalk.yellow("?\nWarning"); - } else if (taskResult.outcome === "Failed") { - statusChar = TextUtils.chalk.red("X\nFailed"); - } - let description = taskResult.resultDescription; - const maxDescriptionLength = 500; - if (description.length > maxDescriptionLength) { - description = description.substring(0, maxDescriptionLength) + "...(more info in log)"; - log.info("Truncated description from profile validation: %s", taskResult.resultDescription); - } - const result = { - Task: taskResult.taskName, - Status: statusChar, - Description: description, - Endpoint: taskResult.associatedEndpoints ? taskResult.associatedEndpoints.join(", ") : undefined - }; - if (result.Endpoint == null) { - // this prevents the endpoint column from showing up - // if there are no endpoints specified - delete result.Endpoint; - } - return result; - }); - text += TextUtils.getTable(tableObject, primaryHighlightColor, undefined, true, true, true) + "\n\n"; - text += TextUtils.wordWrap(TextUtils.formatMessage("Of %s tests, %s succeeded, %s failed, and %s had warnings or undetermined results.\n\n", - report.taskResults.length, succeeded, failed, undetermined)); - - if (report.overallResult === "OK") { - text += TextUtils.chalk.green(" *~~ Perfect score! Wow! ~~* ") + "\n\n"; - } - let outcomeMessage = ""; - switch (report.overallResult) { - case "OK": - outcomeMessage = "is valid and ready for use with " + productDisplayName + ".\n All profile validation tests " + - "succeeded."; - break; - case "Failed": - outcomeMessage = "will not function fully with " + productDisplayName + ".\nAt least one of the above " + - "tests failed. " + (plan.failureSuggestions ? "\n" + plan.failureSuggestions : ""); - break; - case "Warning": - outcomeMessage = "might not function properly with " + productDisplayName + ".\nAt least one of the above " + - "tests got ambiguous results. " + (plan.failureSuggestions ? "\n" + plan.failureSuggestions : ""); - break; - default: - log.warn("Unknown validation outcome in report for %s profile %s", profileType, profileName); - } - - text += TextUtils.wordWrap(TextUtils.formatMessage("The %s profile named \"%s\" %s\n", - profileType + "", profileName + "", outcomeMessage)); - return text; - } - - /** - * Get a printed/tabular version of your validation plan, - * so that the user can see what steps the Zowe CLI will take to validate their profile - * @param {IProfileValidationPlan} plan - the plan for profile validation - * @param profile - the profile that would be validated - used only in this case to show a summary of the profile's contents - * @param primaryHighlightColor - primary highlight color for use with chalk - * @returns {string} - the formatted report - */ - public static getTextDisplayForPlan(plan: IProfileValidationPlan, profile: IProfile, primaryHighlightColor: string): string { - let text = ""; - - text += CliUtils.formatHelpHeader("Profile Summary", undefined, primaryHighlightColor) + "\n\n"; - const censoredProfile = LoggerUtils.censorYargsArguments(profile as any); - text += TextUtils.prettyJson(censoredProfile); - text += CliUtils.formatHelpHeader("Profile Validation Plan", undefined, primaryHighlightColor) + "\n\n"; - - /** - * Collapse the tree of task dependencies into a 1D array - * so that we can display it in the table - */ - const allTasks: IProfileValidationTask[] = []; - const addTasks = (task: IProfileValidationTask) => { - allTasks.push(task); - if (!(task.dependentTasks == null)) { - for (const dependent of task.dependentTasks) { - addTasks(dependent); - } - } - }; - for (const task of plan.tasks) { - addTasks(task); - } - - interface ITaskPlanRow { - Task: string; - Description: string; - Endpoints: string; - } - - const tableObject: ITaskPlanRow[] = allTasks.map((task) => { - const result: ITaskPlanRow = { - Task: task.name, - Description: task.description, - Endpoints: task.associatedEndpoints ? task.associatedEndpoints.join(", ") : undefined - }; - if (result.Endpoints == null) { - delete result.Endpoints; - } - return result; - }); - text += TextUtils.getTable(tableObject, primaryHighlightColor, undefined, - true, true) + "\n\n"; - return text; - } - - /** - * Get a more readable version of the outcome - * @param {VALIDATION_OUTCOME} outcome - the outcome to convert to readable version - * @returns {string} - full version of the outcome - */ - public static outcomeToString(outcome: VALIDATION_OUTCOME): string { - if (outcome === "OK") { - return "Succeeded"; - } else if (outcome === "Warning") { - return "Warning"; - } else if (outcome === "Failed") { - return "Failed"; - } - } - - /** - * Get the total number of each type of profile validation outcome - * @param {IProfileValidationReport} report - the report from which - * @returns {{succeeded: number, undetermined: number, failed: number}} - total count - * of what has succeeded, undetermined, failed - */ - private static countOutcomes(report: IProfileValidationReport): { succeeded: number, undetermined: number, failed: number } { - const log = Logger.getImperativeLogger(); - const result = {succeeded: 0, undetermined: 0, failed: 0}; - for (const task of report.taskResults) { - switch (task.outcome) { - case "OK": - result.succeeded++; - break; - case "Warning": - result.undetermined++; - break; - case "Failed": - result.failed++; - break; - default: - log.warn("Unknown validation outcome for %s profile %s", report.profile.type, report.profile.name); - } - } - return result; - } -} diff --git a/packages/imperative/src/profiles/src/validation/doc/IProfileValidationPlan.ts b/packages/imperative/src/profiles/src/validation/doc/IProfileValidationPlan.ts deleted file mode 100644 index f6aaf1dd47..0000000000 --- a/packages/imperative/src/profiles/src/validation/doc/IProfileValidationPlan.ts +++ /dev/null @@ -1,29 +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. -* -*/ - -import { IProfileValidationTask } from "./IProfileValidationTask"; - -/** - * An overall plan for validating a profile, composed of multiple tasks - */ -export interface IProfileValidationPlan { - /** - * The tasks to run to validate the profile. - * They will be run sequentially in the order specified. - */ - tasks: IProfileValidationTask[]; - - /** - * Suggestions to the user that will be displayed in the validation - * report in the event profile validation is not successful. - */ - failureSuggestions?: string; -} diff --git a/packages/imperative/src/profiles/src/validation/doc/IProfileValidationReport.ts b/packages/imperative/src/profiles/src/validation/doc/IProfileValidationReport.ts deleted file mode 100644 index 6c5d02fdd9..0000000000 --- a/packages/imperative/src/profiles/src/validation/doc/IProfileValidationReport.ts +++ /dev/null @@ -1,36 +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. -* -*/ - -import { IProfileValidationTaskResult } from "./IProfileValidationTaskResult"; -import { VALIDATION_OUTCOME } from "./IProfileValidationTask"; -import { IProfile } from "../../doc/definition/IProfile"; - -/** - * Complete report of the results of profile validation - */ -export interface IProfileValidationReport { - /** - * Is the profile valid overall? - */ - overallResult: VALIDATION_OUTCOME; - /** - * A final message explaining the general result of the report - */ - overallMessage: string; - /** - * List of detailed task results from running the profile validation - */ - taskResults: IProfileValidationTaskResult[]; - /** - * The profile that was validated - */ - profile: IProfile; -} diff --git a/packages/imperative/src/profiles/src/validation/doc/IProfileValidationTask.ts b/packages/imperative/src/profiles/src/validation/doc/IProfileValidationTask.ts deleted file mode 100644 index 40a001cb6c..0000000000 --- a/packages/imperative/src/profiles/src/validation/doc/IProfileValidationTask.ts +++ /dev/null @@ -1,55 +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. -* -*/ - -import { IProfileValidationTaskResult } from "./IProfileValidationTaskResult"; - -export type VALIDATION_OUTCOME = "Failed" | "OK" | "Warning"; - -/** - * A function that takes a profile and calls a done callback with the result of the - * profile validation - */ -export type IProfileValidationTaskFunction = (profile: any, - done: (result: IProfileValidationTaskResult) => void) => void; - -/** - * Criterion/task used for testing the validity of a profile - * You can use any number of these criteria to test different - * aspects of the profile - */ -export interface IProfileValidationTask { - /** - * Long form description of the task you'll take using the - * specified profile to test its validity - */ - description: string; - /** - * The short name of a task e.g. "Submitting a job" - */ - name: string; - /** - * The REST endpoints associated with this task if any, - * e.g. ["PUT /zosmf/restjobs/jobs", "GET /zosmf/restjobs/jobs"] - */ - associatedEndpoints?: string[]; - /** - * A function which tests the profile with your tasks - * Ultimately the result of this function is what determines whether - * the profile is valid or not for this task - */ - taskFunction: IProfileValidationTaskFunction; - - /** - * Any tasks you would like to only run if the current task succeeds - * (skipped on warning or failure of this, the parent task) - */ - dependentTasks?: IProfileValidationTask[]; -} diff --git a/packages/imperative/src/profiles/src/validation/doc/IProfileValidationTaskResult.ts b/packages/imperative/src/profiles/src/validation/doc/IProfileValidationTaskResult.ts deleted file mode 100644 index 3182fbb878..0000000000 --- a/packages/imperative/src/profiles/src/validation/doc/IProfileValidationTaskResult.ts +++ /dev/null @@ -1,46 +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. -* -*/ - -/** - * A single result in the report from testing a profile against an IProfileValidationCriterion - * Used to build the final validation report - */ -import { VALIDATION_OUTCOME } from "./IProfileValidationTask"; - -/** - * Profile validation results for one particular task - */ -export interface IProfileValidationTaskResult { - /** - * Outcome of this task, whether it succeeded, failed, or somewhere in between - */ - outcome: VALIDATION_OUTCOME; - /** - * Name of the task - * (will be automatically populated by the validation API) - */ - taskName?: string; - /** - * A description of the result of the validation test, whether - * it succeeded or failed. Example: - * Successfully submitted job USER(JOB00001) - * or - * Failed to submit job due to the following error: - * Input was not recognized by the system as a job RC 4 RSN ... - */ - resultDescription: string; - /** - * Same as the endpoints in the profile validation task. - * (will be automatically populated by the validation API) - */ - associatedEndpoints?: string[]; -} - diff --git a/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts b/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts index cf92150b13..dfbdf4233e 100644 --- a/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts +++ b/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts @@ -11,9 +11,9 @@ import * as stream from "stream"; import { CliUtils } from "../src/CliUtils"; -import { CommandProfiles, ICommandOptionDefinition } from "../../cmd"; -import { IProfile } from "../../profiles"; +import { ICommandOptionDefinition } from "../../cmd"; import { ImperativeError } from "../../error"; +import { Config, IConfig } from "../../config"; const TEST_PREFIX = "TEST_CLI_PREFIX"; const boolEnv = TEST_PREFIX + "_OPT_FAKE_BOOL_OPT"; @@ -22,6 +22,31 @@ const stringAliasEnv = TEST_PREFIX + "_OPT_FAKE_STRING_OPT_WITH_ALIASES"; const numberEnv = TEST_PREFIX + "_OPT_FAKE_NUMBER_OPT"; const arrayEnv = TEST_PREFIX + "_OPT_FAKE_ARRAY_OPT"; +function mockConfigApi(properties: IConfig | undefined): any { + properties = properties || Config.empty(); + return { + api: { + layers: { + get: () => ({ + exists: true, + path: "fakePath", + properties + }) + }, + profiles: { + defaultGet: jest.fn().mockReturnValue(properties.profiles[properties.defaults.banana]?.properties), + exists: () => properties.defaults.banana != null, + getProfilePathFromName: (name: string) => `profiles.${name}` + }, + secure: { + securePropsForProfile: jest.fn().mockReturnValue([]) + } + }, + exists: true, + properties + }; +} + describe("CliUtils", () => { describe("extractEnvForOptions", () => { @@ -262,7 +287,7 @@ describe("CliUtils", () => { }); }); - describe("getOptValueFromProfiles", () => { + describe("getOptValuesFromConfig", () => { const FAKE_OPTS: ICommandOptionDefinition[] = [{ name: "fake-string-opt", @@ -293,12 +318,8 @@ describe("CliUtils", () => { it("should throw an imperative error if a required profile is not present", () => { let error; try { - // eslint-disable-next-line deprecation/deprecation - const args = CliUtils.getOptValueFromProfiles( - // eslint-disable-next-line deprecation/deprecation - new CommandProfiles(new Map()), - { required: ["banana"] }, - FAKE_OPTS); + const args = CliUtils.getOptValuesFromConfig(mockConfigApi(undefined), + { required: ["banana"] } as any, {} as any, FAKE_OPTS); } catch (e) { error = e; } @@ -308,122 +329,129 @@ describe("CliUtils", () => { }); it("should return nothing if a profile was optional and not loaded", () => { - // eslint-disable-next-line deprecation/deprecation - const args = CliUtils.getOptValueFromProfiles( - // eslint-disable-next-line deprecation/deprecation - new CommandProfiles(new Map()), - { optional: ["banana"] }, - FAKE_OPTS); + const args = CliUtils.getOptValuesFromConfig(mockConfigApi(undefined), + { optional: ["banana"] }, {} as any, FAKE_OPTS); expect(Object.keys(args).length).toBe(0); }); it("should return args (from definitions with no hyphen in name) extracted from loaded profile", () => { - const map = new Map(); - map.set("banana", [{ type: "banana", name: "fakebanana", nohyphen: "specified in profile" }]); - // eslint-disable-next-line deprecation/deprecation - const args = CliUtils.getOptValueFromProfiles( - // eslint-disable-next-line deprecation/deprecation - new CommandProfiles(map), - { optional: ["banana"] }, - FAKE_OPTS); + const args = CliUtils.getOptValuesFromConfig( + mockConfigApi({ + profiles: { + fakebanana: { + type: "banana", + properties: { + nohyphen: "specified in profile" + } + } + }, + defaults: { banana: "fakebanana" } + }), + { optional: ["banana"] }, {} as any, FAKE_OPTS); expect(args).toMatchSnapshot(); }); it("should return args (with both cases) extracted from loaded profile, preferring the camel case", () => { - const map = new Map(); - map.set("banana", [{ - "type": "banana", - "name": "fakebanana", - "couldBeEither": "should be me", - "could-be-either": "should not be me" - }]); - // eslint-disable-next-line deprecation/deprecation - const args = CliUtils.getOptValueFromProfiles( - // eslint-disable-next-line deprecation/deprecation - new CommandProfiles(map), - { optional: ["banana"] }, - FAKE_OPTS); + const args = CliUtils.getOptValuesFromConfig( + mockConfigApi({ + profiles: { + fakebanana: { + type: "banana", + properties: { + couldBeEither: "should be me", + "could-be-either": "should not be me" + } + } + }, + defaults: { banana: "fakebanana" } + }), + { optional: ["banana"] }, {} as any, FAKE_OPTS); expect(args).toMatchSnapshot(); }); it("should return args (with both cases) extracted from loaded profile, preferring the kebab case", () => { - const map = new Map(); - map.set("banana", [{ - "type": "banana", - "name": "fakebanana", - "fakeStringOpt": "should not be me", - "fake-string-opt": "should be me" - }]); - // eslint-disable-next-line deprecation/deprecation - const args = CliUtils.getOptValueFromProfiles( - // eslint-disable-next-line deprecation/deprecation - new CommandProfiles(map), - { optional: ["banana"] }, - FAKE_OPTS); + const args = CliUtils.getOptValuesFromConfig( + mockConfigApi({ + profiles: { + fakebanana: { + type: "banana", + properties: { + fakeStringOpt: "should not be me", + "fake-string-opt": "should be me" + } + } + }, + defaults: { banana: "fakebanana" } + }), + { optional: ["banana"] }, {} as any, FAKE_OPTS); expect(args).toMatchSnapshot(); }); it("should return args with both cases, if the option is camel and the profile is kebab", () => { - const map = new Map(); - map.set("banana", [{ - "type": "banana", - "name": "fakebanana", - "could-be-either": "should be me" - }]); - // eslint-disable-next-line deprecation/deprecation - const args = CliUtils.getOptValueFromProfiles( - // eslint-disable-next-line deprecation/deprecation - new CommandProfiles(map), - { optional: ["banana"] }, - FAKE_OPTS); + const args = CliUtils.getOptValuesFromConfig( + mockConfigApi({ + profiles: { + fakebanana: { + type: "banana", + properties: { + "could-be-either": "should be me" + } + } + }, + defaults: { banana: "fakebanana" } + }), + { optional: ["banana"] }, {} as any, FAKE_OPTS); expect(args).toMatchSnapshot(); }); it("should return args with both cases, if the option is kebab and the profile is camel", () => { - const map = new Map(); - map.set("banana", [{ - type: "banana", - name: "fakebanana", - fakeStringOpt: "should be me" - }]); - // eslint-disable-next-line deprecation/deprecation - const args = CliUtils.getOptValueFromProfiles( - // eslint-disable-next-line deprecation/deprecation - new CommandProfiles(map), - { optional: ["banana"] }, - FAKE_OPTS); + const args = CliUtils.getOptValuesFromConfig( + mockConfigApi({ + profiles: { + fakebanana: { + type: "banana", + properties: { + fakeStringOpt: "should be me" + } + } + }, + defaults: { banana: "fakebanana" } + }), + { optional: ["banana"] }, {} as any, FAKE_OPTS); expect(args).toMatchSnapshot(); }); it("should return args with aliases if extracted option from a profile", () => { - const map = new Map(); - map.set("banana", [{ - type: "banana", - name: "fakebanana", - withAlias: "should have 'w' on args object too" - }]); - // eslint-disable-next-line deprecation/deprecation - const args = CliUtils.getOptValueFromProfiles( - // eslint-disable-next-line deprecation/deprecation - new CommandProfiles(map), - { optional: ["banana"] }, - FAKE_OPTS); + const args = CliUtils.getOptValuesFromConfig( + mockConfigApi({ + profiles: { + fakebanana: { + type: "banana", + properties: { + withAlias: "should have 'w' on args object too" + } + } + }, + defaults: { banana: "fakebanana" } + }), + { optional: ["banana"] }, {} as any, FAKE_OPTS); expect(args).toMatchSnapshot(); }); it("should return args if extracted option from a profile is only available as an alias", () => { - const map = new Map(); - map.set("banana", [{ - type: "banana", - name: "fakebanana", - username: "fake" - }]); - // eslint-disable-next-line deprecation/deprecation - const args = CliUtils.getOptValueFromProfiles( - // eslint-disable-next-line deprecation/deprecation - new CommandProfiles(map), - { optional: ["banana"] }, - FAKE_OPTS); + const args = CliUtils.getOptValuesFromConfig( + mockConfigApi({ + profiles: { + fakebanana: { + type: "banana", + properties: { + username: "fake" + } + } + }, + defaults: { banana: "fakebanana" } + }), + { optional: ["banana"] }, {} as any, FAKE_OPTS); expect(args).toEqual({ user: "fake", username: "fake" }); }); }); diff --git a/packages/imperative/src/utilities/__tests__/__snapshots__/CliUtils.unit.test.ts.snap b/packages/imperative/src/utilities/__tests__/__snapshots__/CliUtils.unit.test.ts.snap index 38efab29ef..c804cc3384 100644 --- a/packages/imperative/src/utilities/__tests__/__snapshots__/CliUtils.unit.test.ts.snap +++ b/packages/imperative/src/utilities/__tests__/__snapshots__/CliUtils.unit.test.ts.snap @@ -98,27 +98,27 @@ Object { } `; -exports[`CliUtils getOptValueFromProfiles should return args (from definitions with no hyphen in name) extracted from loaded profile 1`] = ` +exports[`CliUtils getOptValuesFromConfig should return args (from definitions with no hyphen in name) extracted from loaded profile 1`] = ` Object { "nohyphen": "specified in profile", } `; -exports[`CliUtils getOptValueFromProfiles should return args (with both cases) extracted from loaded profile, preferring the camel case 1`] = ` +exports[`CliUtils getOptValuesFromConfig should return args (with both cases) extracted from loaded profile, preferring the camel case 1`] = ` Object { "could-be-either": "should be me", "couldBeEither": "should be me", } `; -exports[`CliUtils getOptValueFromProfiles should return args (with both cases) extracted from loaded profile, preferring the kebab case 1`] = ` +exports[`CliUtils getOptValuesFromConfig should return args (with both cases) extracted from loaded profile, preferring the kebab case 1`] = ` Object { "fake-string-opt": "should be me", "fakeStringOpt": "should be me", } `; -exports[`CliUtils getOptValueFromProfiles should return args with aliases if extracted option from a profile 1`] = ` +exports[`CliUtils getOptValuesFromConfig should return args with aliases if extracted option from a profile 1`] = ` Object { "w": "should have 'w' on args object too", "with-alias": "should have 'w' on args object too", @@ -126,21 +126,21 @@ Object { } `; -exports[`CliUtils getOptValueFromProfiles should return args with both cases, if the option is camel and the profile is kebab 1`] = ` +exports[`CliUtils getOptValuesFromConfig should return args with both cases, if the option is camel and the profile is kebab 1`] = ` Object { "could-be-either": "should be me", "couldBeEither": "should be me", } `; -exports[`CliUtils getOptValueFromProfiles should return args with both cases, if the option is kebab and the profile is camel 1`] = ` +exports[`CliUtils getOptValuesFromConfig should return args with both cases, if the option is kebab and the profile is camel 1`] = ` Object { "fake-string-opt": "should be me", "fakeStringOpt": "should be me", } `; -exports[`CliUtils getOptValueFromProfiles should throw an imperative error if a required profile is not present 1`] = `"Profile of type \\"banana\\" does not exist within the loaded profiles for the command and it is marked as required."`; +exports[`CliUtils getOptValuesFromConfig should throw an imperative error if a required profile is not present 1`] = `"Profile of type \\"banana\\" does not exist within the loaded profiles for the command and it is marked as required."`; exports[`CliUtils setOptionValue should include aliases in the returned args object 1`] = ` Object { diff --git a/packages/imperative/src/utilities/src/CliUtils.ts b/packages/imperative/src/utilities/src/CliUtils.ts index 115548af5e..e846d96856 100644 --- a/packages/imperative/src/utilities/src/CliUtils.ts +++ b/packages/imperative/src/utilities/src/CliUtils.ts @@ -14,11 +14,8 @@ import { Constants } from "../../constants"; import { Arguments } from "yargs"; import { TextUtils } from "./TextUtils"; import { IOptionFormat } from "./doc/IOptionFormat"; -import { CommandProfiles, ICommandOptionDefinition, ICommandPositionalDefinition, - ICommandProfile, IHandlerParameters -} from "../../cmd"; +import { ICommandOptionDefinition, ICommandPositionalDefinition, ICommandProfile, IHandlerParameters } from "../../cmd"; import { ICommandArguments } from "../../cmd/src/doc/args/ICommandArguments"; -import { IProfile } from "../../profiles/src/doc/definition/IProfile"; import { ProfileUtils } from "../../profiles/src/utils/ProfileUtils"; import { IPromptOptions } from "../../cmd/src/doc/response/api/handler/IPromptOptions"; import { read } from "read"; @@ -104,115 +101,28 @@ export class CliUtils { return newArgs; } - - /** - * Accepts the full set of loaded profiles and attempts to match the option names supplied with profile keys. - * - * @deprecated Use `getOptValuesFromConfig` instead to load from team config - * - * @param {Map} profiles - the map of type to loaded profiles. The key is the profile type - * and the value is an array of profiles loaded for that type. - * - * @param {definitions} definitions - the profile definition on the command. - * - * @param {(Array)} options - the full set of command options - * for the command being processed - * - * @returns {*} - * - * @memberof CliUtils - */ - // eslint-disable-next-line deprecation/deprecation - public static getOptValueFromProfiles(profiles: CommandProfiles, definitions: ICommandProfile, - options: Array): any { - let args: any = {}; - - // Construct the precedence order to iterate through the profiles - let profileOrder: any = definitions.required != null ? definitions.required : []; - if (definitions.optional != null) { - profileOrder = profileOrder.concat(definitions.optional); - } - - // Iterate through the profiles in the order they appear in the list provided. For each profile found, we will - // attempt to match the option name to a profile property exactly - and extract the value from the profile. - profileOrder.forEach((profileType: string) => { - - // Get the first profile loaded - for now, we won't worry about profiles and double-type loading for dependencies - // eslint-disable-next-line deprecation/deprecation - const profile: IProfile = profiles.get(profileType, false); - if (profile == null && definitions.required != null && definitions.required.indexOf(profileType) >= 0) { - throw new ImperativeError({ - msg: `Profile of type "${profileType}" does not exist within the loaded profiles for the command and it is marked as required.`, - additionalDetails: `This is an internal imperative error. ` + - `Command preparation was attempting to extract option values from this profile.` - }); - } else if (profile != null) { - // For each option - extract the value if that exact property exists - options.forEach((opt) => { - let cases; - if (profile[opt.name] == null && "aliases" in opt) { - // Use aliases for backwards compatibility - // Search for first alias available in the profile - const oldOption = opt.aliases.find(o => profile[o] != null); - // Get the camel an kebab case - if (oldOption) cases = CliUtils.getOptionFormat(oldOption); - } - - if (cases == null) { - cases = CliUtils.getOptionFormat(opt.name); - } - - // We have to "deal" with the situation that the profile contains both cases - camel and kebab. - // This is to support where the profile options have "-", but the properties are camel case in the - // yaml file - which is currently how most imperative CLIs have it coded. - const profileKebab = profile[cases.kebabCase]; - const profileCamel = profile[cases.camelCase]; - - // If the profile has either type (or both specified) we'll add it to args if the args object - // does NOT already contain the value in any case - if ((profileCamel !== undefined || profileKebab !== undefined) && - (!Object.prototype.hasOwnProperty.call(args, cases.kebabCase) && - !Object.prototype.hasOwnProperty.call(args, cases.camelCase))) { - - // If both case properties are present in the profile, use the one that matches - // the option name explicitly - const value = profileKebab !== undefined && profileCamel !== undefined ? - opt.name === cases.kebabCase ? profileKebab : profileCamel : - profileKebab !== undefined ? profileKebab : profileCamel; - const keys = CliUtils.setOptionValue(opt.name, - "aliases" in opt ? (opt as ICommandOptionDefinition).aliases : [], - value - ); - args = {...args, ...keys}; - } - }); - } - }); - return args; - } - /** * Searches properties in team configuration and attempts to match the option names supplied with profile keys. * @param {Config} config - Team config API - * @param {ICommandDefinition} definition - Definition of invoked command + * @param {ICommandProfile} profileDef - Profile definition of invoked command * @param {ICommandArguments} args - Arguments from command line and environment - * @param {(Array)} allOpts - the full set of command options + * @param {(Array)} options - the full set of command options * for the command being processed * * @returns {*} * * @memberof CliUtils */ - public static getOptValuesFromConfig(config: Config, definition: ICommandDefinition, args: ICommandArguments, - allOpts: Array): any { + public static getOptValuesFromConfig(config: Config, profileDef: ICommandProfile, args: ICommandArguments, + options: Array): any { // Build a list of all profile types - this will help us search the CLI // options for profiles specified by the user let allTypes: string[] = []; - if (definition.profile != null) { - if (definition.profile.required != null) - allTypes = allTypes.concat(definition.profile.required); - if (definition.profile.optional != null) - allTypes = allTypes.concat(definition.profile.optional); + if (profileDef != null) { + if (profileDef.required != null) + allTypes = allTypes.concat(profileDef.required); + if (profileDef.optional != null) + allTypes = allTypes.concat(profileDef.optional); } // Build an object that contains all the options loaded from config @@ -223,7 +133,7 @@ export class CliUtils { // that this type has been fulfilled - so that we do NOT load from // the traditional profile location const profileTypePrefix = profileType + "_"; - let p: any = {}; + let p: any = null; if (args[opt] != null && config.api.profiles.exists(args[opt])) { p = config.api.profiles.get(args[opt]); } else if (args[opt] != null && !args[opt].startsWith(profileTypePrefix) && @@ -234,13 +144,27 @@ export class CliUtils { config.api.profiles.exists(config.properties.defaults[profileType])) { p = config.api.profiles.defaultGet(profileType); } - fromCnfg = { ...p, ...fromCnfg }; + if (p == null && profileDef.required != null && profileDef.required.indexOf(profileType) >= 0) { + throw new ImperativeError({ + msg: `Profile of type "${profileType}" does not exist within the loaded profiles for the command and it is marked as required.`, + additionalDetails: `This is an internal imperative error. ` + + `Command preparation was attempting to extract option values from this profile.` + }); + } + fromCnfg = { ...(p ?? {}), ...fromCnfg }; } // Convert each property extracted from the config to the correct yargs // style cases for the command handler (kebab and camel) - allOpts.forEach((opt) => { - const cases = CliUtils.getOptionFormat(opt.name); + options.forEach((opt) => { + let cases = CliUtils.getOptionFormat(opt.name); + if (fromCnfg[opt.name] == null && "aliases" in opt) { + // Use aliases for backwards compatibility + // Search for first alias available in the profile + const oldOption = opt.aliases.find(o => fromCnfg[o] != null); + // Get the camel and kebab case + if (oldOption) cases = CliUtils.getOptionFormat(oldOption); + } const profileKebab = fromCnfg[cases.kebabCase]; const profileCamel = fromCnfg[cases.camelCase]; @@ -252,10 +176,7 @@ export class CliUtils { const shouldUseKebab = profileKebab !== undefined && profileCamel !== undefined ? opt.name === cases.kebabCase : profileKebab !== undefined; const value = shouldUseKebab ? profileKebab : profileCamel; - const keys = CliUtils.setOptionValue(opt.name, - "aliases" in opt ? opt.aliases : [], - value - ); + const keys = CliUtils.setOptionValue(opt.name, "aliases" in opt ? opt.aliases : [], value); fromCnfg = { ...fromCnfg, ...keys }; } }); From ef6198b142d336c9ee9169d2689a4376c3992bf4 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 29 Aug 2024 14:50:08 -0400 Subject: [PATCH 29/34] Fix lint warning Signed-off-by: Timothy Johnson --- packages/imperative/src/utilities/src/CliUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/imperative/src/utilities/src/CliUtils.ts b/packages/imperative/src/utilities/src/CliUtils.ts index e846d96856..951145064e 100644 --- a/packages/imperative/src/utilities/src/CliUtils.ts +++ b/packages/imperative/src/utilities/src/CliUtils.ts @@ -151,7 +151,7 @@ export class CliUtils { `Command preparation was attempting to extract option values from this profile.` }); } - fromCnfg = { ...(p ?? {}), ...fromCnfg }; + fromCnfg = { ...p ?? {}, ...fromCnfg }; } // Convert each property extracted from the config to the correct yargs From b3c3c56c515c875ca7bff40705740e08a320a5d9 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 29 Aug 2024 15:31:30 -0400 Subject: [PATCH 30/34] Rename Config.secureFieldsForLayer method Signed-off-by: Timothy Johnson --- packages/imperative/CHANGELOG.md | 1 + packages/imperative/src/config/src/ProfileInfo.ts | 2 +- packages/imperative/src/config/src/api/ConfigSecure.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index c0dea508ab..5314d7ceb3 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to the Imperative package will be documented in this file. - `CliProfileManager`, `CommandProfiles`, `ProfileValidator` - Use the `V1ProfileRead` class if you still need to read V1 profiles - `CliUtils.getOptValueFromProfiles` - Use `getOptValuesFromConfig` instead to load from team config - Next Breaking: Changed 2nd parameter of `CliUtils.getOptValuesFromConfig` method from type `ICommandDefinition` to `ICommandProfile`. +- Next Breaking: Renamed `ConfigSecure.secureFieldsForLayer` method to `securePropsForLayer`. ## `8.0.0-next.202408291544` diff --git a/packages/imperative/src/config/src/ProfileInfo.ts b/packages/imperative/src/config/src/ProfileInfo.ts index 84641b89f5..3b6824e1e8 100644 --- a/packages/imperative/src/config/src/ProfileInfo.ts +++ b/packages/imperative/src/config/src/ProfileInfo.ts @@ -1400,7 +1400,7 @@ export class ProfileInfo { const config = this.getTeamConfig(); const layer = opts ? config.findLayer(opts.user, opts.global) : config.layerActive(); const fields = config.api.secure.findSecure(layer.properties.profiles, "profiles"); - const vault = config.api.secure.secureFieldsForLayer(layer.path); + const vault = config.api.secure.securePropsForLayer(layer.path); const response: IProfArgAttrs[] = []; diff --git a/packages/imperative/src/config/src/api/ConfigSecure.ts b/packages/imperative/src/config/src/api/ConfigSecure.ts index ba43bfc143..2333bfdd2e 100644 --- a/packages/imperative/src/config/src/api/ConfigSecure.ts +++ b/packages/imperative/src/config/src/api/ConfigSecure.ts @@ -248,7 +248,7 @@ export class ConfigSecure extends ConfigApi { * @param layerPath Path of the layer to get secure properties for * @returns the secure properties for the given layer, or null if not found */ - public secureFieldsForLayer(layerPath: string): IConfigSecureProperties { + public securePropsForLayer(layerPath: string): IConfigSecureProperties { const secureLayer = Object.keys(this.mConfig.mSecure).find(osLocation => osLocation === layerPath); return secureLayer ? this.mConfig.mSecure[secureLayer] : null; } From 8f91edaf1a6a512dc550b2582a666d6e09e600ed Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 29 Aug 2024 15:36:16 -0400 Subject: [PATCH 31/34] Fix unused variable in test Signed-off-by: Timothy Johnson --- .../imperative/src/utilities/__tests__/CliUtils.unit.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts b/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts index dfbdf4233e..b107ed6cd3 100644 --- a/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts +++ b/packages/imperative/src/utilities/__tests__/CliUtils.unit.test.ts @@ -318,7 +318,7 @@ describe("CliUtils", () => { it("should throw an imperative error if a required profile is not present", () => { let error; try { - const args = CliUtils.getOptValuesFromConfig(mockConfigApi(undefined), + CliUtils.getOptValuesFromConfig(mockConfigApi(undefined), { required: ["banana"] } as any, {} as any, FAKE_OPTS); } catch (e) { error = e; From bd6d1c56535bb24398d7bfd490b826030f39b7cd Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 29 Aug 2024 16:13:18 -0400 Subject: [PATCH 32/34] Fix broken unit tests Signed-off-by: Timothy Johnson --- .../src/config/__tests__/Config.secure.unit.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/imperative/src/config/__tests__/Config.secure.unit.test.ts b/packages/imperative/src/config/__tests__/Config.secure.unit.test.ts index 276531d6a9..6573aa2757 100644 --- a/packages/imperative/src/config/__tests__/Config.secure.unit.test.ts +++ b/packages/imperative/src/config/__tests__/Config.secure.unit.test.ts @@ -177,8 +177,8 @@ describe("Config secure tests", () => { jest.spyOn(fs, "readFileSync"); const config = await Config.load(MY_APP); config.mSecure = secureConfigs; - expect(config.api.secure.secureFieldsForLayer(projectConfigPath)).toEqual({ [securePropPath]: "area51" }); - expect(config.api.secure.secureFieldsForLayer(projectUserConfigPath)).toEqual(null); + expect(config.api.secure.securePropsForLayer(projectConfigPath)).toEqual({ [securePropPath]: "area51" }); + expect(config.api.secure.securePropsForLayer(projectUserConfigPath)).toEqual(null); config.mSecure = {}; }); From 937889e73c9cc175a0d8555029da23faac13eb44 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Fri, 30 Aug 2024 12:58:35 -0400 Subject: [PATCH 33/34] Update deprecation replacements in changelog Signed-off-by: Timothy Johnson --- packages/imperative/CHANGELOG.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 5314d7ceb3..1f1b74bcb3 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -5,8 +5,12 @@ All notable changes to the Imperative package will be documented in this file. ## Recent Changes - LTS Breaking: Removed the following obsolete V1 profile classes/functions: - - `CliProfileManager`, `CommandProfiles`, `ProfileValidator` - Use the `V1ProfileRead` class if you still need to read V1 profiles - - `CliUtils.getOptValueFromProfiles` - Use `getOptValuesFromConfig` instead to load from team config + - `CliProfileManager` + - `CliUtils.getOptValueFromProfiles` + - `CommandProfiles` + - `ProfileValidator` + + See [`8.0.0-next.202408271330`](#800-next202408271330) for replacements - Next Breaking: Changed 2nd parameter of `CliUtils.getOptValuesFromConfig` method from type `ICommandDefinition` to `ICommandProfile`. - Next Breaking: Renamed `ConfigSecure.secureFieldsForLayer` method to `securePropsForLayer`. @@ -18,13 +22,15 @@ All notable changes to the Imperative package will be documented in this file. ## `8.0.0-next.202408271330` - LTS Breaking: [#2231](https://github.com/zowe/zowe-cli/issues/2231) - - Removed the obsolete V1 `profiles` property from `IHandlerParameters` interface + - Removed the obsolete V1 `profiles` property from `IHandlerParameters` interface - Use `IHandlerParameters.arguments` to access profile properties in a command handler - Deprecated the following obsolete V1 profile interfaces: - `IProfileTypeConfiguration.dependencies` - For team config, use nested profiles instead - `IProfileTypeConfiguration.validationPlanModule` - For team config, validate with JSON schema instead - Deprecated the following obsolete V1 profile classes/functions: - - `CliProfileManager`, `CommandProfiles`, `ProfileValidator` - Use the `V1ProfileRead` class if you still need to read V1 profiles - - `CliUtils.getOptValueFromProfiles` - Use `getOptValuesFromConfig` instead to load from team config + - `CliProfileManager` - Use `ProfileInfo` class to manage team config profiles + - `CliUtils.getOptValueFromProfiles` - Use `CliUtils.getOptValuesFromConfig` to load properties from team config + - `CommandProfiles` - Use `ImperativeConfig.instance.config.api.profiles` to load profiles from team config + - `ProfileValidator` - No direct replacement ## `8.0.0-next.202408231832` From 5a03a92edb88e046df0db52447a888eb6474d852 Mon Sep 17 00:00:00 2001 From: zowe-robot Date: Fri, 30 Aug 2024 18:09:27 +0000 Subject: [PATCH 34/34] Bump version to 8.0.0-next.202408301809 [ci skip] Signed-off-by: zowe-robot --- .../__packages__/cli-test-utils/package.json | 4 +- lerna.json | 2 +- npm-shrinkwrap.json | 122 +++++++++--------- packages/cli/package.json | 28 ++-- packages/core/package.json | 6 +- packages/imperative/CHANGELOG.md | 2 +- packages/imperative/package.json | 4 +- packages/provisioning/package.json | 8 +- packages/secrets/package.json | 2 +- packages/workflows/package.json | 10 +- packages/zosconsole/package.json | 8 +- packages/zosfiles/package.json | 10 +- packages/zosjobs/package.json | 10 +- packages/zoslogs/package.json | 8 +- packages/zosmf/package.json | 8 +- packages/zostso/package.json | 10 +- packages/zosuss/package.json | 6 +- 17 files changed, 124 insertions(+), 124 deletions(-) diff --git a/__tests__/__packages__/cli-test-utils/package.json b/__tests__/__packages__/cli-test-utils/package.json index d313d72c5a..0ee125abdf 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.202408291544", + "version": "8.0.0-next.202408301809", "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": "^10.0.0", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/imperative": "8.0.0-next.202408301809" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" diff --git a/lerna.json b/lerna.json index a0c03b25f8..0088d1bffa 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "command": { "publish": { "ignoreChanges": [ diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index afc2d16c49..e7fbe458cc 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.202408291544", + "version": "8.0.0-next.202408301809", "license": "EPL-2.0", "dependencies": { "find-up": "^5.0.0", @@ -63,7 +63,7 @@ "devDependencies": { "@types/js-yaml": "^4.0.9", "@types/uuid": "^10.0.0", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/imperative": "8.0.0-next.202408301809" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" @@ -16365,21 +16365,21 @@ }, "packages/cli": { "name": "@zowe/cli", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "hasInstallScript": true, "license": "EPL-2.0", "dependencies": { - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544", - "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809", + "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408301809", "find-process": "1.4.7", "lodash": "4.17.21", "minimatch": "9.0.5", @@ -16392,7 +16392,7 @@ "@types/diff": "^5.0.9", "@types/lodash": "^4.17.6", "@types/tar": "^6.1.11", - "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/cli-test-utils": "8.0.0-next.202408301809", "comment-json": "^4.2.3", "strip-ansi": "^6.0.1", "which": "^4.0.0" @@ -16401,7 +16401,7 @@ "node": ">=18.12.0" }, "optionalDependencies": { - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408291544" + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408301809" } }, "packages/cli/node_modules/brace-expansion": { @@ -16448,15 +16448,15 @@ }, "packages/core": { "name": "@zowe/core-for-zowe-sdk", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "license": "EPL-2.0", "dependencies": { "comment-json": "~4.2.3", "string-width": "^4.2.3" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "engines": { "node": ">=18.12.0" @@ -16467,7 +16467,7 @@ }, "packages/imperative": { "name": "@zowe/imperative", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "license": "EPL-2.0", "dependencies": { "@types/yargs": "^17.0.32", @@ -16520,7 +16520,7 @@ "@types/pacote": "^11.1.8", "@types/progress": "^2.0.7", "@types/stack-trace": "^0.0.33", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408301809", "concurrently": "^8.0.0", "cowsay": "^1.6.0", "deep-diff": "^1.0.0", @@ -16661,16 +16661,16 @@ }, "packages/provisioning": { "name": "@zowe/provisioning-for-zowe-sdk", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "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.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "engines": { "node": ">=18.12.0" @@ -16682,7 +16682,7 @@ }, "packages/secrets": { "name": "@zowe/secrets-for-zowe-sdk", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "hasInstallScript": true, "license": "EPL-2.0", "devDependencies": { @@ -16695,15 +16695,15 @@ }, "packages/workflows": { "name": "@zowe/zos-workflows-for-zowe-sdk", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408291544" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408301809" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "engines": { "node": ">=18.12.0" @@ -16715,12 +16715,12 @@ }, "packages/zosconsole": { "name": "@zowe/zos-console-for-zowe-sdk", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "engines": { "node": ">=18.12.0" @@ -16732,16 +16732,16 @@ }, "packages/zosfiles": { "name": "@zowe/zos-files-for-zowe-sdk", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "license": "EPL-2.0", "dependencies": { "minimatch": "^9.0.5" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408301809" }, "engines": { "node": ">=18.12.0" @@ -16773,15 +16773,15 @@ }, "packages/zosjobs": { "name": "@zowe/zos-jobs-for-zowe-sdk", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "license": "EPL-2.0", "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408291544" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408301809" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "engines": { "node": ">=18.12.0" @@ -16793,12 +16793,12 @@ }, "packages/zoslogs": { "name": "@zowe/zos-logs-for-zowe-sdk", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "engines": { "node": ">=18.12.0" @@ -16810,12 +16810,12 @@ }, "packages/zosmf": { "name": "@zowe/zosmf-for-zowe-sdk", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "license": "EPL-2.0", "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "engines": { "node": ">=18.12.0" @@ -16827,15 +16827,15 @@ }, "packages/zostso": { "name": "@zowe/zos-tso-for-zowe-sdk", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "license": "EPL-2.0", "dependencies": { - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408291544" + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408301809" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "engines": { "node": ">=18.12.0" @@ -16847,15 +16847,15 @@ }, "packages/zosuss": { "name": "@zowe/zos-uss-for-zowe-sdk", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "license": "EPL-2.0", "dependencies": { "ssh2": "^1.15.0" }, "devDependencies": { "@types/ssh2": "^1.11.19", - "@zowe/cli-test-utils": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "engines": { "node": ">=18.12.0" diff --git a/packages/cli/package.json b/packages/cli/package.json index f3cd980826..2a12662d17 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/cli", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "zoweVersion": "v3.0.0-prerelease", "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.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544", - "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809", + "@zowe/provisioning-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-logs-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zos-workflows-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408301809", "find-process": "1.4.7", "lodash": "4.17.21", "minimatch": "9.0.5", @@ -78,13 +78,13 @@ "@types/diff": "^5.0.9", "@types/lodash": "^4.17.6", "@types/tar": "^6.1.11", - "@zowe/cli-test-utils": "8.0.0-next.202408291544", + "@zowe/cli-test-utils": "8.0.0-next.202408301809", "comment-json": "^4.2.3", "strip-ansi": "^6.0.1", "which": "^4.0.0" }, "optionalDependencies": { - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408291544" + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408301809" }, "engines": { "node": ">=18.12.0" diff --git a/packages/core/package.json b/packages/core/package.json index fab341dedf..06d2dbdcdd 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.202408291544", + "version": "8.0.0-next.202408301809", "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.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next" diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 1f1b74bcb3..0a98089e66 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the Imperative package will be documented in this file. -## Recent Changes +## `8.0.0-next.202408301809` - LTS Breaking: Removed the following obsolete V1 profile classes/functions: - `CliProfileManager` diff --git a/packages/imperative/package.json b/packages/imperative/package.json index a726a4e4c8..2b337b056b 100644 --- a/packages/imperative/package.json +++ b/packages/imperative/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/imperative", - "version": "8.0.0-next.202408291544", + "version": "8.0.0-next.202408301809", "description": "framework for building configurable CLIs", "author": "Zowe", "license": "EPL-2.0", @@ -95,7 +95,7 @@ "@types/pacote": "^11.1.8", "@types/progress": "^2.0.7", "@types/stack-trace": "^0.0.33", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408291544", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408301809", "concurrently": "^8.0.0", "cowsay": "^1.6.0", "deep-diff": "^1.0.0", diff --git a/packages/provisioning/package.json b/packages/provisioning/package.json index 0b5e370e95..ec7b0534e8 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.202408291544", + "version": "8.0.0-next.202408301809", "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.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/secrets/package.json b/packages/secrets/package.json index 1d849e396d..1fe56608c5 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.202408291544", + "version": "8.0.0-next.202408301809", "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 b1e637f2ff..464996147d 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.202408291544", + "version": "8.0.0-next.202408301809", "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.202408291544" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408301809" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosconsole/package.json b/packages/zosconsole/package.json index be7342265e..6fc0c2033c 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.202408291544", + "version": "8.0.0-next.202408301809", "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.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosfiles/package.json b/packages/zosfiles/package.json index 77a63402a5..44c77c09b5 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.202408291544", + "version": "8.0.0-next.202408301809", "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.5" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408301809" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosjobs/package.json b/packages/zosjobs/package.json index d435f4a579..f954e843ad 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.202408291544", + "version": "8.0.0-next.202408301809", "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.202408291544" + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408301809" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zoslogs/package.json b/packages/zoslogs/package.json index 583a095194..8f5ed0cac9 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.202408291544", + "version": "8.0.0-next.202408301809", "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.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosmf/package.json b/packages/zosmf/package.json index 5424557ca3..0c7283dc44 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.202408291544", + "version": "8.0.0-next.202408301809", "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.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zostso/package.json b/packages/zostso/package.json index 20a41c55de..1a44c07d50 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.202408291544", + "version": "8.0.0-next.202408301809", "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.202408291544" + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408301809" }, "devDependencies": { - "@zowe/cli-test-utils": "8.0.0-next.202408291544", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "peerDependencies": { "@zowe/core-for-zowe-sdk": "^8.0.0-next", diff --git a/packages/zosuss/package.json b/packages/zosuss/package.json index 50d438ab12..195dcd7a55 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.202408291544", + "version": "8.0.0-next.202408301809", "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.202408291544", - "@zowe/imperative": "8.0.0-next.202408291544" + "@zowe/cli-test-utils": "8.0.0-next.202408301809", + "@zowe/imperative": "8.0.0-next.202408301809" }, "peerDependencies": { "@zowe/imperative": "^8.0.0-next"