Skip to content

Commit

Permalink
Merge branch 'main' into clean-up-obsolete-web-page
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmdas authored Dec 17, 2024
2 parents f3f69cc + 3d401f3 commit 5b495f1
Show file tree
Hide file tree
Showing 39 changed files with 623 additions and 189 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zowe/cics_monorepo",
"private": true,
"version": "6.0.2",
"version": "6.1.0",
"publishConfig": {
"registry": "https://zowe.jfrog.io/zowe/api/npm/npm-local-release/"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zowe/cics-for-zowe-cli",
"version": "6.0.0",
"version": "6.1.0",
"author": "Zowe",
"license": "EPL-2.0",
"description": "IBM CICS Plug-in for Zowe CLI",
Expand Down Expand Up @@ -51,7 +51,7 @@
"configurationModule": "lib/imperative.js"
},
"dependencies": {
"@zowe/cics-for-zowe-sdk": "6.0.0"
"@zowe/cics-for-zowe-sdk": "6.1.0"
},
"peerDependencies": {
"@zowe/imperative": "^8.0.0"
Expand Down
4 changes: 4 additions & 0 deletions packages/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the IBM® CICS® Plug-in for Zowe CLI will be documented in this file.

## `6.1.0`

- Enhancement: Made the region name optional on the getResource SDK method. [#162](https://github.com/zowe/cics-for-zowe-client/issues/162)

## `6.0.0`

- MAJOR: v6.0.0 release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ 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 + "'";
"?CRITERIA=(NAME%3D%3D'" + addToListParms.name + "')";

response = await addCSDGroupToList(dummySession, addToListParms);

Expand All @@ -179,7 +179,7 @@ describe("CMCI - Add csdGroup to list", () => {
addToListParms.cicsPlex = "";
endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" +
CicsCmciConstants.CICS_CSDGROUP + "/" + addToListParms.cicsPlex + "/" + addToListParms.regionName +
"?CRITERIA=NAME=='" + addToListParms.name + "'";
"?CRITERIA=(NAME%3D%3D'" + addToListParms.name + "')";

response = await addCSDGroupToList(dummySession, addToListParms);

Expand All @@ -192,7 +192,7 @@ describe("CMCI - Add csdGroup to list", () => {
addToListParms.cicsPlex = cicsPlex;
endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" +
CicsCmciConstants.CICS_CSDGROUP + "/" + addToListParms.cicsPlex + "/" + addToListParms.regionName +
"?CRITERIA=NAME=='" + addToListParms.name + "'";
"?CRITERIA=(NAME%3D%3D'" + addToListParms.name + "')";

response = await addCSDGroupToList(dummySession, addToListParms);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ 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})`;
`?CRITERIA=(NAME%3D${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`;

response = await deleteProgram(dummySession, deleteParms);

Expand All @@ -186,7 +186,7 @@ describe("CMCI - Delete program", () => {
deleteParms.cicsPlex = "";
endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" +
CicsCmciConstants.CICS_DEFINITION_PROGRAM + "//" + region +
`?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`;
`?CRITERIA=(NAME%3D${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`;

response = await deleteProgram(dummySession, deleteParms);

Expand All @@ -199,7 +199,7 @@ describe("CMCI - Delete program", () => {
deleteParms.cicsPlex = cicsPlex;
endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" +
CicsCmciConstants.CICS_DEFINITION_PROGRAM + "/" + cicsPlex + "/" + region +
`?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`;
`?CRITERIA=(NAME%3D${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`;

response = await deleteProgram(dummySession, deleteParms);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ 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})`;
`?CRITERIA=(NAME%3D${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`;

response = await deleteTransaction(dummySession, deleteParms);

Expand All @@ -192,7 +192,7 @@ describe("CMCI - Discard transaction", () => {
deleteParms.cicsPlex = "";
endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" +
CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "//" + region +
`?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`;
`?CRITERIA=(NAME%3D${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`;

response = await deleteTransaction(dummySession, deleteParms);

Expand All @@ -205,7 +205,7 @@ describe("CMCI - Discard transaction", () => {
deleteParms.cicsPlex = cicsPlex;
endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" +
CicsCmciConstants.CICS_DEFINITION_TRANSACTION + "/" + cicsPlex + "/" + region +
`?CRITERIA=(NAME=${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`;
`?CRITERIA=(NAME%3D${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`;

response = await deleteTransaction(dummySession, deleteParms);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ 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})`;
`?CRITERIA=(NAME%3D${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`;

response = await deleteUrimap(dummySession, deleteParms);
expect(response).toContain(content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ 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})`;
`?CRITERIA=(NAME%3D${deleteParms.name})&PARAMETER=CSDGROUP(${deleteParms.csdGroup})`;

response = await deleteWebservice(dummySession, deleteParms);
expect(response).toContain(content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ 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})`;
`?CRITERIA=(NAME%3D${disableParms.name})`;
requestBody = {
request: {
update: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ 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 + ")";
"?CRITERIA=(PROGRAM%3D" + discardParms.name + ")";

response = await discardProgram(dummySession, discardParms);

Expand All @@ -142,7 +142,7 @@ describe("CMCI - Discard program", () => {
discardParms.cicsPlex = "";
endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" +
CicsCmciConstants.CICS_PROGRAM_RESOURCE + "//" + region +
"?CRITERIA=(PROGRAM=" + discardParms.name + ")";
"?CRITERIA=(PROGRAM%3D" + discardParms.name + ")";

response = await discardProgram(dummySession, discardParms);

Expand All @@ -155,7 +155,7 @@ describe("CMCI - Discard program", () => {
discardParms.cicsPlex = cicsPlex;
endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" +
CicsCmciConstants.CICS_PROGRAM_RESOURCE + "/" + cicsPlex + "/" + region +
"?CRITERIA=(PROGRAM=" + discardParms.name + ")";
"?CRITERIA=(PROGRAM%3D" + discardParms.name + ")";

response = await discardProgram(dummySession, discardParms);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ 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 + ")";
"?CRITERIA=(TRANID%3D" + discardParms.name + ")";

response = await discardTransaction(dummySession, discardParms);

Expand All @@ -160,7 +160,7 @@ describe("CMCI - Discard transaction", () => {
discardParms.cicsPlex = "";
endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" +
CicsCmciConstants.CICS_LOCAL_TRANSACTION + "//" + region +
"?CRITERIA=(TRANID=" + discardParms.name + ")";
"?CRITERIA=(TRANID%3D" + discardParms.name + ")";

response = await discardTransaction(dummySession, discardParms);

Expand All @@ -173,7 +173,7 @@ describe("CMCI - Discard transaction", () => {
discardParms.cicsPlex = cicsPlex;
endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" +
CicsCmciConstants.CICS_LOCAL_TRANSACTION + "/" + cicsPlex + "/" + region +
"?CRITERIA=(TRANID=" + discardParms.name + ")";
"?CRITERIA=(TRANID%3D" + discardParms.name + ")";

response = await discardTransaction(dummySession, discardParms);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ 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}')`;
`?CRITERIA=(NAME%3D${discardParms.name})`;

response = await discardUrimap(dummySession, discardParms);
expect(response).toContain(content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ 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})`;
`?CRITERIA=(NAME%3D${enableParms.name})`;
requestBody = {
request: {
update: {
Expand Down
83 changes: 45 additions & 38 deletions packages/sdk/__tests__/__unit__/get/Get.resource.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ describe("CMCI - Get resource", () => {
const criteria = "program=D*";
const content = "This\nis\r\na\ntest" as unknown as ICMCIApiResponse;

const resourceParms: IResourceParms = {
regionName: region,
name: resource,
criteria,
cicsPlex: undefined
};

const dummySession = new Session({
user: "fake",
password: "fake",
Expand All @@ -43,11 +36,19 @@ describe("CMCI - Get resource", () => {
let error: any;
let response: any;
let endPoint: string;
let resourceParms: IResourceParms;


describe("validation", () => {
beforeEach(() => {
response = undefined;
error = undefined;
resourceParms = {
regionName: region,
name: resource,
criteria: undefined,
cicsPlex: undefined
};
});

it("should throw error if no parms are defined", async () => {
Expand Down Expand Up @@ -77,21 +78,6 @@ describe("CMCI - Get resource", () => {
expect(error.message).toContain("CICS resource name is required");
});

it("should throw error if CICS Region name is not defined", async () => {
try {
response = await getResource(dummySession, {
regionName: undefined,
name: "fake"
});
} catch (err) {
error = err;
}

expect(response).toBeUndefined();
expect(error).toBeDefined();
expect(error.message).toContain("CICS region name is required");
});

it("should throw error if resource name is missing", async () => {
try {
response = await getResource(dummySession, {
Expand All @@ -106,21 +92,6 @@ describe("CMCI - Get resource", () => {
expect(error).toBeDefined();
expect(error.message).toContain("Required parameter 'CICS Resource name' must not be blank");
});

it("should throw error if CICS Region name is missing", async () => {
try {
response = await getResource(dummySession, {
regionName: "",
name: "fake"
});
} catch (err) {
error = err;
}

expect(response).toBeUndefined();
expect(error).toBeDefined();
expect(error.message).toContain("Required parameter 'CICS Region name' must not be blank");
});
});

describe("success scenarios", () => {
Expand All @@ -130,13 +101,49 @@ describe("CMCI - Get resource", () => {
beforeEach(() => {
response = undefined;
error = undefined;
resourceParms = {
regionName: region,
name: resource,
criteria: undefined,
cicsPlex: undefined
};
deleteSpy.mockClear();
deleteSpy.mockResolvedValue(content);
});

it("should be able to get a resource without CICS Region name being defined", async () => {
try {
resourceParms.regionName = undefined;
response = await getResource(dummySession, resourceParms);
} catch (err) {
error = err;
}

endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" +
resource + "/";

expect(response).toContain(content);
expect(deleteSpy).toHaveBeenCalledWith(dummySession, endPoint, []);
});

it("should be able to get a resource without CICS Region name being specified", async () => {
try {
resourceParms.regionName = "";
response = await getResource(dummySession, resourceParms);
} catch (err) {
error = err;
}

endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" +
resource + "/";

expect(response).toContain(content);
expect(deleteSpy).toHaveBeenCalledWith(dummySession, endPoint, []);
});

it("should be able to get a resource without cicsPlex specified", async () => {
endPoint = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + resource +
"/" + region + "?CRITERIA=(" + encodeURIComponent(resourceParms.criteria) + ")";
"/" + region;

response = await getResource(dummySession, resourceParms);

Expand Down
Loading

0 comments on commit 5b495f1

Please sign in to comment.