diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 94c2494c45..a064777b06 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -32,7 +32,18 @@ plugins: rules: "@typescript-eslint/await-thenable": off "@typescript-eslint/consistent-type-assertions": warn - "@typescript-eslint/explicit-function-return-type": error + "@typescript-eslint/explicit-function-return-type": [ 'error', { + # We only disallow the rules that provide value (i.e. that found some errors while configuring) + # Documentation: https://typescript-eslint.io/rules/explicit-function-return-type + allowHigherOrderFunctions: false, + allowFunctionsWithoutTypeParameters: false, + + # Disabling (i.e. setting to `false`) the following rule will force us to unnecessarily type built-in functions + # For example, to find the index of a profile in a profiles array we will have to go: + # FROM: profiles.findIndex((profile) => profile.name === "my_profile")) + # TO: profiles.findIndex((profile): boolean => profile.name === "my_profile")) + allowTypedFunctionExpressions: true, + }] "@typescript-eslint/explicit-member-accessibility": error # There are several errors falling under these rules; resolve @@ -46,9 +57,9 @@ rules: "@typescript-eslint/no-unused-expressions": error "@typescript-eslint/no-var-requires": warn array-callback-return: error - complexity: - - warn - - 15 + # complexity: + # - warn + # - 15 constructor-super: error curly: warn getter-return: error @@ -69,7 +80,7 @@ rules: no-irregular-whitespace: warn no-magic-numbers: - warn - - "ignore": [-1, 0, 1, 2, 4] + - "ignore": [-2, -1, 0, 1, 2, 4] no-multiple-empty-lines: warn no-return-await: warn no-sequences: warn diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index 26fe8157c6..42074fa2ec 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -36,14 +36,18 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t - Added PEM certificate support as an authentication method for logging into the API ML. [#2621](https://github.com/zowe/zowe-explorer-vscode/issues/2621) - Deprecated the `getUSSDocumentFilePath` function on the `IZoweTreeNode` interface as Zowe Explorer no longer uses the local file system for storing USS files. **No replacement is planned**; please access data from tree nodes using their [resource URIs](https://github.com/zowe/zowe-explorer-vscode/wiki/FileSystemProvider#operations-for-extenders) instead. [#2968](https://github.com/zowe/zowe-explorer-vscode/pull/2968) - **Next Breaking:** Changed `ProfilesCache.convertV1ProfToConfig` method to be a static method that requires `ProfileInfo` instance as a parameter. +- Added the `onVaultUpdate` VSCode event to notify extenders when credentials are updated on the OS vault by other applications. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994) +- Added the `onCredMgrsUpdate` VSCode event to notify extenders when the local PC's credential manager has been updated by other applications. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994) +- Updated most function signatures for exported programmatic interfaces. Changes make developing with the Zowe Explorer API more efficient for extenders by showing which properties they can expect when calling our APIs. [#2952](https://github.com/zowe/zowe-explorer-vscode/issues/2952) ### Bug fixes - Fixed an issue where the `onProfilesUpdate` event did not fire after secure credentials were updated. [#2822](https://github.com/zowe/zowe-explorer-vscode/issues/2822) - Fixed an issue where `ProfilesCache` may return missing or incorrect profile values when multiple extensions call it during activation. [#2831](https://github.com/zowe/zowe-explorer-vscode/issues/2831) - Removed `handlebars` dependency in favor of `mustache` for technical currency purposes. [#2975](https://github.com/zowe/zowe-explorer-vscode/pull/2975) -- Update Zowe SDKs to `8.0.0-next.202407051717` for technical currency. [#2918](https://github.com/zowe/zowe-explorer-vscode/issues/2918) - Fixed an issue where the `ZoweVsCodeExtension.updateCredentials` method could remove credentials from session when input prompt was cancelled. [#3009](https://github.com/zowe/zowe-explorer-vscode/pull/3009) +- Fixed an issue where the loaded configuration could be overridden when extenders retrieved the Zowe home directory. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994) +- Update Zowe SDKs to `8.0.0-next.202407232256` for technical currency. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994) ## `3.0.0-next.202404242037` diff --git a/packages/zowe-explorer-api/__tests__/__unit__/fs/BaseProvider.unit.test.ts b/packages/zowe-explorer-api/__tests__/__unit__/fs/BaseProvider.unit.test.ts index 6d98611831..b5057cb152 100644 --- a/packages/zowe-explorer-api/__tests__/__unit__/fs/BaseProvider.unit.test.ts +++ b/packages/zowe-explorer-api/__tests__/__unit__/fs/BaseProvider.unit.test.ts @@ -14,7 +14,7 @@ import { BaseProvider, ConflictViewSelection, DirEntry, FileEntry, ZoweScheme } import { Gui } from "../../../src/globals"; import { MockedProperty } from "../../../__mocks__/mockUtils"; -function getGlobalMocks() { +function getGlobalMocks(): { [key: string]: any } { return { testFileUri: vscode.Uri.from({ scheme: ZoweScheme.USS, path: "/file.txt" }), testFolderUri: vscode.Uri.from({ scheme: ZoweScheme.USS, path: "/folder" }), @@ -42,7 +42,7 @@ function getGlobalMocks() { const globalMocks = getGlobalMocks(); describe("diffOverwrite", () => { - function getBlockMocks() { + function getBlockMocks(): { [key: string]: jest.SpyInstance } { return { lookupAsFileMock: jest.spyOn((BaseProvider as any).prototype, "_lookupAsFile"), writeFileMock: jest.spyOn(vscode.workspace.fs, "writeFile").mockImplementation(), @@ -88,7 +88,7 @@ describe("diffOverwrite", () => { }); describe("diffUseRemote", () => { - function getBlockMocks(prov) { + function getBlockMocks(prov): { [key: string]: jest.SpyInstance } { return { lookupAsFileMock: jest.spyOn(prov, "_lookupAsFile"), writeFileMock: jest.spyOn(vscode.workspace.fs, "writeFile").mockImplementation(), @@ -161,7 +161,7 @@ describe("diffUseRemote", () => { }); describe("exists", () => { - function getBlockMocks() { + function getBlockMocks(): { [key: string]: jest.SpyInstance } { return { lookupMock: jest.spyOn((BaseProvider as any).prototype, "_lookup"), }; @@ -454,7 +454,7 @@ describe("_createFile", () => { } }); - it("throws an error if a folder already exists with the same URI", async () => { + it("throws an error if a folder already exists with the same URI", () => { const prov = new (BaseProvider as any)(); prov.root = new DirEntry(""); prov.root.metadata = { diff --git a/packages/zowe-explorer-api/__tests__/__unit__/globals/Gui.unit.test.ts b/packages/zowe-explorer-api/__tests__/__unit__/globals/Gui.unit.test.ts index 96e6e3e8e8..ff826a1f66 100644 --- a/packages/zowe-explorer-api/__tests__/__unit__/globals/Gui.unit.test.ts +++ b/packages/zowe-explorer-api/__tests__/__unit__/globals/Gui.unit.test.ts @@ -15,7 +15,7 @@ import * as vscode from "vscode"; import { Constants } from "../../../src/globals"; jest.mock("vscode"); -function createGlobalMocks() { +function createGlobalMocks(): { [key: string]: jest.Mock } { const mocks = { showInfoMessage: jest.fn(), showErrorMessage: jest.fn(), diff --git a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts index becafa5eea..3f71127166 100644 --- a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts +++ b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts @@ -17,14 +17,6 @@ import { FileManagement, Types } from "../../../src"; jest.mock("fs"); -const fakeSchema: { properties: object } = { - properties: { - host: { type: "string" }, - port: { type: "number" }, - user: { type: "string", secure: true }, - password: { type: "string", secure: true }, - }, -}; const lpar1Profile: Required> = { name: "lpar1", type: "zosmf", @@ -157,7 +149,7 @@ describe("ProfilesCache", () => { existsSync.mockRestore(); }); - it("requireKeyring returns keyring module from Secrets SDK", async () => { + it("requireKeyring returns keyring module from Secrets SDK", () => { const keyring = ProfilesCache.requireKeyring(); expect(keyring).toBeDefined(); expect(Object.keys(keyring).length).toBe(5); @@ -260,7 +252,7 @@ describe("ProfilesCache", () => { it("should refresh profile data for multiple profile types", async () => { const profCache = new ProfilesCache({ ...fakeLogger, error: mockLogError } as unknown as imperative.Logger); - const getProfInfoSpy = jest.spyOn(profCache, "getProfileInfo").mockResolvedValue(createProfInfoMock([lpar1Profile, zftpProfile])); + jest.spyOn(profCache, "getProfileInfo").mockResolvedValue(createProfInfoMock([lpar1Profile, zftpProfile])); await profCache.refresh(fakeApiRegister as unknown as Types.IApiRegisterClient); expect(profCache.allProfiles.length).toEqual(2); expect(profCache.allProfiles[0]).toMatchObject(lpar1Profile); diff --git a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ZoweExplorerZosmfApi.unit.test.ts b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ZoweExplorerZosmfApi.unit.test.ts index d241d51260..269a4d08c7 100644 --- a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ZoweExplorerZosmfApi.unit.test.ts +++ b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ZoweExplorerZosmfApi.unit.test.ts @@ -61,15 +61,11 @@ async function expectUnixCommandApiWithSshSession( ): Promise { spy.mockClear().mockResolvedValue(undefined); spy.mockImplementation((sshobject: zosuss.SshSession, command: string, cwd: string, callback: (data: string) => void) => { - let r = ""; callback("test"); - r += "test"; }); const spywhenpathnotspecified = jest.spyOn(zosuss.Shell, "executeSsh"); spywhenpathnotspecified.mockImplementation((sshobject: zosuss.SshSession, command: string, callback: (data: string) => void) => { - let r = ""; callback("test"); - r += "test"; }); await apiInstance[name as string](sshobj, ...args, true, () => {}); await apiInstance[name as string](sshobj, ...args, false, () => {}); diff --git a/packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts b/packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts index 4b69c1c124..13568ff055 100644 --- a/packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts +++ b/packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts @@ -316,9 +316,9 @@ describe("ZoweVsCodeExtension", () => { const testSpy = jest.spyOn(ZoweVsCodeExtension as any, "getServiceProfileForAuthPurposes"); jest.spyOn(ZoweVsCodeExtension as any, "promptUserPass").mockResolvedValue(["user", "pass"]); let sessionCopy; - const loginSpy = jest.spyOn(Login, "apimlLogin").mockImplementation(async (session: imperative.Session) => { + const loginSpy = jest.spyOn(Login, "apimlLogin").mockImplementation((session: imperative.Session) => { sessionCopy = Object.assign(Object.create(Object.getPrototypeOf(session)), session); - return "tokenValue"; + return Promise.resolve("tokenValue"); }); // case 1: User selects "user/password" for login quick pick diff --git a/packages/zowe-explorer-api/package.json b/packages/zowe-explorer-api/package.json index afaa3f30ff..9fc5242d19 100644 --- a/packages/zowe-explorer-api/package.json +++ b/packages/zowe-explorer-api/package.json @@ -28,15 +28,15 @@ }, "dependencies": { "@types/vscode": "^1.53.2", - "@zowe/core-for-zowe-sdk": "8.0.0-next.202407051717", - "@zowe/imperative": "8.0.0-next.202407051717", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202407051717", - "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202407051717", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202407051717", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202407051717", - "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202407051717", - "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202407051717", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202407051717", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202407232256", + "@zowe/imperative": "8.0.0-next.202407232256", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202407232256", + "@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202407232256", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202407232256", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202407232256", + "@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202407232256", + "@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202407232256", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202407232256", "mustache": "^4.2.0", "semver": "^7.6.0" }, @@ -44,10 +44,14 @@ "build": "pnpm check-cli && pnpm copy-secrets && pnpm clean && pnpm license && tsc -p ./ && pnpm madge", "test:unit": "jest \".*__tests__.*\\.unit\\.test\\.ts\" --coverage", "test": "pnpm test:unit", - "lint": "concurrently -n \"_eslint_,prettier\" \"eslint .\" \"prettier --write . && prettier --check .\"", - "lint:html": "eslint . --format html > results/eslint.html", + "lint": "concurrently -n \"_eslint_,prettier\" \"pnpm lint:all\" \"pnpm pretty; pnpm pretty:check\"", + "lint:all": "pnpm lint:src; pnpm lint:test; pnpm lint:html", + "lint:src": "eslint --format stylish src/**/*.ts", + "lint:test": "eslint --format stylish __tests__/**/*.ts", + "lint:html": "mkdir -p results && eslint . --format html > results/eslint.html", "madge": "madge -c --no-color --no-spinner --exclude __mocks__ --extensions js,ts src/", "pretty": "prettier --write .", + "pretty:check": "prettier --check .", "check-cli": "node scripts/check-cli.js", "clean": "rimraf lib tsconfig.tsbuildinfo", "fresh-clone": "pnpm clean && (rimraf node_modules || true)", diff --git a/packages/zowe-explorer-api/src/extend/IRegisterClient.ts b/packages/zowe-explorer-api/src/extend/IRegisterClient.ts index 85b234655d..20005d9c20 100644 --- a/packages/zowe-explorer-api/src/extend/IRegisterClient.ts +++ b/packages/zowe-explorer-api/src/extend/IRegisterClient.ts @@ -21,18 +21,18 @@ import * as vscode from "vscode"; * the object returned by this extensions activate() method as shown below. * * @example - * // see if Zowe Explorer is installed and retrieve the API Registry\ - * const explorerApi = extensions.getExtension('zowe.vscode-extension-for-zowe');\ - * if (explorerApi && explorerApi.exports) {\ - * // Cast the returned object to the IApiRegisterClient interface\ - * const importedApi: IApiRegisterClient = explorerApi.exports;\ - * // create an instance of my API and register it with Zowe Explorer\ - * importedApi.registerUssApi(new MyZoweExplorerAppUssApi());\ - * window.showInformationMessage(\ - * 'Zowe Explorer was augmented for MyApp support. Please, refresh your explorer views.');\ - * } else {\ - * window.showInformationMessage(\ - * 'Zowe VS Extension was not found: either not installe or older version.');\ + * // see if Zowe Explorer is installed and retrieve the API Registry + * const explorerApi = extensions.getExtension('zowe.vscode-extension-for-zowe'); + * if (explorerApi && explorerApi.exports) { + * // Cast the returned object to the IApiRegisterClient interface + * const importedApi: IApiRegisterClient = explorerApi.exports; + * // create an instance of my API and register it with Zowe Explorer + * importedApi.registerUssApi(new MyZoweExplorerAppUssApi()); + * window.showInformationMessage( + * 'Zowe Explorer was augmented for MyApp support. Please, refresh your explorer views.'); + * } else { + * window.showInformationMessage( + * 'Zowe VS Extension was not found: either not installed or older version.'); * } * * @export @@ -110,6 +110,16 @@ export interface IRegisterClient { */ onProfilesUpdate?: vscode.Event; + /** + * Define events that fire whenever credentials are updated on the client. + */ + onVaultUpdate?: vscode.Event; + + /** + * Define events that fire whenever the credential manager is updated. + */ + onCredMgrUpdate?: vscode.Event; + /** * Lookup of any registered API (Uss, Mvs, Jes, or Command). * @param {string} profile diff --git a/packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts b/packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts index 8e8324445b..48bb4e95a1 100644 --- a/packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts +++ b/packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts @@ -286,7 +286,8 @@ export namespace ZoweExplorerZosmf { }; } } else { - // If we decide to match 1:1 the Zowe.Copy.dataSet implementation, we will need to break the interface definition in the ZoweExplorerApi + // If we decide to match 1:1 the Zowe.Copy.dataSet implementation, + // we will need to break the interface definition in the ZoweExplorerApi newOptions = { "from-dataset": { dsn: fromDataSetName, member: fromMemberName } }; } return zosfiles.Copy.dataSet(this.getSession(), { dsn: toDataSetName, member: toMemberName }, newOptions); diff --git a/packages/zowe-explorer-api/src/utils/FileManagement.ts b/packages/zowe-explorer-api/src/utils/FileManagement.ts index 1e31b16769..1fa8ff4637 100644 --- a/packages/zowe-explorer-api/src/utils/FileManagement.ts +++ b/packages/zowe-explorer-api/src/utils/FileManagement.ts @@ -12,7 +12,7 @@ import { realpathSync } from "fs"; import { platform } from "os"; import { Constants } from "../globals"; -import { ProfileInfo } from "@zowe/imperative"; +import { ImperativeConfig, ConfigUtils } from "@zowe/imperative"; export class FileManagement { public static permStringToOctal(perms: string): number { @@ -34,7 +34,10 @@ export class FileManagement { } public static getZoweDir(): string { - return ProfileInfo.getZoweDir(); + if (ImperativeConfig.instance.loadedConfig != null) { + return ImperativeConfig.instance.cliHome; + } + return ConfigUtils.getZoweDir(); } public static getFullPath(anyPath: string): string { diff --git a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts index 90e77ab004..fec0f7a2ff 100644 --- a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts +++ b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts @@ -271,7 +271,7 @@ export class ZoweVsCodeExtension { const saveButton = "Save Credentials"; const message = [ `Save entered credentials in plain text for future use with profile ${profile.name}?`, - "Saving credentials will update the local information file.", + "Saving credentials will update the local configuration file.", ].join("\n"); await Gui.showMessage(message, { items: [saveButton], vsCodeOpts: { modal: true } }).then((selection) => { if (selection) { diff --git a/packages/zowe-explorer-ftp-extension/CHANGELOG.md b/packages/zowe-explorer-ftp-extension/CHANGELOG.md index 97e02e6eea..8b50a7745d 100644 --- a/packages/zowe-explorer-ftp-extension/CHANGELOG.md +++ b/packages/zowe-explorer-ftp-extension/CHANGELOG.md @@ -10,7 +10,7 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum - Changed the hashing algorithm for e-tag generation from `sha1` to `sha256` to avoid collisions. [#2890](https://github.com/zowe/zowe-explorer-vscode/pull/2890) - Updated the FTP plugin dependency to `3.0.0-next.202403191358` for technical currency [#2783](https://github.com/zowe/vscode-extension-for-zowe/pull/2783). -- Update Zowe SDKs to `8.0.0-next.202405241828` for technical currency. [#2918](https://github.com/zowe/zowe-explorer-vscode/issues/2918) +- Update Zowe SDKs to `8.0.0-next.202407232256` for technical currency. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994) ## `3.0.0-next.202404242037` diff --git a/packages/zowe-explorer-ftp-extension/__tests__/__unit__/FtpApi/ZoweExplorerAbstractFtpApi.unit.test.ts b/packages/zowe-explorer-ftp-extension/__tests__/__unit__/FtpApi/ZoweExplorerAbstractFtpApi.unit.test.ts index e4c8495ace..283065442f 100644 --- a/packages/zowe-explorer-ftp-extension/__tests__/__unit__/FtpApi/ZoweExplorerAbstractFtpApi.unit.test.ts +++ b/packages/zowe-explorer-ftp-extension/__tests__/__unit__/FtpApi/ZoweExplorerAbstractFtpApi.unit.test.ts @@ -72,7 +72,7 @@ describe("AbstractFtpApi", () => { it("should show a fatal message when trying to call getStatus with invalid credentials.", async () => { Object.defineProperty(Gui, "errorMessage", { value: jest.fn(), configurable: true }); jest.spyOn(FTPConfig, "connectFromArguments").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Failed: missing credentials"); }) ); @@ -95,7 +95,7 @@ describe("AbstractFtpApi", () => { it("should show a different fatal message when trying to call getStatus and an exception occurs.", async () => { Object.defineProperty(Gui, "errorMessage", { value: jest.fn(), configurable: true }); jest.spyOn(FTPConfig, "connectFromArguments").mockImplementationOnce( - jest.fn((prof) => { + jest.fn((_prof) => { throw new Error("Something happened"); }) ); @@ -142,7 +142,7 @@ describe("AbstractFtpApi", () => { Object.defineProperty(Gui, "showMessage", { value: jest.fn(), configurable: true }); const instance = new Dummy(profile); jest.spyOn(FTPConfig, "connectFromArguments").mockImplementationOnce( - jest.fn(((prof) => Promise.resolve({ test: "Test successful object" })) as any) + jest.fn(((_prof) => Promise.resolve({ test: "Test successful object" })) as any) ); const status = await instance.getStatus(profile, "zftp"); @@ -152,7 +152,7 @@ describe("AbstractFtpApi", () => { it("should return inactive from sessionStatus when getStatus is called w/ correct profile", async () => { Object.defineProperty(Gui, "showMessage", { value: jest.fn(), configurable: true }); const instance = new Dummy(profile); - jest.spyOn(FTPConfig, "connectFromArguments").mockImplementationOnce(jest.fn(((prof) => Promise.resolve(false)) as any)); + jest.spyOn(FTPConfig, "connectFromArguments").mockImplementationOnce(jest.fn(((_prof) => Promise.resolve(false)) as any)); const status = await instance.getStatus(profile, "zftp"); expect(status).toStrictEqual("inactive"); diff --git a/packages/zowe-explorer-ftp-extension/__tests__/__unit__/Jes/ZoweExplorerFtpJesApi.unit.test.ts b/packages/zowe-explorer-ftp-extension/__tests__/__unit__/Jes/ZoweExplorerFtpJesApi.unit.test.ts index a577f65871..881f63ecaa 100644 --- a/packages/zowe-explorer-ftp-extension/__tests__/__unit__/Jes/ZoweExplorerFtpJesApi.unit.test.ts +++ b/packages/zowe-explorer-ftp-extension/__tests__/__unit__/Jes/ZoweExplorerFtpJesApi.unit.test.ts @@ -16,7 +16,6 @@ import { FtpJesApi } from "../../../src/ZoweExplorerFtpJesApi"; import { DataSetUtils, JobUtils } from "@zowe/zos-ftp-for-zowe-cli"; import TestUtils from "../utils/TestUtils"; -import * as zosjobs from "@zowe/zos-jobs-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; import * as globals from "../../../src/globals"; import { ZoweFtpExtensionError } from "../../../src/ZoweFtpExtensionError"; @@ -151,7 +150,7 @@ describe("FtpJesApi", () => { it("should throw error when list jobs by owner and prefix failed.", async () => { jest.spyOn(JobUtils, "listJobs").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("List jobs failed."); }) ); @@ -162,7 +161,7 @@ describe("FtpJesApi", () => { it("should throw error when get job failed.", async () => { jest.spyOn(JobUtils, "findJobByID").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Get jobs failed."); }) ); @@ -173,7 +172,7 @@ describe("FtpJesApi", () => { it("should throw error when get spool files failed.", async () => { jest.spyOn(JobUtils, "findJobByID").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Get jobs failed."); }) ); @@ -184,7 +183,7 @@ describe("FtpJesApi", () => { it("should throw error when download spool contents failed.", async () => { jest.spyOn(JobUtils, "findJobByID").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Get jobs failed."); }) ); @@ -198,7 +197,7 @@ describe("FtpJesApi", () => { it("should throw error when get spool contents by id failed.", async () => { jest.spyOn(JobUtils, "getSpoolFileContent").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Get spool file content failed."); }) ); @@ -209,7 +208,7 @@ describe("FtpJesApi", () => { it("should throw error when submit job failed", async () => { jest.spyOn(JobUtils, "submitJob").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Submit job failed."); }) ); @@ -220,7 +219,7 @@ describe("FtpJesApi", () => { it("should throw error when delete job failed", async () => { jest.spyOn(JobUtils, "deleteJob").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Delete job failed."); }) ); diff --git a/packages/zowe-explorer-ftp-extension/__tests__/__unit__/Mvs/ZoweExplorerFtpMvsApi.unit.test.ts b/packages/zowe-explorer-ftp-extension/__tests__/__unit__/Mvs/ZoweExplorerFtpMvsApi.unit.test.ts index 4781725a56..3d90f828e8 100644 --- a/packages/zowe-explorer-ftp-extension/__tests__/__unit__/Mvs/ZoweExplorerFtpMvsApi.unit.test.ts +++ b/packages/zowe-explorer-ftp-extension/__tests__/__unit__/Mvs/ZoweExplorerFtpMvsApi.unit.test.ts @@ -322,7 +322,7 @@ describe("FtpMvsApi", () => { it("should throw error when list dataset failed", async () => { jest.spyOn(DataSetUtils, "listDataSets").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("List dataset failed."); }) ); @@ -333,7 +333,7 @@ describe("FtpMvsApi", () => { it("should throw error when list dataset members failed", async () => { jest.spyOn(DataSetUtils, "listMembers").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("List members failed."); }) ); @@ -344,7 +344,7 @@ describe("FtpMvsApi", () => { it("should throw error when get contents failed", async () => { jest.spyOn(DataSetUtils, "downloadDataSet").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Download dataset failed."); }) ); @@ -362,7 +362,7 @@ describe("FtpMvsApi", () => { it("should throw error when put contents failed", async () => { jest.spyOn(DataSetUtils, "uploadDataSet").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Upload dataset failed."); }) ); @@ -379,7 +379,7 @@ describe("FtpMvsApi", () => { it("should throw error when create dataset failed", async () => { jest.spyOn(DataSetUtils, "allocateDataSet").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Allocate dataset failed."); }) ); @@ -395,7 +395,7 @@ describe("FtpMvsApi", () => { it("should throw error when create dataset member failed", async () => { jest.spyOn(DataSetUtils, "uploadDataSet").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Upload dataset failed."); }) ); @@ -411,7 +411,7 @@ describe("FtpMvsApi", () => { it("should throw error when rename dataset failed", async () => { jest.spyOn(DataSetUtils, "renameDataSet").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Rename dataset failed."); }) ); @@ -422,7 +422,7 @@ describe("FtpMvsApi", () => { it("should throw error when rename dataset member failed", async () => { jest.spyOn(DataSetUtils, "renameDataSet").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Rename dataset failed."); }) ); @@ -433,7 +433,7 @@ describe("FtpMvsApi", () => { it("should throw error when delete dataset failed", async () => { jest.spyOn(DataSetUtils, "deleteDataSet").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Delete dataset failed."); }) ); diff --git a/packages/zowe-explorer-ftp-extension/__tests__/__unit__/Uss/ZoweExplorerFtpUssApi.unit.test.ts b/packages/zowe-explorer-ftp-extension/__tests__/__unit__/Uss/ZoweExplorerFtpUssApi.unit.test.ts index 51f02538a2..d2e5718670 100644 --- a/packages/zowe-explorer-ftp-extension/__tests__/__unit__/Uss/ZoweExplorerFtpUssApi.unit.test.ts +++ b/packages/zowe-explorer-ftp-extension/__tests__/__unit__/Uss/ZoweExplorerFtpUssApi.unit.test.ts @@ -85,12 +85,12 @@ describe("FtpUssApi", () => { it("should throw error for getContents if connection to FTP client fails.", async () => { jest.spyOn(UssApi, "ftpClient").mockReturnValueOnce(null); - expect(UssApi.getContents("/some/example/path", {})).rejects.toThrow(); + await expect(UssApi.getContents("/some/example/path", {})).rejects.toThrow(); }); it("should throw error for putContent if connection to FTP client fails.", async () => { jest.spyOn(UssApi, "ftpClient").mockReturnValueOnce(null); - expect(UssApi.putContent("/some/example/input/path", "/some/uss/path")).rejects.toThrow(); + await expect(UssApi.putContent("/some/example/input/path", "/some/uss/path")).rejects.toThrow(); }); it("should upload uss files.", async () => { @@ -212,7 +212,7 @@ describe("FtpUssApi", () => { it("should throw error when list files failed", async () => { jest.spyOn(UssUtils, "listFiles").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("List files failed."); }) ); @@ -257,7 +257,7 @@ describe("FtpUssApi", () => { it("should throw error when upload directory failed", async () => { jest.spyOn(UssUtils, "uploadFile").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Upload file failed."); }) ); @@ -273,7 +273,7 @@ describe("FtpUssApi", () => { it("should throw error when create file failed", async () => { jest.spyOn(UssUtils, "uploadFile").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Upload file failed."); }) ); @@ -284,7 +284,7 @@ describe("FtpUssApi", () => { it("should throw error when delete file failed", async () => { jest.spyOn(UssUtils, "deleteFile").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Delete file failed."); }) ); @@ -295,7 +295,7 @@ describe("FtpUssApi", () => { it("should throw error when rename file failed", async () => { jest.spyOn(UssUtils, "renameFile").mockImplementationOnce( - jest.fn((val) => { + jest.fn((_val) => { throw new Error("Rename file failed."); }) ); diff --git a/packages/zowe-explorer-ftp-extension/__tests__/__unit__/extension.unit.test.ts b/packages/zowe-explorer-ftp-extension/__tests__/__unit__/extension.unit.test.ts index f4627dcb9e..58e18aff90 100644 --- a/packages/zowe-explorer-ftp-extension/__tests__/__unit__/extension.unit.test.ts +++ b/packages/zowe-explorer-ftp-extension/__tests__/__unit__/extension.unit.test.ts @@ -19,7 +19,7 @@ describe("Extension Unit Tests - function registerFtpApis", () => { jest.clearAllMocks(); }); - it("should register the ftp API's", async () => { + it("should register the ftp API's", () => { const registerUssApiMock = jest.fn(); const registerJesApiMock = jest.fn(); const registerMvsApiMock = jest.fn(); @@ -46,7 +46,7 @@ describe("Extension Unit Tests - function registerFtpApis", () => { expect(registerJesApiMock).toHaveBeenCalledTimes(1); }); - it("should display error if zoweExplorerApi was not found", async () => { + it("should display error if zoweExplorerApi was not found", () => { jest.spyOn(ZoweVsCodeExtension, "getZoweExplorerApi").mockReturnValue(null); const showMessageSpy = jest.spyOn(Gui, "showMessage").mockImplementation(); expect( diff --git a/packages/zowe-explorer-ftp-extension/package.json b/packages/zowe-explorer-ftp-extension/package.json index db86bf27f6..1d796d0a88 100644 --- a/packages/zowe-explorer-ftp-extension/package.json +++ b/packages/zowe-explorer-ftp-extension/package.json @@ -33,10 +33,14 @@ "build": "pnpm clean && pnpm license && webpack --mode development && pnpm madge", "test:unit": "jest \".*__tests__.*\\.unit\\.test\\.ts\" --coverage", "test": "pnpm test:unit", - "lint": "concurrently -n \"_eslint_,prettier\" \"eslint .\" \"prettier --write . && prettier --check .\"", - "lint:html": "eslint . --format html > results/eslint.html", + "lint": "concurrently -n \"_eslint_,prettier\" \"pnpm lint:all\" \"pnpm pretty; pnpm pretty:check\"", + "lint:all": "pnpm lint:src; pnpm lint:test; pnpm lint:html", + "lint:src": "eslint . --format stylish src/**/*.ts", + "lint:test": "eslint . --format stylish __tests__/**/*.ts", + "lint:html": "mkdir -p results && eslint . --format html > results/eslint.html", "madge": "madge -c --no-color --no-spinner --exclude __mocks__ --extensions js,ts src/", "pretty": "prettier --write .", + "pretty:check": "prettier --check .", "watch": "webpack --mode development --watch", "clean": "rimraf out", "fresh-clone": "pnpm clean && (rimraf node_modules || true)", @@ -48,9 +52,9 @@ "vscode": "^1.79.0" }, "dependencies": { - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202407051717", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202407232256", "@zowe/zos-ftp-for-zowe-cli": "3.0.0-next.202403191358", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202407051717", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202407232256", "@zowe/zowe-explorer-api": "3.0.0-next-SNAPSHOT", "tmp": "0.2.3" }, diff --git a/packages/zowe-explorer-ftp-extension/src/ZoweExplorerFtpMvsApi.ts b/packages/zowe-explorer-ftp-extension/src/ZoweExplorerFtpMvsApi.ts index c931b71c69..7ae41a5810 100644 --- a/packages/zowe-explorer-ftp-extension/src/ZoweExplorerFtpMvsApi.ts +++ b/packages/zowe-explorer-ftp-extension/src/ZoweExplorerFtpMvsApi.ts @@ -23,8 +23,6 @@ import { ZoweFtpExtensionError } from "./ZoweFtpExtensionError"; /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ -const MAX_MEMBER_NAME_LEN = 8; - export class FtpMvsApi extends AbstractFtpApi implements MainframeInteraction.IMvs { public async dataSet(filter: string, _options?: zosfiles.IListOptions): Promise { const result = this.getDefaultResponse(); diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 2a106b6cc2..10d46414b1 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -41,6 +41,9 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Added support to view the Encoding history for MVS and Dataset in the History View. [#2776](https://github.com/zowe/vscode-extension-for-zowe/issues/2776) - Added error handling for when the default credential manager is unable to initialize. [#2811](https://github.com/zowe/zowe-explorer-vscode/issues/2811) - **Breaking:** Zowe Explorer no longer uses a temporary directory for storing Data Sets and USS files. All settings related to the temporary downloads folder have been removed. In order to access resources stored by Zowe Explorer v3, refer to the [FileSystemProvider documentation](https://github.com/zowe/zowe-explorer-vscode/wiki/FileSystemProvider) for information on how to build and access resource URIs. Extenders can detect changes to resources using the `onResourceChanged` function in the `ZoweExplorerApiRegister` class. [#2951](https://github.com/zowe/zowe-explorer-vscode/issues/2951) +- Implemented the `onVaultUpdate` VSCode events to notify extenders when credentials are updated on the OS vault by other applications. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994) +- Changed default base profile naming scheme in newly generated configuration files to prevent name and property conflicts between Global and Project profiles [#2682](https://github.com/zowe/zowe-explorer-vscode/issues/2682) +- Implemented the `onCredMgrUpdate` VSCode events to notify extenders when the local PC's credential manager has been updated by other applications. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994) ### Bug fixes @@ -60,8 +63,8 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Fixed issue where saving changes to favorited PDS member fails when custom temp folder is set on Windows. [#2880](https://github.com/zowe/zowe-explorer-vscode/issues/2880) - Fixed issue where multiple extensions that contribute profiles to a tree view using the Zowe Explorer API may fail to load. [#2888](https://github.com/zowe/zowe-explorer-vscode/issues/2888) - Fixed regression where `getProviderForNode` returned the wrong tree provider after performing an action on a Zowe tree node, causing some commands to fail silently. [#2967](https://github.com/zowe/zowe-explorer-vscode/issues/2967) -- Update Zowe SDKs to `8.0.0-next.202407051717` for technical currency. [#2918](https://github.com/zowe/zowe-explorer-vscode/issues/2918) - Fixed issue where creating a new team configuration file could cause Zowe Explorer to crash, resulting in all sessions disappearing from trees. [#2906](https://github.com/zowe/zowe-explorer-vscode/issues/2906) +- Update Zowe SDKs to `8.0.0-next.202407232256` for technical currency. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994) ## `3.0.0-next.202404242037` diff --git a/packages/zowe-explorer/__tests__/__common__/testUtils.ts b/packages/zowe-explorer/__tests__/__common__/testUtils.ts index 4f02e9e198..861ff1cbcc 100644 --- a/packages/zowe-explorer/__tests__/__common__/testUtils.ts +++ b/packages/zowe-explorer/__tests__/__common__/testUtils.ts @@ -28,7 +28,7 @@ export interface IJestIt { title?: string; } -function spyOnSubscription(sub: IJestIt) { +function spyOnSubscription(sub: IJestIt): void { sub.mock.forEach((mock) => { if (mock.ret) { mock.spy.mockClear().mockReturnValue(mock.ret); @@ -38,8 +38,8 @@ function spyOnSubscription(sub: IJestIt) { }); } -export function processSubscriptions(subscriptions: IJestIt[], test: ITestContext) { - const getName = (str: string) => { +export function processSubscriptions(subscriptions: IJestIt[], test: ITestContext): void { + const getName = (str: string): string => { return str.indexOf(":") >= 0 ? str.substring(0, str.indexOf(":")) : str; }; subscriptions.forEach((sub) => { diff --git a/packages/zowe-explorer/__tests__/__decorators__/MockMethod.ts b/packages/zowe-explorer/__tests__/__decorators__/MockMethod.ts index 1423557ef9..3594caf2f4 100644 --- a/packages/zowe-explorer/__tests__/__decorators__/MockMethod.ts +++ b/packages/zowe-explorer/__tests__/__decorators__/MockMethod.ts @@ -30,15 +30,16 @@ * // Fails with message * // Expected mock function to have been called two times, but it was called one time */ -export function MockMethod(): (target: any, key: string, descriptor: PropertyDescriptor) => PropertyDescriptor { - return (target: any, key: string, descriptor: PropertyDescriptor) => { - if (descriptor === undefined) { - descriptor = Object.getOwnPropertyDescriptor(target, key); +export function MockMethod(): (target: any, key: string, descriptor: PropertyDescriptor) => PropertyDescriptor | undefined { + return (target: any, key: string, descriptor: PropertyDescriptor | undefined) => { + descriptor ??= Object.getOwnPropertyDescriptor(target, key); + + if (descriptor != null) { + const originalMethod = descriptor.value; + descriptor.value = jest.fn((...args) => { + originalMethod.apply(this, args); + }); } - const originalMethod = descriptor.value; - descriptor.value = jest.fn((...args) => { - originalMethod.apply(this, args); - }); return descriptor; }; } diff --git a/packages/zowe-explorer/__tests__/__integration__/tdd/runTest.ts b/packages/zowe-explorer/__tests__/__integration__/tdd/runTest.ts index 192dd26dfa..f8d9aeec3d 100644 --- a/packages/zowe-explorer/__tests__/__integration__/tdd/runTest.ts +++ b/packages/zowe-explorer/__tests__/__integration__/tdd/runTest.ts @@ -13,7 +13,7 @@ import * as path from "path"; import { runTests } from "@vscode/test-electron"; -async function main() { +async function main(): Promise { try { // The folder containing the Extension Manifest package.json // Passed to `--extensionDevelopmentPath` diff --git a/packages/zowe-explorer/__tests__/__mocks__/@zowe/imperative.ts b/packages/zowe-explorer/__tests__/__mocks__/@zowe/imperative.ts index fcf654c82a..d321cfa569 100644 --- a/packages/zowe-explorer/__tests__/__mocks__/@zowe/imperative.ts +++ b/packages/zowe-explorer/__tests__/__mocks__/@zowe/imperative.ts @@ -269,7 +269,9 @@ export class ProfileInfo { ): any { return; } +} +export class ConfigUtils { public static getZoweDir(): string { const defaultHome = path.join(os.homedir(), ".zowe"); if (ImperativeConfig.instance.loadedConfig?.defaultHome !== defaultHome) { @@ -282,7 +284,6 @@ export class ProfileInfo { return ImperativeConfig.instance.cliHome; } } - export class ImperativeError extends Error { private msg: string; constructor(public mDetails: IImperativeError) { @@ -367,7 +368,7 @@ export class ConfigBuilder { }, secure: [], }, - base: { + global_base: { type: "base", properties: { host: "sample.com", @@ -378,7 +379,7 @@ export class ConfigBuilder { }, defaults: { zosmf: "zosmf", - base: "base", + base: "global_base", }, autoStore: true, }; @@ -428,3 +429,19 @@ export class ConvertV1Profiles { }; } } + +export class ZoweUserEvents { + public static readonly ON_VAULT_CHANGED = "onVaultChanged"; +} +export class ZoweSharedEvents { + public static readonly ON_CREDENTIAL_MANAGER_CHANGED = "onCredentialManagerChanged"; +} + +export class EventOperator { + public static getWatcher() { + return { + subscribeUser: () => ({ close: () => {} }), + subscribeShared: () => ({ close: () => {} }), + }; + } +} diff --git a/packages/zowe-explorer/__tests__/__mocks__/DatasetTree.ts b/packages/zowe-explorer/__tests__/__mocks__/DatasetTree.ts index 2402b8948a..4a08b81d64 100644 --- a/packages/zowe-explorer/__tests__/__mocks__/DatasetTree.ts +++ b/packages/zowe-explorer/__tests__/__mocks__/DatasetTree.ts @@ -10,7 +10,7 @@ */ import * as vscode from "vscode"; -import { ZoweDatasetNode } from "../../src/trees/dataset"; +import { ZoweDatasetNode } from "../../src/trees/dataset/ZoweDatasetNode"; import { MockMethod } from "../__decorators__/MockMethod"; /** @@ -36,7 +36,7 @@ export class DatasetTree implements vscode.TreeDataProvider { */ @MockMethod() public getTreeItem(_element: ZoweDatasetNode): vscode.TreeItem { - return null; + return null as any; } /** @@ -49,7 +49,7 @@ export class DatasetTree implements vscode.TreeDataProvider { @MockMethod() public getChildren(_element?: ZoweDatasetNode): Promise { return new Promise((resolve) => { - return resolve(null); + return resolve([]); }); } @@ -60,7 +60,7 @@ export class DatasetTree implements vscode.TreeDataProvider { */ @MockMethod() public refresh(): void { - return null; + return; } /** diff --git a/packages/zowe-explorer/__tests__/__mocks__/USSTree.ts b/packages/zowe-explorer/__tests__/__mocks__/USSTree.ts index 2c88917ee0..96aab92912 100644 --- a/packages/zowe-explorer/__tests__/__mocks__/USSTree.ts +++ b/packages/zowe-explorer/__tests__/__mocks__/USSTree.ts @@ -11,10 +11,10 @@ import * as vscode from "vscode"; import { IZoweUSSTreeNode, IZoweDatasetTreeNode, IZoweTreeNode } from "@zowe/zowe-explorer-api"; -import { ZoweUSSNode } from "../../src/trees/uss"; +import { ZoweUSSNode } from "../../src/trees/uss/ZoweUSSNode"; import { MockMethod } from "../__decorators__/MockMethod"; import { createTreeView } from "./mockCreators/shared"; -import { ZoweTreeProvider } from "../../src/providers"; +import { ZoweTreeProvider } from "../../src/trees/ZoweTreeProvider"; /** * A tree that contains nodes of files and folders @@ -59,7 +59,7 @@ export class USSTree implements vscode.TreeDataProvider { */ @MockMethod() public getAllLoadedItems(): IZoweUSSTreeNode[] { - return null; + return []; } /** @@ -120,7 +120,7 @@ export class USSTree implements vscode.TreeDataProvider { */ @MockMethod() public getFileHistory(): string[] { - return null; + return []; } /** @@ -132,7 +132,7 @@ export class USSTree implements vscode.TreeDataProvider { */ @MockMethod() public getTreeItem(_element: ZoweUSSNode): vscode.TreeItem { - return null; + return null as any; } /** @@ -145,7 +145,7 @@ export class USSTree implements vscode.TreeDataProvider { @MockMethod() public getChildren(_element?: ZoweUSSNode): Promise { return new Promise((resolve) => { - return resolve(null); + return resolve([]); }); } @@ -156,7 +156,7 @@ export class USSTree implements vscode.TreeDataProvider { */ @MockMethod() public refresh(): void { - return null; + return; } /** diff --git a/packages/zowe-explorer/__tests__/__mocks__/mockCreators/shared.ts b/packages/zowe-explorer/__tests__/__mocks__/mockCreators/shared.ts index 559b267222..33a1edf3b1 100644 --- a/packages/zowe-explorer/__tests__/__mocks__/mockCreators/shared.ts +++ b/packages/zowe-explorer/__tests__/__mocks__/mockCreators/shared.ts @@ -19,13 +19,14 @@ import { FilterDescriptor } from "../../../src/management/FilterManagement"; import { ZoweTreeProvider } from "../../../src/providers/ZoweTreeProvider"; import { ZoweDatasetNode } from "../../../src/trees/dataset/ZoweDatasetNode"; import { ZoweUSSNode } from "../../../src/trees/uss/ZoweUSSNode"; +import { Definitions } from "../../../src/configuration/Definitions"; const MOCK_PROFILES = []; -export function createPersistentConfig() { +export function createPersistentConfig(): Partial & Partial { return { persistence: true, - get: () => { + get: (): Partial => { return { sessions: ["sestest", "profile1", "profile2"], favorites: ["[sestest]: TEST.PDS", "[profile1]: /u/myuser.txt{textFile}", "[profile2]: /u/myuser"], @@ -33,11 +34,11 @@ export function createPersistentConfig() { }, update: jest.fn(() => { return {}; - }), + }) as any, }; } -export function createUnsecureTeamConfigMock() { +export function createUnsecureTeamConfigMock(): imperative.IConfig { return { $schema: "./zowe.schema.json", profiles: { @@ -79,7 +80,7 @@ export function createUnsecureTeamConfigMock() { }; } -export function createTeamConfigMock() { +export function createTeamConfigMock(): imperative.IConfig { return { $schema: "./zowe.schema.json", profiles: { @@ -125,7 +126,7 @@ export function createTeamConfigMock() { }; } -export function createISession() { +export function createISession(): imperative.Session { return new imperative.Session({ user: "fake", password: "fake", @@ -136,7 +137,7 @@ export function createISession() { }); } -export function createISessionWithoutCredentials() { +export function createISessionWithoutCredentials(): imperative.Session { return new imperative.Session({ user: "", password: "", @@ -527,6 +528,7 @@ export function createConfigLoad() { api: { layers: { merge: jest.fn(), + activate: jest.fn(), }, }, layers: [ diff --git a/packages/zowe-explorer/__tests__/__pageobjects__/QuickPick.ts b/packages/zowe-explorer/__tests__/__pageobjects__/QuickPick.ts index f74240234d..73a946b12a 100644 --- a/packages/zowe-explorer/__tests__/__pageobjects__/QuickPick.ts +++ b/packages/zowe-explorer/__tests__/__pageobjects__/QuickPick.ts @@ -20,7 +20,7 @@ class QuickPick { this.selector = ".quick-input-widget"; } - private async findElement() { + private async findElement(): Promise { this.elem = await $(this.selector); } diff --git a/packages/zowe-explorer/__tests__/__unit__/configuration/Profiles.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/configuration/Profiles.unit.test.ts index 9641ab02a1..b8a6f39080 100644 --- a/packages/zowe-explorer/__tests__/__unit__/configuration/Profiles.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/configuration/Profiles.unit.test.ts @@ -50,7 +50,7 @@ jest.mock("fs"); jest.mock("fs-extra"); jest.mock("../../../src/tools/ZoweLogger"); -function createGlobalMocks() { +function createGlobalMocks(): { [key: string]: any } { const newMocks = { log: imperative.Logger.getAppLogger(), mockShowInputBox: jest.fn(), @@ -234,6 +234,7 @@ describe("Profiles Unit Test - Function createInstance", () => { it("should create instance when there is no workspace", async () => { mockWorkspaceFolders.mockClear().mockReturnValue(undefined); + /* eslint-disable-next-line @typescript-eslint/no-var-requires */ const { Profiles: testProfiles } = require("../../../src/configuration/Profiles"); jest.spyOn(testProfiles.prototype, "refresh").mockResolvedValueOnce(undefined); const profilesInstance = await testProfiles.createInstance(undefined); @@ -244,6 +245,7 @@ describe("Profiles Unit Test - Function createInstance", () => { it("should create instance when there is empty workspace", async () => { mockWorkspaceFolders.mockClear().mockReturnValue([undefined]); + /* eslint-disable-next-line @typescript-eslint/no-var-requires */ const { Profiles: testProfiles } = require("../../../src/configuration/Profiles"); jest.spyOn(testProfiles.prototype, "refresh").mockResolvedValueOnce(undefined); const profilesInstance = await testProfiles.createInstance(undefined); @@ -258,6 +260,7 @@ describe("Profiles Unit Test - Function createInstance", () => { }, ]); + /* eslint-disable-next-line @typescript-eslint/no-var-requires */ const { Profiles: testProfiles } = require("../../../src/configuration/Profiles"); jest.spyOn(testProfiles.prototype, "refresh").mockResolvedValueOnce(undefined); const profilesInstance = await testProfiles.createInstance(undefined); @@ -282,8 +285,8 @@ describe("Profiles Unit Tests - Function createZoweSession", () => { return newMocks; } it("Tests that createZoweSession presents correct message when escaping selection of quickpick", async () => { - const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); const spy = jest.spyOn(Gui, "createQuickPick"); jest.spyOn(Gui, "resolveQuickPick").mockResolvedValueOnce(undefined); await Profiles.getInstance().createZoweSession(blockMocks.testDatasetTree); @@ -294,7 +297,7 @@ describe("Profiles Unit Tests - Function createZoweSession", () => { }); it("Tests that createZoweSession runs successfully", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const spyConfig = jest.spyOn(Profiles.getInstance(), "openConfigFile"); jest.spyOn(Gui, "createQuickPick").mockReturnValue({ show: jest.fn(), @@ -311,7 +314,7 @@ describe("Profiles Unit Tests - Function createZoweSession", () => { }); it("Tests that createZoweSession catches error and log warning", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); jest.spyOn(Gui, "createQuickPick").mockReturnValue({ show: jest.fn(), hide: jest.fn(), @@ -327,7 +330,7 @@ describe("Profiles Unit Tests - Function createZoweSession", () => { describe("Profiles Unit Tests - Function editZoweConfigFile", () => { it("Tests that editZoweConfigFile presents correct message when escaping selection of quickpick", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const spy = jest.spyOn(Gui, "showQuickPick"); spy.mockResolvedValueOnce(undefined); @@ -337,7 +340,7 @@ describe("Profiles Unit Tests - Function editZoweConfigFile", () => { spy.mockClear(); }); it("Tests that editZoweConfigFile opens correct file when Global is selected", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const spyQuickPick = jest.spyOn(Gui, "showQuickPick"); spyQuickPick.mockResolvedValueOnce("Global: in the Zowe home directory" as any); @@ -349,7 +352,7 @@ describe("Profiles Unit Tests - Function editZoweConfigFile", () => { spyOpenFile.mockClear(); }); it("Tests that editZoweConfigFile opens correct file when only Global config available", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); globalMocks.mockConfigLoad.load.mockResolvedValueOnce({ layers: [ { @@ -367,7 +370,7 @@ describe("Profiles Unit Tests - Function editZoweConfigFile", () => { spyOpenFile.mockClear(); }); it("Tests that editZoweConfigFile opens correct file when Project is selected", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const spyQuickPick = jest.spyOn(Gui, "showQuickPick"); spyQuickPick.mockResolvedValueOnce("Project: in the current working directory" as any); @@ -379,7 +382,7 @@ describe("Profiles Unit Tests - Function editZoweConfigFile", () => { spyOpenFile.mockClear(); }); it("Tests that editZoweConfigFile opens correct file when only Project config available", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); globalMocks.mockConfigLoad.load.mockResolvedValueOnce({ layers: [ { @@ -411,7 +414,7 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { }; newMocks.testDatasetSessionNode = createDatasetSessionNode(newMocks.session, globalMocks.mockProfileInstance); newMocks.testDatasetTree = createDatasetTree(newMocks.testDatasetSessionNode, newMocks.treeView); - Object.defineProperty(imperative.ProfileInfo, "getZoweDir", { + Object.defineProperty(imperative.ConfigUtils, "getZoweDir", { value: jest.fn().mockReturnValue("file://globalPath/.zowe"), configurable: true, }); @@ -419,12 +422,19 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { get: () => [{ uri: "file://projectPath/zowe.config.user.json", name: "zowe.config.user.json", index: 0 }], configurable: true, }); + // Removes any loaded config + imperative.ImperativeConfig.instance.loadedConfig = undefined as any; return newMocks; } + + afterAll(() => { + jest.restoreAllMocks(); + }); + it("Tests that createZoweSchema presents correct message when escaping selection of config location prompt", async () => { - const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); const spy = jest.spyOn(Gui, "showQuickPick"); spy.mockResolvedValueOnce(undefined); @@ -434,8 +444,8 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { spy.mockClear(); }); it("Tests that createZoweSchema will open correct config file when cancelling creation in location with existing config file", async () => { - const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); const spyQuickPick = jest.spyOn(Gui, "showQuickPick"); globalMocks.mockShowQuickPick.mockResolvedValueOnce("Global: in the Zowe home directory"); @@ -456,8 +466,8 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { spyOpenFile.mockClear(); }); it("Test that createZoweSchema will open config on error if error deals with parsing file", async () => { - const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); const spyQuickPick = jest.spyOn(Gui, "showQuickPick"); globalMocks.mockShowQuickPick.mockResolvedValueOnce("Global: in the Zowe home directory"); @@ -474,8 +484,8 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { spyZoweConfigError.mockClear(); }); it("Test that createZoweSchema will auto create global if VSC not in project and config doesn't exist", async () => { - const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); Object.defineProperty(vscode.workspace, "workspaceFolders", { get: () => undefined, configurable: true, @@ -514,8 +524,8 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { }); it("Tests that createZoweSchema will return the config file path", async () => { - const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); Object.defineProperty(vscode.workspace, "workspaceFolders", { value: undefined, @@ -545,6 +555,63 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { await expect(Profiles.getInstance().createZoweSchema(blockMocks.testDatasetTree)).resolves.toBe(expectedValue); }); + + it("Test that createZoweSchema will create global configuration", async () => { + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); + + const spyQuickPick = jest.spyOn(Gui, "showQuickPick"); + globalMocks.mockShowQuickPick.mockResolvedValueOnce("Global: in the Zowe home directory"); + const spyLayers = jest.spyOn(Profiles.getInstance() as any, "checkExistingConfig").mockReturnValueOnce("zowe"); + const spyConfigBuilder = jest.spyOn(imperative.ConfigBuilder, "build"); + const spyZoweConfigError = jest.spyOn(ZoweExplorerExtender, "showZoweConfigError"); + const spyGuiErrorMessage = jest.spyOn(Gui, "errorMessage").mockResolvedValueOnce("Show config"); + jest.spyOn(SettingsConfig, "getDirectValue").mockReturnValueOnce(undefined); + await Profiles.getInstance().createZoweSchema(blockMocks.testDatasetTree); + + expect(spyQuickPick).toHaveBeenCalledTimes(1); + expect(spyZoweConfigError).not.toHaveBeenCalled(); + expect(spyGuiErrorMessage).not.toHaveBeenCalled(); + expect(spyConfigBuilder).toHaveBeenCalledTimes(1); + expect(spyConfigBuilder.mock.calls[0][1]).toEqual(true); // make sure that global was true + + spyQuickPick.mockClear(); + spyLayers.mockClear(); + spyZoweConfigError.mockClear(); + }); + + it("Test that createZoweSchema will create local configuration", async () => { + const mockWorkspaceFolders = jest.fn(); + const globalMocks = createGlobalMocks(); + const blockMocks = createBlockMocks(globalMocks); + Object.defineProperty(vscode.workspace, "workspaceFolders", { + get: mockWorkspaceFolders.mockReturnValue([ + { + uri: { fsPath: "fakePath" }, + }, + ]), + configurable: true, + }); + + const spyQuickPick = jest.spyOn(Gui, "showQuickPick"); + globalMocks.mockShowQuickPick.mockResolvedValueOnce("Project: in the current working directory"); + const spyLayers = jest.spyOn(Profiles.getInstance() as any, "checkExistingConfig").mockReturnValueOnce("zowe"); + const spyConfigBuilder = jest.spyOn(imperative.ConfigBuilder, "build"); + const spyZoweConfigError = jest.spyOn(ZoweExplorerExtender, "showZoweConfigError"); + const spyGuiErrorMessage = jest.spyOn(Gui, "errorMessage").mockResolvedValueOnce("Show config"); + jest.spyOn(SettingsConfig, "getDirectValue").mockReturnValueOnce(undefined); + await Profiles.getInstance().createZoweSchema(blockMocks.testDatasetTree); + + expect(spyQuickPick).toHaveBeenCalledTimes(1); + expect(spyZoweConfigError).not.toHaveBeenCalled(); + expect(spyGuiErrorMessage).not.toHaveBeenCalled(); + expect(spyConfigBuilder).toHaveBeenCalledTimes(1); + expect(spyConfigBuilder.mock.calls[0][1]).toEqual(false); // make sure that global was false + + spyQuickPick.mockClear(); + spyLayers.mockClear(); + spyZoweConfigError.mockClear(); + }); }); describe("Profiles Unit Tests - function getProfileIcon", () => { @@ -771,7 +838,7 @@ describe("Profiles Unit Tests - function validateProfile", () => { describe("Profiles Unit Tests - function deleteProfile", () => { it("should delete profile", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const datasetSessionNode = createDatasetSessionNode(globalMocks.testSession, globalMocks.testProfile); const datasetTree = createDatasetTree(datasetSessionNode, globalMocks.testProfile); @@ -875,7 +942,7 @@ describe("Profiles Unit Tests - function checkCurrentProfile", () => { }; it("should show as active in status of profile", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); environmentSetup(globalMocks); setupProfilesCheck(globalMocks); jest.spyOn(Profiles.getInstance(), "validateProfiles").mockReturnValue({ status: "active", name: "sestest" } as any); @@ -883,19 +950,19 @@ describe("Profiles Unit Tests - function checkCurrentProfile", () => { await expect(Profiles.getInstance().checkCurrentProfile(globalMocks.testProfile)).resolves.toEqual({ name: "sestest", status: "active" }); }); it("should show as unverified in status of profile", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); environmentSetup(globalMocks); setupProfilesCheck(globalMocks); jest.spyOn(Profiles.getInstance(), "promptCredentials").mockResolvedValue(undefined as any); await expect(Profiles.getInstance().checkCurrentProfile(globalMocks.testProfile)).resolves.toEqual({ name: "sestest", status: "unverified" }); }); it("should show as inactive in status of profile", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); setupProfilesCheck(globalMocks); await expect(Profiles.getInstance().checkCurrentProfile(globalMocks.testProfile)).resolves.toEqual({ name: "sestest", status: "inactive" }); }); it("should throw an error if using token auth and is logged out or has expired token", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); jest.spyOn(AuthUtils, "errorHandling").mockImplementation(); jest.spyOn(AuthUtils, "isUsingTokenAuth").mockResolvedValue(true); setupProfilesCheck(globalMocks); @@ -905,7 +972,7 @@ describe("Profiles Unit Tests - function checkCurrentProfile", () => { describe("Profiles Unit Tests - function getProfileSetting", () => { it("should retrive the profile with a status of unverified", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); Object.defineProperty(Profiles.getInstance(), "profilesValidationSetting", { value: [ { @@ -948,7 +1015,7 @@ describe("Profiles Unit Tests - function getProfileSetting", () => { describe("Profiles Unit Tests - function disableValidationContext", () => { it("should disable validation context and return updated node", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const testNode = new (ZoweTreeNode as any)( "test", vscode.TreeItemCollapsibleState.None, @@ -971,7 +1038,7 @@ describe("Profiles Unit Tests - function disableValidationContext", () => { describe("Profiles Unit Tests - function enableValidationContext", () => { it("should enable validation context and return updated node", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const testNode = new (ZoweTreeNode as any)( "test", vscode.TreeItemCollapsibleState.None, @@ -994,8 +1061,8 @@ describe("Profiles Unit Tests - function enableValidationContext", () => { describe("Profiles Unit Tests - function ssoLogin", () => { let testNode; let globalMocks; - beforeEach(async () => { - globalMocks = await createGlobalMocks(); + beforeEach(() => { + globalMocks = createGlobalMocks(); testNode = new (ZoweTreeNode as any)( "fake", vscode.TreeItemCollapsibleState.None, @@ -1060,8 +1127,8 @@ describe("Profiles Unit Tests - function ssoLogin", () => { describe("Profiles Unit Tests - function ssoLogout", () => { let testNode; let globalMocks; - beforeEach(async () => { - globalMocks = await createGlobalMocks(); + beforeEach(() => { + globalMocks = createGlobalMocks(); testNode = new (ZoweTreeNode as any)( "fake", vscode.TreeItemCollapsibleState.None, @@ -1109,7 +1176,7 @@ describe("Profiles Unit Tests - function ssoLogout", () => { describe("Profiles Unit Tests - function updateBaseProfileFileLogin", () => { it("should update the property of mProfileInfo", async () => { const privateProfile = Profiles.getInstance() as any; - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const updatePropertyMock = jest.fn(); jest.spyOn(privateProfile, "getProfileInfo").mockReturnValue({ isSecured: () => true, @@ -1123,7 +1190,7 @@ describe("Profiles Unit Tests - function updateBaseProfileFileLogin", () => { describe("Profiles Unit Tests - function updateBaseProfileFileLogout", () => { it("should update the property of mProfileInfo", async () => { const privateProfile = Profiles.getInstance() as any; - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const updateKnownPropertyMock = jest.fn(); jest.spyOn(privateProfile, "getProfileInfo").mockReturnValue({ isSecured: () => true, @@ -1141,8 +1208,8 @@ describe("Profiles Unit Tests - function updateBaseProfileFileLogout", () => { }); describe("Profiles Unit Tests - function createNonSecureProfile", () => { - it("should create an unsecured profile by removing secure arrays and setting autoStore to false", async () => { - const globalMocks = await createGlobalMocks(); + it("should create an unsecured profile by removing secure arrays and setting autoStore to false", () => { + const globalMocks = createGlobalMocks(); const changingConfig = globalMocks.testTeamConfigProfile; const privateProfile = Profiles.getInstance() as any; Object.defineProperty(SettingsConfig, "getDirectValue", { @@ -1155,8 +1222,8 @@ describe("Profiles Unit Tests - function createNonSecureProfile", () => { }); describe("Profiles Unit Tests - function validationArraySetup", () => { - it("should setup the validation array", async () => { - const globalMocks = await createGlobalMocks(); + it("should setup the validation array", () => { + const globalMocks = createGlobalMocks(); Object.defineProperty(Profiles.getInstance(), "profilesValidationSetting", { value: [ { @@ -1212,7 +1279,7 @@ describe("Profiles Unit Tests - function getSecurePropsForProfile", () => { jest.resetAllMocks(); }); it("should retrieve the secure properties of a profile", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); jest.spyOn(Profiles.getInstance(), "getProfileInfo").mockResolvedValue({ mergeArgsForProfile: () => ({ knownArgs: [ @@ -1236,8 +1303,8 @@ describe("Profiles Unit Tests - function clearFilterFromAllTrees", () => { jest.restoreAllMocks(); }); - it("should fail to clear filter if no session nodes are available", async () => { - const globalMocks = await createGlobalMocks(); + it("should fail to clear filter if no session nodes are available", () => { + const globalMocks = createGlobalMocks(); const testNode = new (ZoweTreeNode as any)( "fake", vscode.TreeItemCollapsibleState.None, @@ -1263,8 +1330,8 @@ describe("Profiles Unit Tests - function clearFilterFromAllTrees", () => { expect(refreshElementSpy).toHaveBeenCalledTimes(0); }); - it("should fail to clear filters if the session node is not listed in the tree", async () => { - const globalMocks = await createGlobalMocks(); + it("should fail to clear filters if the session node is not listed in the tree", () => { + const globalMocks = createGlobalMocks(); const testNode = new (ZoweTreeNode as any)( "fake", vscode.TreeItemCollapsibleState.None, @@ -1300,16 +1367,16 @@ describe("Profiles Unit Tests - function disableValidation", () => { jest.resetAllMocks(); }); - it("should disable validation for the profile on all trees", async () => { - const globalMocks = await createGlobalMocks(); + it("should disable validation for the profile on all trees", () => { + const globalMocks = createGlobalMocks(); jest.spyOn(SharedTreeProviders, "getSessionForAllTrees").mockReturnValue([globalMocks.testNode]); expect(globalMocks.testNode.contextValue).toEqual(Constants.DS_SESSION_CONTEXT); expect(Profiles.getInstance().disableValidation(globalMocks.testNode)).toEqual(globalMocks.testNode); expect(globalMocks.testNode.contextValue).toEqual(Constants.DS_SESSION_CONTEXT + Constants.VALIDATE_SUFFIX); }); - it("should disable validation for the profile on the current tree", async () => { - const globalMocks = await createGlobalMocks(); + it("should disable validation for the profile on the current tree", () => { + const globalMocks = createGlobalMocks(); jest.spyOn(SharedTreeProviders, "getSessionForAllTrees").mockReturnValue([globalMocks.testNode]); const disableValidationContextSpy = jest.spyOn(Profiles.getInstance(), "disableValidationContext"); expect(globalMocks.testNode.contextValue).toEqual(Constants.DS_SESSION_CONTEXT); @@ -1326,8 +1393,8 @@ describe("Profiles Unit Tests - function enableValidation", () => { jest.resetAllMocks(); }); - it("should enable validation for the profile on all trees", async () => { - const globalMocks = await createGlobalMocks(); + it("should enable validation for the profile on all trees", () => { + const globalMocks = createGlobalMocks(); jest.spyOn(SharedTreeProviders, "getSessionForAllTrees").mockReturnValue([ createMockNode("test2", Constants.DS_SESSION_CONTEXT), globalMocks.testNode, @@ -1337,8 +1404,8 @@ describe("Profiles Unit Tests - function enableValidation", () => { expect(globalMocks.testNode.contextValue).toEqual(Constants.DS_SESSION_CONTEXT + Constants.VALIDATE_SUFFIX); }); - it("should enable validation for the profile on the current tree", async () => { - const globalMocks = await createGlobalMocks(); + it("should enable validation for the profile on the current tree", () => { + const globalMocks = createGlobalMocks(); const enableValidationContextSpy = jest.spyOn(Profiles.getInstance(), "enableValidationContext"); jest.spyOn(SharedTreeProviders, "getSessionForAllTrees").mockReturnValue([globalMocks.testNode]); expect(globalMocks.testNode.contextValue).toEqual(Constants.DS_SESSION_CONTEXT); diff --git a/packages/zowe-explorer/__tests__/__unit__/configuration/SettingsConfig.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/configuration/SettingsConfig.unit.test.ts index 2b9e7fb71b..05a14e195d 100644 --- a/packages/zowe-explorer/__tests__/__unit__/configuration/SettingsConfig.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/configuration/SettingsConfig.unit.test.ts @@ -14,7 +14,6 @@ import { Gui } from "@zowe/zowe-explorer-api"; import { ZoweLogger } from "../../../src/tools/ZoweLogger"; import { ZoweLocalStorage } from "../../../src/tools/ZoweLocalStorage"; import { SettingsConfig } from "../../../src/configuration/SettingsConfig"; -import { Constants } from "../../../src/configuration/Constants"; describe("SettingsConfig Unit Tests", () => { beforeEach(() => { diff --git a/packages/zowe-explorer/__tests__/__unit__/configuration/Workspace.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/configuration/Workspace.unit.test.ts index 2df1e798d1..b61afbf5fb 100644 --- a/packages/zowe-explorer/__tests__/__unit__/configuration/Workspace.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/configuration/Workspace.unit.test.ts @@ -13,7 +13,7 @@ import * as vscode from "vscode"; import { Constants } from "../../../src/configuration/Constants"; import { Workspace } from "../../../src/configuration/Workspace"; -function createGlobalMocks() { +function createGlobalMocks(): { [key: string]: jest.Mock } { const activeTextEditor = jest.fn(); const executeCommand = jest.fn(); @@ -29,7 +29,7 @@ function createGlobalMocks() { /** * Function which imitates looping through an array */ -const generateCycledMock = (mock: any[]) => { +const generateCycledMock = (mock: any[]): (() => number) => { let currentIndex = 0; return () => { diff --git a/packages/zowe-explorer/__tests__/__unit__/extending/ZoweExplorerApiRegister.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/extending/ZoweExplorerApiRegister.unit.test.ts index fed30f9857..a4b1e1b7df 100644 --- a/packages/zowe-explorer/__tests__/__unit__/extending/ZoweExplorerApiRegister.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/extending/ZoweExplorerApiRegister.unit.test.ts @@ -23,128 +23,67 @@ class MockUssApi1 implements MainframeInteraction.IUss { public getProfileTypeName(): string { return "api1typename"; } - public fileList(ussFilePath: string): Promise { + public fileList(_ussFilePath: string): Promise { throw new Error("Method not implemented."); } - public copy(outputPath: string, options?: Omit): Promise { + public copy(_outputPath: string, _options?: Omit): Promise { throw new Error("Method not implemented."); } - public isFileTagBinOrAscii(ussFilePath: string): Promise { + public isFileTagBinOrAscii(_ussFilePath: string): Promise { throw new Error("Method not implemented."); } - public getContents(ussFilePath: string, options: zosfiles.IDownloadOptions): Promise { + public getContents(_ussFilePath: string, _options: zosfiles.IDownloadOptions): Promise { throw new Error("Method not implemented."); } public putContents( - inputFilePath: string, - ussFilePath: string, - binary?: boolean, - localEncoding?: string, - etag?: string, - returnEtag?: boolean + _inputFilePath: string, + _ussFilePath: string, + _binary?: boolean, + _localEncoding?: string, + _etag?: string, + _returnEtag?: boolean ): Promise { throw new Error("Method not implemented."); } - public putContent(inputFilePath: string, ussFilePath: string, options: zosfiles.IUploadOptions): Promise { + public putContent(_inputFilePath: string, _ussFilePath: string, _options: zosfiles.IUploadOptions): Promise { throw new Error("Method not implemented."); } public uploadDirectory( - inputDirectoryPath: string, - ussDirectoryPath: string, - options: zosfiles.IUploadOptions + _inputDirectoryPath: string, + _ussDirectoryPath: string, + _options: zosfiles.IUploadOptions ): Promise { throw new Error("Method not implemented."); } - public create(ussPath: string, type: string, mode?: string): Promise { + public create(_ussPath: string, _type: string, _mode?: string): Promise { throw new Error("Method not implemented."); } - public delete(ussPath: string, recursive?: boolean): Promise { + public delete(_ussPath: string, _recursive?: boolean): Promise { throw new Error("Method not implemented."); } - public rename(currentUssPath: string, newUssPath: string): Promise { + public rename(_currentUssPath: string, _newUssPath: string): Promise { throw new Error("Method not implemented."); } - public getSession(profile?: imperative.IProfileLoaded): imperative.Session { + public getSession(_profile?: imperative.IProfileLoaded): imperative.Session { throw new Error("Method not implemented."); } - public getStatus?(profile?: imperative.IProfileLoaded): Promise { + public getStatus?(_profile?: imperative.IProfileLoaded): Promise { throw new Error("Method not implemented."); } public getTokenTypeName?(): string { throw new Error("Method not implemented."); } - public login?(session: imperative.Session): Promise { + public login?(_session: imperative.Session): Promise { throw new Error("Method not implemented."); } - public logout?(session: imperative.Session): Promise { + public logout?(_session: imperative.Session): Promise { throw new Error("Method not implemented."); } } -class MockUssApi2 implements MainframeInteraction.IUss { - public profile?: imperative.IProfileLoaded; - public getProfileTypeName(): string { - return "api2typename"; - } - public fileList(ussFilePath: string): Promise { - throw new Error("Method not implemented."); - } - public copy(outputPath: string, options?: Omit): Promise { - throw new Error("Method not implemented."); - } - public isFileTagBinOrAscii(ussFilePath: string): Promise { - throw new Error("Method not implemented."); - } - public getContents(ussFilePath: string, options: zosfiles.IDownloadOptions): Promise { - throw new Error("Method not implemented."); - } - public putContents( - inputFilePath: string, - ussFilePath: string, - binary?: boolean, - localEncoding?: string, - etag?: string, - returnEtag?: boolean - ): Promise { - throw new Error("Method not implemented."); - } - public putContent(inputFilePath: string, ussFilePath: string, options: zosfiles.IUploadOptions): Promise { - throw new Error("Method not implemented."); - } - public uploadDirectory( - inputDirectoryPath: string, - ussDirectoryPath: string, - options: zosfiles.IUploadOptions - ): Promise { - throw new Error("Method not implemented."); - } - public create(ussPath: string, type: string, mode?: string): Promise { - throw new Error("Method not implemented."); - } - public delete(ussPath: string, recursive?: boolean): Promise { - throw new Error("Method not implemented."); - } - public rename(currentUssPath: string, newUssPath: string): Promise { - throw new Error("Method not implemented."); - } - public getSession(profile?: imperative.IProfileLoaded): imperative.Session { - throw new Error("Method not implemented."); - } - public getStatus?(profile?: imperative.IProfileLoaded): Promise { - throw new Error("Method not implemented."); - } - public getTokenTypeName?(): string { - throw new Error("Method not implemented."); - } - public login?(session: imperative.Session): Promise { - throw new Error("Method not implemented."); - } - public logout?(session: imperative.Session): Promise { - throw new Error("Method not implemented."); - } -} +class MockUssApi2 extends MockUssApi1 {} -async function createGlobalMocks() { +function createGlobalMocks() { const newMocks = { registry: ZoweExplorerApiRegister.getInstance(), testProfile: createValidIProfile(), @@ -173,8 +112,8 @@ afterEach(() => { }); describe("ZoweExplorerApiRegister unit testing", () => { - it("registers an API only once per profile type", async () => { - const globalMocks = await createGlobalMocks(); + it("registers an API only once per profile type", () => { + const globalMocks = createGlobalMocks(); const defaultProfile = globalMocks.profiles.getDefaultProfile(); const defaultUssApi = globalMocks.registry.getUssApi(defaultProfile); @@ -194,9 +133,9 @@ describe("ZoweExplorerApiRegister unit testing", () => { }); it("registers multiple API instances in parallel", async () => { - const globalMocks = await createGlobalMocks(); - const mockRefresh = jest.fn(async (): Promise => { - return; + const globalMocks = createGlobalMocks(); + const mockRefresh = jest.fn((): Promise => { + return new Promise((resolve) => resolve()); }); const profilesForValidation = { status: "active", name: "fake" }; Object.defineProperty(ZoweExplorerExtender.prototype, "getProfilesCache", { @@ -222,8 +161,8 @@ describe("ZoweExplorerApiRegister unit testing", () => { expect(mockRefresh.mock.calls.length).toBe(2); }); - it("throws errors when registering invalid APIs", async () => { - const globalMocks = await createGlobalMocks(); + it("throws errors when registering invalid APIs", () => { + const globalMocks = createGlobalMocks(); const api1 = new MockUssApi1(); const mockGetProfileTypeName = jest.fn(() => undefined); api1.getProfileTypeName = mockGetProfileTypeName; @@ -253,8 +192,8 @@ describe("ZoweExplorerApiRegister unit testing", () => { }).toThrow(); }); - it("throws errors when invalid APIs requested", async () => { - const globalMocks = await createGlobalMocks(); + it("throws errors when invalid APIs requested", () => { + const globalMocks = createGlobalMocks(); const invalidProfile = { type: "invalid_profile_type", } as imperative.IProfileLoaded; @@ -281,8 +220,8 @@ describe("ZoweExplorerApiRegister unit testing", () => { expect(explorerExtenderApiSpy).toHaveBeenCalled(); }); - it("provides access to the common api for a profile registered to any api regsitry", async () => { - const globalMocks = await createGlobalMocks(); + it("provides access to the common api for a profile registered to any api regsitry", () => { + const globalMocks = createGlobalMocks(); const defaultProfile = globalMocks.profiles.getDefaultProfile(); const ussApi = ZoweExplorerApiRegister.getUssApi(defaultProfile); const profileUnused: imperative.IProfileLoaded = { @@ -309,7 +248,30 @@ describe("ZoweExplorerApiRegister unit testing", () => { configurable: true, }); expect(ZoweExplorerApiRegister.getInstance().onProfilesUpdate).toEqual({}); - ZoweExplorerApiRegister.getInstance()["onProfilesUpdateCallback"] = undefined; + }); + + it("provides access to the onVaultUpdate callback defined by the extender if available", () => { + Object.defineProperty(ZoweExplorerApiRegister.getInstance().onVaultUpdateEmitter, "event", { + value: {}, + configurable: true, + }); + expect(ZoweExplorerApiRegister.getInstance().onVaultUpdate).toEqual({}); + }); + + it("provides access to the onCredMgrUpdate callback defined by the extender if available", () => { + Object.defineProperty(ZoweExplorerApiRegister.getInstance().onCredMgrUpdateEmitter, "event", { + value: {}, + configurable: true, + }); + expect(ZoweExplorerApiRegister.getInstance().onCredMgrUpdate).toEqual({}); + }); + + it("provides access to the callback defined by the extender if available", () => { + Object.defineProperty(ZoweExplorerApiRegister.getInstance().onProfilesUpdateEmitter, "event", { + value: {}, + configurable: true, + }); + expect(ZoweExplorerApiRegister.getInstance().onProfilesUpdate).toEqual({}); }); it("provides access to the appropriate event for onResourceChanged", () => { diff --git a/packages/zowe-explorer/__tests__/__unit__/extending/ZoweExplorerZosmfApi.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/extending/ZoweExplorerZosmfApi.unit.test.ts index 5788a1a219..f206d99696 100644 --- a/packages/zowe-explorer/__tests__/__unit__/extending/ZoweExplorerZosmfApi.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/extending/ZoweExplorerZosmfApi.unit.test.ts @@ -21,7 +21,7 @@ export declare enum TaskStage { describe("Zosmf API tests", () => { it("should test that copy data set uses default options", async () => { - const dataSet = jest.fn(async (session, toDataSet, options) => { + const dataSet = jest.fn((_session, _toDataSet, options) => { expect(options).toMatchSnapshot(); return { api: "", commandResponse: "", success: true }; }); @@ -34,7 +34,7 @@ describe("Zosmf API tests", () => { }); it("should test that copy data set uses enq", async () => { - const dataSet = jest.fn(async (session, toDataSet, options) => { + const dataSet = jest.fn((_session, _toDataSet, options) => { expect(options).toMatchSnapshot(); return { api: "", commandResponse: "", success: true }; }); @@ -51,7 +51,7 @@ describe("Zosmf API tests", () => { }); it("should test that copy data set uses enq only", async () => { - const dataSet = jest.fn(async (session, toDataSet, options) => { + const dataSet = jest.fn((_session, _toDataSet, options) => { expect(options).toMatchSnapshot(); return { api: "", commandResponse: "", success: true }; }); @@ -67,7 +67,7 @@ describe("Zosmf API tests", () => { it("should test putContent method passes all options to Zowe api method", async () => { const fileToUssFile = jest.fn( - async (session: imperative.AbstractSession, inputFile: string, ussname: string, options?: zosfiles.IUploadOptions) => { + (_session: imperative.AbstractSession, _inputFile: string, _ussname: string, options?: zosfiles.IUploadOptions) => { expect(options).toMatchSnapshot(); return { api: "", commandResponse: "", success: true }; } diff --git a/packages/zowe-explorer/__tests__/__unit__/misc/ProfilesCache.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/misc/ProfilesCache.unit.test.ts index 57e1e99cb6..a9d77005ea 100644 --- a/packages/zowe-explorer/__tests__/__unit__/misc/ProfilesCache.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/misc/ProfilesCache.unit.test.ts @@ -15,7 +15,7 @@ jest.mock("fs"); jest.unmock("@zowe/imperative"); describe("ProfilesCache API", () => { - const zoweDir = imperative.ProfileInfo.getZoweDir(); + const zoweDir = imperative.ConfigUtils.getZoweDir(); beforeAll(() => { // Disable loading credential manager in ProfileInfo API diff --git a/packages/zowe-explorer/__tests__/__unit__/tools/ZowePersistentFilters.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/tools/ZowePersistentFilters.unit.test.ts index 2784061bfc..b46746eb0d 100644 --- a/packages/zowe-explorer/__tests__/__unit__/tools/ZowePersistentFilters.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/tools/ZowePersistentFilters.unit.test.ts @@ -9,7 +9,6 @@ * */ -import * as vscode from "vscode"; import { PersistenceSchemaEnum } from "@zowe/zowe-explorer-api"; import { ZoweLocalStorage } from "../../../src/tools/ZoweLocalStorage"; import { ZoweLogger } from "../../../src/tools/ZoweLogger"; diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetActions.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetActions.unit.test.ts index 94e0ceaeb3..e5c77d22f0 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetActions.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetActions.unit.test.ts @@ -240,7 +240,7 @@ describe("Dataset Actions Unit Tests - Function createMember", () => { session: blockMocks.session, }); const nonFavoriteLabel = parent.label; - parent.label = `${parent.label}`; + parent.label = parent.label?.toString(); parent.contextValue = Constants.DS_PDS_CONTEXT + Constants.FAV_SUFFIX; const mySpy = mocked(vscode.window.showInputBox).mockResolvedValue("testMember"); @@ -308,7 +308,7 @@ describe("Dataset Actions Unit Tests - Function refreshPS", () => { expect(mocked(vscode.commands.executeCommand)).not.toHaveBeenCalled(); }); it("Checking failed attempt to refresh PS dataset (not found exception)", async () => { - const globalMocks = createGlobalMocks(); + createGlobalMocks(); const blockMocks = createBlockMocksShared(); const node = new ZoweDatasetNode({ label: "HLQ.TEST.AFILE7", @@ -335,7 +335,7 @@ describe("Dataset Actions Unit Tests - Function refreshPS", () => { blockMocks.fetchDsAtUri.mockRejectedValueOnce(Error("not found")); await DatasetActions.refreshPS(child); - expect(mocked(Gui.showMessage)).toHaveBeenCalledWith(`Unable to find file ${parent.label}(${child.label})`); + expect(mocked(Gui.showMessage)).toHaveBeenCalledWith(`Unable to find file ${parent.label?.toString()}(${child.label?.toString()})`); }); it("Checking favorite empty PDS refresh", async () => { createGlobalMocks(); @@ -441,7 +441,7 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => { mocked(vscode.window.withProgress).mockImplementation((progLocation, callback) => { const progress = { - report: (message) => { + report: (_message) => { return; }, }; @@ -476,7 +476,9 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => { await DatasetActions.deleteDatasetPrompt(blockMocks.testDatasetTree); - expect(mocked(Gui.showMessage)).toHaveBeenCalledWith(`The following 1 item(s) were deleted: ${blockMocks.testDatasetNode.getLabel()}`); + expect(mocked(Gui.showMessage)).toHaveBeenCalledWith( + `The following 1 item(s) were deleted: ${blockMocks.testDatasetNode.getLabel().toString()}` + ); }); it("Should delete one member", async () => { @@ -492,7 +494,8 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => { await DatasetActions.deleteDatasetPrompt(blockMocks.testDatasetTree); expect(mocked(Gui.showMessage)).toHaveBeenCalledWith( - `The following 1 item(s) were deleted: ${blockMocks.testMemberNode.getParent().getLabel()}(${blockMocks.testMemberNode.getLabel()})` + `The following 1 item(s) were deleted: ` + + `${blockMocks.testMemberNode.getParent().getLabel().toString()}(${blockMocks.testMemberNode.getLabel().toString()})` ); }); @@ -507,7 +510,9 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => { await DatasetActions.deleteDatasetPrompt(blockMocks.testDatasetTree); - expect(mocked(Gui.showMessage)).toHaveBeenCalledWith(`The following 1 item(s) were deleted: ${blockMocks.testVsamNode.getLabel()}`); + expect(mocked(Gui.showMessage)).toHaveBeenCalledWith( + `The following 1 item(s) were deleted: ${blockMocks.testVsamNode.getLabel().toString()}` + ); }); it("Should delete one migrated dataset", async () => { @@ -521,7 +526,9 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => { await DatasetActions.deleteDatasetPrompt(blockMocks.testDatasetTree); - expect(mocked(Gui.showMessage)).toHaveBeenCalledWith(`The following 1 item(s) were deleted: ${blockMocks.testMigrNode.getLabel()}`); + expect(mocked(Gui.showMessage)).toHaveBeenCalledWith( + `The following 1 item(s) were deleted: ${blockMocks.testMigrNode.getLabel().toString()}` + ); }); it("Should delete two datasets", async () => { @@ -536,7 +543,8 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => { await DatasetActions.deleteDatasetPrompt(blockMocks.testDatasetTree); expect(mocked(Gui.showMessage)).toHaveBeenCalledWith( - `The following 2 item(s) were deleted: ${blockMocks.testDatasetNode.getLabel()}, ${blockMocks.testVsamNode.getLabel()}` + `The following 2 item(s) were deleted: ` + + `${blockMocks.testDatasetNode.getLabel().toString()}, ${blockMocks.testVsamNode.getLabel().toString()}` ); }); @@ -551,7 +559,9 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => { await DatasetActions.deleteDatasetPrompt(blockMocks.testDatasetTree); - expect(mocked(Gui.showMessage)).toHaveBeenCalledWith(`The following 1 item(s) were deleted: ${blockMocks.testDatasetNode.getLabel()}`); + expect(mocked(Gui.showMessage)).toHaveBeenCalledWith( + `The following 1 item(s) were deleted: ${blockMocks.testDatasetNode.getLabel().toString()}` + ); }); it("Should delete a favorited data set", async () => { @@ -567,7 +577,7 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => { expect(mocked(Gui.warningMessage)).toHaveBeenCalledWith( `Are you sure you want to delete the following 1 item(s)?\nThis will permanently remove these data sets and/or members from your ` + - `system.\n\n ${blockMocks.testFavoritedNode.getLabel()}`, + `system.\n\n ${blockMocks.testFavoritedNode.getLabel().toString()}`, { items: ["Delete"], vsCodeOpts: { modal: true } } ); }); @@ -585,7 +595,7 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => { expect(mocked(Gui.warningMessage)).toHaveBeenCalledWith( `Are you sure you want to delete the following 1 item(s)?\nThis will permanently remove these data sets and/or members from your ` + - `system.\n\n ${blockMocks.testFavoritedNode.getLabel()}(${blockMocks.testFavMemberNode.getLabel()})`, + `system.\n\n ${blockMocks.testFavoritedNode.getLabel().toString()}(${blockMocks.testFavMemberNode.getLabel().toString()})`, { items: ["Delete"], vsCodeOpts: { modal: true } } ); }); @@ -616,7 +626,8 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => { await DatasetActions.deleteDatasetPrompt(blockMocks.testDatasetTree); expect(mocked(Gui.showMessage)).toHaveBeenCalledWith( - `The following 2 item(s) were deleted: ${blockMocks.testDatasetNode.getLabel()}, ${blockMocks.testFavoritedNode.getLabel()}` + `The following 2 item(s) were deleted: ` + + `${blockMocks.testDatasetNode.getLabel().toString()}, ${blockMocks.testFavoritedNode.getLabel().toString()}` ); }); @@ -642,7 +653,8 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => { await DatasetActions.deleteDatasetPrompt(blockMocks.testDatasetTree, blockMocks.testMemberNode); expect(mocked(Gui.showMessage)).toHaveBeenCalledWith( - `The following 1 item(s) were deleted: ${blockMocks.testMemberNode.getParent().getLabel()}(${blockMocks.testMemberNode.getLabel()})` + `The following 1 item(s) were deleted: ` + + `${blockMocks.testMemberNode.getParent().getLabel().toString()}(${blockMocks.testMemberNode.getLabel().toString()})` ); }); }); @@ -746,7 +758,7 @@ describe("Dataset Actions Unit Tests - Function deleteDataset", () => { mocked(vscode.window.showQuickPick).mockResolvedValueOnce("Delete" as any); jest.spyOn(DatasetFSProvider.instance, "delete").mockRejectedValueOnce(Error("not found")); await expect(DatasetActions.deleteDataset(node, blockMocks.testDatasetTree)).rejects.toThrow("not found"); - expect(mocked(Gui.showMessage)).toHaveBeenCalledWith("Unable to find file " + node.label); + expect(mocked(Gui.showMessage)).toHaveBeenCalledWith("Unable to find file " + node.label?.toString()); }); it("Checking common PS dataset failed deletion attempt", async () => { createGlobalMocks(); @@ -2967,7 +2979,7 @@ describe("Dataset Actions Unit Tests - Function confirmJobSubmission", () => { }); describe("Dataset Actions Unit Tests - Function getDsTypePropertiesFromWorkspaceConfig", () => { - it("Should use use local JCL doc name for confirmJobSubmission", async () => { + it("Should use use local JCL doc name for confirmJobSubmission", () => { createGlobalMocks(); const options = createWorkspaceConfiguration(); // const opt = DatasetActions.getDsTypePropertiesFromWorkspaceConfig(options); diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetInit.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetInit.unit.test.ts index 43a16d0531..16a83c6c81 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetInit.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetInit.unit.test.ts @@ -13,7 +13,6 @@ import * as vscode from "vscode"; import { IJestIt, ITestContext, processSubscriptions } from "../../../__common__/testUtils"; import { ZoweScheme } from "@zowe/zowe-explorer-api"; import { SharedActions } from "../../../../src/trees/shared/SharedActions"; -import { DatasetTree } from "../../../../src/trees/dataset/DatasetTree"; import { SharedContext } from "../../../../src/trees/shared/SharedContext"; import { DatasetActions } from "../../../../src/trees/dataset/DatasetActions"; import { DatasetInit } from "../../../../src/trees/dataset/DatasetInit"; diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetTree.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetTree.unit.test.ts index c69d1b30e3..ea807578a1 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetTree.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetTree.unit.test.ts @@ -31,7 +31,6 @@ import { createDatasetSessionNode, createDatasetTree, createDatasetFavoritesNode import { ProfilesCache, imperative, Gui, Validation } from "@zowe/zowe-explorer-api"; import { Constants } from "../../../../src/configuration/Constants"; import { ZoweLocalStorage } from "../../../../src/tools/ZoweLocalStorage"; -import { join } from "path"; import { Profiles } from "../../../../src/configuration/Profiles"; import { SettingsConfig } from "../../../../src/configuration/SettingsConfig"; import { ZoweExplorerApiRegister } from "../../../../src/extending/ZoweExplorerApiRegister"; @@ -187,7 +186,7 @@ describe("Dataset Tree Unit Tests - Initialisation", () => { }; } - it("Checking definition of the dataset tree", async () => { + it("Checking definition of the dataset tree", () => { createGlobalMocks(); const blockMocks = createBlockMocks(); @@ -214,7 +213,7 @@ describe("Dataset Tree Unit Tests - Function getTreeItem", () => { }; } - it("Checking function with PS Dataset", async () => { + it("Checking function with PS Dataset", () => { createGlobalMocks(); const blockMocks = createBlockMocks(); @@ -618,7 +617,7 @@ describe("Dataset Tree Unit Tests - Function getParent", () => { }; } - it("Checking function on the root node", async () => { + it("Checking function on the root node", () => { createGlobalMocks(); const blockMocks = createBlockMocks(); @@ -630,7 +629,7 @@ describe("Dataset Tree Unit Tests - Function getParent", () => { expect(parentNode).toBeUndefined(); }); - it("Checking function on the non-root node", async () => { + it("Checking function on the non-root node", () => { createGlobalMocks(); const blockMocks = createBlockMocks(); @@ -661,7 +660,7 @@ describe("Dataset Tree Unit Tests - Function getSearchHistory", () => { }; } - it("Checking common run of function", async () => { + it("Checking common run of function", () => { createGlobalMocks(); const blockMocks = createBlockMocks(); @@ -687,7 +686,7 @@ describe("Dataset Tree Unit Tests - Function addFileHistory", () => { }; } - it("Checking common run of function", async () => { + it("Checking common run of function", () => { createGlobalMocks(); const blockMocks = createBlockMocks(); @@ -713,7 +712,7 @@ describe("Dataset Tree Unit Tests - Function removeFileHistory", () => { }; } - it("Checking common run of function", async () => { + it("Checking common run of function", () => { createGlobalMocks(); const blockMocks = createBlockMocks(); @@ -784,7 +783,7 @@ describe("Dataset Tree Unit Tests - Function addSession", () => { expect(testTree.mSessionNodes[1].label).toBe(blockMocks.imperativeProfile.name); }); - it("Checking successful adding of session with disabled validation", async () => { + it("Checking successful adding of session with disabled validation", () => { createGlobalMocks(); const blockMocks = createBlockMocks(); @@ -803,7 +802,7 @@ describe("Dataset Tree Unit Tests - Function addSession", () => { expect(testTree.mSessionNodes[1].label).toBe(blockMocks.imperativeProfile.name); }); - it("Checking successful adding of session without sessname passed", async () => { + it("Checking successful adding of session without sessname passed", () => { createGlobalMocks(); const blockMocks = createBlockMocks(); @@ -969,10 +968,10 @@ describe("Dataset Tree Unit Tests - Function addFavorite", () => { await testTree.addFavorite(node); - expect(testTree.mFavorites[0].label).toBe(`${blockMocks.datasetSessionNode.label}`); - expect(testTree.mFavorites[0].contextValue).toBe(`${Constants.FAV_PROFILE_CONTEXT}`); - expect(testTree.mFavorites[0].children[0].label).toBe(`${node.label}`); - expect(testTree.mFavorites[0].children[0].contextValue).toBe(`${Constants.DS_DS_CONTEXT}${Constants.FAV_SUFFIX}`); + expect(testTree.mFavorites[0].label).toBe(blockMocks.datasetSessionNode.label?.toString()); + expect(testTree.mFavorites[0].contextValue).toBe(Constants.FAV_PROFILE_CONTEXT); + expect(testTree.mFavorites[0].children[0].label).toBe(node.label?.toString()); + expect(testTree.mFavorites[0].children[0].contextValue).toBe(Constants.DS_DS_CONTEXT + Constants.FAV_SUFFIX); }); it("Checking adding of PDS Dataset node", async () => { createGlobalMocks(); @@ -990,10 +989,10 @@ describe("Dataset Tree Unit Tests - Function addFavorite", () => { await testTree.addFavorite(node); - expect(testTree.mFavorites[0].label).toBe(`${blockMocks.datasetSessionNode.label}`); - expect(testTree.mFavorites[0].contextValue).toBe(`${Constants.FAV_PROFILE_CONTEXT}`); - expect(testTree.mFavorites[0].children[0].label).toBe(`${node.label}`); - expect(testTree.mFavorites[0].children[0].contextValue).toBe(`${Constants.DS_PDS_CONTEXT}${Constants.FAV_SUFFIX}`); + expect(testTree.mFavorites[0].label).toBe(blockMocks.datasetSessionNode.label?.toString()); + expect(testTree.mFavorites[0].contextValue).toBe(Constants.FAV_PROFILE_CONTEXT); + expect(testTree.mFavorites[0].children[0].label).toBe(node.label?.toString()); + expect(testTree.mFavorites[0].children[0].contextValue).toBe(Constants.DS_PDS_CONTEXT + Constants.FAV_SUFFIX); }); it("Checking adding of PDS Member node", async () => { createGlobalMocks(); @@ -1013,10 +1012,10 @@ describe("Dataset Tree Unit Tests - Function addFavorite", () => { await testTree.addFavorite(child); - expect(testTree.mFavorites[0].label).toBe(`${blockMocks.datasetSessionNode.label}`); - expect(testTree.mFavorites[0].contextValue).toBe(`${Constants.FAV_PROFILE_CONTEXT}`); - expect(testTree.mFavorites[0].children[0].label).toBe(`${parent.label}`); - expect(testTree.mFavorites[0].children[0].contextValue).toBe(`${Constants.DS_PDS_CONTEXT}${Constants.FAV_SUFFIX}`); + expect(testTree.mFavorites[0].label).toBe(blockMocks.datasetSessionNode.label?.toString()); + expect(testTree.mFavorites[0].contextValue).toBe(Constants.FAV_PROFILE_CONTEXT); + expect(testTree.mFavorites[0].children[0].label).toBe(parent.label?.toString()); + expect(testTree.mFavorites[0].children[0].contextValue).toBe(Constants.DS_PDS_CONTEXT + Constants.FAV_SUFFIX); }); it("Checking adding of Session node", async () => { createGlobalMocks(); @@ -1030,10 +1029,10 @@ describe("Dataset Tree Unit Tests - Function addFavorite", () => { await testTree.addFavorite(testTree.mSessionNodes[1]); - expect(testTree.mFavorites[0].label).toBe(`${blockMocks.datasetSessionNode.label}`); - expect(testTree.mFavorites[0].contextValue).toBe(`${Constants.FAV_PROFILE_CONTEXT}`); - expect(testTree.mFavorites[0].children[0].label).toBe(`${testTree.mSessionNodes[1].pattern}`); - expect(testTree.mFavorites[0].children[0].contextValue).toBe(`${Constants.DS_SESSION_CONTEXT}${Constants.FAV_SUFFIX}`); + expect(testTree.mFavorites[0].label).toBe(blockMocks.datasetSessionNode.label?.toString()); + expect(testTree.mFavorites[0].contextValue).toBe(Constants.FAV_PROFILE_CONTEXT); + expect(testTree.mFavorites[0].children[0].label).toBe(testTree.mSessionNodes[1].pattern); + expect(testTree.mFavorites[0].children[0].contextValue).toBe(Constants.DS_SESSION_CONTEXT + Constants.FAV_SUFFIX); }); it("Checking attempt to add a duplicate node", async () => { createGlobalMocks(); @@ -1051,7 +1050,7 @@ describe("Dataset Tree Unit Tests - Function addFavorite", () => { await testTree.addFavorite(node); await testTree.addFavorite(node); - expect(testTree.mFavorites[0].children.map((entry) => entry.label)).toEqual([`${node.label}`]); + expect(testTree.mFavorites[0].children.map((entry) => entry.label)).toEqual([node.label?.toString()]); }); it("Checking attempt to add a member of favorite PDS", async () => { createGlobalMocks(); @@ -1112,14 +1111,14 @@ describe("Dataset Tree Unit Tests - Function removeFavorite", () => { await testTree.addFavorite(node1); await testTree.addFavorite(node2); const profileNodeInFavs = testTree.mFavorites[0]; - expect(profileNodeInFavs.children[0].label).toBe(`${node1.label}`); - expect(profileNodeInFavs.children[1].label).toBe(`${node2.label}`); + expect(profileNodeInFavs.children[0].label).toBe(node1.label?.toString()); + expect(profileNodeInFavs.children[1].label).toBe(node2.label?.toString()); // Actual test await testTree.removeFavorite(profileNodeInFavs.children[0]); expect(removeFavProfileSpy).not.toHaveBeenCalled(); expect(profileNodeInFavs.children.length).toBe(1); - expect(profileNodeInFavs.children[0].label).toBe(`${node2.label}`); + expect(profileNodeInFavs.children[0].label).toBe(node2.label?.toString()); }); it("Checking removeFavorite when starting with only one favorite for the profile", async () => { createGlobalMocks(); @@ -1140,7 +1139,7 @@ describe("Dataset Tree Unit Tests - Function removeFavorite", () => { // First we need to have the item and be sure that it's properly added to have legit removal operation await testTree.addFavorite(node); const profileNodeInFavs = testTree.mFavorites[0]; - expect(profileNodeInFavs.children[0].label).toBe(`${node.label}`); + expect(profileNodeInFavs.children[0].label).toBe(node.label?.toString()); await testTree.removeFavorite(profileNodeInFavs.children[0]); expect(removeFavProfileSpy).toHaveBeenCalledWith(profileNodeInFavs.label, false); expect(testTree.mFavorites.length).toBe(0); @@ -1199,7 +1198,7 @@ describe("Dataset Tree Unit Tests - Function removeFavProfile", () => { expect(blockMocks.testTree.mFavorites.length).toEqual(1); globalMocks.mockShowWarningMessage.mockResolvedValueOnce("Continue"); - await blockMocks.testTree.removeFavProfile(blockMocks.profileNodeInFavs.label.toString(), true); + await blockMocks.testTree.removeFavProfile(blockMocks.profileNodeInFavs.label?.toString() ?? "UNDEFINED", true); // Check that favorite is removed from UI expect(blockMocks.testTree.mFavorites.length).toEqual(0); @@ -1216,7 +1215,7 @@ describe("Dataset Tree Unit Tests - Function removeFavProfile", () => { const expectedFavProfileNode = blockMocks.testTree.mFavorites[0]; globalMocks.mockShowWarningMessage.mockResolvedValueOnce("Cancel"); - await blockMocks.testTree.removeFavProfile(blockMocks.profileNodeInFavs.label.toString(), true); + await blockMocks.testTree.removeFavProfile(blockMocks.profileNodeInFavs.label?.toString() ?? "UNDEFINED", true); expect(blockMocks.testTree.mFavorites.length).toEqual(1); expect(blockMocks.testTree.mFavorites[0]).toEqual(expectedFavProfileNode); @@ -1228,7 +1227,7 @@ describe("Dataset Tree Unit Tests - Function removeFavProfile", () => { // Make sure favorite is added before the actual unit test expect(blockMocks.testTree.mFavorites.length).toEqual(1); - await blockMocks.testTree.removeFavProfile(blockMocks.profileNodeInFavs.label.toString(), false); + await blockMocks.testTree.removeFavProfile(blockMocks.profileNodeInFavs.label?.toString() ?? "UNDEFINED", false); expect(blockMocks.testTree.mFavorites.length).toEqual(0); }); @@ -1362,7 +1361,7 @@ describe("Dataset Tree Unit Tests - Function flipState", () => { }); }); describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { - async function createBlockMocks(globalMocks) { + function createBlockMocks(globalMocks): { [key: string]: any } { const newMocks = { log: imperative.Logger.getAppLogger(), session: createISession(), @@ -1398,14 +1397,14 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { it("Checking function on favorites", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); mocked(vscode.window.createTreeView).mockReturnValueOnce(blockMocks.treeView); const testTree = new DatasetTree(); testTree.mSessionNodes.push(blockMocks.datasetSessionNode); const addSessionSpy = jest.spyOn(testTree, "addSession"); const favoriteSearch = new ZoweDatasetNode({ - label: `[${blockMocks.datasetSessionNode.label}]: HLQ.PROD1.STUFF`, + label: `[${blockMocks.datasetSessionNode.label as string}]: HLQ.PROD1.STUFF`, collapsibleState: vscode.TreeItemCollapsibleState.Collapsed, contextOverride: Constants.DS_SESSION_CONTEXT + Constants.FAV_SUFFIX, parentNode: testTree.mSessionNodes[1], @@ -1421,11 +1420,11 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { } as any); await testTree.datasetFilterPrompt(favoriteSearch); - expect(addSessionSpy).toHaveBeenLastCalledWith({ sessionName: blockMocks.datasetSessionNode.label.trim() }); + expect(addSessionSpy).toHaveBeenLastCalledWith({ sessionName: blockMocks.datasetSessionNode.label.toString().trim() }); }); it("Checking adding of new filter", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new FilterDescriptor("\uFF0B " + "Create a new filter")); mocked(Gui.showInputBox).mockResolvedValueOnce("HLQ.PROD1.STUFF"); @@ -1450,7 +1449,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { }); it("Checking adding of new filter of multiple ds search", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new FilterDescriptor("\uFF0B " + "Create a new filter")); mocked(Gui.showInputBox).mockResolvedValueOnce("HLQ.PROD(STUF*),HLQ.PROD1*"); @@ -1478,7 +1477,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { }); it("Checking adding of new filter with data set member", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new FilterDescriptor("\uFF0B " + "Create a new filter")); mocked(Gui.showInputBox).mockResolvedValueOnce("HLQ.PROD1(MEMBER)"); @@ -1491,11 +1490,11 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { }); it("Checking adding of new filter with Unverified profile", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); Object.defineProperty(Profiles, "getInstance", { value: jest.fn(() => { return { - loadNamedProfile: jest.fn().mockImplementationOnce((name, type) => blockMocks.imperativeProfile), + loadNamedProfile: jest.fn().mockImplementationOnce((_name, _type) => blockMocks.imperativeProfile), getBaseProfile: jest.fn(), checkCurrentProfile: blockMocks.mockCheckCurrentProfile.mockReturnValueOnce({ name: blockMocks.imperativeProfile.name, @@ -1519,7 +1518,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { }); it("Checking cancelled attempt to add a filter", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new FilterDescriptor("\uFF0B " + "Create a new filter")); mocked(vscode.window.showInputBox).mockResolvedValueOnce(undefined); @@ -1533,7 +1532,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { }); it("Checking usage of existing filter from filterPrompt", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const quickPickItem = new FilterDescriptor("HLQ.PROD1.STUFF"); mocked(vscode.window.createQuickPick).mockReturnValueOnce( @@ -1554,7 +1553,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { }); it("Checking cancelling of filter prompt with available filters", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const quickPickItem = undefined; mocked(vscode.window.createQuickPick).mockReturnValueOnce(createQuickPickContent("HLQ.PROD1.STUFF", quickPickItem, blockMocks.qpPlaceholder)); @@ -1572,7 +1571,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { }); it("Checking adding of new filter error is caught on getChildren", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new FilterDescriptor("\uFF0B " + "Create a new filter")); mocked(vscode.window.showInputBox).mockResolvedValueOnce("HLQ.PROD1.STUFF"); @@ -1594,7 +1593,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { }); it("Checking function for return if getChildren is undefined", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new FilterDescriptor("\uFF0B " + "Create a new filter")); mocked(vscode.window.showInputBox).mockResolvedValueOnce("HLQ.PROD1.STUFF"); @@ -1616,7 +1615,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { }); it("Checking function for return if element.getChildren calls error handling for success: false", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const errorHandlingMock = new MockedProperty(AuthUtils, "errorHandling"); @@ -1642,7 +1641,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { }); it("Checking function for return if element.getChildren returns undefined", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new FilterDescriptor("\uFF0B " + "Create a new filter")); mocked(vscode.window.showInputBox).mockResolvedValueOnce("HLQ.PROD1.STUFF"); @@ -1659,7 +1658,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { it("updates stats with modified date and user ID if provided in API", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const testTree = new DatasetTree(); testTree.mSessionNodes.push(blockMocks.datasetSessionNode); @@ -1826,19 +1825,6 @@ describe("Dataset Tree Unit Tests - Function onDidConfiguration", () => { expect(mocked(vscode.workspace.getConfiguration)).toHaveBeenCalledTimes(2); }); }); -describe("Dataset Tree Unit Tests - Function renameNode", () => { - function createBlockMocks() { - const session = createISession(); - const imperativeProfile = createIProfile(); - const datasetSessionNode = createDatasetSessionNode(session, imperativeProfile); - - return { - session, - imperativeProfile, - datasetSessionNode, - }; - } -}); describe("Dataset Tree Unit Tests - Function findFavoritedNode", () => { function createBlockMocks() { @@ -1857,7 +1843,7 @@ describe("Dataset Tree Unit Tests - Function findFavoritedNode", () => { }; } - it("Checking common run of function", async () => { + it("Checking common run of function", () => { createGlobalMocks(); const blockMocks = createBlockMocks(); @@ -1876,7 +1862,7 @@ describe("Dataset Tree Unit Tests - Function findFavoritedNode", () => { contextOverride: Constants.FAV_PROFILE_CONTEXT, }); const favoriteNode = new ZoweDatasetNode({ - label: `${node.label}`, + label: node.label?.toString(), collapsibleState: vscode.TreeItemCollapsibleState.Collapsed, parentNode: favProfileNode, }); @@ -1888,7 +1874,7 @@ describe("Dataset Tree Unit Tests - Function findFavoritedNode", () => { expect(foundNode).toBe(favoriteNode); }); - it("Checking that function does not error when there is no favorite or matching profile node in Favorites", async () => { + it("Checking that function does not error when there is no favorite or matching profile node in Favorites", () => { createGlobalMocks(); const blockMocks = createBlockMocks(); @@ -1921,7 +1907,7 @@ describe("Dataset Tree Unit Tests - Function findNonFavoritedNode", () => { }; } - it("Checking common run of function", async () => { + it("Checking common run of function", () => { createGlobalMocks(); const blockMocks = createBlockMocks(); @@ -1951,7 +1937,7 @@ describe("Dataset Tree Unit Tests - Function findNonFavoritedNode", () => { }); describe("Dataset Tree Unit Tests - Function openItemFromPath", () => { - function createBlockMocks() { + function createBlockMocks(): { [key: string]: any } { const session = createISession(); const imperativeProfile = createIProfile(); const treeView = createTreeView(); @@ -1981,7 +1967,10 @@ describe("Dataset Tree Unit Tests - Function openItemFromPath", () => { testTree.mSessionNodes[1].pattern = "test"; jest.spyOn(testTree.mSessionNodes[1], "getChildren").mockReturnValue(Promise.resolve([node])); - await testTree.openItemFromPath(`[${blockMocks.datasetSessionNode.label}]: ${node.label}`, blockMocks.datasetSessionNode); + await testTree.openItemFromPath( + `[${blockMocks.datasetSessionNode.label as string}]: ${node.label?.toString()}`, + blockMocks.datasetSessionNode + ); expect(testTree.getSearchHistory()).toEqual([node.label]); }); @@ -2003,8 +1992,11 @@ describe("Dataset Tree Unit Tests - Function openItemFromPath", () => { jest.spyOn(testTree.mSessionNodes[1], "getChildren").mockReturnValue(Promise.resolve([parent])); jest.spyOn(parent, "getChildren").mockReturnValue(Promise.resolve([child])); - await testTree.openItemFromPath(`[${blockMocks.datasetSessionNode.label}]: ${parent.label}(${child.label})`, blockMocks.datasetSessionNode); - expect(testTree.getSearchHistory()).toEqual([`${parent.label}(${child.label})`]); + await testTree.openItemFromPath( + `[${blockMocks.datasetSessionNode.label as string}]: ${parent.label?.toString()}(${child.label?.toString()})`, + blockMocks.datasetSessionNode + ); + expect(testTree.getSearchHistory()).toEqual([`${parent.label?.toString()}(${child.label?.toString()})`]); }); }); @@ -2472,14 +2464,14 @@ describe("Dataset Tree Unit Tests - Function rename", () => { expect(renameDataSetMemberSpy).toHaveBeenLastCalledWith(child); expect(error).toBe(defaultError); }); - it("Checking validate validateDataSetName util function successfully execution", async () => { + it("Checking validate validateDataSetName util function successfully execution", () => { expect(DatasetUtils.validateDataSetName("#DSNAME.DSNAME")).toBe(true); }); - it("Checking validate validateDataSetName util function fail", async () => { + it("Checking validate validateDataSetName util function fail", () => { expect(DatasetUtils.validateDataSetName("#DSNAME.DSNAMEMORETHAN8CHARS.TEST")).toBe(false); }); - it("Checking validate validateDataSetName util function fail on max ds length", async () => { + it("Checking validate validateDataSetName util function fail on max ds length", () => { const dsName = "#DSNAMET.DSNAME.DSNAME.DSNAME.DSNAME.DSNAMETE"; expect(dsName.length - 1 === Constants.MAX_DATASET_LENGTH).toBe(true); expect(DatasetUtils.validateDataSetName(dsName)).toBe(false); @@ -2504,7 +2496,6 @@ describe("Dataset Tree Unit Tests - Function rename", () => { options.validateInput(text); return Promise.resolve(text); }); - const oldName = node.label; await testTree.rename(node); expect(renameDataSetSpy).toHaveBeenLastCalledWith(node); }; @@ -2606,7 +2597,7 @@ describe("Dataset Tree Unit Tests - Function initializeFavorites", () => { }; } - it("successfully initialize favorites", async () => { + it("successfully initialize favorites", () => { createGlobalMocks(); const blockMocks = createBlockMocks(); const testTree = new DatasetTree(); diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/job/JobTree.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/job/JobTree.unit.test.ts index 352546bda6..cdd91df1a6 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/job/JobTree.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/job/JobTree.unit.test.ts @@ -241,7 +241,7 @@ async function createGlobalMocks() { globalMocks.mockProfileInstance.editSession = jest.fn(() => globalMocks.testProfile); globalMocks.mockGetConfiguration.mockReturnValue({ persistence: true, - get: (setting: string) => [], + get: (_setting: string) => [], update: jest.fn(() => { return {}; }), @@ -664,7 +664,7 @@ describe("ZosJobsProvider unit tests - Function removeFavProfile", () => { }); describe("ZosJobsProvider unit tests - Function delete", () => { - const createTestJob = async (globalMocks) => { + const createTestJob = (globalMocks) => { globalMocks.testJobsProvider.mFavorites = []; const testJobNode = new ZoweJobNode({ label: "IEFBR14(JOB1234) - CC 0000", @@ -679,7 +679,7 @@ describe("ZosJobsProvider unit tests - Function delete", () => { it("Removes a job node from session parent and refreshes job provider", async () => { const globalMocks = await createGlobalMocks(); - const testJob = await createTestJob(globalMocks); + const testJob = createTestJob(globalMocks); const deleteSpy = jest.spyOn(globalMocks.testJobsProvider, "delete"); const removeFavoriteSpy = jest.spyOn(globalMocks.testJobsProvider, "removeFavorite"); @@ -987,7 +987,7 @@ describe("ZosJobsProvider unit tests - function pollData", () => { }); describe("Jobs utils unit tests - Function jobStringValidator", () => { - it("should return null with correct input", async () => { + it("should return null with correct input", () => { const validOpts: [string, "owner" | "prefix"][] = [ ["job*", "prefix"], ["owner*", "owner"], @@ -995,7 +995,7 @@ describe("Jobs utils unit tests - Function jobStringValidator", () => { validOpts.forEach((validOpt) => expect(SharedUtils.jobStringValidator(validOpt[0], validOpt[1])).toBeNull()); }); - it("should return invalid string with invalid input", async () => { + it("should return invalid string with invalid input", () => { const invalidOpts: [string, "owner" | "prefix"][] = [ ["invalidowner", "owner"], ["job1234567*", "prefix"], diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/job/ZoweJobNode.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/job/ZoweJobNode.unit.test.ts index 2529efbd79..fa5309ff4d 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/job/ZoweJobNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/job/ZoweJobNode.unit.test.ts @@ -188,7 +188,7 @@ async function createGlobalMocks() { globalMocks.testIJobComplete.jobid = "JOB1235"; globalMocks.testIJobComplete.retcode = "0"; globalMocks.getConfiguration.mockReturnValueOnce({ - get: (setting: string) => ["[test]: /u/aDir{directory}", "[test]: /u/myFile.txt{textFile}"], + get: (_setting: string) => ["[test]: /u/aDir{directory}", "[test]: /u/myFile.txt{textFile}"], update: jest.fn(() => { return {}; }), @@ -612,7 +612,7 @@ describe("ZoweJobNode unit tests - Function flipState", () => { }); describe("ZoweJobNode unit tests - Function addFavorite", () => { - async function createBlockMocks(globalMocks) { + function createBlockMocks(globalMocks) { const newMocks = { testJobNode: new ZoweJobNode({ label: "MYHLQ(JOB1283) - Input", @@ -629,7 +629,7 @@ describe("ZoweJobNode unit tests - Function addFavorite", () => { it("Tests that addFavorite successfully favorites a job", async () => { const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); globalMocks.testJobsProvider.mFavorites = []; blockMocks.testJobNode.contextValue = Constants.JOBS_JOB_CONTEXT; @@ -646,7 +646,7 @@ describe("ZoweJobNode unit tests - Function addFavorite", () => { }); it("Tests that addFavorite successfully favorites a search", async () => { const globalMocks = await createGlobalMocks(); - await createBlockMocks(globalMocks); + createBlockMocks(globalMocks); globalMocks.testJobsProvider.mFavorites = []; globalMocks.testJobsProvider.mSessionNodes[1].owner = "myHLQ"; globalMocks.testJobsProvider.mSessionNodes[1].prefix = "*"; @@ -662,7 +662,7 @@ describe("ZoweJobNode unit tests - Function addFavorite", () => { }); describe("ZoweJobNode unit tests - Function removeFavorite", () => { - async function createBlockMocks(globalMocks) { + function createBlockMocks(globalMocks) { const newMocks = { testJobNode1: new ZoweJobNode({ label: "MYHLQ(JOB1283) - Input", @@ -687,7 +687,7 @@ describe("ZoweJobNode unit tests - Function removeFavorite", () => { it("Tests removeFavorite when starting with more than one favorite for the profile", async () => { const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const removeFavProfileSpy = jest.spyOn(globalMocks.testJobsProvider, "removeFavProfile"); globalMocks.testJobsProvider.mFavorites = []; @@ -708,7 +708,7 @@ describe("ZoweJobNode unit tests - Function removeFavorite", () => { }); it("Tests removeFavorite when starting with only one favorite for the profile", async () => { const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const removeFavProfileSpy = jest.spyOn(globalMocks.testJobsProvider, "removeFavProfile"); globalMocks.testJobsProvider.mFavorites = []; @@ -727,7 +727,7 @@ describe("ZoweJobNode unit tests - Function removeFavorite", () => { }); describe("ZoweJobNode unit tests - Function saveSearch", () => { - async function createBlockMocks(globalMocks) { + function createBlockMocks(globalMocks) { const testSession = globalMocks.testJobsProvider.mSessionNodes[1].getSession(); const newMocks = { testSession, @@ -749,7 +749,7 @@ describe("ZoweJobNode unit tests - Function saveSearch", () => { it("Tests that saveSearch is executed successfully", async () => { const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const favJob = blockMocks.testJobNode; favJob.owner = "myHLQ"; favJob.prefix = "*"; diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/shared/SharedActions.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/shared/SharedActions.unit.test.ts index 4088375a99..0cc7697bb2 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/shared/SharedActions.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/shared/SharedActions.unit.test.ts @@ -558,10 +558,10 @@ describe("Shared Actions Unit Tests - Function refreshAll", () => { const addedProfTypes = new Set(); const removeSessionSpy = jest .spyOn(TreeViewUtils, "removeSession") - .mockImplementation(async (treeProvider, profileName) => removedProfNames.add(profileName)); + .mockImplementation((treeProvider, profileName) => removedProfNames.add(profileName) as any); const addDefaultSessionSpy = jest .spyOn(TreeViewUtils, "addDefaultSession") - .mockImplementation(async (treeProvider, profileType) => addedProfTypes.add(profileType)); + .mockImplementation((treeProvider, profileType) => addedProfTypes.add(profileType) as any); await SharedActions.refreshAll(); expect(removeSessionSpy).toHaveBeenCalledTimes(6); expect([...removedProfNames]).toEqual(["zosmf", "zosmf2"]); diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/shared/SharedInit.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/shared/SharedInit.unit.test.ts index cf0406570b..87380559ba 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/shared/SharedInit.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/shared/SharedInit.unit.test.ts @@ -27,6 +27,7 @@ import { UnixCommandHandler } from "../../../../src/commands/UnixCommandHandler" import { SharedTreeProviders } from "../../../../src/trees/shared/SharedTreeProviders"; import { SharedContext } from "../../../../src/trees/shared/SharedContext"; import * as certWizard from "../../../../src/utils/CertificateWizard"; +import { Gui, imperative } from "@zowe/zowe-explorer-api"; jest.mock("../../../../src/utils/LoggerUtils"); jest.mock("../../../../src/tools/ZoweLogger"); @@ -420,6 +421,64 @@ describe("Test src/shared/extension", () => { expect(spyRefreshAll).toHaveBeenCalledTimes(1); expect(mockEmitter).toHaveBeenCalledTimes(1); }); + + it("should trigger callbacks when credentials or credManager are updated by another application", async () => { + let onVaultUpdatedCallback, onCredentialManagerUpdatedCallback; + const dummyWatcher: any = { + subscribeUser: (_event, cb) => { + onVaultUpdatedCallback = cb; + return { close: () => {} } as any; + }, + subscribeShared: (_event, cb) => { + onCredentialManagerUpdatedCallback = cb; + return { close: () => {} } as any; + }, + }; + const spyWatcher = jest.spyOn(imperative.EventOperator, "getWatcher").mockReturnValue(dummyWatcher); + const spyGuiError = jest.spyOn(Gui, "errorMessage"); + + // Spy callback behavior + const spyTranslatedLog = jest.spyOn(vscode.l10n, "t"); + const spyGetProfileInfo = jest.spyOn(profUtils.ProfilesUtils, "getProfileInfo").mockImplementationOnce(jest.fn()); + const spyReadConfigFromDisk = jest.spyOn(profUtils.ProfilesUtils, "readConfigFromDisk").mockImplementationOnce(jest.fn()); + const spyRefreshAll = jest.spyOn(SharedActions, "refreshAll").mockImplementation(jest.fn()); + + // Setup watchers + await SharedInit.watchConfigProfile(context); + + expect(spyWatcher).toHaveBeenCalled(); + expect(spyGuiError).not.toHaveBeenCalled(); + + jest.clearAllMocks(); + // Trigger Vault changes + await onVaultUpdatedCallback(); + expect(spyTranslatedLog.mock.calls[0][0]).toContain("vault"); + expect(spyReadConfigFromDisk).toHaveBeenCalled(); + expect(spyRefreshAll).toHaveBeenCalled(); + + jest.clearAllMocks(); + // Trigger Vault changes + await onCredentialManagerUpdatedCallback(); + expect(spyTranslatedLog.mock.calls[0][0]).toContain("credential management"); + expect(spyGetProfileInfo).toHaveBeenCalled(); + expect(spyRefreshAll).toHaveBeenCalled(); + }); + + it("should handle errors when watching for vault or credMgr changes", async () => { + const testError = "__TEST_ERROR__"; + const spyWatcher = jest.spyOn(imperative.EventOperator, "getWatcher").mockImplementation(() => { + throw testError; + }); + const spyGuiError = jest.spyOn(Gui, "errorMessage"); + + await SharedInit.watchConfigProfile(context); + + expect(spyWatcher).toHaveBeenCalled(); + expect(spyGuiError.mock.calls[0][0]).toContain("vault changes"); + expect(spyGuiError.mock.calls[0][0]).toContain(testError); + expect(spyGuiError.mock.calls[1][0]).toContain("credential manager changes"); + expect(spyGuiError.mock.calls[1][0]).toContain(testError); + }); }); describe("initSubscribers", () => { diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/shared/SharedUtils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/shared/SharedUtils.unit.test.ts index 416f82afb6..df75514851 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/shared/SharedUtils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/shared/SharedUtils.unit.test.ts @@ -13,7 +13,7 @@ import * as vscode from "vscode"; import { createIProfile, createISession, createInstanceOfProfile } from "../../../__mocks__/mockCreators/shared"; import { createDatasetSessionNode } from "../../../__mocks__/mockCreators/datasets"; import { UssFSProvider } from "../../../../src/trees/uss/UssFSProvider"; -import { imperative, ProfilesCache, Gui, ZosEncoding, BaseProvider, IZoweTreeNode } from "@zowe/zowe-explorer-api"; +import { imperative, ProfilesCache, Gui, ZosEncoding, BaseProvider } from "@zowe/zowe-explorer-api"; import { Constants } from "../../../../src/configuration/Constants"; import { FilterItem } from "../../../../src/management/FilterManagement"; import { ZoweLocalStorage } from "../../../../src/tools/ZoweLocalStorage"; @@ -110,7 +110,7 @@ describe("syncSessionNode shared util function", () => { expect(sessionNode.getSession()).toEqual(expectedSession); expect(sessionNode.getProfile()).toEqual(createIProfile()); }); - it("should do nothing, if there is no profile from provided node in the file system", async () => { + it("should do nothing, if there is no profile from provided node in the file system", () => { const profiles = createInstanceOfProfile(serviceProfile); profiles.loadNamedProfile = jest.fn(() => jest.fn(() => { @@ -134,17 +134,17 @@ describe("syncSessionNode shared util function", () => { }); describe("Positive testing", () => { - it("should pass for ZoweDatasetTreeNode with ZoweDatasetNode node type", async () => { + it("should pass for ZoweDatasetTreeNode with ZoweDatasetNode node type", () => { const dsNode = new ZoweDatasetNode({ label: "", collapsibleState: vscode.TreeItemCollapsibleState.None }); const value = SharedUtils.isZoweDatasetTreeNode(dsNode); expect(value).toBeTruthy(); }); - it("should pass for ZoweUSSTreeNode with ZoweUSSNode node type", async () => { + it("should pass for ZoweUSSTreeNode with ZoweUSSNode node type", () => { const ussNode = new ZoweUSSNode({ label: "", collapsibleState: vscode.TreeItemCollapsibleState.None }); const value = SharedUtils.isZoweUSSTreeNode(ussNode); expect(value).toBeTruthy(); }); - it("should pass for ZoweJobTreeNode with ZoweJobNode node type", async () => { + it("should pass for ZoweJobTreeNode with ZoweJobNode node type", () => { const jobNode = new ZoweJobNode({ label: "", collapsibleState: vscode.TreeItemCollapsibleState.None }); const value = SharedUtils.isZoweJobTreeNode(jobNode); expect(value).toBeTruthy(); @@ -152,12 +152,12 @@ describe("Positive testing", () => { }); describe("Negative testing for ZoweDatasetTreeNode", () => { - it("should fail with ZoweUSSNode node type", async () => { + it("should fail with ZoweUSSNode node type", () => { const ussNode = new ZoweUSSNode({ label: "", collapsibleState: vscode.TreeItemCollapsibleState.None }); const value = SharedUtils.isZoweDatasetTreeNode(ussNode); expect(value).toBeFalsy(); }); - it("should fail with ZoweJobNode node type", async () => { + it("should fail with ZoweJobNode node type", () => { const jobNode = new ZoweJobNode({ label: "", collapsibleState: vscode.TreeItemCollapsibleState.None }); const value = SharedUtils.isZoweDatasetTreeNode(jobNode); expect(value).toBeFalsy(); @@ -165,12 +165,12 @@ describe("Negative testing for ZoweDatasetTreeNode", () => { }); describe("Negative testing for ZoweUSSTreeNode", () => { - it("should fail with ZoweDatasetNode node type", async () => { + it("should fail with ZoweDatasetNode node type", () => { const dsNode = new ZoweDatasetNode({ label: "", collapsibleState: vscode.TreeItemCollapsibleState.None }); const value = SharedUtils.isZoweUSSTreeNode(dsNode); expect(value).toBeFalsy(); }); - it("should fail with ZoweJobNode node type", async () => { + it("should fail with ZoweJobNode node type", () => { const jobNode = new ZoweJobNode({ label: "", collapsibleState: vscode.TreeItemCollapsibleState.None }); const value = SharedUtils.isZoweUSSTreeNode(jobNode); expect(value).toBeFalsy(); @@ -178,12 +178,12 @@ describe("Negative testing for ZoweUSSTreeNode", () => { }); describe("Negative testing for ZoweJobTreeNode", () => { - it("should fail with ZoweDatasetNode node type", async () => { + it("should fail with ZoweDatasetNode node type", () => { const dsNode = new ZoweDatasetNode({ label: "", collapsibleState: vscode.TreeItemCollapsibleState.None }); const value = SharedUtils.isZoweJobTreeNode(dsNode); expect(value).toBeFalsy(); }); - it("should fail with ZoweUSSNode node type", async () => { + it("should fail with ZoweUSSNode node type", () => { const ussNode = new ZoweUSSNode({ label: "", collapsibleState: vscode.TreeItemCollapsibleState.None }); const value = SharedUtils.isZoweJobTreeNode(ussNode); expect(value).toBeFalsy(); @@ -214,7 +214,7 @@ describe("Shared Utils Unit Tests - Function filterTreeByString", () => { }); describe("Shared Utils Unit Tests - Function getSelectedNodeList", () => { - it("Testing that getSelectedNodeList returns the correct array when single node is selected", async () => { + it("Testing that getSelectedNodeList returns the correct array when single node is selected", () => { const selectedNodes = []; const aNode = createTestNode(); selectedNodes.push(aNode); @@ -223,7 +223,7 @@ describe("Shared Utils Unit Tests - Function getSelectedNodeList", () => { expect(nodeList).toEqual(selectedNodes); }); - it("Testing that getSelectedNodeList returns the correct array when single node is selected via quickKeys", async () => { + it("Testing that getSelectedNodeList returns the correct array when single node is selected via quickKeys", () => { const selectedNodes = undefined; const aNode = createTestNode(); const nodeList = SharedUtils.getSelectedNodeList(aNode, selectedNodes); @@ -231,7 +231,7 @@ describe("Shared Utils Unit Tests - Function getSelectedNodeList", () => { expect(nodeList[0]).toEqual(aNode); }); - it("Testing that getSelectedNodeList returns the correct array when multiple node is selected", async () => { + it("Testing that getSelectedNodeList returns the correct array when multiple node is selected", () => { const selectedNodes = []; const aNode = createTestNode(); selectedNodes.push(aNode); diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSActions.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSActions.unit.test.ts index d4f1c8b97e..af9143996a 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSActions.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSActions.unit.test.ts @@ -175,7 +175,7 @@ function createGlobalMocks() { } describe("USS Action Unit Tests - Function createUSSNodeDialog", () => { - async function createBlockMocks(globalMocks) { + function createBlockMocks(globalMocks) { const newMocks = { testUSSTree: null, ussNode: createUSSNode(globalMocks.testSession, createIProfile()), @@ -195,7 +195,7 @@ describe("USS Action Unit Tests - Function createUSSNodeDialog", () => { it("Tests that only the child node is refreshed when createUSSNode() is called on a child node", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); globalMocks.mockShowInputBox.mockReturnValue("USSFolder"); jest.spyOn(blockMocks.ussNode, "getChildren").mockResolvedValueOnce([]); @@ -209,7 +209,7 @@ describe("USS Action Unit Tests - Function createUSSNodeDialog", () => { it("Tests if createUSSNode is executed successfully with Unverified profile", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); Object.defineProperty(Profiles, "getInstance", { value: jest.fn(() => { @@ -232,7 +232,7 @@ describe("USS Action Unit Tests - Function createUSSNodeDialog", () => { it("Tests that createUSSNode does not execute if node name was not entered", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); globalMocks.mockShowInputBox.mockReturnValueOnce(""); @@ -243,7 +243,7 @@ describe("USS Action Unit Tests - Function createUSSNodeDialog", () => { it("Tests that createUSSNode is executed successfully", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const testProfile = createIProfile(); const ussApi = ZoweExplorerApiRegister.getUssApi(testProfile); @@ -265,7 +265,7 @@ describe("USS Action Unit Tests - Function createUSSNodeDialog", () => { it("Tests that createUSSNode refreshes the equivalent node (favorite/non-favorite)", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const testProfile = createIProfile(); const ussApi = ZoweExplorerApiRegister.getUssApi(testProfile); @@ -290,9 +290,9 @@ describe("USS Action Unit Tests - Function createUSSNodeDialog", () => { it("Tests that createUSSNode fails if an error is thrown", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); - const getUssApiSpy = jest.spyOn(ZoweExplorerApiRegister, "getUssApi").mockImplementationOnce(() => { + jest.spyOn(ZoweExplorerApiRegister, "getUssApi").mockImplementationOnce(() => { throw Error("Test error"); }); globalMocks.mockShowInputBox.mockReturnValueOnce("USSFolder"); @@ -309,7 +309,7 @@ describe("USS Action Unit Tests - Function createUSSNodeDialog", () => { it("Tests that only the child node is refreshed when createUSSNode() is called on a child node", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); globalMocks.mockShowInputBox.mockReturnValueOnce("USSFolder"); jest.spyOn(blockMocks.ussNode, "getChildren").mockResolvedValueOnce([]); @@ -323,7 +323,7 @@ describe("USS Action Unit Tests - Function createUSSNodeDialog", () => { it("Tests that the error is handled if createUSSNode is unsuccessful", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); globalMocks.mockShowInputBox.mockReturnValueOnce("USSFolder"); const isTopLevel = false; const errorHandlingSpy = jest.spyOn(AuthUtils, "errorHandling"); @@ -341,7 +341,7 @@ describe("USS Action Unit Tests - Function createUSSNodeDialog", () => { }); describe("USS Action Unit Tests - Function refreshUSSInTree", () => { - async function createBlockMocks(globalMocks) { + function createBlockMocks(globalMocks) { const newMocks = { testUSSTree: null, ussNode: createUSSNode(globalMocks.testSession, createIProfile()), @@ -356,7 +356,7 @@ describe("USS Action Unit Tests - Function refreshUSSInTree", () => { } it("should make the call to refresh the specified node within the USS tree", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); await USSActions.refreshUSSInTree(blockMocks.ussNode, blockMocks.testUSSTree); @@ -365,25 +365,11 @@ describe("USS Action Unit Tests - Function refreshUSSInTree", () => { }); describe("USS Action Unit Tests - Function deleteFromDisk", () => { - async function createBlockMocks(globalMocks) { - const newMocks = { - testUSSTree: null, - ussNode: createUSSNode(globalMocks.testSession, createIProfile()), - }; - newMocks.testUSSTree = createUSSTree( - [createFavoriteUSSNode(globalMocks.testSession, globalMocks.testProfile)], - [newMocks.ussNode], - createTreeView() - ); - - return newMocks; - } - it("should call unlink if file exists", () => { - (fs.existsSync as any) = jest.fn, Parameters>((filePath: string) => { + (fs.existsSync as any) = jest.fn, Parameters>((_filePath: string) => { return true; }); - (fs.unlinkSync as any) = jest.fn, Parameters>((filePath: string) => { + (fs.unlinkSync as any) = jest.fn, Parameters>((_filePath: string) => { // do nothing }); @@ -394,10 +380,10 @@ describe("USS Action Unit Tests - Function deleteFromDisk", () => { }); it("should call not unlink if file doesn't exist", () => { - (fs.existsSync as any) = jest.fn, Parameters>((filePath: string) => { + (fs.existsSync as any) = jest.fn, Parameters>((_filePath: string) => { return false; }); - (fs.unlinkSync as any) = jest.fn, Parameters>((filePath: string) => { + (fs.unlinkSync as any) = jest.fn, Parameters>((_filePath: string) => { // do nothing }); @@ -418,7 +404,7 @@ describe("USS Action Unit Tests - Function deleteFromDisk", () => { }); describe("USS Action Unit Tests - Function copyPath", () => { - async function createBlockMocks(globalMocks) { + function createBlockMocks(globalMocks) { const newMocks = { ussNode: createUSSNode(globalMocks.testSession, createIProfile()), }; @@ -428,7 +414,7 @@ describe("USS Action Unit Tests - Function copyPath", () => { it("should copy the node's full path to the system clipboard", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); await USSActions.copyPath(blockMocks.ussNode); expect(globalMocks.writeText).toHaveBeenCalledWith(blockMocks.ussNode.fullPath); @@ -436,11 +422,11 @@ describe("USS Action Unit Tests - Function copyPath", () => { }); describe("USS Action Unit Tests - Functions uploadDialog & uploadFile", () => { - async function createBlockMocks(globalMocks) { + function createBlockMocks(globalMocks) { Object.defineProperty(vscode.window, "withProgress", { value: jest.fn().mockImplementation((progLocation, callback) => { const progress = { - report: (message) => { + report: (_message) => { return; }, }; @@ -480,7 +466,7 @@ describe("USS Action Unit Tests - Functions uploadDialog & uploadFile", () => { it("Tests that uploadDialog() works for non-binary file", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); globalMocks.openTextDocument.mockResolvedValue(blockMocks.testDoc); const fileUri = { fsPath: "/tmp/foo.txt" }; @@ -494,7 +480,7 @@ describe("USS Action Unit Tests - Functions uploadDialog & uploadFile", () => { it("Tests that uploadDialog() works for binary file", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); globalMocks.openTextDocument.mockResolvedValue(blockMocks.testDoc); const fileUri = { fsPath: "/tmp/foo.zip" }; @@ -507,7 +493,7 @@ describe("USS Action Unit Tests - Functions uploadDialog & uploadFile", () => { it("shouldn't call upload dialog and not upload file if selection is empty", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); globalMocks.showOpenDialog.mockReturnValue(undefined); await USSActions.uploadDialog(blockMocks.ussNode, blockMocks.testUSSTree, true); expect(globalMocks.showOpenDialog).toHaveBeenCalled(); @@ -516,7 +502,7 @@ describe("USS Action Unit Tests - Functions uploadDialog & uploadFile", () => { it("Tests that uploadDialog() throws an error successfully", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); globalMocks.openTextDocument.mockResolvedValue(blockMocks.testDoc); globalMocks.mockShowInputBox.mockReturnValueOnce("new name"); @@ -537,7 +523,7 @@ describe("USS Action Unit Tests - Functions uploadDialog & uploadFile", () => { }); describe("USS Action Unit Tests - function uploadFile", () => { - async function createBlockMocks(globalMocks) { + function createBlockMocks(globalMocks) { const newMocks = { node: null, testUSSTree: null, @@ -570,10 +556,10 @@ describe("USS Action Unit Tests - function uploadFile", () => { it("Tests upload file works with new API method", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const putContent = jest.fn(); ZoweExplorerApiRegister.getUssApi = jest.fn>( - (profile: imperative.IProfileLoaded) => { + (_profile: imperative.IProfileLoaded) => { return { putContent, }; @@ -586,7 +572,7 @@ describe("USS Action Unit Tests - function uploadFile", () => { }); describe("USS Action Unit Tests - copy file / directory", () => { - async function createBlockMocks(globalMocks) { + function createBlockMocks(globalMocks) { const newMocks = { testUSSTree: null as unknown as USSTree, ussNode: createUSSNode(globalMocks.testSession, createIProfile()), @@ -636,7 +622,7 @@ describe("USS Action Unit Tests - copy file / directory", () => { it("Copy file(s), Directory(s) paths into clipboard", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const getEncodingForFileMock = jest.spyOn(ZoweUSSNode.prototype, "getEncoding").mockReturnValue(undefined as any); const fileStructure = JSON.stringify(await USSActions.ussFileStructure(blockMocks.ussNodes)); await USSActions.copyUssFilesToClipboard(blockMocks.ussNodes); @@ -645,7 +631,7 @@ describe("USS Action Unit Tests - copy file / directory", () => { getEncodingForFileMock.mockRestore(); }); - it("Has the proper responses for toSameSession in UssFileUtils", async () => { + it("Has the proper responses for toSameSession in UssFileUtils", () => { // Test toSameSession where one of the files has a diff LPAR let isSameSession = USSFileStructure.UssFileUtils.toSameSession( { @@ -677,7 +663,7 @@ describe("USS Action Unit Tests - copy file / directory", () => { it("paste calls relevant function in FileSystemProvider", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const rootTree: USSFileStructure.UssFileTree = { children: [], baseName: blockMocks.ussNodes[1].getLabel() as string, @@ -694,7 +680,7 @@ describe("USS Action Unit Tests - copy file / directory", () => { it("paste throws an error if required APIs are not available", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const rootTree: USSFileStructure.UssFileTree = { children: [], baseName: blockMocks.ussNodes[1].getLabel() as string, @@ -727,7 +713,7 @@ describe("USS Action Unit Tests - copy file / directory", () => { it("tests refreshChildNodesDirectory executed successfully with empty directory", async () => { jest.clearAllMocks(); const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); await USSActions.refreshChildNodesDirectory(blockMocks.ussNodes[1]); expect(blockMocks.ussNodes[1].getChildren).toHaveBeenCalledTimes(1); expect(blockMocks.ussNodes[1].refreshUSS).toHaveBeenCalledTimes(0); @@ -736,13 +722,13 @@ describe("USS Action Unit Tests - copy file / directory", () => { it("tests refreshChildNodesDirectory executed successfully with file", async () => { jest.clearAllMocks(); const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); await USSActions.refreshChildNodesDirectory(blockMocks.ussNodes[0]); expect(blockMocks.ussNodes[0].refreshUSS).toHaveBeenCalledTimes(1); }); it("tests refreshChildNodesDirectory executed successfully on a node with a child", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const node = new ZoweUSSNode({ label: "parent", collapsibleState: vscode.TreeItemCollapsibleState.Collapsed, @@ -757,26 +743,26 @@ describe("USS Action Unit Tests - copy file / directory", () => { it("tests copyUssFiles executed successfully via context menu with selected nodes", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); await USSActions.copyUssFiles(blockMocks.ussNode, null, blockMocks.testUSSTree); expect(SharedUtils.getSelectedNodeList(blockMocks.ussNode, null)).toEqual([blockMocks.ussNode]); }); it("tests copyUssFiles executed successfully via quick keys with selected nodes", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); await USSActions.copyUssFiles(null, null, blockMocks.testUSSTree); expect(SharedUtils.getSelectedNodeList(blockMocks.ussNode, null)).toEqual([blockMocks.ussNode]); }); it("tests pasteUss executed successfully with selected nodes", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); await USSActions.pasteUss(blockMocks.testUSSTree, blockMocks.ussNodes[0]); expect(SharedUtils.getSelectedNodeList(blockMocks.ussNode, null)).toEqual([blockMocks.ussNode]); }); it("tests pasteUss executed successfully with one node", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const parent = blockMocks.testUSSTree.getTreeView(); parent.selection = blockMocks.ussNodes[0]; jest.spyOn(USSActions, "copyUssFilesToClipboard").mockResolvedValueOnce(); @@ -785,7 +771,7 @@ describe("USS Action Unit Tests - copy file / directory", () => { }); it("tests pasteUss returns early if APIs are not supported", async () => { const globalMocks = createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + const blockMocks = createBlockMocks(globalMocks); const testNode = blockMocks.ussNodes[0]; testNode.copyUssFile = testNode.pasteUssTree = null; const infoMessageSpy = jest.spyOn(Gui, "infoMessage"); diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSInit.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSInit.unit.test.ts index 0f80f5f3a5..ef2045d76b 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSInit.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSInit.unit.test.ts @@ -16,7 +16,6 @@ import { SharedContext } from "../../../../src/trees/shared/SharedContext"; import { USSInit } from "../../../../src/trees/uss/USSInit"; import { SharedActions } from "../../../../src/trees/shared/SharedActions"; import { SharedInit } from "../../../../src/trees/shared/SharedInit"; -import { USSTree } from "../../../../src/trees/uss/USSTree"; describe("Test src/uss/extension", () => { describe("initUSSProvider", () => { diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSTree.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSTree.unit.test.ts index 92a1621f0a..7e65905a06 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSTree.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/uss/USSTree.unit.test.ts @@ -12,7 +12,6 @@ import * as vscode from "vscode"; import * as zosmf from "@zowe/zosmf-for-zowe-sdk"; import * as zosfiles from "@zowe/zos-files-for-zowe-sdk"; -import * as path from "path"; import { Gui, imperative, IZoweUSSTreeNode, ProfilesCache, Validation, ZoweScheme } from "@zowe/zowe-explorer-api"; import { ZoweExplorerApiRegister } from "../../../../src/extending/ZoweExplorerApiRegister"; import { Profiles } from "../../../../src/configuration/Profiles"; @@ -196,7 +195,7 @@ function createGlobalMocks() { globalMocks.getFilters.mockReturnValue(["/u/aDir{directory}", "/u/myFile.txt{textFile}"]); globalMocks.mockDefaultProfile.mockReturnValue(globalMocks.testProfile); globalMocks.getConfiguration.mockReturnValue({ - get: (setting: string) => ["[test]: /u/aDir{directory}", "[test]: /u/myFile.txt{textFile}"], + get: (_setting: string) => ["[test]: /u/aDir{directory}", "[test]: /u/myFile.txt{textFile}"], update: jest.fn(() => { return {}; }), @@ -622,7 +621,7 @@ describe("USSTree Unit Tests - Function filterPrompt", () => { it("Tests that filter() exits when user cancels out of input field", async () => { const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + await createBlockMocks(globalMocks); globalMocks.showInputBox.mockReturnValueOnce(undefined); @@ -656,7 +655,7 @@ describe("USSTree Unit Tests - Function filterPrompt", () => { it("Tests that filter() works correctly for favorited search nodes with credentials", async () => { const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + await createBlockMocks(globalMocks); const sessionWithCred = createISession(); globalMocks.createSessCfgFromArgs.mockReturnValue(sessionWithCred); @@ -674,7 +673,7 @@ describe("USSTree Unit Tests - Function filterPrompt", () => { it("Tests that filter() works correctly for favorited search nodes without credentials", async () => { const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + await createBlockMocks(globalMocks); const sessionNoCred = createISessionWithoutCredentials(); globalMocks.createSessCfgFromArgs.mockReturnValue(sessionNoCred); @@ -722,12 +721,10 @@ describe("USSTree Unit Tests - Function getAllLoadedItems", () => { globalMocks.testTree.mSessionNodes[1].children = [folder]; folder.children.push(file); - const treeGetChildren = jest - .spyOn(globalMocks.testTree, "getChildren") - .mockImplementationOnce(() => Promise.resolve([globalMocks.testTree.mSessionNodes[1]])); - const sessionGetChildren = jest - .spyOn(globalMocks.testTree.mSessionNodes[1], "getChildren") - .mockImplementationOnce(() => Promise.resolve(globalMocks.testTree.mSessionNodes[1].children)); + jest.spyOn(globalMocks.testTree, "getChildren").mockImplementationOnce(() => Promise.resolve([globalMocks.testTree.mSessionNodes[1]])); + jest.spyOn(globalMocks.testTree.mSessionNodes[1], "getChildren").mockImplementationOnce(() => + Promise.resolve(globalMocks.testTree.mSessionNodes[1].children) + ); const loadedItems = await globalMocks.testTree.getAllLoadedItems(); expect(loadedItems).toStrictEqual([file, folder]); @@ -893,7 +890,7 @@ describe("USSTree Unit Tests - Function saveSearch", () => { it("Testing that saveSearch() works properly on the same session, different path", async () => { const globalMocks = await createGlobalMocks(); - const blockMocks = await createBlockMocks(globalMocks); + await createBlockMocks(globalMocks); const testNode = globalMocks.testTree.mSessionNodes[1]; testNode.fullPath = "/a1234"; @@ -979,7 +976,7 @@ describe("USSTree Unit Tests - Function rename", () => { const globalMocks = await createGlobalMocks(); const blockMocks = createBlockMocks(globalMocks); const ussFavNode = blockMocks.ussFavNode; - globalMocks.testUSSNode.fullPath = globalMocks.testUSSNode.fullPath + "/usstest"; + globalMocks.testUSSNode.fullPath = (globalMocks.testUSSNode.fullPath as string) + "/usstest"; globalMocks.testTree.mSessionNodes[1].children.push(globalMocks.testUSSNode); const renameNode = jest.spyOn(globalMocks.testUSSNode, "rename"); renameNode.mockResolvedValue(false); @@ -1000,7 +997,7 @@ describe("USSTree Unit Tests - Function rename", () => { const globalMocks = await createGlobalMocks(); createBlockMocks(globalMocks); globalMocks.testTree.mFavorites = []; - globalMocks.testUSSNode.fullPath = globalMocks.testUSSNode.fullPath + "/usstest"; + globalMocks.testUSSNode.fullPath = (globalMocks.testUSSNode.fullPath as string) + "/usstest"; globalMocks.testTree.mSessionNodes[1].children.push(globalMocks.testUSSNode); const renameNode = jest.spyOn(globalMocks.testUSSNode, "rename"); renameNode.mockResolvedValue(false); diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/uss/UssFSProvider.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/uss/UssFSProvider.unit.test.ts index 89724ee62b..5987704f9e 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/uss/UssFSProvider.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/uss/UssFSProvider.unit.test.ts @@ -277,8 +277,9 @@ describe("fetchEncodingForUri", () => { it("returns the correct encoding for a URI", async () => { const fileEntry = { ...testEntries.file }; const lookupAsFileMock = jest.spyOn((UssFSProvider as any).prototype, "_lookupAsFile").mockReturnValueOnce(fileEntry); - const autoDetectEncodingMock = jest.spyOn(UssFSProvider.instance, "autoDetectEncoding").mockImplementation(async (entry) => { + const autoDetectEncodingMock = jest.spyOn(UssFSProvider.instance, "autoDetectEncoding").mockImplementation((entry) => { entry.encoding = { kind: "text" }; + return Promise.resolve(); }); await UssFSProvider.instance.fetchEncodingForUri(testUris.file); diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/uss/ZoweUSSNode.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/uss/ZoweUSSNode.unit.test.ts index 236a7902f2..9b8723804f 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/uss/ZoweUSSNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/uss/ZoweUSSNode.unit.test.ts @@ -1446,7 +1446,7 @@ describe("ZoweUSSNode Unit Tests - Function node.setAttributes", () => { }); describe("ZoweUSSNode Unit Tests - Function node.getBaseName", () => { - it("returns the base name for a USS node based on its URI", async () => { + it("returns the base name for a USS node based on its URI", () => { const node = new ZoweUSSNode({ label: "testFile", collapsibleState: vscode.TreeItemCollapsibleState.None }); node.resourceUri = vscode.Uri.from({ scheme: ZoweScheme.USS, path: "/someProfile/a/b/c/testFile" }); expect(node.getBaseName()).toBe("testFile"); diff --git a/packages/zowe-explorer/__tests__/__unit__/utils/LoggerUtils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/utils/LoggerUtils.unit.test.ts index 3899eff165..b070db36c4 100644 --- a/packages/zowe-explorer/__tests__/__unit__/utils/LoggerUtils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/utils/LoggerUtils.unit.test.ts @@ -20,7 +20,7 @@ import { LoggerUtils } from "../../../src/utils/LoggerUtils"; import { ZoweLocalStorage } from "../../../src/tools/ZoweLocalStorage"; import { ZoweLogger } from "../../../src/tools/ZoweLogger"; -function createGlobalMocks() { +function createGlobalMocks(): { [key: string]: any } { const newMocks = { mockMessage: "fake message", outputChannel: shared.createOutputChannel(), diff --git a/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts index 69a1caf167..514e8e605e 100644 --- a/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts @@ -34,7 +34,7 @@ describe("ProfilesUtils unit tests", () => { jest.clearAllMocks(); }); - function createBlockMocks() { + function createBlockMocks(): { [key: string]: any } { const newMocks = { mockExistsSync: jest.fn().mockReturnValue(true), mockReadFileSync: jest.fn(), @@ -342,7 +342,6 @@ describe("ProfilesUtils unit tests", () => { profInfoSpy.mockRestore(); }); it("should prompt user if v1 profiles detected and Convert Existing Profiles chosen", async () => { - const mocks = createBlockMocks(); const mockReadProfilesFromDisk = jest.fn(); const profInfoSpy = jest.spyOn(ProfilesUtils, "getProfileInfo").mockResolvedValue({ readProfilesFromDisk: mockReadProfilesFromDisk, diff --git a/packages/zowe-explorer/__tests__/__unit__/utils/SpoolUtils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/utils/SpoolUtils.unit.test.ts index 4dcd509bab..44753499a8 100644 --- a/packages/zowe-explorer/__tests__/__unit__/utils/SpoolUtils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/utils/SpoolUtils.unit.test.ts @@ -101,7 +101,10 @@ describe("SpoolProvider Unit Tests", () => { bindJesApi(jesApi); const spoolOk: zosjobs.IJobFile = { ...iJobFile, stepname: "test", ddname: "dd", "record-count": 1, procstep: "proc" }; - const { id, ddname, stepname, ...withoutIdDdStep } = spoolOk; + const withoutIdDdStep: Partial = JSON.parse(JSON.stringify(spoolOk)); + delete withoutIdDdStep.id; + delete withoutIdDdStep.ddname; + delete withoutIdDdStep.stepname; newJobSession.job = spoolOk as any; diff --git a/packages/zowe-explorer/__tests__/__unit__/utils/TreeViewUtils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/utils/TreeViewUtils.unit.test.ts index d78590a69e..01707e29fa 100644 --- a/packages/zowe-explorer/__tests__/__unit__/utils/TreeViewUtils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/utils/TreeViewUtils.unit.test.ts @@ -18,7 +18,7 @@ import { TreeViewUtils } from "../../../src/utils/TreeViewUtils"; import { Constants } from "../../../src/configuration/Constants"; describe("TreeViewUtils Unit Tests", () => { - function createBlockMocks() { + function createBlockMocks(): { [key: string]: any } { const newMocks = { session: createISession(), imperativeProfile: createIProfile(), diff --git a/packages/zowe-explorer/l10n/bundle.l10n.json b/packages/zowe-explorer/l10n/bundle.l10n.json index 9e84a07d99..32897ccc46 100644 --- a/packages/zowe-explorer/l10n/bundle.l10n.json +++ b/packages/zowe-explorer/l10n/bundle.l10n.json @@ -330,6 +330,8 @@ "Team config file created, refreshing Zowe Explorer.": "Team config file created, refreshing Zowe Explorer.", "Team config file deleted, refreshing Zowe Explorer.": "Team config file deleted, refreshing Zowe Explorer.", "Team config file updated.": "Team config file updated.", + "Changes in the credential vault detected, refreshing Zowe Explorer.": "Changes in the credential vault detected, refreshing Zowe Explorer.", + "Changes in credential management detected, refreshing Zowe Explorer.": "Changes in credential management detected, refreshing Zowe Explorer.", "Zowe Explorer has activated successfully.": "Zowe Explorer has activated successfully.", "Type the new pattern to add to history": "Type the new pattern to add to history", "action is not supported for this property type.": "action is not supported for this property type.", diff --git a/packages/zowe-explorer/l10n/poeditor.json b/packages/zowe-explorer/l10n/poeditor.json index 1a7957694e..823c39db81 100644 --- a/packages/zowe-explorer/l10n/poeditor.json +++ b/packages/zowe-explorer/l10n/poeditor.json @@ -544,6 +544,8 @@ "Team config file created, refreshing Zowe Explorer.": "", "Team config file deleted, refreshing Zowe Explorer.": "", "Team config file updated.": "", + "Changes in the credential vault detected, refreshing Zowe Explorer.": "", + "Changes in credential management detected, refreshing Zowe Explorer.": "", "Zowe Explorer has activated successfully.": "", "Type the new pattern to add to history": "", "action is not supported for this property type.": "", diff --git a/packages/zowe-explorer/package.json b/packages/zowe-explorer/package.json index 80e263c7b4..d904444c6a 100644 --- a/packages/zowe-explorer/package.json +++ b/packages/zowe-explorer/package.json @@ -1760,11 +1760,12 @@ "watch:webviews": "pnpm --filter webviews dev", "compile": "tsc -b", "markdown": "markdownlint CHANGELOG.md README.md", - "lint:pretty": "prettier --write . && prettier --check .", - "lint": "pnpm lint:src && pnpm lint:tests && pnpm lint:pretty && pnpm markdown", - "lint:html": "eslint . --format html > results/eslint.html", + "lint": "concurrently -n \"_eslint_,prettier,markdown\" \"pnpm lint:src; pnpm lint:test\" \"pnpm lint:pretty\" \"pnpm markdown\"", + "lint:all": "pnpm lint:src; pnpm lint:test; pnpm lint:html", "lint:src": "eslint --format stylish \"src/**/*.ts\"", - "lint:tests": "eslint --format stylish \"__tests__/**/*.ts\"", + "lint:test": "eslint --format stylish \"__tests__/**/*.ts\"", + "lint:html": "mkdir -p results && eslint . --format html > results/eslint.html", + "lint:pretty": "prettier --write . && prettier --check .", "clean:bundle": "rimraf out || true", "clean:dependencies": "rimraf node_modules || true", "fresh-clone": "pnpm clean:bundle && pnpm clean:dependencies", @@ -1811,11 +1812,11 @@ "webdriverio": "^8.36.1" }, "dependencies": { - "@zowe/core-for-zowe-sdk": "8.0.0-next.202407051717", - "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202407051717", - "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202407051717", - "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202407051717", - "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202407051717", + "@zowe/core-for-zowe-sdk": "8.0.0-next.202407232256", + "@zowe/secrets-for-zowe-sdk": "8.0.0-next.202407232256", + "@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202407232256", + "@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202407232256", + "@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202407232256", "@zowe/zowe-explorer-api": "3.0.0-next-SNAPSHOT", "dayjs": "^1.11.10", "fs-extra": "8.0.1", diff --git a/packages/zowe-explorer/src/configuration/Profiles.ts b/packages/zowe-explorer/src/configuration/Profiles.ts index 980c594f5a..015dad6a42 100644 --- a/packages/zowe-explorer/src/configuration/Profiles.ts +++ b/packages/zowe-explorer/src/configuration/Profiles.ts @@ -473,7 +473,7 @@ export class Profiles extends ProfilesCache { profiles: [...this.getCoreProfileTypes(), ProfileConstants.BaseProfile], baseProfile: ProfileConstants.BaseProfile, }; - const newConfig: imperative.IConfig = await imperative.ConfigBuilder.build(impConfig, opts); + const newConfig: imperative.IConfig = await imperative.ConfigBuilder.build(impConfig, global, opts); // Create non secure profile if VS Code setting is false this.createNonSecureProfile(newConfig); diff --git a/packages/zowe-explorer/src/configuration/Workspace.ts b/packages/zowe-explorer/src/configuration/Workspace.ts index 43f43eb285..a3a124dd1b 100644 --- a/packages/zowe-explorer/src/configuration/Workspace.ts +++ b/packages/zowe-explorer/src/configuration/Workspace.ts @@ -57,7 +57,8 @@ export class Workspace { * Checks if file is opened using iteration through tabs * This kind of method is caused by incompleteness of VSCode API, which allows to check only buffered status of files * There's an issue on GitHub for such feature: https://github.com/Microsoft/vscode/issues/15178 let's track it - * Idea of the approach was borrowed from the another extension: https://github.com/eamodio/vscode-restore-editors/blob/master/src/documentManager.ts + * Idea of the approach was borrowed from the another extension: + * https://github.com/eamodio/vscode-restore-editors/blob/master/src/documentManager.ts * Also notice that timer delay as well as iteration through opened tabs can cause side-effects on slow machines */ public static async checkTextFileIsOpened(path: string): Promise { diff --git a/packages/zowe-explorer/src/extending/ZoweExplorerApiRegister.ts b/packages/zowe-explorer/src/extending/ZoweExplorerApiRegister.ts index 16a5a554da..1d684806fe 100644 --- a/packages/zowe-explorer/src/extending/ZoweExplorerApiRegister.ts +++ b/packages/zowe-explorer/src/extending/ZoweExplorerApiRegister.ts @@ -98,6 +98,8 @@ export class ZoweExplorerApiRegister implements Types.IApiRegisterClient { // Event emitter extenders can subscribe to public onProfilesUpdateEmitter = new vscode.EventEmitter(); + public onVaultUpdateEmitter = new vscode.EventEmitter(); + public onCredMgrUpdateEmitter = new vscode.EventEmitter(); /** * Private constructor that creates the singleton instance of ZoweExplorerApiRegister. @@ -350,6 +352,22 @@ export class ZoweExplorerApiRegister implements Types.IApiRegisterClient { return this.onProfilesUpdateEmitter.event; } + /** + * Event for extenders to subscribe to that will fire upon credential changes. + * @returns event that can be attached that will be called upon credential changes. + */ + public get onVaultUpdate(): vscode.Event { + return this.onVaultUpdateEmitter.event; + } + + /** + * Event for extenders to subscribe to that will fire upon credential manager changes. + * @returns event that can be attached that will be called upon credential manager changes. + */ + public get onCredMgrUpdate(): vscode.Event { + return this.onCredMgrUpdateEmitter.event; + } + /** * Access the specific event that fires when a resource from the given scheme is updated (changed/created/deleted). * @param scheme The scheme of the resource (Data Sets, USS, Jobs, or an extender scheme) diff --git a/packages/zowe-explorer/src/trees/dataset/DatasetTemplates.ts b/packages/zowe-explorer/src/trees/dataset/DatasetTemplates.ts index a9392d7d39..a43131988b 100644 --- a/packages/zowe-explorer/src/trees/dataset/DatasetTemplates.ts +++ b/packages/zowe-explorer/src/trees/dataset/DatasetTemplates.ts @@ -65,8 +65,7 @@ export class DataSetTemplates { } } - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - private static promptForSaveLocation() { + private static promptForSaveLocation(): Thenable { const qpOptions: vscode.QuickPickOptions = { title: vscode.l10n.t("Data set template save location"), placeHolder: vscode.l10n.t("Choose the setting location to save the data set template..."), @@ -76,7 +75,7 @@ export class DataSetTemplates { const qpItems = []; qpItems.push(new FilterItem({ text: vscode.l10n.t("Save as User setting"), show: true })); qpItems.push(new FilterItem({ text: vscode.l10n.t("Save as Workspace setting"), show: true })); - return Gui.showQuickPick(qpItems, qpOptions); + return Gui.showQuickPick(qpItems, qpOptions); } private static getTemplatesPerLocation(target: vscode.ConfigurationTarget = vscode.ConfigurationTarget.Global): Types.DataSetAllocTemplate[] { diff --git a/packages/zowe-explorer/src/trees/job/JobFSProvider.ts b/packages/zowe-explorer/src/trees/job/JobFSProvider.ts index 7476a43e88..d1ed6e152a 100644 --- a/packages/zowe-explorer/src/trees/job/JobFSProvider.ts +++ b/packages/zowe-explorer/src/trees/job/JobFSProvider.ts @@ -47,7 +47,7 @@ export class JobFSProvider extends BaseProvider implements vscode.FileSystemProv return JobFSProvider._instance; } - public watch(uri: vscode.Uri, options: { readonly recursive: boolean; readonly excludes: readonly string[] }): vscode.Disposable { + public watch(_uri: vscode.Uri, _options: { readonly recursive: boolean; readonly excludes: readonly string[] }): vscode.Disposable { // ignore, fires for all changes... return new vscode.Disposable(() => {}); } diff --git a/packages/zowe-explorer/src/trees/job/JobInit.ts b/packages/zowe-explorer/src/trees/job/JobInit.ts index b3dd615503..07021fc1ef 100644 --- a/packages/zowe-explorer/src/trees/job/JobInit.ts +++ b/packages/zowe-explorer/src/trees/job/JobInit.ts @@ -77,9 +77,11 @@ export class JobInit { }) ); - const downloadSingleSpoolHandler = (binary: boolean) => async (node, nodeList) => { - const selectedNodes = SharedUtils.getSelectedNodeList(node, nodeList) as IZoweJobTreeNode[]; - await JobActions.downloadSingleSpool(selectedNodes, binary); + const downloadSingleSpoolHandler = (binary: boolean): ((node: IZoweTreeNode, nodeList: IZoweTreeNode[]) => Promise) => { + return async (node: IZoweTreeNode, nodeList: IZoweTreeNode[]): Promise => { + const selectedNodes = SharedUtils.getSelectedNodeList(node, nodeList) as IZoweJobTreeNode[]; + await JobActions.downloadSingleSpool(selectedNodes, binary); + }; }; context.subscriptions.push(vscode.commands.registerCommand("zowe.jobs.downloadSingleSpool", downloadSingleSpoolHandler(false))); context.subscriptions.push(vscode.commands.registerCommand("zowe.jobs.downloadSingleSpoolBinary", downloadSingleSpoolHandler(true))); @@ -88,9 +90,11 @@ export class JobInit { context.subscriptions.push(vscode.commands.registerCommand("zowe.jobs.setOwner", (job) => JobActions.setOwner(job, jobsProvider))); context.subscriptions.push(vscode.commands.registerCommand("zowe.jobs.setPrefix", (job) => JobActions.setPrefix(job, jobsProvider))); - const downloadSpoolHandler = (binary: boolean) => async (node, nodeList) => { - const selectedNodes = SharedUtils.getSelectedNodeList(node, nodeList) as IZoweJobTreeNode[]; - await JobActions.downloadSpool(selectedNodes, binary); + const downloadSpoolHandler = (binary: boolean): ((node: IZoweTreeNode, nodeList: IZoweTreeNode[]) => Promise) => { + return async (node: IZoweTreeNode, nodeList: IZoweTreeNode[]) => { + const selectedNodes = SharedUtils.getSelectedNodeList(node, nodeList) as IZoweJobTreeNode[]; + await JobActions.downloadSpool(selectedNodes, binary); + }; }; context.subscriptions.push(vscode.commands.registerCommand("zowe.jobs.downloadSpool", downloadSpoolHandler(false))); context.subscriptions.push(vscode.commands.registerCommand("zowe.jobs.downloadSpoolBinary", downloadSpoolHandler(true))); @@ -110,9 +114,8 @@ export class JobInit { context.subscriptions.push( vscode.commands.registerCommand("zowe.jobs.search", async (node): Promise => jobsProvider.filterPrompt(node)) ); - const spoolFileTogglePoll = - (startPolling: boolean) => - async (node: IZoweTreeNode, nodeList: IZoweTreeNode[]): Promise => { + const spoolFileTogglePoll = (startPolling: boolean): ((node: IZoweTreeNode, nodeList: IZoweTreeNode[]) => Promise) => { + return async (node: IZoweTreeNode, nodeList: IZoweTreeNode[]): Promise => { const selectedNodes = SharedUtils.getSelectedNodeList(node, nodeList); const isMultipleSelection = selectedNodes.length > 1; for (const n of selectedNodes) { @@ -125,6 +128,7 @@ export class JobInit { } } }; + }; context.subscriptions.push(vscode.commands.registerCommand("zowe.jobs.startPolling", spoolFileTogglePoll(true))); context.subscriptions.push(vscode.commands.registerCommand("zowe.jobs.stopPolling", spoolFileTogglePoll(false))); context.subscriptions.push( diff --git a/packages/zowe-explorer/src/trees/shared/SharedInit.ts b/packages/zowe-explorer/src/trees/shared/SharedInit.ts index c7bfbe22d5..bd47500f7c 100644 --- a/packages/zowe-explorer/src/trees/shared/SharedInit.ts +++ b/packages/zowe-explorer/src/trees/shared/SharedInit.ts @@ -10,7 +10,7 @@ */ import * as vscode from "vscode"; -import { FileManagement, IZoweTree, IZoweTreeNode, Validation, ZosEncoding, ZoweScheme } from "@zowe/zowe-explorer-api"; +import { FileManagement, Gui, IZoweTree, IZoweTreeNode, Validation, ZosEncoding, ZoweScheme, imperative } from "@zowe/zowe-explorer-api"; import { SharedActions } from "./SharedActions"; import { SharedHistoryView } from "./SharedHistoryView"; import { SharedTreeProviders } from "./SharedTreeProviders"; @@ -330,6 +330,33 @@ export class SharedInit { ZoweExplorerApiRegister.getInstance().onProfilesUpdateEmitter.fire(Validation.EventType.UPDATE); }); }); + + try { + const zoweWatcher = imperative.EventOperator.getWatcher().subscribeUser(imperative.ZoweUserEvents.ON_VAULT_CHANGED, async () => { + ZoweLogger.info(vscode.l10n.t("Changes in the credential vault detected, refreshing Zowe Explorer.")); + await ProfilesUtils.readConfigFromDisk(); + await SharedActions.refreshAll(); + ZoweExplorerApiRegister.getInstance().onVaultUpdateEmitter.fire(Validation.EventType.UPDATE); + }); + context.subscriptions.push(new vscode.Disposable(zoweWatcher.close.bind(zoweWatcher))); + } catch (err) { + Gui.errorMessage("Unable to watch for vault changes. " + JSON.stringify(err)); + } + + try { + const zoweWatcher = imperative.EventOperator.getWatcher().subscribeShared( + imperative.ZoweSharedEvents.ON_CREDENTIAL_MANAGER_CHANGED, + async () => { + ZoweLogger.info(vscode.l10n.t("Changes in credential management detected, refreshing Zowe Explorer.")); + await ProfilesUtils.getProfileInfo(); + await SharedActions.refreshAll(); + ZoweExplorerApiRegister.getInstance().onCredMgrUpdateEmitter.fire(Validation.EventType.UPDATE); + } + ); + context.subscriptions.push(new vscode.Disposable(zoweWatcher.close.bind(zoweWatcher))); + } catch (err) { + Gui.errorMessage("Unable to watch for credential manager changes. " + JSON.stringify(err)); + } } public static initSubscribers(context: vscode.ExtensionContext, theProvider: IZoweTree): void { diff --git a/packages/zowe-explorer/src/trees/uss/USSInit.ts b/packages/zowe-explorer/src/trees/uss/USSInit.ts index c33bd942be..af58f8a00c 100644 --- a/packages/zowe-explorer/src/trees/uss/USSInit.ts +++ b/packages/zowe-explorer/src/trees/uss/USSInit.ts @@ -121,8 +121,10 @@ export class USSInit { context.subscriptions.push( vscode.commands.registerCommand("zowe.uss.renameNode", async (node: IZoweUSSTreeNode): Promise => ussFileProvider.rename(node)) ); - const uploadDialogHandler = (binary: boolean) => async (node) => { - await USSActions.uploadDialog(node, ussFileProvider, binary); + const uploadDialogHandler = (binary: boolean): ((node: IZoweUSSTreeNode) => Promise) => { + return async (node: IZoweUSSTreeNode): Promise => { + await USSActions.uploadDialog(node, ussFileProvider, binary); + }; }; context.subscriptions.push(vscode.commands.registerCommand("zowe.uss.uploadDialog", uploadDialogHandler(false))); context.subscriptions.push(vscode.commands.registerCommand("zowe.uss.uploadDialogBinary", uploadDialogHandler(true))); diff --git a/packages/zowe-explorer/src/trees/uss/USSTree.ts b/packages/zowe-explorer/src/trees/uss/USSTree.ts index 32b9cc6b92..a7d9d3e7ef 100644 --- a/packages/zowe-explorer/src/trees/uss/USSTree.ts +++ b/packages/zowe-explorer/src/trees/uss/USSTree.ts @@ -83,7 +83,7 @@ export class USSTree extends ZoweTreeProvider implements Types this.treeView.onDidCollapseElement(TreeViewUtils.refreshIconOnCollapse([SharedContext.isUssDirectory, SharedContext.isUssSession], this)); } - public handleDrag(source: IZoweUSSTreeNode[], dataTransfer: vscode.DataTransfer, token: vscode.CancellationToken): void { + public handleDrag(source: IZoweUSSTreeNode[], dataTransfer: vscode.DataTransfer, _token: vscode.CancellationToken): void { const items = []; for (const srcItem of source) { this.draggedNodes[srcItem.resourceUri.path] = srcItem; @@ -168,7 +168,7 @@ export class USSTree extends ZoweTreeProvider implements Types public async handleDrop( targetNode: IZoweUSSTreeNode | undefined, dataTransfer: vscode.DataTransfer, - token: vscode.CancellationToken + _token: vscode.CancellationToken ): Promise { const droppedItems = dataTransfer.get("application/vnd.code.tree.zowe.uss.explorer"); if (!droppedItems) { @@ -428,7 +428,7 @@ export class USSTree extends ZoweTreeProvider implements Types /** * Renames a node from the favorites list * @deprecated No longer used as more info is now needed during the rename operation. - + * @param node */ public async renameFavorite(node: IZoweUSSTreeNode, newNamePath: string): Promise { diff --git a/packages/zowe-explorer/src/trees/uss/UssFSProvider.ts b/packages/zowe-explorer/src/trees/uss/UssFSProvider.ts index cfa8a773cc..9c3ae13597 100644 --- a/packages/zowe-explorer/src/trees/uss/UssFSProvider.ts +++ b/packages/zowe-explorer/src/trees/uss/UssFSProvider.ts @@ -428,7 +428,7 @@ export class UssFSProvider extends BaseProvider implements vscode.FileSystemProv * Deletes a file or folder at the given URI. * @param uri The URI that points to the file/folder to delete */ - public async delete(uri: vscode.Uri, options: { recursive: boolean }): Promise { + public async delete(uri: vscode.Uri, _options: { recursive: boolean }): Promise { const { entryToDelete, parent, parentUri } = this._getDeleteInfo(uri); try { diff --git a/packages/zowe-explorer/src/utils/ProfilesUtils.ts b/packages/zowe-explorer/src/utils/ProfilesUtils.ts index 1893369d4e..a475c0146f 100644 --- a/packages/zowe-explorer/src/utils/ProfilesUtils.ts +++ b/packages/zowe-explorer/src/utils/ProfilesUtils.ts @@ -72,7 +72,7 @@ export class ProfilesUtils { * Update the current credential manager override * @param setting the credential manager to use in imperative.json */ - public static updateCredentialManagerSetting(credentialManager?: string): void { + public static updateCredentialManagerSetting(credentialManager?: string | false): void { ZoweLogger.trace("ProfilesUtils.updateCredentialManagerSetting called."); const settingEnabled: boolean = SettingsConfig.getDirectValue(Constants.SETTINGS_SECURE_CREDENTIALS_ENABLED); if (settingEnabled && credentialManager) { @@ -85,9 +85,7 @@ export class ProfilesUtils { this.PROFILE_SECURITY = Constants.ZOWE_CLI_SCM; ZoweLogger.info(vscode.l10n.t(`Zowe explorer profiles are being set as secured.`)); } - if (this.PROFILE_SECURITY) { - imperative.CredentialManagerOverride.recordCredMgrInConfig(this.PROFILE_SECURITY); - } + imperative.CredentialManagerOverride.recordCredMgrInConfig(this.PROFILE_SECURITY); } /** @@ -127,7 +125,7 @@ export class ProfilesUtils { const customCredentialManagerExtension = credentialManagerMap.credMgrZEName && vscode.extensions.getExtension(credentialManagerMap.credMgrZEName); const credentialManager = await ProfilesUtils.activateCredentialManagerOverride(customCredentialManagerExtension); - if (credentialManager) { + if (credentialManager && credentialManagerMap.credMgrDisplayName) { Object.setPrototypeOf(credentialManager.prototype, imperative.AbstractCredentialManager.prototype); ProfilesUtils.updateCredentialManagerSetting(credentialManagerMap.credMgrDisplayName); return new imperative.ProfileInfo("zowe", { diff --git a/packages/zowe-explorer/src/utils/TreeViewUtils.ts b/packages/zowe-explorer/src/utils/TreeViewUtils.ts index 28ea955f7d..c6814ae79b 100644 --- a/packages/zowe-explorer/src/utils/TreeViewUtils.ts +++ b/packages/zowe-explorer/src/utils/TreeViewUtils.ts @@ -49,7 +49,7 @@ export class TreeViewUtils { public static refreshIconOnCollapse( qualifiers: ((node: IZoweTreeNode) => boolean)[], treeProvider: ZoweTreeProvider - ) { + ): (e: TreeViewExpansionEvent) => any { return (e: TreeViewExpansionEvent): any => { const newIcon = IconGenerator.getIconByNode(e.element); if (qualifiers.some((q) => q(e.element)) && newIcon) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ec7925159..9e876a8091 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -107,7 +107,7 @@ importers: version: 5.3.10(webpack@5.91.0) ts-jest: specifier: ^29.0.3 - version: 29.1.2(@babel/core@7.24.7)(jest@29.7.0)(typescript@5.4.5) + version: 29.1.2(@babel/core@7.24.9)(jest@29.7.0)(typescript@5.4.5) tsx: specifier: ^4.9.3 version: 4.10.4 @@ -133,20 +133,20 @@ importers: packages/zowe-explorer: dependencies: '@zowe/core-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717(@zowe/imperative@8.0.0-next.202407051717) + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256(@zowe/imperative@8.0.0-next.202407232256) '@zowe/secrets-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717 + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256 '@zowe/zos-files-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717) + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256) '@zowe/zos-jobs-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717) + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256) '@zowe/zosmf-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717) + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256) '@zowe/zowe-explorer-api': specifier: 3.0.0-next-SNAPSHOT version: link:../zowe-explorer-api @@ -189,7 +189,7 @@ importers: version: 17.0.3 '@wdio/cli': specifier: ^8.36.1 - version: 8.38.2(typescript@5.5.3) + version: 8.38.2(typescript@5.5.4) '@wdio/cucumber-framework': specifier: ^8.36.1 version: 8.38.2 @@ -198,7 +198,7 @@ importers: version: 8.38.2 '@wdio/local-runner': specifier: ^8.36.1 - version: 8.38.2(typescript@5.5.3) + version: 8.38.2(typescript@5.5.4) '@wdio/mocha-framework': specifier: ^8.37.0 version: 8.38.2 @@ -225,7 +225,7 @@ importers: version: 24.9.0 expect-webdriverio: specifier: ^4.13.0 - version: 4.14.0(typescript@5.5.3) + version: 4.14.0(typescript@5.5.4) glob: specifier: ^7.1.6 version: 7.2.3 @@ -243,7 +243,7 @@ importers: version: 16.1.3 ts-node: specifier: ^10.9.2 - version: 10.9.2(@types/node@18.19.33)(typescript@5.5.3) + version: 10.9.2(@types/node@18.19.33)(typescript@5.5.4) wdio-vscode-service: specifier: ^6.0.3 version: 6.0.3(webdriverio@8.38.2) @@ -252,7 +252,7 @@ importers: version: 3.0.11 webdriverio: specifier: ^8.36.1 - version: 8.38.2(typescript@5.5.3) + version: 8.38.2(typescript@5.5.4) packages/zowe-explorer-api: dependencies: @@ -260,32 +260,32 @@ importers: specifier: ^1.53.2 version: 1.89.0 '@zowe/core-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717(@zowe/imperative@8.0.0-next.202407051717) + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256(@zowe/imperative@8.0.0-next.202407232256) '@zowe/imperative': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717 + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256 '@zowe/secrets-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717 + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256 '@zowe/zos-console-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717) + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256) '@zowe/zos-files-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717) + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256) '@zowe/zos-jobs-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717) + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256) '@zowe/zos-tso-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717) + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256) '@zowe/zos-uss-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717(@zowe/imperative@8.0.0-next.202407051717) + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256(@zowe/imperative@8.0.0-next.202407232256) '@zowe/zosmf-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717) + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256) mustache: specifier: ^4.2.0 version: 4.2.0 @@ -306,14 +306,14 @@ importers: packages/zowe-explorer-ftp-extension: dependencies: '@zowe/zos-files-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717) + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256) '@zowe/zos-ftp-for-zowe-cli': specifier: 3.0.0-next.202403191358 - version: 3.0.0-next.202403191358(@zowe/imperative@8.0.0-next.202407051717) + version: 3.0.0-next.202403191358(@zowe/imperative@8.0.0-next.202407232256) '@zowe/zos-jobs-for-zowe-sdk': - specifier: 8.0.0-next.202407051717 - version: 8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717) + specifier: 8.0.0-next.202407232256 + version: 8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256) '@zowe/zowe-explorer-api': specifier: 3.0.0-next-SNAPSHOT version: link:../zowe-explorer-api @@ -342,7 +342,7 @@ importers: devDependencies: '@preact/preset-vite': specifier: ^2.5.0 - version: 2.8.2(@babel/core@7.24.7)(preact@10.22.0)(vite@4.5.3) + version: 2.8.2(@babel/core@7.24.9)(preact@10.22.0)(vite@4.5.3) '@types/lodash': specifier: ^4.17.0 version: 4.17.4 @@ -542,8 +542,8 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/compat-data@7.24.7: - resolution: {integrity: sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==} + /@babel/compat-data@7.24.9: + resolution: {integrity: sha512-e701mcfApCJqMMueQI0Fb68Amflj83+dvAvHawoBpAz+GDjCIyGHzNwnefjsWJ3xiYAqqiQFoWbspGYBdb2/ng==} engines: {node: '>=6.9.0'} dev: true @@ -570,20 +570,20 @@ packages: - supports-color dev: true - /@babel/core@7.24.7: - resolution: {integrity: sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==} + /@babel/core@7.24.9: + resolution: {integrity: sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.3.0 '@babel/code-frame': 7.24.7 - '@babel/generator': 7.24.7 - '@babel/helper-compilation-targets': 7.24.7 - '@babel/helper-module-transforms': 7.24.7(@babel/core@7.24.7) - '@babel/helpers': 7.24.7 - '@babel/parser': 7.24.7 + '@babel/generator': 7.24.10 + '@babel/helper-compilation-targets': 7.24.8 + '@babel/helper-module-transforms': 7.24.9(@babel/core@7.24.9) + '@babel/helpers': 7.24.8 + '@babel/parser': 7.24.8 '@babel/template': 7.24.7 - '@babel/traverse': 7.24.7 - '@babel/types': 7.24.7 + '@babel/traverse': 7.24.8 + '@babel/types': 7.24.9 convert-source-map: 2.0.0 debug: 4.3.5 gensync: 1.0.0-beta.2 @@ -593,21 +593,21 @@ packages: - supports-color dev: true - /@babel/generator@7.24.5: - resolution: {integrity: sha512-x32i4hEXvr+iI0NEoEfDKzlemF8AmtOP8CcrRaEcpzysWuoEb1KknpcvMsHKPONoKZiDuItklgWhB18xEhr9PA==} + /@babel/generator@7.24.10: + resolution: {integrity: sha512-o9HBZL1G2129luEUlG1hB4N/nlYNWHnpwlND9eOMclRqqu1YDy2sSYVCFUZwl8I1Gxh+QSRrP2vD7EpUmFVXxg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.9 '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 dev: true - /@babel/generator@7.24.7: - resolution: {integrity: sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==} + /@babel/generator@7.24.5: + resolution: {integrity: sha512-x32i4hEXvr+iI0NEoEfDKzlemF8AmtOP8CcrRaEcpzysWuoEb1KknpcvMsHKPONoKZiDuItklgWhB18xEhr9PA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.5 '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 @@ -631,13 +631,13 @@ packages: semver: 6.3.1 dev: true - /@babel/helper-compilation-targets@7.24.7: - resolution: {integrity: sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==} + /@babel/helper-compilation-targets@7.24.8: + resolution: {integrity: sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/compat-data': 7.24.7 - '@babel/helper-validator-option': 7.24.7 - browserslist: 4.23.1 + '@babel/compat-data': 7.24.9 + '@babel/helper-validator-option': 7.24.8 + browserslist: 4.23.2 lru-cache: 5.1.1 semver: 6.3.1 dev: true @@ -651,7 +651,7 @@ packages: resolution: {integrity: sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.9 dev: true /@babel/helper-function-name@7.23.0: @@ -667,7 +667,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.24.7 - '@babel/types': 7.24.7 + '@babel/types': 7.24.9 dev: true /@babel/helper-hoist-variables@7.22.5: @@ -681,7 +681,7 @@ packages: resolution: {integrity: sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.9 dev: true /@babel/helper-module-imports@7.24.3: @@ -695,8 +695,8 @@ packages: resolution: {integrity: sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/traverse': 7.24.7 - '@babel/types': 7.24.7 + '@babel/traverse': 7.24.8 + '@babel/types': 7.24.9 transitivePeerDependencies: - supports-color dev: true @@ -715,13 +715,13 @@ packages: '@babel/helper-validator-identifier': 7.24.5 dev: true - /@babel/helper-module-transforms@7.24.7(@babel/core@7.24.7): - resolution: {integrity: sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==} + /@babel/helper-module-transforms@7.24.9(@babel/core@7.24.9): + resolution: {integrity: sha512-oYbh+rtFKj/HwBQkFlUzvcybzklmVdVV3UU+mN7n2t/q3yGHbuVdNxyFvSBO1tfvjyArpHNcWMAzsSPdyI46hw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.9 '@babel/helper-environment-visitor': 7.24.7 '@babel/helper-module-imports': 7.24.7 '@babel/helper-simple-access': 7.24.7 @@ -747,8 +747,8 @@ packages: resolution: {integrity: sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/traverse': 7.24.7 - '@babel/types': 7.24.7 + '@babel/traverse': 7.24.8 + '@babel/types': 7.24.9 transitivePeerDependencies: - supports-color dev: true @@ -764,7 +764,7 @@ packages: resolution: {integrity: sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.9 dev: true /@babel/helper-string-parser@7.24.1: @@ -772,8 +772,8 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-string-parser@7.24.7: - resolution: {integrity: sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==} + /@babel/helper-string-parser@7.24.8: + resolution: {integrity: sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==} engines: {node: '>=6.9.0'} dev: true @@ -792,8 +792,8 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-option@7.24.7: - resolution: {integrity: sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==} + /@babel/helper-validator-option@7.24.8: + resolution: {integrity: sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==} engines: {node: '>=6.9.0'} dev: true @@ -808,12 +808,12 @@ packages: - supports-color dev: true - /@babel/helpers@7.24.7: - resolution: {integrity: sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==} + /@babel/helpers@7.24.8: + resolution: {integrity: sha512-gV2265Nkcz7weJJfvDoAEVzC1e2OTDpkGbEsebse8koXUJUXPsCMi7sRo/+SPMuMZ9MtUPnGwITTnQnU5YjyaQ==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.24.7 - '@babel/types': 7.24.7 + '@babel/types': 7.24.9 dev: true /@babel/highlight@7.24.5: @@ -844,12 +844,12 @@ packages: '@babel/types': 7.24.5 dev: true - /@babel/parser@7.24.7: - resolution: {integrity: sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==} + /@babel/parser@7.24.8: + resolution: {integrity: sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.24.7 + '@babel/types': 7.24.9 dev: true /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.5): @@ -907,13 +907,13 @@ packages: '@babel/helper-plugin-utils': 7.24.5 dev: true - /@babel/plugin-syntax-jsx@7.24.1(@babel/core@7.24.7): + /@babel/plugin-syntax-jsx@7.24.1(@babel/core@7.24.9): resolution: {integrity: sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.9 '@babel/helper-plugin-utils': 7.24.5 dev: true @@ -991,27 +991,27 @@ packages: '@babel/helper-plugin-utils': 7.24.5 dev: true - /@babel/plugin-transform-react-jsx-development@7.22.5(@babel/core@7.24.7): + /@babel/plugin-transform-react-jsx-development@7.22.5(@babel/core@7.24.9): resolution: {integrity: sha512-bDhuzwWMuInwCYeDeMzyi7TaBgRQei6DqxhbyniL7/VG4RSS7HtSL2QbY4eESy1KJqlWt8g3xeEBGPuo+XqC8A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.24.7 - '@babel/plugin-transform-react-jsx': 7.23.4(@babel/core@7.24.7) + '@babel/core': 7.24.9 + '@babel/plugin-transform-react-jsx': 7.23.4(@babel/core@7.24.9) dev: true - /@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.7): + /@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.9): resolution: {integrity: sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.9 '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-module-imports': 7.24.3 '@babel/helper-plugin-utils': 7.24.5 - '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.7) + '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.9) '@babel/types': 7.24.5 dev: true @@ -1036,8 +1036,8 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.24.7 - '@babel/parser': 7.24.7 - '@babel/types': 7.24.7 + '@babel/parser': 7.24.8 + '@babel/types': 7.24.9 dev: true /@babel/traverse@7.24.5: @@ -1058,18 +1058,18 @@ packages: - supports-color dev: true - /@babel/traverse@7.24.7: - resolution: {integrity: sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==} + /@babel/traverse@7.24.8: + resolution: {integrity: sha512-t0P1xxAPzEDcEPmjprAQq19NWum4K0EQPjMwZQZbHt+GiZqvjCHjj755Weq1YRPVzBI+3zSfvScfpnuIecVFJQ==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.24.7 - '@babel/generator': 7.24.7 + '@babel/generator': 7.24.10 '@babel/helper-environment-visitor': 7.24.7 '@babel/helper-function-name': 7.24.7 '@babel/helper-hoist-variables': 7.24.7 '@babel/helper-split-export-declaration': 7.24.7 - '@babel/parser': 7.24.7 - '@babel/types': 7.24.7 + '@babel/parser': 7.24.8 + '@babel/types': 7.24.9 debug: 4.3.5 globals: 11.12.0 transitivePeerDependencies: @@ -1085,11 +1085,11 @@ packages: to-fast-properties: 2.0.0 dev: true - /@babel/types@7.24.7: - resolution: {integrity: sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==} + /@babel/types@7.24.9: + resolution: {integrity: sha512-xm8XrMKz0IlUdocVbYJe0Z9xEgidU7msskG8BbhnTPK/HZ2z/7FP7ykqPgrUH+C+r414mNfNWam1f2vqOjqjYQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.24.7 + '@babel/helper-string-parser': 7.24.8 '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 dev: true @@ -2235,7 +2235,7 @@ packages: agent-base: 7.1.1 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.4 - lru-cache: 10.4.0 + lru-cache: 10.4.3 socks-proxy-agent: 8.0.4 transitivePeerDependencies: - supports-color @@ -2248,13 +2248,14 @@ packages: semver: 7.6.2 dev: false - /@npmcli/git@5.0.7: - resolution: {integrity: sha512-WaOVvto604d5IpdCRV2KjQu8PzkfE96d50CQGKgywXh2GxXmDeUO5EWcBC4V57uFyrNqx83+MewuJh3WTR3xPA==} + /@npmcli/git@5.0.8: + resolution: {integrity: sha512-liASfw5cqhjNW9UFd+ruwwdEf/lbOAQjLL2XY2dFW/bkJheXDYZgOyul/4gVvEV4BWkTXjYGmDqMw9uegdbJNQ==} engines: {node: ^16.14.0 || >=18.0.0} dependencies: '@npmcli/promise-spawn': 7.0.2 - lru-cache: 10.4.0 - npm-pick-manifest: 9.0.1 + ini: 4.1.3 + lru-cache: 10.4.3 + npm-pick-manifest: 9.1.0 proc-log: 4.2.0 promise-inflight: 1.0.1 promise-retry: 2.0.1 @@ -2282,8 +2283,8 @@ packages: resolution: {integrity: sha512-qe/kiqqkW0AGtvBjL8TJKZk/eBBSpnJkUWvHdQ9jM2lKHXRYYJuyNpJPlJw3c8QjC2ow6NZYiLExhUaeJelbxQ==} engines: {node: ^16.14.0 || >=18.0.0} dependencies: - '@npmcli/git': 5.0.7 - glob: 10.4.3 + '@npmcli/git': 5.0.8 + glob: 10.4.5 hosted-git-info: 7.0.2 json-parse-even-better-errors: 3.0.2 normalize-package-data: 6.0.2 @@ -2312,7 +2313,7 @@ packages: '@npmcli/node-gyp': 3.0.0 '@npmcli/package-json': 5.2.0 '@npmcli/promise-spawn': 7.0.2 - node-gyp: 10.1.0 + node-gyp: 10.2.0 proc-log: 4.2.0 which: 4.0.0 transitivePeerDependencies: @@ -2330,18 +2331,18 @@ packages: resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} dev: true - /@preact/preset-vite@2.8.2(@babel/core@7.24.7)(preact@10.22.0)(vite@4.5.3): + /@preact/preset-vite@2.8.2(@babel/core@7.24.9)(preact@10.22.0)(vite@4.5.3): resolution: {integrity: sha512-m3tl+M8IO8jgiHnk+7LSTFl8axdPXloewi7iGVLdmCwf34XOzEUur0bZVewW4DUbUipFjTS2CXu27+5f/oexBA==} peerDependencies: '@babel/core': 7.x vite: 2.x || 3.x || 4.x || 5.x dependencies: - '@babel/core': 7.24.7 - '@babel/plugin-transform-react-jsx': 7.23.4(@babel/core@7.24.7) - '@babel/plugin-transform-react-jsx-development': 7.22.5(@babel/core@7.24.7) + '@babel/core': 7.24.9 + '@babel/plugin-transform-react-jsx': 7.23.4(@babel/core@7.24.9) + '@babel/plugin-transform-react-jsx-development': 7.22.5(@babel/core@7.24.9) '@prefresh/vite': 2.4.5(preact@10.22.0)(vite@4.5.3) '@rollup/pluginutils': 4.2.1 - babel-plugin-transform-hook-names: 1.0.2(@babel/core@7.24.7) + babel-plugin-transform-hook-names: 1.0.2(@babel/core@7.24.9) debug: 4.3.4(supports-color@8.1.1) kolorist: 1.8.0 magic-string: 0.30.5 @@ -2404,7 +2405,7 @@ packages: dev: true optional: true - /@puppeteer/browsers@1.4.6(typescript@5.5.3): + /@puppeteer/browsers@1.4.6(typescript@5.5.4): resolution: {integrity: sha512-x4BEjr2SjOPowNeiguzjozQbsc6h437ovD/wu+JpaenxVLm3jkgzHY2xOslMTp50HoTvQreMjiexiGQw1sqZlQ==} engines: {node: '>=16.3.0'} hasBin: true @@ -2419,7 +2420,7 @@ packages: progress: 2.0.3 proxy-agent: 6.3.0 tar-fs: 3.0.4 - typescript: 5.5.3 + typescript: 5.5.4 unbzip2-stream: 1.4.3 yargs: 17.7.1 transitivePeerDependencies: @@ -2734,8 +2735,8 @@ packages: undici-types: 5.26.5 dev: true - /@types/node@20.14.10: - resolution: {integrity: sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==} + /@types/node@20.14.12: + resolution: {integrity: sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ==} requiresBuild: true dependencies: undici-types: 5.26.5 @@ -3146,7 +3147,7 @@ packages: tslib: 2.6.2 dev: false - /@wdio/cli@8.38.2(typescript@5.5.3): + /@wdio/cli@8.38.2(typescript@5.5.4): resolution: {integrity: sha512-p9y6jxmpmw53OoB9v/uTLwMetmz7Q0K7NewdVONgmeTY/ERpkU15qL3fMw1rXb+E+vrV8dlce4srnXroec6SFA==} engines: {node: ^16.13 || >=18} hasBin: true @@ -3154,7 +3155,7 @@ packages: '@types/node': 20.14.2 '@vitest/snapshot': 1.6.0 '@wdio/config': 8.38.2 - '@wdio/globals': 8.38.2(typescript@5.5.3) + '@wdio/globals': 8.38.2(typescript@5.5.4) '@wdio/logger': 8.38.0 '@wdio/protocols': 8.38.0 '@wdio/types': 8.38.2 @@ -3173,7 +3174,7 @@ packages: lodash.union: 4.6.0 read-pkg-up: 10.0.0 recursive-readdir: 2.2.3 - webdriverio: 8.38.2(typescript@5.5.3) + webdriverio: 8.38.2(typescript@5.5.4) yargs: 17.7.2 transitivePeerDependencies: - bufferutil @@ -3209,7 +3210,7 @@ packages: '@wdio/utils': 8.39.0 decamelize: 6.0.0 deepmerge-ts: 5.1.0 - glob: 10.4.3 + glob: 10.4.5 import-meta-resolve: 4.1.0 transitivePeerDependencies: - supports-color @@ -3234,12 +3235,12 @@ packages: - supports-color dev: true - /@wdio/globals@8.38.2(typescript@5.5.3): + /@wdio/globals@8.38.2(typescript@5.5.4): resolution: {integrity: sha512-iIrUF1EODfHLh3V/CSNCqbNNxUTe3ND+c86zDjzJcPFjawLX1plvAApsU/eDmtsFShcOS2KHbfSjiydFoqQG1Q==} engines: {node: ^16.13 || >=18} optionalDependencies: - expect-webdriverio: 4.14.0(typescript@5.5.3) - webdriverio: 8.38.2(typescript@5.5.3) + expect-webdriverio: 4.14.0(typescript@5.5.4) + webdriverio: 8.38.2(typescript@5.5.4) transitivePeerDependencies: - bufferutil - devtools @@ -3249,13 +3250,13 @@ packages: - utf-8-validate dev: true - /@wdio/globals@8.39.1(typescript@5.5.3): + /@wdio/globals@8.39.1(typescript@5.5.4): resolution: {integrity: sha512-kNb1TlxI8Le/tsOiw7CMQcG0+ZGyxk9ZDO/PQLxkJvjo/q2QmiBcgaNMPuf+j1ABETcQK4bI7QtiT5uZ+f2AGA==} engines: {node: ^16.13 || >=18} requiresBuild: true optionalDependencies: - expect-webdriverio: 4.14.0(typescript@5.5.3) - webdriverio: 8.39.1(typescript@5.5.3) + expect-webdriverio: 4.14.0(typescript@5.5.4) + webdriverio: 8.39.1(typescript@5.5.4) transitivePeerDependencies: - bufferutil - devtools @@ -3276,14 +3277,14 @@ packages: junit-report-builder: 3.2.1 dev: true - /@wdio/local-runner@8.38.2(typescript@5.5.3): + /@wdio/local-runner@8.38.2(typescript@5.5.4): resolution: {integrity: sha512-syW+R5VUHJ3GBkQGFcNYe6MYwWRgklc9W7A83xQDTvKWFNHCetLvc8AtKZ54vs8MItBejjU+Oh94ZNbNX1pBcg==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.14.2 '@wdio/logger': 8.38.0 '@wdio/repl': 8.24.12 - '@wdio/runner': 8.38.2(typescript@5.5.3) + '@wdio/runner': 8.38.2(typescript@5.5.4) '@wdio/types': 8.38.2 async-exit-hook: 2.0.1 split2: 4.2.0 @@ -3343,21 +3344,21 @@ packages: object-inspect: 1.13.1 dev: true - /@wdio/runner@8.38.2(typescript@5.5.3): + /@wdio/runner@8.38.2(typescript@5.5.4): resolution: {integrity: sha512-5lPnKSX2BBLI2AbYW+hoGPiEUAJXj8F8I6NC2LaBVzf1CLN+w2HWZ7lUiqS14XT0b5/hlSUX6+JYwUXlDbpuuw==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.14.2 '@wdio/config': 8.38.2 - '@wdio/globals': 8.38.2(typescript@5.5.3) + '@wdio/globals': 8.38.2(typescript@5.5.4) '@wdio/logger': 8.38.0 '@wdio/types': 8.38.2 '@wdio/utils': 8.38.2 deepmerge-ts: 5.1.0 - expect-webdriverio: 4.14.0(typescript@5.5.3) + expect-webdriverio: 4.14.0(typescript@5.5.4) gaze: 1.1.3 webdriver: 8.38.2 - webdriverio: 8.38.2(typescript@5.5.3) + webdriverio: 8.38.2(typescript@5.5.4) transitivePeerDependencies: - bufferutil - devtools @@ -3390,7 +3391,7 @@ packages: engines: {node: ^16.13 || >=18} requiresBuild: true dependencies: - '@types/node': 20.14.10 + '@types/node': 20.14.12 dev: true optional: true @@ -3594,19 +3595,19 @@ packages: engines: {bun: '>=0.7.0', deno: '>=1.0.0', node: '>=16.5.0'} dev: true - /@zowe/core-for-zowe-sdk@8.0.0-next.202407051717(@zowe/imperative@8.0.0-next.202407051717): - resolution: {integrity: sha512-OeZnlNP7ySBPSl+sxhRnAJFV27NMuLFHhsJ9jneWA1B5tQQPzxH67Ydt6vNswtElUfjctUlq8WF6xX8oFhAY7A==} + /@zowe/core-for-zowe-sdk@8.0.0-next.202407232256(@zowe/imperative@8.0.0-next.202407232256): + resolution: {integrity: sha512-qIN8pXzea1Grcxun6jIOUk9CyFWPcZ6yqwalldRX9KCm6G0BDLen/0fN21Q1Won9B7SONbcmZdK89lXaGrz91g==} engines: {node: '>=18.12.0'} peerDependencies: '@zowe/imperative': ^8.0.0-next dependencies: - '@zowe/imperative': 8.0.0-next.202407051717 + '@zowe/imperative': 8.0.0-next.202407232256 comment-json: 4.2.4 string-width: 4.2.3 dev: false - /@zowe/imperative@8.0.0-next.202407051717: - resolution: {integrity: sha512-iUa+r2cm7aul96D2q2KRssR99unm2YXRtS+qnP1DF92tjNFJs5ko6OJBtEawEDh50ZvGS9cFTl4nkc/KWoLlXw==} + /@zowe/imperative@8.0.0-next.202407232256: + resolution: {integrity: sha512-yo07LqTQdgMI4OK34y5iqUHzYXtpUpdXvZsDa9U4T94+jGSw02EVlTqJTM8TqmV72Y5ZYfr1pcjHP7l2AlYu5A==} engines: {node: '>=18.12.0'} dependencies: '@types/yargs': 17.0.32 @@ -3633,7 +3634,7 @@ packages: log4js: 6.9.1 markdown-it: 14.1.0 mustache: 4.2.0 - npm-package-arg: 11.0.2 + npm-package-arg: 11.0.3 opener: 1.5.2 pacote: 18.0.6 prettyjson: 1.2.5 @@ -3644,94 +3645,93 @@ packages: strip-ansi: 6.0.1 which: 4.0.0 wrap-ansi: 7.0.0 - yamljs: 0.3.0 yargs: 17.7.2 transitivePeerDependencies: - bluebird - supports-color dev: false - /@zowe/secrets-for-zowe-sdk@8.0.0-next.202407051717: - resolution: {integrity: sha512-vZ8VbkJfJDT0rzbqSBzpv8UG0WGrKzUU4BawKLhP8eWMeVJ8Er9Jcb0itsotHYn9W3e6GMlVrJvZOzqLL8+feA==} + /@zowe/secrets-for-zowe-sdk@8.0.0-next.202407232256: + resolution: {integrity: sha512-3KYoOV838qTXjM7PEW+xcjSFooJbc9XYVonwOS67FQOfLmUy1tfOB7qnbDCi6jTQLvL3ydnN7G36eBr/AzEl/w==} engines: {node: '>=14'} requiresBuild: true dev: false - /@zowe/zos-console-for-zowe-sdk@8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717): - resolution: {integrity: sha512-KSvTEMF+t3KuRg9k/o3+c1Q58/qSIVi2B2m+AXdDZ42qCI59VbS7sZC46a/yHfYC4uxXvwk4jJmhmTY82Jnqjw==} + /@zowe/zos-console-for-zowe-sdk@8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256): + resolution: {integrity: sha512-wi2fo7QdRXNt/71lJ2xvEn7Wft2qGH7SNhyl4T3SLsx/QMUWZcoPbZNTwodeKLA9ay7beBhdiwOURRYdj51B4w==} engines: {node: '>=18.12.0'} peerDependencies: '@zowe/core-for-zowe-sdk': ^8.0.0-next '@zowe/imperative': ^8.0.0-next dependencies: - '@zowe/core-for-zowe-sdk': 8.0.0-next.202407051717(@zowe/imperative@8.0.0-next.202407051717) - '@zowe/imperative': 8.0.0-next.202407051717 + '@zowe/core-for-zowe-sdk': 8.0.0-next.202407232256(@zowe/imperative@8.0.0-next.202407232256) + '@zowe/imperative': 8.0.0-next.202407232256 dev: false - /@zowe/zos-files-for-zowe-sdk@8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717): - resolution: {integrity: sha512-lMXB4b6ti0xhXNf4nP1nNEZReRQGG8vef6CyxeuQrfV41emk8i4Gt4D2SwQH2nQMMSJCN25mPrJkCUxR06VZlQ==} + /@zowe/zos-files-for-zowe-sdk@8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256): + resolution: {integrity: sha512-BG6Cea4tS221n1+Ll8DaGskyqr0XlHi5DFBkkh0eQG8T2dMPSr8X6Lv4CP9F/FuI58CwUTgWHYMDtLiv5qy4kQ==} engines: {node: '>=18.12.0'} peerDependencies: '@zowe/core-for-zowe-sdk': ^8.0.0-next '@zowe/imperative': ^8.0.0-next dependencies: - '@zowe/core-for-zowe-sdk': 8.0.0-next.202407051717(@zowe/imperative@8.0.0-next.202407051717) - '@zowe/imperative': 8.0.0-next.202407051717 + '@zowe/core-for-zowe-sdk': 8.0.0-next.202407232256(@zowe/imperative@8.0.0-next.202407232256) + '@zowe/imperative': 8.0.0-next.202407232256 minimatch: 9.0.5 dev: false - /@zowe/zos-ftp-for-zowe-cli@3.0.0-next.202403191358(@zowe/imperative@8.0.0-next.202407051717): + /@zowe/zos-ftp-for-zowe-cli@3.0.0-next.202403191358(@zowe/imperative@8.0.0-next.202407232256): resolution: {integrity: sha512-jTiGcqFZNKIanUQAWOT+2M+3X6P9FAlPrie999HjDm79DpEltkjNwdNLM8EZLtSXsTjBrifaTo/pMVVmmhfl4A==} peerDependencies: '@zowe/imperative': '>=8.0.0-next.0 <8.0.0' dependencies: - '@zowe/imperative': 8.0.0-next.202407051717 + '@zowe/imperative': 8.0.0-next.202407232256 zos-node-accessor: 2.0.9 dev: false - /@zowe/zos-jobs-for-zowe-sdk@8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717): - resolution: {integrity: sha512-gG2uVv8W0zfZIIg3QZuKWsfnlrnOIxvm8bcHwlRXkysGlgECYaSUBelZGCmimuQ51X5FXyD59enoQjw7TeMmVg==} + /@zowe/zos-jobs-for-zowe-sdk@8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256): + resolution: {integrity: sha512-iAOhViTomTU5AEBW5YKNN2Fi4c09FfZgD2rV4IRwrvViayjsDIAp2VOTwc6d67850imIAn+mCNVe7rh0u8dlOA==} engines: {node: '>=18.12.0'} peerDependencies: '@zowe/core-for-zowe-sdk': ^8.0.0-next '@zowe/imperative': ^8.0.0-next dependencies: - '@zowe/core-for-zowe-sdk': 8.0.0-next.202407051717(@zowe/imperative@8.0.0-next.202407051717) - '@zowe/imperative': 8.0.0-next.202407051717 - '@zowe/zos-files-for-zowe-sdk': 8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717) + '@zowe/core-for-zowe-sdk': 8.0.0-next.202407232256(@zowe/imperative@8.0.0-next.202407232256) + '@zowe/imperative': 8.0.0-next.202407232256 + '@zowe/zos-files-for-zowe-sdk': 8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256) dev: false - /@zowe/zos-tso-for-zowe-sdk@8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717): - resolution: {integrity: sha512-A+A/N9k/wSlQldKlm9EiuZ6AZip8qWGzfxUTzpl4wiGGk0bUIRrOP4SxRNU8gcaUvfslaKLO/lbKBtQ1X/eCZw==} + /@zowe/zos-tso-for-zowe-sdk@8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256): + resolution: {integrity: sha512-DJNoIkSr7HSVsio1QM2pbAJL0z9XvgbW/XQIj9hKhKqzvd/o2tPUWDf2iwzRnc1gB3aGKB8bXqM86G3+AqtuaA==} engines: {node: '>=18.12.0'} peerDependencies: '@zowe/core-for-zowe-sdk': ^8.0.0-next '@zowe/imperative': ^8.0.0-next dependencies: - '@zowe/core-for-zowe-sdk': 8.0.0-next.202407051717(@zowe/imperative@8.0.0-next.202407051717) - '@zowe/imperative': 8.0.0-next.202407051717 - '@zowe/zosmf-for-zowe-sdk': 8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717) + '@zowe/core-for-zowe-sdk': 8.0.0-next.202407232256(@zowe/imperative@8.0.0-next.202407232256) + '@zowe/imperative': 8.0.0-next.202407232256 + '@zowe/zosmf-for-zowe-sdk': 8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256) dev: false - /@zowe/zos-uss-for-zowe-sdk@8.0.0-next.202407051717(@zowe/imperative@8.0.0-next.202407051717): - resolution: {integrity: sha512-igiTGJVBvJiNA9jDBK4YTlTUIKKsluXyrLTjgIJeYTn9A9fk2IQQlAg0T6Fj53SSue/H3/y7XAhoZmFRH6f3eA==} + /@zowe/zos-uss-for-zowe-sdk@8.0.0-next.202407232256(@zowe/imperative@8.0.0-next.202407232256): + resolution: {integrity: sha512-4ffxCN/1WG7UAG/vwBxztOnwUP0byNMgbLLZxO/iU7UFbTdyxijL+bodfCMVeN1TvC3N1G3AjnLb1HJAzHpK/g==} engines: {node: '>=18.12.0'} peerDependencies: '@zowe/imperative': ^8.0.0-next dependencies: - '@zowe/imperative': 8.0.0-next.202407051717 + '@zowe/imperative': 8.0.0-next.202407232256 ssh2: 1.15.0 dev: false - /@zowe/zosmf-for-zowe-sdk@8.0.0-next.202407051717(@zowe/core-for-zowe-sdk@8.0.0-next.202407051717)(@zowe/imperative@8.0.0-next.202407051717): - resolution: {integrity: sha512-vA/DuxMnnfhHf+8rVLuu9uSt9j4YzUK1FKi/37y/KgyAvNnidJukDz8VqfFSgLNpKygxfoO9tbtFtClNbuFSoQ==} + /@zowe/zosmf-for-zowe-sdk@8.0.0-next.202407232256(@zowe/core-for-zowe-sdk@8.0.0-next.202407232256)(@zowe/imperative@8.0.0-next.202407232256): + resolution: {integrity: sha512-iAwewgpX1/hIAQjrj2CZN715uwrC19bY75JexHvDMp8BlsiRliYAfg1NI1JjNPS5SlApk8zfdwFs0llFGwUUTw==} engines: {node: '>=18.12.0'} peerDependencies: '@zowe/core-for-zowe-sdk': ^8.0.0-next '@zowe/imperative': ^8.0.0-next dependencies: - '@zowe/core-for-zowe-sdk': 8.0.0-next.202407051717(@zowe/imperative@8.0.0-next.202407051717) - '@zowe/imperative': 8.0.0-next.202407051717 + '@zowe/core-for-zowe-sdk': 8.0.0-next.202407232256(@zowe/imperative@8.0.0-next.202407232256) + '@zowe/imperative': 8.0.0-next.202407232256 dev: false /abbrev@1.1.1: @@ -3984,6 +3984,7 @@ packages: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: sprintf-js: 1.0.3 + dev: true /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -4180,12 +4181,12 @@ packages: '@types/babel__traverse': 7.20.5 dev: true - /babel-plugin-transform-hook-names@1.0.2(@babel/core@7.24.7): + /babel-plugin-transform-hook-names@1.0.2(@babel/core@7.24.9): resolution: {integrity: sha512-5gafyjyyBTTdX/tQQ0hRgu4AhNHG/hqWi0ZZmg2xvs2FgRkJXzDNKBZCyoYqgFkovfDrgM8OoKg8karoUvWeCw==} peerDependencies: '@babel/core': ^7.12.10 dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.9 dev: true /babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.5): @@ -4353,6 +4354,7 @@ packages: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 + dev: true /brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} @@ -4398,15 +4400,15 @@ packages: update-browserslist-db: 1.0.16(browserslist@4.23.0) dev: true - /browserslist@4.23.1: - resolution: {integrity: sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==} + /browserslist@4.23.2: + resolution: {integrity: sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001640 - electron-to-chromium: 1.4.818 - node-releases: 2.0.14 - update-browserslist-db: 1.1.0(browserslist@4.23.1) + caniuse-lite: 1.0.30001643 + electron-to-chromium: 1.5.0 + node-releases: 2.0.18 + update-browserslist-db: 1.1.0(browserslist@4.23.2) dev: true /bs-logger@0.2.6: @@ -4485,14 +4487,14 @@ packages: dev: false optional: true - /cacache@18.0.3: - resolution: {integrity: sha512-qXCd4rh6I07cnDqh8V48/94Tc/WSfj+o3Gn6NZ0aZovS255bUx8O13uKxRFd2eWG0xgsco7+YItQNPaa5E85hg==} + /cacache@18.0.4: + resolution: {integrity: sha512-B+L5iIa9mgcjLbliir2th36yEwPftrzteHYujzsx3dFP/31GCHcIeS8f5MGd80odLOjaOvSpU3EEAmRQptkxLQ==} engines: {node: ^16.14.0 || >=18.0.0} dependencies: '@npmcli/fs': 3.1.1 fs-minipass: 3.0.3 - glob: 10.4.3 - lru-cache: 10.4.0 + glob: 10.4.5 + lru-cache: 10.4.3 minipass: 7.1.2 minipass-collect: 2.0.1 minipass-flush: 1.0.5 @@ -4577,8 +4579,8 @@ packages: resolution: {integrity: sha512-WJvYsOjd1/BYUY6SNGUosK9DUidBPDTnOARHp3fSmFO1ekdxaY6nKRttEVrfMmYi80ctS0kz1wiWmm14fVc3ew==} dev: true - /caniuse-lite@1.0.30001640: - resolution: {integrity: sha512-lA4VMpW0PSUrFnkmVuEKBUovSWKhj7puyCg8StBChgu298N1AtuF1sKWEvfDuimSEDbhlb/KqPKC3fs1HbuQUA==} + /caniuse-lite@1.0.30001643: + resolution: {integrity: sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==} dev: true /capital-case@1.0.4: @@ -4986,6 +4988,7 @@ packages: /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true /concurrently@6.5.1: resolution: {integrity: sha512-FlSwNpGjWQfRwPLXvJ/OgysbBxPkWpiVjy1042b0U7on7S7qwwMIILRj7WTN1mTgqa582bG6NFuScOoh6Zgdag==} @@ -5738,8 +5741,8 @@ packages: resolution: {integrity: sha512-87eHF+h3PlCRwbxVEAw9KtK3v7lWfc/sUDr0W76955AdYTG4bV/k0zrl585Qnj/skRMH2qOSiE+kqMeOQ+LOpw==} dev: true - /electron-to-chromium@1.4.818: - resolution: {integrity: sha512-eGvIk2V0dGImV9gWLq8fDfTTsCAeMDwZqEPMr+jMInxZdnp9Us8UpovYpRCf9NQ7VOFgrN2doNSgvISbsbNpxA==} + /electron-to-chromium@1.5.0: + resolution: {integrity: sha512-Vb3xHHYnLseK8vlMJQKJYXJ++t4u1/qJ3vykuVrVjvdiOEhYyT1AuP4x03G8EnPmYvYOhe9T+dADTmthjRQMkA==} dev: true /emittery@0.13.1: @@ -6339,7 +6342,7 @@ packages: dev: true optional: true - /expect-webdriverio@4.14.0(typescript@5.5.3): + /expect-webdriverio@4.14.0(typescript@5.5.4): resolution: {integrity: sha512-bPZ9zfyJHF41dO8o7iFcEV4Dvcw45yhsv1WjtJyPLZPjQ+ixVBrbSil9+rjRiONoX4f45EZRCqaGvPlzNC523Q==} engines: {node: '>=16 || >=18 || >=20'} dependencies: @@ -6348,9 +6351,9 @@ packages: jest-matcher-utils: 29.7.0 lodash.isequal: 4.5.0 optionalDependencies: - '@wdio/globals': 8.39.1(typescript@5.5.3) + '@wdio/globals': 8.39.1(typescript@5.5.4) '@wdio/logger': 8.38.0 - webdriverio: 8.39.1(typescript@5.5.3) + webdriverio: 8.39.1(typescript@5.5.4) transitivePeerDependencies: - bufferutil - devtools @@ -6766,6 +6769,7 @@ packages: /foreground-child@3.2.1: resolution: {integrity: sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==} engines: {node: '>=14'} + requiresBuild: true dependencies: cross-spawn: 7.0.3 signal-exit: 4.1.0 @@ -6892,6 +6896,7 @@ packages: /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true /fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} @@ -7129,13 +7134,12 @@ packages: path-scurry: 1.11.1 dev: true - /glob@10.4.3: - resolution: {integrity: sha512-Q38SGlYRpVtDBPSWEylRyctn7uDeTp4NQERTLiCT1FqA9JXPYWqAVmQU6qh4r/zMM5ehxTcbaO8EjhWnvEhmyg==} - engines: {node: '>=18'} + /glob@10.4.5: + resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true dependencies: foreground-child: 3.2.1 - jackspeak: 3.4.1 + jackspeak: 3.4.3 minimatch: 9.0.5 minipass: 7.1.2 package-json-from-dist: 1.0.0 @@ -7162,6 +7166,7 @@ packages: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 + dev: true /glob@8.0.3: resolution: {integrity: sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==} @@ -7623,6 +7628,7 @@ packages: dependencies: once: 1.4.0 wrappy: 1.0.2 + dev: true /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -7641,6 +7647,11 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} dev: true + /ini@4.1.3: + resolution: {integrity: sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dev: false + /inquirer@9.2.12: resolution: {integrity: sha512-mg3Fh9g2zfuVWJn6lhST0O7x4n03k7G8Tx5nvikJkbq8/CK47WDVm+UznF0G6s5Zi0KcyUisr6DU8T67N5U+1Q==} engines: {node: '>=14.18.0'} @@ -8130,9 +8141,9 @@ packages: '@pkgjs/parseargs': 0.11.0 dev: true - /jackspeak@3.4.1: - resolution: {integrity: sha512-U23pQPDnmYybVkYjObcuYMk43VRlMLLqLI+RdZy8s8WV8WsxO9SnqSroKaluuvcNOdCAlauKszDwd+umbot5Mg==} - engines: {node: '>=18'} + /jackspeak@3.4.3: + resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + requiresBuild: true dependencies: '@isaacs/cliui': 8.0.2 optionalDependencies: @@ -9198,6 +9209,10 @@ packages: resolution: {integrity: sha512-bfJaPTuEiTYBu+ulDaeQ0F+uLmlfFkMgXj4cbwfuMSjgObGMzb55FMMbDvbRU0fAHZ4sLGkz2mKwcMg8Dvm8Ww==} engines: {node: '>=18'} + /lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + dev: false + /lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} dependencies: @@ -9294,7 +9309,7 @@ packages: engines: {node: ^16.14.0 || >=18.0.0} dependencies: '@npmcli/agent': 2.2.2 - cacache: 18.0.3 + cacache: 18.0.4 http-cache-semantics: 4.1.1 is-lambda: 1.0.1 minipass: 7.1.2 @@ -9501,6 +9516,7 @@ packages: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: brace-expansion: 1.1.11 + dev: true /minimatch@5.0.1: resolution: {integrity: sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==} @@ -9889,18 +9905,18 @@ packages: formdata-polyfill: 4.0.10 dev: true - /node-gyp@10.1.0: - resolution: {integrity: sha512-B4J5M1cABxPc5PwfjhbV5hoy2DP9p8lFXASnEN6hugXOa61416tnTZ29x9sSwAd0o99XNIcpvDDy1swAExsVKA==} + /node-gyp@10.2.0: + resolution: {integrity: sha512-sp3FonBAaFe4aYTcFdZUn2NYkbP7xroPGYvQmP4Nl5PxamznItBnNCgjrVTKrEfQynInMsJvZrdmqUnysCJ8rw==} engines: {node: ^16.14.0 || >=18.0.0} hasBin: true dependencies: env-paths: 2.2.1 exponential-backoff: 3.1.1 - glob: 10.4.3 + glob: 10.4.5 graceful-fs: 4.2.11 make-fetch-happen: 13.0.1 nopt: 7.2.1 - proc-log: 3.0.0 + proc-log: 4.2.0 semver: 7.6.2 tar: 6.2.1 which: 4.0.0 @@ -9940,6 +9956,10 @@ packages: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} dev: true + /node-releases@2.0.18: + resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} + dev: true + /node-source-walk@6.0.2: resolution: {integrity: sha512-jn9vOIK/nfqoFCcpK89/VCVaLg1IHE6UVfDOzvqmANaJ/rWCTEdH8RZ1V278nv2jr36BJdyQXIAavBLXpzdlag==} engines: {node: '>=14'} @@ -10026,8 +10046,8 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dev: false - /npm-package-arg@11.0.2: - resolution: {integrity: sha512-IGN0IAwmhDJwy13Wc8k+4PEbTPhpJnMtfR53ZbOyjkvmEcLS4nCwp6mvMWjS5sUjeiW3mpx6cHmuhKEu9XmcQw==} + /npm-package-arg@11.0.3: + resolution: {integrity: sha512-sHGJy8sOC1YraBywpzQlIKBE4pBbGbiF95U6Auspzyem956E0+FtDtsx1ZxlOJkQCZ1AFXAY/yuvtFYrOxF+Bw==} engines: {node: ^16.14.0 || >=18.0.0} dependencies: hosted-git-info: 7.0.2 @@ -10043,13 +10063,13 @@ packages: ignore-walk: 6.0.5 dev: false - /npm-pick-manifest@9.0.1: - resolution: {integrity: sha512-Udm1f0l2nXb3wxDpKjfohwgdFUSV50UVwzEIpDXVsbDMXVIEF81a/i0UhuQbhrPMMmdiq3+YMFLFIRVLs3hxQw==} + /npm-pick-manifest@9.1.0: + resolution: {integrity: sha512-nkc+3pIIhqHVQr085X9d2JzPzLyjzQS96zbruppqC9aZRm/x8xx6xhI98gHtsfELP2bE+loHq8ZaHFHhe+NauA==} engines: {node: ^16.14.0 || >=18.0.0} dependencies: npm-install-checks: 6.3.0 npm-normalize-package-bin: 3.0.1 - npm-package-arg: 11.0.2 + npm-package-arg: 11.0.3 semver: 7.6.2 dev: false @@ -10063,7 +10083,7 @@ packages: minipass: 7.1.2 minipass-fetch: 3.0.5 minizlib: 2.1.2 - npm-package-arg: 11.0.2 + npm-package-arg: 11.0.3 proc-log: 4.2.0 transitivePeerDependencies: - supports-color @@ -10148,6 +10168,7 @@ packages: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: wrappy: 1.0.2 + dev: true /onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} @@ -10343,23 +10364,24 @@ packages: /package-json-from-dist@1.0.0: resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==} + requiresBuild: true /pacote@18.0.6: resolution: {integrity: sha512-+eK3G27SMwsB8kLIuj4h1FUhHtwiEUo21Tw8wNjmvdlpOEr613edv+8FUsTj/4F/VN5ywGE19X18N7CC2EJk6A==} engines: {node: ^16.14.0 || >=18.0.0} hasBin: true dependencies: - '@npmcli/git': 5.0.7 + '@npmcli/git': 5.0.8 '@npmcli/installed-package-contents': 2.1.0 '@npmcli/package-json': 5.2.0 '@npmcli/promise-spawn': 7.0.2 '@npmcli/run-script': 8.1.0 - cacache: 18.0.3 + cacache: 18.0.4 fs-minipass: 3.0.3 minipass: 7.1.2 - npm-package-arg: 11.0.2 + npm-package-arg: 11.0.3 npm-packlist: 8.0.2 - npm-pick-manifest: 9.0.1 + npm-pick-manifest: 9.1.0 npm-registry-fetch: 17.1.0 proc-log: 4.2.0 promise-retry: 2.0.1 @@ -10456,6 +10478,7 @@ packages: /path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} + dev: true /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} @@ -10728,11 +10751,6 @@ packages: minimist: 1.2.8 dev: false - /proc-log@3.0.0: - resolution: {integrity: sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dev: false - /proc-log@4.2.0: resolution: {integrity: sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -10860,7 +10878,7 @@ packages: engines: {node: '>=6'} dev: true - /puppeteer-core@20.9.0(typescript@5.5.3): + /puppeteer-core@20.9.0(typescript@5.5.4): resolution: {integrity: sha512-H9fYZQzMTRrkboEfPmf7m3CLDN6JvbxXA3qTtS+dFt27tR+CsFHzPsT6pzp6lYL6bJbAPaR0HaPO6uSi+F94Pg==} engines: {node: '>=16.3.0'} peerDependencies: @@ -10869,12 +10887,12 @@ packages: typescript: optional: true dependencies: - '@puppeteer/browsers': 1.4.6(typescript@5.5.3) + '@puppeteer/browsers': 1.4.6(typescript@5.5.4) chromium-bidi: 0.4.16(devtools-protocol@0.0.1147663) cross-fetch: 4.0.0 debug: 4.3.4(supports-color@8.1.1) devtools-protocol: 0.0.1147663 - typescript: 5.5.3 + typescript: 5.5.4 ws: 8.13.0 transitivePeerDependencies: - bufferutil @@ -11808,6 +11826,7 @@ packages: /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + dev: true /sprintf-js@1.1.3: resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} @@ -12410,7 +12429,7 @@ packages: engines: {node: '>=14.16'} dev: true - /ts-jest@29.1.2(@babel/core@7.24.7)(jest@29.7.0)(typescript@5.4.5): + /ts-jest@29.1.2(@babel/core@7.24.9)(jest@29.7.0)(typescript@5.4.5): resolution: {integrity: sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==} engines: {node: ^16.10.0 || ^18.0.0 || >=20.0.0} hasBin: true @@ -12431,7 +12450,7 @@ packages: esbuild: optional: true dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.9 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 jest: 29.7.0(@types/node@18.19.33) @@ -12444,7 +12463,7 @@ packages: yargs-parser: 21.1.1 dev: true - /ts-node@10.9.2(@types/node@18.19.33)(typescript@5.5.3): + /ts-node@10.9.2(@types/node@18.19.33)(typescript@5.5.4): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true peerDependencies: @@ -12470,7 +12489,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.5.3 + typescript: 5.5.4 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true @@ -12645,8 +12664,8 @@ packages: hasBin: true dev: true - /typescript@5.5.3: - resolution: {integrity: sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==} + /typescript@5.5.4: + resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} engines: {node: '>=14.17'} hasBin: true dev: true @@ -12759,13 +12778,13 @@ packages: picocolors: 1.0.1 dev: true - /update-browserslist-db@1.1.0(browserslist@4.23.1): + /update-browserslist-db@1.1.0(browserslist@4.23.2): resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.23.1 + browserslist: 4.23.2 escalade: 3.1.2 picocolors: 1.0.1 dev: true @@ -13061,7 +13080,7 @@ packages: tmp-promise: 3.0.3 undici: 5.28.4 vscode-uri: 3.0.8 - webdriverio: 8.38.2(typescript@5.5.3) + webdriverio: 8.38.2(typescript@5.5.4) ws: 8.17.0 yargs-parser: 21.1.1 transitivePeerDependencies: @@ -13110,7 +13129,7 @@ packages: engines: {node: ^16.13 || >=18} requiresBuild: true dependencies: - '@types/node': 20.14.10 + '@types/node': 20.14.12 '@types/ws': 8.5.10 '@wdio/config': 8.39.0 '@wdio/logger': 8.38.0 @@ -13128,7 +13147,7 @@ packages: dev: true optional: true - /webdriverio@8.38.2(typescript@5.5.3): + /webdriverio@8.38.2(typescript@5.5.4): resolution: {integrity: sha512-r09y5UfivyYh5JOzT2SpJJ1zDmQl/R4OTH12opUqkjvp21BibCQm/uu1mrxGy4lzSHljrvqSVrrcGI+6UA1O8w==} engines: {node: ^16.13 || >=18} peerDependencies: @@ -13156,7 +13175,7 @@ packages: lodash.clonedeep: 4.5.0 lodash.zip: 4.2.0 minimatch: 9.0.4 - puppeteer-core: 20.9.0(typescript@5.5.3) + puppeteer-core: 20.9.0(typescript@5.5.4) query-selector-shadow-dom: 1.0.1 resq: 1.11.0 rgb2hex: 0.2.5 @@ -13170,7 +13189,7 @@ packages: - utf-8-validate dev: true - /webdriverio@8.39.1(typescript@5.5.3): + /webdriverio@8.39.1(typescript@5.5.4): resolution: {integrity: sha512-dPwLgLNtP+l4vnybz+YFxxH8nBKOP7j6VVzKtfDyTLDQg9rz3U8OA4xMMQCBucnrVXy3KcKxGqlnMa+c4IfWCQ==} engines: {node: ^16.13 || >=18} requiresBuild: true @@ -13199,7 +13218,7 @@ packages: lodash.clonedeep: 4.5.0 lodash.zip: 4.2.0 minimatch: 9.0.4 - puppeteer-core: 20.9.0(typescript@5.5.3) + puppeteer-core: 20.9.0(typescript@5.5.4) query-selector-shadow-dom: 1.0.1 resq: 1.11.0 rgb2hex: 0.2.5 @@ -13401,6 +13420,7 @@ packages: /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true /write-file-atomic@4.0.2: resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} @@ -13504,14 +13524,6 @@ packages: hasBin: true dev: true - /yamljs@0.3.0: - resolution: {integrity: sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ==} - hasBin: true - dependencies: - argparse: 1.0.10 - glob: 7.2.3 - dev: false - /yargs-parser@20.2.4: resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} engines: {node: '>=10'}