From 08e7254ce3cafec856ec49312e57a1a10a634793 Mon Sep 17 00:00:00 2001 From: zFernand0 <37381190+zFernand0@users.noreply.github.com> Date: Sat, 23 Mar 2024 13:02:05 -0400 Subject: [PATCH 1/9] feat: Enable transaction (no tests yet) Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com> --- package-lock.json | 7 +-- package.json | 2 +- packages/cli/src/-strings-/en.ts | 18 ++++++- packages/cli/src/enable/Enable.definition.ts | 5 +- .../transaction/Transaction.definition.ts | 48 +++++++++++++++++++ .../enable/transaction/Transaction.handler.ts | 46 ++++++++++++++++++ packages/sdk/src/doc/IBaseParms.ts | 28 +++++++++++ packages/sdk/src/doc/ICSDGroupParms.ts | 18 +------ packages/sdk/src/doc/IProgramParms.ts | 18 +------ packages/sdk/src/doc/IResourceParms.ts | 17 +------ packages/sdk/src/doc/ITransactionParms.ts | 19 +------- packages/sdk/src/doc/IURIMapParms.ts | 18 +------ packages/sdk/src/doc/IWebServiceParms.ts | 18 +------ packages/sdk/src/doc/index.ts | 1 + packages/sdk/src/methods/enable/Enable.ts | 44 +++++++++++++++-- .../enableTransactionCommand.ts | 32 +------------ 16 files changed, 204 insertions(+), 135 deletions(-) create mode 100644 packages/cli/src/enable/transaction/Transaction.definition.ts create mode 100644 packages/cli/src/enable/transaction/Transaction.handler.ts create mode 100644 packages/sdk/src/doc/IBaseParms.ts diff --git a/package-lock.json b/package-lock.json index 33835e59..67c33279 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ ], "devDependencies": { "@types/glob": "^7.2.0", - "@types/jest": "^29.5.0", + "@types/jest": "^29.5.12", "@types/node": "^18.18.2", "@types/uuid": "^9.0.1", "@types/xml2js": "^0.4.4", @@ -3500,9 +3500,10 @@ } }, "node_modules/@types/jest": { - "version": "29.5.1", + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", "dev": true, - "license": "MIT", "dependencies": { "expect": "^29.0.0", "pretty-format": "^29.0.0" diff --git a/package.json b/package.json index 295ee869..04a1a590 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "@types/glob": "^7.2.0", - "@types/jest": "^29.5.0", + "@types/jest": "^29.5.12", "@types/node": "^18.18.2", "@types/uuid": "^9.0.1", "@types/xml2js": "^0.4.4", diff --git a/packages/cli/src/-strings-/en.ts b/packages/cli/src/-strings-/en.ts index 94208338..460205f8 100644 --- a/packages/cli/src/-strings-/en.ts +++ b/packages/cli/src/-strings-/en.ts @@ -308,8 +308,24 @@ export default { }, ENABLE: { SUMMARY: "Enable resources from CICS", - DESCRIPTION: "Enable resources (for example, urimaps) from CICS through IBM CMCI.", + DESCRIPTION: "Enable resources from CICS through IBM CMCI.", RESOURCES: { + TRANSACTION: { + DESCRIPTION: "Enable a transaction from CICS.", + POSITIONALS: { + NAME: "The name of the transaction to enable. The maximum length is four characters." + }, + OPTIONS: { + REGIONNAME: "The CICS region name in which to enable the transaction", + CICSPLEX: "The name of the CICSPlex to which to enable the transaction" + }, + MESSAGES: { + SUCCESS: "The transaction '%s' was enabled successfully." + }, + EXAMPLES: { + EX1: "Enable a transaction named TRN1 from the region named MYREGION" + } + }, URIMAP: { DESCRIPTION: "Enable a urimap from CICS.", POSITIONALS: { diff --git a/packages/cli/src/enable/Enable.definition.ts b/packages/cli/src/enable/Enable.definition.ts index 0dd0d448..5b0caf55 100644 --- a/packages/cli/src/enable/Enable.definition.ts +++ b/packages/cli/src/enable/Enable.definition.ts @@ -14,6 +14,7 @@ import { UrimapDefinition } from "./urimap/Urimap.definition"; import i18nTypings from "../-strings-/en"; import { CicsSession } from "../CicsSession"; +import { TransactionDefinition } from "./transaction/Transaction.definition"; // Does not use the import in anticipation of some internationalization work to be done later. const strings = (require("../-strings-/en").default as typeof i18nTypings).ENABLE; @@ -27,7 +28,9 @@ const definition: ICommandDefinition = { description: strings.DESCRIPTION, type: "group", children: [ - UrimapDefinition], + TransactionDefinition, + UrimapDefinition + ], passOn: [ { property: "options", diff --git a/packages/cli/src/enable/transaction/Transaction.definition.ts b/packages/cli/src/enable/transaction/Transaction.definition.ts new file mode 100644 index 00000000..89c6ba14 --- /dev/null +++ b/packages/cli/src/enable/transaction/Transaction.definition.ts @@ -0,0 +1,48 @@ +/** + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License v2.0 which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Copyright Contributors to the Zowe Project. + * + */ + +import { ICommandDefinition } from "@zowe/imperative"; + +import i18nTypings from "../../-strings-/en"; + +// Does not use the import in anticipation of some internationalization work to be done later. +const strings = (require("../../-strings-/en").default as typeof i18nTypings).ENABLE.RESOURCES.TRANSACTION; + +export const TransactionDefinition: ICommandDefinition = { + name: "transaction", + aliases: ["tran"], + description: strings.DESCRIPTION, + handler: __dirname + "/Transaction.handler", + type: "command", + positionals: [{ + name: "name", + description: strings.POSITIONALS.NAME, + type: "string", + required: true + }], + options: [ + { + name: "region-name", + description: strings.OPTIONS.REGIONNAME, + type: "string" + }, + { + name: "cics-plex", + description: strings.OPTIONS.CICSPLEX, + type: "string" + }, + ], + profile: {optional: ["cics"]}, + examples: [{ + description: strings.EXAMPLES.EX1, + options: "TRN1 --region-name MYREGION" + }] +}; diff --git a/packages/cli/src/enable/transaction/Transaction.handler.ts b/packages/cli/src/enable/transaction/Transaction.handler.ts new file mode 100644 index 00000000..add137a7 --- /dev/null +++ b/packages/cli/src/enable/transaction/Transaction.handler.ts @@ -0,0 +1,46 @@ +/** + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License v2.0 which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Copyright Contributors to the Zowe Project. + * + */ + +import { AbstractSession, IHandlerParameters, ITaskWithStatus, TaskStage } from "@zowe/imperative"; +import { ICMCIApiResponse, enableTransaction } from "@zowe/cics-for-zowe-sdk"; +import { CicsBaseHandler } from "../../CicsBaseHandler"; + +import i18nTypings from "../../-strings-/en"; + +// Does not use the import in anticipation of some internationalization work to be done later. +const strings = (require("../../-strings-/en").default as typeof i18nTypings).ENABLE.RESOURCES.TRANSACTION; + +/** + * Command handler for enabling CICS Transactions via CMCI + * @export + * @class TransactionHandler + * @implements {ICommandHandler} + */ +export default class TransactionHandler extends CicsBaseHandler { + public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { + + const status: ITaskWithStatus = { + statusMessage: "Enabling Transaction from CICS", + percentComplete: 0, + stageName: TaskStage.IN_PROGRESS + }; + params.response.progress.startBar({task: status}); + + const response = await enableTransaction(session, { + name: params.arguments.name, + regionName: params.arguments.regionName, + cicsPlex: params.arguments.cicsPlex + }); + + params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.name); + return response; + } +} diff --git a/packages/sdk/src/doc/IBaseParms.ts b/packages/sdk/src/doc/IBaseParms.ts new file mode 100644 index 00000000..b5007bfb --- /dev/null +++ b/packages/sdk/src/doc/IBaseParms.ts @@ -0,0 +1,28 @@ +/** + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License v2.0 which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Copyright Contributors to the Zowe Project. + * + */ + +export interface IBaseParms { + /** + * The name of resource + * Up to eight characters long + */ + name: string; + + /** + * The name of the CICS region + */ + regionName: string; + + /** + * The name of the CICS Plex + */ + cicsPlex?: string; +} diff --git a/packages/sdk/src/doc/ICSDGroupParms.ts b/packages/sdk/src/doc/ICSDGroupParms.ts index 99ca3cb3..73534a4b 100644 --- a/packages/sdk/src/doc/ICSDGroupParms.ts +++ b/packages/sdk/src/doc/ICSDGroupParms.ts @@ -9,26 +9,12 @@ * */ -export interface ICSDGroupParms { - /** - * The name of the CSD Group - * Up to eight characters long - */ - name: string; +import { IBaseParms } from "./IBaseParms"; +export interface ICSDGroupParms extends IBaseParms { /** * CSD list name for the CSD Group * Up to eight characters long */ csdList: string; - - /** - * The name of the CICS region of the CSD List - */ - regionName: string; - - /** - * CICS Plex of the CSD List - */ - cicsPlex?: string; } diff --git a/packages/sdk/src/doc/IProgramParms.ts b/packages/sdk/src/doc/IProgramParms.ts index 2c3774a1..90dc1334 100644 --- a/packages/sdk/src/doc/IProgramParms.ts +++ b/packages/sdk/src/doc/IProgramParms.ts @@ -9,26 +9,12 @@ * */ -export interface IProgramParms { - /** - * The name of the program - * Up to eight characters long - */ - name: string; +import { IBaseParms } from "./IBaseParms"; +export interface IProgramParms extends IBaseParms { /** * CSD group for the program * Up to eight characters long */ csdGroup?: string; - - /** - * The name of the CICS region of the program - */ - regionName: string; - - /** - * CICS Plex of the program - */ - cicsPlex?: string; } diff --git a/packages/sdk/src/doc/IResourceParms.ts b/packages/sdk/src/doc/IResourceParms.ts index 23145c1b..6b9ad6c1 100644 --- a/packages/sdk/src/doc/IResourceParms.ts +++ b/packages/sdk/src/doc/IResourceParms.ts @@ -9,12 +9,9 @@ * */ -export interface IResourceParms { - /** - * The name of the resource - */ - name: string; +import { IBaseParms } from "./IBaseParms"; +export interface IResourceParms extends IBaseParms { /** * Criteria by which to filter the records * @@ -33,14 +30,4 @@ export interface IResourceParms { * "CSDGROUP(D*)" */ parameter?: string; - - /** - * The name of the CICS region of the program - */ - regionName: string; - - /** - * CICS Plex of the program - */ - cicsPlex?: string; } diff --git a/packages/sdk/src/doc/ITransactionParms.ts b/packages/sdk/src/doc/ITransactionParms.ts index bbf6cfa0..fbe204ab 100644 --- a/packages/sdk/src/doc/ITransactionParms.ts +++ b/packages/sdk/src/doc/ITransactionParms.ts @@ -9,13 +9,9 @@ * */ -export interface ITransactionParms { - /** - * The name of the transaction to define - * Up to four characters long - */ - name: string; +import { IBaseParms } from "./IBaseParms"; +export interface ITransactionParms extends IBaseParms { /** * The name of the program to associate to the transaction * Up to eight characters long @@ -27,15 +23,4 @@ export interface ITransactionParms { * Up to eight characters long */ csdGroup?: string; - - /** - * The name of the CICS region to define the transaction to - */ - regionName: string; - - /** - * CICS Plex to define the new transaction to - */ - cicsPlex?: string; - } diff --git a/packages/sdk/src/doc/IURIMapParms.ts b/packages/sdk/src/doc/IURIMapParms.ts index 55df70a4..697fa5ea 100644 --- a/packages/sdk/src/doc/IURIMapParms.ts +++ b/packages/sdk/src/doc/IURIMapParms.ts @@ -9,13 +9,9 @@ * */ -export interface IURIMapParms { - /** - * The name of the URIMap - * Up to eight characters long - */ - name: string; +import { IBaseParms } from "./IBaseParms"; +export interface IURIMapParms extends IBaseParms { /** * CSD group for the URIMap * Up to eight characters long @@ -82,16 +78,6 @@ export interface IURIMapParms { */ webserviceName?: string; - /** - * The name of the CICS region of the URIMap - */ - regionName: string; - - /** - * CICS Plex of the URIMap - */ - cicsPlex?: string; - /** * Enable attribute of the URIMap */ diff --git a/packages/sdk/src/doc/IWebServiceParms.ts b/packages/sdk/src/doc/IWebServiceParms.ts index cf8746ee..546047ef 100644 --- a/packages/sdk/src/doc/IWebServiceParms.ts +++ b/packages/sdk/src/doc/IWebServiceParms.ts @@ -9,13 +9,9 @@ * */ -export interface IWebServiceParms { - /** - * The name of the web service - * Up to eight characters long - */ - name: string; +import { IBaseParms } from "./IBaseParms"; +export interface IWebServiceParms extends IBaseParms { /** * CSD group for the web service * Up to eight characters long @@ -51,14 +47,4 @@ export interface IWebServiceParms { * Should be a fully qualified file name */ wsdlFile?: string; - - /** - * The name of the CICS region of the web service - */ - regionName: string; - - /** - * CICS Plex of the web service - */ - cicsPlex?: string; } diff --git a/packages/sdk/src/doc/index.ts b/packages/sdk/src/doc/index.ts index 084dcaa8..ac49a30e 100644 --- a/packages/sdk/src/doc/index.ts +++ b/packages/sdk/src/doc/index.ts @@ -9,6 +9,7 @@ * */ +export * from "./IBaseParms"; export * from "./ICMCIApiResponse"; export * from "./ICMCIResponseResultSummary"; export * from "./ICSDGroupParms"; diff --git a/packages/sdk/src/methods/enable/Enable.ts b/packages/sdk/src/methods/enable/Enable.ts index 91f0cc41..2845e067 100644 --- a/packages/sdk/src/methods/enable/Enable.ts +++ b/packages/sdk/src/methods/enable/Enable.ts @@ -12,7 +12,7 @@ import { AbstractSession, ImperativeExpect, Logger } from "@zowe/imperative"; import { CicsCmciRestClient } from "../../rest"; import { CicsCmciConstants } from "../../constants"; -import { ICMCIApiResponse, IURIMapParms } from "../../doc"; +import { IBaseParms, ICMCIApiResponse, IURIMapParms } from "../../doc"; /** * Enable a URIMap installed in CICS through CMCI REST API @@ -21,11 +21,9 @@ import { ICMCIApiResponse, IURIMapParms } from "../../doc"; * @returns {Promise} promise that resolves to the response (XML parsed into a javascript object) * when the request is complete * @throws {ImperativeError} CICS URIMap name not defined or blank - * @throws {ImperativeError} CICS CSD group not defined or blank * @throws {ImperativeError} CICS region name not defined or blank * @throws {ImperativeError} CicsCmciRestClient request fails */ - export async function enableUrimap(session: AbstractSession, parms: IURIMapParms): Promise { ImperativeExpect.toBeDefinedAndNonBlank(parms.name, "CICS URIMap name", "CICS URIMap name is required"); ImperativeExpect.toBeDefinedAndNonBlank(parms.regionName, "CICS Region name", "CICS region name is required"); @@ -49,3 +47,43 @@ export async function enableUrimap(session: AbstractSession, parms: IURIMapParms }; return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); } + +/** + * Enable a transaction installed in CICS through CMCI REST API + * @param {AbstractSession} session - the session to connect to CMCI with + * @param {IURIMapParms} parms - parameters for enabling your transaction + * @returns {Promise} promise that resolves to the response (XML parsed into a javascript object) + * when the request is complete + * @throws {ImperativeError} CICS Transaction name not defined or blank + * @throws {ImperativeError} CICS Region name not defined or blank + * @throws {ImperativeError} CicsCmciRestClient request fails + */ +export async function enableTransaction(session: AbstractSession, parms: IBaseParms): Promise { + ImperativeExpect.toBeDefinedAndNonBlank(parms.name, "CICS Transaction name", "CICS Transaction name is required"); + ImperativeExpect.toBeDefinedAndNonBlank(parms.regionName, "CICS Region name", "CICS region name is required"); + const requestBody: any = { + request: { + action: { + $: { + name: "ENABLE", + }, + }, + }, + }; + + const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_LOCAL_TRANSACTION + + "/" + + cicsPlex + + parms.regionName + + "?CRITERIA=(TRANID=" + + parms.name + + ")"; + + return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); +} + diff --git a/packages/vsce/src/commands/enableCommands/enableTransactionCommand.ts b/packages/vsce/src/commands/enableCommands/enableTransactionCommand.ts index b1509c0f..0bd64770 100644 --- a/packages/vsce/src/commands/enableCommands/enableTransactionCommand.ts +++ b/packages/vsce/src/commands/enableCommands/enableTransactionCommand.ts @@ -9,8 +9,6 @@ * */ -import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse } from "@zowe/cics-for-zowe-sdk"; -import { imperative } from "@zowe/zowe-explorer-api"; import { commands, ProgressLocation, TreeView, window } from "vscode"; import { CICSRegionTree } from "../../trees/CICSRegionTree"; import { CICSTree } from "../../trees/CICSTree"; @@ -19,6 +17,7 @@ import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer"; import { findSelectedNodes } from "../../utils/commandUtils"; import { CICSTransactionTreeItem } from "../../trees/treeItems/CICSTransactionTreeItem"; import { CICSCombinedTransactionsTree } from "../../trees/CICSCombinedTrees/CICSCombinedTransactionTree"; +import { enableTransaction } from "@zowe/cics-for-zowe-sdk"; export function getEnableTransactionCommand(tree: CICSTree, treeview: TreeView) { return commands.registerCommand("cics-extension-for-zowe.enableTransaction", async (clickedNode) => { @@ -97,31 +96,4 @@ export function getEnableTransactionCommand(tree: CICSTree, treeview: TreeView { - const requestBody: any = { - request: { - action: { - $: { - name: "ENABLE", - }, - }, - }, - }; - - const cicsPlex = parms.cicsPlex === undefined ? "" : parms.cicsPlex + "/"; - const cmciResource = - "/" + - CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + - "/" + - CicsCmciConstants.CICS_LOCAL_TRANSACTION + - "/" + - cicsPlex + - parms.regionName + - "?CRITERIA=(TRANID=" + - parms.name + - ")"; - - return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); -} +} \ No newline at end of file From 27e51f468a9375e4c6d20fa4655bd13e62257bc5 Mon Sep 17 00:00:00 2001 From: zFernand0 <37381190+zFernand0@users.noreply.github.com> Date: Sun, 24 Mar 2024 07:54:58 -0400 Subject: [PATCH 2/9] format: add prettier Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com> --- .prettierrc.yaml | 9 + package.json | 1 + .../cli/__mocks__/@zowe/cli-test-utils.ts | 18 +- .../__src__/ITestPropertiesSchema.ts | 53 +- .../cli.add-to-list.csdGroup.system.test.ts | 9 +- .../program/cli.define.program.system.test.ts | 33 +- .../cli.define.transaction.system.test.ts | 51 +- .../cli.define.urimap.client.system.test.ts | 63 ++- .../cli.define.urimap.pipeline.system.test.ts | 75 ++- .../cli.define.urimap.server.system.test.ts | 76 ++- .../cli.define.webservice.system.test.ts | 95 ++-- .../program/cli.delete.program.system.test.ts | 57 ++- .../cli.delete.transaction.system.test.ts | 62 +-- .../urimap/cli.delete.urimap.system.test.ts | 213 ++++---- .../cli.delete.webservice.system.test.ts | 63 +-- .../urimap/cli.disable.urimap.system.test.ts | 483 +++++++++--------- .../cli.discard.program.system.test.ts | 85 +-- .../cli.discard.transaction.system.test.ts | 92 ++-- .../urimap/cli.discard.urimap.system.test.ts | 351 +++++++------ .../urimap/cli.enable.urimap.system.test.ts | 3 +- .../resource/cli.get.resource.system.test.ts | 25 +- .../cli.install.program.system.test.ts | 72 +-- .../cli.install.transaction.system.test.ts | 74 +-- .../urimap/cli.install.urimap.system.test.ts | 3 +- .../cli.refresh.program.system.test.ts | 25 +- ...i.remove-from-list.csdGroup.system.test.ts | 61 +-- .../AddToList.definition.unit.test.ts | 2 +- .../csdGroup/CSDGroup.definition.unit.test.ts | 2 +- .../csdGroup/CSDGroup.handler.unit.test.ts | 26 +- .../define/Define.definition.unit.test.ts | 2 +- .../program/Program.definition.unit.test.ts | 2 +- .../program/Program.handler.unit.test.ts | 26 +- .../Transaction.definition.unit.test.ts | 2 +- .../Transaction.handler.unit.test.ts | 26 +- .../UrimapClient.definition.unit.test.ts | 2 +- .../UrimapClient.handler.unit.test.ts | 26 +- .../UrimapPipeline.definition.unit.test.ts | 2 +- .../UrimapPipeline.handler.unit.test.ts | 34 +- .../UrimapServer.definition.unit.test.ts | 2 +- .../UrimapServer.handler.unit.test.ts | 26 +- .../Webservice.definition.unit.test.ts | 2 +- .../Webservice.handler.unit.test.ts | 26 +- .../delete/Delete.definition.unit.test.ts | 2 +- .../program/Program.definition.unit.test.ts | 2 +- .../program/Program.handler.unit.test.ts | 26 +- .../Transaction.definition.unit.test.ts | 2 +- .../Transaction.handler.unit.test.ts | 26 +- .../urimap/Urimap.definition.unit.test.ts | 2 +- .../delete/urimap/Urimap.handler.unit.test.ts | 26 +- .../webservice/Webservice.definition.test.ts | 2 +- .../webservice/Webservice.handler.test.ts | 26 +- .../disable/Disable.definition.unit.test.ts | 2 +- .../urimap/Urimap.definition.unit.test.ts | 2 +- .../urimap/Urimap.handler.unit.test.ts | 26 +- .../discard/Discard.definition.unit.test.ts | 2 +- .../program/Program.definition.unit.test.ts | 2 +- .../program/Program.handler.unit.test.ts | 26 +- .../Transaction.definition.unit.test.ts | 2 +- .../Transaction.handler.unit.test.ts | 26 +- .../urimap/Urimap.definition.unit.test.ts | 2 +- .../urimap/Urimap.handler.unit.test.ts | 26 +- .../enable/Enable.definition.unit.test.ts | 2 +- .../urimap/Urimap.definition.unit.test.ts | 2 +- .../enable/urimap/Urimap.handler.unit.test.ts | 26 +- .../__unit__/get/Get.definition.unit.test.ts | 2 +- .../resource/Resource.definition.unit.test.ts | 2 +- .../resource/Resource.handler.unit.test.ts | 28 +- .../install/Install.definition.unit.test.ts | 2 +- .../program/Program.definition.unit.test.ts | 2 +- .../program/Program.handler.unit.test.ts | 26 +- .../Transaction.definition.unit.test.ts | 2 +- .../Transaction.handler.unit.test.ts | 26 +- .../urimap/Urimap.definition.unit.test.ts | 2 +- .../urimap/Urimap.handler.unit.test.ts | 26 +- .../refresh/Refresh.definition.unit.test.ts | 2 +- .../program/Program.definition.unit.test.ts | 2 +- .../program/Program.handler.unit.test.ts | 24 +- .../RemoveFromList.definition.unit.test.ts | 2 +- .../csdGroup/CSDGroup.definition.unit.test.ts | 2 +- .../csdGroup/CSDGroup.handler.unit.test.ts | 26 +- packages/cli/__tests__/imperative.test.ts | 3 +- packages/cli/package.json | 1 + packages/cli/src/-strings-/en.ts | 323 ++++++------ packages/cli/src/-strings-/es.ts | 14 +- packages/cli/src/CicsBaseHandler.ts | 35 +- packages/cli/src/CicsSession.ts | 79 +-- packages/cli/src/PluginConstants.ts | 13 +- .../src/add-to-list/AddToList.definition.ts | 11 +- .../csdGroup/CSDGroup.definition.ts | 44 +- .../add-to-list/csdGroup/CSDGroup.handler.ts | 7 +- packages/cli/src/define/Define.definition.ts | 17 +- .../src/define/program/Program.definition.ts | 47 +- .../cli/src/define/program/Program.handler.ts | 7 +- .../transaction/Transaction.definition.ts | 58 ++- .../define/transaction/Transaction.handler.ts | 7 +- .../urimap-client/UrimapClient.definition.ts | 58 ++- .../urimap-client/UrimapClient.handler.ts | 7 +- .../UrimapPipeline.definition.ts | 62 ++- .../urimap-pipeline/UrimapPipeline.handler.ts | 7 +- .../urimap-server/UrimapServer.definition.ts | 58 ++- .../urimap-server/UrimapServer.handler.ts | 7 +- .../webservice/Webservice.definition.ts | 54 +- .../define/webservice/Webservice.handler.ts | 21 +- packages/cli/src/delete/Delete.definition.ts | 16 +- .../src/delete/program/Program.definition.ts | 47 +- .../cli/src/delete/program/Program.handler.ts | 7 +- .../transaction/Transaction.definition.ts | 47 +- .../delete/transaction/Transaction.handler.ts | 7 +- .../src/delete/urimap/Urimap.definition.ts | 49 +- .../cli/src/delete/urimap/Urimap.handler.ts | 5 +- .../webservice/Webservice.definition.ts | 49 +- .../delete/webservice/Webservice.handler.ts | 5 +- .../cli/src/disable/Disable.definition.ts | 11 +- .../src/disable/urimap/Urimap.definition.ts | 38 +- .../cli/src/disable/urimap/Urimap.handler.ts | 5 +- .../cli/src/discard/Discard.definition.ts | 15 +- .../src/discard/program/Program.definition.ts | 36 +- .../src/discard/program/Program.handler.ts | 7 +- .../transaction/Transaction.definition.ts | 36 +- .../transaction/Transaction.handler.ts | 7 +- .../src/discard/urimap/Urimap.definition.ts | 38 +- .../cli/src/discard/urimap/Urimap.handler.ts | 7 +- packages/cli/src/enable/Enable.definition.ts | 16 +- .../transaction/Transaction.definition.ts | 30 +- .../enable/transaction/Transaction.handler.ts | 7 +- .../src/enable/urimap/Urimap.definition.ts | 38 +- .../cli/src/enable/urimap/Urimap.handler.ts | 7 +- packages/cli/src/get/Get.definition.ts | 8 +- .../src/get/resource/Resource.definition.ts | 64 ++- .../cli/src/get/resource/Resource.handler.ts | 9 +- packages/cli/src/imperative.ts | 19 +- .../cli/src/install/Install.definition.ts | 15 +- .../src/install/program/Program.definition.ts | 47 +- .../src/install/program/Program.handler.ts | 7 +- .../transaction/Transaction.definition.ts | 47 +- .../transaction/Transaction.handler.ts | 7 +- .../src/install/urimap/Urimap.definition.ts | 49 +- .../cli/src/install/urimap/Urimap.handler.ts | 7 +- .../cli/src/refresh/Refresh.definition.ts | 11 +- .../src/refresh/program/Program.definition.ts | 36 +- .../src/refresh/program/Program.handler.ts | 7 +- .../RemoveFromList.definition.ts | 11 +- .../csdGroup/CSDGroup.definition.ts | 44 +- .../csdGroup/CSDGroup.handler.ts | 7 +- .../__src__/ITestPropertiesSchema.ts | 53 +- .../AddToList.csdGroup.system.test.ts | 5 +- .../define/Define.program.system.test.ts | 5 +- .../define/Define.transaction.system.test.ts | 5 +- .../Define.urimap-client.system.test.ts | 5 +- .../Define.urimap-pipeline.system.test.ts | 5 +- .../Define.urimap-server.system.test.ts | 5 +- .../define/Define.webservice.system.test.ts | 5 +- .../delete/Delete.program.system.test.ts | 5 +- .../delete/Delete.transaction.system.test.ts | 5 +- .../delete/Delete.urimap.system.test.ts | 5 +- .../delete/Delete.webservice.system.test.ts | 7 +- .../disable/Disable.urimap.system.test.ts | 18 +- .../discard/Discard.program.system.test.ts | 5 +- .../Discard.transaction.system.test.ts | 5 +- .../discard/Discard.urimap.system.test.ts | 8 +- .../enable/Enable.urimap.system.test.ts | 18 +- .../get/Get.resource.system.test.ts | 5 +- .../install/Install.program.system.test.ts | 5 +- .../Install.transaction.system.test.ts | 5 +- .../install/Install.urimap.system.test.ts | 8 +- .../refresh/Refresh.program.system.test.ts | 5 +- .../RemoveFromList.csdGroup.system.test.ts | 5 +- .../__unit__/CicsCmciRestClient.unit.test.ts | 65 ++- .../AddToList.csdGroup.unit.test.ts | 71 ++- .../define/Define.program.unit.test.ts | 39 +- .../define/Define.transaction.unit.test.ts | 45 +- .../define/Define.urimap-client.unit.test.ts | 56 +- .../Define.urimap-pipeline.unit.test.ts | 60 +-- .../define/Define.urimap-server.unit.test.ts | 60 +-- .../define/Define.webservice.unit.test.ts | 51 +- .../delete/Delete.program.unit.test.ts | 59 ++- .../delete/Delete.transaction.unit.test.ts | 61 ++- .../delete/Delete.urimap.unit.test.ts | 24 +- .../delete/Delete.webservice.unit.test.ts | 24 +- .../disable/Disable.urimap.unit.test.ts | 28 +- .../discard/Discard.program.unit.test.ts | 53 +- .../discard/Discard.transaction.unit.test.ts | 63 ++- .../discard/Discard.urimap.unit.test.ts | 24 +- .../enable/Enable.urimap.unit.test.ts | 28 +- .../__unit__/get/Get.resource.unit.test.ts | 50 +- .../install/Install.program.unit.test.ts | 71 ++- .../install/Install.transaction.unit.test.ts | 74 ++- .../install/Install.urimap.unit.test.ts | 30 +- .../refresh/Refresh.program.unit.test.ts | 59 ++- .../RemoveFromList.csdGroup.unit.test.ts | 67 ++- packages/sdk/package.json | 1 + .../sdk/src/constants/CicsCmci.constants.ts | 65 ++- .../sdk/src/constants/CicsCmci.messages.ts | 5 +- packages/sdk/src/doc/IBaseParms.ts | 14 +- packages/sdk/src/doc/ICMCIApiResponse.ts | 18 +- packages/sdk/src/doc/ICSDGroupParms.ts | 6 +- packages/sdk/src/doc/IProgramParms.ts | 6 +- packages/sdk/src/doc/IResourceParms.ts | 26 +- packages/sdk/src/doc/ITransactionParms.ts | 12 +- packages/sdk/src/doc/IURIMapParms.ts | 76 +-- packages/sdk/src/doc/IWebServiceParms.ts | 36 +- .../sdk/src/methods/add-to-list/AddToList.ts | 24 +- packages/sdk/src/methods/define/Define.ts | 80 ++- packages/sdk/src/methods/delete/Delete.ts | 44 +- packages/sdk/src/methods/disable/Disable.ts | 21 +- packages/sdk/src/methods/discard/Discard.ts | 39 +- packages/sdk/src/methods/enable/Enable.ts | 22 +- packages/sdk/src/methods/get/Get.ts | 3 +- packages/sdk/src/methods/install/Install.ts | 64 ++- .../remove-from-list/RemoveFromList.ts | 16 +- packages/sdk/src/methods/set/Set.ts | 20 +- packages/sdk/src/rest/CicsCmciRestClient.ts | 50 +- packages/vsce/package.json | 1 + .../disableCommands/disableProgramCommand.ts | 5 +- .../enableCommands/enableLocalFileCommand.ts | 5 +- .../enableCommands/enableProgramCommand.ts | 5 +- .../enableTransactionCommand.ts | 2 +- .../vsce/src/commands/openLocalFileCommand.ts | 5 +- .../CICSCombinedLibraryTree.ts | 5 +- .../CICSCombinedLocalFileTree.ts | 5 +- .../CICSCombinedPipelineTree.ts | 5 +- .../CICSCombinedProgramTree.ts | 5 +- .../CICSCombinedTCPIPServiceTree.ts | 5 +- .../CICSCombinedTrees/CICSCombinedTaskTree.ts | 5 +- .../CICSCombinedTransactionTree.ts | 5 +- .../CICSCombinedURIMapTree.ts | 5 +- .../CICSCombinedWebServiceTree.ts | 5 +- packages/vsce/src/trees/CICSLibraryTree.ts | 10 +- packages/vsce/src/trees/CICSLocalFileTree.ts | 10 +- packages/vsce/src/trees/CICSPlexTree.ts | 5 +- packages/vsce/src/trees/CICSProgramTree.ts | 10 +- .../vsce/src/trees/CICSRegionsContainer.ts | 10 +- packages/vsce/src/trees/CICSSessionTree.ts | 5 +- packages/vsce/src/trees/CICSTaskTree.ts | 10 +- .../vsce/src/trees/CICSTransactionTree.ts | 10 +- packages/vsce/src/trees/CICSTree.ts | 14 +- packages/vsce/src/trees/CICSWebTree.ts | 5 +- .../trees/treeItems/CICSLibraryDatasets.ts | 5 +- .../trees/treeItems/CICSLibraryTreeItem.ts | 5 +- .../trees/treeItems/CICSLocalFileTreeItem.ts | 17 +- .../trees/treeItems/CICSProgramTreeItem.ts | 11 +- .../src/trees/treeItems/CICSTaskTreeItem.ts | 8 +- .../trees/treeItems/web/CICSPipelineTree.ts | 10 +- .../treeItems/web/CICSTCPIPServiceTree.ts | 10 +- .../src/trees/treeItems/web/CICSURIMapTree.ts | 10 +- .../trees/treeItems/web/CICSWebServiceTree.ts | 10 +- packages/vsce/src/utils/profileDefinition.ts | 2 +- packages/vsce/src/utils/profileManagement.ts | 8 +- packages/vsce/src/utils/profileUtils.ts | 11 +- packages/vsce/src/utils/webviewHTML.ts | 8 +- turbo.json | 3 + 251 files changed, 3806 insertions(+), 3137 deletions(-) create mode 100644 .prettierrc.yaml diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 00000000..ce886122 --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,9 @@ +printWidth: 150 +tabWidth: 2 +useTabs: false +semi: true +singleQuote: false +trailingComma: "es5" +bracketSpacing: true +arrowParens: "always" +experimentalTernaries: true diff --git a/package.json b/package.json index 04a1a590..e5a5ec89 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "lint": "npm run lint --workspaces", "lintErrors": "npm run lintErrors --workspaces", "prepare": "husky install", + "pretty": "turbo pretty", "license": "node scripts/updateLicenses.js" }, "devDependencies": { diff --git a/packages/cli/__mocks__/@zowe/cli-test-utils.ts b/packages/cli/__mocks__/@zowe/cli-test-utils.ts index f6d6fdff..1e3bb42d 100644 --- a/packages/cli/__mocks__/@zowe/cli-test-utils.ts +++ b/packages/cli/__mocks__/@zowe/cli-test-utils.ts @@ -1,13 +1,13 @@ /* -* This program and the accompanying materials are made available under the terms of the -* Eclipse Public License v2.0 which accompanies this distribution, and is available at -* https://www.eclipse.org/legal/epl-v20.html -* -* SPDX-License-Identifier: EPL-2.0 -* -* Copyright Contributors to the Zowe Project. -* -*/ + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License v2.0 which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Copyright Contributors to the Zowe Project. + * + */ const original = jest.requireActual("@zowe/cli-test-utils") as any; const nodePath = require("path"); diff --git a/packages/cli/__tests__/__src__/ITestPropertiesSchema.ts b/packages/cli/__tests__/__src__/ITestPropertiesSchema.ts index 214932d5..d2d5cb07 100644 --- a/packages/cli/__tests__/__src__/ITestPropertiesSchema.ts +++ b/packages/cli/__tests__/__src__/ITestPropertiesSchema.ts @@ -14,58 +14,57 @@ * see example_properties.yaml for descriptions and more details */ export interface ITestPropertiesSchema { - /** - * Properties related to connecting to CICS service - */ + * Properties related to connecting to CICS service + */ cics: { /** - * user ID to connect to CMCI - */ - user: string, + * user ID to connect to CMCI + */ + user: string; /** - * Password to connect to CMCI - */ - password: string, + * Password to connect to CMCI + */ + password: string; /** - * host name for CMCI - */ - host: string, + * host name for CMCI + */ + host: string; /** - * Port for CMCI - */ - port?: number, + * Port for CMCI + */ + port?: number; /** - * http or https protocol for CMCI - */ + * http or https protocol for CMCI + */ protocol?: string; /** - * http or https protocol for CMCI - */ + * http or https protocol for CMCI + */ rejectUnauthorized?: boolean; }; /** - * Properties related to connecting to CMCI - */ + * Properties related to connecting to CMCI + */ cmci: { /** - * CSD group to define resources to - */ + * CSD group to define resources to + */ csdGroup?: string; /** - * Name of the CICS region e.g. "CICSCMCI" - */ + * Name of the CICS region e.g. "CICSCMCI" + */ regionName?: string; }; urimap: { /** - * Name of the certificate to use for CICS Client Testing - */ + * Name of the certificate to use for CICS Client Testing + */ certificate?: string; }; } diff --git a/packages/cli/__tests__/__system__/add-to-list/csdGroup/cli.add-to-list.csdGroup.system.test.ts b/packages/cli/__tests__/__system__/add-to-list/csdGroup/cli.add-to-list.csdGroup.system.test.ts index 51382943..a60edd54 100644 --- a/packages/cli/__tests__/__system__/add-to-list/csdGroup/cli.add-to-list.csdGroup.system.test.ts +++ b/packages/cli/__tests__/__system__/add-to-list/csdGroup/cli.add-to-list.csdGroup.system.test.ts @@ -14,12 +14,11 @@ import { ITestPropertiesSchema } from "../../../__src__/ITestPropertiesSchema"; let TEST_ENVIRONMENT: ITestEnvironment; describe("CICS add-to-list csdGroup command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "add_to_list_csdGroup", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); }); @@ -35,8 +34,7 @@ describe("CICS add-to-list csdGroup command", () => { }); it("should get a syntax error if csdGroup name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/add_to_list_csdGroup.sh", TEST_ENVIRONMENT, - ["", "FAKELIST", "FAKERGN"]); + const output = runCliScript(__dirname + "/__scripts__/add_to_list_csdGroup.sh", TEST_ENVIRONMENT, ["", "FAKELIST", "FAKERGN"]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("Missing Positional Argument"); @@ -45,8 +43,7 @@ describe("CICS add-to-list csdGroup command", () => { }); it("should get a syntax error if list name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/add_to_list_csdGroup.sh", TEST_ENVIRONMENT, - ["FAKEGRP", "", "FAKERGN"]); + const output = runCliScript(__dirname + "/__scripts__/add_to_list_csdGroup.sh", TEST_ENVIRONMENT, ["FAKEGRP", "", "FAKERGN"]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("Missing Positional Argument"); diff --git a/packages/cli/__tests__/__system__/define/program/cli.define.program.system.test.ts b/packages/cli/__tests__/__system__/define/program/cli.define.program.system.test.ts index 6e39c6a2..acbbbe90 100644 --- a/packages/cli/__tests__/__system__/define/program/cli.define.program.system.test.ts +++ b/packages/cli/__tests__/__system__/define/program/cli.define.program.system.test.ts @@ -25,12 +25,11 @@ let password: string; let protocol: string; let rejectUnauthorized: boolean; describe("CICS define program command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "define_program", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -56,12 +55,14 @@ describe("CICS define program command", () => { user: cicsProperties.user, password: cicsProperties.password, rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); - return CicsCmciRestClient.deleteExpectParsedXml(session, + return CicsCmciRestClient.deleteExpectParsedXml( + session, `/${CicsCmciConstants.CICS_SYSTEM_MANAGEMENT}/CICSDefinitionProgram/${cmciProperties.regionName}` + - `?CRITERIA=(NAME=${programName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})`); + `?CRITERIA=(NAME=${programName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})` + ); }; it("should be able to display the help", () => { @@ -102,21 +103,21 @@ describe("CICS define program command", () => { it("should be able to successfully define a program using profile options", async () => { const programNameSuffixLength = 4; const programName = "DFN" + generateRandomAlphaNumericString(programNameSuffixLength); - const output = runCliScript(__dirname + "/__scripts__/define_program_fully_qualified.sh", TEST_ENVIRONMENT, - [programName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + const output = runCliScript(__dirname + "/__scripts__/define_program_fully_qualified.sh", TEST_ENVIRONMENT, [ + programName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); const stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await deleteProgram(programName); }); - }); diff --git a/packages/cli/__tests__/__system__/define/transaction/cli.define.transaction.system.test.ts b/packages/cli/__tests__/__system__/define/transaction/cli.define.transaction.system.test.ts index a3d0ecf5..a80e29d6 100644 --- a/packages/cli/__tests__/__system__/define/transaction/cli.define.transaction.system.test.ts +++ b/packages/cli/__tests__/__system__/define/transaction/cli.define.transaction.system.test.ts @@ -25,12 +25,11 @@ let password: string; let protocol: string; let rejectUnauthorized: boolean; describe("CICS define transaction command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "define_transaction", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -56,12 +55,14 @@ describe("CICS define transaction command", () => { user: cicsProperties.user, password: cicsProperties.password, rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); - return CicsCmciRestClient.deleteExpectParsedXml(session, + return CicsCmciRestClient.deleteExpectParsedXml( + session, `/${CicsCmciConstants.CICS_SYSTEM_MANAGEMENT}/${CicsCmciConstants.CICS_DEFINITION_TRANSACTION}/${cmciProperties.regionName}` + - `?CRITERIA=(NAME=${transactionName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})`); + `?CRITERIA=(NAME=${transactionName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})` + ); }; it("should be able to display the help", () => { @@ -75,8 +76,12 @@ describe("CICS define transaction command", () => { const transactionNameSuffixLength = 3; const transactionName = "X" + generateRandomAlphaNumericString(transactionNameSuffixLength); const dummyPgmName = "TESTING"; - const output = runCliScript(__dirname + "/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, - [transactionName, dummyPgmName, csdGroup, regionName]); + const output = runCliScript(__dirname + "/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, [ + transactionName, + dummyPgmName, + csdGroup, + regionName, + ]); const stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -85,8 +90,7 @@ describe("CICS define transaction command", () => { }); it("should get a syntax error if transaction name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, - ["", "FAKEPGM", "FAKEGRP", "FAKERGN"]); + const output = runCliScript(__dirname + "/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, ["", "FAKEPGM", "FAKEGRP", "FAKERGN"]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("Missing Positional Argument"); @@ -95,8 +99,7 @@ describe("CICS define transaction command", () => { }); it("should get a syntax error if program name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, - ["FAKETRAN", "", "FAKEGRP", "FAKERGN"]); + const output = runCliScript(__dirname + "/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, ["FAKETRAN", "", "FAKEGRP", "FAKERGN"]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("Missing Positional Argument"); @@ -105,8 +108,7 @@ describe("CICS define transaction command", () => { }); it("should get a syntax error if CSD group is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, - ["FAKETRAN", "FAKEPGM", "", "FAKERGN"]); + const output = runCliScript(__dirname + "/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, ["FAKETRAN", "FAKEPGM", "", "FAKERGN"]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("Missing Positional Argument"); @@ -118,17 +120,18 @@ describe("CICS define transaction command", () => { const transactionNameSuffixLength = 3; const transactionName = "X" + generateRandomAlphaNumericString(transactionNameSuffixLength); const dummyPgmName = "TESTING"; - const output = runCliScript(__dirname + "/__scripts__/define_transaction_fully_qualified.sh", TEST_ENVIRONMENT, - [transactionName, - dummyPgmName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + const output = runCliScript(__dirname + "/__scripts__/define_transaction_fully_qualified.sh", TEST_ENVIRONMENT, [ + transactionName, + dummyPgmName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); const stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); diff --git a/packages/cli/__tests__/__system__/define/urimap-client/cli.define.urimap.client.system.test.ts b/packages/cli/__tests__/__system__/define/urimap-client/cli.define.urimap.client.system.test.ts index 5076c615..14f30ea1 100644 --- a/packages/cli/__tests__/__system__/define/urimap-client/cli.define.urimap.client.system.test.ts +++ b/packages/cli/__tests__/__system__/define/urimap-client/cli.define.urimap.client.system.test.ts @@ -16,12 +16,11 @@ let TEST_ENVIRONMENT: ITestEnvironment; let certificate: string; describe("CICS define urimap-client command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "define_urimap_client", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); certificate = TEST_ENVIRONMENT.systemTestProperties.urimap.certificate; }); @@ -38,8 +37,16 @@ describe("CICS define urimap-client command", () => { }); it("should get a syntax error if urimap name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, - ["", "FAKEGRP", "FAKEPATH", "FAKEHOST", "FAKERGN", "false", "BASIC", certificate]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, [ + "", + "FAKEGRP", + "FAKEPATH", + "FAKEHOST", + "FAKERGN", + "false", + "BASIC", + certificate, + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("urimap"); @@ -48,8 +55,16 @@ describe("CICS define urimap-client command", () => { }); it("should get a syntax error if CSD group is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, - ["FAKESRV", "", "FAKEPATH", "FAKEHOST", "FAKERGN", "false", "BASIC", certificate]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "", + "FAKEPATH", + "FAKEHOST", + "FAKERGN", + "false", + "BASIC", + certificate, + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("csdGroup"); @@ -57,8 +72,16 @@ describe("CICS define urimap-client command", () => { }); it("should get a syntax error if urimap path is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, - ["FAKESRV", "FAKEGRP", "", "FAKEHOST", "FAKERGN", "false", "BASIC", certificate]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "FAKEGRP", + "", + "FAKEHOST", + "FAKERGN", + "false", + "BASIC", + certificate, + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("urimap-path"); @@ -66,8 +89,16 @@ describe("CICS define urimap-client command", () => { }); it("should get a syntax error if urimap host is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, - ["FAKESRV", "FAKEGRP", "FAKEPATH", "", "FAKERGN", "false", "BASIC", certificate]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "FAKEGRP", + "FAKEPATH", + "", + "FAKERGN", + "false", + "BASIC", + certificate, + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("urimap-host"); @@ -75,8 +106,16 @@ describe("CICS define urimap-client command", () => { }); it("should get a syntax error if region name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, - ["FAKESRV", "FAKEGRP", "FAKEPATH", "FAKEHOST", "", "false", "BASIC", certificate]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "FAKEGRP", + "FAKEPATH", + "FAKEHOST", + "", + "false", + "BASIC", + certificate, + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("region-name"); diff --git a/packages/cli/__tests__/__system__/define/urimap-pipeline/cli.define.urimap.pipeline.system.test.ts b/packages/cli/__tests__/__system__/define/urimap-pipeline/cli.define.urimap.pipeline.system.test.ts index 1d9de87e..3a221011 100644 --- a/packages/cli/__tests__/__system__/define/urimap-pipeline/cli.define.urimap.pipeline.system.test.ts +++ b/packages/cli/__tests__/__system__/define/urimap-pipeline/cli.define.urimap.pipeline.system.test.ts @@ -15,12 +15,11 @@ import { ITestPropertiesSchema } from "../../../__src__/ITestPropertiesSchema"; let TEST_ENVIRONMENT: ITestEnvironment; describe("CICS define urimap-pipeline command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "define_urimap_pipeline", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); }); @@ -36,8 +35,16 @@ describe("CICS define urimap-pipeline command", () => { }); it("should get a syntax error if urimap name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, - ["", "FAKEGRP", "FAKEPATH", "FAKEHOST", "FAKEPIPE", "FAKERGN", "false", "TESTSVC"]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, [ + "", + "FAKEGRP", + "FAKEPATH", + "FAKEHOST", + "FAKEPIPE", + "FAKERGN", + "false", + "TESTSVC", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("urimap"); @@ -46,8 +53,16 @@ describe("CICS define urimap-pipeline command", () => { }); it("should get a syntax error if CSD group is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, - ["FAKESRV", "", "FAKEPATH", "FAKEHOST", "FAKEPIPE", "FAKERGN", "false", "TESTSVC"]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "", + "FAKEPATH", + "FAKEHOST", + "FAKEPIPE", + "FAKERGN", + "false", + "TESTSVC", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("csdGroup"); @@ -55,8 +70,16 @@ describe("CICS define urimap-pipeline command", () => { }); it("should get a syntax error if urimap path is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, - ["FAKESRV", "FAKEGRP", "", "FAKEHOST", "FAKEPIPE", "FAKERGN", "false", "TESTSVC"]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "FAKEGRP", + "", + "FAKEHOST", + "FAKEPIPE", + "FAKERGN", + "false", + "TESTSVC", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("urimap-path"); @@ -64,8 +87,16 @@ describe("CICS define urimap-pipeline command", () => { }); it("should get a syntax error if urimap host is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, - ["FAKESRV", "FAKEGRP", "FAKEPATH", "", "FAKEPIPE", "FAKERGN", "false", "TESTSVC"]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "FAKEGRP", + "FAKEPATH", + "", + "FAKEPIPE", + "FAKERGN", + "false", + "TESTSVC", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("urimap-host"); @@ -73,8 +104,16 @@ describe("CICS define urimap-pipeline command", () => { }); it("should get a syntax error if pipeline name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, - ["FAKESRV", "FAKEGRP", "FAKEPATH", "FAKEHOST", "", "FAKERGN", "false", "TESTSVC"]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "FAKEGRP", + "FAKEPATH", + "FAKEHOST", + "", + "FAKERGN", + "false", + "TESTSVC", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("pipeline-name"); @@ -82,8 +121,16 @@ describe("CICS define urimap-pipeline command", () => { }); it("should get a syntax error if region name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, - ["FAKESRV", "FAKEGRP", "FAKEPATH", "FAKEHOST", "FAKEPIPE", "", "false", "TESTSVC"]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "FAKEGRP", + "FAKEPATH", + "FAKEHOST", + "FAKEPIPE", + "", + "false", + "TESTSVC", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("region-name"); diff --git a/packages/cli/__tests__/__system__/define/urimap-server/cli.define.urimap.server.system.test.ts b/packages/cli/__tests__/__system__/define/urimap-server/cli.define.urimap.server.system.test.ts index 950999b7..8d39ddbb 100644 --- a/packages/cli/__tests__/__system__/define/urimap-server/cli.define.urimap.server.system.test.ts +++ b/packages/cli/__tests__/__system__/define/urimap-server/cli.define.urimap.server.system.test.ts @@ -15,12 +15,11 @@ import { ITestPropertiesSchema } from "../../../__src__/ITestPropertiesSchema"; let TEST_ENVIRONMENT: ITestEnvironment; describe("CICS define urimap-server command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "define_urimap_server", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); }); @@ -36,8 +35,16 @@ describe("CICS define urimap-server command", () => { }); it("should get a syntax error if urimap name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, - ["", "FAKEGRP", "FAKEPATH", "FAKEHOST", "FAKEPGM", "FAKERGN", "false", "TESTSVC"]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, [ + "", + "FAKEGRP", + "FAKEPATH", + "FAKEHOST", + "FAKEPGM", + "FAKERGN", + "false", + "TESTSVC", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("urimap"); @@ -46,8 +53,16 @@ describe("CICS define urimap-server command", () => { }); it("should get a syntax error if CSD group is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, - ["FAKESRV", "", "FAKEPATH", "FAKEHOST", "FAKEPGM", "FAKERGN", "false", "TESTSVC"]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "", + "FAKEPATH", + "FAKEHOST", + "FAKEPGM", + "FAKERGN", + "false", + "TESTSVC", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("csdGroup"); @@ -55,8 +70,16 @@ describe("CICS define urimap-server command", () => { }); it("should get a syntax error if urimap path is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, - ["FAKESRV", "FAKEGRP", "", "FAKEHOST", "FAKEPGM", "FAKERGN", "false", "TESTSVC"]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "FAKEGRP", + "", + "FAKEHOST", + "FAKEPGM", + "FAKERGN", + "false", + "TESTSVC", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("urimap-path"); @@ -64,8 +87,16 @@ describe("CICS define urimap-server command", () => { }); it("should get a syntax error if urimap host is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, - ["FAKESRV", "FAKEGRP", "FAKEPATH", "", "FAKEPGM", "FAKERGN", "false", "TESTSVC"]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "FAKEGRP", + "FAKEPATH", + "", + "FAKEPGM", + "FAKERGN", + "false", + "TESTSVC", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("urimap-host"); @@ -73,8 +104,16 @@ describe("CICS define urimap-server command", () => { }); it("should get a syntax error if program name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, - ["FAKESRV", "FAKEGRP", "FAKEPATH", "FAKEHOST", "", "FAKERGN", "false", "TESTSVC"]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "FAKEGRP", + "FAKEPATH", + "FAKEHOST", + "", + "FAKERGN", + "false", + "TESTSVC", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("program-name"); @@ -82,12 +121,19 @@ describe("CICS define urimap-server command", () => { }); it("should get a syntax error if region name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, - ["FAKESRV", "FAKEGRP", "FAKEPATH", "FAKEHOST", "FAKEPGM", "", "false", "TESTSVC"]); + const output = runCliScript(__dirname + "/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, [ + "FAKESRV", + "FAKEGRP", + "FAKEPATH", + "FAKEHOST", + "FAKEPGM", + "", + "false", + "TESTSVC", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("region-name"); expect(output.status).toEqual(1); }); - }); diff --git a/packages/cli/__tests__/__system__/define/webservice/cli.define.webservice.system.test.ts b/packages/cli/__tests__/__system__/define/webservice/cli.define.webservice.system.test.ts index 8bf91c6a..9cf385eb 100644 --- a/packages/cli/__tests__/__system__/define/webservice/cli.define.webservice.system.test.ts +++ b/packages/cli/__tests__/__system__/define/webservice/cli.define.webservice.system.test.ts @@ -28,12 +28,11 @@ let rejectUnauthorized: boolean; let session: Session; describe("CICS define web service command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "define_webservice", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); const cicsProperties = TEST_ENVIRONMENT.systemTestProperties.cics; csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; @@ -51,7 +50,7 @@ describe("CICS define web service command", () => { user: cicsProperties.user, password: cicsProperties.password, rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); @@ -70,15 +69,19 @@ describe("CICS define web service command", () => { const websvcNameSuffixLength = 4; const websvcName = "DFN" + generateRandomAlphaNumericString(websvcNameSuffixLength); const options: IWebServiceParms = { name: websvcName, csdGroup, regionName }; - let output = runCliScript(__dirname + "/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, - [websvcName, csdGroup, "FAKEPIPE", "//u/exampleapp/wsbind/example.log", regionName]); + let output = runCliScript(__dirname + "/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, [ + websvcName, + csdGroup, + "FAKEPIPE", + "//u/exampleapp/wsbind/example.log", + regionName, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/get_resource_webservice.sh", TEST_ENVIRONMENT, - [regionName, csdGroup]); + output = runCliScript(__dirname + "/__scripts__/get_resource_webservice.sh", TEST_ENVIRONMENT, [regionName, csdGroup]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -88,8 +91,7 @@ describe("CICS define web service command", () => { }); it("should get a syntax error if web service name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, - ["", "FAKEGRP", "FAKEPIPE", "FAKEWSB", "FAKERGN"]); + const output = runCliScript(__dirname + "/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, ["", "FAKEGRP", "FAKEPIPE", "FAKEWSB", "FAKERGN"]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("webserviceName"); @@ -97,8 +99,13 @@ describe("CICS define web service command", () => { }); it("should get a syntax error if CSD group is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, - ["FAKEWSVC", "", "FAKEPIPE", "FAKEWSB", "FAKERGN"]); + const output = runCliScript(__dirname + "/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, [ + "FAKEWSVC", + "", + "FAKEPIPE", + "FAKEWSB", + "FAKERGN", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("csdGroup"); @@ -106,8 +113,7 @@ describe("CICS define web service command", () => { }); it("should get a syntax error if web service pipeline name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, - ["FAKEWSVC", "FAKEGRP", "", "FAKEWSB", "FAKERGN"]); + const output = runCliScript(__dirname + "/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, ["FAKEWSVC", "FAKEGRP", "", "FAKEWSB", "FAKERGN"]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("pipeline-name"); @@ -115,8 +121,13 @@ describe("CICS define web service command", () => { }); it("should get a syntax error if web service binding file is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, - ["FAKEWSVC", "FAKEGRP", "FAKEPIPE", "", "FAKERGN"]); + const output = runCliScript(__dirname + "/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, [ + "FAKEWSVC", + "FAKEGRP", + "FAKEPIPE", + "", + "FAKERGN", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("wsbind"); @@ -124,8 +135,13 @@ describe("CICS define web service command", () => { }); it("should get a syntax error if region name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, - ["FAKEWSVC", "FAKEGRP", "FAKEPIPE", "FAKEWSB", ""]); + const output = runCliScript(__dirname + "/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, [ + "FAKEWSVC", + "FAKEGRP", + "FAKEPIPE", + "FAKEWSB", + "", + ]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("region-name"); @@ -138,32 +154,34 @@ describe("CICS define web service command", () => { const pipelineName = "FAKEPIPE"; const wsBind = "//u/exampleapp/wsbind/example.log"; const options: IWebServiceParms = { name: websvcName, csdGroup, regionName }; - let output = runCliScript(__dirname + "/__scripts__/define_webservice_fully_qualified.sh", TEST_ENVIRONMENT, - [websvcName, - csdGroup, - pipelineName, - wsBind, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/__scripts__/define_webservice_fully_qualified.sh", TEST_ENVIRONMENT, [ + websvcName, + csdGroup, + pipelineName, + wsBind, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/get_resource_webservice_fully_qualified.sh", TEST_ENVIRONMENT, - [regionName, - csdGroup, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/get_resource_webservice_fully_qualified.sh", TEST_ENVIRONMENT, [ + regionName, + csdGroup, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -171,5 +189,4 @@ describe("CICS define web service command", () => { await deleteWebservice(session, options); }); - }); diff --git a/packages/cli/__tests__/__system__/delete/program/cli.delete.program.system.test.ts b/packages/cli/__tests__/__system__/delete/program/cli.delete.program.system.test.ts index 13c38ac1..afe95d4c 100644 --- a/packages/cli/__tests__/__system__/delete/program/cli.delete.program.system.test.ts +++ b/packages/cli/__tests__/__system__/delete/program/cli.delete.program.system.test.ts @@ -23,12 +23,11 @@ let password: string; let protocol: string; let rejectUnauthorized: boolean; describe("CICS delete program command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "delete_program", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -52,21 +51,22 @@ describe("CICS delete program command", () => { }); it("should be able to successfully delete a program with basic options", async () => { - // Get a random program name const programNameSuffixLength = 4; const programName = "AAAA" + generateRandomAlphaNumericString(programNameSuffixLength); // Define the program - let output = runCliScript(__dirname + "/../../define/program/__scripts__/define_program.sh", TEST_ENVIRONMENT, - [programName, csdGroup, regionName]); + let output = runCliScript(__dirname + "/../../define/program/__scripts__/define_program.sh", TEST_ENVIRONMENT, [ + programName, + csdGroup, + regionName, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/delete_program.sh", TEST_ENVIRONMENT, - [programName, csdGroup, regionName]); + output = runCliScript(__dirname + "/__scripts__/delete_program.sh", TEST_ENVIRONMENT, [programName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -83,37 +83,38 @@ describe("CICS delete program command", () => { }); it("should be able to successfully delete a program with profile options", async () => { - // Get a random program name const programNameSuffixLength = 4; const programName = "AAAA" + generateRandomAlphaNumericString(programNameSuffixLength); // Define the program - let output = runCliScript(__dirname + "/../../define/program/__scripts__/define_program_fully_qualified.sh", TEST_ENVIRONMENT, - [programName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/program/__scripts__/define_program_fully_qualified.sh", TEST_ENVIRONMENT, [ + programName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/delete_program_fully_qualified.sh", TEST_ENVIRONMENT, - [programName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/delete_program_fully_qualified.sh", TEST_ENVIRONMENT, [ + programName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); diff --git a/packages/cli/__tests__/__system__/delete/transaction/cli.delete.transaction.system.test.ts b/packages/cli/__tests__/__system__/delete/transaction/cli.delete.transaction.system.test.ts index ad4001f4..0638da27 100644 --- a/packages/cli/__tests__/__system__/delete/transaction/cli.delete.transaction.system.test.ts +++ b/packages/cli/__tests__/__system__/delete/transaction/cli.delete.transaction.system.test.ts @@ -25,12 +25,11 @@ let protocol: string; let rejectUnauthorized: boolean; describe("CICS delete transaction command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "delete_transaction", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -54,22 +53,23 @@ describe("CICS delete transaction command", () => { }); it("should be able to successfully delete a transaction with basic options", async () => { - // Get a random transaction name const transactionNameSuffixLength = 3; const transactionName = "X" + generateRandomAlphaNumericString(transactionNameSuffixLength); // Define the transaction - let output = runCliScript(__dirname + "/../../define/transaction/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, - [transactionName, programName, csdGroup, regionName]); + let output = runCliScript(__dirname + "/../../define/transaction/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, [ + transactionName, + programName, + csdGroup, + regionName, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - - output = runCliScript(__dirname + "/__scripts__/delete_transaction.sh", TEST_ENVIRONMENT, - [transactionName, csdGroup, regionName]); + output = runCliScript(__dirname + "/__scripts__/delete_transaction.sh", TEST_ENVIRONMENT, [transactionName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -86,42 +86,42 @@ describe("CICS delete transaction command", () => { }); it("should be able to successfully delete a transaction with profile options", async () => { - // Get a random transaction name const transactionNameSuffixLength = 3; const transactionName = "X" + generateRandomAlphaNumericString(transactionNameSuffixLength); // Define the transaction - let output = runCliScript(__dirname + "/../../define/transaction/__scripts__/define_transaction_fully_qualified.sh", TEST_ENVIRONMENT, - [transactionName, - programName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/transaction/__scripts__/define_transaction_fully_qualified.sh", TEST_ENVIRONMENT, [ + transactionName, + programName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/delete_transaction_fully_qualified.sh", TEST_ENVIRONMENT, - [transactionName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/delete_transaction_fully_qualified.sh", TEST_ENVIRONMENT, [ + transactionName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); }); - }); diff --git a/packages/cli/__tests__/__system__/delete/urimap/cli.delete.urimap.system.test.ts b/packages/cli/__tests__/__system__/delete/urimap/cli.delete.urimap.system.test.ts index ed5fcfb6..1056e97e 100644 --- a/packages/cli/__tests__/__system__/delete/urimap/cli.delete.urimap.system.test.ts +++ b/packages/cli/__tests__/__system__/delete/urimap/cli.delete.urimap.system.test.ts @@ -28,12 +28,11 @@ const authenticate: string = "BASIC"; const tcpipservice: string = "TESTSVC"; describe("CICS delete urimap command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "delete_urimap", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -64,15 +63,22 @@ describe("CICS delete urimap command", () => { const urimapHost = "www.example.com"; const programName = "FAKEPGM"; - let output = runCliScript(__dirname + "/../../define/urimap-server/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, urimapPath, urimapHost, programName, regionName, enable, tcpipservice]); + let output = runCliScript(__dirname + "/../../define/urimap-server/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + programName, + regionName, + enable, + tcpipservice, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -86,15 +92,22 @@ describe("CICS delete urimap command", () => { const urimapHost = "www.example.com"; const pipelineName = "FAKEPIPE"; - let output = runCliScript(__dirname + "/../../define/urimap-pipeline/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, urimapPath, urimapHost, pipelineName, regionName, enable, tcpipservice]); + let output = runCliScript(__dirname + "/../../define/urimap-pipeline/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + pipelineName, + regionName, + enable, + tcpipservice, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -107,15 +120,22 @@ describe("CICS delete urimap command", () => { const urimapPath = "fake/path"; const urimapHost = "www.example.com"; - let output = runCliScript(__dirname + "/../../define/urimap-client/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, urimapPath, urimapHost, regionName, enable, authenticate, certificate]); + let output = runCliScript(__dirname + "/../../define/urimap-client/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + regionName, + enable, + authenticate, + certificate, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -141,7 +161,6 @@ describe("CICS delete urimap command", () => { }); it("should be able to successfully delete a urimap of type server with profile options", async () => { - const urimapNameSuffixLength = 3; const urimapName = "X" + generateRandomAlphaNumericString(urimapNameSuffixLength); const urimapPath = "fake/path"; @@ -149,37 +168,39 @@ describe("CICS delete urimap command", () => { const programName = "FAKEPGM"; const urimapScheme = "HTTPS"; - let output = runCliScript(__dirname + "/../../define/urimap-server/__scripts__/define_urimap_server_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - urimapPath, - urimapHost, - urimapScheme, - programName, - regionName, - enable, - tcpipservice, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/urimap-server/__scripts__/define_urimap_server_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + urimapScheme, + programName, + regionName, + enable, + tcpipservice, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -187,7 +208,6 @@ describe("CICS delete urimap command", () => { }); it("should be able to successfully delete a pipeline of type server with profile options", async () => { - const urimapNameSuffixLength = 3; const urimapName = "X" + generateRandomAlphaNumericString(urimapNameSuffixLength); const urimapPath = "fake/path"; @@ -195,37 +215,39 @@ describe("CICS delete urimap command", () => { const pipelineName = "FAKEPIPE"; const urimapScheme = "HTTPS"; - let output = runCliScript(__dirname + "/../../define/urimap-pipeline/__scripts__/define_urimap_pipeline_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - urimapPath, - urimapHost, - urimapScheme, - pipelineName, - regionName, - enable, - tcpipservice, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/urimap-pipeline/__scripts__/define_urimap_pipeline_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + urimapScheme, + pipelineName, + regionName, + enable, + tcpipservice, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -233,44 +255,45 @@ describe("CICS delete urimap command", () => { }); it("should be able to successfully delete a urimap of type client with profile options", async () => { - const urimapNameSuffixLength = 3; const urimapName = "X" + generateRandomAlphaNumericString(urimapNameSuffixLength); const urimapPath = "fake/path"; const urimapHost = "www.example.com"; const urimapScheme = "HTTPS"; - let output = runCliScript(__dirname + "/../../define/urimap-client/__scripts__/define_urimap_client_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - urimapPath, - urimapHost, - urimapScheme, - regionName, - enable, - authenticate, - certificate, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/urimap-client/__scripts__/define_urimap_client_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + urimapScheme, + regionName, + enable, + authenticate, + certificate, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); diff --git a/packages/cli/__tests__/__system__/delete/webservice/cli.delete.webservice.system.test.ts b/packages/cli/__tests__/__system__/delete/webservice/cli.delete.webservice.system.test.ts index fe4f5a39..524c21e8 100644 --- a/packages/cli/__tests__/__system__/delete/webservice/cli.delete.webservice.system.test.ts +++ b/packages/cli/__tests__/__system__/delete/webservice/cli.delete.webservice.system.test.ts @@ -23,12 +23,11 @@ let password: string; let protocol: string; let rejectUnauthorized: boolean; describe("CICS delete web service command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "delete_webservice", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -52,21 +51,24 @@ describe("CICS delete web service command", () => { }); it("should be able to successfully delete a web service with basic options", async () => { - // Get a random web service name const webserviceNameSuffixLength = 4; const webserviceName = "AAAA" + generateRandomAlphaNumericString(webserviceNameSuffixLength); // Define the web service - let output = runCliScript(__dirname + "/../../define/webservice/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, - [webserviceName, csdGroup, "AAAA1234", "//u/exampleapp/wsbind/example.log", regionName]); + let output = runCliScript(__dirname + "/../../define/webservice/__scripts__/define_webservice.sh", TEST_ENVIRONMENT, [ + webserviceName, + csdGroup, + "AAAA1234", + "//u/exampleapp/wsbind/example.log", + regionName, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/delete_webservice.sh", TEST_ENVIRONMENT, - [webserviceName, csdGroup, regionName]); + output = runCliScript(__dirname + "/__scripts__/delete_webservice.sh", TEST_ENVIRONMENT, [webserviceName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -83,39 +85,40 @@ describe("CICS delete web service command", () => { }); it("should be able to successfully delete a web service with profile options", async () => { - // Get a random web service name const webserviceNameSuffixLength = 4; const webserviceName = "AAAA" + generateRandomAlphaNumericString(webserviceNameSuffixLength); // Define the web service - let output = runCliScript(__dirname + "/../../define/webservice/__scripts__/define_webservice_fully_qualified.sh", TEST_ENVIRONMENT, - [webserviceName, - csdGroup, - "AAAA1234", - "//u/exampleapp/wsbind/example.log", - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/webservice/__scripts__/define_webservice_fully_qualified.sh", TEST_ENVIRONMENT, [ + webserviceName, + csdGroup, + "AAAA1234", + "//u/exampleapp/wsbind/example.log", + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/delete_webservice_fully_qualified.sh", TEST_ENVIRONMENT, - [webserviceName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/delete_webservice_fully_qualified.sh", TEST_ENVIRONMENT, [ + webserviceName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); diff --git a/packages/cli/__tests__/__system__/disable/urimap/cli.disable.urimap.system.test.ts b/packages/cli/__tests__/__system__/disable/urimap/cli.disable.urimap.system.test.ts index f76cc8bf..0358e6cd 100644 --- a/packages/cli/__tests__/__system__/disable/urimap/cli.disable.urimap.system.test.ts +++ b/packages/cli/__tests__/__system__/disable/urimap/cli.disable.urimap.system.test.ts @@ -34,12 +34,11 @@ function sleep(ms: number) { const sleepTime = 2000; describe("CICS disable urimap command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "disable_urimap", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -70,48 +69,51 @@ describe("CICS disable urimap command", () => { const urimapHost = "www.example.com"; const programName = "FAKEPGM"; - let output = runCliScript(__dirname + "/../../define/urimap-server/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, urimapPath, urimapHost, programName, regionName, enable, tcpipservice]); + let output = runCliScript(__dirname + "/../../define/urimap-server/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + programName, + regionName, + enable, + tcpipservice, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../enable/urimap/__scripts__/enable_urimap.sh", TEST_ENVIRONMENT, - [urimapName, regionName]); + output = runCliScript(__dirname + "/../../enable/urimap/__scripts__/enable_urimap.sh", TEST_ENVIRONMENT, [urimapName, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/__scripts__/disable_urimap.sh", TEST_ENVIRONMENT, - [urimapName, regionName]); + output = runCliScript(__dirname + "/__scripts__/disable_urimap.sh", TEST_ENVIRONMENT, [urimapName, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap.sh", TEST_ENVIRONMENT, - [urimapName, regionName]); + output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap.sh", TEST_ENVIRONMENT, [urimapName, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -125,48 +127,51 @@ describe("CICS disable urimap command", () => { const urimapHost = "www.example.com"; const pipelineName = "FAKEPIPE"; - let output = runCliScript(__dirname + "/../../define/urimap-pipeline/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, urimapPath, urimapHost, pipelineName, regionName, enable, tcpipservice]); + let output = runCliScript(__dirname + "/../../define/urimap-pipeline/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + pipelineName, + regionName, + enable, + tcpipservice, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../enable/urimap/__scripts__/enable_urimap.sh", TEST_ENVIRONMENT, - [urimapName, regionName]); + output = runCliScript(__dirname + "/../../enable/urimap/__scripts__/enable_urimap.sh", TEST_ENVIRONMENT, [urimapName, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/__scripts__/disable_urimap.sh", TEST_ENVIRONMENT, - [urimapName, regionName]); + output = runCliScript(__dirname + "/__scripts__/disable_urimap.sh", TEST_ENVIRONMENT, [urimapName, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap.sh", TEST_ENVIRONMENT, - [urimapName, regionName]); + output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap.sh", TEST_ENVIRONMENT, [urimapName, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -179,48 +184,51 @@ describe("CICS disable urimap command", () => { const urimapPath = "fake/path"; const urimapHost = "www.example.com"; - let output = runCliScript(__dirname + "/../../define/urimap-client/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, urimapPath, urimapHost, regionName, enable, authenticate, certificate]); + let output = runCliScript(__dirname + "/../../define/urimap-client/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + regionName, + enable, + authenticate, + certificate, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../enable/urimap/__scripts__/enable_urimap.sh", TEST_ENVIRONMENT, - [urimapName, regionName]); + output = runCliScript(__dirname + "/../../enable/urimap/__scripts__/enable_urimap.sh", TEST_ENVIRONMENT, [urimapName, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/__scripts__/disable_urimap.sh", TEST_ENVIRONMENT, - [urimapName, regionName]); + output = runCliScript(__dirname + "/__scripts__/disable_urimap.sh", TEST_ENVIRONMENT, [urimapName, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap.sh", TEST_ENVIRONMENT, - [urimapName, regionName]); + output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap.sh", TEST_ENVIRONMENT, [urimapName, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -237,7 +245,6 @@ describe("CICS disable urimap command", () => { }); it("should be able to successfully disable a urimap of type server with profile options", async () => { - const urimapNameSuffixLength = 6; const urimapName = "X" + generateRandomAlphaNumericString(urimapNameSuffixLength); const urimapPath = "fake/path"; @@ -245,99 +252,105 @@ describe("CICS disable urimap command", () => { const programName = "FAKEPGM"; const urimapScheme = "HTTPS"; - let output = runCliScript(__dirname + "/../../define/urimap-server/__scripts__/define_urimap_server_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - urimapPath, - urimapHost, - urimapScheme, - programName, - regionName, - enable, - tcpipservice, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/urimap-server/__scripts__/define_urimap_server_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + urimapScheme, + programName, + regionName, + enable, + tcpipservice, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../enable/urimap/__scripts__/enable_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../enable/urimap/__scripts__/enable_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/__scripts__/disable_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/disable_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -345,7 +358,6 @@ describe("CICS disable urimap command", () => { }); it("should be able to successfully disable a pipeline of type server with profile options", async () => { - const urimapNameSuffixLength = 6; const urimapName = "X" + generateRandomAlphaNumericString(urimapNameSuffixLength); const urimapPath = "fake/path"; @@ -353,99 +365,105 @@ describe("CICS disable urimap command", () => { const pipelineName = "FAKEPIPE"; const urimapScheme = "HTTPS"; - let output = runCliScript(__dirname + "/../../define/urimap-pipeline/__scripts__/define_urimap_pipeline_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - urimapPath, - urimapHost, - urimapScheme, - pipelineName, - regionName, - enable, - tcpipservice, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/urimap-pipeline/__scripts__/define_urimap_pipeline_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + urimapScheme, + pipelineName, + regionName, + enable, + tcpipservice, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../enable/urimap/__scripts__/enable_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../enable/urimap/__scripts__/enable_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/__scripts__/disable_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/disable_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -453,106 +471,111 @@ describe("CICS disable urimap command", () => { }); it("should be able to successfully disable a urimap of type client with profile options", async () => { - const urimapNameSuffixLength = 6; const urimapName = "X" + generateRandomAlphaNumericString(urimapNameSuffixLength); const urimapPath = "fake/path"; const urimapHost = "www.example.com"; const urimapScheme = "HTTPS"; - let output = runCliScript(__dirname + "/../../define/urimap-client/__scripts__/define_urimap_client_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - urimapPath, - urimapHost, - urimapScheme, - regionName, - enable, - authenticate, - certificate, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/urimap-client/__scripts__/define_urimap_client_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + urimapScheme, + regionName, + enable, + authenticate, + certificate, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../enable/urimap/__scripts__/enable_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../enable/urimap/__scripts__/enable_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/__scripts__/disable_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/disable_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); diff --git a/packages/cli/__tests__/__system__/discard/program/cli.discard.program.system.test.ts b/packages/cli/__tests__/__system__/discard/program/cli.discard.program.system.test.ts index d83b0f19..45543d64 100644 --- a/packages/cli/__tests__/__system__/discard/program/cli.discard.program.system.test.ts +++ b/packages/cli/__tests__/__system__/discard/program/cli.discard.program.system.test.ts @@ -26,12 +26,11 @@ let protocol: string; let rejectUnauthorized: boolean; describe("CICS discard program command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "discard_program", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -57,12 +56,14 @@ describe("CICS discard program command", () => { user: cicsProperties.user, password: cicsProperties.password, rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); - return CicsCmciRestClient.deleteExpectParsedXml(session, + return CicsCmciRestClient.deleteExpectParsedXml( + session, `/${CicsCmciConstants.CICS_SYSTEM_MANAGEMENT}/CICSDefinitionProgram/${cmciProperties.regionName}` + - `?CRITERIA=(NAME=${programName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})`); + `?CRITERIA=(NAME=${programName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})` + ); }; it("should be able to display the help", () => { @@ -73,22 +74,23 @@ describe("CICS discard program command", () => { }); it("should be able to successfully discard a program with basic options", async () => { - // Get a random program name const programNameSuffixLength = 4; const programName = "AAA" + generateRandomAlphaNumericString(programNameSuffixLength); // Define the program - let output = runCliScript(__dirname + "/../../define/program/__scripts__/define_program.sh", TEST_ENVIRONMENT, - [programName, csdGroup, regionName]); + let output = runCliScript(__dirname + "/../../define/program/__scripts__/define_program.sh", TEST_ENVIRONMENT, [ + programName, + csdGroup, + regionName, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); // Install defined program - output = runCliScript(__dirname + "/../../install/program/__scripts__/install_program.sh", TEST_ENVIRONMENT, - [programName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../install/program/__scripts__/install_program.sh", TEST_ENVIRONMENT, [programName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -113,53 +115,54 @@ describe("CICS discard program command", () => { }); it("should be able to successfully discard a program with profile options", async () => { - // Get a random program name const programNameSuffixLength = 4; const programName = "AAA" + generateRandomAlphaNumericString(programNameSuffixLength); // Define the program - let output = runCliScript(__dirname + "/../../define/program/__scripts__/define_program_fully_qualified.sh", TEST_ENVIRONMENT, - [programName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/program/__scripts__/define_program_fully_qualified.sh", TEST_ENVIRONMENT, [ + programName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); // Install defined program - output = runCliScript(__dirname + "/../../install/program/__scripts__/install_program_fully_qualified.sh", TEST_ENVIRONMENT, - [programName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../install/program/__scripts__/install_program_fully_qualified.sh", TEST_ENVIRONMENT, [ + programName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/discard_program_fully_qualified.sh", - TEST_ENVIRONMENT, - [programName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/discard_program_fully_qualified.sh", TEST_ENVIRONMENT, [ + programName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); diff --git a/packages/cli/__tests__/__system__/discard/transaction/cli.discard.transaction.system.test.ts b/packages/cli/__tests__/__system__/discard/transaction/cli.discard.transaction.system.test.ts index d8003c28..b6f0d0b6 100644 --- a/packages/cli/__tests__/__system__/discard/transaction/cli.discard.transaction.system.test.ts +++ b/packages/cli/__tests__/__system__/discard/transaction/cli.discard.transaction.system.test.ts @@ -27,12 +27,11 @@ let protocol: string; let rejectUnauthorized: boolean; describe("CICS discard transaction command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "discard_transaction", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -58,12 +57,14 @@ describe("CICS discard transaction command", () => { user: cicsProperties.user, password: cicsProperties.password, rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); - return CicsCmciRestClient.deleteExpectParsedXml(session, + return CicsCmciRestClient.deleteExpectParsedXml( + session, `/${CicsCmciConstants.CICS_SYSTEM_MANAGEMENT}/${CicsCmciConstants.CICS_DEFINITION_TRANSACTION}/${cmciProperties.regionName}` + - `?CRITERIA=(NAME=${transactionName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})`); + `?CRITERIA=(NAME=${transactionName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})` + ); }; it("should be able to display the help", () => { @@ -74,22 +75,28 @@ describe("CICS discard transaction command", () => { }); it("should be able to successfully discard a transaction with basic options", async () => { - // Get a random transaction name const transactionNameSuffixLength = 3; const transactionName = "X" + generateRandomAlphaNumericString(transactionNameSuffixLength); // Define the transaction - let output = runCliScript(__dirname + "/../../define/transaction/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, - [transactionName, programName, csdGroup, regionName]); + let output = runCliScript(__dirname + "/../../define/transaction/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, [ + transactionName, + programName, + csdGroup, + regionName, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); // Install defined transaction - output = runCliScript(__dirname + "/../../install/transaction/__scripts__/install_transaction.sh", TEST_ENVIRONMENT, - [transactionName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../install/transaction/__scripts__/install_transaction.sh", TEST_ENVIRONMENT, [ + transactionName, + csdGroup, + regionName, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -114,54 +121,55 @@ describe("CICS discard transaction command", () => { }); it("should be able to successfully discard a transaction with profile options", async () => { - // Get a random transaction name const transactionNameSuffixLength = 3; const transactionName = "X" + generateRandomAlphaNumericString(transactionNameSuffixLength); // Define the transaction - let output = runCliScript(__dirname + "/../../define/transaction/__scripts__/define_transaction_fully_qualified.sh", TEST_ENVIRONMENT, - [transactionName, - programName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized - ]); + let output = runCliScript(__dirname + "/../../define/transaction/__scripts__/define_transaction_fully_qualified.sh", TEST_ENVIRONMENT, [ + transactionName, + programName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); // Install defined transaction - output = runCliScript(__dirname + "/../../install/transaction/__scripts__/install_transaction_fully_qualified.sh", TEST_ENVIRONMENT, - [transactionName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../install/transaction/__scripts__/install_transaction_fully_qualified.sh", TEST_ENVIRONMENT, [ + transactionName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/discard_transaction_fully_qualified.sh", TEST_ENVIRONMENT, - [transactionName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/discard_transaction_fully_qualified.sh", TEST_ENVIRONMENT, [ + transactionName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); diff --git a/packages/cli/__tests__/__system__/discard/urimap/cli.discard.urimap.system.test.ts b/packages/cli/__tests__/__system__/discard/urimap/cli.discard.urimap.system.test.ts index c2897403..aa69d5ef 100644 --- a/packages/cli/__tests__/__system__/discard/urimap/cli.discard.urimap.system.test.ts +++ b/packages/cli/__tests__/__system__/discard/urimap/cli.discard.urimap.system.test.ts @@ -36,12 +36,11 @@ function sleep(ms: number) { const sleepTime = 2000; describe("CICS discard urimap command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "discard_urimap", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -72,32 +71,37 @@ describe("CICS discard urimap command", () => { const urimapHost = "www.example.com"; const programName = "FAKEPGM"; - let output = runCliScript(__dirname + "/../../define/urimap-server/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, urimapPath, urimapHost, programName, regionName, enable, tcpipservice]); + let output = runCliScript(__dirname + "/../../define/urimap-server/__scripts__/define_urimap_server.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + programName, + regionName, + enable, + tcpipservice, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/__scripts__/discard_urimap.sh", TEST_ENVIRONMENT, - [urimapName, regionName]); + output = runCliScript(__dirname + "/__scripts__/discard_urimap.sh", TEST_ENVIRONMENT, [urimapName, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -111,32 +115,37 @@ describe("CICS discard urimap command", () => { const urimapHost = "www.example.com"; const pipelineName = "FAKEPIPE"; - let output = runCliScript(__dirname + "/../../define/urimap-pipeline/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, urimapPath, urimapHost, pipelineName, regionName, enable, tcpipservice]); + let output = runCliScript(__dirname + "/../../define/urimap-pipeline/__scripts__/define_urimap_pipeline.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + pipelineName, + regionName, + enable, + tcpipservice, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/__scripts__/discard_urimap.sh", TEST_ENVIRONMENT, - [urimapName, regionName]); + output = runCliScript(__dirname + "/__scripts__/discard_urimap.sh", TEST_ENVIRONMENT, [urimapName, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -149,32 +158,37 @@ describe("CICS discard urimap command", () => { const urimapPath = "fake/path"; const urimapHost = "www.example.com"; - let output = runCliScript(__dirname + "/../../define/urimap-client/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, urimapPath, urimapHost, regionName, enable, authenticate, certificate]); + let output = runCliScript(__dirname + "/../../define/urimap-client/__scripts__/define_urimap_client.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + regionName, + enable, + authenticate, + certificate, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/__scripts__/discard_urimap.sh", TEST_ENVIRONMENT, - [urimapName, regionName]); + output = runCliScript(__dirname + "/__scripts__/discard_urimap.sh", TEST_ENVIRONMENT, [urimapName, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, - [urimapName, csdGroup, regionName]); + output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap.sh", TEST_ENVIRONMENT, [urimapName, csdGroup, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -191,7 +205,6 @@ describe("CICS discard urimap command", () => { }); it("should be able to successfully discard a urimap of type server with profile options", async () => { - const urimapNameSuffixLength = 6; const urimapName = "X" + generateRandomAlphaNumericString(urimapNameSuffixLength); const urimapPath = "fake/path"; @@ -199,69 +212,73 @@ describe("CICS discard urimap command", () => { const programName = "FAKEPGM"; const urimapScheme = "HTTPS"; - let output = runCliScript(__dirname + "/../../define/urimap-server/__scripts__/define_urimap_server_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - urimapPath, - urimapHost, - urimapScheme, - programName, - regionName, - enable, - tcpipservice, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/urimap-server/__scripts__/define_urimap_server_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + urimapScheme, + programName, + regionName, + enable, + tcpipservice, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/__scripts__/discard_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/discard_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -269,7 +286,6 @@ describe("CICS discard urimap command", () => { }); it("should be able to successfully discard a pipeline of type server with profile options", async () => { - const urimapNameSuffixLength = 6; const urimapName = "X" + generateRandomAlphaNumericString(urimapNameSuffixLength); const urimapPath = "fake/path"; @@ -277,69 +293,73 @@ describe("CICS discard urimap command", () => { const pipelineName = "FAKEPIPE"; const urimapScheme = "HTTPS"; - let output = runCliScript(__dirname + "/../../define/urimap-pipeline/__scripts__/define_urimap_pipeline_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - urimapPath, - urimapHost, - urimapScheme, - pipelineName, - regionName, - enable, - tcpipservice, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/urimap-pipeline/__scripts__/define_urimap_pipeline_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + urimapScheme, + pipelineName, + regionName, + enable, + tcpipservice, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/__scripts__/discard_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/discard_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -347,76 +367,79 @@ describe("CICS discard urimap command", () => { }); it("should be able to successfully discard a urimap of type client with profile options", async () => { - const urimapNameSuffixLength = 6; const urimapName = "X" + generateRandomAlphaNumericString(urimapNameSuffixLength); const urimapPath = "fake/path"; const urimapHost = "www.example.com"; const urimapScheme = "HTTPS"; - let output = runCliScript(__dirname + "/../../define/urimap-client/__scripts__/define_urimap_client_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - urimapPath, - urimapHost, - urimapScheme, - regionName, - enable, - authenticate, - certificate, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/urimap-client/__scripts__/define_urimap_client_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + urimapPath, + urimapHost, + urimapScheme, + regionName, + enable, + authenticate, + certificate, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../install/urimap/__scripts__/install_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../discard/urimap/__scripts__/discard_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); await sleep(sleepTime); - output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, - [urimapName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/../../delete/urimap/__scripts__/delete_urimap_fully_qualified.sh", TEST_ENVIRONMENT, [ + urimapName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); diff --git a/packages/cli/__tests__/__system__/enable/urimap/cli.enable.urimap.system.test.ts b/packages/cli/__tests__/__system__/enable/urimap/cli.enable.urimap.system.test.ts index a1ba7a33..f809de75 100644 --- a/packages/cli/__tests__/__system__/enable/urimap/cli.enable.urimap.system.test.ts +++ b/packages/cli/__tests__/__system__/enable/urimap/cli.enable.urimap.system.test.ts @@ -15,12 +15,11 @@ import { ITestPropertiesSchema } from "../../../__src__/ITestPropertiesSchema"; let TEST_ENVIRONMENT: ITestEnvironment; describe("CICS enable urimap command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "enable_urimap", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); }); diff --git a/packages/cli/__tests__/__system__/get/resource/cli.get.resource.system.test.ts b/packages/cli/__tests__/__system__/get/resource/cli.get.resource.system.test.ts index 16d7cab6..a28a2b23 100644 --- a/packages/cli/__tests__/__system__/get/resource/cli.get.resource.system.test.ts +++ b/packages/cli/__tests__/__system__/get/resource/cli.get.resource.system.test.ts @@ -23,13 +23,12 @@ let protocol: string; let rejectUnauthorized: boolean; describe("cics get resource", () => { - // Create the unique test environment beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "get_resource_command", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; host = TEST_ENVIRONMENT.systemTestProperties.cics.host; @@ -52,8 +51,7 @@ describe("cics get resource", () => { }); it("should be able to successfully get resources", async () => { - const output = runCliScript(__dirname + "/__scripts__/get_resource.sh", TEST_ENVIRONMENT, - ["CICSProgram", regionName]); + const output = runCliScript(__dirname + "/__scripts__/get_resource.sh", TEST_ENVIRONMENT, ["CICSProgram", regionName]); const stderr = output.stderr.toString(); const stdout = output.stdout.toString(); expect(stderr).toEqual(""); @@ -62,15 +60,16 @@ describe("cics get resource", () => { }); it("should be able to successfully get resources using profile options", async () => { - const output = runCliScript(__dirname + "/__scripts__/get_resource_fully_qualified.sh", TEST_ENVIRONMENT, - ["CICSProgram", - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + const output = runCliScript(__dirname + "/__scripts__/get_resource_fully_qualified.sh", TEST_ENVIRONMENT, [ + "CICSProgram", + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); const stderr = output.stderr.toString(); const stdout = output.stdout.toString(); expect(stderr).toEqual(""); diff --git a/packages/cli/__tests__/__system__/install/program/cli.install.program.system.test.ts b/packages/cli/__tests__/__system__/install/program/cli.install.program.system.test.ts index 6bbad60a..bb35c2a9 100644 --- a/packages/cli/__tests__/__system__/install/program/cli.install.program.system.test.ts +++ b/packages/cli/__tests__/__system__/install/program/cli.install.program.system.test.ts @@ -26,12 +26,11 @@ let protocol: string; let rejectUnauthorized: boolean; describe("CICS install program command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "install_program", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -57,12 +56,14 @@ describe("CICS install program command", () => { user: cicsProperties.user, password: cicsProperties.password, rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); - return CicsCmciRestClient.deleteExpectParsedXml(session, + return CicsCmciRestClient.deleteExpectParsedXml( + session, `/${CicsCmciConstants.CICS_SYSTEM_MANAGEMENT}/CICSDefinitionProgram/${cmciProperties.regionName}` + - `?CRITERIA=(NAME=${programName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})`); + `?CRITERIA=(NAME=${programName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})` + ); }; const discardProgram = async (programName: string) => { @@ -75,12 +76,13 @@ describe("CICS install program command", () => { user: cicsProperties.user, password: cicsProperties.password, rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); - return CicsCmciRestClient.deleteExpectParsedXml(deleteSession, - `/${CicsCmciConstants.CICS_SYSTEM_MANAGEMENT}/CICSProgram/${cmciProperties.regionName}` + - `?CRITERIA=(PROGRAM=${programName})`); + return CicsCmciRestClient.deleteExpectParsedXml( + deleteSession, + `/${CicsCmciConstants.CICS_SYSTEM_MANAGEMENT}/CICSProgram/${cmciProperties.regionName}` + `?CRITERIA=(PROGRAM=${programName})` + ); }; it("should be able to display the help", () => { @@ -91,12 +93,14 @@ describe("CICS install program command", () => { }); it("should be able to successfully install a program with basic options", async () => { - // first define the program const programNameSuffixLength = 4; const programName = "AAA" + generateRandomAlphaNumericString(programNameSuffixLength); - let output = runCliScript(__dirname + "/../../define/program/__scripts__/define_program.sh", TEST_ENVIRONMENT, - [programName, csdGroup, regionName]); + let output = runCliScript(__dirname + "/../../define/program/__scripts__/define_program.sh", TEST_ENVIRONMENT, [ + programName, + csdGroup, + regionName, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -129,35 +133,36 @@ describe("CICS install program command", () => { }); it("should be able to successfully install a program with profile options", async () => { - // first define the program const programNameSuffixLength = 4; const programName = "AAA" + generateRandomAlphaNumericString(programNameSuffixLength); - let output = runCliScript(__dirname + "/../../define/program/__scripts__/define_program_fully_qualified.sh", TEST_ENVIRONMENT, - [programName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/program/__scripts__/define_program_fully_qualified.sh", TEST_ENVIRONMENT, [ + programName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/install_program_fully_qualified.sh", TEST_ENVIRONMENT, - [programName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/install_program_fully_qualified.sh", TEST_ENVIRONMENT, [ + programName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -165,5 +170,4 @@ describe("CICS install program command", () => { await discardProgram(programName); await deleteProgram(programName); }); - }); diff --git a/packages/cli/__tests__/__system__/install/transaction/cli.install.transaction.system.test.ts b/packages/cli/__tests__/__system__/install/transaction/cli.install.transaction.system.test.ts index af3d8a10..d5facc00 100644 --- a/packages/cli/__tests__/__system__/install/transaction/cli.install.transaction.system.test.ts +++ b/packages/cli/__tests__/__system__/install/transaction/cli.install.transaction.system.test.ts @@ -26,12 +26,11 @@ let protocol: string; let rejectUnauthorized: boolean; describe("CICS install transaction command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "install_transaction", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -57,12 +56,14 @@ describe("CICS install transaction command", () => { user: cicsProperties.user, password: cicsProperties.password, rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); - return CicsCmciRestClient.deleteExpectParsedXml(session, + return CicsCmciRestClient.deleteExpectParsedXml( + session, `/${CicsCmciConstants.CICS_SYSTEM_MANAGEMENT}/${CicsCmciConstants.CICS_DEFINITION_TRANSACTION}` + - `/${cmciProperties.regionName}?CRITERIA=(NAME=${transactionName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})`); + `/${cmciProperties.regionName}?CRITERIA=(NAME=${transactionName})&PARAMETER=CSDGROUP(${cmciProperties.csdGroup})` + ); }; const discardTransaction = async (transactionName: string) => { @@ -75,12 +76,14 @@ describe("CICS install transaction command", () => { user: cicsProperties.user, password: cicsProperties.password, rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); - return CicsCmciRestClient.deleteExpectParsedXml(deleteSession, + return CicsCmciRestClient.deleteExpectParsedXml( + deleteSession, `/${CicsCmciConstants.CICS_SYSTEM_MANAGEMENT}/${CicsCmciConstants.CICS_LOCAL_TRANSACTION}/${cmciProperties.regionName}` + - `?CRITERIA=(TRANID=${transactionName})`); + `?CRITERIA=(TRANID=${transactionName})` + ); }; it("should be able to display the help", () => { @@ -91,12 +94,15 @@ describe("CICS install transaction command", () => { }); it("should be able to successfully install a transaction with basic options", async () => { - // first define the transaction const transactionNameSuffixLength = 3; const transactionName = "X" + generateRandomAlphaNumericString(transactionNameSuffixLength); - let output = runCliScript(__dirname + "/../../define/transaction/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, - [transactionName, "program1", csdGroup, regionName]); + let output = runCliScript(__dirname + "/../../define/transaction/__scripts__/define_transaction.sh", TEST_ENVIRONMENT, [ + transactionName, + "program1", + csdGroup, + regionName, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -129,36 +135,37 @@ describe("CICS install transaction command", () => { }); it("should be able to successfully install a transaction with profile options", async () => { - // first define the transaction const transactionNameSuffixLength = 3; const transactionName = "X" + generateRandomAlphaNumericString(transactionNameSuffixLength); - let output = runCliScript(__dirname + "/../../define/transaction/__scripts__/define_transaction_fully_qualified.sh", TEST_ENVIRONMENT, - [transactionName, - "program1", - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../define/transaction/__scripts__/define_transaction_fully_qualified.sh", TEST_ENVIRONMENT, [ + transactionName, + "program1", + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/install_transaction_fully_qualified.sh", TEST_ENVIRONMENT, - [transactionName, - csdGroup, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/install_transaction_fully_qualified.sh", TEST_ENVIRONMENT, [ + transactionName, + csdGroup, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -166,5 +173,4 @@ describe("CICS install transaction command", () => { await discardTransaction(transactionName); await deleteTransaction(transactionName); }); - }); diff --git a/packages/cli/__tests__/__system__/install/urimap/cli.install.urimap.system.test.ts b/packages/cli/__tests__/__system__/install/urimap/cli.install.urimap.system.test.ts index 235a2786..fe8d5f08 100644 --- a/packages/cli/__tests__/__system__/install/urimap/cli.install.urimap.system.test.ts +++ b/packages/cli/__tests__/__system__/install/urimap/cli.install.urimap.system.test.ts @@ -15,12 +15,11 @@ import { ITestPropertiesSchema } from "../../../__src__/ITestPropertiesSchema"; let TEST_ENVIRONMENT: ITestEnvironment; describe("CICS install urimap command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "install_urimap", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); }); diff --git a/packages/cli/__tests__/__system__/refresh/program/cli.refresh.program.system.test.ts b/packages/cli/__tests__/__system__/refresh/program/cli.refresh.program.system.test.ts index a7d6fa03..10ad4a8e 100644 --- a/packages/cli/__tests__/__system__/refresh/program/cli.refresh.program.system.test.ts +++ b/packages/cli/__tests__/__system__/refresh/program/cli.refresh.program.system.test.ts @@ -25,12 +25,11 @@ let password: string; let ru: boolean; describe("CICS refresh program command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "refresh_program", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -47,7 +46,7 @@ describe("CICS refresh program command", () => { port, type: "basic", rejectUnauthorized: ru, - protocol: TEST_ENVIRONMENT.systemTestProperties.cics.protocol as any || "https", + protocol: (TEST_ENVIRONMENT.systemTestProperties.cics.protocol as any) || "https", }); }); @@ -55,7 +54,6 @@ describe("CICS refresh program command", () => { await TestEnvironment.cleanUp(TEST_ENVIRONMENT); }); - it("should be able to display the help", () => { const output = runCliScript(__dirname + "/__scripts__/refresh_program_help.sh", TEST_ENVIRONMENT, []); expect(output.stderr.toString()).toEqual(""); @@ -71,7 +69,7 @@ describe("CICS refresh program command", () => { const options: IProgramParms = { name: programName, csdGroup, - regionName + regionName, }; await defineProgram(session, options); @@ -104,19 +102,20 @@ describe("CICS refresh program command", () => { const options: IProgramParms = { name: programName, csdGroup, - regionName + regionName, }; await defineProgram(session, options); await installProgram(session, options); - const output = runCliScript(__dirname + "/__scripts__/refresh_program.sh", TEST_ENVIRONMENT, - [programName, - regionName, - host, - port, - user, - password]); + const output = runCliScript(__dirname + "/__scripts__/refresh_program.sh", TEST_ENVIRONMENT, [ + programName, + regionName, + host, + port, + user, + password, + ]); const stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); diff --git a/packages/cli/__tests__/__system__/remove-from-list/csdGroup/cli.remove-from-list.csdGroup.system.test.ts b/packages/cli/__tests__/__system__/remove-from-list/csdGroup/cli.remove-from-list.csdGroup.system.test.ts index e5954dc7..5cb7e288 100644 --- a/packages/cli/__tests__/__system__/remove-from-list/csdGroup/cli.remove-from-list.csdGroup.system.test.ts +++ b/packages/cli/__tests__/__system__/remove-from-list/csdGroup/cli.remove-from-list.csdGroup.system.test.ts @@ -22,12 +22,11 @@ let password: string; let protocol: string; let rejectUnauthorized: boolean; describe("CICS remove-from-list csdGroup command", () => { - beforeAll(async () => { TEST_ENVIRONMENT = await TestEnvironment.setUp({ testName: "remove_from_list_csdGroup", installPlugin: true, - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = TEST_ENVIRONMENT.systemTestProperties.cmci.csdGroup; regionName = TEST_ENVIRONMENT.systemTestProperties.cmci.regionName; @@ -51,8 +50,7 @@ describe("CICS remove-from-list csdGroup command", () => { }); it("should get a syntax error if csdGroup name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/remove_from_list_csdGroup.sh", TEST_ENVIRONMENT, - ["", "FAKELIST", "FAKERGN"]); + const output = runCliScript(__dirname + "/__scripts__/remove_from_list_csdGroup.sh", TEST_ENVIRONMENT, ["", "FAKELIST", "FAKERGN"]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("Missing Positional Argument"); @@ -61,8 +59,7 @@ describe("CICS remove-from-list csdGroup command", () => { }); it("should get a syntax error if list name is omitted", () => { - const output = runCliScript(__dirname + "/__scripts__/remove_from_list_csdGroup.sh", TEST_ENVIRONMENT, - ["FAKEGRP", "", "FAKERGN"]); + const output = runCliScript(__dirname + "/__scripts__/remove_from_list_csdGroup.sh", TEST_ENVIRONMENT, ["FAKEGRP", "", "FAKERGN"]); const stderr = output.stderr.toString(); expect(stderr).toContain("Syntax"); expect(stderr).toContain("Missing Positional Argument"); @@ -72,15 +69,17 @@ describe("CICS remove-from-list csdGroup command", () => { it("should be able to successfully add and remove a csdGroup to/from a list with basic options", async () => { const dummyList = "TESTLIST"; - let output = runCliScript(__dirname + "/../../add-to-list/csdGroup/__scripts__/add_to_list_csdGroup.sh", TEST_ENVIRONMENT, - [csdGroup, dummyList, regionName]); + let output = runCliScript(__dirname + "/../../add-to-list/csdGroup/__scripts__/add_to_list_csdGroup.sh", TEST_ENVIRONMENT, [ + csdGroup, + dummyList, + regionName, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/remove_from_list_csdGroup.sh", TEST_ENVIRONMENT, - [csdGroup, dummyList, regionName]); + output = runCliScript(__dirname + "/__scripts__/remove_from_list_csdGroup.sh", TEST_ENVIRONMENT, [csdGroup, dummyList, regionName]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); @@ -89,31 +88,33 @@ describe("CICS remove-from-list csdGroup command", () => { it("should be able to successfully add and remove a csdGroup to/from a list with profile options", async () => { const dummyList = "TESTLIST"; - let output = runCliScript(__dirname + "/../../add-to-list/csdGroup/__scripts__/add_to_list_csdGroup_fully_qualified.sh", TEST_ENVIRONMENT, - [csdGroup, - dummyList, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + let output = runCliScript(__dirname + "/../../add-to-list/csdGroup/__scripts__/add_to_list_csdGroup_fully_qualified.sh", TEST_ENVIRONMENT, [ + csdGroup, + dummyList, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); let stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); expect(output.stdout.toString()).toContain("success"); - output = runCliScript(__dirname + "/__scripts__/remove_from_list_csdGroup_fully_qualified.sh", TEST_ENVIRONMENT, - [csdGroup, - dummyList, - regionName, - host, - port, - user, - password, - protocol, - rejectUnauthorized]); + output = runCliScript(__dirname + "/__scripts__/remove_from_list_csdGroup_fully_qualified.sh", TEST_ENVIRONMENT, [ + csdGroup, + dummyList, + regionName, + host, + port, + user, + password, + protocol, + rejectUnauthorized, + ]); stderr = output.stderr.toString(); expect(stderr).toEqual(""); expect(output.status).toEqual(0); diff --git a/packages/cli/__tests__/__unit__/add-to-list/AddToList.definition.unit.test.ts b/packages/cli/__tests__/__unit__/add-to-list/AddToList.definition.unit.test.ts index 41d6501b..9ef6b341 100644 --- a/packages/cli/__tests__/__unit__/add-to-list/AddToList.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/add-to-list/AddToList.definition.unit.test.ts @@ -14,7 +14,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics add-to-list", () => { const ADD_TO_LIST_RESOURCES = 1; - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../src/add-to-list/AddToList.definition"); expect(definition).toBeDefined(); expect(definition.children.length).toBe(ADD_TO_LIST_RESOURCES); diff --git a/packages/cli/__tests__/__unit__/add-to-list/csdGroup/CSDGroup.definition.unit.test.ts b/packages/cli/__tests__/__unit__/add-to-list/csdGroup/CSDGroup.definition.unit.test.ts index 91b4a0d5..446a53fe 100644 --- a/packages/cli/__tests__/__unit__/add-to-list/csdGroup/CSDGroup.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/add-to-list/csdGroup/CSDGroup.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics add-to-list csdGroup", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/add-to-list/csdGroup/CSDGroup.definition").CSDGroupDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/add-to-list/csdGroup/CSDGroup.handler.unit.test.ts b/packages/cli/__tests__/__unit__/add-to-list/csdGroup/CSDGroup.handler.unit.test.ts index f34c3545..7bd1241c 100644 --- a/packages/cli/__tests__/__unit__/add-to-list/csdGroup/CSDGroup.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/add-to-list/csdGroup/CSDGroup.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "add-to-list", "csdGroup"], definition: CSDGroupDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("AddToListProgramHandler", () => { @@ -50,9 +50,9 @@ describe("AddToListProgramHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(AddToList, "addCSDGroupToList"); @@ -65,7 +65,7 @@ describe("AddToListProgramHandler", () => { it("should call the addCSDGroupToList api", async () => { const handler = new CSDGroupHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, name, @@ -76,7 +76,7 @@ describe("AddToListProgramHandler", () => { user, password, rejectUnauthorized, - protocol + protocol, }; await handler.process(commandParameters); @@ -91,12 +91,12 @@ describe("AddToListProgramHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name, csdList, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/define/Define.definition.unit.test.ts b/packages/cli/__tests__/__unit__/define/Define.definition.unit.test.ts index ca690d14..5f893a11 100644 --- a/packages/cli/__tests__/__unit__/define/Define.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/define/Define.definition.unit.test.ts @@ -14,7 +14,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics define program", () => { const DEFINE_RESOURCES = 6; - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../src/define/Define.definition"); expect(definition).toBeDefined(); expect(definition.children.length).toBe(DEFINE_RESOURCES); diff --git a/packages/cli/__tests__/__unit__/define/program/Program.definition.unit.test.ts b/packages/cli/__tests__/__unit__/define/program/Program.definition.unit.test.ts index 7ea7d19b..babd6d01 100644 --- a/packages/cli/__tests__/__unit__/define/program/Program.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/define/program/Program.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics define program", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/define/program/Program.definition").ProgramDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/define/program/Program.handler.unit.test.ts b/packages/cli/__tests__/__unit__/define/program/Program.handler.unit.test.ts index ef36fe9d..5298bffb 100644 --- a/packages/cli/__tests__/__unit__/define/program/Program.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/define/program/Program.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "define", "program"], definition: ProgramDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DefineProgramHandler", () => { @@ -50,9 +50,9 @@ describe("DefineProgramHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Define, "defineProgram"); @@ -65,7 +65,7 @@ describe("DefineProgramHandler", () => { it("should call the defineProgram api", async () => { const handler = new ProgramHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, programName, @@ -76,7 +76,7 @@ describe("DefineProgramHandler", () => { user, password, rejectUnauthorized, - protocol + protocol, }; await handler.process(commandParameters); @@ -91,12 +91,12 @@ describe("DefineProgramHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: programName, csdGroup, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/define/transaction/Transaction.definition.unit.test.ts b/packages/cli/__tests__/__unit__/define/transaction/Transaction.definition.unit.test.ts index 10585cfe..58b0f92a 100644 --- a/packages/cli/__tests__/__unit__/define/transaction/Transaction.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/define/transaction/Transaction.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics define program", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/define/transaction/Transaction.definition").TransactionDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/define/transaction/Transaction.handler.unit.test.ts b/packages/cli/__tests__/__unit__/define/transaction/Transaction.handler.unit.test.ts index 82a91d2f..5c8568be 100644 --- a/packages/cli/__tests__/__unit__/define/transaction/Transaction.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/define/transaction/Transaction.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "define", "transaction"], definition: TransactionDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DefineTransactionHandler", () => { @@ -51,9 +51,9 @@ describe("DefineTransactionHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Define, "defineTransaction"); @@ -66,7 +66,7 @@ describe("DefineTransactionHandler", () => { it("should call the defineTransaction api", async () => { const handler = new TransactionHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, transactionName, @@ -78,7 +78,7 @@ describe("DefineTransactionHandler", () => { user, password, rejectUnauthorized, - protocol + protocol, }; await handler.process(commandParameters); @@ -93,13 +93,13 @@ describe("DefineTransactionHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: transactionName, programName, csdGroup, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/define/urimap-client/UrimapClient.definition.unit.test.ts b/packages/cli/__tests__/__unit__/define/urimap-client/UrimapClient.definition.unit.test.ts index 841c80e6..7e43365e 100644 --- a/packages/cli/__tests__/__unit__/define/urimap-client/UrimapClient.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/define/urimap-client/UrimapClient.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics define urimap-client", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/define/urimap-client/UrimapClient.definition").UrimapClientDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/define/urimap-client/UrimapClient.handler.unit.test.ts b/packages/cli/__tests__/__unit__/define/urimap-client/UrimapClient.handler.unit.test.ts index 6942c834..38b6b129 100644 --- a/packages/cli/__tests__/__unit__/define/urimap-client/UrimapClient.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/define/urimap-client/UrimapClient.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "define", "urimap-client"], definition: UrimapClientDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DefineUrimapClientHandler", () => { @@ -57,9 +57,9 @@ describe("DefineUrimapClientHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Define, "defineUrimapClient"); @@ -72,7 +72,7 @@ describe("DefineUrimapClientHandler", () => { it("should call the defineUrimapClient api", async () => { const handler = new UrimapClientHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, urimapName, @@ -90,7 +90,7 @@ describe("DefineUrimapClientHandler", () => { user, password, rejectUnauthorized, - protocol + protocol, }; await handler.process(commandParameters); @@ -105,7 +105,7 @@ describe("DefineUrimapClientHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: urimapName, @@ -118,7 +118,7 @@ describe("DefineUrimapClientHandler", () => { enable, description: undefined, authenticate, - certificate + certificate, } ); }); diff --git a/packages/cli/__tests__/__unit__/define/urimap-pipeline/UrimapPipeline.definition.unit.test.ts b/packages/cli/__tests__/__unit__/define/urimap-pipeline/UrimapPipeline.definition.unit.test.ts index 8a652030..1f544428 100644 --- a/packages/cli/__tests__/__unit__/define/urimap-pipeline/UrimapPipeline.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/define/urimap-pipeline/UrimapPipeline.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics define urimap-pipeline", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const path = "../../../../src/define/urimap-pipeline/UrimapPipeline.definition"; const definition: ICommandDefinition = require(path).UrimapPipelineDefinition; expect(definition).toBeDefined(); diff --git a/packages/cli/__tests__/__unit__/define/urimap-pipeline/UrimapPipeline.handler.unit.test.ts b/packages/cli/__tests__/__unit__/define/urimap-pipeline/UrimapPipeline.handler.unit.test.ts index 9d3632d5..21dd0a09 100644 --- a/packages/cli/__tests__/__unit__/define/urimap-pipeline/UrimapPipeline.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/define/urimap-pipeline/UrimapPipeline.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "define", "urimap-pipeline"], definition: UrimapPipelineDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DefineUrimapPipelineHandler", () => { @@ -60,9 +60,9 @@ describe("DefineUrimapPipelineHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Define, "defineUrimapPipeline"); @@ -75,7 +75,7 @@ describe("DefineUrimapPipelineHandler", () => { it("should call the defineUrimapPipeline api with required options specified", async () => { const handler = new UrimapPipelineHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, urimapName, @@ -92,7 +92,7 @@ describe("DefineUrimapPipelineHandler", () => { user, password, rejectUnauthorized, - protocol + protocol, }; await handler.process(commandParameters); @@ -107,7 +107,7 @@ describe("DefineUrimapPipelineHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: urimapName, @@ -121,7 +121,7 @@ describe("DefineUrimapPipelineHandler", () => { enable, description: undefined, transactionName: undefined, - webserviceName: undefined + webserviceName: undefined, } ); }); @@ -129,7 +129,7 @@ describe("DefineUrimapPipelineHandler", () => { it("should call the defineUrimapPipeline api with all options specified", async () => { const handler = new UrimapPipelineHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, urimapName, @@ -149,7 +149,7 @@ describe("DefineUrimapPipelineHandler", () => { user, password, rejectUnauthorized, - protocol + protocol, }; await handler.process(commandParameters); @@ -164,7 +164,7 @@ describe("DefineUrimapPipelineHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: urimapName, @@ -178,7 +178,7 @@ describe("DefineUrimapPipelineHandler", () => { transactionName, webserviceName, regionName, - cicsPlex + cicsPlex, } ); }); diff --git a/packages/cli/__tests__/__unit__/define/urimap-server/UrimapServer.definition.unit.test.ts b/packages/cli/__tests__/__unit__/define/urimap-server/UrimapServer.definition.unit.test.ts index d93eefdb..974ce3ac 100644 --- a/packages/cli/__tests__/__unit__/define/urimap-server/UrimapServer.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/define/urimap-server/UrimapServer.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics define urimap-server", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/define/urimap-server/UrimapServer.definition").UrimapServerDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/define/urimap-server/UrimapServer.handler.unit.test.ts b/packages/cli/__tests__/__unit__/define/urimap-server/UrimapServer.handler.unit.test.ts index 848166f0..e4df97c8 100644 --- a/packages/cli/__tests__/__unit__/define/urimap-server/UrimapServer.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/define/urimap-server/UrimapServer.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "define", "urimap-server"], definition: UrimapServerDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DefineUrimapServerHandler", () => { @@ -57,9 +57,9 @@ describe("DefineUrimapServerHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Define, "defineUrimapServer"); @@ -72,7 +72,7 @@ describe("DefineUrimapServerHandler", () => { it("should call the defineUrimapServer api", async () => { const handler = new UrimapServerHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, urimapName, @@ -90,7 +90,7 @@ describe("DefineUrimapServerHandler", () => { user, password, rejectUnauthorized, - protocol + protocol, }; await handler.process(commandParameters); @@ -105,7 +105,7 @@ describe("DefineUrimapServerHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: urimapName, @@ -118,7 +118,7 @@ describe("DefineUrimapServerHandler", () => { cicsPlex, enable, tcpipservice, - description: undefined + description: undefined, } ); }); diff --git a/packages/cli/__tests__/__unit__/define/webservice/Webservice.definition.unit.test.ts b/packages/cli/__tests__/__unit__/define/webservice/Webservice.definition.unit.test.ts index 3df5735d..b7e1f4ae 100644 --- a/packages/cli/__tests__/__unit__/define/webservice/Webservice.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/define/webservice/Webservice.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics define webservice", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const path = "../../../../src/define/webservice/Webservice.definition"; const definition: ICommandDefinition = require(path).WebServiceDefinition; expect(definition).toBeDefined(); diff --git a/packages/cli/__tests__/__unit__/define/webservice/Webservice.handler.unit.test.ts b/packages/cli/__tests__/__unit__/define/webservice/Webservice.handler.unit.test.ts index 87f1e0d0..2432e246 100644 --- a/packages/cli/__tests__/__unit__/define/webservice/Webservice.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/define/webservice/Webservice.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "define", "webservice"], definition: WebServiceDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DefineWebserviceHandler", () => { @@ -53,9 +53,9 @@ describe("DefineWebserviceHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Define, "defineWebservice"); @@ -68,7 +68,7 @@ describe("DefineWebserviceHandler", () => { it("should call the defineWebservice api", async () => { const handler = new WebServiceHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, webserviceName: websvcName, @@ -82,7 +82,7 @@ describe("DefineWebserviceHandler", () => { user, password, rejectUnauthorized, - protocol + protocol, }; await handler.process(commandParameters); @@ -97,7 +97,7 @@ describe("DefineWebserviceHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: websvcName, @@ -105,7 +105,7 @@ describe("DefineWebserviceHandler", () => { pipelineName, wsBind, regionName, - cicsPlex + cicsPlex, } ); }); diff --git a/packages/cli/__tests__/__unit__/delete/Delete.definition.unit.test.ts b/packages/cli/__tests__/__unit__/delete/Delete.definition.unit.test.ts index b1c0fc30..2538fe2b 100644 --- a/packages/cli/__tests__/__unit__/delete/Delete.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/delete/Delete.definition.unit.test.ts @@ -14,7 +14,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics delete program", () => { const DELETE_RESOURCES = 4; - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../src/delete/Delete.definition"); expect(definition).toBeDefined(); expect(definition.children.length).toBe(DELETE_RESOURCES); diff --git a/packages/cli/__tests__/__unit__/delete/program/Program.definition.unit.test.ts b/packages/cli/__tests__/__unit__/delete/program/Program.definition.unit.test.ts index d9cd1e7e..befc580c 100644 --- a/packages/cli/__tests__/__unit__/delete/program/Program.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/delete/program/Program.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics delete program", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/delete/program/Program.definition").ProgramDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/delete/program/Program.handler.unit.test.ts b/packages/cli/__tests__/__unit__/delete/program/Program.handler.unit.test.ts index 0ff0660f..04dc35c6 100644 --- a/packages/cli/__tests__/__unit__/delete/program/Program.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/delete/program/Program.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "delete", "program"], definition: ProgramDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DiscardProgramHandler", () => { @@ -50,9 +50,9 @@ describe("DiscardProgramHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Discard, "deleteProgram"); @@ -65,7 +65,7 @@ describe("DiscardProgramHandler", () => { it("should call the deleteProgram api", async () => { const handler = new ProgramHandler(); const testProfile = PROFILE_MAP.get("cics")[0]; - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, programName, @@ -76,7 +76,7 @@ describe("DiscardProgramHandler", () => { user, password, rejectUnauthorized, - protocol + protocol, }; await handler.process(commandParameters); @@ -90,12 +90,12 @@ describe("DiscardProgramHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: programName, csdGroup, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/delete/transaction/Transaction.definition.unit.test.ts b/packages/cli/__tests__/__unit__/delete/transaction/Transaction.definition.unit.test.ts index 30c36792..ac7fb032 100644 --- a/packages/cli/__tests__/__unit__/delete/transaction/Transaction.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/delete/transaction/Transaction.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics delete transaction", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/delete/transaction/Transaction.definition").TransactionDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/delete/transaction/Transaction.handler.unit.test.ts b/packages/cli/__tests__/__unit__/delete/transaction/Transaction.handler.unit.test.ts index 6ad531d8..21e2c3d2 100644 --- a/packages/cli/__tests__/__unit__/delete/transaction/Transaction.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/delete/transaction/Transaction.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "delete", "transaction"], definition: TransactionDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DiscardTransactionHandler", () => { @@ -50,9 +50,9 @@ describe("DiscardTransactionHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Discard, "deleteTransaction"); @@ -65,7 +65,7 @@ describe("DiscardTransactionHandler", () => { it("should call the deleteTransaction api", async () => { const handler = new TransactionHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, transactionName, @@ -76,7 +76,7 @@ describe("DiscardTransactionHandler", () => { user, password, protocol, - rejectUnauthorized + rejectUnauthorized, }; await handler.process(commandParameters); @@ -91,12 +91,12 @@ describe("DiscardTransactionHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: transactionName, csdGroup, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/delete/urimap/Urimap.definition.unit.test.ts b/packages/cli/__tests__/__unit__/delete/urimap/Urimap.definition.unit.test.ts index a20fcc79..059f9636 100644 --- a/packages/cli/__tests__/__unit__/delete/urimap/Urimap.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/delete/urimap/Urimap.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics delete urimap", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/delete/urimap/Urimap.definition").UrimapDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/delete/urimap/Urimap.handler.unit.test.ts b/packages/cli/__tests__/__unit__/delete/urimap/Urimap.handler.unit.test.ts index fc4e1c27..7c7922bc 100644 --- a/packages/cli/__tests__/__unit__/delete/urimap/Urimap.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/delete/urimap/Urimap.handler.unit.test.ts @@ -26,8 +26,8 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, @@ -35,14 +35,14 @@ PROFILE_MAP.set( user, password, protocol, - rejectUnauthorized - }] -); + rejectUnauthorized, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "delete", "urimap"], definition: UrimapDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DeleteUrimapHandler", () => { @@ -52,9 +52,9 @@ describe("DeleteUrimapHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Delete, "deleteUrimap"); @@ -67,7 +67,7 @@ describe("DeleteUrimapHandler", () => { it("should call the deleteUrimap api", async () => { const handler = new UrimapHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, urimapName, @@ -78,7 +78,7 @@ describe("DeleteUrimapHandler", () => { user, password, protocol, - rejectUnauthorized + rejectUnauthorized, }; await handler.process(commandParameters); @@ -93,12 +93,12 @@ describe("DeleteUrimapHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: urimapName, csdGroup, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/delete/webservice/Webservice.definition.test.ts b/packages/cli/__tests__/__unit__/delete/webservice/Webservice.definition.test.ts index 5f0f0b82..90dfd5cb 100644 --- a/packages/cli/__tests__/__unit__/delete/webservice/Webservice.definition.test.ts +++ b/packages/cli/__tests__/__unit__/delete/webservice/Webservice.definition.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics delete web service", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/delete/webservice/Webservice.definition").WebServiceDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/delete/webservice/Webservice.handler.test.ts b/packages/cli/__tests__/__unit__/delete/webservice/Webservice.handler.test.ts index a8ca0460..ec89b0a0 100644 --- a/packages/cli/__tests__/__unit__/delete/webservice/Webservice.handler.test.ts +++ b/packages/cli/__tests__/__unit__/delete/webservice/Webservice.handler.test.ts @@ -26,8 +26,8 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, @@ -35,14 +35,14 @@ PROFILE_MAP.set( user, password, protocol, - rejectUnauthorized - }] -); + rejectUnauthorized, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "delete", "webservice"], definition: WebServiceDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DeleteWebserviceHandler", () => { @@ -52,9 +52,9 @@ describe("DeleteWebserviceHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Delete, "deleteWebservice"); @@ -67,7 +67,7 @@ describe("DeleteWebserviceHandler", () => { it("should call the deleteWebservice api", async () => { const handler = new WebServiceHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, webserviceName, @@ -78,7 +78,7 @@ describe("DeleteWebserviceHandler", () => { user, password, protocol, - rejectUnauthorized + rejectUnauthorized, }; await handler.process(commandParameters); @@ -93,12 +93,12 @@ describe("DeleteWebserviceHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: webserviceName, csdGroup, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/disable/Disable.definition.unit.test.ts b/packages/cli/__tests__/__unit__/disable/Disable.definition.unit.test.ts index 9c31c0e4..f100d307 100644 --- a/packages/cli/__tests__/__unit__/disable/Disable.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/disable/Disable.definition.unit.test.ts @@ -14,7 +14,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics disable urimap", () => { const DISABLE_RESOURCES = 1; - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../src/disable/Disable.definition"); expect(definition).toBeDefined(); expect(definition.children.length).toBe(DISABLE_RESOURCES); diff --git a/packages/cli/__tests__/__unit__/disable/urimap/Urimap.definition.unit.test.ts b/packages/cli/__tests__/__unit__/disable/urimap/Urimap.definition.unit.test.ts index 33add3d3..edf7ec39 100644 --- a/packages/cli/__tests__/__unit__/disable/urimap/Urimap.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/disable/urimap/Urimap.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics disable urimap", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/disable/urimap/Urimap.definition").UrimapDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/disable/urimap/Urimap.handler.unit.test.ts b/packages/cli/__tests__/__unit__/disable/urimap/Urimap.handler.unit.test.ts index 7b82ffa8..268392f9 100644 --- a/packages/cli/__tests__/__unit__/disable/urimap/Urimap.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/disable/urimap/Urimap.handler.unit.test.ts @@ -26,8 +26,8 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, @@ -35,14 +35,14 @@ PROFILE_MAP.set( user, password, protocol, - rejectUnauthorized - }] -); + rejectUnauthorized, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "disable", "urimap"], definition: UrimapDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DisableUrimapHandler", () => { @@ -51,9 +51,9 @@ describe("DisableUrimapHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Disable, "disableUrimap"); @@ -66,7 +66,7 @@ describe("DisableUrimapHandler", () => { it("should call the disableUrimap api", async () => { const handler = new UrimapHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, urimapName, @@ -76,7 +76,7 @@ describe("DisableUrimapHandler", () => { user, password, protocol, - rejectUnauthorized + rejectUnauthorized, }; await handler.process(commandParameters); @@ -91,11 +91,11 @@ describe("DisableUrimapHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: urimapName, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/discard/Discard.definition.unit.test.ts b/packages/cli/__tests__/__unit__/discard/Discard.definition.unit.test.ts index 3baa5531..0b346c59 100644 --- a/packages/cli/__tests__/__unit__/discard/Discard.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/discard/Discard.definition.unit.test.ts @@ -14,7 +14,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics discard program", () => { const DISCARD_RESOURCES = 3; - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../src/discard/Discard.definition"); expect(definition).toBeDefined(); expect(definition.children.length).toBe(DISCARD_RESOURCES); diff --git a/packages/cli/__tests__/__unit__/discard/program/Program.definition.unit.test.ts b/packages/cli/__tests__/__unit__/discard/program/Program.definition.unit.test.ts index cf4d7511..ab1c0088 100644 --- a/packages/cli/__tests__/__unit__/discard/program/Program.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/discard/program/Program.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics discard program", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/discard/program/Program.definition").ProgramDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/discard/program/Program.handler.unit.test.ts b/packages/cli/__tests__/__unit__/discard/program/Program.handler.unit.test.ts index 8fc8ff73..a20b9654 100644 --- a/packages/cli/__tests__/__unit__/discard/program/Program.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/discard/program/Program.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "discard", "program"], definition: ProgramDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DiscardProgramHandler", () => { @@ -50,9 +50,9 @@ describe("DiscardProgramHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Discard, "discardProgram"); @@ -65,7 +65,7 @@ describe("DiscardProgramHandler", () => { it("should call the discardProgram api", async () => { const handler = new ProgramHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, programName, @@ -76,7 +76,7 @@ describe("DiscardProgramHandler", () => { user, password, protocol, - rejectUnauthorized + rejectUnauthorized, }; await handler.process(commandParameters); @@ -91,11 +91,11 @@ describe("DiscardProgramHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: programName, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/discard/transaction/Transaction.definition.unit.test.ts b/packages/cli/__tests__/__unit__/discard/transaction/Transaction.definition.unit.test.ts index f524c4d5..6dae3a4d 100644 --- a/packages/cli/__tests__/__unit__/discard/transaction/Transaction.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/discard/transaction/Transaction.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics discard transaction", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/discard/transaction/Transaction.definition").TransactionDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/discard/transaction/Transaction.handler.unit.test.ts b/packages/cli/__tests__/__unit__/discard/transaction/Transaction.handler.unit.test.ts index 635b25e5..fb40cf1d 100644 --- a/packages/cli/__tests__/__unit__/discard/transaction/Transaction.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/discard/transaction/Transaction.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "discard", "program"], definition: TransactionDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DiscardTransactionHandler", () => { @@ -50,9 +50,9 @@ describe("DiscardTransactionHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Discard, "discardTransaction"); @@ -65,7 +65,7 @@ describe("DiscardTransactionHandler", () => { it("should call the discardTransaction api", async () => { const handler = new TransactionHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, transactionName, @@ -76,7 +76,7 @@ describe("DiscardTransactionHandler", () => { user, password, protocol, - rejectUnauthorized + rejectUnauthorized, }; await handler.process(commandParameters); @@ -91,11 +91,11 @@ describe("DiscardTransactionHandler", () => { user: testProfile.user, password: testProfile.password, protocol, - rejectUnauthorized + rejectUnauthorized, }), { name: transactionName, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/discard/urimap/Urimap.definition.unit.test.ts b/packages/cli/__tests__/__unit__/discard/urimap/Urimap.definition.unit.test.ts index c4d4d7c7..7a470331 100644 --- a/packages/cli/__tests__/__unit__/discard/urimap/Urimap.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/discard/urimap/Urimap.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics discard urimap", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/discard/urimap/Urimap.definition").UrimapDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/discard/urimap/Urimap.handler.unit.test.ts b/packages/cli/__tests__/__unit__/discard/urimap/Urimap.handler.unit.test.ts index 563323c9..d6d7cbb7 100644 --- a/packages/cli/__tests__/__unit__/discard/urimap/Urimap.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/discard/urimap/Urimap.handler.unit.test.ts @@ -26,8 +26,8 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, @@ -35,14 +35,14 @@ PROFILE_MAP.set( user, password, protocol, - rejectUnauthorized - }] -); + rejectUnauthorized, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "discard", "urimap"], definition: UrimapDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("DiscardUrimapHandler", () => { @@ -51,9 +51,9 @@ describe("DiscardUrimapHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Discard, "discardUrimap"); @@ -66,7 +66,7 @@ describe("DiscardUrimapHandler", () => { it("should call the discardUrimap api", async () => { const handler = new UrimapHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, urimapName, @@ -76,7 +76,7 @@ describe("DiscardUrimapHandler", () => { user, password, protocol, - rejectUnauthorized + rejectUnauthorized, }; await handler.process(commandParameters); @@ -91,11 +91,11 @@ describe("DiscardUrimapHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: urimapName, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/enable/Enable.definition.unit.test.ts b/packages/cli/__tests__/__unit__/enable/Enable.definition.unit.test.ts index 7f7088a4..cc8542a8 100644 --- a/packages/cli/__tests__/__unit__/enable/Enable.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/enable/Enable.definition.unit.test.ts @@ -14,7 +14,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics enable urimap", () => { const ENABLE_RESOURCES = 1; - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../src/enable/Enable.definition"); expect(definition).toBeDefined(); expect(definition.children.length).toBe(ENABLE_RESOURCES); diff --git a/packages/cli/__tests__/__unit__/enable/urimap/Urimap.definition.unit.test.ts b/packages/cli/__tests__/__unit__/enable/urimap/Urimap.definition.unit.test.ts index 8f1fd496..45c4998a 100644 --- a/packages/cli/__tests__/__unit__/enable/urimap/Urimap.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/enable/urimap/Urimap.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics enable urimap", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/enable/urimap/Urimap.definition").UrimapDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/enable/urimap/Urimap.handler.unit.test.ts b/packages/cli/__tests__/__unit__/enable/urimap/Urimap.handler.unit.test.ts index 1f94dad4..b2c84a56 100644 --- a/packages/cli/__tests__/__unit__/enable/urimap/Urimap.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/enable/urimap/Urimap.handler.unit.test.ts @@ -26,8 +26,8 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, @@ -35,14 +35,14 @@ PROFILE_MAP.set( user, password, protocol, - rejectUnauthorized - }] -); + rejectUnauthorized, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "enable", "urimap"], definition: UrimapDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("enableUrimapHandler", () => { @@ -51,9 +51,9 @@ describe("enableUrimapHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Enable, "enableUrimap"); @@ -66,7 +66,7 @@ describe("enableUrimapHandler", () => { it("should call the enableUrimap api", async () => { const handler = new UrimapHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, urimapName, @@ -76,7 +76,7 @@ describe("enableUrimapHandler", () => { user, password, protocol, - rejectUnauthorized + rejectUnauthorized, }; await handler.process(commandParameters); @@ -91,11 +91,11 @@ describe("enableUrimapHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: urimapName, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/get/Get.definition.unit.test.ts b/packages/cli/__tests__/__unit__/get/Get.definition.unit.test.ts index b9050fae..98a5575b 100644 --- a/packages/cli/__tests__/__unit__/get/Get.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/get/Get.definition.unit.test.ts @@ -14,7 +14,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics get resource", () => { const DEFINE_RESOURCES = 1; - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../src/get/Get.definition"); expect(definition).toBeDefined(); expect(definition.children.length).toBe(DEFINE_RESOURCES); diff --git a/packages/cli/__tests__/__unit__/get/resource/Resource.definition.unit.test.ts b/packages/cli/__tests__/__unit__/get/resource/Resource.definition.unit.test.ts index 6c9651ff..f8fe4e42 100644 --- a/packages/cli/__tests__/__unit__/get/resource/Resource.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/get/resource/Resource.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics get resource", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/get/resource/Resource.definition").ResourceDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/get/resource/Resource.handler.unit.test.ts b/packages/cli/__tests__/__unit__/get/resource/Resource.handler.unit.test.ts index 990a6776..8272fe54 100644 --- a/packages/cli/__tests__/__unit__/get/resource/Resource.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/get/resource/Resource.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "get", "resource"], definition: ResourceDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("GetResourceHandler", () => { @@ -49,23 +49,23 @@ describe("GetResourceHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: {} - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: {}, + }, }; const functionSpy = jest.spyOn(Get, "getResource"); beforeEach(() => { functionSpy.mockClear(); - defaultReturn.response.records[resourceName.toLowerCase()] = [{prop: "test1"}, {prop: "test2"}]; + defaultReturn.response.records[resourceName.toLowerCase()] = [{ prop: "test1" }, { prop: "test2" }]; functionSpy.mockImplementation(async () => defaultReturn); }); it("should call the getResource api", async () => { const handler = new ResourceHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, resourceName, @@ -75,7 +75,7 @@ describe("GetResourceHandler", () => { user, password, protocol, - rejectUnauthorized + rejectUnauthorized, }; await handler.process(commandParameters); @@ -90,11 +90,11 @@ describe("GetResourceHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: resourceName, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/install/Install.definition.unit.test.ts b/packages/cli/__tests__/__unit__/install/Install.definition.unit.test.ts index 6aaec27a..bbe65c3f 100644 --- a/packages/cli/__tests__/__unit__/install/Install.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/install/Install.definition.unit.test.ts @@ -14,7 +14,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics install program", () => { const INSTALL_RESOURCES = 3; - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../src/install/Install.definition"); expect(definition).toBeDefined(); expect(definition.children.length).toBe(INSTALL_RESOURCES); diff --git a/packages/cli/__tests__/__unit__/install/program/Program.definition.unit.test.ts b/packages/cli/__tests__/__unit__/install/program/Program.definition.unit.test.ts index b854a7f6..7dd37378 100644 --- a/packages/cli/__tests__/__unit__/install/program/Program.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/install/program/Program.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics install program", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/install/program/Program.definition").ProgramDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/install/program/Program.handler.unit.test.ts b/packages/cli/__tests__/__unit__/install/program/Program.handler.unit.test.ts index 68aa503b..b4c46e8b 100644 --- a/packages/cli/__tests__/__unit__/install/program/Program.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/install/program/Program.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "install", "program"], definition: ProgramDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("InstallProgramHandler", () => { @@ -50,9 +50,9 @@ describe("InstallProgramHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Install, "installProgram"); @@ -65,7 +65,7 @@ describe("InstallProgramHandler", () => { it("should call the installProgram api", async () => { const handler = new ProgramHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, programName, @@ -76,7 +76,7 @@ describe("InstallProgramHandler", () => { user, password, protocol, - rejectUnauthorized + rejectUnauthorized, }; await handler.process(commandParameters); @@ -91,12 +91,12 @@ describe("InstallProgramHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: programName, csdGroup, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/install/transaction/Transaction.definition.unit.test.ts b/packages/cli/__tests__/__unit__/install/transaction/Transaction.definition.unit.test.ts index 829601b1..c4d0f45c 100644 --- a/packages/cli/__tests__/__unit__/install/transaction/Transaction.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/install/transaction/Transaction.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics install transaction", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/install/transaction/Transaction.definition").TransactionDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/install/transaction/Transaction.handler.unit.test.ts b/packages/cli/__tests__/__unit__/install/transaction/Transaction.handler.unit.test.ts index 2ee088f4..5e220871 100644 --- a/packages/cli/__tests__/__unit__/install/transaction/Transaction.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/install/transaction/Transaction.handler.unit.test.ts @@ -26,21 +26,21 @@ const rejectUnauthorized = false; const protocol = "https"; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "install", "transaction"], definition: TransactionDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("InstallTransactionHandler", () => { @@ -50,9 +50,9 @@ describe("InstallTransactionHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Install, "installTransaction"); @@ -65,7 +65,7 @@ describe("InstallTransactionHandler", () => { it("should call the installTransaction api", async () => { const handler = new TransactionHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, transactionName, @@ -75,7 +75,7 @@ describe("InstallTransactionHandler", () => { port, user, password, - rejectUnauthorized + rejectUnauthorized, }; await handler.process(commandParameters); @@ -90,12 +90,12 @@ describe("InstallTransactionHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: transactionName, csdGroup, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/install/urimap/Urimap.definition.unit.test.ts b/packages/cli/__tests__/__unit__/install/urimap/Urimap.definition.unit.test.ts index 4cc8a188..501f223b 100644 --- a/packages/cli/__tests__/__unit__/install/urimap/Urimap.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/install/urimap/Urimap.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics install urimap", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/install/urimap/Urimap.definition").UrimapDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/install/urimap/Urimap.handler.unit.test.ts b/packages/cli/__tests__/__unit__/install/urimap/Urimap.handler.unit.test.ts index e3d0e29f..16123f9e 100644 --- a/packages/cli/__tests__/__unit__/install/urimap/Urimap.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/install/urimap/Urimap.handler.unit.test.ts @@ -26,8 +26,8 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, @@ -35,14 +35,14 @@ PROFILE_MAP.set( user, password, protocol, - rejectUnauthorized - }] -); + rejectUnauthorized, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "install", "urimap"], definition: UrimapDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("InstallUrimapHandler", () => { @@ -52,9 +52,9 @@ describe("InstallUrimapHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Install, "installUrimap"); @@ -67,7 +67,7 @@ describe("InstallUrimapHandler", () => { it("should call the installUrimap api", async () => { const handler = new UrimapHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, urimapName, @@ -78,7 +78,7 @@ describe("InstallUrimapHandler", () => { user, password, protocol, - rejectUnauthorized + rejectUnauthorized, }; await handler.process(commandParameters); @@ -93,12 +93,12 @@ describe("InstallUrimapHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name: urimapName, csdGroup, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/refresh/Refresh.definition.unit.test.ts b/packages/cli/__tests__/__unit__/refresh/Refresh.definition.unit.test.ts index 09fa2dbb..510f0bec 100644 --- a/packages/cli/__tests__/__unit__/refresh/Refresh.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/refresh/Refresh.definition.unit.test.ts @@ -14,7 +14,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics refresh program", () => { const REFRESH_RESOURCES = 1; - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../src/refresh/Refresh.definition"); expect(definition).toBeDefined(); expect(definition.children.length).toBe(REFRESH_RESOURCES); diff --git a/packages/cli/__tests__/__unit__/refresh/program/Program.definition.unit.test.ts b/packages/cli/__tests__/__unit__/refresh/program/Program.definition.unit.test.ts index 0c4e81d0..cdfcf4bd 100644 --- a/packages/cli/__tests__/__unit__/refresh/program/Program.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/refresh/program/Program.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics refresh program", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/refresh/program/Program.definition").ProgramDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/refresh/program/Program.handler.unit.test.ts b/packages/cli/__tests__/__unit__/refresh/program/Program.handler.unit.test.ts index c09bb6c1..a543218a 100644 --- a/packages/cli/__tests__/__unit__/refresh/program/Program.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/refresh/program/Program.handler.unit.test.ts @@ -25,8 +25,8 @@ const password = "somesecret"; const protocol = "https"; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, @@ -34,14 +34,14 @@ PROFILE_MAP.set( user, password, protocol, - rejectUnauthorized: false - }] -); + rejectUnauthorized: false, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "refresh", "program"], definition: ProgramDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("RefreshProgramHandler", () => { @@ -51,9 +51,9 @@ describe("RefreshProgramHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(Set, "programNewcopy"); @@ -66,7 +66,7 @@ describe("RefreshProgramHandler", () => { it("should call the programNewcopy api", async () => { const handler = new ProgramHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, programName, @@ -76,7 +76,7 @@ describe("RefreshProgramHandler", () => { port, user, password, - rejectUnauthorized: false + rejectUnauthorized: false, }; await handler.process(commandParameters); @@ -95,7 +95,7 @@ describe("RefreshProgramHandler", () => { }), { name: programName, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/__unit__/remove-from-list/RemoveFromList.definition.unit.test.ts b/packages/cli/__tests__/__unit__/remove-from-list/RemoveFromList.definition.unit.test.ts index cac51608..18925196 100644 --- a/packages/cli/__tests__/__unit__/remove-from-list/RemoveFromList.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/remove-from-list/RemoveFromList.definition.unit.test.ts @@ -14,7 +14,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics remove-from-list", () => { const REMOVE_FROM_LIST_RESOURCES = 1; - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../src/remove-from-list/RemoveFromList.definition"); expect(definition).toBeDefined(); expect(definition.children.length).toBe(REMOVE_FROM_LIST_RESOURCES); diff --git a/packages/cli/__tests__/__unit__/remove-from-list/csdGroup/CSDGroup.definition.unit.test.ts b/packages/cli/__tests__/__unit__/remove-from-list/csdGroup/CSDGroup.definition.unit.test.ts index 57518d83..eedf9c97 100644 --- a/packages/cli/__tests__/__unit__/remove-from-list/csdGroup/CSDGroup.definition.unit.test.ts +++ b/packages/cli/__tests__/__unit__/remove-from-list/csdGroup/CSDGroup.definition.unit.test.ts @@ -12,7 +12,7 @@ import { ICommandDefinition } from "@zowe/imperative"; describe("cics remove-from-list csdGroup", () => { - it ("should not have changed", () => { + it("should not have changed", () => { const definition: ICommandDefinition = require("../../../../src/remove-from-list/csdGroup/CSDGroup.definition").CSDGroupDefinition; expect(definition).toBeDefined(); delete definition.handler; diff --git a/packages/cli/__tests__/__unit__/remove-from-list/csdGroup/CSDGroup.handler.unit.test.ts b/packages/cli/__tests__/__unit__/remove-from-list/csdGroup/CSDGroup.handler.unit.test.ts index 34b9b61b..eda87e30 100644 --- a/packages/cli/__tests__/__unit__/remove-from-list/csdGroup/CSDGroup.handler.unit.test.ts +++ b/packages/cli/__tests__/__unit__/remove-from-list/csdGroup/CSDGroup.handler.unit.test.ts @@ -26,21 +26,21 @@ const protocol = "http"; const rejectUnauthorized = false; const PROFILE_MAP = new Map(); -PROFILE_MAP.set( - "cics", [{ +PROFILE_MAP.set("cics", [ + { name: "cics", type: "cics", host, port, user, - password - }] -); + password, + }, +]); const PROFILES: CommandProfiles = new CommandProfiles(PROFILE_MAP); const DEFAULT_PARAMETERS: IHandlerParameters = mockHandlerParameters({ positionals: ["cics", "remove-from-list", "csdGroup"], definition: CSDGroupDefinition, - profiles: PROFILES + profiles: PROFILES, }); describe("RemoveFromListProgramHandler", () => { @@ -50,9 +50,9 @@ describe("RemoveFromListProgramHandler", () => { const defaultReturn: ICMCIApiResponse = { response: { - resultsummary: {api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0"}, - records: "testing" - } + resultsummary: { api_response1: "1024", api_response2: "0", recordcount: "0", displayed_recordcount: "0" }, + records: "testing", + }, }; const functionSpy = jest.spyOn(RemoveFromList, "removeCSDGroupFromList"); @@ -65,7 +65,7 @@ describe("RemoveFromListProgramHandler", () => { it("should call the removeCSDGroupFromList api", async () => { const handler = new CSDGroupHandler(); - const commandParameters = {...DEFAULT_PARAMETERS}; + const commandParameters = { ...DEFAULT_PARAMETERS }; commandParameters.arguments = { ...commandParameters.arguments, name, @@ -76,7 +76,7 @@ describe("RemoveFromListProgramHandler", () => { user, password, rejectUnauthorized, - protocol + protocol, }; await handler.process(commandParameters); @@ -91,12 +91,12 @@ describe("RemoveFromListProgramHandler", () => { user: testProfile.user, password: testProfile.password, rejectUnauthorized, - protocol + protocol, }), { name, csdList, - regionName + regionName, } ); }); diff --git a/packages/cli/__tests__/imperative.test.ts b/packages/cli/__tests__/imperative.test.ts index 5e71de24..1822ab02 100644 --- a/packages/cli/__tests__/imperative.test.ts +++ b/packages/cli/__tests__/imperative.test.ts @@ -10,10 +10,9 @@ */ describe("imperative config", () => { - // Will fail if imperative config object is changed. This is a sanity/protection check to ensure that any // changes to the configuration document are intended (and the snapshot must be updated). - it ("should match the snapshot", () => { + it("should match the snapshot", () => { const config = require("../src/imperative"); expect(config).toMatchSnapshot(); }); diff --git a/packages/cli/package.json b/packages/cli/package.json index 5e1fc2c4..56cb6b9b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -30,6 +30,7 @@ "build": "tsc --pretty && npm run checkTestsCompile && npm run madge", "checkTestsCompile": "echo \"Checking that test source compiles...\" && tsc --project __tests__/test-tsconfig.json --noEmit ", "madge": "madge -c lib", + "pretty": "prettier --write 'src/**/*.ts' '__tests__/**/*.ts' '__mocks__/**/*.ts'", "prebuild": "npm run clean && echo Using TypeScript && tsc --version", "clean": "rimraf lib", "watch": "tsc --pretty --watch", diff --git a/packages/cli/src/-strings-/en.ts b/packages/cli/src/-strings-/en.ts index 460205f8..b0ac1139 100644 --- a/packages/cli/src/-strings-/en.ts +++ b/packages/cli/src/-strings-/en.ts @@ -27,13 +27,13 @@ export default { CICSPLEX: "The name of the CICSPlex to which to add the CSD Group to the CSD List", }, MESSAGES: { - SUCCESS: "The CSD Group '%s' was successfully added to '%s'." + SUCCESS: "The CSD Group '%s' was successfully added to '%s'.", }, EXAMPLES: { - EX1: "Add the CSD Group MYGRP to the CSD List MYLIST in the region named MYREG" - } - } - } + EX1: "Add the CSD Group MYGRP to the CSD List MYLIST in the region named MYREG", + }, + }, + }, }, DEFINE: { SUMMARY: "Define new resources to CICS", @@ -43,51 +43,53 @@ export default { DESCRIPTION: "Define a new program to CICS.", POSITIONALS: { PROGRAMNAME: "The name of the new program to define. The maximum length of the program name is eight characters.", - CSDGROUP: "The CICS system definition (CSD) Group for the new program that you want to define." + - " The maximum length of the group " - + "name is eight characters." + CSDGROUP: + "The CICS system definition (CSD) Group for the new program that you want to define." + + " The maximum length of the group " + + "name is eight characters.", }, OPTIONS: { REGIONNAME: "The CICS region name to which to define the new program", - CICSPLEX: "The name of the CICSPlex to which to define the new program" + CICSPLEX: "The name of the CICSPlex to which to define the new program", }, MESSAGES: { - SUCCESS: "The program '%s' was defined successfully." + SUCCESS: "The program '%s' was defined successfully.", }, EXAMPLES: { - EX1: "Define a program named PGM123 to the region name MYREGION in the CSD group MYGRP" - } + EX1: "Define a program named PGM123 to the region name MYREGION in the CSD group MYGRP", + }, }, TRANSACTION: { DESCRIPTION: "Define a new transaction to CICS.", POSITIONALS: { TRANSACTIONNAME: "The name of the new transaction to define. The maximum length of the transaction name is four characters.", PROGRAMNAME: "The name of the program that the transaction uses. The maximum length of the program name is eight characters.", - CSDGROUP: "The CICS system definition (CSD) Group for the new transaction that you want to define." + - " The maximum length of the group name is eight characters." + CSDGROUP: + "The CICS system definition (CSD) Group for the new transaction that you want to define." + + " The maximum length of the group name is eight characters.", }, OPTIONS: { REGIONNAME: "The CICS region name to which to define the new transaction", - CICSPLEX: "The name of the CICSPlex to which to define the new transaction" + CICSPLEX: "The name of the CICSPlex to which to define the new transaction", }, MESSAGES: { - SUCCESS: "The transaction '%s' was defined successfully." + SUCCESS: "The transaction '%s' was defined successfully.", }, EXAMPLES: { - EX1: "Define a transaction named TRN1 for the program named PGM123 to the region named MYREGION " + - "in the CSD group MYGRP" - } + EX1: "Define a transaction named TRN1 for the program named PGM123 to the region named MYREGION " + "in the CSD group MYGRP", + }, }, URIMAP: { DESCRIPTION: { SERVER: "Define a new URIMAP of type server to CICS. This acts as an HTTP(S) server", CLIENT: "Define a new URIMAP of type client to CICS. This acts as an HTTP(S) client", - PIPELINE: "Define a new URIMAP of type pipeline to CICS. This processes incoming HTTP(S) requests" + PIPELINE: "Define a new URIMAP of type pipeline to CICS. This processes incoming HTTP(S) requests", }, POSITIONALS: { URIMAPNAME: "The name of the URIMAP to create. The maximum length of the urimap name is eight characters.", - CSDGROUP: "The CICS system definition (CSD) Group for the new urimap that you want to define." + - " The maximum length of the group name is eight characters." + CSDGROUP: + "The CICS system definition (CSD) Group for the new urimap that you want to define." + + " The maximum length of the group name is eight characters.", }, OPTIONS: { URIMAPHOST: "The host component of the URI.", @@ -96,64 +98,69 @@ export default { REGIONNAME: "The CICS region name to which to define the new URIMAP.", CICSPLEX: "The name of the CICSPlex to which to define the new URIMAP.", PROGRAMNAME: "The application program that makes or handles the requests.", - PIPELINENAME: "The name of the PIPELINE resource definition for the URIMAP. " + - "The maximum length of the pipeline name is eight characters.", - CERTIFICATE: "The label of a certificate in the keyring that is to be used as the client " + - "certificate in SSL handshakes", + PIPELINENAME: + "The name of the PIPELINE resource definition for the URIMAP. " + "The maximum length of the pipeline name is eight characters.", + CERTIFICATE: "The label of a certificate in the keyring that is to be used as the client " + "certificate in SSL handshakes", AUTHENTICATE: "The authentication and identification scheme to be used for client URIMAPs.", DESCRIPTION: "Description of the URIMAP resource being defined.", - TRANSACTIONNAME: "The name of the TRANSACTION resource definition for the URIMAP. " + - "The maximum length of the transaction name is four characters.", - WEBSERVICENAME: "The name of the WEBSERVICE resource definition for the URIMAP. " + - "The maximum length of the transaction name is 32 characters.", + TRANSACTIONNAME: + "The name of the TRANSACTION resource definition for the URIMAP. " + "The maximum length of the transaction name is four characters.", + WEBSERVICENAME: + "The name of the WEBSERVICE resource definition for the URIMAP. " + "The maximum length of the transaction name is 32 characters.", ENABLE: "Whether or not the URIMAP is to be enabled on install by default. ", - TCPIPSERVICE: "The TCPIPSERVICE to which the URIMAP definition applies." + TCPIPSERVICE: "The TCPIPSERVICE to which the URIMAP definition applies.", }, MESSAGES: { - SUCCESS: "The URIMAP '%s' was defined successfully." + SUCCESS: "The URIMAP '%s' was defined successfully.", }, EXAMPLES: { SERVER: { - EX1: "Define a URIMAP named URIMAPA for the program named PGM123 to the region named MYREGION " + - "in the CSD group MYGRP where the host is www.example.com and the path is /example/index.html" + EX1: + "Define a URIMAP named URIMAPA for the program named PGM123 to the region named MYREGION " + + "in the CSD group MYGRP where the host is www.example.com and the path is /example/index.html", }, CLIENT: { - EX1: "Define a URIMAP named URIMAPA to the region named MYREGION in the CSD group MYGRP " + - "where the host is www.example.com and the path is /example/index.html" + EX1: + "Define a URIMAP named URIMAPA to the region named MYREGION in the CSD group MYGRP " + + "where the host is www.example.com and the path is /example/index.html", }, PIPELINE: { - EX1: "Define a URIMAP named URIMAPA for the pipeline named PIPE123 to the region named MYREGION " + - "in the CSD group MYGRP where the host is www.example.com and the path is /example/index.html" - } - } + EX1: + "Define a URIMAP named URIMAPA for the pipeline named PIPE123 to the region named MYREGION " + + "in the CSD group MYGRP where the host is www.example.com and the path is /example/index.html", + }, + }, }, WEBSERVICE: { DESCRIPTION: "Define a new web service to CICS.", POSITIONALS: { WEBSERVICENAME: "The name of the WEBSERVICE to create. The maximum length of the web service name is eight characters.", - CSDGROUP: "The CICS system definition (CSD) Group for the new web service that you want to define." + - " The maximum length of the group name is eight characters." + CSDGROUP: + "The CICS system definition (CSD) Group for the new web service that you want to define." + + " The maximum length of the group name is eight characters.", }, OPTIONS: { - PIPELINENAME: "The name of the PIPELINE resource definition for the web service." + - " The maximum length of the pipeline name is eight characters", + PIPELINENAME: + "The name of the PIPELINE resource definition for the web service." + " The maximum length of the pipeline name is eight characters", WSBIND: "The file name of the web service binding file on HFS.", DESCRIPTION: "Description of the web service resource being defined.", - VALIDATION: "Specifies whether full validation of SOAP messages against the corresponding schema in the web service " + - "description should be performed at run time.", + VALIDATION: + "Specifies whether full validation of SOAP messages against the corresponding schema in the web service " + + "description should be performed at run time.", WSDLFILE: "The file name of the web service description (WSDL) file on HFS.", REGIONNAME: "The CICS region name to which to define the new web service.", - CICSPLEX: "The name of the CICSPlex to which to define the new web service." + CICSPLEX: "The name of the CICSPlex to which to define the new web service.", }, MESSAGES: { - SUCCESS: "The WEBSERVICE '%s' was defined successfully." + SUCCESS: "The WEBSERVICE '%s' was defined successfully.", }, EXAMPLES: { - EX1: "Define a webservice named WEBSVCA for the pipeline named PIPE123 to the region named MYREGION " + - "in the CSD group MYGRP where the binding file is /u/exampleapp/wsbind/example.log" - } - } - } + EX1: + "Define a webservice named WEBSVCA for the pipeline named PIPE123 to the region named MYREGION " + + "in the CSD group MYGRP where the binding file is /u/exampleapp/wsbind/example.log", + }, + }, + }, }, DELETE: { SUMMARY: "Delete resources from CICS", @@ -163,74 +170,78 @@ export default { DESCRIPTION: "Delete a program from CICS.", POSITIONALS: { PROGRAMNAME: "The name of the program to delete. The maximum length of the program name is eight characters.", - CSDGROUP: "The CICS system definition (CSD) Group for the program that you want to delete." + - " The maximum length of the group name is eight characters." + CSDGROUP: + "The CICS system definition (CSD) Group for the program that you want to delete." + + " The maximum length of the group name is eight characters.", }, OPTIONS: { REGIONNAME: "The CICS region name from which to delete the program", - CICSPLEX: "The name of the CICSPlex from which to delete the program" + CICSPLEX: "The name of the CICSPlex from which to delete the program", }, MESSAGES: { - SUCCESS: "The program '%s' was deleted successfully." + SUCCESS: "The program '%s' was deleted successfully.", }, EXAMPLES: { - EX1: "Delete a program named PGM123 from the region named MYREGION" - } + EX1: "Delete a program named PGM123 from the region named MYREGION", + }, }, TRANSACTION: { DESCRIPTION: "Delete a transaction from CICS.", POSITIONALS: { TRANSACTIONNAME: "The name of the transaction to delete. The maximum length of the transaction name is four characters.", - CSDGROUP: "The CICS system definition (CSD) Group for the transaction that you want to delete." + - " The maximum length of the group " - + "name is eight characters." + CSDGROUP: + "The CICS system definition (CSD) Group for the transaction that you want to delete." + + " The maximum length of the group " + + "name is eight characters.", }, OPTIONS: { REGIONNAME: "The CICS region name from which to delete the transaction", - CICSPLEX: "The name of the CICSPlex from which to delete the transaction" + CICSPLEX: "The name of the CICSPlex from which to delete the transaction", }, MESSAGES: { - SUCCESS: "The transaction '%s' was deleted successfully." + SUCCESS: "The transaction '%s' was deleted successfully.", }, EXAMPLES: { - EX1: "Delete a transaction named TRN1 from the region named MYREGION" - } + EX1: "Delete a transaction named TRN1 from the region named MYREGION", + }, }, URIMAP: { DESCRIPTION: "Delete a urimap from CICS.", POSITIONALS: { URIMAPNAME: "The name of the urimap to delete. The maximum length of the urimap name is eight characters.", - CSDGROUP: "The CICS system definition (CSD) Group for the urimap that you want to delete." + - " The maximum length of the group name is eight characters." + CSDGROUP: + "The CICS system definition (CSD) Group for the urimap that you want to delete." + + " The maximum length of the group name is eight characters.", }, OPTIONS: { - REGIONNAME: "The CICS region name from which to delete the urimap" + REGIONNAME: "The CICS region name from which to delete the urimap", }, MESSAGES: { - SUCCESS: "The urimap '%s' was deleted successfully." + SUCCESS: "The urimap '%s' was deleted successfully.", }, EXAMPLES: { - EX1: "Delete a urimap named URIMAPA from the region named MYREGION belonging to the csdgroup MYGRP" - } + EX1: "Delete a urimap named URIMAPA from the region named MYREGION belonging to the csdgroup MYGRP", + }, }, WEBSERVICE: { DESCRIPTION: "Delete a web service from CICS.", POSITIONALS: { WEBSERVICENAME: "The name of the web service to delete. The maximum length of the web service name is eight characters.", - CSDGROUP: "The CICS system definition (CSD) Group for the web service that you want to delete." + - " The maximum length of the group name is eight characters." + CSDGROUP: + "The CICS system definition (CSD) Group for the web service that you want to delete." + + " The maximum length of the group name is eight characters.", }, OPTIONS: { - REGIONNAME: "The CICS region name from which to delete the web service" + REGIONNAME: "The CICS region name from which to delete the web service", }, MESSAGES: { - SUCCESS: "The web service '%s' was deleted successfully." + SUCCESS: "The web service '%s' was deleted successfully.", }, EXAMPLES: { - EX1: "Delete a web service named WEBSVCA from the region named MYREGION belonging to the csdgroup MYGRP" - } - } - } + EX1: "Delete a web service named WEBSVCA from the region named MYREGION belonging to the csdgroup MYGRP", + }, + }, + }, }, DISABLE: { SUMMARY: "Disable resources from CICS", @@ -239,19 +250,19 @@ export default { URIMAP: { DESCRIPTION: "Disable a urimap from CICS.", POSITIONALS: { - URIMAPNAME: "The name of the urimap to disable. The maximum length of the urimap name is eight characters." + URIMAPNAME: "The name of the urimap to disable. The maximum length of the urimap name is eight characters.", }, OPTIONS: { - REGIONNAME: "The CICS region name in which to disable the urimap" + REGIONNAME: "The CICS region name in which to disable the urimap", }, MESSAGES: { - SUCCESS: "The urimap '%s' was disabled successfully." + SUCCESS: "The urimap '%s' was disabled successfully.", }, EXAMPLES: { - EX1: "Disable a urimap named URIMAPA from the region named MYREGION" - } - } - } + EX1: "Disable a urimap named URIMAPA from the region named MYREGION", + }, + }, + }, }, DISCARD: { SUMMARY: "Discard resources from CICS", @@ -260,34 +271,34 @@ export default { PROGRAM: { DESCRIPTION: "Discard a program from CICS.", POSITIONALS: { - PROGRAMNAME: "The name of the program to discard. The maximum length of the program name is eight characters." + PROGRAMNAME: "The name of the program to discard. The maximum length of the program name is eight characters.", }, OPTIONS: { REGIONNAME: "The CICS region name from which to discard the program", - CICSPLEX: "The name of the CICSPlex from which to discard the program" + CICSPLEX: "The name of the CICSPlex from which to discard the program", }, MESSAGES: { - SUCCESS: "The program '%s' was discarded successfully." + SUCCESS: "The program '%s' was discarded successfully.", }, EXAMPLES: { - EX1: "Discard a program named PGM123 from the region named MYREGION" - } + EX1: "Discard a program named PGM123 from the region named MYREGION", + }, }, TRANSACTION: { DESCRIPTION: "Discard a transaction from CICS.", POSITIONALS: { - TRANSACTIONNAME: "The name of the transaction to discard. The maximum length of the transaction name is four characters." + TRANSACTIONNAME: "The name of the transaction to discard. The maximum length of the transaction name is four characters.", }, OPTIONS: { REGIONNAME: "The CICS region name from which to discard the transaction", - CICSPLEX: "The name of the CICSPlex from which to discard the transaction" + CICSPLEX: "The name of the CICSPlex from which to discard the transaction", }, MESSAGES: { - SUCCESS: "The transaction '%s' was discarded successfully." + SUCCESS: "The transaction '%s' was discarded successfully.", }, EXAMPLES: { - EX1: "Discard a transaction named TRN1 from the region named MYREGION" - } + EX1: "Discard a transaction named TRN1 from the region named MYREGION", + }, }, URIMAP: { DESCRIPTION: "Discard a urimap from CICS.", @@ -295,16 +306,16 @@ export default { URIMAPNAME: "The name of the urimap to discard. The maximum length of the urimap name is eight characters.", }, OPTIONS: { - REGIONNAME: "The CICS region name from which to discard the urimap" + REGIONNAME: "The CICS region name from which to discard the urimap", }, MESSAGES: { - SUCCESS: "The urimap '%s' was discarded successfully." + SUCCESS: "The urimap '%s' was discarded successfully.", }, EXAMPLES: { - EX1: "Discard a urimap named URIMAPA from the region named MYREGION" - } - } - } + EX1: "Discard a urimap named URIMAPA from the region named MYREGION", + }, + }, + }, }, ENABLE: { SUMMARY: "Enable resources from CICS", @@ -313,35 +324,35 @@ export default { TRANSACTION: { DESCRIPTION: "Enable a transaction from CICS.", POSITIONALS: { - NAME: "The name of the transaction to enable. The maximum length is four characters." + NAME: "The name of the transaction to enable. The maximum length is four characters.", }, OPTIONS: { REGIONNAME: "The CICS region name in which to enable the transaction", - CICSPLEX: "The name of the CICSPlex to which to enable the transaction" + CICSPLEX: "The name of the CICSPlex to which to enable the transaction", }, MESSAGES: { - SUCCESS: "The transaction '%s' was enabled successfully." + SUCCESS: "The transaction '%s' was enabled successfully.", }, EXAMPLES: { - EX1: "Enable a transaction named TRN1 from the region named MYREGION" - } - }, + EX1: "Enable a transaction named TRN1 from the region named MYREGION", + }, + }, URIMAP: { DESCRIPTION: "Enable a urimap from CICS.", POSITIONALS: { - URIMAPNAME: "The name of the urimap to enable. The maximum length of the urimap name is eight characters." + URIMAPNAME: "The name of the urimap to enable. The maximum length of the urimap name is eight characters.", }, OPTIONS: { - REGIONNAME: "The CICS region name in which to enable the urimap" + REGIONNAME: "The CICS region name in which to enable the urimap", }, MESSAGES: { - SUCCESS: "The urimap '%s' was enabled successfully." + SUCCESS: "The urimap '%s' was enabled successfully.", }, EXAMPLES: { - EX1: "Enable a urimap named URIMAPA from the region named MYREGION" - } - } - } + EX1: "Enable a urimap named URIMAPA from the region named MYREGION", + }, + }, + }, }, GET: { SUMMARY: "Get resources from CICS", @@ -356,10 +367,10 @@ export default { REGIONNAME: "The CICS region name from which to get the resources", CICSPLEX: "The name of the CICSPlex from which to get the resources", CRITERIA: "The criteria by which to filter the resource", - PARAMETER: "The parameter by which to refine the resource" + PARAMETER: "The parameter by which to refine the resource", }, MESSAGES: { - SUCCESS: "The resource(s) for '%s' were retrieved successfully." + SUCCESS: "The resource(s) for '%s' were retrieved successfully.", }, EXAMPLES: { EX1: "Get program resources from the region named MYREGION", @@ -371,9 +382,9 @@ export default { EX7: "Get program resources that start with the name PRG from the region named MYREGION", EX8: "Get a local transaction resource named TRAN from the region named MYREGION", EX9: "Get program resources that start with the name MYPRG from the region named MYREGION and display various fields as a table", - } - } - } + }, + }, + }, }, INSTALL: { SUMMARY: "Install resources to CICS", @@ -383,57 +394,59 @@ export default { DESCRIPTION: "Install a program to CICS.", POSITIONALS: { PROGRAMNAME: "The name of the program to install. The maximum length of the program name is eight characters.", - CSDGROUP: "The CICS system definition (CSD) Group for the program that you want to install." + - " The maximum length of the group name is eight characters." + CSDGROUP: + "The CICS system definition (CSD) Group for the program that you want to install." + + " The maximum length of the group name is eight characters.", }, OPTIONS: { REGIONNAME: "The CICS region name to which to install the program", - CICSPLEX: "The name of the CICSPlex to which to install the program" + CICSPLEX: "The name of the CICSPlex to which to install the program", }, MESSAGES: { - SUCCESS: "The program named '%s' was installed successfully." + SUCCESS: "The program named '%s' was installed successfully.", }, EXAMPLES: { - EX1: "Install a program named PGM123 to the region named MYREGION in the CSD group MYGRP" - } + EX1: "Install a program named PGM123 to the region named MYREGION in the CSD group MYGRP", + }, }, TRANSACTION: { DESCRIPTION: "Install a transaction to CICS.", POSITIONALS: { TRANSACTIONNAME: "The name of the transaction to install. The maximum length of the transaction name is four characters.", - CSDGROUP: "The CICS system definition (CSD) Group for the transaction that you want to install." + - " The maximum length of the group name is eight characters." + CSDGROUP: + "The CICS system definition (CSD) Group for the transaction that you want to install." + + " The maximum length of the group name is eight characters.", }, OPTIONS: { REGIONNAME: "The CICS region name to which to install the transaction", - CICSPLEX: "The name of the CICSPlex to which to install the transaction" + CICSPLEX: "The name of the CICSPlex to which to install the transaction", }, MESSAGES: { - SUCCESS: "The transaction '%s' was installed successfully." + SUCCESS: "The transaction '%s' was installed successfully.", }, EXAMPLES: { - EX1: "Install a transaction named TRN1 to the region named MYREGION " + - "in the CSD group MYGRP", - } + EX1: "Install a transaction named TRN1 to the region named MYREGION " + "in the CSD group MYGRP", + }, }, URIMAP: { DESCRIPTION: "Install a urimap to CICS.", POSITIONALS: { URIMAPNAME: "The name of the urimap to install. The maximum length of the urimap name is eight characters.", - CSDGROUP: "The CICS system definition (CSD) Group for the urimap that you want to install." + - " The maximum length of the group name is eight characters." + CSDGROUP: + "The CICS system definition (CSD) Group for the urimap that you want to install." + + " The maximum length of the group name is eight characters.", }, OPTIONS: { - REGIONNAME: "The CICS region name to which to install the urimap" + REGIONNAME: "The CICS region name to which to install the urimap", }, MESSAGES: { - SUCCESS: "The urimap '%s' was installed successfully." + SUCCESS: "The urimap '%s' was installed successfully.", }, EXAMPLES: { - EX1: "Install a urimap named URIMAPA to the region named MYREGION belonging to the csdgroup MYGRP" - } - } - } + EX1: "Install a urimap named URIMAPA to the region named MYREGION belonging to the csdgroup MYGRP", + }, + }, + }, }, REFRESH: { SUMMARY: "Refresh program on CICS", @@ -442,20 +455,20 @@ export default { PROGRAM: { DESCRIPTION: "Refresh a program on CICS.", POSITIONALS: { - PROGRAMNAME: "The name of the program to refresh. The maximum length of the program name is eight characters." + PROGRAMNAME: "The name of the program to refresh. The maximum length of the program name is eight characters.", }, OPTIONS: { REGIONNAME: "The CICS region name on which you want to refresh the program", - CICSPLEX: "The name of the CICSPlex on which to refresh the program" + CICSPLEX: "The name of the CICSPlex on which to refresh the program", }, MESSAGES: { - SUCCESS: "The program '%s' was refreshed successfully." + SUCCESS: "The program '%s' was refreshed successfully.", }, EXAMPLES: { - DEFINE_EXAMPLE_ONE: "Refresh a program named PGM123 from the region named MYREGION" - } - } - } + DEFINE_EXAMPLE_ONE: "Refresh a program named PGM123 from the region named MYREGION", + }, + }, + }, }, REMOVEFROMLIST: { SUMMARY: "Remove resources from CICS", @@ -472,12 +485,12 @@ export default { CICSPLEX: "The name of the CICSPlex to which to remove the CSD Group from the CSD List", }, MESSAGES: { - SUCCESS: "The CSD Group '%s' was successfully removed from '%s'." + SUCCESS: "The CSD Group '%s' was successfully removed from '%s'.", }, EXAMPLES: { - EX1: "Remove the CSD Group MYGRP from the CSD List MYLIST in the region named MYREG" - } - } - } - } + EX1: "Remove the CSD Group MYGRP from the CSD List MYLIST in the region named MYREG", + }, + }, + }, + }, }; diff --git a/packages/cli/src/-strings-/es.ts b/packages/cli/src/-strings-/es.ts index a70ad63f..cbbb4376 100644 --- a/packages/cli/src/-strings-/es.ts +++ b/packages/cli/src/-strings-/es.ts @@ -18,16 +18,16 @@ export default { DESCRIPTION: "Definir un nuevo programa en CICS a través de CMCI", POSITIONALS: { PROGRAMNAME: "El nombre the programa que desea definir. La longitud máxima del nombre es de ocho caracteres", - CSDGROUP: "El nombre del grupo CSD del programa que desea definir. La longitud máxima del nombre del grupo es de ocho caracteres" + CSDGROUP: "El nombre del grupo CSD del programa que desea definir. La longitud máxima del nombre del grupo es de ocho caracteres", }, OPTIONS: { REGIONNAME: "Nombre de la región CICS a la cual desea definir el programa.", - CICSPLEX: "Nombre del CICS Plex al cual desea definir el programa." + CICSPLEX: "Nombre del CICS Plex al cual desea definir el programa.", }, MESSAGES: { - SUCCESS: "La definición del programa '%s' fue exitosa." - } - } - } - } + SUCCESS: "La definición del programa '%s' fue exitosa.", + }, + }, + }, + }, }; diff --git a/packages/cli/src/CicsBaseHandler.ts b/packages/cli/src/CicsBaseHandler.ts index 66e6a4a4..b91462cb 100644 --- a/packages/cli/src/CicsBaseHandler.ts +++ b/packages/cli/src/CicsBaseHandler.ts @@ -19,13 +19,13 @@ import { CicsSession } from "./CicsSession"; */ export abstract class CicsBaseHandler implements ICommandHandler { /** - * This will grab the cics profile and create a session before calling the subclass - * {@link CicsBaseHandler#processWithSession} method. - * - * @param {IHandlerParameters} commandParameters Command parameters sent by imperative. - * - * @returns {Promise} - */ + * This will grab the cics profile and create a session before calling the subclass + * {@link CicsBaseHandler#processWithSession} method. + * + * @param {IHandlerParameters} commandParameters Command parameters sent by imperative. + * + * @returns {Promise} + */ public async process(commandParameters: IHandlerParameters) { const session = await CicsSession.createSessCfgFromArgs(commandParameters.arguments, true, commandParameters); @@ -38,16 +38,13 @@ export abstract class CicsBaseHandler implements ICommandHandler { } /** - * This is called by the {@link CicsBaseHandler#process} after it creates a session. Should - * be used so that every class does not have to instantiate the session object. - * - * @param {IHandlerParameters} commandParameters Command parameters sent to the handler. - * @param {AbstractSession} session The session object generated from the cics profile. - * - * @returns {Promise} The response from the underlying cics api call. - */ - public abstract processWithSession( - commandParameters: IHandlerParameters, - session: AbstractSession - ): Promise; + * This is called by the {@link CicsBaseHandler#process} after it creates a session. Should + * be used so that every class does not have to instantiate the session object. + * + * @param {IHandlerParameters} commandParameters Command parameters sent to the handler. + * @param {AbstractSession} session The session object generated from the cics profile. + * + * @returns {Promise} The response from the underlying cics api call. + */ + public abstract processWithSession(commandParameters: IHandlerParameters, session: AbstractSession): Promise; } diff --git a/packages/cli/src/CicsSession.ts b/packages/cli/src/CicsSession.ts index 0c6648fb..8d9a7df3 100644 --- a/packages/cli/src/CicsSession.ts +++ b/packages/cli/src/CicsSession.ts @@ -10,8 +10,14 @@ */ import { - ConnectionPropsForSessCfg, ICommandArguments, ICommandOptionDefinition, - IHandlerParameters, IProfile, ISession, Logger, Session + ConnectionPropsForSessCfg, + ICommandArguments, + ICommandOptionDefinition, + IHandlerParameters, + IProfile, + ISession, + Logger, + Session, } from "@zowe/imperative"; /** @@ -19,46 +25,45 @@ import { * @export */ export class CicsSession { - public static CICS_CONNECTION_OPTION_GROUP = "Cics Connection Options"; /** - * Option used in profile creation and commands for hostname for CICS - */ + * Option used in profile creation and commands for hostname for CICS + */ public static CICS_OPTION_HOST: ICommandOptionDefinition = { name: "host", aliases: ["H"], description: "The CICS server host name.", type: "string", - group: CicsSession.CICS_CONNECTION_OPTION_GROUP + group: CicsSession.CICS_CONNECTION_OPTION_GROUP, }; /** - * Option used in profile creation and commands for port for CICS - */ + * Option used in profile creation and commands for port for CICS + */ public static CICS_OPTION_PORT: ICommandOptionDefinition = { name: "port", aliases: ["P"], description: "The CICS server port.", type: "number", defaultValue: 443, - group: CicsSession.CICS_CONNECTION_OPTION_GROUP + group: CicsSession.CICS_CONNECTION_OPTION_GROUP, }; /** - * Option used in profile creation and commands for username / ID for CICS - */ + * Option used in profile creation and commands for username / ID for CICS + */ public static CICS_OPTION_USER: ICommandOptionDefinition = { name: "user", aliases: ["u"], description: "Mainframe (CICS) user name, which can be the same as your TSO login.", type: "string", - group: CicsSession.CICS_CONNECTION_OPTION_GROUP + group: CicsSession.CICS_CONNECTION_OPTION_GROUP, }; /** - * Option used in profile creation and commands for password/passphrase for CICS - */ + * Option used in profile creation and commands for password/passphrase for CICS + */ public static CICS_OPTION_PASSWORD: ICommandOptionDefinition = { name: "password", aliases: ["pw"], @@ -75,7 +80,7 @@ export class CicsSession { description: "Reject self-signed certificates.", type: "boolean", defaultValue: true, - group: CicsSession.CICS_CONNECTION_OPTION_GROUP + group: CicsSession.CICS_CONNECTION_OPTION_GROUP, }; /** * Option used in profile creation and commands for protocol for CMCI @@ -87,28 +92,28 @@ export class CicsSession { type: "string", defaultValue: "https", allowableValues: { values: ["http", "https"], caseSensitive: false }, - group: CicsSession.CICS_CONNECTION_OPTION_GROUP + group: CicsSession.CICS_CONNECTION_OPTION_GROUP, }; /** - * Options related to connecting to CICS - * These options can be filled in if the user creates a profile - */ + * Options related to connecting to CICS + * These options can be filled in if the user creates a profile + */ public static CICS_CONNECTION_OPTIONS: ICommandOptionDefinition[] = [ CicsSession.CICS_OPTION_HOST, CicsSession.CICS_OPTION_PORT, CicsSession.CICS_OPTION_USER, CicsSession.CICS_OPTION_PASSWORD, CicsSession.CICS_OPTION_REJECT_UNAUTHORIZED, - CicsSession.CICS_OPTION_PROTOCOL + CicsSession.CICS_OPTION_PROTOCOL, ]; /** - * Given a CICS profile, create a REST Client Session. - * @static - * @param {IProfile} profile - The CICS profile contents - * @returns {Session} - A session for usage in the CMCI REST Client - */ + * Given a CICS profile, create a REST Client Session. + * @static + * @param {IProfile} profile - The CICS profile contents + * @returns {Session} - A session for usage in the CMCI REST Client + */ public static createBasicCicsSession(profile: IProfile): Session { this.log.debug("Creating a CICS session from the profile named %s", profile.name); return new Session({ @@ -123,11 +128,11 @@ export class CicsSession { } /** - * Given command line arguments, create a REST Client Session. - * @static - * @param {IProfile} args - The arguments specified by the user - * @returns {Session} - A session for usage in the CMCI REST Client - */ + * Given command line arguments, create a REST Client Session. + * @static + * @param {IProfile} args - The arguments specified by the user + * @returns {Session} - A session for usage in the CMCI REST Client + */ public static createBasicCicsSessionFromArguments(args: ICommandArguments): Session { this.log.debug("Creating a CICS session from arguments"); return new Session({ @@ -143,13 +148,13 @@ export class CicsSession { } /** - * Given command line arguments, create a REST Client Session. - * @static - * @param {IProfile} args - The arguments specified by the user - * @param {boolean} doPrompting - Whether to prompt for missing arguments (defaults to true) - * @param {IHandlerParameters} handlerParams - The command parameters object for Daemon mode prompting - * @returns {Session} - A session for usage in the CMCI REST Client - */ + * Given command line arguments, create a REST Client Session. + * @static + * @param {IProfile} args - The arguments specified by the user + * @param {boolean} doPrompting - Whether to prompt for missing arguments (defaults to true) + * @param {IHandlerParameters} handlerParams - The command parameters object for Daemon mode prompting + * @returns {Session} - A session for usage in the CMCI REST Client + */ public static async createSessCfgFromArgs(args: ICommandArguments, doPrompting = true, handlerParams?: IHandlerParameters): Promise { const sessCfg: ISession = { type: "basic", diff --git a/packages/cli/src/PluginConstants.ts b/packages/cli/src/PluginConstants.ts index 436756bf..483aa92b 100644 --- a/packages/cli/src/PluginConstants.ts +++ b/packages/cli/src/PluginConstants.ts @@ -10,19 +10,18 @@ */ export class PluginConstants { - /** - * The name of this plug-in - */ + * The name of this plug-in + */ public static readonly PLUGIN_NAME = "CLI Plug-in for IBM CICS"; /** - * The description of the group exposed by this plug-in - */ + * The description of the group exposed by this plug-in + */ public static readonly PLUGIN_DESCRIPTION = "Interact with IBM CICS programs and transactions."; /** - * The name of the command group exposed by this plug-in - */ + * The name of the command group exposed by this plug-in + */ public static readonly PLUGIN_GROUP_NAME = "cics"; } diff --git a/packages/cli/src/add-to-list/AddToList.definition.ts b/packages/cli/src/add-to-list/AddToList.definition.ts index 4291c1f3..15e5de2e 100644 --- a/packages/cli/src/add-to-list/AddToList.definition.ts +++ b/packages/cli/src/add-to-list/AddToList.definition.ts @@ -23,7 +23,8 @@ const strings = (require("../-strings-/en").default as typeof i18nTypings).ADDTO * Definition for the "add" group of commands under the CICS plugin */ const definition: ICommandDefinition = { - name: "add-to-list", aliases: ["atl"], + name: "add-to-list", + aliases: ["atl"], summary: strings.SUMMARY, description: strings.DESCRIPTION, type: "group", @@ -33,10 +34,8 @@ const definition: ICommandDefinition = { property: "options", value: CicsSession.CICS_CONNECTION_OPTIONS, merge: true, - ignoreNodes: [ - {type: "group"} - ] - } - ] + ignoreNodes: [{ type: "group" }], + }, + ], }; export = definition; diff --git a/packages/cli/src/add-to-list/csdGroup/CSDGroup.definition.ts b/packages/cli/src/add-to-list/csdGroup/CSDGroup.definition.ts index 16039a2a..a9e0b8fe 100644 --- a/packages/cli/src/add-to-list/csdGroup/CSDGroup.definition.ts +++ b/packages/cli/src/add-to-list/csdGroup/CSDGroup.definition.ts @@ -22,31 +22,37 @@ export const CSDGroupDefinition: ICommandDefinition = { description: strings.DESCRIPTION, handler: __dirname + "/CSDGroup.handler", type: "command", - positionals: [{ - name: "name", - description: strings.POSITIONALS.NAME, - type: "string", - required: true - }, { - name: "csdList", - description: strings.POSITIONALS.CSDLIST, - type: "string", - required: true - }], + positionals: [ + { + name: "name", + description: strings.POSITIONALS.NAME, + type: "string", + required: true, + }, + { + name: "csdList", + description: strings.POSITIONALS.CSDLIST, + type: "string", + required: true, + }, + ], options: [ { name: "region-name", description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "MYGRP MYLIST --region-name MYREG" - }] + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "MYGRP MYLIST --region-name MYREG", + }, + ], }; diff --git a/packages/cli/src/add-to-list/csdGroup/CSDGroup.handler.ts b/packages/cli/src/add-to-list/csdGroup/CSDGroup.handler.ts index fb276697..648ac0b8 100644 --- a/packages/cli/src/add-to-list/csdGroup/CSDGroup.handler.ts +++ b/packages/cli/src/add-to-list/csdGroup/CSDGroup.handler.ts @@ -26,19 +26,18 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).AD */ export default class CSDGroupHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Adding CSD Group to CSD List on CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await addCSDGroupToList(session, { name: params.arguments.name, csdList: params.arguments.csdList, regionName: params.arguments.regionName, - cicsPlex: params.arguments.cicsPlex + cicsPlex: params.arguments.cicsPlex, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.name, params.arguments.csdList); diff --git a/packages/cli/src/define/Define.definition.ts b/packages/cli/src/define/Define.definition.ts index e99d9b7c..e08ab435 100644 --- a/packages/cli/src/define/Define.definition.ts +++ b/packages/cli/src/define/Define.definition.ts @@ -28,25 +28,26 @@ const strings = (require("../-strings-/en").default as typeof i18nTypings).DEFIN * Definition for the "define" group of commands under the CICS plugin */ const definition: ICommandDefinition = { - name: "define", aliases: ["def"], + name: "define", + aliases: ["def"], summary: strings.SUMMARY, description: strings.DESCRIPTION, type: "group", - children: [ProgramDefinition, + children: [ + ProgramDefinition, TransactionDefinition, UrimapServerDefinition, UrimapClientDefinition, UrimapPipelineDefinition, - WebServiceDefinition], + WebServiceDefinition, + ], passOn: [ { property: "options", value: CicsSession.CICS_CONNECTION_OPTIONS, merge: true, - ignoreNodes: [ - {type: "group"} - ] - } - ] + ignoreNodes: [{ type: "group" }], + }, + ], }; export = definition; diff --git a/packages/cli/src/define/program/Program.definition.ts b/packages/cli/src/define/program/Program.definition.ts index 5355e18f..4897dd7d 100644 --- a/packages/cli/src/define/program/Program.definition.ts +++ b/packages/cli/src/define/program/Program.definition.ts @@ -17,35 +17,42 @@ import i18nTypings from "../../-strings-/en"; const strings = (require("../../-strings-/en").default as typeof i18nTypings).DEFINE.RESOURCES.PROGRAM; export const ProgramDefinition: ICommandDefinition = { - name: "program", aliases: ["prog"], + name: "program", + aliases: ["prog"], description: strings.DESCRIPTION, handler: __dirname + "/Program.handler", type: "command", - positionals: [{ - name: "programName", - description: strings.POSITIONALS.PROGRAMNAME, - type: "string", - required: true - }, { - name: "csdGroup", - description: strings.POSITIONALS.CSDGROUP, - type: "string", - required: true - }], + positionals: [ + { + name: "programName", + description: strings.POSITIONALS.PROGRAMNAME, + type: "string", + required: true, + }, + { + name: "csdGroup", + description: strings.POSITIONALS.CSDGROUP, + type: "string", + required: true, + }, + ], options: [ { name: "region-name", description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "PGM123 MYGRP --region-name MYREGION" - }] + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "PGM123 MYGRP --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/define/program/Program.handler.ts b/packages/cli/src/define/program/Program.handler.ts index 02d4dfb6..ad57f1d4 100644 --- a/packages/cli/src/define/program/Program.handler.ts +++ b/packages/cli/src/define/program/Program.handler.ts @@ -26,19 +26,18 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DE */ export default class ProgramHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Defining program to CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await defineProgram(session, { name: params.arguments.programName, csdGroup: params.arguments.csdGroup, regionName: params.arguments.regionName, - cicsPlex: params.arguments.cicsPlex + cicsPlex: params.arguments.cicsPlex, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.programName); diff --git a/packages/cli/src/define/transaction/Transaction.definition.ts b/packages/cli/src/define/transaction/Transaction.definition.ts index e045a237..620fe0a1 100644 --- a/packages/cli/src/define/transaction/Transaction.definition.ts +++ b/packages/cli/src/define/transaction/Transaction.definition.ts @@ -17,40 +17,48 @@ import i18nTypings from "../../-strings-/en"; const strings = (require("../../-strings-/en").default as typeof i18nTypings).DEFINE.RESOURCES.TRANSACTION; export const TransactionDefinition: ICommandDefinition = { - name: "transaction", aliases: ["tran"], + name: "transaction", + aliases: ["tran"], description: strings.DESCRIPTION, handler: __dirname + "/Transaction.handler", type: "command", - positionals: [{ - name: "transactionName", - description: strings.POSITIONALS.TRANSACTIONNAME, - type: "string", - required: true - }, { - name: "programName", - description: strings.POSITIONALS.PROGRAMNAME, - type: "string", - required: true - }, { - name: "csdGroup", - description: strings.POSITIONALS.CSDGROUP, - type: "string", - required: true - }], + positionals: [ + { + name: "transactionName", + description: strings.POSITIONALS.TRANSACTIONNAME, + type: "string", + required: true, + }, + { + name: "programName", + description: strings.POSITIONALS.PROGRAMNAME, + type: "string", + required: true, + }, + { + name: "csdGroup", + description: strings.POSITIONALS.CSDGROUP, + type: "string", + required: true, + }, + ], options: [ { name: "region-name", description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "TRN1 PGM123 MYGRP --region-name MYREGION" - }] + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "TRN1 PGM123 MYGRP --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/define/transaction/Transaction.handler.ts b/packages/cli/src/define/transaction/Transaction.handler.ts index eec50faa..bf21a591 100644 --- a/packages/cli/src/define/transaction/Transaction.handler.ts +++ b/packages/cli/src/define/transaction/Transaction.handler.ts @@ -26,20 +26,19 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DE */ export default class TransactionHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Defining transaction to CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await defineTransaction(session, { name: params.arguments.transactionName, programName: params.arguments.programName, csdGroup: params.arguments.csdGroup, regionName: params.arguments.regionName, - cicsPlex: params.arguments.cicsPlex + cicsPlex: params.arguments.cicsPlex, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.transactionName); diff --git a/packages/cli/src/define/urimap-client/UrimapClient.definition.ts b/packages/cli/src/define/urimap-client/UrimapClient.definition.ts index 07267f52..81fdc1ca 100644 --- a/packages/cli/src/define/urimap-client/UrimapClient.definition.ts +++ b/packages/cli/src/define/urimap-client/UrimapClient.definition.ts @@ -22,58 +22,61 @@ export const UrimapClientDefinition: ICommandDefinition = { description: strings.DESCRIPTION.CLIENT, handler: __dirname + "/UrimapClient.handler", type: "command", - positionals: [{ - name: "urimapName", - description: strings.POSITIONALS.URIMAPNAME, - type: "string", - required: true - }, { - name: "csdGroup", - description: strings.POSITIONALS.CSDGROUP, - type: "string", - required: true - }], + positionals: [ + { + name: "urimapName", + description: strings.POSITIONALS.URIMAPNAME, + type: "string", + required: true, + }, + { + name: "csdGroup", + description: strings.POSITIONALS.CSDGROUP, + type: "string", + required: true, + }, + ], options: [ { name: "urimap-path", aliases: ["up"], description: strings.OPTIONS.URIMAPPATH, type: "string", - required: true + required: true, }, { name: "urimap-host", aliases: ["uh"], description: strings.OPTIONS.URIMAPHOST, type: "string", - required: true + required: true, }, { name: "urimap-scheme", aliases: ["us"], description: strings.OPTIONS.URIMAPSCHEME, type: "string", - allowableValues: {values: ["http", "https"], caseSensitive: false}, - defaultValue: "https" + allowableValues: { values: ["http", "https"], caseSensitive: false }, + defaultValue: "https", }, { name: "authenticate", aliases: ["auth"], description: strings.OPTIONS.AUTHENTICATE, type: "string", - allowableValues: {values: ["NO", "BASIC"], caseSensitive: true}, + allowableValues: { values: ["NO", "BASIC"], caseSensitive: true }, }, { name: "certificate", aliases: ["cert"], description: strings.OPTIONS.CERTIFICATE, - type: "string" + type: "string", }, { name: "description", aliases: ["desc"], description: strings.OPTIONS.DESCRIPTION, - type: "string" + type: "string", }, { name: "region-name", @@ -83,17 +86,20 @@ export const UrimapClientDefinition: ICommandDefinition = { { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" + type: "string", }, { name: "enable", description: strings.OPTIONS.ENABLE, type: "boolean", - defaultValue: true - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.CLIENT.EX1, - options: "URIMAPA MYGRP --urimap-path /example/index.html --urimap-host www.example.com --region-name MYREGION" - }] + defaultValue: true, + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.CLIENT.EX1, + options: "URIMAPA MYGRP --urimap-path /example/index.html --urimap-host www.example.com --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/define/urimap-client/UrimapClient.handler.ts b/packages/cli/src/define/urimap-client/UrimapClient.handler.ts index 813bef6c..9cd9c8a8 100644 --- a/packages/cli/src/define/urimap-client/UrimapClient.handler.ts +++ b/packages/cli/src/define/urimap-client/UrimapClient.handler.ts @@ -26,13 +26,12 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DE */ export default class UrimapClientHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Defining URIMAP of type Client to CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await defineUrimapClient(session, { name: params.arguments.urimapName, @@ -45,7 +44,7 @@ export default class UrimapClientHandler extends CicsBaseHandler { regionName: params.arguments.regionName, cicsPlex: params.arguments.cicsPlex, authenticate: params.arguments.authenticate, - certificate: params.arguments.certificate + certificate: params.arguments.certificate, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.urimapName); diff --git a/packages/cli/src/define/urimap-pipeline/UrimapPipeline.definition.ts b/packages/cli/src/define/urimap-pipeline/UrimapPipeline.definition.ts index 6fabf01a..09ee5995 100644 --- a/packages/cli/src/define/urimap-pipeline/UrimapPipeline.definition.ts +++ b/packages/cli/src/define/urimap-pipeline/UrimapPipeline.definition.ts @@ -22,70 +22,73 @@ export const UrimapPipelineDefinition: ICommandDefinition = { description: strings.DESCRIPTION.PIPELINE, handler: __dirname + "/UrimapPipeline.handler", type: "command", - positionals: [{ - name: "urimapName", - description: strings.POSITIONALS.URIMAPNAME, - type: "string", - required: true - }, { - name: "csdGroup", - description: strings.POSITIONALS.CSDGROUP, - type: "string", - required: true - }], + positionals: [ + { + name: "urimapName", + description: strings.POSITIONALS.URIMAPNAME, + type: "string", + required: true, + }, + { + name: "csdGroup", + description: strings.POSITIONALS.CSDGROUP, + type: "string", + required: true, + }, + ], options: [ { name: "urimap-path", aliases: ["up"], description: strings.OPTIONS.URIMAPPATH, type: "string", - required: true + required: true, }, { name: "urimap-host", aliases: ["uh"], description: strings.OPTIONS.URIMAPHOST, type: "string", - required: true + required: true, }, { name: "urimap-scheme", aliases: ["us"], description: strings.OPTIONS.URIMAPSCHEME, type: "string", - allowableValues: {values: ["http", "https"], caseSensitive: false}, - defaultValue: "https" + allowableValues: { values: ["http", "https"], caseSensitive: false }, + defaultValue: "https", }, { name: "pipeline-name", aliases: ["pn"], description: strings.OPTIONS.PIPELINENAME, type: "string", - required: true + required: true, }, { name: "description", aliases: ["desc"], description: strings.OPTIONS.DESCRIPTION, - type: "string" + type: "string", }, { name: "transaction-name", aliases: ["tn"], description: strings.OPTIONS.TRANSACTIONNAME, - type: "string" + type: "string", }, { name: "webservice-name", aliases: ["wn"], description: strings.OPTIONS.WEBSERVICENAME, - type: "string" + type: "string", }, { name: "tcpipservice", aliases: ["tcpip"], description: strings.OPTIONS.TCPIPSERVICE, - type: "string" + type: "string", }, { name: "region-name", @@ -95,17 +98,20 @@ export const UrimapPipelineDefinition: ICommandDefinition = { { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" + type: "string", }, { name: "enable", description: strings.OPTIONS.ENABLE, type: "boolean", - defaultValue: true - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.PIPELINE.EX1, - options: "URIMAPA MYGRP --urimap-path /example/index.html --urimap-host www.example.com --pipeline-name PIPE123 --region-name MYREGION" - }] + defaultValue: true, + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.PIPELINE.EX1, + options: "URIMAPA MYGRP --urimap-path /example/index.html --urimap-host www.example.com --pipeline-name PIPE123 --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/define/urimap-pipeline/UrimapPipeline.handler.ts b/packages/cli/src/define/urimap-pipeline/UrimapPipeline.handler.ts index b9acb2b5..cc5e4371 100644 --- a/packages/cli/src/define/urimap-pipeline/UrimapPipeline.handler.ts +++ b/packages/cli/src/define/urimap-pipeline/UrimapPipeline.handler.ts @@ -26,13 +26,12 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DE */ export default class UrimapPipelineHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Defining URIMAP of type Pipeline to CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await defineUrimapPipeline(session, { name: params.arguments.urimapName, @@ -47,7 +46,7 @@ export default class UrimapPipelineHandler extends CicsBaseHandler { webserviceName: params.arguments.webserviceName, regionName: params.arguments.regionName, cicsPlex: params.arguments.cicsPlex, - tcpipservice: params.arguments.tcpipservice + tcpipservice: params.arguments.tcpipservice, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.urimapName); diff --git a/packages/cli/src/define/urimap-server/UrimapServer.definition.ts b/packages/cli/src/define/urimap-server/UrimapServer.definition.ts index e0cf6ddd..4199855e 100644 --- a/packages/cli/src/define/urimap-server/UrimapServer.definition.ts +++ b/packages/cli/src/define/urimap-server/UrimapServer.definition.ts @@ -22,58 +22,61 @@ export const UrimapServerDefinition: ICommandDefinition = { description: strings.DESCRIPTION.SERVER, handler: __dirname + "/UrimapServer.handler", type: "command", - positionals: [{ - name: "urimapName", - description: strings.POSITIONALS.URIMAPNAME, - type: "string", - required: true - }, { - name: "csdGroup", - description: strings.POSITIONALS.CSDGROUP, - type: "string", - required: true - }], + positionals: [ + { + name: "urimapName", + description: strings.POSITIONALS.URIMAPNAME, + type: "string", + required: true, + }, + { + name: "csdGroup", + description: strings.POSITIONALS.CSDGROUP, + type: "string", + required: true, + }, + ], options: [ { name: "urimap-path", aliases: ["up"], description: strings.OPTIONS.URIMAPPATH, type: "string", - required: true + required: true, }, { name: "urimap-host", aliases: ["uh"], description: strings.OPTIONS.URIMAPHOST, type: "string", - required: true + required: true, }, { name: "urimap-scheme", aliases: ["us"], description: strings.OPTIONS.URIMAPSCHEME, type: "string", - allowableValues: {values: ["http", "https"], caseSensitive: false}, - defaultValue: "https" + allowableValues: { values: ["http", "https"], caseSensitive: false }, + defaultValue: "https", }, { name: "program-name", aliases: ["pn"], description: strings.OPTIONS.PROGRAMNAME, type: "string", - required: true + required: true, }, { name: "description", aliases: ["desc"], description: strings.OPTIONS.DESCRIPTION, - type: "string" + type: "string", }, { name: "tcpipservice", aliases: ["tcpip"], description: strings.OPTIONS.TCPIPSERVICE, - type: "string" + type: "string", }, { name: "region-name", @@ -83,17 +86,20 @@ export const UrimapServerDefinition: ICommandDefinition = { { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" + type: "string", }, { name: "enable", description: strings.OPTIONS.ENABLE, type: "boolean", - defaultValue: true - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.SERVER.EX1, - options: "URIMAPA MYGRP --urimap-path /example/index.html --urimap-host www.example.com --program-name PGM123 --region-name MYREGION" - }] + defaultValue: true, + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.SERVER.EX1, + options: "URIMAPA MYGRP --urimap-path /example/index.html --urimap-host www.example.com --program-name PGM123 --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/define/urimap-server/UrimapServer.handler.ts b/packages/cli/src/define/urimap-server/UrimapServer.handler.ts index 3c3be781..f7f530b9 100644 --- a/packages/cli/src/define/urimap-server/UrimapServer.handler.ts +++ b/packages/cli/src/define/urimap-server/UrimapServer.handler.ts @@ -26,13 +26,12 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DE */ export default class UrimapServerHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Defining URIMAP of type Server to CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await defineUrimapServer(session, { name: params.arguments.urimapName, @@ -45,7 +44,7 @@ export default class UrimapServerHandler extends CicsBaseHandler { enable: params.arguments.enable, regionName: params.arguments.regionName, cicsPlex: params.arguments.cicsPlex, - tcpipservice: params.arguments.tcpipservice + tcpipservice: params.arguments.tcpipservice, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.urimapName); diff --git a/packages/cli/src/define/webservice/Webservice.definition.ts b/packages/cli/src/define/webservice/Webservice.definition.ts index bace8ccf..0a1b6925 100644 --- a/packages/cli/src/define/webservice/Webservice.definition.ts +++ b/packages/cli/src/define/webservice/Webservice.definition.ts @@ -22,62 +22,68 @@ export const WebServiceDefinition: ICommandDefinition = { description: strings.DESCRIPTION, handler: __dirname + "/Webservice.handler", type: "command", - positionals: [{ - name: "webserviceName", - description: strings.POSITIONALS.WEBSERVICENAME, - type: "string", - required: true - }, { - name: "csdGroup", - description: strings.POSITIONALS.CSDGROUP, - type: "string", - required: true - }], + positionals: [ + { + name: "webserviceName", + description: strings.POSITIONALS.WEBSERVICENAME, + type: "string", + required: true, + }, + { + name: "csdGroup", + description: strings.POSITIONALS.CSDGROUP, + type: "string", + required: true, + }, + ], options: [ { name: "pipeline-name", aliases: ["pn"], description: strings.OPTIONS.PIPELINENAME, type: "string", - required: true + required: true, }, { name: "wsbind", description: strings.OPTIONS.WSBIND, type: "string", - required: true + required: true, }, { name: "description", aliases: ["desc"], description: strings.OPTIONS.DESCRIPTION, - type: "string" + type: "string", }, { name: "validation", description: strings.OPTIONS.VALIDATION, type: "boolean", - defaultValue: false + defaultValue: false, }, { name: "wsdlfile", aliases: ["wsdl"], description: strings.OPTIONS.WSDLFILE, - type: "string" + type: "string", }, { name: "region-name", description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "WEBSVCA MYGRP --pipeline-name PIPELINE --wsbind /u/exampleapp/wsbind/example.log --region-name MYREGION" - }] + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "WEBSVCA MYGRP --pipeline-name PIPELINE --wsbind /u/exampleapp/wsbind/example.log --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/define/webservice/Webservice.handler.ts b/packages/cli/src/define/webservice/Webservice.handler.ts index dfac6863..c105ab8d 100644 --- a/packages/cli/src/define/webservice/Webservice.handler.ts +++ b/packages/cli/src/define/webservice/Webservice.handler.ts @@ -26,22 +26,21 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DE */ export default class WebServiceHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Defining web service to CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); /* - * Git Bash on Windows attempts to replace forward slashes with a - * directory path (e.g., /u -> U:/). CICS is picky when it validates the - * wsbind path. Unlike typical Unix paths, it must start with one slash - * and two are not allowed. We need to support paths prefixed with two - * slashes so Git Bash does not tamper with them, and then strip off the - * extra leading slash here so CICS validation will not complain. - */ + * Git Bash on Windows attempts to replace forward slashes with a + * directory path (e.g., /u -> U:/). CICS is picky when it validates the + * wsbind path. Unlike typical Unix paths, it must start with one slash + * and two are not allowed. We need to support paths prefixed with two + * slashes so Git Bash does not tamper with them, and then strip off the + * extra leading slash here so CICS validation will not complain. + */ let wsBind: string = params.arguments.wsbind; if (wsBind.startsWith("//")) { wsBind = wsBind.slice(1); @@ -56,7 +55,7 @@ export default class WebServiceHandler extends CicsBaseHandler { validation: params.arguments.validation, wsdlFile: params.arguments.wsdlFile, regionName: params.arguments.regionName, - cicsPlex: params.arguments.cicsPlex + cicsPlex: params.arguments.cicsPlex, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.webserviceName); diff --git a/packages/cli/src/delete/Delete.definition.ts b/packages/cli/src/delete/Delete.definition.ts index c8e9ceb8..4bb5310c 100644 --- a/packages/cli/src/delete/Delete.definition.ts +++ b/packages/cli/src/delete/Delete.definition.ts @@ -25,23 +25,19 @@ const strings = (require("../-strings-/en").default as typeof i18nTypings).DELET * Definition for the "delete" group of commands under the CICS plugin */ const definition: ICommandDefinition = { - name: "delete", aliases: ["del"], + name: "delete", + aliases: ["del"], summary: strings.SUMMARY, description: strings.DESCRIPTION, type: "group", - children: [ProgramDefinition, - TransactionDefinition, - UrimapDefinition, - WebServiceDefinition], + children: [ProgramDefinition, TransactionDefinition, UrimapDefinition, WebServiceDefinition], passOn: [ { property: "options", value: CicsSession.CICS_CONNECTION_OPTIONS, merge: true, - ignoreNodes: [ - {type: "group"} - ] - } - ] + ignoreNodes: [{ type: "group" }], + }, + ], }; export = definition; diff --git a/packages/cli/src/delete/program/Program.definition.ts b/packages/cli/src/delete/program/Program.definition.ts index 4ae2dd86..7fbc4995 100644 --- a/packages/cli/src/delete/program/Program.definition.ts +++ b/packages/cli/src/delete/program/Program.definition.ts @@ -17,35 +17,42 @@ import i18nTypings from "../../-strings-/en"; const strings = (require("../../-strings-/en").default as typeof i18nTypings).DELETE.RESOURCES.PROGRAM; export const ProgramDefinition: ICommandDefinition = { - name: "program", aliases: ["prog"], + name: "program", + aliases: ["prog"], description: strings.DESCRIPTION, handler: __dirname + "/Program.handler", type: "command", - positionals: [{ - name: "programName", - description: strings.POSITIONALS.PROGRAMNAME, - type: "string", - required: true - }, { - name: "csdGroup", - description: strings.POSITIONALS.CSDGROUP, - type: "string", - required: true - }], + positionals: [ + { + name: "programName", + description: strings.POSITIONALS.PROGRAMNAME, + type: "string", + required: true, + }, + { + name: "csdGroup", + description: strings.POSITIONALS.CSDGROUP, + type: "string", + required: true, + }, + ], options: [ { name: "region-name", description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "PGM123 --region-name MYREGION" - }] + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "PGM123 --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/delete/program/Program.handler.ts b/packages/cli/src/delete/program/Program.handler.ts index cc0a0e99..2a5a933e 100644 --- a/packages/cli/src/delete/program/Program.handler.ts +++ b/packages/cli/src/delete/program/Program.handler.ts @@ -26,19 +26,18 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DE */ export default class ProgramHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Deleting program from CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await deleteProgram(session, { name: params.arguments.programName, csdGroup: params.arguments.csdGroup, regionName: params.arguments.regionName, - cicsPlex: params.arguments.cicsPlex + cicsPlex: params.arguments.cicsPlex, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.programName); diff --git a/packages/cli/src/delete/transaction/Transaction.definition.ts b/packages/cli/src/delete/transaction/Transaction.definition.ts index 268895e9..e9863fae 100644 --- a/packages/cli/src/delete/transaction/Transaction.definition.ts +++ b/packages/cli/src/delete/transaction/Transaction.definition.ts @@ -17,35 +17,42 @@ import i18nTypings from "../../-strings-/en"; const strings = (require("../../-strings-/en").default as typeof i18nTypings).DELETE.RESOURCES.TRANSACTION; export const TransactionDefinition: ICommandDefinition = { - name: "transaction", aliases: ["tran"], + name: "transaction", + aliases: ["tran"], description: strings.DESCRIPTION, handler: __dirname + "/Transaction.handler", type: "command", - positionals: [{ - name: "transactionName", - description: strings.POSITIONALS.TRANSACTIONNAME, - type: "string", - required: true - }, { - name: "csdGroup", - description: strings.POSITIONALS.CSDGROUP, - type: "string", - required: true - }], + positionals: [ + { + name: "transactionName", + description: strings.POSITIONALS.TRANSACTIONNAME, + type: "string", + required: true, + }, + { + name: "csdGroup", + description: strings.POSITIONALS.CSDGROUP, + type: "string", + required: true, + }, + ], options: [ { name: "region-name", description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "TRN1 MYGRP --region-name MYREGION" - }] + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "TRN1 MYGRP --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/delete/transaction/Transaction.handler.ts b/packages/cli/src/delete/transaction/Transaction.handler.ts index 45bef1f7..54ae4090 100644 --- a/packages/cli/src/delete/transaction/Transaction.handler.ts +++ b/packages/cli/src/delete/transaction/Transaction.handler.ts @@ -26,19 +26,18 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DE */ export default class TransactionHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Deleting transaction from CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await deleteTransaction(session, { name: params.arguments.transactionName, csdGroup: params.arguments.csdGroup, regionName: params.arguments.regionName, - cicsPlex: params.arguments.cicsPlex + cicsPlex: params.arguments.cicsPlex, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.transactionName); diff --git a/packages/cli/src/delete/urimap/Urimap.definition.ts b/packages/cli/src/delete/urimap/Urimap.definition.ts index 92184471..7a1e4ac1 100644 --- a/packages/cli/src/delete/urimap/Urimap.definition.ts +++ b/packages/cli/src/delete/urimap/Urimap.definition.ts @@ -22,25 +22,32 @@ export const UrimapDefinition: ICommandDefinition = { description: strings.DESCRIPTION, handler: __dirname + "/Urimap.handler", type: "command", - positionals: [{ - name: "urimapName", - description: strings.POSITIONALS.URIMAPNAME, - type: "string", - required: true - }, { - name: "csdGroup", - description: strings.POSITIONALS.CSDGROUP, - type: "string", - required: true - }], - options: [{ - name: "region-name", - description: strings.OPTIONS.REGIONNAME, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "URIMAPA MYGRP --region-name MYREGION" - }] + positionals: [ + { + name: "urimapName", + description: strings.POSITIONALS.URIMAPNAME, + type: "string", + required: true, + }, + { + name: "csdGroup", + description: strings.POSITIONALS.CSDGROUP, + type: "string", + required: true, + }, + ], + options: [ + { + name: "region-name", + description: strings.OPTIONS.REGIONNAME, + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "URIMAPA MYGRP --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/delete/urimap/Urimap.handler.ts b/packages/cli/src/delete/urimap/Urimap.handler.ts index 99d308e7..cc7d4fea 100644 --- a/packages/cli/src/delete/urimap/Urimap.handler.ts +++ b/packages/cli/src/delete/urimap/Urimap.handler.ts @@ -27,13 +27,12 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DE export default class UrimapHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Deleting URIMAP from CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await deleteUrimap(session, { name: params.arguments.urimapName, diff --git a/packages/cli/src/delete/webservice/Webservice.definition.ts b/packages/cli/src/delete/webservice/Webservice.definition.ts index 07e9db2b..1281c4e0 100644 --- a/packages/cli/src/delete/webservice/Webservice.definition.ts +++ b/packages/cli/src/delete/webservice/Webservice.definition.ts @@ -22,25 +22,32 @@ export const WebServiceDefinition: ICommandDefinition = { description: strings.DESCRIPTION, handler: __dirname + "/Webservice.handler", type: "command", - positionals: [{ - name: "webserviceName", - description: strings.POSITIONALS.WEBSERVICENAME, - type: "string", - required: true - }, { - name: "csdGroup", - description: strings.POSITIONALS.CSDGROUP, - type: "string", - required: true - }], - options: [{ - name: "region-name", - description: strings.OPTIONS.REGIONNAME, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "WEBSVCA MYGRP --region-name MYREGION" - }] + positionals: [ + { + name: "webserviceName", + description: strings.POSITIONALS.WEBSERVICENAME, + type: "string", + required: true, + }, + { + name: "csdGroup", + description: strings.POSITIONALS.CSDGROUP, + type: "string", + required: true, + }, + ], + options: [ + { + name: "region-name", + description: strings.OPTIONS.REGIONNAME, + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "WEBSVCA MYGRP --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/delete/webservice/Webservice.handler.ts b/packages/cli/src/delete/webservice/Webservice.handler.ts index 48e1b81c..eee1db19 100644 --- a/packages/cli/src/delete/webservice/Webservice.handler.ts +++ b/packages/cli/src/delete/webservice/Webservice.handler.ts @@ -27,13 +27,12 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DE export default class WebServiceHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Deleting web service from CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await deleteWebservice(session, { name: params.arguments.webserviceName, diff --git a/packages/cli/src/disable/Disable.definition.ts b/packages/cli/src/disable/Disable.definition.ts index 5c3f8406..67354e21 100644 --- a/packages/cli/src/disable/Disable.definition.ts +++ b/packages/cli/src/disable/Disable.definition.ts @@ -26,17 +26,14 @@ const definition: ICommandDefinition = { summary: strings.SUMMARY, description: strings.DESCRIPTION, type: "group", - children: [ - UrimapDefinition], + children: [UrimapDefinition], passOn: [ { property: "options", value: CicsSession.CICS_CONNECTION_OPTIONS, merge: true, - ignoreNodes: [ - {type: "group"} - ] - } - ] + ignoreNodes: [{ type: "group" }], + }, + ], }; export = definition; diff --git a/packages/cli/src/disable/urimap/Urimap.definition.ts b/packages/cli/src/disable/urimap/Urimap.definition.ts index 526bb152..30f9e7d7 100644 --- a/packages/cli/src/disable/urimap/Urimap.definition.ts +++ b/packages/cli/src/disable/urimap/Urimap.definition.ts @@ -22,20 +22,26 @@ export const UrimapDefinition: ICommandDefinition = { description: strings.DESCRIPTION, handler: __dirname + "/Urimap.handler", type: "command", - positionals: [{ - name: "urimapName", - description: strings.POSITIONALS.URIMAPNAME, - type: "string", - required: true - }], - options: [{ - name: "region-name", - description: strings.OPTIONS.REGIONNAME, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "URIMAPA --region-name MYREGION" - }] + positionals: [ + { + name: "urimapName", + description: strings.POSITIONALS.URIMAPNAME, + type: "string", + required: true, + }, + ], + options: [ + { + name: "region-name", + description: strings.OPTIONS.REGIONNAME, + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "URIMAPA --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/disable/urimap/Urimap.handler.ts b/packages/cli/src/disable/urimap/Urimap.handler.ts index 8d1432a3..42db613d 100644 --- a/packages/cli/src/disable/urimap/Urimap.handler.ts +++ b/packages/cli/src/disable/urimap/Urimap.handler.ts @@ -27,13 +27,12 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DI export default class UrimapHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Disabling URIMAP from CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await disableUrimap(session, { name: params.arguments.urimapName, diff --git a/packages/cli/src/discard/Discard.definition.ts b/packages/cli/src/discard/Discard.definition.ts index d2ed38f9..a32c2f12 100644 --- a/packages/cli/src/discard/Discard.definition.ts +++ b/packages/cli/src/discard/Discard.definition.ts @@ -24,22 +24,19 @@ const strings = (require("../-strings-/en").default as typeof i18nTypings).DISCA * Definition for the "discard" group of commands under the CICS plugin */ const definition: ICommandDefinition = { - name: "discard", aliases: ["dis"], + name: "discard", + aliases: ["dis"], summary: strings.SUMMARY, description: strings.DESCRIPTION, type: "group", - children: [ProgramDefinition, - TransactionDefinition, - UrimapDefinition], + children: [ProgramDefinition, TransactionDefinition, UrimapDefinition], passOn: [ { property: "options", value: CicsSession.CICS_CONNECTION_OPTIONS, merge: true, - ignoreNodes: [ - {type: "group"} - ] - } - ] + ignoreNodes: [{ type: "group" }], + }, + ], }; export = definition; diff --git a/packages/cli/src/discard/program/Program.definition.ts b/packages/cli/src/discard/program/Program.definition.ts index e006428b..5fbf9255 100644 --- a/packages/cli/src/discard/program/Program.definition.ts +++ b/packages/cli/src/discard/program/Program.definition.ts @@ -17,30 +17,36 @@ import i18nTypings from "../../-strings-/en"; const strings = (require("../../-strings-/en").default as typeof i18nTypings).DISCARD.RESOURCES.PROGRAM; export const ProgramDefinition: ICommandDefinition = { - name: "program", aliases: ["prog"], + name: "program", + aliases: ["prog"], description: strings.DESCRIPTION, handler: __dirname + "/Program.handler", type: "command", - positionals: [{ - name: "programName", - description: strings.POSITIONALS.PROGRAMNAME, - type: "string", - required: true - }], + positionals: [ + { + name: "programName", + description: strings.POSITIONALS.PROGRAMNAME, + type: "string", + required: true, + }, + ], options: [ { name: "region-name", description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "PGM123 --region-name MYREGION" - }] + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "PGM123 --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/discard/program/Program.handler.ts b/packages/cli/src/discard/program/Program.handler.ts index 49aaa6aa..aad2ce76 100644 --- a/packages/cli/src/discard/program/Program.handler.ts +++ b/packages/cli/src/discard/program/Program.handler.ts @@ -26,18 +26,17 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DI */ export default class ProgramHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Discarding program from CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await discardProgram(session, { name: params.arguments.programName, regionName: params.arguments.regionName, - cicsPlex: params.arguments.cicsPlex + cicsPlex: params.arguments.cicsPlex, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.programName); diff --git a/packages/cli/src/discard/transaction/Transaction.definition.ts b/packages/cli/src/discard/transaction/Transaction.definition.ts index 4f449704..dc7d1c85 100644 --- a/packages/cli/src/discard/transaction/Transaction.definition.ts +++ b/packages/cli/src/discard/transaction/Transaction.definition.ts @@ -17,30 +17,36 @@ import i18nTypings from "../../-strings-/en"; const strings = (require("../../-strings-/en").default as typeof i18nTypings).DISCARD.RESOURCES.TRANSACTION; export const TransactionDefinition: ICommandDefinition = { - name: "transaction", aliases: ["tran"], + name: "transaction", + aliases: ["tran"], description: strings.DESCRIPTION, handler: __dirname + "/Transaction.handler", type: "command", - positionals: [{ - name: "transactionName", - description: strings.POSITIONALS.TRANSACTIONNAME, - type: "string", - required: true - }], + positionals: [ + { + name: "transactionName", + description: strings.POSITIONALS.TRANSACTIONNAME, + type: "string", + required: true, + }, + ], options: [ { name: "region-name", description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "TRN1 --region-name MYREGION" - }] + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "TRN1 --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/discard/transaction/Transaction.handler.ts b/packages/cli/src/discard/transaction/Transaction.handler.ts index 26789f76..66413d45 100644 --- a/packages/cli/src/discard/transaction/Transaction.handler.ts +++ b/packages/cli/src/discard/transaction/Transaction.handler.ts @@ -26,18 +26,17 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DI */ export default class TransactionHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Discarding transaction from CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await discardTransaction(session, { name: params.arguments.transactionName, regionName: params.arguments.regionName, - cicsPlex: params.arguments.cicsPlex + cicsPlex: params.arguments.cicsPlex, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.transactionName); diff --git a/packages/cli/src/discard/urimap/Urimap.definition.ts b/packages/cli/src/discard/urimap/Urimap.definition.ts index 65aafed5..b6278490 100644 --- a/packages/cli/src/discard/urimap/Urimap.definition.ts +++ b/packages/cli/src/discard/urimap/Urimap.definition.ts @@ -22,20 +22,26 @@ export const UrimapDefinition: ICommandDefinition = { description: strings.DESCRIPTION, handler: __dirname + "/Urimap.handler", type: "command", - positionals: [{ - name: "urimapName", - description: strings.POSITIONALS.URIMAPNAME, - type: "string", - required: true - }], - options: [{ - name: "region-name", - description: strings.OPTIONS.REGIONNAME, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "URIMAPA --region-name MYREGION" - }] + positionals: [ + { + name: "urimapName", + description: strings.POSITIONALS.URIMAPNAME, + type: "string", + required: true, + }, + ], + options: [ + { + name: "region-name", + description: strings.OPTIONS.REGIONNAME, + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "URIMAPA --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/discard/urimap/Urimap.handler.ts b/packages/cli/src/discard/urimap/Urimap.handler.ts index f14b4c8e..65a6644a 100644 --- a/packages/cli/src/discard/urimap/Urimap.handler.ts +++ b/packages/cli/src/discard/urimap/Urimap.handler.ts @@ -27,17 +27,16 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).DI export default class UrimapHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Discarding URIMAP from CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await discardUrimap(session, { name: params.arguments.urimapName, - regionName: params.arguments.regionName + regionName: params.arguments.regionName, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.urimapName); diff --git a/packages/cli/src/enable/Enable.definition.ts b/packages/cli/src/enable/Enable.definition.ts index 5b0caf55..8b72f658 100644 --- a/packages/cli/src/enable/Enable.definition.ts +++ b/packages/cli/src/enable/Enable.definition.ts @@ -23,23 +23,19 @@ const strings = (require("../-strings-/en").default as typeof i18nTypings).ENABL * Definition for the "Enable" group of commands under the CICS plugin */ const definition: ICommandDefinition = { - name: "enable", aliases: ["en"], + name: "enable", + aliases: ["en"], summary: strings.SUMMARY, description: strings.DESCRIPTION, type: "group", - children: [ - TransactionDefinition, - UrimapDefinition - ], + children: [TransactionDefinition, UrimapDefinition], passOn: [ { property: "options", value: CicsSession.CICS_CONNECTION_OPTIONS, merge: true, - ignoreNodes: [ - {type: "group"} - ] - } - ] + ignoreNodes: [{ type: "group" }], + }, + ], }; export = definition; diff --git a/packages/cli/src/enable/transaction/Transaction.definition.ts b/packages/cli/src/enable/transaction/Transaction.definition.ts index 89c6ba14..c7c4266c 100644 --- a/packages/cli/src/enable/transaction/Transaction.definition.ts +++ b/packages/cli/src/enable/transaction/Transaction.definition.ts @@ -22,27 +22,31 @@ export const TransactionDefinition: ICommandDefinition = { description: strings.DESCRIPTION, handler: __dirname + "/Transaction.handler", type: "command", - positionals: [{ - name: "name", - description: strings.POSITIONALS.NAME, - type: "string", - required: true - }], + positionals: [ + { + name: "name", + description: strings.POSITIONALS.NAME, + type: "string", + required: true, + }, + ], options: [ { name: "region-name", description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "TRN1 --region-name MYREGION", }, ], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "TRN1 --region-name MYREGION" - }] }; diff --git a/packages/cli/src/enable/transaction/Transaction.handler.ts b/packages/cli/src/enable/transaction/Transaction.handler.ts index add137a7..efc08d63 100644 --- a/packages/cli/src/enable/transaction/Transaction.handler.ts +++ b/packages/cli/src/enable/transaction/Transaction.handler.ts @@ -26,18 +26,17 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).EN */ export default class TransactionHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Enabling Transaction from CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await enableTransaction(session, { name: params.arguments.name, regionName: params.arguments.regionName, - cicsPlex: params.arguments.cicsPlex + cicsPlex: params.arguments.cicsPlex, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.name); diff --git a/packages/cli/src/enable/urimap/Urimap.definition.ts b/packages/cli/src/enable/urimap/Urimap.definition.ts index 41817144..b143cd38 100644 --- a/packages/cli/src/enable/urimap/Urimap.definition.ts +++ b/packages/cli/src/enable/urimap/Urimap.definition.ts @@ -22,20 +22,26 @@ export const UrimapDefinition: ICommandDefinition = { description: strings.DESCRIPTION, handler: __dirname + "/Urimap.handler", type: "command", - positionals: [{ - name: "urimapName", - description: strings.POSITIONALS.URIMAPNAME, - type: "string", - required: true - }], - options: [{ - name: "region-name", - description: strings.OPTIONS.REGIONNAME, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "URIMAPA --region-name MYREGION" - }] + positionals: [ + { + name: "urimapName", + description: strings.POSITIONALS.URIMAPNAME, + type: "string", + required: true, + }, + ], + options: [ + { + name: "region-name", + description: strings.OPTIONS.REGIONNAME, + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "URIMAPA --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/enable/urimap/Urimap.handler.ts b/packages/cli/src/enable/urimap/Urimap.handler.ts index 5b3a9eff..a1a70c26 100644 --- a/packages/cli/src/enable/urimap/Urimap.handler.ts +++ b/packages/cli/src/enable/urimap/Urimap.handler.ts @@ -27,17 +27,16 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).EN export default class UrimapHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Enabling URIMAP from CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await enableUrimap(session, { name: params.arguments.urimapName, - regionName: params.arguments.regionName + regionName: params.arguments.regionName, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.urimapName); diff --git a/packages/cli/src/get/Get.definition.ts b/packages/cli/src/get/Get.definition.ts index e8687df8..877a11d8 100644 --- a/packages/cli/src/get/Get.definition.ts +++ b/packages/cli/src/get/Get.definition.ts @@ -32,10 +32,8 @@ const definition: ICommandDefinition = { property: "options", value: CicsSession.CICS_CONNECTION_OPTIONS, merge: true, - ignoreNodes: [ - {type: "group"} - ] - } - ] + ignoreNodes: [{ type: "group" }], + }, + ], }; export = definition; diff --git a/packages/cli/src/get/resource/Resource.definition.ts b/packages/cli/src/get/resource/Resource.definition.ts index 4f9d7b9a..f8f10fc4 100644 --- a/packages/cli/src/get/resource/Resource.definition.ts +++ b/packages/cli/src/get/resource/Resource.definition.ts @@ -17,78 +17,86 @@ import i18nTypings from "../../-strings-/en"; const strings = (require("../../-strings-/en").default as typeof i18nTypings).GET.RESOURCES.RESOURCE; export const ResourceDefinition: ICommandDefinition = { - name: "resource", aliases: ["res"], + name: "resource", + aliases: ["res"], description: strings.DESCRIPTION, handler: __dirname + "/Resource.handler", type: "command", - positionals: [{ - name: "resourceName", - description: strings.POSITIONALS.RESOURCENAME, - type: "string", - required: true - }], + positionals: [ + { + name: "resourceName", + description: strings.POSITIONALS.RESOURCENAME, + type: "string", + required: true, + }, + ], outputFormatOptions: true, options: [ { - name: "region-name", aliases: ["rn"], + name: "region-name", + aliases: ["rn"], description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { - name: "cics-plex", aliases:["cp"], + name: "cics-plex", + aliases: ["cp"], description: strings.OPTIONS.CICSPLEX, - type: "string" + type: "string", }, { - name: "criteria", aliases: ["c"], + name: "criteria", + aliases: ["c"], description: strings.OPTIONS.CRITERIA, - type: "string" + type: "string", }, { - name: "parameter", aliases: ["p"], + name: "parameter", + aliases: ["p"], description: strings.OPTIONS.PARAMETER, - type: "string" - }], + type: "string", + }, + ], - profile: {optional: ["cics"]}, + profile: { optional: ["cics"] }, examples: [ { description: strings.EXAMPLES.EX1, - options: "CICSProgram --region-name MYREGION" + options: "CICSProgram --region-name MYREGION", }, { description: strings.EXAMPLES.EX2, - options: "CICSLocalTransaction --region-name MYREGION" + options: "CICSLocalTransaction --region-name MYREGION", }, { description: strings.EXAMPLES.EX3, - options: "CICSLocalFile --region-name MYREGION" + options: "CICSLocalFile --region-name MYREGION", }, { description: strings.EXAMPLES.EX4, - options: `CICSDefinitionProgram --region-name MYREGION --parameter "CSDGROUP(GRP1)"` + options: `CICSDefinitionProgram --region-name MYREGION --parameter "CSDGROUP(GRP1)"`, }, { description: strings.EXAMPLES.EX5, - options: `CICSDefinitionTransaction --region-name MYREGION --parameter "CSDGROUP(GRP1)"` + options: `CICSDefinitionTransaction --region-name MYREGION --parameter "CSDGROUP(GRP1)"`, }, { description: strings.EXAMPLES.EX6, - options: `CICSDefinitionURIMap --region-name MYREGION --parameter "CSDGROUP(GRP1)"` + options: `CICSDefinitionURIMap --region-name MYREGION --parameter "CSDGROUP(GRP1)"`, }, { description: strings.EXAMPLES.EX7, - options: `CICSProgram --region-name MYREGION --criteria "PROGRAM=PRG*"` + options: `CICSProgram --region-name MYREGION --criteria "PROGRAM=PRG*"`, }, { description: strings.EXAMPLES.EX8, - options: `CICSLocalTransaction --region-name MYREGION --criteria "TRANID=TRAN"` + options: `CICSLocalTransaction --region-name MYREGION --criteria "TRANID=TRAN"`, }, { description: strings.EXAMPLES.EX9, - options: `CICSProgram --region-name MYREGION --criteria "PROGRAM=MYPRG*" --rft table --rfh --rff program length status` - } - ] + options: `CICSProgram --region-name MYREGION --criteria "PROGRAM=MYPRG*" --rft table --rfh --rff program length status`, + }, + ], }; // These are GET REST API options available (for future) diff --git a/packages/cli/src/get/resource/Resource.handler.ts b/packages/cli/src/get/resource/Resource.handler.ts index c827db1d..14a92b6a 100644 --- a/packages/cli/src/get/resource/Resource.handler.ts +++ b/packages/cli/src/get/resource/Resource.handler.ts @@ -21,26 +21,25 @@ import { CicsBaseHandler } from "../../CicsBaseHandler"; */ export default class ResourceHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Getting resources from CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await getResource(session, { name: params.arguments.resourceName, regionName: params.arguments.regionName, cicsPlex: params.arguments.cicsPlex, criteria: params.arguments.criteria, - parameter: params.arguments.parameter + parameter: params.arguments.parameter, }); params.response.format.output({ fields: [], format: "object", - output: response.response.records[params.arguments.resourceName.toLowerCase()] + output: response.response.records[params.arguments.resourceName.toLowerCase()], }); return response; } diff --git a/packages/cli/src/imperative.ts b/packages/cli/src/imperative.ts index 8e499218..875e7b4e 100644 --- a/packages/cli/src/imperative.ts +++ b/packages/cli/src/imperative.ts @@ -32,7 +32,8 @@ const config: IImperativeConfig = { schema: { type: "object", title: "CICS Profile", - description: "A cics profile is required to issue commands in the cics command group that interact with " + + description: + "A cics profile is required to issue commands in the cics command group that interact with " + "CICS regions. The cics profile contains your host, port, user name, and password " + "for the IBM CICS management client interface (CMCI) server of your choice.", properties: { @@ -82,7 +83,7 @@ const config: IImperativeConfig = { optionDefinition: { name: "region-name", description: "The name of the CICS region name to interact with", - type: "string" + type: "string", }, }, cicsPlex: { @@ -90,22 +91,22 @@ const config: IImperativeConfig = { optionDefinition: { name: "cics-plex", description: "The name of the CICSPlex to interact with", - type: "string" + type: "string", }, }, rejectUnauthorized: { type: "boolean", - optionDefinition: CicsSession.CICS_OPTION_REJECT_UNAUTHORIZED + optionDefinition: CicsSession.CICS_OPTION_REJECT_UNAUTHORIZED, }, protocol: { type: "string", - optionDefinition: CicsSession.CICS_OPTION_PROTOCOL - } + optionDefinition: CicsSession.CICS_OPTION_PROTOCOL, + }, }, required: [], - } - } - ] + }, + }, + ], }; export = config; diff --git a/packages/cli/src/install/Install.definition.ts b/packages/cli/src/install/Install.definition.ts index bcb2f8a1..15e0fa20 100644 --- a/packages/cli/src/install/Install.definition.ts +++ b/packages/cli/src/install/Install.definition.ts @@ -24,22 +24,19 @@ const strings = (require("../-strings-/en").default as typeof i18nTypings).INSTA * Definition for the "install" group of commands under the CICS plugin */ const definition: ICommandDefinition = { - name: "install", aliases: ["ins"], + name: "install", + aliases: ["ins"], summary: strings.SUMMARY, description: strings.DESCRIPTION, type: "group", - children: [ProgramDefinition, - TransactionDefinition, - UrimapDefinition], + children: [ProgramDefinition, TransactionDefinition, UrimapDefinition], passOn: [ { property: "options", value: CicsSession.CICS_CONNECTION_OPTIONS, merge: true, - ignoreNodes: [ - {type: "group"} - ] - } - ] + ignoreNodes: [{ type: "group" }], + }, + ], }; export = definition; diff --git a/packages/cli/src/install/program/Program.definition.ts b/packages/cli/src/install/program/Program.definition.ts index 51ef1c82..3069180b 100644 --- a/packages/cli/src/install/program/Program.definition.ts +++ b/packages/cli/src/install/program/Program.definition.ts @@ -17,35 +17,42 @@ import i18nTypings from "../../-strings-/en"; const strings = (require("../../-strings-/en").default as typeof i18nTypings).INSTALL.RESOURCES.PROGRAM; export const ProgramDefinition: ICommandDefinition = { - name: "program", aliases: ["prog"], + name: "program", + aliases: ["prog"], description: strings.DESCRIPTION, handler: __dirname + "/Program.handler", type: "command", - positionals: [{ - name: "programName", - description: strings.POSITIONALS.PROGRAMNAME, - type: "string", - required: true - }, { - name: "csdGroup", - description: strings.POSITIONALS.CSDGROUP, - type: "string", - required: true - }], + positionals: [ + { + name: "programName", + description: strings.POSITIONALS.PROGRAMNAME, + type: "string", + required: true, + }, + { + name: "csdGroup", + description: strings.POSITIONALS.CSDGROUP, + type: "string", + required: true, + }, + ], options: [ { name: "region-name", description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "PGM123 MYGRP --region-name MYREGION" - }] + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "PGM123 MYGRP --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/install/program/Program.handler.ts b/packages/cli/src/install/program/Program.handler.ts index 7e2bd3d9..1ecfd054 100644 --- a/packages/cli/src/install/program/Program.handler.ts +++ b/packages/cli/src/install/program/Program.handler.ts @@ -26,19 +26,18 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).IN */ export default class ProgramHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Installing program to CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await installProgram(session, { name: params.arguments.programName, csdGroup: params.arguments.csdGroup, regionName: params.arguments.regionName, - cicsPlex: params.arguments.cicsPlex + cicsPlex: params.arguments.cicsPlex, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.programName); diff --git a/packages/cli/src/install/transaction/Transaction.definition.ts b/packages/cli/src/install/transaction/Transaction.definition.ts index 755d7c0e..0ce2b2c3 100644 --- a/packages/cli/src/install/transaction/Transaction.definition.ts +++ b/packages/cli/src/install/transaction/Transaction.definition.ts @@ -17,35 +17,42 @@ import i18nTypings from "../../-strings-/en"; const strings = (require("../../-strings-/en").default as typeof i18nTypings).INSTALL.RESOURCES.TRANSACTION; export const TransactionDefinition: ICommandDefinition = { - name: "transaction", aliases: ["tran"], + name: "transaction", + aliases: ["tran"], description: strings.DESCRIPTION, handler: __dirname + "/Transaction.handler", type: "command", - positionals: [{ - name: "transactionName", - description: strings.POSITIONALS.TRANSACTIONNAME, - type: "string", - required: true - }, { - name: "csdGroup", - description: strings.POSITIONALS.CSDGROUP, - type: "string", - required: true - }], + positionals: [ + { + name: "transactionName", + description: strings.POSITIONALS.TRANSACTIONNAME, + type: "string", + required: true, + }, + { + name: "csdGroup", + description: strings.POSITIONALS.CSDGROUP, + type: "string", + required: true, + }, + ], options: [ { name: "region-name", description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "TRN1 MYGRP --region-name MYREGION" - }] + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "TRN1 MYGRP --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/install/transaction/Transaction.handler.ts b/packages/cli/src/install/transaction/Transaction.handler.ts index aa2f498e..eb9e78b6 100644 --- a/packages/cli/src/install/transaction/Transaction.handler.ts +++ b/packages/cli/src/install/transaction/Transaction.handler.ts @@ -26,19 +26,18 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).IN */ export default class TransactionHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Installing transaction to CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await installTransaction(session, { name: params.arguments.transactionName, csdGroup: params.arguments.csdGroup, regionName: params.arguments.regionName, - cicsPlex: params.arguments.cicsPlex + cicsPlex: params.arguments.cicsPlex, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.transactionName); diff --git a/packages/cli/src/install/urimap/Urimap.definition.ts b/packages/cli/src/install/urimap/Urimap.definition.ts index 38c3d0a1..9f3fef24 100644 --- a/packages/cli/src/install/urimap/Urimap.definition.ts +++ b/packages/cli/src/install/urimap/Urimap.definition.ts @@ -22,25 +22,32 @@ export const UrimapDefinition: ICommandDefinition = { description: strings.DESCRIPTION, handler: __dirname + "/Urimap.handler", type: "command", - positionals: [{ - name: "urimapName", - description: strings.POSITIONALS.URIMAPNAME, - type: "string", - required: true - }, { - name: "csdGroup", - description: strings.POSITIONALS.CSDGROUP, - type: "string", - required: true - }], - options: [{ - name: "region-name", - description: strings.OPTIONS.REGIONNAME, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "URIMAPA CSDGROUP --region-name MYREGION" - }] + positionals: [ + { + name: "urimapName", + description: strings.POSITIONALS.URIMAPNAME, + type: "string", + required: true, + }, + { + name: "csdGroup", + description: strings.POSITIONALS.CSDGROUP, + type: "string", + required: true, + }, + ], + options: [ + { + name: "region-name", + description: strings.OPTIONS.REGIONNAME, + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "URIMAPA CSDGROUP --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/install/urimap/Urimap.handler.ts b/packages/cli/src/install/urimap/Urimap.handler.ts index d9ca56d0..3620249d 100644 --- a/packages/cli/src/install/urimap/Urimap.handler.ts +++ b/packages/cli/src/install/urimap/Urimap.handler.ts @@ -27,18 +27,17 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).IN export default class UrimapHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Installing URIMAP from CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await installUrimap(session, { name: params.arguments.urimapName, csdGroup: params.arguments.csdGroup, - regionName: params.arguments.regionName + regionName: params.arguments.regionName, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.urimapName); diff --git a/packages/cli/src/refresh/Refresh.definition.ts b/packages/cli/src/refresh/Refresh.definition.ts index c340bcb6..c14838c7 100644 --- a/packages/cli/src/refresh/Refresh.definition.ts +++ b/packages/cli/src/refresh/Refresh.definition.ts @@ -22,7 +22,8 @@ const strings = (require("../-strings-/en").default as typeof i18nTypings).REFRE * Definition for the "refresh" group of commands under the CICS plugin */ const definition: ICommandDefinition = { - name: "refresh", aliases: ["ref"], + name: "refresh", + aliases: ["ref"], summary: strings.SUMMARY, description: strings.DESCRIPTION, type: "group", @@ -32,10 +33,8 @@ const definition: ICommandDefinition = { property: "options", value: CicsSession.CICS_CONNECTION_OPTIONS, merge: true, - ignoreNodes: [ - {type: "group"} - ] - } - ] + ignoreNodes: [{ type: "group" }], + }, + ], }; export = definition; diff --git a/packages/cli/src/refresh/program/Program.definition.ts b/packages/cli/src/refresh/program/Program.definition.ts index c2fb7a4d..a81e78df 100644 --- a/packages/cli/src/refresh/program/Program.definition.ts +++ b/packages/cli/src/refresh/program/Program.definition.ts @@ -17,30 +17,36 @@ import i18nTypings from "../../-strings-/en"; const strings = (require("../../-strings-/en").default as typeof i18nTypings).REFRESH.RESOURCES.PROGRAM; export const ProgramDefinition: ICommandDefinition = { - name: "program", aliases: ["prog"], + name: "program", + aliases: ["prog"], description: strings.DESCRIPTION, handler: __dirname + "/Program.handler", type: "command", - positionals: [{ - name: "programName", - description: strings.POSITIONALS.PROGRAMNAME, - type: "string", - required: true - }], + positionals: [ + { + name: "programName", + description: strings.POSITIONALS.PROGRAMNAME, + type: "string", + required: true, + }, + ], options: [ { name: "region-name", description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.DEFINE_EXAMPLE_ONE, - options: "PGM123 --region-name MYREGION" - }] + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.DEFINE_EXAMPLE_ONE, + options: "PGM123 --region-name MYREGION", + }, + ], }; diff --git a/packages/cli/src/refresh/program/Program.handler.ts b/packages/cli/src/refresh/program/Program.handler.ts index 6f7cc870..9cf83313 100644 --- a/packages/cli/src/refresh/program/Program.handler.ts +++ b/packages/cli/src/refresh/program/Program.handler.ts @@ -26,18 +26,17 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).RE */ export default class ProgramHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Refreshing program to CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await programNewcopy(session, { name: params.arguments.programName, regionName: params.arguments.regionName, - cicsPlex: params.arguments.cicsPlex + cicsPlex: params.arguments.cicsPlex, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.programName); diff --git a/packages/cli/src/remove-from-list/RemoveFromList.definition.ts b/packages/cli/src/remove-from-list/RemoveFromList.definition.ts index 013993cd..3d228992 100644 --- a/packages/cli/src/remove-from-list/RemoveFromList.definition.ts +++ b/packages/cli/src/remove-from-list/RemoveFromList.definition.ts @@ -23,7 +23,8 @@ const strings = (require("../-strings-/en").default as typeof i18nTypings).REMOV * Definition for the "remove" group of commands under the CICS plugin */ const definition: ICommandDefinition = { - name: "remove-from-list", aliases: ["rfl"], + name: "remove-from-list", + aliases: ["rfl"], summary: strings.SUMMARY, description: strings.DESCRIPTION, type: "group", @@ -33,10 +34,8 @@ const definition: ICommandDefinition = { property: "options", value: CicsSession.CICS_CONNECTION_OPTIONS, merge: true, - ignoreNodes: [ - {type: "group"} - ] - } - ] + ignoreNodes: [{ type: "group" }], + }, + ], }; export = definition; diff --git a/packages/cli/src/remove-from-list/csdGroup/CSDGroup.definition.ts b/packages/cli/src/remove-from-list/csdGroup/CSDGroup.definition.ts index 061468b6..7e166fa3 100644 --- a/packages/cli/src/remove-from-list/csdGroup/CSDGroup.definition.ts +++ b/packages/cli/src/remove-from-list/csdGroup/CSDGroup.definition.ts @@ -22,31 +22,37 @@ export const CSDGroupDefinition: ICommandDefinition = { description: strings.DESCRIPTION, handler: __dirname + "/CSDGroup.handler", type: "command", - positionals: [{ - name: "name", - description: strings.POSITIONALS.NAME, - type: "string", - required: true - }, { - name: "csdList", - description: strings.POSITIONALS.CSDLIST, - type: "string", - required: true - }], + positionals: [ + { + name: "name", + description: strings.POSITIONALS.NAME, + type: "string", + required: true, + }, + { + name: "csdList", + description: strings.POSITIONALS.CSDLIST, + type: "string", + required: true, + }, + ], options: [ { name: "region-name", description: strings.OPTIONS.REGIONNAME, - type: "string" + type: "string", }, { name: "cics-plex", description: strings.OPTIONS.CICSPLEX, - type: "string" - }], - profile: {optional: ["cics"]}, - examples: [{ - description: strings.EXAMPLES.EX1, - options: "MYGRP MYLIST --region-name MYREG" - }] + type: "string", + }, + ], + profile: { optional: ["cics"] }, + examples: [ + { + description: strings.EXAMPLES.EX1, + options: "MYGRP MYLIST --region-name MYREG", + }, + ], }; diff --git a/packages/cli/src/remove-from-list/csdGroup/CSDGroup.handler.ts b/packages/cli/src/remove-from-list/csdGroup/CSDGroup.handler.ts index 56bbc97e..667e3315 100644 --- a/packages/cli/src/remove-from-list/csdGroup/CSDGroup.handler.ts +++ b/packages/cli/src/remove-from-list/csdGroup/CSDGroup.handler.ts @@ -26,19 +26,18 @@ const strings = (require("../../-strings-/en").default as typeof i18nTypings).RE */ export default class CSDGroupFromListHandler extends CicsBaseHandler { public async processWithSession(params: IHandlerParameters, session: AbstractSession): Promise { - const status: ITaskWithStatus = { statusMessage: "Removing CSD Group from CSD List on CICS", percentComplete: 0, - stageName: TaskStage.IN_PROGRESS + stageName: TaskStage.IN_PROGRESS, }; - params.response.progress.startBar({task: status}); + params.response.progress.startBar({ task: status }); const response = await removeCSDGroupFromList(session, { name: params.arguments.name, csdList: params.arguments.csdList, regionName: params.arguments.regionName, - cicsPlex: params.arguments.cicsPlex + cicsPlex: params.arguments.cicsPlex, }); params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.name, params.arguments.csdList); diff --git a/packages/sdk/__tests__/__src__/ITestPropertiesSchema.ts b/packages/sdk/__tests__/__src__/ITestPropertiesSchema.ts index 95fab20b..d2d5cb07 100644 --- a/packages/sdk/__tests__/__src__/ITestPropertiesSchema.ts +++ b/packages/sdk/__tests__/__src__/ITestPropertiesSchema.ts @@ -14,58 +14,57 @@ * see example_properties.yaml for descriptions and more details */ export interface ITestPropertiesSchema { - /** - * Properties related to connecting to CICS service - */ + * Properties related to connecting to CICS service + */ cics: { /** - * user ID to connect to CMCI - */ - user: string, + * user ID to connect to CMCI + */ + user: string; /** - * Password to connect to CMCI - */ - password: string, + * Password to connect to CMCI + */ + password: string; /** - * host name for CMCI - */ - host: string, + * host name for CMCI + */ + host: string; /** - * Port for CMCI - */ - port?: number, + * Port for CMCI + */ + port?: number; /** - * http or https protocol for CMCI - */ + * http or https protocol for CMCI + */ protocol?: string; /** - * http or https protocol for CMCI - */ + * http or https protocol for CMCI + */ rejectUnauthorized?: boolean; }; /** - * Properties related to connecting to CMCI - */ + * Properties related to connecting to CMCI + */ cmci: { /** - * CSD group to define resources to - */ + * CSD group to define resources to + */ csdGroup?: string; /** - * Name of the CICS region e.g. "CICSCMCI" - */ + * Name of the CICS region e.g. "CICSCMCI" + */ regionName?: string; }; urimap: { /** - * Name of the certificate to use for CICS Client Testing - */ + * Name of the certificate to use for CICS Client Testing + */ certificate?: string; }; } diff --git a/packages/sdk/__tests__/__system__/add-to-list/AddToList.csdGroup.system.test.ts b/packages/sdk/__tests__/__system__/add-to-list/AddToList.csdGroup.system.test.ts index 27549a77..c46901a3 100644 --- a/packages/sdk/__tests__/__system__/add-to-list/AddToList.csdGroup.system.test.ts +++ b/packages/sdk/__tests__/__system__/add-to-list/AddToList.csdGroup.system.test.ts @@ -28,11 +28,10 @@ function sleep(ms: number) { const sleepTime = 4000; describe("CICS AddToList csdGroup", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_add-to-list_csd-group", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -47,7 +46,7 @@ describe("CICS AddToList csdGroup", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/define/Define.program.system.test.ts b/packages/sdk/__tests__/__system__/define/Define.program.system.test.ts index 4bad8565..48f7287e 100644 --- a/packages/sdk/__tests__/__system__/define/Define.program.system.test.ts +++ b/packages/sdk/__tests__/__system__/define/Define.program.system.test.ts @@ -21,11 +21,10 @@ let csdGroup: string; let session: Session; describe("CICS Define program", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_define_program", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -38,7 +37,7 @@ describe("CICS Define program", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/define/Define.transaction.system.test.ts b/packages/sdk/__tests__/__system__/define/Define.transaction.system.test.ts index cf546cad..15a27343 100644 --- a/packages/sdk/__tests__/__system__/define/Define.transaction.system.test.ts +++ b/packages/sdk/__tests__/__system__/define/Define.transaction.system.test.ts @@ -21,11 +21,10 @@ let csdGroup: string; let session: Session; describe("CICS Define transaction", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_define_transaction", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -38,7 +37,7 @@ describe("CICS Define transaction", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/define/Define.urimap-client.system.test.ts b/packages/sdk/__tests__/__system__/define/Define.urimap-client.system.test.ts index 31bb8424..ec454e2e 100644 --- a/packages/sdk/__tests__/__system__/define/Define.urimap-client.system.test.ts +++ b/packages/sdk/__tests__/__system__/define/Define.urimap-client.system.test.ts @@ -30,11 +30,10 @@ function sleep(ms: number) { const sleepTime = 4000; describe("CICS Define client URImap", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_define_urimap-client", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; enable = false; @@ -51,7 +50,7 @@ describe("CICS Define client URImap", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/define/Define.urimap-pipeline.system.test.ts b/packages/sdk/__tests__/__system__/define/Define.urimap-pipeline.system.test.ts index ddd5c27c..390df378 100644 --- a/packages/sdk/__tests__/__system__/define/Define.urimap-pipeline.system.test.ts +++ b/packages/sdk/__tests__/__system__/define/Define.urimap-pipeline.system.test.ts @@ -29,11 +29,10 @@ function sleep(ms: number) { const sleepTime = 4000; describe("CICS Define pipeline URImap", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_define_urimap-pipeline", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -49,7 +48,7 @@ describe("CICS Define pipeline URImap", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/define/Define.urimap-server.system.test.ts b/packages/sdk/__tests__/__system__/define/Define.urimap-server.system.test.ts index 7be2b4ba..08ef4df3 100644 --- a/packages/sdk/__tests__/__system__/define/Define.urimap-server.system.test.ts +++ b/packages/sdk/__tests__/__system__/define/Define.urimap-server.system.test.ts @@ -29,11 +29,10 @@ function sleep(ms: number) { const sleepTime = 4000; describe("CICS Define server URImap", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_define_urimap-server", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; enable = false; @@ -49,7 +48,7 @@ describe("CICS Define server URImap", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/define/Define.webservice.system.test.ts b/packages/sdk/__tests__/__system__/define/Define.webservice.system.test.ts index da3e1d74..0257dedc 100644 --- a/packages/sdk/__tests__/__system__/define/Define.webservice.system.test.ts +++ b/packages/sdk/__tests__/__system__/define/Define.webservice.system.test.ts @@ -21,11 +21,10 @@ let csdGroup: string; let session: Session; describe("CICS Define web service", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_define_webservice", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -38,7 +37,7 @@ describe("CICS Define web service", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/delete/Delete.program.system.test.ts b/packages/sdk/__tests__/__system__/delete/Delete.program.system.test.ts index 80de4b9f..5c8e72ec 100644 --- a/packages/sdk/__tests__/__system__/delete/Delete.program.system.test.ts +++ b/packages/sdk/__tests__/__system__/delete/Delete.program.system.test.ts @@ -21,11 +21,10 @@ let csdGroup: string; let session: Session; describe("CICS Delete program", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_delete_program", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -38,7 +37,7 @@ describe("CICS Delete program", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/delete/Delete.transaction.system.test.ts b/packages/sdk/__tests__/__system__/delete/Delete.transaction.system.test.ts index f3171254..6074af6a 100644 --- a/packages/sdk/__tests__/__system__/delete/Delete.transaction.system.test.ts +++ b/packages/sdk/__tests__/__system__/delete/Delete.transaction.system.test.ts @@ -21,11 +21,10 @@ let csdGroup: string; let session: Session; describe("CICS Delete transaction", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_delete_transaction", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -38,7 +37,7 @@ describe("CICS Delete transaction", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/delete/Delete.urimap.system.test.ts b/packages/sdk/__tests__/__system__/delete/Delete.urimap.system.test.ts index a061e6ec..4979b345 100644 --- a/packages/sdk/__tests__/__system__/delete/Delete.urimap.system.test.ts +++ b/packages/sdk/__tests__/__system__/delete/Delete.urimap.system.test.ts @@ -22,11 +22,10 @@ let session: Session; let certificate: string; describe("CICS Delete URImap", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_delete_urimap", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -40,7 +39,7 @@ describe("CICS Delete URImap", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/delete/Delete.webservice.system.test.ts b/packages/sdk/__tests__/__system__/delete/Delete.webservice.system.test.ts index 1ac41e92..2b757758 100644 --- a/packages/sdk/__tests__/__system__/delete/Delete.webservice.system.test.ts +++ b/packages/sdk/__tests__/__system__/delete/Delete.webservice.system.test.ts @@ -21,11 +21,10 @@ let csdGroup: string; let session: Session; describe("CICS Delete web service", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_delete_webservice", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -38,7 +37,7 @@ describe("CICS Delete web service", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); @@ -49,7 +48,7 @@ describe("CICS Delete web service", () => { const options: IWebServiceParms = { pipelineName: "AAAA1234", wsBind: "/u/exampleapp/wsbind/example.log", - validation: false + validation: false, } as any; it("should delete a web service from CICS", async () => { diff --git a/packages/sdk/__tests__/__system__/disable/Disable.urimap.system.test.ts b/packages/sdk/__tests__/__system__/disable/Disable.urimap.system.test.ts index 23cec9c3..1b0d7590 100644 --- a/packages/sdk/__tests__/__system__/disable/Disable.urimap.system.test.ts +++ b/packages/sdk/__tests__/__system__/disable/Disable.urimap.system.test.ts @@ -13,8 +13,17 @@ import { Session } from "@zowe/imperative"; import { ITestEnvironment, TestEnvironment } from "@zowe/cli-test-utils"; import { ITestPropertiesSchema } from "../../__src__/ITestPropertiesSchema"; import { generateRandomAlphaNumericString } from "../../__src__/TestUtils"; -import { defineUrimapServer, defineUrimapClient, defineUrimapPipeline, deleteUrimap, disableUrimap, IURIMapParms, discardUrimap, - installUrimap, enableUrimap } from "../../../src"; +import { + defineUrimapServer, + defineUrimapClient, + defineUrimapPipeline, + deleteUrimap, + disableUrimap, + IURIMapParms, + discardUrimap, + installUrimap, + enableUrimap, +} from "../../../src"; let testEnvironment: ITestEnvironment; let regionName: string; @@ -29,11 +38,10 @@ function sleep(ms: number) { const sleepTime = 2000; describe("CICS Disable URImap", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_disable_urimap", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -47,7 +55,7 @@ describe("CICS Disable URImap", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/discard/Discard.program.system.test.ts b/packages/sdk/__tests__/__system__/discard/Discard.program.system.test.ts index 84559c3e..571cb9bb 100644 --- a/packages/sdk/__tests__/__system__/discard/Discard.program.system.test.ts +++ b/packages/sdk/__tests__/__system__/discard/Discard.program.system.test.ts @@ -21,11 +21,10 @@ let csdGroup: string; let session: Session; describe("CICS Discard program", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_discard_program", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -38,7 +37,7 @@ describe("CICS Discard program", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/discard/Discard.transaction.system.test.ts b/packages/sdk/__tests__/__system__/discard/Discard.transaction.system.test.ts index e5c93f25..147bff53 100644 --- a/packages/sdk/__tests__/__system__/discard/Discard.transaction.system.test.ts +++ b/packages/sdk/__tests__/__system__/discard/Discard.transaction.system.test.ts @@ -21,11 +21,10 @@ let csdGroup: string; let session: Session; describe("CICS Discard transaction", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_discard_transaction", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -38,7 +37,7 @@ describe("CICS Discard transaction", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/discard/Discard.urimap.system.test.ts b/packages/sdk/__tests__/__system__/discard/Discard.urimap.system.test.ts index 932af197..104547be 100644 --- a/packages/sdk/__tests__/__system__/discard/Discard.urimap.system.test.ts +++ b/packages/sdk/__tests__/__system__/discard/Discard.urimap.system.test.ts @@ -13,8 +13,7 @@ import { Session } from "@zowe/imperative"; import { ITestEnvironment, TestEnvironment } from "@zowe/cli-test-utils"; import { ITestPropertiesSchema } from "../../__src__/ITestPropertiesSchema"; import { generateRandomAlphaNumericString } from "../../__src__/TestUtils"; -import { defineUrimapServer, defineUrimapClient, defineUrimapPipeline, deleteUrimap, IURIMapParms, discardUrimap, - installUrimap } from "../../../src"; +import { defineUrimapServer, defineUrimapClient, defineUrimapPipeline, deleteUrimap, IURIMapParms, discardUrimap, installUrimap } from "../../../src"; let testEnvironment: ITestEnvironment; let regionName: string; @@ -29,11 +28,10 @@ function sleep(ms: number) { const sleepTime = 5000; describe("CICS Discard URImap", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_discard_urimap", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -47,7 +45,7 @@ describe("CICS Discard URImap", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/enable/Enable.urimap.system.test.ts b/packages/sdk/__tests__/__system__/enable/Enable.urimap.system.test.ts index 5cd7da50..77ad6004 100644 --- a/packages/sdk/__tests__/__system__/enable/Enable.urimap.system.test.ts +++ b/packages/sdk/__tests__/__system__/enable/Enable.urimap.system.test.ts @@ -13,8 +13,17 @@ import { Session } from "@zowe/imperative"; import { ITestEnvironment, TestEnvironment } from "@zowe/cli-test-utils"; import { ITestPropertiesSchema } from "../../__src__/ITestPropertiesSchema"; import { generateRandomAlphaNumericString } from "../../__src__/TestUtils"; -import { defineUrimapServer, defineUrimapClient, defineUrimapPipeline, deleteUrimap, disableUrimap, IURIMapParms, enableUrimap, discardUrimap, - installUrimap } from "../../../src"; +import { + defineUrimapServer, + defineUrimapClient, + defineUrimapPipeline, + deleteUrimap, + disableUrimap, + IURIMapParms, + enableUrimap, + discardUrimap, + installUrimap, +} from "../../../src"; let testEnvironment: ITestEnvironment; let regionName: string; @@ -29,11 +38,10 @@ function sleep(ms: number) { const sleepTime = 2000; describe("CICS Enable URImap", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_enable_urimap", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -47,7 +55,7 @@ describe("CICS Enable URImap", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/get/Get.resource.system.test.ts b/packages/sdk/__tests__/__system__/get/Get.resource.system.test.ts index 0f828ab5..0b2f229e 100644 --- a/packages/sdk/__tests__/__system__/get/Get.resource.system.test.ts +++ b/packages/sdk/__tests__/__system__/get/Get.resource.system.test.ts @@ -19,11 +19,10 @@ let regionName: string; let session: Session; describe("CICS Get resource", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_get_resource", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); regionName = testEnvironment.systemTestProperties.cmci.regionName; const cicsProperties = testEnvironment.systemTestProperties.cics; @@ -35,7 +34,7 @@ describe("CICS Get resource", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/install/Install.program.system.test.ts b/packages/sdk/__tests__/__system__/install/Install.program.system.test.ts index 79a5514c..1bd822d3 100644 --- a/packages/sdk/__tests__/__system__/install/Install.program.system.test.ts +++ b/packages/sdk/__tests__/__system__/install/Install.program.system.test.ts @@ -21,11 +21,10 @@ let csdGroup: string; let session: Session; describe("CICS Install program", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_install_program", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -38,7 +37,7 @@ describe("CICS Install program", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/install/Install.transaction.system.test.ts b/packages/sdk/__tests__/__system__/install/Install.transaction.system.test.ts index 3d66d8d3..0e135d7c 100644 --- a/packages/sdk/__tests__/__system__/install/Install.transaction.system.test.ts +++ b/packages/sdk/__tests__/__system__/install/Install.transaction.system.test.ts @@ -22,11 +22,10 @@ let csdGroup: string; let session: Session; describe("CICS Install transaction", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_install_transaction", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); programName = "program1"; csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; @@ -40,7 +39,7 @@ describe("CICS Install transaction", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/install/Install.urimap.system.test.ts b/packages/sdk/__tests__/__system__/install/Install.urimap.system.test.ts index 7b20ee34..d3f2f5db 100644 --- a/packages/sdk/__tests__/__system__/install/Install.urimap.system.test.ts +++ b/packages/sdk/__tests__/__system__/install/Install.urimap.system.test.ts @@ -13,8 +13,7 @@ import { Session } from "@zowe/imperative"; import { ITestEnvironment, TestEnvironment } from "@zowe/cli-test-utils"; import { ITestPropertiesSchema } from "../../__src__/ITestPropertiesSchema"; import { generateRandomAlphaNumericString } from "../../__src__/TestUtils"; -import { defineUrimapServer, defineUrimapClient, defineUrimapPipeline, deleteUrimap, IURIMapParms, discardUrimap, - installUrimap } from "../../../src"; +import { defineUrimapServer, defineUrimapClient, defineUrimapPipeline, deleteUrimap, IURIMapParms, discardUrimap, installUrimap } from "../../../src"; let testEnvironment: ITestEnvironment; let regionName: string; @@ -29,11 +28,10 @@ function sleep(ms: number) { const sleepTime = 2000; describe("CICS Install URImap", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_install_urimap", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -47,7 +45,7 @@ describe("CICS Install URImap", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/refresh/Refresh.program.system.test.ts b/packages/sdk/__tests__/__system__/refresh/Refresh.program.system.test.ts index 9720c122..9969494a 100644 --- a/packages/sdk/__tests__/__system__/refresh/Refresh.program.system.test.ts +++ b/packages/sdk/__tests__/__system__/refresh/Refresh.program.system.test.ts @@ -21,11 +21,10 @@ let csdGroup: string; let session: Session; describe("CICS Refresh program", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_refresh_program", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -38,7 +37,7 @@ describe("CICS Refresh program", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__system__/remove-from-list/RemoveFromList.csdGroup.system.test.ts b/packages/sdk/__tests__/__system__/remove-from-list/RemoveFromList.csdGroup.system.test.ts index 28071464..7a5b5dd0 100644 --- a/packages/sdk/__tests__/__system__/remove-from-list/RemoveFromList.csdGroup.system.test.ts +++ b/packages/sdk/__tests__/__system__/remove-from-list/RemoveFromList.csdGroup.system.test.ts @@ -28,11 +28,10 @@ function sleep(ms: number) { const sleepTime = 4000; describe("CICS RemoveFromList csdGroup", () => { - beforeAll(async () => { testEnvironment = await TestEnvironment.setUp({ testName: "cics_cmci_remove-from-list_csd-group", - tempProfileTypes: ["cics"] + tempProfileTypes: ["cics"], }); csdGroup = testEnvironment.systemTestProperties.cmci.csdGroup; regionName = testEnvironment.systemTestProperties.cmci.regionName; @@ -47,7 +46,7 @@ describe("CICS RemoveFromList csdGroup", () => { port: cicsProperties.port, type: "basic", rejectUnauthorized: cicsProperties.rejectUnauthorized || false, - protocol: cicsProperties.protocol as any || "https", + protocol: (cicsProperties.protocol as any) || "https", }); }); diff --git a/packages/sdk/__tests__/__unit__/CicsCmciRestClient.unit.test.ts b/packages/sdk/__tests__/__unit__/CicsCmciRestClient.unit.test.ts index 1f15ffdb..5ae23832 100644 --- a/packages/sdk/__tests__/__unit__/CicsCmciRestClient.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/CicsCmciRestClient.unit.test.ts @@ -13,9 +13,9 @@ import { IImperativeError, RestClient, Session } from "@zowe/imperative"; import { CicsCmciRestClient } from "../../src"; describe("CicsCmciRestClient tests", () => { - const dummySession = new Session({hostname: "dummy"}); + const dummySession = new Session({ hostname: "dummy" }); const testEndpoint = "testing"; - const dummyHeaders = [{testEndpoint}]; + const dummyHeaders = [{ testEndpoint }]; const restClientExpect = jest.spyOn(RestClient, "getExpectString"); @@ -25,26 +25,26 @@ describe("CicsCmciRestClient tests", () => { it("should return a formatted JSON object based on the XML retrieved", async () => { const breakfastMenu = - "" + - "" + - "\n" + - "\n" + - "French Toast\n" + - "$5.95\n" + - "\n" + - "\n" + - "Homestyle Breakfast\n" + - "$6.95\n" + - "$7.95\n" + - "$8.95\n" + - "\n" + - "" + - ""; + "" + + "" + + "\n" + + "\n" + + "French Toast\n" + + "$5.95\n" + + "\n" + + "\n" + + "Homestyle Breakfast\n" + + "$6.95\n" + + "$7.95\n" + + "$8.95\n" + + "\n" + + "" + + ""; const breakfastMenuJson = { response: { resultsummary: { api_response1: "1024", - api_response2: "0" + api_response2: "0", }, breakfast_menu: { food: [ @@ -52,8 +52,8 @@ describe("CicsCmciRestClient tests", () => { name: "French Toast", price: { currency: "USD", - _: "$5.95" - } + _: "$5.95", + }, }, { name: "Homestyle Breakfast", @@ -61,23 +61,23 @@ describe("CicsCmciRestClient tests", () => { { currency: "USD", size: "small", - _: "$6.95" + _: "$6.95", }, { currency: "USD", size: "medium", - _: "$7.95" + _: "$7.95", }, { currency: "USD", size: "large", - _: "$8.95" - } - ] - } - ] - } - } + _: "$8.95", + }, + ], + }, + ], + }, + }, }; restClientExpect.mockResolvedValue(breakfastMenu); @@ -94,12 +94,11 @@ describe("CicsCmciRestClient tests", () => { msg: "hello", causeErrors: JSON.stringify({ stack: shouldDeleteMessage, - shouldNotDelete: shouldNotDeleteMessage - }) + shouldNotDelete: shouldNotDeleteMessage, + }), }; - const processedError = ((cicsCmciRestClient as any).processError(error)); + const processedError = (cicsCmciRestClient as any).processError(error); expect(processedError.msg).toContain(shouldNotDeleteMessage); expect(processedError.msg.indexOf()).toEqual(-1); - }); }); diff --git a/packages/sdk/__tests__/__unit__/add-to-list/AddToList.csdGroup.unit.test.ts b/packages/sdk/__tests__/__unit__/add-to-list/AddToList.csdGroup.unit.test.ts index 1ad3f52b..be4e530f 100644 --- a/packages/sdk/__tests__/__unit__/add-to-list/AddToList.csdGroup.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/add-to-list/AddToList.csdGroup.unit.test.ts @@ -13,25 +13,24 @@ import { Session } from "@zowe/imperative"; import { CicsCmciRestClient, CicsCmciConstants, ICSDGroupParms, addCSDGroupToList, ICMCIApiResponse } from "../../../src"; describe("CMCI - Add csdGroup to list", () => { - const region = "region"; const group = "group"; const cicsPlex = "plex"; const list = "list"; const content = "This\nis\r\na\ntest" as unknown as ICMCIApiResponse; - const addToListParms: ICSDGroupParms = { + const addToListParms: ICSDGroupParms = { regionName: region, name: group, csdList: list, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -61,7 +60,7 @@ describe("CMCI - Add csdGroup to list", () => { response = await addCSDGroupToList(dummySession, { regionName: "fake", name: undefined, - csdList: "fake" + csdList: "fake", }); } catch (err) { error = err; @@ -77,7 +76,7 @@ describe("CMCI - Add csdGroup to list", () => { response = await addCSDGroupToList(dummySession, { regionName: "fake", name: "fake", - csdList: undefined + csdList: undefined, }); } catch (err) { error = err; @@ -93,7 +92,7 @@ describe("CMCI - Add csdGroup to list", () => { response = await addCSDGroupToList(dummySession, { regionName: undefined, name: "fake", - csdList: "fake" + csdList: "fake", }); } catch (err) { error = err; @@ -109,7 +108,7 @@ describe("CMCI - Add csdGroup to list", () => { response = await addCSDGroupToList(dummySession, { regionName: "fake", name: "", - csdList: "fake" + csdList: "fake", }); } catch (err) { error = err; @@ -125,7 +124,7 @@ describe("CMCI - Add csdGroup to list", () => { response = await addCSDGroupToList(dummySession, { regionName: "fake", name: "fake", - csdList: "" + csdList: "", }); } catch (err) { error = err; @@ -137,7 +136,6 @@ describe("CMCI - Add csdGroup to list", () => { }); }); describe("success scenarios", () => { - const requestBody: any = { request: { action: { @@ -147,11 +145,11 @@ describe("CMCI - Add csdGroup to list", () => { parameter: { $: { name: "TO_CSDLIST", - value: "list" - } - } - } - } + value: "list", + }, + }, + }, + }, }; const defineSpy = jest.spyOn(CicsCmciRestClient, "putExpectParsedXml").mockResolvedValue(content); @@ -164,9 +162,16 @@ describe("CMCI - Add csdGroup to list", () => { }); it("should be able to add a csdGroup to list without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_CSDGROUP + "/" + addToListParms.regionName + - "?CRITERIA=NAME=='" + addToListParms.name + "'"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_CSDGROUP + + "/" + + addToListParms.regionName + + "?CRITERIA=NAME=='" + + addToListParms.name + + "'"; response = await addCSDGroupToList(dummySession, addToListParms); @@ -177,9 +182,18 @@ describe("CMCI - Add csdGroup to list", () => { it("should be able to add a csdGroup to list with cicsPlex specified but empty string", async () => { addToListParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_CSDGROUP + "/" + addToListParms.cicsPlex + "/" + addToListParms.regionName + - "?CRITERIA=NAME=='" + addToListParms.name + "'"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_CSDGROUP + + "/" + + addToListParms.cicsPlex + + "/" + + addToListParms.regionName + + "?CRITERIA=NAME=='" + + addToListParms.name + + "'"; response = await addCSDGroupToList(dummySession, addToListParms); @@ -190,9 +204,18 @@ describe("CMCI - Add csdGroup to list", () => { it("should be able to add a csdGroup to list with cicsPlex specified", async () => { addToListParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_CSDGROUP + "/" + addToListParms.cicsPlex + "/" + addToListParms.regionName + - "?CRITERIA=NAME=='" + addToListParms.name + "'"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_CSDGROUP + + "/" + + addToListParms.cicsPlex + + "/" + + addToListParms.regionName + + "?CRITERIA=NAME=='" + + addToListParms.name + + "'"; response = await addCSDGroupToList(dummySession, addToListParms); diff --git a/packages/sdk/__tests__/__unit__/define/Define.program.unit.test.ts b/packages/sdk/__tests__/__unit__/define/Define.program.unit.test.ts index c1917ebc..dc82f57c 100644 --- a/packages/sdk/__tests__/__unit__/define/Define.program.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/define/Define.program.unit.test.ts @@ -13,7 +13,6 @@ import { Session } from "@zowe/imperative"; import { CicsCmciConstants, CicsCmciRestClient, defineProgram, ICMCIApiResponse, IProgramParms } from "../../../src"; describe("CMCI - Define program", () => { - const program = "program"; const region = "region"; const group = "group"; @@ -24,14 +23,14 @@ describe("CMCI - Define program", () => { regionName: region, name: program, csdGroup: group, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -61,7 +60,7 @@ describe("CMCI - Define program", () => { response = await defineProgram(dummySession, { regionName: "fake", name: undefined, - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -77,7 +76,7 @@ describe("CMCI - Define program", () => { response = await defineProgram(dummySession, { regionName: "fake", name: "fake", - csdGroup: undefined + csdGroup: undefined, }); } catch (err) { error = err; @@ -93,7 +92,7 @@ describe("CMCI - Define program", () => { response = await defineProgram(dummySession, { regionName: undefined, name: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -109,7 +108,7 @@ describe("CMCI - Define program", () => { response = await defineProgram(dummySession, { regionName: "fake", name: "", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -125,7 +124,7 @@ describe("CMCI - Define program", () => { response = await defineProgram(dummySession, { regionName: "fake", name: "fake", - csdGroup: "" + csdGroup: "", }); } catch (err) { error = err; @@ -141,7 +140,7 @@ describe("CMCI - Define program", () => { response = await defineProgram(dummySession, { regionName: "", name: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -154,23 +153,22 @@ describe("CMCI - Define program", () => { }); describe("success scenarios", () => { - const requestBody: any = { request: { create: { parameter: { $: { name: "CSD", - } + }, }, attributes: { $: { name: program, - csdgroup: group - } - } - } - } + csdgroup: group, + }, + }, + }, + }, }; const defineSpy = jest.spyOn(CicsCmciRestClient, "postExpectParsedXml").mockResolvedValue(content); @@ -183,8 +181,7 @@ describe("CMCI - Define program", () => { }); it("should be able to define a program without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_PROGRAM + "/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_PROGRAM + "/" + region; response = await defineProgram(dummySession, defineParms); @@ -195,8 +192,7 @@ describe("CMCI - Define program", () => { it("should be able to define a program with cicsPlex specified but empty string", async () => { defineParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_PROGRAM + "//" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_PROGRAM + "//" + region; response = await defineProgram(dummySession, defineParms); @@ -207,8 +203,7 @@ describe("CMCI - Define program", () => { it("should be able to define a program with cicsPlex specified", async () => { defineParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_PROGRAM + "/" + cicsPlex + "/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_PROGRAM + "/" + cicsPlex + "/" + region; response = await defineProgram(dummySession, defineParms); diff --git a/packages/sdk/__tests__/__unit__/define/Define.transaction.unit.test.ts b/packages/sdk/__tests__/__unit__/define/Define.transaction.unit.test.ts index 8e85c001..f9dc81e1 100644 --- a/packages/sdk/__tests__/__unit__/define/Define.transaction.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/define/Define.transaction.unit.test.ts @@ -13,7 +13,6 @@ import { Session } from "@zowe/imperative"; import { CicsCmciRestClient, CicsCmciConstants, ITransactionParms, defineTransaction, ICMCIApiResponse } from "../../../src"; describe("CMCI - Define transaction", () => { - const transaction = "transaction"; const program = "program"; const region = "region"; @@ -21,19 +20,19 @@ describe("CMCI - Define transaction", () => { const cicsPlex = "plex"; const content = "This\nis\r\na\ntest" as unknown as ICMCIApiResponse; - const defineParms: ITransactionParms = { + const defineParms: ITransactionParms = { regionName: region, name: transaction, programName: program, csdGroup: group, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -64,7 +63,7 @@ describe("CMCI - Define transaction", () => { regionName: "fake", name: undefined, programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -81,7 +80,7 @@ describe("CMCI - Define transaction", () => { regionName: "fake", name: "fake", programName: undefined, - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -98,7 +97,7 @@ describe("CMCI - Define transaction", () => { regionName: "fake", name: "fake", programName: "fake", - csdGroup: undefined + csdGroup: undefined, }); } catch (err) { error = err; @@ -115,7 +114,7 @@ describe("CMCI - Define transaction", () => { regionName: undefined, name: "fake", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -132,7 +131,7 @@ describe("CMCI - Define transaction", () => { regionName: "fake", name: "", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -149,7 +148,7 @@ describe("CMCI - Define transaction", () => { regionName: "fake", name: "fake", programName: "", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -166,7 +165,7 @@ describe("CMCI - Define transaction", () => { regionName: "fake", name: "fake", programName: "fake", - csdGroup: "" + csdGroup: "", }); } catch (err) { error = err; @@ -183,7 +182,7 @@ describe("CMCI - Define transaction", () => { regionName: "", name: "fake", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -196,24 +195,23 @@ describe("CMCI - Define transaction", () => { }); describe("success scenarios", () => { - const requestBody: any = { request: { create: { parameter: { $: { name: "CSD", - } + }, }, attributes: { $: { name: transaction, program, - csdgroup: group - } - } - } - } + csdgroup: group, + }, + }, + }, + }, }; const defineSpy = jest.spyOn(CicsCmciRestClient, "postExpectParsedXml").mockResolvedValue(content); @@ -226,8 +224,7 @@ describe("CMCI - Define transaction", () => { }); it("should be able to define a transaction without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "/" + region; response = await defineTransaction(dummySession, defineParms); @@ -238,8 +235,7 @@ describe("CMCI - Define transaction", () => { it("should be able to define a transaction with cicsPlex specified but empty string", async () => { defineParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "//" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "//" + region; response = await defineTransaction(dummySession, defineParms); @@ -250,8 +246,7 @@ describe("CMCI - Define transaction", () => { it("should be able to define a transaction with cicsPlex specified", async () => { defineParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "/" + cicsPlex +"/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "/" + cicsPlex + "/" + region; response = await defineTransaction(dummySession, defineParms); diff --git a/packages/sdk/__tests__/__unit__/define/Define.urimap-client.unit.test.ts b/packages/sdk/__tests__/__unit__/define/Define.urimap-client.unit.test.ts index c61c262e..dc5bcc95 100644 --- a/packages/sdk/__tests__/__unit__/define/Define.urimap-client.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/define/Define.urimap-client.unit.test.ts @@ -13,7 +13,6 @@ import { Session } from "@zowe/imperative"; import { CicsCmciRestClient, CicsCmciConstants, IURIMapParms, defineUrimapClient, ICMCIApiResponse } from "../../../src"; describe("CMCI - Define client URIMap", () => { - const urimap = "urimap"; const path = "path"; const host = "host"; @@ -26,21 +25,21 @@ describe("CMCI - Define client URIMap", () => { const authenticate = "BASIC"; const certificate = "CERT01"; - const defineParms: IURIMapParms = { + const defineParms: IURIMapParms = { regionName: region, name: urimap, path, host, scheme, csdGroup: group, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -73,7 +72,7 @@ describe("CMCI - Define client URIMap", () => { path: "fake", host: "fake", scheme: "http", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -92,7 +91,7 @@ describe("CMCI - Define client URIMap", () => { path: "fake", host: "fake", scheme: "http", - csdGroup: undefined + csdGroup: undefined, }); } catch (err) { error = err; @@ -111,7 +110,7 @@ describe("CMCI - Define client URIMap", () => { path: undefined, host: "fake", scheme: "http", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -130,7 +129,7 @@ describe("CMCI - Define client URIMap", () => { path: "fake", host: undefined, scheme: "http", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -149,7 +148,7 @@ describe("CMCI - Define client URIMap", () => { path: "fake", host: "fake", scheme: undefined, - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -168,7 +167,7 @@ describe("CMCI - Define client URIMap", () => { path: "fake", host: "fake", scheme: "http", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -187,7 +186,7 @@ describe("CMCI - Define client URIMap", () => { path: "fake", host: "fake", scheme: "http", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -206,7 +205,7 @@ describe("CMCI - Define client URIMap", () => { path: "fake", host: "fake", scheme: "http", - csdGroup: "" + csdGroup: "", }); } catch (err) { error = err; @@ -225,7 +224,7 @@ describe("CMCI - Define client URIMap", () => { path: "", host: "fake", scheme: "http", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -244,7 +243,7 @@ describe("CMCI - Define client URIMap", () => { path: "fake", host: "", scheme: "http", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -263,7 +262,7 @@ describe("CMCI - Define client URIMap", () => { path: "fake", host: "fake", scheme: "", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -282,7 +281,7 @@ describe("CMCI - Define client URIMap", () => { path: "fake", host: "fake", scheme: "http", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -295,14 +294,13 @@ describe("CMCI - Define client URIMap", () => { }); describe("success scenarios", () => { - const requestBody: any = { request: { create: { parameter: { $: { name: "CSD", - } + }, }, attributes: { $: { @@ -312,11 +310,11 @@ describe("CMCI - Define client URIMap", () => { host, scheme, usage: "client", - status: "ENABLED" - } - } - } - } + status: "ENABLED", + }, + }, + }, + }, }; const defineSpy = jest.spyOn(CicsCmciRestClient, "postExpectParsedXml").mockResolvedValue(content); @@ -329,8 +327,7 @@ describe("CMCI - Define client URIMap", () => { }); it("should be able to define a URIMap without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + region; response = await defineUrimapClient(dummySession, defineParms); @@ -341,8 +338,7 @@ describe("CMCI - Define client URIMap", () => { it("should be able to define a URIMap with cicsPlex specified but empty string", async () => { defineParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "//" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "//" + region; response = await defineUrimapClient(dummySession, defineParms); @@ -353,8 +349,7 @@ describe("CMCI - Define client URIMap", () => { it("should be able to define a URIMap with cicsPlex specified", async () => { defineParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex +"/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + "/" + region; response = await defineUrimapClient(dummySession, defineParms); @@ -367,8 +362,7 @@ describe("CMCI - Define client URIMap", () => { defineParms.description = description; defineParms.authenticate = authenticate; defineParms.certificate = certificate; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex +"/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + "/" + region; requestBody.request.create.attributes.$.description = description; requestBody.request.create.attributes.$.authenticate = authenticate; requestBody.request.create.attributes.$.certificate = certificate; diff --git a/packages/sdk/__tests__/__unit__/define/Define.urimap-pipeline.unit.test.ts b/packages/sdk/__tests__/__unit__/define/Define.urimap-pipeline.unit.test.ts index acae75e7..16c3a0cf 100644 --- a/packages/sdk/__tests__/__unit__/define/Define.urimap-pipeline.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/define/Define.urimap-pipeline.unit.test.ts @@ -13,7 +13,6 @@ import { Session } from "@zowe/imperative"; import { CicsCmciRestClient, CicsCmciConstants, IURIMapParms, defineUrimapPipeline, ICMCIApiResponse } from "../../../src"; describe("CMCI - Define pipeline URIMap", () => { - const urimap = "urimap"; const path = "path"; const host = "host"; @@ -28,7 +27,7 @@ describe("CMCI - Define pipeline URIMap", () => { const webservice = "webservice"; const tcpipservice = "TCPIPSRV"; - const defineParms: IURIMapParms = { + const defineParms: IURIMapParms = { regionName: region, name: urimap, path, @@ -36,14 +35,14 @@ describe("CMCI - Define pipeline URIMap", () => { scheme, pipelineName: pipeline, csdGroup: group, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -77,7 +76,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: "fake", scheme: "http", pipelineName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -97,7 +96,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: "fake", scheme: "http", pipelineName: "fake", - csdGroup: undefined + csdGroup: undefined, }); } catch (err) { error = err; @@ -117,7 +116,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: "fake", scheme: "http", pipelineName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -137,7 +136,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: undefined, scheme: "http", pipelineName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -157,7 +156,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: "fake", scheme: undefined, pipelineName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -177,7 +176,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: "fake", scheme: "http", pipelineName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -197,7 +196,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: "fake", scheme: "http", pipelineName: undefined, - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -217,7 +216,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: "fake", scheme: "http", pipelineName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -237,7 +236,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: "fake", scheme: "http", pipelineName: "fake", - csdGroup: "" + csdGroup: "", }); } catch (err) { error = err; @@ -257,7 +256,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: "fake", scheme: "http", pipelineName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -277,7 +276,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: "", scheme: "http", pipelineName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -297,7 +296,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: "fake", scheme: "", pipelineName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -317,7 +316,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: "fake", scheme: "http", pipelineName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -337,7 +336,7 @@ describe("CMCI - Define pipeline URIMap", () => { host: "fake", scheme: "http", pipelineName: "", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -350,14 +349,13 @@ describe("CMCI - Define pipeline URIMap", () => { }); describe("success scenarios", () => { - const requestBody: any = { request: { create: { parameter: { $: { name: "CSD", - } + }, }, attributes: { $: { @@ -368,11 +366,11 @@ describe("CMCI - Define pipeline URIMap", () => { scheme, pipeline, usage: "pipeline", - status: "ENABLED" - } - } - } - } + status: "ENABLED", + }, + }, + }, + }, }; const defineSpy = jest.spyOn(CicsCmciRestClient, "postExpectParsedXml").mockResolvedValue(content); @@ -385,8 +383,7 @@ describe("CMCI - Define pipeline URIMap", () => { }); it("should be able to define a URIMap without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + region; response = await defineUrimapPipeline(dummySession, defineParms); @@ -397,8 +394,7 @@ describe("CMCI - Define pipeline URIMap", () => { it("should be able to define a URIMap with cicsPlex specified but empty string", async () => { defineParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "//" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "//" + region; response = await defineUrimapPipeline(dummySession, defineParms); @@ -409,8 +405,7 @@ describe("CMCI - Define pipeline URIMap", () => { it("should be able to define a URIMap with cicsPlex specified", async () => { defineParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex +"/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + "/" + region; response = await defineUrimapPipeline(dummySession, defineParms); @@ -424,8 +419,7 @@ describe("CMCI - Define pipeline URIMap", () => { defineParms.transactionName = transaction; defineParms.webserviceName = webservice; defineParms.tcpipservice = tcpipservice; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex +"/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + "/" + region; requestBody.request.create.attributes.$.description = description; requestBody.request.create.attributes.$.transaction = transaction; requestBody.request.create.attributes.$.webservice = webservice; diff --git a/packages/sdk/__tests__/__unit__/define/Define.urimap-server.unit.test.ts b/packages/sdk/__tests__/__unit__/define/Define.urimap-server.unit.test.ts index ba0d538c..0281f54f 100644 --- a/packages/sdk/__tests__/__unit__/define/Define.urimap-server.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/define/Define.urimap-server.unit.test.ts @@ -13,7 +13,6 @@ import { Session } from "@zowe/imperative"; import { CicsCmciRestClient, CicsCmciConstants, IURIMapParms, defineUrimapServer, ICMCIApiResponse } from "../../../src"; describe("CMCI - Define server URIMap", () => { - const urimap = "urimap"; const path = "path"; const host = "host"; @@ -26,7 +25,7 @@ describe("CMCI - Define server URIMap", () => { const description = "description"; const tcpipservice = "TCPIPSRV"; - const defineParms: IURIMapParms = { + const defineParms: IURIMapParms = { regionName: region, name: urimap, path, @@ -34,14 +33,14 @@ describe("CMCI - Define server URIMap", () => { scheme, programName: program, csdGroup: group, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -75,7 +74,7 @@ describe("CMCI - Define server URIMap", () => { host: "fake", scheme: "http", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -95,7 +94,7 @@ describe("CMCI - Define server URIMap", () => { host: "fake", scheme: "http", programName: "fake", - csdGroup: undefined + csdGroup: undefined, }); } catch (err) { error = err; @@ -115,7 +114,7 @@ describe("CMCI - Define server URIMap", () => { host: "fake", scheme: "http", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -135,7 +134,7 @@ describe("CMCI - Define server URIMap", () => { host: undefined, scheme: "http", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -155,7 +154,7 @@ describe("CMCI - Define server URIMap", () => { host: "fake", scheme: undefined, programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -175,7 +174,7 @@ describe("CMCI - Define server URIMap", () => { host: "fake", scheme: "http", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -195,7 +194,7 @@ describe("CMCI - Define server URIMap", () => { host: "fake", scheme: "http", programName: undefined, - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -215,7 +214,7 @@ describe("CMCI - Define server URIMap", () => { host: "fake", scheme: "http", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -235,7 +234,7 @@ describe("CMCI - Define server URIMap", () => { host: "fake", scheme: "http", programName: "fake", - csdGroup: "" + csdGroup: "", }); } catch (err) { error = err; @@ -255,7 +254,7 @@ describe("CMCI - Define server URIMap", () => { host: "fake", scheme: "http", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -275,7 +274,7 @@ describe("CMCI - Define server URIMap", () => { host: "", scheme: "http", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -295,7 +294,7 @@ describe("CMCI - Define server URIMap", () => { host: "fake", scheme: "", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -315,7 +314,7 @@ describe("CMCI - Define server URIMap", () => { host: "fake", scheme: "http", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -335,7 +334,7 @@ describe("CMCI - Define server URIMap", () => { host: "fake", scheme: "http", programName: "", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -348,14 +347,13 @@ describe("CMCI - Define server URIMap", () => { }); describe("success scenarios", () => { - const requestBody: any = { request: { create: { parameter: { $: { name: "CSD", - } + }, }, attributes: { $: { @@ -366,11 +364,11 @@ describe("CMCI - Define server URIMap", () => { scheme, program, usage: "server", - status: "ENABLED" - } - } - } - } + status: "ENABLED", + }, + }, + }, + }, }; const defineSpy = jest.spyOn(CicsCmciRestClient, "postExpectParsedXml").mockResolvedValue(content); @@ -383,8 +381,7 @@ describe("CMCI - Define server URIMap", () => { }); it("should be able to define a URIMap without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + region; response = await defineUrimapServer(dummySession, defineParms); @@ -395,8 +392,7 @@ describe("CMCI - Define server URIMap", () => { it("should be able to define a URIMap with cicsPlex specified but empty string", async () => { defineParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "//" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "//" + region; response = await defineUrimapServer(dummySession, defineParms); @@ -407,8 +403,7 @@ describe("CMCI - Define server URIMap", () => { it("should be able to define a URIMap with cicsPlex specified", async () => { defineParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex +"/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + "/" + region; response = await defineUrimapServer(dummySession, defineParms); @@ -420,8 +415,7 @@ describe("CMCI - Define server URIMap", () => { it("should be able to define a URIMap with optional parameters specified", async () => { defineParms.description = description; defineParms.tcpipservice = tcpipservice; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex +"/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + "/" + region; requestBody.request.create.attributes.$.description = description; requestBody.request.create.attributes.$.tcpipservice = tcpipservice; diff --git a/packages/sdk/__tests__/__unit__/define/Define.webservice.unit.test.ts b/packages/sdk/__tests__/__unit__/define/Define.webservice.unit.test.ts index 5bf977fb..07ace7eb 100644 --- a/packages/sdk/__tests__/__unit__/define/Define.webservice.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/define/Define.webservice.unit.test.ts @@ -13,7 +13,6 @@ import { Session } from "@zowe/imperative"; import { CicsCmciRestClient, CicsCmciConstants, IWebServiceParms, defineWebservice, ICMCIApiResponse } from "../../../src"; describe("CMCI - Define web service", () => { - const websvc = "websvc"; const group = "group"; const pipeline = "pipeline"; @@ -22,21 +21,21 @@ describe("CMCI - Define web service", () => { const cicsPlex = "plex"; const content = "This\nis\r\na\ntest" as unknown as ICMCIApiResponse; - const defineParms: IWebServiceParms = { + const defineParms: IWebServiceParms = { name: websvc, pipelineName: pipeline, wsBind, validation: false, regionName: region, csdGroup: group, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -69,7 +68,7 @@ describe("CMCI - Define web service", () => { pipelineName: "fake", wsBind: "fake", validation: false, - regionName: "fake" + regionName: "fake", }); } catch (err) { error = err; @@ -88,7 +87,7 @@ describe("CMCI - Define web service", () => { pipelineName: "fake", wsBind: "fake", validation: false, - regionName: "fake" + regionName: "fake", }); } catch (err) { error = err; @@ -107,7 +106,7 @@ describe("CMCI - Define web service", () => { pipelineName: undefined, wsBind: "fake", validation: false, - regionName: "fake" + regionName: "fake", }); } catch (err) { error = err; @@ -126,7 +125,7 @@ describe("CMCI - Define web service", () => { pipelineName: "fake", wsBind: undefined, validation: false, - regionName: "fake" + regionName: "fake", }); } catch (err) { error = err; @@ -145,7 +144,7 @@ describe("CMCI - Define web service", () => { pipelineName: "fake", wsBind: "fake", validation: undefined, - regionName: "fake" + regionName: "fake", }); } catch (err) { error = err; @@ -164,7 +163,7 @@ describe("CMCI - Define web service", () => { pipelineName: "fake", wsBind: "fake", validation: false, - regionName: undefined + regionName: undefined, }); } catch (err) { error = err; @@ -183,7 +182,7 @@ describe("CMCI - Define web service", () => { pipelineName: "fake", wsBind: "fake", validation: false, - regionName: "fake" + regionName: "fake", }); } catch (err) { error = err; @@ -202,7 +201,7 @@ describe("CMCI - Define web service", () => { pipelineName: "fake", wsBind: "fake", validation: false, - regionName: "fake" + regionName: "fake", }); } catch (err) { error = err; @@ -221,7 +220,7 @@ describe("CMCI - Define web service", () => { pipelineName: "", wsBind: "fake", validation: false, - regionName: "fake" + regionName: "fake", }); } catch (err) { error = err; @@ -240,7 +239,7 @@ describe("CMCI - Define web service", () => { pipelineName: "fake", wsBind: "", validation: false, - regionName: "fake" + regionName: "fake", }); } catch (err) { error = err; @@ -259,7 +258,7 @@ describe("CMCI - Define web service", () => { pipelineName: "fake", wsBind: "fake", validation: false, - regionName: "" + regionName: "", }); } catch (err) { error = err; @@ -272,14 +271,13 @@ describe("CMCI - Define web service", () => { }); describe("success scenarios", () => { - const requestBody: any = { request: { create: { parameter: { $: { name: "CSD", - } + }, }, attributes: { $: { @@ -287,11 +285,11 @@ describe("CMCI - Define web service", () => { csdgroup: group, pipeline, wsbind: wsBind, - validation: "no" - } - } - } - } + validation: "no", + }, + }, + }, + }, }; const defineSpy = jest.spyOn(CicsCmciRestClient, "postExpectParsedXml").mockResolvedValue(content); @@ -304,8 +302,7 @@ describe("CMCI - Define web service", () => { }); it("should be able to define a web service without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_WEBSERVICE + "/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_WEBSERVICE + "/" + region; response = await defineWebservice(dummySession, defineParms); @@ -316,8 +313,7 @@ describe("CMCI - Define web service", () => { it("should be able to define a web service with cicsPlex specified but empty string", async () => { defineParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_WEBSERVICE + "//" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_WEBSERVICE + "//" + region; response = await defineWebservice(dummySession, defineParms); @@ -328,8 +324,7 @@ describe("CMCI - Define web service", () => { it("should be able to define a web service with cicsPlex specified", async () => { defineParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_WEBSERVICE + "/" + cicsPlex +"/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_WEBSERVICE + "/" + cicsPlex + "/" + region; response = await defineWebservice(dummySession, defineParms); diff --git a/packages/sdk/__tests__/__unit__/delete/Delete.program.unit.test.ts b/packages/sdk/__tests__/__unit__/delete/Delete.program.unit.test.ts index e6a2c324..f83f4077 100644 --- a/packages/sdk/__tests__/__unit__/delete/Delete.program.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/delete/Delete.program.unit.test.ts @@ -10,16 +10,9 @@ */ import { Session } from "@zowe/imperative"; -import { - CicsCmciConstants, - CicsCmciRestClient, - deleteProgram, - ICMCIApiResponse, - IProgramParms -} from "../../../src"; +import { CicsCmciConstants, CicsCmciRestClient, deleteProgram, ICMCIApiResponse, IProgramParms } from "../../../src"; describe("CMCI - Delete program", () => { - const program = "program"; const region = "region"; const cicsPlex = "plex"; @@ -30,14 +23,14 @@ describe("CMCI - Delete program", () => { regionName: region, name: program, csdGroup: group, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -83,7 +76,7 @@ describe("CMCI - Delete program", () => { response = await deleteProgram(dummySession, { regionName: "fake", csdGroup: undefined, - name: "fake" + name: "fake", }); } catch (err) { error = err; @@ -99,7 +92,7 @@ describe("CMCI - Delete program", () => { response = await deleteProgram(dummySession, { regionName: undefined, csdGroup: "fake", - name: "fake" + name: "fake", }); } catch (err) { error = err; @@ -115,7 +108,7 @@ describe("CMCI - Delete program", () => { response = await deleteProgram(dummySession, { regionName: "fake", csdGroup: "fake", - name: "" + name: "", }); } catch (err) { error = err; @@ -131,7 +124,7 @@ describe("CMCI - Delete program", () => { response = await deleteProgram(dummySession, { regionName: "fake", csdGroup: "", - name: "fake" + name: "fake", }); } catch (err) { error = err; @@ -147,7 +140,7 @@ describe("CMCI - Delete program", () => { response = await deleteProgram(dummySession, { regionName: "", csdGroup: "fake", - name: "fake" + name: "fake", }); } catch (err) { error = err; @@ -160,7 +153,6 @@ describe("CMCI - Delete program", () => { }); describe("success scenarios", () => { - const deleteSpy = jest.spyOn(CicsCmciRestClient, "deleteExpectParsedXml").mockResolvedValue(content); beforeEach(() => { @@ -171,9 +163,14 @@ describe("CMCI - Delete program", () => { }); it("should be able to delete a program without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_PROGRAM + "/" + region + - `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_PROGRAM + + "/" + + region + + `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; response = await deleteProgram(dummySession, deleteParms); @@ -184,9 +181,14 @@ describe("CMCI - Delete program", () => { it("should be able to delete a program with cicsPlex specified but empty string", async () => { deleteParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_PROGRAM + "//" + region + - `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_PROGRAM + + "//" + + region + + `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; response = await deleteProgram(dummySession, deleteParms); @@ -197,9 +199,16 @@ describe("CMCI - Delete program", () => { it("should be able to delete a program with cicsPlex specified", async () => { deleteParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_PROGRAM + "/" + cicsPlex + "/" + region + - `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_PROGRAM + + "/" + + cicsPlex + + "/" + + region + + `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; response = await deleteProgram(dummySession, deleteParms); diff --git a/packages/sdk/__tests__/__unit__/delete/Delete.transaction.unit.test.ts b/packages/sdk/__tests__/__unit__/delete/Delete.transaction.unit.test.ts index c05dfd48..eff8ac88 100644 --- a/packages/sdk/__tests__/__unit__/delete/Delete.transaction.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/delete/Delete.transaction.unit.test.ts @@ -10,16 +10,9 @@ */ import { Session } from "@zowe/imperative"; -import { - CicsCmciConstants, - CicsCmciRestClient, - deleteTransaction, - ICMCIApiResponse, - ITransactionParms -} from "../../../src"; +import { CicsCmciConstants, CicsCmciRestClient, deleteTransaction, ICMCIApiResponse, ITransactionParms } from "../../../src"; describe("CMCI - Discard transaction", () => { - const transaction = "transaction"; const program = "program"; const region = "region"; @@ -27,19 +20,19 @@ describe("CMCI - Discard transaction", () => { const cicsPlex = "plex"; const content = "This\nis\r\na\ntest" as unknown as ICMCIApiResponse; - const deleteParms: ITransactionParms = { + const deleteParms: ITransactionParms = { regionName: region, name: transaction, programName: program, csdGroup: group, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -86,7 +79,7 @@ describe("CMCI - Discard transaction", () => { response = await deleteTransaction(dummySession, { regionName: "fake", name: "fake", - csdGroup: undefined + csdGroup: undefined, }); } catch (err) { error = err; @@ -103,7 +96,7 @@ describe("CMCI - Discard transaction", () => { regionName: undefined, name: "fake", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -120,7 +113,7 @@ describe("CMCI - Discard transaction", () => { regionName: "fake", name: "", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -136,7 +129,7 @@ describe("CMCI - Discard transaction", () => { response = await deleteTransaction(dummySession, { regionName: "fake", name: "fake", - csdGroup: "" + csdGroup: "", }); } catch (err) { error = err; @@ -153,7 +146,7 @@ describe("CMCI - Discard transaction", () => { regionName: "", name: "fake", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -166,7 +159,6 @@ describe("CMCI - Discard transaction", () => { }); describe("success scenarios", () => { - const deleteSpy = jest.spyOn(CicsCmciRestClient, "deleteExpectParsedXml").mockResolvedValue(content); beforeEach(() => { @@ -177,9 +169,14 @@ describe("CMCI - Discard transaction", () => { }); it("should be able to delete a transaction without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "/" + region + - `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_TRANSACTION + + "/" + + region + + `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; response = await deleteTransaction(dummySession, deleteParms); @@ -190,9 +187,14 @@ describe("CMCI - Discard transaction", () => { it("should be able to delete a transaction with cicsPlex specified but empty string", async () => { deleteParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "//" + region + - `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_TRANSACTION + + "//" + + region + + `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; response = await deleteTransaction(dummySession, deleteParms); @@ -203,9 +205,16 @@ describe("CMCI - Discard transaction", () => { it("should be able to delete a transaction with cicsPlex specified", async () => { deleteParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "/" + cicsPlex + "/" + region + - `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_TRANSACTION + + "/" + + cicsPlex + + "/" + + region + + `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; response = await deleteTransaction(dummySession, deleteParms); diff --git a/packages/sdk/__tests__/__unit__/delete/Delete.urimap.unit.test.ts b/packages/sdk/__tests__/__unit__/delete/Delete.urimap.unit.test.ts index 701eb516..22e7c350 100644 --- a/packages/sdk/__tests__/__unit__/delete/Delete.urimap.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/delete/Delete.urimap.unit.test.ts @@ -10,16 +10,9 @@ */ import { Session } from "@zowe/imperative"; -import { - CicsCmciConstants, - CicsCmciRestClient, - ICMCIApiResponse, - IURIMapParms, - deleteUrimap -} from "../../../src"; +import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse, IURIMapParms, deleteUrimap } from "../../../src"; describe("CMCI - Delete urimap", () => { - const urimap = "urimap"; const region = "region"; const group = "group"; @@ -28,14 +21,14 @@ describe("CMCI - Delete urimap", () => { const deleteParms: IURIMapParms = { regionName: region, name: urimap, - csdGroup: group + csdGroup: group, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -102,9 +95,14 @@ describe("CMCI - Delete urimap", () => { }); it("should be able to delete a urimap", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + region + - `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_URIMAP + + "/" + + region + + `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; response = await deleteUrimap(dummySession, deleteParms); expect(response).toContain(content); diff --git a/packages/sdk/__tests__/__unit__/delete/Delete.webservice.unit.test.ts b/packages/sdk/__tests__/__unit__/delete/Delete.webservice.unit.test.ts index 91bedd2c..ec565493 100644 --- a/packages/sdk/__tests__/__unit__/delete/Delete.webservice.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/delete/Delete.webservice.unit.test.ts @@ -10,16 +10,9 @@ */ import { Session } from "@zowe/imperative"; -import { - CicsCmciConstants, - CicsCmciRestClient, - ICMCIApiResponse, - IWebServiceParms, - deleteWebservice -} from "../../../src"; +import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse, IWebServiceParms, deleteWebservice } from "../../../src"; describe("CMCI - Delete web service", () => { - const webservice = "webservice"; const region = "region"; const group = "group"; @@ -28,14 +21,14 @@ describe("CMCI - Delete web service", () => { const deleteParms: IWebServiceParms = { regionName: region, name: webservice, - csdGroup: group + csdGroup: group, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -102,9 +95,14 @@ describe("CMCI - Delete web service", () => { }); it("should be able to delete a web service", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_WEBSERVICE + "/" + region + - `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_WEBSERVICE + + "/" + + region + + `?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`; response = await deleteWebservice(dummySession, deleteParms); expect(response).toContain(content); diff --git a/packages/sdk/__tests__/__unit__/disable/Disable.urimap.unit.test.ts b/packages/sdk/__tests__/__unit__/disable/Disable.urimap.unit.test.ts index bbe563c6..7684518c 100644 --- a/packages/sdk/__tests__/__unit__/disable/Disable.urimap.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/disable/Disable.urimap.unit.test.ts @@ -10,30 +10,23 @@ */ import { Session } from "@zowe/imperative"; -import { - CicsCmciConstants, - CicsCmciRestClient, - disableUrimap, - ICMCIApiResponse, - IURIMapParms, -} from "../../../src"; +import { CicsCmciConstants, CicsCmciRestClient, disableUrimap, ICMCIApiResponse, IURIMapParms } from "../../../src"; describe("CMCI - Disable urimap", () => { - const urimap = "urimap"; const region = "region"; const content = "ThisIsATest" as unknown as ICMCIApiResponse; const disableParms: IURIMapParms = { regionName: region, - name: urimap + name: urimap, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -87,19 +80,18 @@ describe("CMCI - Disable urimap", () => { }); it("should be able to disable a urimap", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_URIMAP + "/" + region + - `?CRITERIA=(NAME=${disableParms.name})`; + endPoint = + "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_URIMAP + "/" + region + `?CRITERIA=(NAME=${disableParms.name})`; requestBody = { request: { update: { attributes: { $: { - ENABLESTATUS: "DISABLED" - } - } - } - } + ENABLESTATUS: "DISABLED", + }, + }, + }, + }, }; response = await disableUrimap(dummySession, disableParms); diff --git a/packages/sdk/__tests__/__unit__/discard/Discard.program.unit.test.ts b/packages/sdk/__tests__/__unit__/discard/Discard.program.unit.test.ts index 8a2b9ed1..14190bdd 100644 --- a/packages/sdk/__tests__/__unit__/discard/Discard.program.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/discard/Discard.program.unit.test.ts @@ -13,7 +13,6 @@ import { Session } from "@zowe/imperative"; import { CicsCmciConstants, CicsCmciRestClient, discardProgram, ICMCIApiResponse, IProgramParms } from "../../../src"; describe("CMCI - Discard program", () => { - const program = "program"; const region = "region"; const cicsPlex = "plex"; @@ -22,14 +21,14 @@ describe("CMCI - Discard program", () => { const discardParms: IProgramParms = { regionName: region, name: program, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -73,7 +72,7 @@ describe("CMCI - Discard program", () => { try { response = await discardProgram(dummySession, { regionName: undefined, - name: "fake" + name: "fake", }); } catch (err) { error = err; @@ -88,7 +87,7 @@ describe("CMCI - Discard program", () => { try { response = await discardProgram(dummySession, { regionName: "fake", - name: "" + name: "", }); } catch (err) { error = err; @@ -103,7 +102,7 @@ describe("CMCI - Discard program", () => { try { response = await discardProgram(dummySession, { regionName: "", - name: "fake" + name: "fake", }); } catch (err) { error = err; @@ -116,7 +115,6 @@ describe("CMCI - Discard program", () => { }); describe("success scenarios", () => { - const discardSpy = jest.spyOn(CicsCmciRestClient, "deleteExpectParsedXml").mockResolvedValue(content); beforeEach(() => { @@ -127,9 +125,16 @@ describe("CMCI - Discard program", () => { }); it("should be able to discard a program without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_PROGRAM_RESOURCE + "/" + region + - "?CRITERIA=(PROGRAM=" + discardParms.name + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_PROGRAM_RESOURCE + + "/" + + region + + "?CRITERIA=(PROGRAM=" + + discardParms.name + + ")"; response = await discardProgram(dummySession, discardParms); @@ -140,9 +145,16 @@ describe("CMCI - Discard program", () => { it("should be able to discard a program with cicsPlex specified but empty string", async () => { discardParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_PROGRAM_RESOURCE + "//" + region + - "?CRITERIA=(PROGRAM=" + discardParms.name + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_PROGRAM_RESOURCE + + "//" + + region + + "?CRITERIA=(PROGRAM=" + + discardParms.name + + ")"; response = await discardProgram(dummySession, discardParms); @@ -153,9 +165,18 @@ describe("CMCI - Discard program", () => { it("should be able to discard a program with cicsPlex specified", async () => { discardParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_PROGRAM_RESOURCE + "/" + cicsPlex + "/" + region + - "?CRITERIA=(PROGRAM=" + discardParms.name + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_PROGRAM_RESOURCE + + "/" + + cicsPlex + + "/" + + region + + "?CRITERIA=(PROGRAM=" + + discardParms.name + + ")"; response = await discardProgram(dummySession, discardParms); diff --git a/packages/sdk/__tests__/__unit__/discard/Discard.transaction.unit.test.ts b/packages/sdk/__tests__/__unit__/discard/Discard.transaction.unit.test.ts index f0f45fdf..1b585fea 100644 --- a/packages/sdk/__tests__/__unit__/discard/Discard.transaction.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/discard/Discard.transaction.unit.test.ts @@ -10,16 +10,9 @@ */ import { Session } from "@zowe/imperative"; -import { - CicsCmciConstants, - CicsCmciRestClient, - discardTransaction, - ICMCIApiResponse, - ITransactionParms -} from "../../../src"; +import { CicsCmciConstants, CicsCmciRestClient, discardTransaction, ICMCIApiResponse, ITransactionParms } from "../../../src"; describe("CMCI - Discard transaction", () => { - const transaction = "transaction"; const program = "program"; const region = "region"; @@ -27,19 +20,19 @@ describe("CMCI - Discard transaction", () => { const cicsPlex = "plex"; const content = "This\nis\r\na\ntest" as unknown as ICMCIApiResponse; - const discardParms: ITransactionParms = { + const discardParms: ITransactionParms = { regionName: region, name: transaction, programName: program, csdGroup: group, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -87,7 +80,7 @@ describe("CMCI - Discard transaction", () => { regionName: undefined, name: "fake", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -104,7 +97,7 @@ describe("CMCI - Discard transaction", () => { regionName: "fake", name: "", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -121,7 +114,7 @@ describe("CMCI - Discard transaction", () => { regionName: "", name: "fake", programName: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -134,7 +127,6 @@ describe("CMCI - Discard transaction", () => { }); describe("success scenarios", () => { - const discardSpy = jest.spyOn(CicsCmciRestClient, "deleteExpectParsedXml").mockResolvedValue(content); beforeEach(() => { @@ -145,9 +137,16 @@ describe("CMCI - Discard transaction", () => { }); it("should be able to discard a transaction without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_LOCAL_TRANSACTION + "/" + region + - "?CRITERIA=(TRANID=" + discardParms.name + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_LOCAL_TRANSACTION + + "/" + + region + + "?CRITERIA=(TRANID=" + + discardParms.name + + ")"; response = await discardTransaction(dummySession, discardParms); @@ -158,9 +157,16 @@ describe("CMCI - Discard transaction", () => { it("should be able to discard a transaction with cicsPlex specified but empty string", async () => { discardParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_LOCAL_TRANSACTION + "//" + region + - "?CRITERIA=(TRANID=" + discardParms.name + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_LOCAL_TRANSACTION + + "//" + + region + + "?CRITERIA=(TRANID=" + + discardParms.name + + ")"; response = await discardTransaction(dummySession, discardParms); @@ -171,9 +177,18 @@ describe("CMCI - Discard transaction", () => { it("should be able to discard a transaction with cicsPlex specified", async () => { discardParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_LOCAL_TRANSACTION + "/" + cicsPlex + "/" + region + - "?CRITERIA=(TRANID=" + discardParms.name + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_LOCAL_TRANSACTION + + "/" + + cicsPlex + + "/" + + region + + "?CRITERIA=(TRANID=" + + discardParms.name + + ")"; response = await discardTransaction(dummySession, discardParms); diff --git a/packages/sdk/__tests__/__unit__/discard/Discard.urimap.unit.test.ts b/packages/sdk/__tests__/__unit__/discard/Discard.urimap.unit.test.ts index c5408eca..17426951 100644 --- a/packages/sdk/__tests__/__unit__/discard/Discard.urimap.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/discard/Discard.urimap.unit.test.ts @@ -10,30 +10,23 @@ */ import { Session } from "@zowe/imperative"; -import { - CicsCmciConstants, - CicsCmciRestClient, - discardUrimap, - ICMCIApiResponse, - IURIMapParms, -} from "../../../src"; +import { CicsCmciConstants, CicsCmciRestClient, discardUrimap, ICMCIApiResponse, IURIMapParms } from "../../../src"; describe("CMCI - Discard urimap", () => { - const urimap = "urimap"; const region = "region"; const content = "ThisIsATest" as unknown as ICMCIApiResponse; const discardParms: IURIMapParms = { regionName: region, - name: urimap + name: urimap, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -86,9 +79,14 @@ describe("CMCI - Discard urimap", () => { }); it("should be able to discard a urimap", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_URIMAP + "/" + region + - `?CRITERIA=(NAME='${discardParms.name}')`; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_URIMAP + + "/" + + region + + `?CRITERIA=(NAME='${discardParms.name}')`; response = await discardUrimap(dummySession, discardParms); expect(response).toContain(content); diff --git a/packages/sdk/__tests__/__unit__/enable/Enable.urimap.unit.test.ts b/packages/sdk/__tests__/__unit__/enable/Enable.urimap.unit.test.ts index 467480ed..ba539e3c 100644 --- a/packages/sdk/__tests__/__unit__/enable/Enable.urimap.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/enable/Enable.urimap.unit.test.ts @@ -10,30 +10,23 @@ */ import { Session } from "@zowe/imperative"; -import { - CicsCmciConstants, - CicsCmciRestClient, - enableUrimap, - ICMCIApiResponse, - IURIMapParms, -} from "../../../src"; +import { CicsCmciConstants, CicsCmciRestClient, enableUrimap, ICMCIApiResponse, IURIMapParms } from "../../../src"; describe("CMCI - enable urimap", () => { - const urimap = "urimap"; const region = "region"; const content = "ThisIsATest" as unknown as ICMCIApiResponse; const enableParms: IURIMapParms = { regionName: region, - name: urimap + name: urimap, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -87,19 +80,18 @@ describe("CMCI - enable urimap", () => { }); it("should be able to enable a urimap", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_URIMAP + "/" + region + - `?CRITERIA=(NAME=${enableParms.name})`; + endPoint = + "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_URIMAP + "/" + region + `?CRITERIA=(NAME=${enableParms.name})`; requestBody = { request: { update: { attributes: { $: { - ENABLESTATUS: "ENABLED" - } - } - } - } + ENABLESTATUS: "ENABLED", + }, + }, + }, + }, }; response = await enableUrimap(dummySession, enableParms); diff --git a/packages/sdk/__tests__/__unit__/get/Get.resource.unit.test.ts b/packages/sdk/__tests__/__unit__/get/Get.resource.unit.test.ts index b1e2eb11..06ad761f 100644 --- a/packages/sdk/__tests__/__unit__/get/Get.resource.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/get/Get.resource.unit.test.ts @@ -10,16 +10,9 @@ */ import { Session } from "@zowe/imperative"; -import { - CicsCmciConstants, - CicsCmciRestClient, - getResource, - ICMCIApiResponse, - IResourceParms -} from "../../../src"; +import { CicsCmciConstants, CicsCmciRestClient, getResource, ICMCIApiResponse, IResourceParms } from "../../../src"; describe("CMCI - Get resource", () => { - const resource = "resource"; const region = "region"; const cicsPlex = "plex"; @@ -30,14 +23,14 @@ describe("CMCI - Get resource", () => { regionName: region, name: resource, criteria, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -81,7 +74,7 @@ describe("CMCI - Get resource", () => { try { response = await getResource(dummySession, { regionName: undefined, - name: "fake" + name: "fake", }); } catch (err) { error = err; @@ -96,7 +89,7 @@ describe("CMCI - Get resource", () => { try { response = await getResource(dummySession, { regionName: "fake", - name: "" + name: "", }); } catch (err) { error = err; @@ -111,7 +104,7 @@ describe("CMCI - Get resource", () => { try { response = await getResource(dummySession, { regionName: "", - name: "fake" + name: "fake", }); } catch (err) { error = err; @@ -124,7 +117,6 @@ describe("CMCI - Get resource", () => { }); describe("success scenarios", () => { - const deleteSpy = jest.spyOn(CicsCmciRestClient, "getExpectParsedXml").mockResolvedValue(content); beforeEach(() => { @@ -135,8 +127,16 @@ describe("CMCI - Get resource", () => { }); it("should be able to get a resource without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + resource + - "/" + region + "?CRITERIA=(" + encodeURIComponent(resourceParms.criteria) + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + resource + + "/" + + region + + "?CRITERIA=(" + + encodeURIComponent(resourceParms.criteria) + + ")"; response = await getResource(dummySession, resourceParms); @@ -146,8 +146,7 @@ describe("CMCI - Get resource", () => { it("should be able to get a resource without criteria specified", async () => { resourceParms.criteria = undefined; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + resource + - "/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + resource + "/" + region; response = await getResource(dummySession, resourceParms); @@ -158,8 +157,7 @@ describe("CMCI - Get resource", () => { it("should be able to get a resource with cicsPlex specified and criteria not specified", async () => { resourceParms.cicsPlex = cicsPlex; resourceParms.criteria = undefined; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + resource + - "/" + cicsPlex + "/" + region; + endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + resource + "/" + cicsPlex + "/" + region; response = await getResource(dummySession, resourceParms); @@ -170,8 +168,16 @@ describe("CMCI - Get resource", () => { it("should be able to get a resource with criteria specified", async () => { resourceParms.cicsPlex = undefined; resourceParms.criteria = criteria; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + resource + - "/" + region + "?CRITERIA=(" + encodeURIComponent(resourceParms.criteria) + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + resource + + "/" + + region + + "?CRITERIA=(" + + encodeURIComponent(resourceParms.criteria) + + ")"; response = await getResource(dummySession, resourceParms); expect(response).toContain(content); diff --git a/packages/sdk/__tests__/__unit__/install/Install.program.unit.test.ts b/packages/sdk/__tests__/__unit__/install/Install.program.unit.test.ts index 348ea8ab..3b5f30a9 100644 --- a/packages/sdk/__tests__/__unit__/install/Install.program.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/install/Install.program.unit.test.ts @@ -13,7 +13,6 @@ import { Session } from "@zowe/imperative"; import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse, installProgram, IProgramParms } from "../../../src"; describe("CMCI - Install program", () => { - const program = "program"; const region = "region"; const group = "group"; @@ -24,14 +23,14 @@ describe("CMCI - Install program", () => { regionName: region, name: program, csdGroup: group, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -61,7 +60,7 @@ describe("CMCI - Install program", () => { response = await installProgram(dummySession, { regionName: "fake", name: undefined, - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -77,7 +76,7 @@ describe("CMCI - Install program", () => { response = await installProgram(dummySession, { regionName: "fake", name: "fake", - csdGroup: undefined + csdGroup: undefined, }); } catch (err) { error = err; @@ -93,7 +92,7 @@ describe("CMCI - Install program", () => { response = await installProgram(dummySession, { regionName: undefined, name: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -109,7 +108,7 @@ describe("CMCI - Install program", () => { response = await installProgram(dummySession, { regionName: "fake", name: "", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -125,7 +124,7 @@ describe("CMCI - Install program", () => { response = await installProgram(dummySession, { regionName: "fake", name: "fake", - csdGroup: "" + csdGroup: "", }); } catch (err) { error = err; @@ -141,7 +140,7 @@ describe("CMCI - Install program", () => { response = await installProgram(dummySession, { regionName: "", name: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -154,15 +153,14 @@ describe("CMCI - Install program", () => { }); describe("success scenarios", () => { - const requestBody: any = { request: { action: { $: { name: "CSDINSTALL", - } - } - } + }, + }, + }, }; const installSpy = jest.spyOn(CicsCmciRestClient, "putExpectParsedXml").mockResolvedValue(content); @@ -175,9 +173,18 @@ describe("CMCI - Install program", () => { }); it("should be able to install a program without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_PROGRAM + "/" + region + - "?CRITERIA=(NAME=" + installParms.name + ")&PARAMETER=CSDGROUP(" + installParms.csdGroup + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_PROGRAM + + "/" + + region + + "?CRITERIA=(NAME=" + + installParms.name + + ")&PARAMETER=CSDGROUP(" + + installParms.csdGroup + + ")"; response = await installProgram(dummySession, installParms); @@ -188,9 +195,18 @@ describe("CMCI - Install program", () => { it("should be able to install a program with cicsPlex specified but empty string", async () => { installParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_PROGRAM + "//" + region + - "?CRITERIA=(NAME=" + installParms.name + ")&PARAMETER=CSDGROUP(" + installParms.csdGroup + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_PROGRAM + + "//" + + region + + "?CRITERIA=(NAME=" + + installParms.name + + ")&PARAMETER=CSDGROUP(" + + installParms.csdGroup + + ")"; response = await installProgram(dummySession, installParms); @@ -201,9 +217,20 @@ describe("CMCI - Install program", () => { it("should be able to install a program with cicsPlex specified", async () => { installParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_PROGRAM + "/" + cicsPlex + "/" + region + - "?CRITERIA=(NAME=" + installParms.name + ")&PARAMETER=CSDGROUP(" + installParms.csdGroup + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_PROGRAM + + "/" + + cicsPlex + + "/" + + region + + "?CRITERIA=(NAME=" + + installParms.name + + ")&PARAMETER=CSDGROUP(" + + installParms.csdGroup + + ")"; response = await installProgram(dummySession, installParms); diff --git a/packages/sdk/__tests__/__unit__/install/Install.transaction.unit.test.ts b/packages/sdk/__tests__/__unit__/install/Install.transaction.unit.test.ts index 9bc16187..49ce8bb0 100644 --- a/packages/sdk/__tests__/__unit__/install/Install.transaction.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/install/Install.transaction.unit.test.ts @@ -13,7 +13,6 @@ import { Session } from "@zowe/imperative"; import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse, installTransaction, ITransactionParms } from "../../../src"; describe("CMCI - Install transaction", () => { - const transaction = "transaction"; const program = "program"; const region = "region"; @@ -26,14 +25,14 @@ describe("CMCI - Install transaction", () => { name: transaction, programName: program, csdGroup: group, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -46,8 +45,7 @@ describe("CMCI - Install transaction", () => { error = undefined; }); - it("should throw " + - "error if no parms are defined", async () => { + it("should throw " + "error if no parms are defined", async () => { try { response = await installTransaction(dummySession, undefined); } catch (err) { @@ -64,7 +62,7 @@ describe("CMCI - Install transaction", () => { response = await installTransaction(dummySession, { regionName: "fake", name: undefined, - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -80,7 +78,7 @@ describe("CMCI - Install transaction", () => { response = await installTransaction(dummySession, { regionName: "fake", name: "fake", - csdGroup: undefined + csdGroup: undefined, }); } catch (err) { error = err; @@ -96,7 +94,7 @@ describe("CMCI - Install transaction", () => { response = await installTransaction(dummySession, { regionName: undefined, name: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -112,7 +110,7 @@ describe("CMCI - Install transaction", () => { response = await installTransaction(dummySession, { regionName: "fake", name: "", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -128,7 +126,7 @@ describe("CMCI - Install transaction", () => { response = await installTransaction(dummySession, { regionName: "fake", name: "fake", - csdGroup: "" + csdGroup: "", }); } catch (err) { error = err; @@ -144,7 +142,7 @@ describe("CMCI - Install transaction", () => { response = await installTransaction(dummySession, { regionName: "", name: "fake", - csdGroup: "fake" + csdGroup: "fake", }); } catch (err) { error = err; @@ -157,15 +155,14 @@ describe("CMCI - Install transaction", () => { }); describe("success scenarios", () => { - const requestBody: any = { request: { action: { $: { name: "CSDINSTALL", - } - } - } + }, + }, + }, }; const installSpy = jest.spyOn(CicsCmciRestClient, "putExpectParsedXml").mockResolvedValue(content); @@ -178,9 +175,18 @@ describe("CMCI - Install transaction", () => { }); it("should be able to install a transaction without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "/" + region + - "?CRITERIA=(NAME=" + installParms.name + ")&PARAMETER=CSDGROUP(" + installParms.csdGroup + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_TRANSACTION + + "/" + + region + + "?CRITERIA=(NAME=" + + installParms.name + + ")&PARAMETER=CSDGROUP(" + + installParms.csdGroup + + ")"; response = await installTransaction(dummySession, installParms); @@ -191,9 +197,18 @@ describe("CMCI - Install transaction", () => { it("should be able to install a transaction with cicsPlex specified but empty string", async () => { installParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "//" + region + - "?CRITERIA=(NAME=" + installParms.name + ")&PARAMETER=CSDGROUP(" + installParms.csdGroup + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_TRANSACTION + + "//" + + region + + "?CRITERIA=(NAME=" + + installParms.name + + ")&PARAMETER=CSDGROUP(" + + installParms.csdGroup + + ")"; response = await installTransaction(dummySession, installParms); @@ -204,9 +219,20 @@ describe("CMCI - Install transaction", () => { it("should be able to install a transaction with cicsPlex specified", async () => { installParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "/" + cicsPlex + "/" + region + - "?CRITERIA=(NAME=" + installParms.name + ")&PARAMETER=CSDGROUP(" + installParms.csdGroup + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_TRANSACTION + + "/" + + cicsPlex + + "/" + + region + + "?CRITERIA=(NAME=" + + installParms.name + + ")&PARAMETER=CSDGROUP(" + + installParms.csdGroup + + ")"; response = await installTransaction(dummySession, installParms); diff --git a/packages/sdk/__tests__/__unit__/install/Install.urimap.unit.test.ts b/packages/sdk/__tests__/__unit__/install/Install.urimap.unit.test.ts index ffa95fc3..e01a7064 100644 --- a/packages/sdk/__tests__/__unit__/install/Install.urimap.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/install/Install.urimap.unit.test.ts @@ -10,16 +10,9 @@ */ import { Session } from "@zowe/imperative"; -import { - CicsCmciConstants, - CicsCmciRestClient, - ICMCIApiResponse, - installUrimap, - IURIMapParms, -} from "../../../src"; +import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse, installUrimap, IURIMapParms } from "../../../src"; describe("CMCI - Install urimap", () => { - const urimap = "urimap"; const region = "region"; const group = "group"; @@ -28,14 +21,14 @@ describe("CMCI - Install urimap", () => { const installParms: IURIMapParms = { regionName: region, name: urimap, - csdGroup: group + csdGroup: group, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -103,17 +96,22 @@ describe("CMCI - Install urimap", () => { }); it("should be able to install a urimap", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + region + - `?CRITERIA=(NAME=${installParms.name})&PARAMETER=CSDGROUP(${installParms.csdGroup})`; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_URIMAP + + "/" + + region + + `?CRITERIA=(NAME=${installParms.name})&PARAMETER=CSDGROUP(${installParms.csdGroup})`; requestBody = { request: { action: { $: { name: "CSDINSTALL", - } - } - } + }, + }, + }, }; response = await installUrimap(dummySession, installParms); diff --git a/packages/sdk/__tests__/__unit__/refresh/Refresh.program.unit.test.ts b/packages/sdk/__tests__/__unit__/refresh/Refresh.program.unit.test.ts index 70f849c3..ff65a000 100644 --- a/packages/sdk/__tests__/__unit__/refresh/Refresh.program.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/refresh/Refresh.program.unit.test.ts @@ -13,7 +13,6 @@ import { Session } from "@zowe/imperative"; import { CicsCmciConstants, CicsCmciRestClient, programNewcopy, IProgramParms, ICMCIApiResponse } from "../../../src"; describe("CMCI - Refresh program", () => { - const program = "program"; const region = "region"; const cicsPlex = "plex"; @@ -22,14 +21,14 @@ describe("CMCI - Refresh program", () => { const refreshParms: IProgramParms = { regionName: region, name: program, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -73,7 +72,7 @@ describe("CMCI - Refresh program", () => { try { response = await programNewcopy(dummySession, { regionName: undefined, - name: "fake" + name: "fake", }); } catch (err) { error = err; @@ -88,7 +87,7 @@ describe("CMCI - Refresh program", () => { try { response = await programNewcopy(dummySession, { regionName: "fake", - name: "" + name: "", }); } catch (err) { error = err; @@ -103,7 +102,7 @@ describe("CMCI - Refresh program", () => { try { response = await programNewcopy(dummySession, { regionName: "", - name: "fake" + name: "fake", }); } catch (err) { error = err; @@ -116,15 +115,14 @@ describe("CMCI - Refresh program", () => { }); describe("success scenarios", () => { - const requestBody: any = { request: { action: { $: { name: "NEWCOPY", - } - } - } + }, + }, + }, }; const refreshSpy = jest.spyOn(CicsCmciRestClient, "putExpectParsedXml").mockResolvedValue(content); @@ -137,9 +135,16 @@ describe("CMCI - Refresh program", () => { }); it("should be able to refresh a program without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_PROGRAM_RESOURCE + "/" + region + - "?CRITERIA=(PROGRAM=" + refreshParms.name + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_PROGRAM_RESOURCE + + "/" + + region + + "?CRITERIA=(PROGRAM=" + + refreshParms.name + + ")"; response = await programNewcopy(dummySession, refreshParms); @@ -150,9 +155,16 @@ describe("CMCI - Refresh program", () => { it("should be able to refresh a program with cicsPlex specified but empty string", async () => { refreshParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_PROGRAM_RESOURCE + "//" + region + - "?CRITERIA=(PROGRAM=" + refreshParms.name + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_PROGRAM_RESOURCE + + "//" + + region + + "?CRITERIA=(PROGRAM=" + + refreshParms.name + + ")"; response = await programNewcopy(dummySession, refreshParms); @@ -163,9 +175,18 @@ describe("CMCI - Refresh program", () => { it("should be able to refresh a program with cicsPlex specified", async () => { refreshParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_PROGRAM_RESOURCE + "/" + cicsPlex + "/" + region + - "?CRITERIA=(PROGRAM=" + refreshParms.name + ")"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_PROGRAM_RESOURCE + + "/" + + cicsPlex + + "/" + + region + + "?CRITERIA=(PROGRAM=" + + refreshParms.name + + ")"; response = await programNewcopy(dummySession, refreshParms); diff --git a/packages/sdk/__tests__/__unit__/remove-from-list/RemoveFromList.csdGroup.unit.test.ts b/packages/sdk/__tests__/__unit__/remove-from-list/RemoveFromList.csdGroup.unit.test.ts index 81166369..662a07cf 100644 --- a/packages/sdk/__tests__/__unit__/remove-from-list/RemoveFromList.csdGroup.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/remove-from-list/RemoveFromList.csdGroup.unit.test.ts @@ -13,25 +13,24 @@ import { Session } from "@zowe/imperative"; import { CicsCmciRestClient, CicsCmciConstants, ICSDGroupParms, removeCSDGroupFromList, ICMCIApiResponse } from "../../../src"; describe("CMCI - Remove csdGroup from list", () => { - const region = "region"; const group = "group"; const cicsPlex = "plex"; const list = "list"; const content = "This\nis\r\na\ntest" as unknown as ICMCIApiResponse; - const removeFromListParms: ICSDGroupParms = { + const removeFromListParms: ICSDGroupParms = { regionName: region, name: group, csdList: list, - cicsPlex: undefined + cicsPlex: undefined, }; const dummySession = new Session({ user: "fake", password: "fake", hostname: "fake", - port: 1490 + port: 1490, }); let error: any; @@ -61,7 +60,7 @@ describe("CMCI - Remove csdGroup from list", () => { response = await removeCSDGroupFromList(dummySession, { regionName: "fake", name: undefined, - csdList: "fake" + csdList: "fake", }); } catch (err) { error = err; @@ -77,7 +76,7 @@ describe("CMCI - Remove csdGroup from list", () => { response = await removeCSDGroupFromList(dummySession, { regionName: "fake", name: "fake", - csdList: undefined + csdList: undefined, }); } catch (err) { error = err; @@ -93,7 +92,7 @@ describe("CMCI - Remove csdGroup from list", () => { response = await removeCSDGroupFromList(dummySession, { regionName: undefined, name: "fake", - csdList: "fake" + csdList: "fake", }); } catch (err) { error = err; @@ -109,7 +108,7 @@ describe("CMCI - Remove csdGroup from list", () => { response = await removeCSDGroupFromList(dummySession, { regionName: "fake", name: "", - csdList: "fake" + csdList: "fake", }); } catch (err) { error = err; @@ -125,7 +124,7 @@ describe("CMCI - Remove csdGroup from list", () => { response = await removeCSDGroupFromList(dummySession, { regionName: "fake", name: "fake", - csdList: "" + csdList: "", }); } catch (err) { error = err; @@ -137,7 +136,6 @@ describe("CMCI - Remove csdGroup from list", () => { }); }); describe("success scenarios", () => { - const defineSpy = jest.spyOn(CicsCmciRestClient, "deleteExpectParsedXml").mockResolvedValue(content); beforeEach(() => { @@ -148,9 +146,18 @@ describe("CMCI - Remove csdGroup from list", () => { }); it("should be able to remove a csdGroup from list without cicsPlex specified", async () => { - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_CSDGROUP_IN_LIST + "/" + removeFromListParms.regionName + - "?CRITERIA=(CSDLIST=='" + removeFromListParms.csdList + "')%20AND%20(CSDGROUP=='" + removeFromListParms.name + "')"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_CSDGROUP_IN_LIST + + "/" + + removeFromListParms.regionName + + "?CRITERIA=(CSDLIST=='" + + removeFromListParms.csdList + + "')%20AND%20(CSDGROUP=='" + + removeFromListParms.name + + "')"; response = await removeCSDGroupFromList(dummySession, removeFromListParms); @@ -161,9 +168,20 @@ describe("CMCI - Remove csdGroup from list", () => { it("should be able to remove a csdGroup from list with cicsPlex specified but empty string", async () => { removeFromListParms.cicsPlex = ""; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_CSDGROUP_IN_LIST + "/" + removeFromListParms.cicsPlex + "/" + removeFromListParms.regionName + - "?CRITERIA=(CSDLIST=='" + removeFromListParms.csdList + "')%20AND%20(CSDGROUP=='" + removeFromListParms.name + "')"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_CSDGROUP_IN_LIST + + "/" + + removeFromListParms.cicsPlex + + "/" + + removeFromListParms.regionName + + "?CRITERIA=(CSDLIST=='" + + removeFromListParms.csdList + + "')%20AND%20(CSDGROUP=='" + + removeFromListParms.name + + "')"; response = await removeCSDGroupFromList(dummySession, removeFromListParms); @@ -174,9 +192,20 @@ describe("CMCI - Remove csdGroup from list", () => { it("should be able to remove a csdGroup from list with cicsPlex specified", async () => { removeFromListParms.cicsPlex = cicsPlex; - endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_CSDGROUP_IN_LIST + "/" + removeFromListParms.cicsPlex + "/" + removeFromListParms.regionName + - "?CRITERIA=(CSDLIST=='" + removeFromListParms.csdList + "')%20AND%20(CSDGROUP=='" + removeFromListParms.name + "')"; + endPoint = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_CSDGROUP_IN_LIST + + "/" + + removeFromListParms.cicsPlex + + "/" + + removeFromListParms.regionName + + "?CRITERIA=(CSDLIST=='" + + removeFromListParms.csdList + + "')%20AND%20(CSDGROUP=='" + + removeFromListParms.name + + "')"; response = await removeCSDGroupFromList(dummySession, removeFromListParms); diff --git a/packages/sdk/package.json b/packages/sdk/package.json index d422c863..fa398568 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -28,6 +28,7 @@ "build": "tsc --pretty && npm run checkTestsCompile && npm run madge", "checkTestsCompile": "echo \"Checking that test source compiles...\" && tsc --project __tests__/test-tsconfig.json --noEmit ", "madge": "madge -c lib", + "pretty": "prettier --write 'src/**/*.ts' '__tests__/**/*.ts'", "prebuild": "npm run clean && echo Using TypeScript && tsc --version", "clean": "rimraf lib", "watch": "tsc --pretty --watch", diff --git a/packages/sdk/src/constants/CicsCmci.constants.ts b/packages/sdk/src/constants/CicsCmci.constants.ts index aaa36c3e..ac8093eb 100644 --- a/packages/sdk/src/constants/CicsCmci.constants.ts +++ b/packages/sdk/src/constants/CicsCmci.constants.ts @@ -14,84 +14,83 @@ */ export const CicsCmciConstants: { [key: string]: any } = { /** - * Specifies the required part of the REST interface URI - */ + * Specifies the required part of the REST interface URI + */ CICS_SYSTEM_MANAGEMENT: "CICSSystemManagement", /** - * Specifies the required part of the REST interface URI to access program definitions - */ + * Specifies the required part of the REST interface URI to access program definitions + */ CICS_DEFINITION_PROGRAM: "CICSDefinitionProgram", /** - * Specifies the required part of the REST interface URI to update installed transactions - */ + * Specifies the required part of the REST interface URI to update installed transactions + */ CICS_LOCAL_TRANSACTION: "CICSLocalTransaction", /** - * Specifies the required part of the REST interface URI to access transaction definitions - */ + * Specifies the required part of the REST interface URI to access transaction definitions + */ CICS_DEFINITION_TRANSACTION: "CICSDefinitionTransaction", /** - * Specifies the required part of the REST interface URI to access program resources - */ + * Specifies the required part of the REST interface URI to access program resources + */ CICS_PROGRAM_RESOURCE: "CICSProgram", /** - * Specifies the required part of the REST interface URI to access URIMap definitions - */ + * Specifies the required part of the REST interface URI to access URIMap definitions + */ CICS_DEFINITION_URIMAP: "CICSDefinitionURIMap", /** - * Specifies the required part of the REST interface URI to access webservice definitions - */ + * Specifies the required part of the REST interface URI to access webservice definitions + */ CICS_DEFINITION_WEBSERVICE: "CICSDefinitionWebService", /* - * Specifies the required part of the REST interface URI to access URIMaps - */ + * Specifies the required part of the REST interface URI to access URIMaps + */ CICS_URIMAP: "CICSURIMap", /** - * Specifies the required part of the REST interface URI to access CSD Group definitions - */ + * Specifies the required part of the REST interface URI to access CSD Group definitions + */ CICS_CSDGROUP: "CICSCSDGroup", /** - * Specifies the required part of the REST interface URI to access CSD Group in list definitions - */ + * Specifies the required part of the REST interface URI to access CSD Group in list definitions + */ CICS_CSDGROUP_IN_LIST: "CICSCSDGroupInList", /** - * ORDERBY parameter - */ + * ORDERBY parameter + */ ORDER_BY: "ORDERBY", /** - * SUMMONLY parameter - */ + * SUMMONLY parameter + */ SUMM_ONLY: "SUMMONLY", /** - * NODISCARD parameter - */ + * NODISCARD parameter + */ NO_DISCARD: "NODISCARD", /** - * CRITERIA parameter - */ + * CRITERIA parameter + */ CRITERIA: "CRITERIA", /** - * PARAMETER parameter - */ + * PARAMETER parameter + */ PARAMETER: "PARAMETER", /** - * The CICS CMCI external resource names - */ + * The CICS CMCI external resource names + */ CICS_CMCI_EXTERNAL_RESOURCES: ["CICSLocalTransaction", "CICSRemoteTransaction", "CICSDefinitionTransaction", "CICSLocalFile"], - }; diff --git a/packages/sdk/src/constants/CicsCmci.messages.ts b/packages/sdk/src/constants/CicsCmci.messages.ts index 1b9aebde..81abb5f2 100644 --- a/packages/sdk/src/constants/CicsCmci.messages.ts +++ b/packages/sdk/src/constants/CicsCmci.messages.ts @@ -15,8 +15,7 @@ import { IMessageDefinition } from "@zowe/imperative"; * Messages for the CICS plugin */ export const CicsCmciMessages: { [key: string]: IMessageDefinition } = { - cmciRequestFailed: { - message: "Did not receive the expected response from CMCI REST API. " - } + message: "Did not receive the expected response from CMCI REST API. ", + }, }; diff --git a/packages/sdk/src/doc/IBaseParms.ts b/packages/sdk/src/doc/IBaseParms.ts index b5007bfb..32a680f0 100644 --- a/packages/sdk/src/doc/IBaseParms.ts +++ b/packages/sdk/src/doc/IBaseParms.ts @@ -11,18 +11,18 @@ export interface IBaseParms { /** - * The name of resource - * Up to eight characters long - */ + * The name of resource + * Up to eight characters long + */ name: string; /** - * The name of the CICS region - */ + * The name of the CICS region + */ regionName: string; /** - * The name of the CICS Plex - */ + * The name of the CICS Plex + */ cicsPlex?: string; } diff --git a/packages/sdk/src/doc/ICMCIApiResponse.ts b/packages/sdk/src/doc/ICMCIApiResponse.ts index 984ca45f..c8e1862a 100644 --- a/packages/sdk/src/doc/ICMCIApiResponse.ts +++ b/packages/sdk/src/doc/ICMCIApiResponse.ts @@ -17,19 +17,19 @@ import { ICMCIResponseResultSummary } from "./ICMCIResponseResultSummary"; export interface ICMCIApiResponse { /** - * See the following link for more information: - * https://www.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.ts.clientapi.doc/topics/clientapi_response_element.html - */ + * See the following link for more information: + * https://www.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.ts.clientapi.doc/topics/clientapi_response_element.html + */ response: { /** - * See the following link for more information: - * https://www.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.ts.clientapi.doc/topics/clientapi_resultsummary_element.html - */ + * See the following link for more information: + * https://www.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.ts.clientapi.doc/topics/clientapi_resultsummary_element.html + */ resultsummary: ICMCIResponseResultSummary; /** - * See the following link for more information: - * https://www.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.ts.clientapi.doc/topics/clientapi_records_element.html - */ + * See the following link for more information: + * https://www.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.ts.clientapi.doc/topics/clientapi_records_element.html + */ records: any; }; } diff --git a/packages/sdk/src/doc/ICSDGroupParms.ts b/packages/sdk/src/doc/ICSDGroupParms.ts index 73534a4b..c5691dff 100644 --- a/packages/sdk/src/doc/ICSDGroupParms.ts +++ b/packages/sdk/src/doc/ICSDGroupParms.ts @@ -13,8 +13,8 @@ import { IBaseParms } from "./IBaseParms"; export interface ICSDGroupParms extends IBaseParms { /** - * CSD list name for the CSD Group - * Up to eight characters long - */ + * CSD list name for the CSD Group + * Up to eight characters long + */ csdList: string; } diff --git a/packages/sdk/src/doc/IProgramParms.ts b/packages/sdk/src/doc/IProgramParms.ts index 90dc1334..693c767c 100644 --- a/packages/sdk/src/doc/IProgramParms.ts +++ b/packages/sdk/src/doc/IProgramParms.ts @@ -13,8 +13,8 @@ import { IBaseParms } from "./IBaseParms"; export interface IProgramParms extends IBaseParms { /** - * CSD group for the program - * Up to eight characters long - */ + * CSD group for the program + * Up to eight characters long + */ csdGroup?: string; } diff --git a/packages/sdk/src/doc/IResourceParms.ts b/packages/sdk/src/doc/IResourceParms.ts index 6b9ad6c1..959a80c5 100644 --- a/packages/sdk/src/doc/IResourceParms.ts +++ b/packages/sdk/src/doc/IResourceParms.ts @@ -13,21 +13,21 @@ import { IBaseParms } from "./IBaseParms"; export interface IResourceParms extends IBaseParms { /** - * Criteria by which to filter the records - * - * Examples: - * "TRANID=TRAN" - * "PROGRAM=PRG*" - * "NAME=C* AND PROGRAM=D*" - */ + * Criteria by which to filter the records + * + * Examples: + * "TRANID=TRAN" + * "PROGRAM=PRG*" + * "NAME=C* AND PROGRAM=D*" + */ criteria?: string; /** - * Parameter by which to refine the records - * - * Example: - * "CSDGROUP(GRP1)" - * "CSDGROUP(D*)" - */ + * Parameter by which to refine the records + * + * Example: + * "CSDGROUP(GRP1)" + * "CSDGROUP(D*)" + */ parameter?: string; } diff --git a/packages/sdk/src/doc/ITransactionParms.ts b/packages/sdk/src/doc/ITransactionParms.ts index fbe204ab..2d58ffed 100644 --- a/packages/sdk/src/doc/ITransactionParms.ts +++ b/packages/sdk/src/doc/ITransactionParms.ts @@ -13,14 +13,14 @@ import { IBaseParms } from "./IBaseParms"; export interface ITransactionParms extends IBaseParms { /** - * The name of the program to associate to the transaction - * Up to eight characters long - */ + * The name of the program to associate to the transaction + * Up to eight characters long + */ programName?: string; /** - * CSD group for the transaction - * Up to eight characters long - */ + * CSD group for the transaction + * Up to eight characters long + */ csdGroup?: string; } diff --git a/packages/sdk/src/doc/IURIMapParms.ts b/packages/sdk/src/doc/IURIMapParms.ts index 697fa5ea..b45a6148 100644 --- a/packages/sdk/src/doc/IURIMapParms.ts +++ b/packages/sdk/src/doc/IURIMapParms.ts @@ -13,79 +13,79 @@ import { IBaseParms } from "./IBaseParms"; export interface IURIMapParms extends IBaseParms { /** - * CSD group for the URIMap - * Up to eight characters long - */ + * CSD group for the URIMap + * Up to eight characters long + */ csdGroup?: string; /** - * Path component of URI to which the map applies - * Up to 255 characters long - */ + * Path component of URI to which the map applies + * Up to 255 characters long + */ path?: string; /** - * Host component of URI to which the map applies - * Up to 116 characters long - */ + * Host component of URI to which the map applies + * Up to 116 characters long + */ host?: string; /** - * Scheme component of URI to which the map applies - * Allowed values: http, https - */ + * Scheme component of URI to which the map applies + * Allowed values: http, https + */ scheme?: string; /** - * Application program that will process the request - * Only used for server URIMaps; up to 8 characters long - */ + * Application program that will process the request + * Only used for server URIMaps; up to 8 characters long + */ programName?: string; /** - * Pipeline that will process the request - * Only used for pipeline URIMaps; up to 8 characters long - */ + * Pipeline that will process the request + * Only used for pipeline URIMaps; up to 8 characters long + */ pipelineName?: string; /** - * Certificate that will be used to negotiate an SSL handshake - * Only used for client URIMaps - */ + * Certificate that will be used to negotiate an SSL handshake + * Only used for client URIMaps + */ certificate?: string; /** - * Authentication and identification scheme to be used for URIMAPs - * Only used for client URIMaps - * Allowed values: NO, BASIC - */ + * Authentication and identification scheme to be used for URIMAPs + * Only used for client URIMaps + * Allowed values: NO, BASIC + */ authenticate?: string; /** - * Description text for the URIMap - */ + * Description text for the URIMap + */ description?: string; /** - * Transaction resource associated with the URIMap - * Only used for pipeline URIMaps, up to 4 characters long - */ + * Transaction resource associated with the URIMap + * Only used for pipeline URIMaps, up to 4 characters long + */ transactionName?: string; /** - * Web service resource associated with the URIMap - * Only used for pipeline URIMaps, up to 32 characters long - */ + * Web service resource associated with the URIMap + * Only used for pipeline URIMaps, up to 32 characters long + */ webserviceName?: string; /** - * Enable attribute of the URIMap - */ + * Enable attribute of the URIMap + */ enable?: boolean; /** - * The TCPIPSERVICE to which a URIMAP applies - * Only used for server and pipeline URIMAPs; up to 8 characters long - */ + * The TCPIPSERVICE to which a URIMAP applies + * Only used for server and pipeline URIMAPs; up to 8 characters long + */ tcpipservice?: string; } diff --git a/packages/sdk/src/doc/IWebServiceParms.ts b/packages/sdk/src/doc/IWebServiceParms.ts index 546047ef..0970beba 100644 --- a/packages/sdk/src/doc/IWebServiceParms.ts +++ b/packages/sdk/src/doc/IWebServiceParms.ts @@ -13,38 +13,38 @@ import { IBaseParms } from "./IBaseParms"; export interface IWebServiceParms extends IBaseParms { /** - * CSD group for the web service - * Up to eight characters long - */ + * CSD group for the web service + * Up to eight characters long + */ csdGroup: string; /** - * Pipeline name for the web service - * Up to eight characters long - */ + * Pipeline name for the web service + * Up to eight characters long + */ pipelineName?: string; /** - * Web service binding file on HFS - * Should be a fully qualified file name - */ + * Web service binding file on HFS + * Should be a fully qualified file name + */ wsBind?: string; /** - * Description text for the web service - */ + * Description text for the web service + */ description?: string; /** - * Specifies whether full validation of SOAP messages against the - * corresponding schema in the web service description should be performed - * at run time - */ + * Specifies whether full validation of SOAP messages against the + * corresponding schema in the web service description should be performed + * at run time + */ validation?: boolean; /** - * Web service description file on HFS - * Should be a fully qualified file name - */ + * Web service description file on HFS + * Should be a fully qualified file name + */ wsdlFile?: string; } diff --git a/packages/sdk/src/methods/add-to-list/AddToList.ts b/packages/sdk/src/methods/add-to-list/AddToList.ts index 45b1fb8e..9a97ec4e 100644 --- a/packages/sdk/src/methods/add-to-list/AddToList.ts +++ b/packages/sdk/src/methods/add-to-list/AddToList.ts @@ -32,9 +32,17 @@ export function addCSDGroupToList(session: AbstractSession, parms: ICSDGroupParm Logger.getAppLogger().debug("Attempting to add a CSD Group to a CSD List with the following parameters:\n%s", JSON.stringify(parms)); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_CSDGROUP + "/" + cicsPlex + parms.regionName + - "?CRITERIA=NAME=='" + parms.name + "'"; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_CSDGROUP + + "/" + + cicsPlex + + parms.regionName + + "?CRITERIA=NAME=='" + + parms.name + + "'"; const requestBody: any = { request: { @@ -45,11 +53,11 @@ export function addCSDGroupToList(session: AbstractSession, parms: ICSDGroupParm parameter: { $: { name: "TO_CSDLIST", - value: parms.csdList - } - } - } - } + value: parms.csdList, + }, + }, + }, + }, }; return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody) as any; } diff --git a/packages/sdk/src/methods/define/Define.ts b/packages/sdk/src/methods/define/Define.ts index cbf7d4d9..11b6b57b 100644 --- a/packages/sdk/src/methods/define/Define.ts +++ b/packages/sdk/src/methods/define/Define.ts @@ -37,21 +37,21 @@ export function defineProgram(session: AbstractSession, parms: IProgramParms): P parameter: { $: { name: "CSD", - } + }, }, attributes: { $: { name: parms.name, - csdgroup: parms.csdGroup - } - } - } - } + csdgroup: parms.csdGroup, + }, + }, + }, + }, }; const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_PROGRAM + "/" + cicsPlex + parms.regionName; + const cmciResource = + "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_PROGRAM + "/" + cicsPlex + parms.regionName; return CicsCmciRestClient.postExpectParsedXml(session, cmciResource, [], requestBody) as any; } @@ -80,25 +80,23 @@ export function defineTransaction(session: AbstractSession, parms: ITransactionP parameter: { $: { name: "CSD", - } + }, }, attributes: { $: { name: parms.name, program: parms.programName, - csdgroup: parms.csdGroup - } - } - } - } + csdgroup: parms.csdGroup, + }, + }, + }, + }, }; const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "/" + cicsPlex + - parms.regionName; - return CicsCmciRestClient.postExpectParsedXml(session, cmciResource, - [], requestBody) as any; + const cmciResource = + "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "/" + cicsPlex + parms.regionName; + return CicsCmciRestClient.postExpectParsedXml(session, cmciResource, [], requestBody) as any; } /** @@ -125,8 +123,8 @@ export function defineUrimapServer(session: AbstractSession, parms: IURIMapParms requestBody.request.create.attributes.$.program = parms.programName; const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + parms.regionName; + const cmciResource = + "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + parms.regionName; return CicsCmciRestClient.postExpectParsedXml(session, cmciResource, [], requestBody) as any; } @@ -151,8 +149,8 @@ export function defineUrimapClient(session: AbstractSession, parms: IURIMapParms const requestBody: any = buildUrimapRequestBody(parms, "client"); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + parms.regionName; + const cmciResource = + "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + parms.regionName; return CicsCmciRestClient.postExpectParsedXml(session, cmciResource, [], requestBody) as any; } @@ -180,8 +178,8 @@ export function defineUrimapPipeline(session: AbstractSession, parms: IURIMapPar requestBody.request.create.attributes.$.pipeline = parms.pipelineName; const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + parms.regionName; + const cmciResource = + "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + parms.regionName; return CicsCmciRestClient.postExpectParsedXml(session, cmciResource, [], requestBody) as any; } @@ -216,7 +214,7 @@ function buildUrimapRequestBody(parms: IURIMapParms, usage: "server" | "client" path: parms.path, host: parms.host, scheme: parms.scheme, - usage + usage, }; if (parms.description != null) { @@ -255,13 +253,13 @@ function buildUrimapRequestBody(parms: IURIMapParms, usage: "server" | "client" parameter: { $: { name: "CSD", - } + }, }, attributes: { - $: requestAttrs - } - } - } + $: requestAttrs, + }, + }, + }, }; } @@ -279,7 +277,7 @@ export function defineWebservice(session: AbstractSession, parms: IWebServicePar csdgroup: parms.csdGroup, pipeline: parms.pipelineName, wsbind: parms.wsBind, - validation: parms.validation ? "yes" : "no" + validation: parms.validation ? "yes" : "no", }; if (parms.description != null) { @@ -296,19 +294,17 @@ export function defineWebservice(session: AbstractSession, parms: IWebServicePar parameter: { $: { name: "CSD", - } + }, }, attributes: { - $: requestAttrs - } - } - } + $: requestAttrs, + }, + }, + }, }; const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_WEBSERVICE + "/" + cicsPlex + - parms.regionName; - return CicsCmciRestClient.postExpectParsedXml(session, cmciResource, - [], requestBody) as any; + const cmciResource = + "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + CicsCmciConstants.CICS_DEFINITION_WEBSERVICE + "/" + cicsPlex + parms.regionName; + return CicsCmciRestClient.postExpectParsedXml(session, cmciResource, [], requestBody) as any; } diff --git a/packages/sdk/src/methods/delete/Delete.ts b/packages/sdk/src/methods/delete/Delete.ts index 07a232fe..ca5fdfc3 100644 --- a/packages/sdk/src/methods/delete/Delete.ts +++ b/packages/sdk/src/methods/delete/Delete.ts @@ -32,9 +32,14 @@ export async function deleteProgram(session: AbstractSession, parms: IProgramPar Logger.getAppLogger().debug("Attempting to delete a program with the following parameters:\n%s", JSON.stringify(parms)); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_PROGRAM + "/" + cicsPlex + - `${parms.regionName}?CRITERIA=(NAME=${parms.name})&PARAMETER=CSDGROUP(${parms.csdGroup})`; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_PROGRAM + + "/" + + cicsPlex + + `${parms.regionName}?CRITERIA=(NAME=${parms.name})&PARAMETER=CSDGROUP(${parms.csdGroup})`; return CicsCmciRestClient.deleteExpectParsedXml(session, cmciResource, []); } @@ -56,9 +61,14 @@ export async function deleteTransaction(session: AbstractSession, parms: ITransa Logger.getAppLogger().debug("Attempting to delete a transaction with the following parameters:\n%s", JSON.stringify(parms)); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "/" + cicsPlex + - `${parms.regionName}?CRITERIA=(NAME=${parms.name})&PARAMETER=CSDGROUP(${parms.csdGroup})`; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_TRANSACTION + + "/" + + cicsPlex + + `${parms.regionName}?CRITERIA=(NAME=${parms.name})&PARAMETER=CSDGROUP(${parms.csdGroup})`; return CicsCmciRestClient.deleteExpectParsedXml(session, cmciResource, []); } @@ -81,9 +91,14 @@ export async function deleteUrimap(session: AbstractSession, parms: IURIMapParms Logger.getAppLogger().debug("Attempting to delete a URIMap with the following parameters:\n%s", JSON.stringify(parms)); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + - `${parms.regionName}?CRITERIA=(NAME=${parms.name})&PARAMETER=CSDGROUP(${parms.csdGroup})`; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_URIMAP + + "/" + + cicsPlex + + `${parms.regionName}?CRITERIA=(NAME=${parms.name})&PARAMETER=CSDGROUP(${parms.csdGroup})`; return CicsCmciRestClient.deleteExpectParsedXml(session, cmciResource, []); } @@ -106,8 +121,13 @@ export async function deleteWebservice(session: AbstractSession, parms: IWebServ Logger.getAppLogger().debug("Attempting to delete a web service with the following parameters:\n%s", JSON.stringify(parms)); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_WEBSERVICE + "/" + cicsPlex + - `${parms.regionName}?CRITERIA=(NAME=${parms.name})&PARAMETER=CSDGROUP(${parms.csdGroup})`; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_WEBSERVICE + + "/" + + cicsPlex + + `${parms.regionName}?CRITERIA=(NAME=${parms.name})&PARAMETER=CSDGROUP(${parms.csdGroup})`; return CicsCmciRestClient.deleteExpectParsedXml(session, cmciResource, []); } diff --git a/packages/sdk/src/methods/disable/Disable.ts b/packages/sdk/src/methods/disable/Disable.ts index d1f9c22a..3790e122 100644 --- a/packages/sdk/src/methods/disable/Disable.ts +++ b/packages/sdk/src/methods/disable/Disable.ts @@ -33,19 +33,24 @@ export async function disableUrimap(session: AbstractSession, parms: IURIMapParm Logger.getAppLogger().debug("Attempting to disable a URIMap with the following parameters:\n%s", JSON.stringify(parms)); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_URIMAP + "/" + cicsPlex + - `${parms.regionName}?CRITERIA=(NAME=${parms.name})`; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_URIMAP + + "/" + + cicsPlex + + `${parms.regionName}?CRITERIA=(NAME=${parms.name})`; const requestBody: any = { request: { update: { attributes: { $: { - ENABLESTATUS: "DISABLED" - } - } - } - } + ENABLESTATUS: "DISABLED", + }, + }, + }, + }, }; return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); } diff --git a/packages/sdk/src/methods/discard/Discard.ts b/packages/sdk/src/methods/discard/Discard.ts index fc962ad3..c9633ced 100644 --- a/packages/sdk/src/methods/discard/Discard.ts +++ b/packages/sdk/src/methods/discard/Discard.ts @@ -31,9 +31,17 @@ export async function discardProgram(session: AbstractSession, parms: IProgramPa Logger.getAppLogger().debug("Attempting to discard a program with the following parameters:\n%s", JSON.stringify(parms)); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_PROGRAM_RESOURCE + "/" + cicsPlex + parms.regionName + - "?CRITERIA=(PROGRAM=" + parms.name + ")"; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_PROGRAM_RESOURCE + + "/" + + cicsPlex + + parms.regionName + + "?CRITERIA=(PROGRAM=" + + parms.name + + ")"; return CicsCmciRestClient.deleteExpectParsedXml(session, cmciResource, []); } @@ -54,9 +62,17 @@ export async function discardTransaction(session: AbstractSession, parms: ITrans Logger.getAppLogger().debug("Attempting to discard a transaction with the following parameters:\n%s", JSON.stringify(parms)); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_LOCAL_TRANSACTION + "/" + cicsPlex + parms.regionName + - "?CRITERIA=(TRANID=" + parms.name + ")"; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_LOCAL_TRANSACTION + + "/" + + cicsPlex + + parms.regionName + + "?CRITERIA=(TRANID=" + + parms.name + + ")"; return CicsCmciRestClient.deleteExpectParsedXml(session, cmciResource, []); } @@ -67,8 +83,13 @@ export async function discardUrimap(session: AbstractSession, parms: IURIMapParm Logger.getAppLogger().debug("Attempting to discard a URIMap with the following parameters:\n%s", JSON.stringify(parms)); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_URIMAP + "/" + cicsPlex + - `${parms.regionName}?CRITERIA=(NAME='${parms.name}')`; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_URIMAP + + "/" + + cicsPlex + + `${parms.regionName}?CRITERIA=(NAME='${parms.name}')`; return CicsCmciRestClient.deleteExpectParsedXml(session, cmciResource, []); } diff --git a/packages/sdk/src/methods/enable/Enable.ts b/packages/sdk/src/methods/enable/Enable.ts index 2845e067..6cbd459a 100644 --- a/packages/sdk/src/methods/enable/Enable.ts +++ b/packages/sdk/src/methods/enable/Enable.ts @@ -31,19 +31,24 @@ export async function enableUrimap(session: AbstractSession, parms: IURIMapParms Logger.getAppLogger().debug("Attempting to enable a URIMap with the following parameters:\n%s", JSON.stringify(parms)); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_URIMAP + "/" + cicsPlex + - `${parms.regionName}?CRITERIA=(NAME=${parms.name})`; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_URIMAP + + "/" + + cicsPlex + + `${parms.regionName}?CRITERIA=(NAME=${parms.name})`; const requestBody: any = { request: { update: { attributes: { $: { - ENABLESTATUS: "ENABLED" - } - } - } - } + ENABLESTATUS: "ENABLED", + }, + }, + }, + }, }; return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); } @@ -86,4 +91,3 @@ export async function enableTransaction(session: AbstractSession, parms: IBasePa return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); } - diff --git a/packages/sdk/src/methods/get/Get.ts b/packages/sdk/src/methods/get/Get.ts index a83fefd1..ddff04b0 100644 --- a/packages/sdk/src/methods/get/Get.ts +++ b/packages/sdk/src/methods/get/Get.ts @@ -33,8 +33,7 @@ export async function getResource(session: AbstractSession, parms: IResourceParm Logger.getAppLogger().debug("Attempting to get resource(s) with the following parameters:\n%s", JSON.stringify(parms)); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - let cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - parms.name + "/" + cicsPlex + parms.regionName; + let cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + parms.name + "/" + cicsPlex + parms.regionName; if (parms.criteria != null) { cmciResource = cmciResource + delimiter + "CRITERIA=(" + encodeURIComponent(parms.criteria) + ")"; diff --git a/packages/sdk/src/methods/install/Install.ts b/packages/sdk/src/methods/install/Install.ts index 5a0fc6a9..98d7cb37 100644 --- a/packages/sdk/src/methods/install/Install.ts +++ b/packages/sdk/src/methods/install/Install.ts @@ -36,15 +36,25 @@ export function installProgram(session: AbstractSession, parms: IProgramParms): action: { $: { name: "CSDINSTALL", - } - } - } + }, + }, + }, }; const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_PROGRAM + "/" + cicsPlex + parms.regionName + - "?CRITERIA=(NAME=" + parms.name + ")&PARAMETER=CSDGROUP(" + parms.csdGroup + ")"; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_PROGRAM + + "/" + + cicsPlex + + parms.regionName + + "?CRITERIA=(NAME=" + + parms.name + + ")&PARAMETER=CSDGROUP(" + + parms.csdGroup + + ")"; return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody) as any; } @@ -70,17 +80,26 @@ export function installTransaction(session: AbstractSession, parms: IProgramParm action: { $: { name: "CSDINSTALL", - } - } - } + }, + }, + }, }; const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "/" + cicsPlex + parms.regionName + - "?CRITERIA=(NAME=" + parms.name + ")&PARAMETER=CSDGROUP(" + parms.csdGroup + ")"; - return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, - [], requestBody) as any; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_TRANSACTION + + "/" + + cicsPlex + + parms.regionName + + "?CRITERIA=(NAME=" + + parms.name + + ")&PARAMETER=CSDGROUP(" + + parms.csdGroup + + ")"; + return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody) as any; } /** @@ -103,17 +122,22 @@ export function installUrimap(session: AbstractSession, parms: IURIMapParms): Pr Logger.getAppLogger().debug("Attempting to install a URIMap with the following parameters:\n%s", JSON.stringify(parms)); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_DEFINITION_URIMAP + "/" + cicsPlex + - `${parms.regionName}?CRITERIA=(NAME=${parms.name})&PARAMETER=CSDGROUP(${parms.csdGroup})`; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_DEFINITION_URIMAP + + "/" + + cicsPlex + + `${parms.regionName}?CRITERIA=(NAME=${parms.name})&PARAMETER=CSDGROUP(${parms.csdGroup})`; const requestBody: any = { request: { action: { $: { name: "CSDINSTALL", - } - } - } + }, + }, + }, }; return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); } diff --git a/packages/sdk/src/methods/remove-from-list/RemoveFromList.ts b/packages/sdk/src/methods/remove-from-list/RemoveFromList.ts index 149f47f1..4a730deb 100644 --- a/packages/sdk/src/methods/remove-from-list/RemoveFromList.ts +++ b/packages/sdk/src/methods/remove-from-list/RemoveFromList.ts @@ -32,8 +32,18 @@ export function removeCSDGroupFromList(session: AbstractSession, parms: ICSDGrou Logger.getAppLogger().debug("Attempting to remove a CSD Group from a CSD List with the following parameters:\n%s", JSON.stringify(parms)); const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_CSDGROUP_IN_LIST + "/" + cicsPlex + parms.regionName + - "?CRITERIA=(CSDLIST=='" + parms.csdList + "')%20AND%20(CSDGROUP=='" + parms.name + "')"; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_CSDGROUP_IN_LIST + + "/" + + cicsPlex + + parms.regionName + + "?CRITERIA=(CSDLIST=='" + + parms.csdList + + "')%20AND%20(CSDGROUP=='" + + parms.name + + "')"; return CicsCmciRestClient.deleteExpectParsedXml(session, cmciResource, []) as any; } diff --git a/packages/sdk/src/methods/set/Set.ts b/packages/sdk/src/methods/set/Set.ts index d5cb0258..591bdf52 100644 --- a/packages/sdk/src/methods/set/Set.ts +++ b/packages/sdk/src/methods/set/Set.ts @@ -34,14 +34,22 @@ export function programNewcopy(session: AbstractSession, parms: IProgramParms): action: { $: { name: "NEWCOPY", - } - } - } + }, + }, + }, }; const cicsPlex = parms.cicsPlex == null ? "" : parms.cicsPlex + "/"; - const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + - CicsCmciConstants.CICS_PROGRAM_RESOURCE + "/" + cicsPlex + parms.regionName + - "?CRITERIA=(PROGRAM=" + parms.name + ")"; + const cmciResource = + "/" + + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + + "/" + + CicsCmciConstants.CICS_PROGRAM_RESOURCE + + "/" + + cicsPlex + + parms.regionName + + "?CRITERIA=(PROGRAM=" + + parms.name + + ")"; return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody) as any; } diff --git a/packages/sdk/src/rest/CicsCmciRestClient.ts b/packages/sdk/src/rest/CicsCmciRestClient.ts index ceca84a0..30e446d1 100644 --- a/packages/sdk/src/rest/CicsCmciRestClient.ts +++ b/packages/sdk/src/rest/CicsCmciRestClient.ts @@ -23,9 +23,9 @@ import { CicsCmciMessages } from "../constants/CicsCmci.messages"; */ export class CicsCmciRestClient extends RestClient { /** - * If the API request is successful, this value should be in - * api_response2 in the resultsummary object in the response - */ + * If the API request is successful, this value should be in + * api_response2 in the resultsummary object in the response + */ public static readonly CMCI_SUCCESS_RESPONSE_1 = "1024"; /** @@ -40,8 +40,7 @@ export class CicsCmciRestClient extends RestClient { * @returns {string} the string of XML generated by xml2js */ public static convertObjectToXML(obj: any): string { - this.log.trace("Converting the following object to XML via xml2js:\n%s", - JSON.stringify(obj, null, 2)); + this.log.trace("Converting the following object to XML via xml2js:\n%s", JSON.stringify(obj, null, 2)); const builder = new Builder({ headless: true }); return builder.buildObject(obj); } @@ -55,8 +54,7 @@ export class CicsCmciRestClient extends RestClient { * @returns {Promise<*>} - response body content from http(s) call * @throws {ImperativeError} verifyResponseCodes fails */ - public static async getExpectParsedXml(session: AbstractSession, - resource: string, reqHeaders: any[] = []): Promise { + public static async getExpectParsedXml(session: AbstractSession, resource: string, reqHeaders: any[] = []): Promise { const data = await CicsCmciRestClient.getExpectString(session, resource, reqHeaders); const apiResponse = CicsCmciRestClient.parseStringSync(data); return CicsCmciRestClient.verifyResponseCodes(apiResponse); @@ -71,8 +69,7 @@ export class CicsCmciRestClient extends RestClient { * @returns {Promise<*>} - response body content from http(s) call * @throws {ImperativeError} verifyResponseCodes fails */ - public static async deleteExpectParsedXml(session: AbstractSession, - resource: string, reqHeaders: any[] = []): Promise { + public static async deleteExpectParsedXml(session: AbstractSession, resource: string, reqHeaders: any[] = []): Promise { const data = await CicsCmciRestClient.deleteExpectString(session, resource, reqHeaders); const apiResponse = CicsCmciRestClient.parseStringSync(data); return CicsCmciRestClient.verifyResponseCodes(apiResponse); @@ -89,9 +86,12 @@ export class CicsCmciRestClient extends RestClient { * @returns {Promise<*>} - response body content from http(s) call * @throws {ImperativeError} verifyResponseCodes fails */ - public static async putExpectParsedXml(session: AbstractSession, - resource: string, reqHeaders: any[] = [], - payload: any): Promise { + public static async putExpectParsedXml( + session: AbstractSession, + resource: string, + reqHeaders: any[] = [], + payload: any + ): Promise { if (payload != null) { payload = CicsCmciRestClient.convertPayloadToXML(payload); } @@ -111,9 +111,12 @@ export class CicsCmciRestClient extends RestClient { * @returns {Promise<*>} - response body content from http(s) call * @throws {ImperativeError} verifyResponseCodes fails */ - public static async postExpectParsedXml(session: AbstractSession, - resource: string, reqHeaders: any[] = [], - payload: any): Promise { + public static async postExpectParsedXml( + session: AbstractSession, + resource: string, + reqHeaders: any[] = [], + payload: any + ): Promise { if (payload != null) { payload = CicsCmciRestClient.convertPayloadToXML(payload); } @@ -166,9 +169,9 @@ export class CicsCmciRestClient extends RestClient { private static get parser(): Parser { if (this.mParser == null) { this.mParser = new Parser({ - explicitArray: false, // Only create arrays if there are multiple tags with the same name - mergeAttrs: true, // Do not use the attrKey, instead merge all attributes with the parent - normalizeTags: true // Guarantee that all tags are going to be lowercase + explicitArray: false, // Only create arrays if there are multiple tags with the same name + mergeAttrs: true, // Do not use the attrKey, instead merge all attributes with the parent + normalizeTags: true, // Guarantee that all tags are going to be lowercase }); } return this.mParser; @@ -181,9 +184,12 @@ export class CicsCmciRestClient extends RestClient { * @throws {ImperativeError} request did not get the expected codes */ private static verifyResponseCodes(apiResponse: ICMCIApiResponse): ICMCIApiResponse { - if (apiResponse.response != null && apiResponse.response.resultsummary != null - && apiResponse.response.resultsummary.api_response1 === CicsCmciRestClient.CMCI_SUCCESS_RESPONSE_1 - && apiResponse.response.resultsummary.api_response2 === CicsCmciRestClient.CMCI_SUCCESS_RESPONSE_2) { + if ( + apiResponse.response != null && + apiResponse.response.resultsummary != null && + apiResponse.response.resultsummary.api_response1 === CicsCmciRestClient.CMCI_SUCCESS_RESPONSE_1 && + apiResponse.response.resultsummary.api_response2 === CicsCmciRestClient.CMCI_SUCCESS_RESPONSE_2 + ) { // expected return code and reason code specify return apiResponse; } else { @@ -218,7 +224,7 @@ export class CicsCmciRestClient extends RestClient { * Process an error encountered in the rest client * @param {IImperativeError} original - the original error automatically built by the abstract rest client * @returns {IImperativeError} - the processed error with details added - */ + */ protected processError(original: IImperativeError): IImperativeError { original.msg = "CICS CMCI REST API Error:\n" + original.msg; let details = original.causeErrors; diff --git a/packages/vsce/package.json b/packages/vsce/package.json index 90fc138f..e1a8af9d 100644 --- a/packages/vsce/package.json +++ b/packages/vsce/package.json @@ -875,6 +875,7 @@ "build": "tsup && npm run checkTestsCompile && npm run madge", "checkTestsCompile": "echo \"Checking that test source compiles...\" && tsc --project __tests__/test-tsconfig.json --noEmit ", "madge": "echo 'Nothing to check'", + "pretty": "prettier --write 'src/**/*.ts' '__tests__/**/*.ts'", "lint": "eslint src --ext ts", "prebuild": "npm run clean && echo Using TypeScript && tsc --version && echo Using TSUP && tsup --version", "clean": "rimraf lib && rimraf dist", diff --git a/packages/vsce/src/commands/disableCommands/disableProgramCommand.ts b/packages/vsce/src/commands/disableCommands/disableProgramCommand.ts index 2d606838..6f961e9a 100644 --- a/packages/vsce/src/commands/disableCommands/disableProgramCommand.ts +++ b/packages/vsce/src/commands/disableCommands/disableProgramCommand.ts @@ -105,7 +105,10 @@ export function getDisableProgramCommand(tree: CICSTree, treeview: TreeView }); } -function disableProgram(session: imperative.AbstractSession, parms: { name: string; regionName: string; cicsPlex: string }): Promise { +function disableProgram( + session: imperative.AbstractSession, + parms: { name: string; regionName: string; cicsPlex: string } +): Promise { const requestBody: any = { request: { action: { diff --git a/packages/vsce/src/commands/enableCommands/enableLocalFileCommand.ts b/packages/vsce/src/commands/enableCommands/enableLocalFileCommand.ts index aa718227..d614ca77 100644 --- a/packages/vsce/src/commands/enableCommands/enableLocalFileCommand.ts +++ b/packages/vsce/src/commands/enableCommands/enableLocalFileCommand.ts @@ -99,7 +99,10 @@ export function getEnableLocalFileCommand(tree: CICSTree, treeview: TreeView { +async function enableLocalFile( + session: imperative.AbstractSession, + parms: { name: string; regionName: string; cicsPlex: string } +): Promise { const requestBody: any = { request: { action: { diff --git a/packages/vsce/src/commands/enableCommands/enableProgramCommand.ts b/packages/vsce/src/commands/enableCommands/enableProgramCommand.ts index 9882bd86..26940508 100644 --- a/packages/vsce/src/commands/enableCommands/enableProgramCommand.ts +++ b/packages/vsce/src/commands/enableCommands/enableProgramCommand.ts @@ -104,7 +104,10 @@ export function getEnableProgramCommand(tree: CICSTree, treeview: TreeView) }); } -async function enableProgram(session: imperative.AbstractSession, parms: { name: string; regionName: string; cicsPlex: string }): Promise { +async function enableProgram( + session: imperative.AbstractSession, + parms: { name: string; regionName: string; cicsPlex: string } +): Promise { const requestBody: any = { request: { action: { diff --git a/packages/vsce/src/commands/enableCommands/enableTransactionCommand.ts b/packages/vsce/src/commands/enableCommands/enableTransactionCommand.ts index 0bd64770..5bcfc6b9 100644 --- a/packages/vsce/src/commands/enableCommands/enableTransactionCommand.ts +++ b/packages/vsce/src/commands/enableCommands/enableTransactionCommand.ts @@ -96,4 +96,4 @@ export function getEnableTransactionCommand(tree: CICSTree, treeview: TreeView) }); } -async function openLocalFile(session: imperative.AbstractSession, parms: { name: string; regionName: string; cicsPlex: string }): Promise { +async function openLocalFile( + session: imperative.AbstractSession, + parms: { name: string; regionName: string; cicsPlex: string } +): Promise { const requestBody: any = { request: { action: { diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLibraryTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLibraryTree.ts index 41584cf3..9203c7c3 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLibraryTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLibraryTree.ts @@ -29,7 +29,10 @@ export class CICSCombinedLibraryTree extends TreeItem { incrementCount: number; constant: string; - constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentPlex: CICSPlexTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("All Libraries", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicscombinedlibrarytree.`; this.parentPlex = parentPlex; diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLocalFileTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLocalFileTree.ts index cba867aa..354efdcd 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLocalFileTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLocalFileTree.ts @@ -29,7 +29,10 @@ export class CICSCombinedLocalFileTree extends TreeItem { incrementCount: number; constant: string; - constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentPlex: CICSPlexTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("All Local Files", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicscombinedlocalfiletree.`; this.parentPlex = parentPlex; diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedPipelineTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedPipelineTree.ts index 57467d59..2fb8e3df 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedPipelineTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedPipelineTree.ts @@ -29,7 +29,10 @@ export class CICSCombinedPipelineTree extends TreeItem { incrementCount: number; constant: string; - constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentPlex: CICSPlexTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("All Pipelines", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicscombinedpipelinetree.`; this.parentPlex = parentPlex; diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedProgramTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedProgramTree.ts index d745dd22..b4b81446 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedProgramTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedProgramTree.ts @@ -30,7 +30,10 @@ export class CICSCombinedProgramTree extends TreeItem { incrementCount: number; constant: string; - constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentPlex: CICSPlexTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("All Programs", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicscombinedprogramtree.`; this.parentPlex = parentPlex; diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTCPIPServiceTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTCPIPServiceTree.ts index 4f47f388..dc87c1b3 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTCPIPServiceTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTCPIPServiceTree.ts @@ -29,7 +29,10 @@ export class CICSCombinedTCPIPServiceTree extends TreeItem { incrementCount: number; constant: string; - constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentPlex: CICSPlexTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("All TCPIP Services", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicscombinedtcpipstree.`; this.parentPlex = parentPlex; diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTaskTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTaskTree.ts index b0363025..ab1d5f13 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTaskTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTaskTree.ts @@ -29,7 +29,10 @@ export class CICSCombinedTaskTree extends TreeItem { incrementCount: number; constant: string; - constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentPlex: CICSPlexTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("All Tasks", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicscombinedtasktree.`; this.parentPlex = parentPlex; diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTransactionTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTransactionTree.ts index 1fe2f984..f768c85a 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTransactionTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTransactionTree.ts @@ -30,7 +30,10 @@ export class CICSCombinedTransactionsTree extends TreeItem { incrementCount: number; constant: string; - constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentPlex: CICSPlexTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("All Local Transactions", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicscombinedtransactiontree.`; this.parentPlex = parentPlex; diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedURIMapTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedURIMapTree.ts index 24b9d074..2ff0a6f3 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedURIMapTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedURIMapTree.ts @@ -29,7 +29,10 @@ export class CICSCombinedURIMapTree extends TreeItem { incrementCount: number; constant: string; - constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentPlex: CICSPlexTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("All URI Maps", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicscombinedurimapstree.`; this.parentPlex = parentPlex; diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedWebServiceTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedWebServiceTree.ts index 0fe42c00..c26a1d79 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedWebServiceTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedWebServiceTree.ts @@ -29,7 +29,10 @@ export class CICSCombinedWebServiceTree extends TreeItem { incrementCount: number; constant: string; - constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentPlex: CICSPlexTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("All Web Services", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicscombinedwebservicetree.`; this.parentPlex = parentPlex; diff --git a/packages/vsce/src/trees/CICSLibraryTree.ts b/packages/vsce/src/trees/CICSLibraryTree.ts index fb5e953d..0fda576e 100644 --- a/packages/vsce/src/trees/CICSLibraryTree.ts +++ b/packages/vsce/src/trees/CICSLibraryTree.ts @@ -22,7 +22,10 @@ export class CICSLibraryTree extends TreeItem { parentRegion: CICSRegionTree; activeFilter: string | undefined = undefined; - constructor(parentRegion: CICSRegionTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentRegion: CICSRegionTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("Libraries", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicstreelibrary.${this.activeFilter ? "filtered" : "unfiltered"}.libraries`; this.parentRegion = parentRegion; @@ -51,8 +54,9 @@ export class CICSLibraryTree extends TreeItem { criteria: criteria, }); https.globalAgent.options.rejectUnauthorized = undefined; - const librariesArray = Array.isArray(libraryResponse.response.records.cicslibrary) - ? libraryResponse.response.records.cicslibrary + const librariesArray = + Array.isArray(libraryResponse.response.records.cicslibrary) ? + libraryResponse.response.records.cicslibrary : [libraryResponse.response.records.cicslibrary]; this.label = `Libraries${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${librariesArray.length}]`; for (const library of librariesArray) { diff --git a/packages/vsce/src/trees/CICSLocalFileTree.ts b/packages/vsce/src/trees/CICSLocalFileTree.ts index fcf8524a..7f537da2 100644 --- a/packages/vsce/src/trees/CICSLocalFileTree.ts +++ b/packages/vsce/src/trees/CICSLocalFileTree.ts @@ -22,7 +22,10 @@ export class CICSLocalFileTree extends TreeItem { parentRegion: CICSRegionTree; activeFilter: string | undefined = undefined; - constructor(parentRegion: CICSRegionTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentRegion: CICSRegionTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("Local Files", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicstreelocalfile.${this.activeFilter ? "filtered" : "unfiltered"}.localFiles`; this.parentRegion = parentRegion; @@ -55,8 +58,9 @@ export class CICSLocalFileTree extends TreeItem { criteria: criteria, }); https.globalAgent.options.rejectUnauthorized = undefined; - const localFileArray = Array.isArray(localFileResponse.response.records.cicslocalfile) - ? localFileResponse.response.records.cicslocalfile + const localFileArray = + Array.isArray(localFileResponse.response.records.cicslocalfile) ? + localFileResponse.response.records.cicslocalfile : [localFileResponse.response.records.cicslocalfile]; this.label = `Local Files${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${localFileArray.length}]`; for (const localFile of localFileArray) { diff --git a/packages/vsce/src/trees/CICSPlexTree.ts b/packages/vsce/src/trees/CICSPlexTree.ts index c725884a..74d252b3 100644 --- a/packages/vsce/src/trees/CICSPlexTree.ts +++ b/packages/vsce/src/trees/CICSPlexTree.ts @@ -57,8 +57,9 @@ export class CICSPlexTree extends TreeItem { this.resourceFilters = {}; this.activeFilter = undefined; this.groupName = group; - this.iconPath = group - ? getIconPathInResources("cics-system-group-dark.svg ", "cics-system-group-light.svg ") + this.iconPath = + group ? + getIconPathInResources("cics-system-group-dark.svg ", "cics-system-group-light.svg ") : getIconPathInResources("cics-plex-dark.svg", "cics-plex-light.svg"); } diff --git a/packages/vsce/src/trees/CICSProgramTree.ts b/packages/vsce/src/trees/CICSProgramTree.ts index 495f6815..28d59306 100644 --- a/packages/vsce/src/trees/CICSProgramTree.ts +++ b/packages/vsce/src/trees/CICSProgramTree.ts @@ -21,7 +21,10 @@ export class CICSProgramTree extends TreeItem { parentRegion: CICSRegionTree; activeFilter: string | undefined = undefined; - constructor(parentRegion: CICSRegionTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentRegion: CICSRegionTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("Programs", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicstreeprogram.${this.activeFilter ? "filtered" : "unfiltered"}.programs`; this.parentRegion = parentRegion; @@ -50,8 +53,9 @@ export class CICSProgramTree extends TreeItem { criteria: criteria, }); https.globalAgent.options.rejectUnauthorized = undefined; - const programsArray = Array.isArray(programResponse.response.records.cicsprogram) - ? programResponse.response.records.cicsprogram + const programsArray = + Array.isArray(programResponse.response.records.cicsprogram) ? + programResponse.response.records.cicsprogram : [programResponse.response.records.cicsprogram]; this.label = `Programs${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${programsArray.length}]`; for (const program of programsArray) { diff --git a/packages/vsce/src/trees/CICSRegionsContainer.ts b/packages/vsce/src/trees/CICSRegionsContainer.ts index d905494c..b7105ef7 100644 --- a/packages/vsce/src/trees/CICSRegionsContainer.ts +++ b/packages/vsce/src/trees/CICSRegionsContainer.ts @@ -24,7 +24,10 @@ export class CICSRegionsContainer extends TreeItem { resourceFilters: any; activeFilter: string; - constructor(parent: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parent: CICSPlexTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("Regions", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicsregionscontainer.`; this.parent = parent; @@ -70,8 +73,9 @@ export class CICSRegionsContainer extends TreeItem { }); https.globalAgent.options.rejectUnauthorized = undefined; this.clearChildren(); - const regionsArray = Array.isArray(regionsObtained.response.records.cicsmanagedregion) - ? regionsObtained.response.records.cicsmanagedregion + const regionsArray = + Array.isArray(regionsObtained.response.records.cicsmanagedregion) ? + regionsObtained.response.records.cicsmanagedregion : [regionsObtained.response.records.cicsmanagedregion]; this.addRegionsUtility(regionsArray); // Keep container open after label change diff --git a/packages/vsce/src/trees/CICSSessionTree.ts b/packages/vsce/src/trees/CICSSessionTree.ts index ac6369c0..69318d15 100644 --- a/packages/vsce/src/trees/CICSSessionTree.ts +++ b/packages/vsce/src/trees/CICSSessionTree.ts @@ -21,7 +21,10 @@ export class CICSSessionTree extends TreeItem { profile: any; isUnauthorized: boolean | undefined; - constructor(profile: any, public readonly iconPath = getIconPathInResources("profile-unverified-dark.svg", "profile-unverified-light.svg")) { + constructor( + profile: any, + public readonly iconPath = getIconPathInResources("profile-unverified-dark.svg", "profile-unverified-light.svg") + ) { super(profile.name, TreeItemCollapsibleState.Collapsed); this.children = []; this.contextValue = `cicssession.${profile.name}`; diff --git a/packages/vsce/src/trees/CICSTaskTree.ts b/packages/vsce/src/trees/CICSTaskTree.ts index 1477ff26..981a19a4 100644 --- a/packages/vsce/src/trees/CICSTaskTree.ts +++ b/packages/vsce/src/trees/CICSTaskTree.ts @@ -22,7 +22,10 @@ export class CICSTaskTree extends TreeItem { parentRegion: CICSRegionTree; activeTransactionFilter: string | undefined = undefined; - constructor(parentRegion: CICSRegionTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentRegion: CICSRegionTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("Tasks", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicstreetask.${this.activeTransactionFilter ? "filtered" : "unfiltered"}.tasks`; this.parentRegion = parentRegion; @@ -56,9 +59,8 @@ export class CICSTaskTree extends TreeItem { }); https.globalAgent.options.rejectUnauthorized = undefined; - const tasksArray = Array.isArray(taskResponse.response.records.cicstask) - ? taskResponse.response.records.cicstask - : [taskResponse.response.records.cicstask]; + const tasksArray = + Array.isArray(taskResponse.response.records.cicstask) ? taskResponse.response.records.cicstask : [taskResponse.response.records.cicstask]; this.label = `Tasks${this.activeTransactionFilter ? ` (${this.activeTransactionFilter}) ` : " "}[${tasksArray.length}]`; for (const task of tasksArray) { const newTaskItem = new CICSTaskTreeItem(task, this.parentRegion, this); diff --git a/packages/vsce/src/trees/CICSTransactionTree.ts b/packages/vsce/src/trees/CICSTransactionTree.ts index 352a59d6..ff57c006 100644 --- a/packages/vsce/src/trees/CICSTransactionTree.ts +++ b/packages/vsce/src/trees/CICSTransactionTree.ts @@ -22,7 +22,10 @@ export class CICSTransactionTree extends TreeItem { parentRegion: CICSRegionTree; activeFilter: string | undefined = undefined; - constructor(parentRegion: CICSRegionTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentRegion: CICSRegionTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("Transactions", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicstreetransaction.${this.activeFilter ? "filtered" : "unfiltered"}.transactions`; this.parentRegion = parentRegion; @@ -51,8 +54,9 @@ export class CICSTransactionTree extends TreeItem { criteria: criteria, }); https.globalAgent.options.rejectUnauthorized = undefined; - const transactionArray = Array.isArray(transactionResponse.response.records.cicslocaltransaction) - ? transactionResponse.response.records.cicslocaltransaction + const transactionArray = + Array.isArray(transactionResponse.response.records.cicslocaltransaction) ? + transactionResponse.response.records.cicslocaltransaction : [transactionResponse.response.records.cicslocaltransaction]; this.label = `Transactions${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${transactionArray.length}]`; for (const transaction of transactionArray) { diff --git a/packages/vsce/src/trees/CICSTree.ts b/packages/vsce/src/trees/CICSTree.ts index e7d7907a..24a52a89 100644 --- a/packages/vsce/src/trees/CICSTree.ts +++ b/packages/vsce/src/trees/CICSTree.ts @@ -10,17 +10,7 @@ */ import { getResource } from "@zowe/cics-for-zowe-sdk"; -import { - Event, - EventEmitter, - ProgressLocation, - ProviderResult, - TreeDataProvider, - TreeItem, - WebviewPanel, - window, - commands -} from "vscode"; +import { Event, EventEmitter, ProgressLocation, ProviderResult, TreeDataProvider, TreeItem, WebviewPanel, window, commands } from "vscode"; import { PersistentStorage } from "../utils/PersistentStorage"; import { InfoLoaded, ProfileManagement } from "../utils/profileManagement"; import { isTheia, openConfigFile } from "../utils/workspaceUtils"; @@ -44,7 +34,7 @@ export class CICSTree implements TreeDataProvider { public async refreshLoadedProfiles() { this.clearLoadedProfiles(); await this.loadStoredProfileNames(); - commands.executeCommand('workbench.actions.treeView.cics-view.collapseAll'); + commands.executeCommand("workbench.actions.treeView.cics-view.collapseAll"); } public clearLoadedProfiles() { this.loadedProfiles = []; diff --git a/packages/vsce/src/trees/CICSWebTree.ts b/packages/vsce/src/trees/CICSWebTree.ts index 657d9981..4769e3b3 100644 --- a/packages/vsce/src/trees/CICSWebTree.ts +++ b/packages/vsce/src/trees/CICSWebTree.ts @@ -22,7 +22,10 @@ export class CICSWebTree extends TreeItem { parentRegion: CICSRegionTree | undefined; //activeFilter: string | undefined = undefined; - constructor(parentRegion: CICSRegionTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentRegion: CICSRegionTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("Web", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicstreeweb.web`; this.parentRegion = parentRegion; diff --git a/packages/vsce/src/trees/treeItems/CICSLibraryDatasets.ts b/packages/vsce/src/trees/treeItems/CICSLibraryDatasets.ts index 09a30e5d..432b0044 100644 --- a/packages/vsce/src/trees/treeItems/CICSLibraryDatasets.ts +++ b/packages/vsce/src/trees/treeItems/CICSLibraryDatasets.ts @@ -67,8 +67,9 @@ export class CICSLibraryDatasets extends TreeItem { }); https.globalAgent.options.rejectUnauthorized = undefined; - const programsArray = Array.isArray(datasetResponse.response.records.cicsprogram) - ? datasetResponse.response.records.cicsprogram + const programsArray = + Array.isArray(datasetResponse.response.records.cicsprogram) ? + datasetResponse.response.records.cicsprogram : [datasetResponse.response.records.cicsprogram]; this.label = `${this.dataset.dsname}${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${programsArray.length}]`; for (const program of programsArray) { diff --git a/packages/vsce/src/trees/treeItems/CICSLibraryTreeItem.ts b/packages/vsce/src/trees/treeItems/CICSLibraryTreeItem.ts index 62b72680..da641a71 100644 --- a/packages/vsce/src/trees/treeItems/CICSLibraryTreeItem.ts +++ b/packages/vsce/src/trees/treeItems/CICSLibraryTreeItem.ts @@ -67,8 +67,9 @@ export class CICSLibraryTreeItem extends TreeItem { criteria: criteria, }); https.globalAgent.options.rejectUnauthorized = undefined; - const datasetArray = Array.isArray(libraryResponse.response.records.cicslibrarydatasetname) - ? libraryResponse.response.records.cicslibrarydatasetname + const datasetArray = + Array.isArray(libraryResponse.response.records.cicslibrarydatasetname) ? + libraryResponse.response.records.cicslibrarydatasetname : [libraryResponse.response.records.cicslibrarydatasetname]; this.label = `${this.library.name}${this.parentRegion.parentPlex ? ` (${this.library.eyu_cicsname})` : ""}${ this.activeFilter ? ` (${this.activeFilter}) ` : " " diff --git a/packages/vsce/src/trees/treeItems/CICSLocalFileTreeItem.ts b/packages/vsce/src/trees/treeItems/CICSLocalFileTreeItem.ts index 1d3925cb..1d33f4c8 100644 --- a/packages/vsce/src/trees/treeItems/CICSLocalFileTreeItem.ts +++ b/packages/vsce/src/trees/treeItems/CICSLocalFileTreeItem.ts @@ -27,17 +27,12 @@ export class CICSLocalFileTreeItem extends TreeItem { ) { super( `${localFile.file} ${ - localFile.enablestatus.toLowerCase() === "disabled" && localFile.openstatus.toLowerCase() === "closed" - ? "(Disabled) (Closed)" - : localFile.enablestatus.toLowerCase() === "disabled" && localFile.openstatus.toLowerCase() !== "closed" - ? "(Disabled)" - : localFile.enablestatus.toLowerCase() === "unenabled" && localFile.openstatus.toLowerCase() === "closed" - ? "(Unenabled) (Closed)" - : localFile.enablestatus.toLowerCase() === "unenabled" && localFile.openstatus.toLowerCase() !== "closed" - ? "(Unenabled)" - : localFile.enablestatus.toLowerCase() === "enabled" && localFile.openstatus.toLowerCase() === "closed" - ? "(Closed)" - : "" + localFile.enablestatus.toLowerCase() === "disabled" && localFile.openstatus.toLowerCase() === "closed" ? "(Disabled) (Closed)" + : localFile.enablestatus.toLowerCase() === "disabled" && localFile.openstatus.toLowerCase() !== "closed" ? "(Disabled)" + : localFile.enablestatus.toLowerCase() === "unenabled" && localFile.openstatus.toLowerCase() === "closed" ? "(Unenabled) (Closed)" + : localFile.enablestatus.toLowerCase() === "unenabled" && localFile.openstatus.toLowerCase() !== "closed" ? "(Unenabled)" + : localFile.enablestatus.toLowerCase() === "enabled" && localFile.openstatus.toLowerCase() === "closed" ? "(Closed)" + : "" }`, TreeItemCollapsibleState.None ); diff --git a/packages/vsce/src/trees/treeItems/CICSProgramTreeItem.ts b/packages/vsce/src/trees/treeItems/CICSProgramTreeItem.ts index a483902e..2c74f1be 100644 --- a/packages/vsce/src/trees/treeItems/CICSProgramTreeItem.ts +++ b/packages/vsce/src/trees/treeItems/CICSProgramTreeItem.ts @@ -26,13 +26,10 @@ export class CICSProgramTreeItem extends TreeItem { ) { super( `${program.program}${ - program.status.toLowerCase() === "disabled" && parseInt(program.newcopycnt) - ? ` (New copy count: ${program.newcopycnt}) (Disabled)` - : program.status.toLowerCase() === "disabled" && !parseInt(program.newcopycnt) - ? ` (Disabled)` - : program.status.toLowerCase() !== "disabled" && parseInt(program.newcopycnt) - ? ` (New copy count: ${program.newcopycnt})` - : "" + program.status.toLowerCase() === "disabled" && parseInt(program.newcopycnt) ? ` (New copy count: ${program.newcopycnt}) (Disabled)` + : program.status.toLowerCase() === "disabled" && !parseInt(program.newcopycnt) ? ` (Disabled)` + : program.status.toLowerCase() !== "disabled" && parseInt(program.newcopycnt) ? ` (New copy count: ${program.newcopycnt})` + : "" }`, TreeItemCollapsibleState.None ); diff --git a/packages/vsce/src/trees/treeItems/CICSTaskTreeItem.ts b/packages/vsce/src/trees/treeItems/CICSTaskTreeItem.ts index 8e63d68a..2054dce8 100644 --- a/packages/vsce/src/trees/treeItems/CICSTaskTreeItem.ts +++ b/packages/vsce/src/trees/treeItems/CICSTaskTreeItem.ts @@ -22,11 +22,9 @@ export class CICSTaskTreeItem extends TreeItem { task: any, parentRegion: CICSRegionTree, directParent: any, - public readonly iconPath = task.runstatus === "RUNNING" - ? getIconPathInResources("task-running-dark.svg", "task-running-light.svg") - : task.runstatus === "SUSPENDED" - ? getIconPathInResources("task-suspended-dark.svg", "task-suspended-light.svg") - : getIconPathInResources("task-dispatched-dark.svg", "task-dispatched-light.svg") + public readonly iconPath = task.runstatus === "RUNNING" ? getIconPathInResources("task-running-dark.svg", "task-running-light.svg") + : task.runstatus === "SUSPENDED" ? getIconPathInResources("task-suspended-dark.svg", "task-suspended-light.svg") + : getIconPathInResources("task-dispatched-dark.svg", "task-dispatched-light.svg") ) { super(`${task.task}`, TreeItemCollapsibleState.None); diff --git a/packages/vsce/src/trees/treeItems/web/CICSPipelineTree.ts b/packages/vsce/src/trees/treeItems/web/CICSPipelineTree.ts index 1fcd4390..6e4e67c7 100644 --- a/packages/vsce/src/trees/treeItems/web/CICSPipelineTree.ts +++ b/packages/vsce/src/trees/treeItems/web/CICSPipelineTree.ts @@ -21,7 +21,10 @@ export class CICSPipelineTree extends TreeItem { parentRegion: CICSRegionTree; activeFilter: string | undefined = undefined; - constructor(parentRegion: CICSRegionTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentRegion: CICSRegionTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("Pipelines", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicstreepipeline.${this.activeFilter ? "filtered" : "unfiltered"}.pipelines`; this.parentRegion = parentRegion; @@ -50,8 +53,9 @@ export class CICSPipelineTree extends TreeItem { criteria: criteria, }); https.globalAgent.options.rejectUnauthorized = undefined; - const pipelinesArray = Array.isArray(pipelineResponse.response.records.cicspipeline) - ? pipelineResponse.response.records.cicspipeline + const pipelinesArray = + Array.isArray(pipelineResponse.response.records.cicspipeline) ? + pipelineResponse.response.records.cicspipeline : [pipelineResponse.response.records.cicspipeline]; this.label = `Pipelines${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${pipelinesArray.length}]`; for (const pipeline of pipelinesArray) { diff --git a/packages/vsce/src/trees/treeItems/web/CICSTCPIPServiceTree.ts b/packages/vsce/src/trees/treeItems/web/CICSTCPIPServiceTree.ts index 6573d2c3..8aa5df03 100644 --- a/packages/vsce/src/trees/treeItems/web/CICSTCPIPServiceTree.ts +++ b/packages/vsce/src/trees/treeItems/web/CICSTCPIPServiceTree.ts @@ -21,7 +21,10 @@ export class CICSTCPIPServiceTree extends TreeItem { parentRegion: CICSRegionTree; activeFilter: string | undefined = undefined; - constructor(parentRegion: CICSRegionTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentRegion: CICSRegionTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("TCPIP Services", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicstreetcpips.${this.activeFilter ? "filtered" : "unfiltered"}.tcpips`; this.parentRegion = parentRegion; @@ -50,8 +53,9 @@ export class CICSTCPIPServiceTree extends TreeItem { criteria: criteria, }); https.globalAgent.options.rejectUnauthorized = undefined; - const tcpipservicesArray = Array.isArray(tcpipsResponse.response.records.cicstcpipservice) - ? tcpipsResponse.response.records.cicstcpipservice + const tcpipservicesArray = + Array.isArray(tcpipsResponse.response.records.cicstcpipservice) ? + tcpipsResponse.response.records.cicstcpipservice : [tcpipsResponse.response.records.cicstcpipservice]; this.label = `TCPIP Services${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${tcpipservicesArray.length}]`; for (const tcpips of tcpipservicesArray) { diff --git a/packages/vsce/src/trees/treeItems/web/CICSURIMapTree.ts b/packages/vsce/src/trees/treeItems/web/CICSURIMapTree.ts index 920f2859..b8ae2215 100644 --- a/packages/vsce/src/trees/treeItems/web/CICSURIMapTree.ts +++ b/packages/vsce/src/trees/treeItems/web/CICSURIMapTree.ts @@ -21,7 +21,10 @@ export class CICSURIMapTree extends TreeItem { parentRegion: CICSRegionTree; activeFilter: string | undefined = undefined; - constructor(parentRegion: CICSRegionTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentRegion: CICSRegionTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("URI Maps", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicstreeurimaps.${this.activeFilter ? "filtered" : "unfiltered"}.urimaps`; this.parentRegion = parentRegion; @@ -50,8 +53,9 @@ export class CICSURIMapTree extends TreeItem { criteria: criteria, }); https.globalAgent.options.rejectUnauthorized = undefined; - const urimapArray = Array.isArray(urimapResponse.response.records.cicsurimap) - ? urimapResponse.response.records.cicsurimap + const urimapArray = + Array.isArray(urimapResponse.response.records.cicsurimap) ? + urimapResponse.response.records.cicsurimap : [urimapResponse.response.records.cicsurimap]; this.label = `URI Maps${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${urimapArray.length}]`; for (const urimap of urimapArray) { diff --git a/packages/vsce/src/trees/treeItems/web/CICSWebServiceTree.ts b/packages/vsce/src/trees/treeItems/web/CICSWebServiceTree.ts index a8ddd16e..e9403403 100644 --- a/packages/vsce/src/trees/treeItems/web/CICSWebServiceTree.ts +++ b/packages/vsce/src/trees/treeItems/web/CICSWebServiceTree.ts @@ -21,7 +21,10 @@ export class CICSWebServiceTree extends TreeItem { parentRegion: CICSRegionTree; activeFilter: string | undefined = undefined; - constructor(parentRegion: CICSRegionTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) { + constructor( + parentRegion: CICSRegionTree, + public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg") + ) { super("Web Services", TreeItemCollapsibleState.Collapsed); this.contextValue = `cicstreewebservice.${this.activeFilter ? "filtered" : "unfiltered"}.webservices`; this.parentRegion = parentRegion; @@ -50,8 +53,9 @@ export class CICSWebServiceTree extends TreeItem { criteria: criteria, }); https.globalAgent.options.rejectUnauthorized = undefined; - const webservicesArray = Array.isArray(webserviceResponse.response.records.cicswebservice) - ? webserviceResponse.response.records.cicswebservice + const webservicesArray = + Array.isArray(webserviceResponse.response.records.cicswebservice) ? + webserviceResponse.response.records.cicswebservice : [webserviceResponse.response.records.cicswebservice]; this.label = `Web Services${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${webservicesArray.length}]`; for (const webservice of webservicesArray) { diff --git a/packages/vsce/src/utils/profileDefinition.ts b/packages/vsce/src/utils/profileDefinition.ts index 2cec42d3..4a0bc94b 100644 --- a/packages/vsce/src/utils/profileDefinition.ts +++ b/packages/vsce/src/utils/profileDefinition.ts @@ -114,4 +114,4 @@ const cicsProfileMeta: imperative.ICommandProfileTypeConfiguration[] = [ }, ]; -export default cicsProfileMeta ; +export default cicsProfileMeta; diff --git a/packages/vsce/src/utils/profileManagement.ts b/packages/vsce/src/utils/profileManagement.ts index 43f1a969..85f61dcc 100644 --- a/packages/vsce/src/utils/profileManagement.ts +++ b/packages/vsce/src/utils/profileManagement.ts @@ -281,7 +281,13 @@ export class ProfileManagement { } } - public static async generateCacheToken(profile: imperative.IProfileLoaded, plexName: string, resourceName: string, criteria?: string, group?: string) { + public static async generateCacheToken( + profile: imperative.IProfileLoaded, + plexName: string, + resourceName: string, + criteria?: string, + group?: string + ) { try { const config: AxiosRequestConfig = { baseURL: `${profile.profile.protocol}://${profile.profile.host}:${profile.profile.port}/CICSSystemManagement`, diff --git a/packages/vsce/src/utils/profileUtils.ts b/packages/vsce/src/utils/profileUtils.ts index d5e1d770..8cc38ebb 100644 --- a/packages/vsce/src/utils/profileUtils.ts +++ b/packages/vsce/src/utils/profileUtils.ts @@ -41,10 +41,13 @@ export async function promptCredentials(sessionName: string, rePrompt?: boolean) // }); // await mProfileInfo.readProfilesFromDisk(); // ProfilesCache.createConfigInstance(mProfileInfo); - const promptInfo = await ZoweVsCodeExtension.updateCredentials({ - sessionName, - rePrompt, - }, ProfileManagement.getExplorerApis()); + const promptInfo = await ZoweVsCodeExtension.updateCredentials( + { + sessionName, + rePrompt, + }, + ProfileManagement.getExplorerApis() + ); if (!promptInfo) { window.showInformationMessage("Input credentials operation Cancelled"); } diff --git a/packages/vsce/src/utils/webviewHTML.ts b/packages/vsce/src/utils/webviewHTML.ts index e8c28aff..49400605 100644 --- a/packages/vsce/src/utils/webviewHTML.ts +++ b/packages/vsce/src/utils/webviewHTML.ts @@ -193,8 +193,8 @@ export const addProfileHtml = (message?: imperative.IUpdateProfile): string => {
+ message?.profile.rejectUnauthorized ? `checked="checked"` : "" + }>
+ !message?.profile.rejectUnauthorized ? `checked="checked""` : "" + }> child.contextValue.includes("cicstreetransaction."))[0]; // Only load contents if the tree is expanded - if (transactionTree.collapsibleState === 2) { + if (transactionTree.collapsibleState === TreeItemCollapsibleState.Expanded) { await transactionTree.loadContents(); } // if node is in a plex and the plex contains the region container tree @@ -79,7 +79,7 @@ export function getEnableTransactionCommand(tree: CICSTree, treeview: TreeView child.contextValue.includes("cicscombinedtransactiontree.") )[0] as CICSCombinedTransactionsTree; - if (allTransactionTree.collapsibleState === 2 && allTransactionTree.getActiveFilter()) { + if (allTransactionTree.collapsibleState === TreeItemCollapsibleState.Expanded && allTransactionTree.getActiveFilter()) { await allTransactionTree.loadContents(tree); } } diff --git a/packages/vsce/src/commands/inquireProgram.ts b/packages/vsce/src/commands/inquireProgram.ts index 680972ee..1b6b34f3 100644 --- a/packages/vsce/src/commands/inquireProgram.ts +++ b/packages/vsce/src/commands/inquireProgram.ts @@ -33,9 +33,9 @@ export function getInquireProgramCommand(tree: CICSTree, treeview: TreeView if (allSelectedNodes[0].getParent() instanceof CICSCombinedTransactionsTree) { const cicsPlex: CICSPlexTree = allSelectedNodes[0].getParent().getParent(); const regionsContainer = cicsPlex.getChildren().filter((child) => child instanceof CICSRegionsContainer)[0]; - //@ts-ignore + //@ts-expect-error const regionTree: CICSRegionTree = regionsContainer - .getChildren()! + .getChildren() .filter((region: CICSRegionTree) => region.getRegionName() === allSelectedNodes[0].parentRegion.getRegionName())[0]; resourceFolders = regionTree.getChildren()!; } else { diff --git a/packages/vsce/src/commands/inquireTransaction.ts b/packages/vsce/src/commands/inquireTransaction.ts index 7bf0fc6a..d19afb7d 100644 --- a/packages/vsce/src/commands/inquireTransaction.ts +++ b/packages/vsce/src/commands/inquireTransaction.ts @@ -33,9 +33,9 @@ export function getInquireTransactionCommand(tree: CICSTree, treeview: TreeView< if (allSelectedNodes[0].getParent() instanceof CICSCombinedTaskTree) { const cicsPlex: CICSPlexTree = allSelectedNodes[0].getParent().getParent(); const regionsContainer = cicsPlex.getChildren().filter((child) => child instanceof CICSRegionsContainer)[0]; - //@ts-ignore + //@ts-expect-error const regionTree: CICSRegionTree = regionsContainer - .getChildren()! + .getChildren() .filter((region: CICSRegionTree) => region.getRegionName() === allSelectedNodes[0].parentRegion.getRegionName())[0]; resourceFolders = regionTree.getChildren()!; } else { diff --git a/packages/vsce/src/commands/newCopyCommand.ts b/packages/vsce/src/commands/newCopyCommand.ts index e0482650..affb717d 100644 --- a/packages/vsce/src/commands/newCopyCommand.ts +++ b/packages/vsce/src/commands/newCopyCommand.ts @@ -10,7 +10,7 @@ */ import { programNewcopy } from "@zowe/cics-for-zowe-sdk"; -import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { commands, ProgressLocation, TreeItemCollapsibleState, TreeView, window } from "vscode"; import { CICSRegionTree } from "../trees/CICSRegionTree"; import { CICSTree } from "../trees/CICSTree"; import * as https from "https"; @@ -64,9 +64,9 @@ export function getNewCopyCommand(tree: CICSTree, treeview: TreeView) { } catch (error) { // CMCI new copy error https.globalAgent.options.rejectUnauthorized = undefined; - // @ts-ignore + // @ts-expect-error if (error.mMessage) { - // @ts-ignore + // @ts-expect-error const [_, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); window.showErrorMessage( `Perform NEWCOPY on Program "${ @@ -88,7 +88,7 @@ export function getNewCopyCommand(tree: CICSTree, treeview: TreeView) { try { const programTree = parentRegion.children.filter((child: any) => child.contextValue.includes("cicstreeprogram."))[0]; // Only load contents if the tree is expanded - if (programTree.collapsibleState === 2) { + if (programTree.collapsibleState === TreeItemCollapsibleState.Expanded) { await programTree.loadContents(); } // if node is in a plex and the plex contains the region container tree @@ -96,7 +96,7 @@ export function getNewCopyCommand(tree: CICSTree, treeview: TreeView) { const allProgramsTree = parentRegion.parentPlex.children.filter((child: any) => child.contextValue.includes("cicscombinedprogramtree.") )[0] as CICSCombinedProgramTree; - if (allProgramsTree.collapsibleState === 2 && allProgramsTree.getActiveFilter()) { + if (allProgramsTree.collapsibleState === TreeItemCollapsibleState.Expanded && allProgramsTree.getActiveFilter()) { await allProgramsTree.loadContents(tree); } } diff --git a/packages/vsce/src/commands/openLocalFileCommand.ts b/packages/vsce/src/commands/openLocalFileCommand.ts index 6abdbabe..01c3e55c 100644 --- a/packages/vsce/src/commands/openLocalFileCommand.ts +++ b/packages/vsce/src/commands/openLocalFileCommand.ts @@ -11,7 +11,7 @@ import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse } from "@zowe/cics-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; -import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { commands, ProgressLocation, TreeItemCollapsibleState, TreeView, window } from "vscode"; import { CICSRegionTree } from "../trees/CICSRegionTree"; import { CICSTree } from "../trees/CICSTree"; import * as https from "https"; @@ -59,9 +59,9 @@ export function getOpenLocalFileCommand(tree: CICSTree, treeview: TreeView) } } catch (error) { https.globalAgent.options.rejectUnauthorized = undefined; - // @ts-ignore + // @ts-expect-error if (error.mMessage) { - // @ts-ignore + // @ts-expect-error const [_, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); window.showErrorMessage( `Perform OPEN on local file "${ @@ -82,7 +82,7 @@ export function getOpenLocalFileCommand(tree: CICSTree, treeview: TreeView) try { const localFileTree = parentRegion.children.filter((child: any) => child.contextValue.includes("cicstreelocalfile."))[0]; // Only load contents if the tree is expanded - if (localFileTree.collapsibleState === 2) { + if (localFileTree.collapsibleState === TreeItemCollapsibleState.Expanded) { await localFileTree.loadContents(); } // if node is in a plex and the plex contains the region container tree @@ -90,7 +90,7 @@ export function getOpenLocalFileCommand(tree: CICSTree, treeview: TreeView) const allLocalFileTreeTree = parentRegion.parentPlex.children.filter((child: any) => child.contextValue.includes("cicscombinedlocalfiletree.") )[0] as CICSCombinedLocalFileTree; - if (allLocalFileTreeTree.collapsibleState === 2 && allLocalFileTreeTree.getActiveFilter()) { + if (allLocalFileTreeTree.collapsibleState === TreeItemCollapsibleState.Expanded && allLocalFileTreeTree.getActiveFilter()) { await allLocalFileTreeTree.loadContents(tree); } } diff --git a/packages/vsce/src/commands/phaseInCommand.ts b/packages/vsce/src/commands/phaseInCommand.ts index b77d1073..49cbe806 100644 --- a/packages/vsce/src/commands/phaseInCommand.ts +++ b/packages/vsce/src/commands/phaseInCommand.ts @@ -11,7 +11,7 @@ import { CicsCmciConstants, CicsCmciRestClient } from "@zowe/cics-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; -import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { commands, ProgressLocation, TreeItemCollapsibleState, TreeView, window } from "vscode"; import { CICSRegionTree } from "../trees/CICSRegionTree"; import { CICSTree } from "../trees/CICSTree"; import * as https from "https"; @@ -65,9 +65,9 @@ export function getPhaseInCommand(tree: CICSTree, treeview: TreeView) { } } catch (error) { https.globalAgent.options.rejectUnauthorized = undefined; - // @ts-ignore + // @ts-expect-error if (error.mMessage) { - // @ts-ignore + // @ts-expect-error const [_, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); window.showErrorMessage( `Perform PHASEIN on Program "${ @@ -89,7 +89,7 @@ export function getPhaseInCommand(tree: CICSTree, treeview: TreeView) { try { const programTree = parentRegion.children.filter((child: any) => child.contextValue.includes("cicstreeprogram."))[0]; // Only load contents if the tree is expanded - if (programTree.collapsibleState === 2) { + if (programTree.collapsibleState === TreeItemCollapsibleState.Expanded) { await programTree.loadContents(); } // if node is in a plex and the plex contains the region container tree @@ -97,7 +97,7 @@ export function getPhaseInCommand(tree: CICSTree, treeview: TreeView) { const allProgramsTree = parentRegion.parentPlex.children.filter((child: any) => child.contextValue.includes("cicscombinedprogramtree.") )[0] as CICSCombinedProgramTree; - if (allProgramsTree.collapsibleState === 2 && allProgramsTree.getActiveFilter()) { + if (allProgramsTree.collapsibleState === TreeItemCollapsibleState.Expanded && allProgramsTree.getActiveFilter()) { await allProgramsTree.loadContents(tree); } } diff --git a/packages/vsce/src/commands/purgeTaskCommand.ts b/packages/vsce/src/commands/purgeTaskCommand.ts index 128782c1..6154e058 100644 --- a/packages/vsce/src/commands/purgeTaskCommand.ts +++ b/packages/vsce/src/commands/purgeTaskCommand.ts @@ -11,7 +11,7 @@ import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse } from "@zowe/cics-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; -import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { commands, ProgressLocation, TreeItemCollapsibleState, TreeView, window } from "vscode"; import { CICSRegionTree } from "../trees/CICSRegionTree"; import { CICSTree } from "../trees/CICSTree"; import * as https from "https"; @@ -73,9 +73,9 @@ export function getPurgeTaskCommand(tree: CICSTree, treeview: TreeView) { } } catch (error) { https.globalAgent.options.rejectUnauthorized = undefined; - // @ts-ignore + // @ts-expect-error if (error.mMessage) { - // @ts-ignore + // @ts-expect-error const [_, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); window.showErrorMessage( `Perform ${purgeType?.toUpperCase()} on CICSTask "${ @@ -96,7 +96,7 @@ export function getPurgeTaskCommand(tree: CICSTree, treeview: TreeView) { try { const taskTree = parentRegion.children.filter((child: any) => child.contextValue.includes("cicstreetask."))[0]; // Only load contents if the tree is expanded - if (taskTree.collapsibleState === 2) { + if (taskTree.collapsibleState === TreeItemCollapsibleState.Expanded) { await taskTree.loadContents(); } // if node is in a plex and the plex contains the region container tree @@ -107,7 +107,7 @@ export function getPurgeTaskCommand(tree: CICSTree, treeview: TreeView) { child.contextValue.includes("cicscombinedlocalfiletree.") )[0] as CICSCombinedTaskTree; // If allTasksTree is open - if (allTaskTreeTree.collapsibleState === 2 && allTaskTreeTree.getActiveFilter()) { + if (allTaskTreeTree.collapsibleState === TreeItemCollapsibleState.Expanded && allTaskTreeTree.getActiveFilter()) { await allTaskTreeTree.loadContents(tree); } } diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLibraryTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLibraryTree.ts index 0db67145..38b20485 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLibraryTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLibraryTree.ts @@ -119,7 +119,7 @@ export class CICSCombinedLibraryTree extends TreeItem { continue; } const parentRegion = regionsContainer - .getChildren()! + .getChildren() .filter((child) => child instanceof CICSRegionTree && child.getRegionName() === library.eyu_cicsname)?.[0] as CICSRegionTree; const libraryTree = new CICSLibraryTreeItem(library, parentRegion, this); libraryTree.setLabel(libraryTree.label.toString().replace(library.name, `${library.name} (${library.eyu_cicsname})`)); @@ -167,7 +167,7 @@ export class CICSCombinedLibraryTree extends TreeItem { this.incrementCount ); if (allLibraries) { - // @ts-ignore + // @ts-expect-error this.addLibrariesUtil( (this.getChildren()?.filter((child) => child instanceof CICSLibraryTreeItem) ?? []) as CICSLibraryTreeItem[], allLibraries, diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLocalFileTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLocalFileTree.ts index aec577ab..16c6735b 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLocalFileTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedLocalFileTree.ts @@ -119,7 +119,7 @@ export class CICSCombinedLocalFileTree extends TreeItem { continue; } const parentRegion = regionsContainer - .getChildren()! + .getChildren() .filter((child) => child instanceof CICSRegionTree && child.getRegionName() === localfile.eyu_cicsname)?.[0] as CICSRegionTree; const localFileTree = new CICSLocalFileTreeItem(localfile, parentRegion, this); localFileTree.setLabel(localFileTree.label.toString().replace(localfile.file, `${localfile.file} (${localfile.eyu_cicsname})`)); @@ -162,7 +162,7 @@ export class CICSCombinedLocalFileTree extends TreeItem { this.incrementCount ); if (allLocalFiles) { - // @ts-ignore + // @ts-expect-error this.addLocalFilesUtil( (this.getChildren()?.filter((child) => child instanceof CICSLocalFileTreeItem) ?? []) as CICSLocalFileTreeItem[], allLocalFiles, diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedPipelineTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedPipelineTree.ts index 33a7ed14..cc115635 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedPipelineTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedPipelineTree.ts @@ -119,7 +119,7 @@ export class CICSCombinedPipelineTree extends TreeItem { continue; } const parentRegion = regionsContainer - .getChildren()! + .getChildren() .filter((child) => child instanceof CICSRegionTree && child.getRegionName() === pipeline.eyu_cicsname)?.[0] as CICSRegionTree; const pipelineTree = new CICSPipelineTreeItem(pipeline, parentRegion, this); pipelineTree.setLabel(pipelineTree.label.toString().replace(pipeline.name, `${pipeline.name} (${pipeline.eyu_cicsname})`)); @@ -167,7 +167,7 @@ export class CICSCombinedPipelineTree extends TreeItem { this.incrementCount ); if (allPipelines) { - // @ts-ignore + // @ts-expect-error this.addPipelinesUtil( (this.getChildren()?.filter((child) => child instanceof CICSPipelineTreeItem) ?? []) as CICSPipelineTreeItem[], allPipelines, diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedProgramTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedProgramTree.ts index 5c46a64f..2cfab57a 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedProgramTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedProgramTree.ts @@ -121,7 +121,7 @@ export class CICSCombinedProgramTree extends TreeItem { continue; } const parentRegion = regionsContainer - .getChildren()! + .getChildren() .filter((child) => child instanceof CICSRegionTree && child.getRegionName() === program.eyu_cicsname)?.[0] as CICSRegionTree; const progamTree = new CICSProgramTreeItem(program, parentRegion, this); progamTree.setLabel(progamTree.label.toString().replace(program.program, `${program.program} (${program.eyu_cicsname})`)); @@ -169,7 +169,7 @@ export class CICSCombinedProgramTree extends TreeItem { this.incrementCount ); if (allPrograms) { - // @ts-ignore + // @ts-expect-error this.addProgramsUtil( (this.getChildren()?.filter((child) => child instanceof CICSProgramTreeItem) ?? []) as CICSProgramTreeItem[], allPrograms, diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTCPIPServiceTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTCPIPServiceTree.ts index 39c9be4e..f408fc3b 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTCPIPServiceTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTCPIPServiceTree.ts @@ -120,7 +120,7 @@ export class CICSCombinedTCPIPServiceTree extends TreeItem { continue; } const parentRegion = regionsContainer - .getChildren()! + .getChildren() .filter((child) => child instanceof CICSRegionTree && child.getRegionName() === tcpips.eyu_cicsname)?.[0] as CICSRegionTree; const tcpipsTree = new CICSTCPIPServiceTreeItem(tcpips, parentRegion, this); tcpipsTree.setLabel( @@ -170,7 +170,7 @@ export class CICSCombinedTCPIPServiceTree extends TreeItem { this.incrementCount ); if (allTCPIPS) { - // @ts-ignore + // @ts-expect-error this.addTCPIPSUtil( (this.getChildren()?.filter((child) => child instanceof CICSTCPIPServiceTreeItem) ?? []) as CICSTCPIPServiceTreeItem[], allTCPIPS, diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTaskTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTaskTree.ts index 27fe3979..279be9be 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTaskTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTaskTree.ts @@ -119,7 +119,7 @@ export class CICSCombinedTaskTree extends TreeItem { continue; } const parentRegion = regionsContainer - .getChildren()! + .getChildren() .filter((child) => child instanceof CICSRegionTree && child.getRegionName() === task.eyu_cicsname)?.[0] as CICSRegionTree; const taskTree = new CICSTaskTreeItem(task, parentRegion, this); // Show run status if run status isn't SUSPENDED (assuming SUSPENDED is default runstatus) @@ -167,7 +167,7 @@ export class CICSCombinedTaskTree extends TreeItem { this.incrementCount ); if (allTasks) { - // @ts-ignore + // @ts-expect-error this.addTasksUtil(this.getChildren() ? this.getChildren().filter((child) => child instanceof CICSTaskTreeItem) : [], allTasks, count); tree._onDidChangeTreeData.fire(undefined); } diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTransactionTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTransactionTree.ts index 798350df..a5b7acd0 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTransactionTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedTransactionTree.ts @@ -120,7 +120,7 @@ export class CICSCombinedTransactionsTree extends TreeItem { continue; } const parentRegion = regionsContainer - .getChildren()! + .getChildren() .filter((child) => child instanceof CICSRegionTree && child.getRegionName() === transaction.eyu_cicsname)?.[0] as CICSRegionTree; const transactionTree = new CICSTransactionTreeItem(transaction, parentRegion, this); transactionTree.setLabel(transactionTree.label.toString().replace(transaction.tranid, `${transaction.tranid} (${transaction.eyu_cicsname})`)); @@ -163,7 +163,7 @@ export class CICSCombinedTransactionsTree extends TreeItem { this.incrementCount ); if (allLocalTransactions) { - // @ts-ignore + // @ts-expect-error this.addLocalTransactionsUtil( (this.getChildren()?.filter((child) => child instanceof CICSTransactionTreeItem) ?? []) as CICSTransactionTreeItem[], allLocalTransactions, diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedURIMapTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedURIMapTree.ts index e14a122d..180c44ad 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedURIMapTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedURIMapTree.ts @@ -120,7 +120,7 @@ export class CICSCombinedURIMapTree extends TreeItem { continue; } const parentRegion = regionsContainer - .getChildren()! + .getChildren() .filter((child) => child instanceof CICSRegionTree && child.getRegionName() === urimaps.eyu_cicsname)?.[0] as CICSRegionTree; const urimapsTree = new CICSURIMapTreeItem(urimaps, parentRegion, this); urimapsTree.setLabel( @@ -172,7 +172,7 @@ export class CICSCombinedURIMapTree extends TreeItem { this.incrementCount ); if (allURIMaps) { - // @ts-ignore + // @ts-expect-error this.addURIMapsUtil( (this.getChildren()?.filter((child) => child instanceof CICSURIMapTreeItem) ?? []) as CICSURIMapTreeItem[], allURIMaps, diff --git a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedWebServiceTree.ts b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedWebServiceTree.ts index 43b77a52..1ff4593e 100644 --- a/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedWebServiceTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTrees/CICSCombinedWebServiceTree.ts @@ -120,7 +120,7 @@ export class CICSCombinedWebServiceTree extends TreeItem { continue; } const parentRegion = regionsContainer - .getChildren()! + .getChildren() .filter((child) => child instanceof CICSRegionTree && child.getRegionName() === webservice.eyu_cicsname)?.[0] as CICSRegionTree; const webserviceTree = new CICSWebServiceTreeItem(webservice, parentRegion, this); webserviceTree.setLabel(webserviceTree.label.toString().replace(webservice.name, `${webservice.name} (${webservice.eyu_cicsname})`)); @@ -168,7 +168,7 @@ export class CICSCombinedWebServiceTree extends TreeItem { this.incrementCount ); if (allWebServices) { - // @ts-ignore + // @ts-expect-error this.addWebServicesUtil( (this.getChildren()?.filter((child) => child instanceof CICSWebServiceTreeItem) ?? []) as CICSWebServiceTreeItem[], allWebServices, diff --git a/packages/vsce/src/trees/CICSLocalFileTree.ts b/packages/vsce/src/trees/CICSLocalFileTree.ts index 7f537da2..8d3c6b45 100644 --- a/packages/vsce/src/trees/CICSLocalFileTree.ts +++ b/packages/vsce/src/trees/CICSLocalFileTree.ts @@ -70,10 +70,10 @@ export class CICSLocalFileTree extends TreeItem { this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg"); } catch (error) { https.globalAgent.options.rejectUnauthorized = undefined; - // @ts-ignore + // @ts-expect-error if (error.mMessage!.includes("exceeded a resource limit")) { window.showErrorMessage(`Resource Limit Exceeded - Set a local file filter to narrow search`); - // @ts-ignore + // @ts-expect-error } else if (this.children.length === 0) { window.showInformationMessage(`No local files found`); this.label = `Local Files${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[0]`; diff --git a/packages/vsce/src/trees/CICSTransactionTree.ts b/packages/vsce/src/trees/CICSTransactionTree.ts index ff57c006..616464f2 100644 --- a/packages/vsce/src/trees/CICSTransactionTree.ts +++ b/packages/vsce/src/trees/CICSTransactionTree.ts @@ -66,10 +66,10 @@ export class CICSTransactionTree extends TreeItem { this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg"); } catch (error) { https.globalAgent.options.rejectUnauthorized = undefined; - // @ts-ignore + // @ts-expect-error if (error.mMessage!.includes("exceeded a resource limit")) { window.showErrorMessage(`Resource Limit Exceeded - Set a transaction filter to narrow search`); - // @ts-ignore + // @ts-expect-error } else if (this.children.length === 0) { window.showInformationMessage(`No transactions found`); this.label = `Transactions${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[0]`; diff --git a/packages/vsce/src/trees/CICSTree.ts b/packages/vsce/src/trees/CICSTree.ts index 24a52a89..8e382ba5 100644 --- a/packages/vsce/src/trees/CICSTree.ts +++ b/packages/vsce/src/trees/CICSTree.ts @@ -477,7 +477,7 @@ export class CICSTree implements TreeDataProvider { await ProfileManagement.profilesCacheRefresh(); await this.loadProfile(ProfileManagement.getProfilesCache().loadNamedProfile(message.name, "cics")); } catch (error) { - // @ts-ignore + // @ts-expect-error window.showErrorMessage(error); } } else { @@ -499,7 +499,7 @@ export class CICSTree implements TreeDataProvider { await this.loadProfile(ProfileManagement.getProfilesCache().loadNamedProfile(message.name, "cics")); } catch (error) { console.log(error); - // @ts-ignore + // @ts-expect-error window.showErrorMessage(error); } }); @@ -524,13 +524,13 @@ export class CICSTree implements TreeDataProvider { let answer; if (sessions.length === 1) { answer = await window.showInformationMessage( - `Are you sure you want to delete the profile "${sessions[0].label?.toString()!}"`, + `Are you sure you want to delete the profile "${sessions[0].label?.toString()}"`, ...["Yes", "No"] ); } else if (sessions.length > 1) { answer = await window.showInformationMessage( `Are you sure you want to delete the profiles "${sessions.map((sessionTree) => { - return sessionTree.label?.toString()!; + return sessionTree.label?.toString(); })}"`, ...["Yes", "No"] ); @@ -553,7 +553,7 @@ export class CICSTree implements TreeDataProvider { }); try { await ProfileManagement.deleteProfile({ - name: sessions[parseInt(index)].label?.toString()!, + name: sessions[parseInt(index)].label?.toString(), rejectIfDependency: true, }); const persistentStorage = new PersistentStorage("zowe.cics.persistent"); @@ -562,7 +562,7 @@ export class CICSTree implements TreeDataProvider { this.loadedProfiles = this.loadedProfiles.filter((profile) => profile !== sessions[parseInt(index)]); this._onDidChangeTreeData.fire(undefined); } catch (error) { - // @ts-ignore + // @ts-expect-error window.showErrorMessage(error); } } @@ -573,7 +573,7 @@ export class CICSTree implements TreeDataProvider { async updateSession(session: CICSSessionTree) { await ProfileManagement.profilesCacheRefresh(); - const profileToUpdate = await ProfileManagement.getProfilesCache().loadNamedProfile(session.label?.toString()!, "cics"); + const profileToUpdate = await ProfileManagement.getProfilesCache().loadNamedProfile(session.label?.toString(), "cics"); const message = { name: profileToUpdate.name, @@ -598,7 +598,7 @@ export class CICSTree implements TreeDataProvider { const updatedProfile = await ProfileManagement.getProfilesCache().loadNamedProfile(profile.profile.name, "cics"); await this.removeSession(session, updatedProfile, position); } catch (error) { - // @ts-ignore + // @ts-expect-error window.showErrorMessage(error); } }); @@ -615,6 +615,6 @@ export class CICSTree implements TreeDataProvider { element.getParent(); } - public _onDidChangeTreeData: EventEmitter = new EventEmitter(); - readonly onDidChangeTreeData: Event = this._onDidChangeTreeData.event; + public _onDidChangeTreeData: EventEmitter = new EventEmitter(); + readonly onDidChangeTreeData: Event = this._onDidChangeTreeData.event; } diff --git a/packages/vsce/src/utils/expansionHandler.ts b/packages/vsce/src/utils/expansionHandler.ts index b9a71bde..8aa9ec84 100644 --- a/packages/vsce/src/utils/expansionHandler.ts +++ b/packages/vsce/src/utils/expansionHandler.ts @@ -17,7 +17,7 @@ import { CICSTree } from "../trees/CICSTree"; import { ProfileManagement } from "./profileManagement"; export async function sessionExpansionHandler(session: CICSSessionTree, tree: CICSTree) { - const profile = await ProfileManagement.getProfilesCache().getLoadedProfConfig(session.label?.toString()!); + const profile = await ProfileManagement.getProfilesCache().getLoadedProfConfig(session.label?.toString()); if (profile == null) { throw new Error("sessionExpansionHandler: Profile is not defined"); } From 4bf0fc8e1e0bee1216cff946df714595d183b73a Mon Sep 17 00:00:00 2001 From: zFernand0 <37381190+zFernand0@users.noreply.github.com> Date: Wed, 31 Jul 2024 21:55:42 -0400 Subject: [PATCH 9/9] windows: test dowble quotes Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com> --- packages/cli/package.json | 2 +- packages/sdk/package.json | 2 +- packages/vsce/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 56cb6b9b..46328b63 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -30,7 +30,7 @@ "build": "tsc --pretty && npm run checkTestsCompile && npm run madge", "checkTestsCompile": "echo \"Checking that test source compiles...\" && tsc --project __tests__/test-tsconfig.json --noEmit ", "madge": "madge -c lib", - "pretty": "prettier --write 'src/**/*.ts' '__tests__/**/*.ts' '__mocks__/**/*.ts'", + "pretty": "prettier --write \"src/**/*.ts\" \"__tests__/**/*.ts\" \"__mocks__/**/*.ts\"", "prebuild": "npm run clean && echo Using TypeScript && tsc --version", "clean": "rimraf lib", "watch": "tsc --pretty --watch", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index fa398568..17c29cb0 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -28,7 +28,7 @@ "build": "tsc --pretty && npm run checkTestsCompile && npm run madge", "checkTestsCompile": "echo \"Checking that test source compiles...\" && tsc --project __tests__/test-tsconfig.json --noEmit ", "madge": "madge -c lib", - "pretty": "prettier --write 'src/**/*.ts' '__tests__/**/*.ts'", + "pretty": "prettier --write \"src/**/*.ts\" \"__tests__/**/*.ts\"", "prebuild": "npm run clean && echo Using TypeScript && tsc --version", "clean": "rimraf lib", "watch": "tsc --pretty --watch", diff --git a/packages/vsce/package.json b/packages/vsce/package.json index 853dfcd5..a458f098 100644 --- a/packages/vsce/package.json +++ b/packages/vsce/package.json @@ -875,7 +875,7 @@ "build": "tsup && npm run checkTestsCompile && npm run madge", "checkTestsCompile": "echo \"Checking that test source compiles...\" && tsc --project __tests__/test-tsconfig.json --noEmit ", "madge": "echo 'Nothing to check'", - "pretty": "prettier --write 'src/**/*.ts' '__tests__/**/*.ts'", + "pretty": "prettier --write \"src/**/*.ts\" \"__tests__/**/*.ts\"", "lint": "eslint src --ext ts", "prebuild": "npm run clean && echo Using TypeScript && tsc --version && echo Using TSUP && tsup --version", "clean": "rimraf lib && rimraf dist",