diff --git a/packages/vsce/src/utils/profileManagement.ts b/packages/vsce/src/utils/profileManagement.ts index 5ce6fe7e..208f510b 100644 --- a/packages/vsce/src/utils/profileManagement.ts +++ b/packages/vsce/src/utils/profileManagement.ts @@ -96,7 +96,8 @@ export class ProfileManagement { const { response } = await runGetResource({ session, resourceName: CicsCmciConstants.CICS_CMCI_REGION_GROUP, - profile, + ...profile?.regionName && { regionName: profile.regionName }, + ...profile?.cicsPlex && {cicsPlex: profile.cicsPlex }, params: { criteria: `GROUP=${profile.regionName}`, queryParams: { summonly: true, nodiscard: false } } }); @@ -158,7 +159,8 @@ export class ProfileManagement { const { response } = await runGetResource({ session, resourceName: CicsCmciConstants.CICS_CMCI_MANAGED_REGION, - profile, + ...profile?.regionName && { regionName: profile.regionName }, + ...profile?.cicsPlex && {cicsPlex: profile.cicsPlex }, }); if (response.records?.cicsmanagedregion) { @@ -199,7 +201,8 @@ export class ProfileManagement { const { response } = await runGetResource({ session, - profile, + ...profile?.regionName && { regionName: profile.regionName }, + ...profile?.cicsPlex && {cicsPlex: profile.cicsPlex }, resourceName: CicsCmciConstants.CICS_CMCI_MANAGED_REGION, }); @@ -242,7 +245,8 @@ export class ProfileManagement { try { const { response } = await runGetResource({ session, - profile, + ...profile?.regionName && { regionName: profile.regionName }, + ...profile?.cicsPlex && {cicsPlex: profile.cicsPlex }, resourceName: CicsCmciConstants.CICS_CMCI_REGION, }); @@ -360,7 +364,7 @@ export class ProfileManagement { const { response } = await runGetResource({ session, resourceName: CicsCmciConstants.CICS_CMCI_MANAGED_REGION, - profile: { cicsPlex: plex.getPlexName() } + cicsPlex: plex.getPlexName() }); if (response.resultsummary?.api_response1 === `${CicsCmciConstants.RESPONSE_1_CODES.OK}` && response.records?.cicsmanagedregion) { return toArray(response.records.cicsmanagedregion); diff --git a/packages/vsce/src/utils/resourceUtils.ts b/packages/vsce/src/utils/resourceUtils.ts index cb547c4e..e8e44b76 100644 --- a/packages/vsce/src/utils/resourceUtils.ts +++ b/packages/vsce/src/utils/resourceUtils.ts @@ -18,10 +18,9 @@ import { imperative } from "@zowe/zowe-explorer-api"; import constants from "./constants"; import { getErrorCode } from "./errorUtils"; -export async function runGetResource({ session, resourceName, profile, regionName, cicsPlex, params }: { +export async function runGetResource({ session, resourceName, regionName, cicsPlex, params }: { session: Session, resourceName: string, - profile?: imperative.IProfile, regionName?: string, cicsPlex?: string, params?: { criteria?: string, parameter?: string; queryParams?: IResourceQueryParams; }; @@ -31,8 +30,6 @@ export async function runGetResource({ session, resourceName, profile, regionNam try { const response = await getResource(session, { name: resourceName, - ...profile?.regionName && { regionName: profile.regionName }, - ...profile?.cicsPlex && { cicsPlex: profile.cicsPlex }, ...regionName && { regionName: regionName}, ...cicsPlex && { cicsPlex: regionName }, ...params?.criteria && { criteria: params.criteria }, @@ -53,4 +50,4 @@ export async function runGetResource({ session, resourceName, profile, regionNam throw error; } } -} +} \ No newline at end of file diff --git a/packages/vsce/tsup.config.json b/packages/vsce/tsup.config.json index aa7385ef..01265113 100644 --- a/packages/vsce/tsup.config.json +++ b/packages/vsce/tsup.config.json @@ -10,5 +10,6 @@ "external": [ "vscode" ], + "minify": "terser", "noExternal": [] } \ No newline at end of file