diff --git a/.vscode/settings.json b/.vscode/settings.json index 78664b27..009c4736 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "editor.tabSize": 2 -} + "editor.tabSize": 2, + "sarif-viewer.connectToGithubCodeScanning": "off" +} \ No newline at end of file diff --git a/nuget.json b/nuget.json index b1b7d0cb..fd02f3df 100644 --- a/nuget.json +++ b/nuget.json @@ -7,12 +7,12 @@ "packages": [ { "name": "Microsoft.PowerApps.CLI", - "version": "1.31.6", + "version": "1.32.8", "internalName": "pac" }, { "name": "Microsoft.PowerApps.CLI.Core.linux-x64", - "version": "1.31.6", + "version": "1.32.8", "internalName": "pac_linux", "chmod": "tools/pac" } diff --git a/src/actions/installCatalog.ts b/src/actions/installCatalog.ts index 83991908..2f5e5c1d 100644 --- a/src/actions/installCatalog.ts +++ b/src/actions/installCatalog.ts @@ -9,7 +9,8 @@ export interface InstallCatalogParameters extends CommonActionParameters { credentials: AuthCredentials; environmentUrl: string; catalogItemId: HostParameterEntry; - targetEnvironmentUrl: HostParameterEntry; + targetEnvironmentUrl?: HostParameterEntry; + targetEnvironment?: HostParameterEntry; targetVersion?: HostParameterEntry; settings?: HostParameterEntry; pollStatus?: HostParameterEntry; @@ -28,6 +29,7 @@ export async function installCatalog(parameters: InstallCatalogParameters, runne validator.pushInput(pacArgs, "--catalog-item-id", parameters.catalogItemId); validator.pushInput(pacArgs, "--target-url", parameters.targetEnvironmentUrl); + validator.pushInput(pacArgs, "--target-env", parameters.targetEnvironment); validator.pushInput(pacArgs, "--settings", parameters.settings); validator.pushInput(pacArgs, "--target-version", parameters.targetVersion); validator.pushInput(pacArgs, "--poll-status", parameters.pollStatus); diff --git a/test/actions/installCatalog.test.ts b/test/actions/installCatalog.test.ts index b34082e3..ded4fa7f 100644 --- a/test/actions/installCatalog.test.ts +++ b/test/actions/installCatalog.test.ts @@ -52,7 +52,6 @@ describe("action: install catalog", () => { credentials: mockClientCredentials, environmentUrl: environmentUrl, catalogItemId: { name: "CatalogItemId", required: true }, - targetEnvironmentUrl: { name: "TargetEnvironmentUrl", required: true }, settings: { name: "Settings", required: false }, targetVersion: { name: "TargetVersion", required: false }, pollStatus: { name: "PollStatus", required: false }, @@ -60,10 +59,20 @@ describe("action: install catalog", () => { }); it("with required params, calls pac runner with correct args", async () => { + installCatalogParameters.targetEnvironmentUrl = { name: "TargetEnvironmentUrl", required: true }; await runActionWithMocks(installCatalogParameters); authenticateEnvironmentStub.should.have.been.calledOnceWith(pacStub, mockClientCredentials); pacStub.should.have.been.calledOnceWith("catalog", "install", "--catalog-item-id", mockedHost.catalogItemId, "--target-url", mockedHost.targetEnvironmentUrl); clearAuthenticationStub.should.have.been.calledOnceWith(pacStub); }); + + it("with required params, calls pac runner with correct args 2", async () => { + installCatalogParameters.targetEnvironment = { name: "TargetEnvironment", required: true }; + await runActionWithMocks(installCatalogParameters); + + authenticateEnvironmentStub.should.have.been.calledOnceWith(pacStub, mockClientCredentials); + pacStub.should.have.been.calledOnceWith("catalog", "install", "--catalog-item-id", mockedHost.catalogItemId, "--target-env", mockedHost.targetEnvironment); + clearAuthenticationStub.should.have.been.calledOnceWith(pacStub); + }); });