Skip to content

Commit 18491f1

Browse files
committed
standardise cics profile definition for CLI and VSCE
Signed-off-by: Andrew Twydell <[email protected]>
1 parent 2d13589 commit 18491f1

File tree

4 files changed

+9
-89
lines changed

4 files changed

+9
-89
lines changed

packages/cli/src/imperative.ts

+2-80
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
// Imperative version of Zowe CLI
1313
import { IImperativeConfig } from "@zowe/imperative";
14-
import { CicsSession } from "./CicsSession";
1514
import { PluginConstants } from "./PluginConstants";
15+
import { getCICSProfileDefinition } from "@zowe/cics-for-zowe-sdk";
1616

1717
const config: IImperativeConfig = {
1818
commandModuleGlobs: ["*/*.definition!(.d).*s"],
@@ -27,85 +27,7 @@ const config: IImperativeConfig = {
2727
// }
2828
// ],
2929
profiles: [
30-
{
31-
type: "cics",
32-
schema: {
33-
type: "object",
34-
title: "CICS Profile",
35-
description:
36-
"A cics profile is required to issue commands in the cics command group that interact with " +
37-
"CICS regions. The cics profile contains your host, port, user name, and password " +
38-
"for the IBM CICS management client interface (CMCI) server of your choice.",
39-
properties: {
40-
host: {
41-
type: "string",
42-
optionDefinition: {
43-
name: "host",
44-
aliases: ["H"],
45-
description: "The CMCI server host name",
46-
type: "string",
47-
},
48-
},
49-
port: {
50-
type: "number",
51-
optionDefinition: {
52-
name: "port",
53-
aliases: ["P"],
54-
description: "The CMCI server port",
55-
type: "number",
56-
defaultValue: 1490,
57-
},
58-
},
59-
user: {
60-
type: "string",
61-
secure: true,
62-
optionDefinition: {
63-
name: "user",
64-
aliases: ["u"],
65-
description: "Your username to connect to CICS",
66-
type: "string",
67-
implies: ["password"],
68-
},
69-
},
70-
password: {
71-
type: "string",
72-
secure: true,
73-
optionDefinition: {
74-
name: "password",
75-
aliases: ["p"],
76-
description: "Your password to connect to CICS",
77-
type: "string",
78-
implies: ["user"],
79-
},
80-
},
81-
regionName: {
82-
type: "string",
83-
optionDefinition: {
84-
name: "region-name",
85-
description: "The name of the CICS region name to interact with",
86-
type: "string",
87-
},
88-
},
89-
cicsPlex: {
90-
type: "string",
91-
optionDefinition: {
92-
name: "cics-plex",
93-
description: "The name of the CICSPlex to interact with",
94-
type: "string",
95-
},
96-
},
97-
rejectUnauthorized: {
98-
type: "boolean",
99-
optionDefinition: CicsSession.CICS_OPTION_REJECT_UNAUTHORIZED,
100-
},
101-
protocol: {
102-
type: "string",
103-
optionDefinition: CicsSession.CICS_OPTION_PROTOCOL,
104-
},
105-
},
106-
required: [],
107-
},
108-
},
30+
getCICSProfileDefinition(),
10931
],
11032
};
11133

packages/vsce/src/utils/profileDefinition.ts packages/sdk/src/constants/CICSProfileDefinition.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
import { imperative } from "@zowe/zowe-explorer-api";
1313

14-
const cicsProfileMeta: imperative.ICommandProfileTypeConfiguration[] = [
15-
{
14+
export const getCICSProfileDefinition = (): imperative.ICommandProfileTypeConfiguration => {
15+
return {
1616
type: "cics",
1717
schema: {
1818
type: "object",
@@ -105,7 +105,5 @@ const cicsProfileMeta: imperative.ICommandProfileTypeConfiguration[] = [
105105
},
106106
required: [],
107107
},
108-
},
109-
];
110-
111-
export default cicsProfileMeta;
108+
};
109+
};

packages/sdk/src/constants/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111

1212
export * from "./CicsCmci.constants";
1313
export * from "./CicsCmci.messages";
14+
export * from "./CICSProfileDefinition";

packages/vsce/src/utils/profileManagement.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
*
1010
*/
1111

12-
import { CicsCmciConstants, CicsCmciRestError, getCache } from "@zowe/cics-for-zowe-sdk";
12+
import { CicsCmciConstants, CicsCmciRestError, getCache, getCICSProfileDefinition } from "@zowe/cics-for-zowe-sdk";
1313
import { Session } from "@zowe/imperative";
1414
import { Gui, MessageSeverity, Types, ZoweVsCodeExtension, imperative } from "@zowe/zowe-explorer-api";
1515
import { CICSPlexTree } from "../trees/CICSPlexTree";
1616
import { toArray } from "./commandUtils";
1717
import constants from "./constants";
1818
import { getBestCICSplexes } from "./plexUtils";
19-
import cicsProfileMeta from "./profileDefinition";
2019
import { runGetResource } from "./resourceUtils";
2120

2221
export class ProfileManagement {
@@ -33,7 +32,7 @@ export class ProfileManagement {
3332
}
3433

3534
public static async registerCICSProfiles() {
36-
await ProfileManagement.zoweExplorerAPI.getExplorerExtenderApi().initForZowe("cics", cicsProfileMeta);
35+
await ProfileManagement.zoweExplorerAPI.getExplorerExtenderApi().initForZowe("cics", [getCICSProfileDefinition()]);
3736
}
3837

3938
public static getExplorerApis() {

0 commit comments

Comments
 (0)