diff --git a/package-lock.json b/package-lock.json index 42e5a47..b06c353 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "trm-core", - "version": "6.1.14", + "version": "6.1.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "trm-core", - "version": "6.1.14", + "version": "6.1.15", "license": "MIT", "dependencies": { "@esm2cjs/normalize-url": "^8.0.0", diff --git a/package.json b/package.json index fe06fa7..8bfac6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "trm-core", - "version": "6.1.14", + "version": "6.1.15", "description": "TRM (Transport Request Manager) Core", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/actions/install/importTadirTransport.ts b/src/actions/install/importTadirTransport.ts index 08ff9cd..dae529f 100644 --- a/src/actions/install/importTadirTransport.ts +++ b/src/actions/install/importTadirTransport.ts @@ -3,6 +3,7 @@ import { InstallWorkflowContext } from "."; import { Logger } from "../../logger"; import { SystemConnector } from "../../systemConnector"; import { Transport } from "../../transport"; +import _ from 'lodash'; /** * Import TADIR Transport. @@ -34,23 +35,23 @@ export const importTadirTransport: Step = { Logger.loading(`Importing ${context.runtime.packageTransports.tadir.binaries.trkorr}`, true); await context.runtime.packageTransports.tadir.instance.import(importTimeout); Logger.success(`Transport ${context.runtime.packageTransports.tadir.binaries.trkorr} imported`, true); - + Logger.loading(`Finalizing import...`); //3- run tadir interface (package replacement) - if (!context.rawInput.installData.installDevclass.keepOriginal) { - for (const tadir of context.runtime.packageTransportsData.tadir) { + for (const tadir of context.runtime.packageTransportsData.tadir) { + var object = _.cloneDeep(tadir); + if (!context.rawInput.installData.installDevclass.keepOriginal) { const replacementDevclass = context.rawInput.installData.installDevclass.replacements.find(o => o.originalDevclass === tadir.devclass); if (replacementDevclass && replacementDevclass.installDevclass) { - var object = tadir; - object.devclass = replacementDevclass.installDevclass; - object.srcsystem = 'TRM'; - Logger.log(`Running TADIR interface for object ${object.pgmid} ${object.object} ${object.objName}, devclass ${tadir.devclass} -> ${object.devclass}, src system ${tadir.srcsystem} -> ${object.srcsystem}`, true); - await SystemConnector.tadirInterface(object); + object.devclass = replacementDevclass.installDevclass;; } else { Logger.error(`Replacement ABAP package not found for ${tadir.devclass}!`, true); } } + object.srcsystem = 'TRM'; + Logger.log(`Running TADIR interface for object ${object.pgmid} ${object.object} ${object.objName}, devclass ${tadir.devclass} -> ${object.devclass}, src system ${tadir.srcsystem} -> ${object.srcsystem}`, true); + await SystemConnector.tadirInterface(object); } }, revert: async (context: InstallWorkflowContext): Promise => { diff --git a/src/actions/publish/init.ts b/src/actions/publish/init.ts index 4d4ad6b..d15da58 100644 --- a/src/actions/publish/init.ts +++ b/src/actions/publish/init.ts @@ -192,14 +192,18 @@ export const init: Step = { Logger.info(`First time publishing "${context.rawInput.packageData.name}". Congratulations!`); }else{ context.runtime.trmPackage.latestReleaseManifest = (await context.runtime.trmPackage.package.fetchRemoteManifest('latest')).get(); - const validateVisibility = validatePackageVisibility( - context.rawInput.packageData.registry.getRegistryType(), - context.rawInput.packageData.name, - !!(context.runtime.trmPackage.manifest.private), - context.runtime.trmPackage.latestReleaseManifest ? context.runtime.trmPackage.latestReleaseManifest.private : undefined - ); - if(validateVisibility !== true){ - throw new Error(validateVisibility); + if(context.runtime.trmPackage.manifest.private === undefined){ + context.runtime.trmPackage.manifest.private = context.runtime.trmPackage.latestReleaseManifest.private; + }else{ + const validateVisibility = validatePackageVisibility( + context.rawInput.packageData.registry.getRegistryType(), + context.rawInput.packageData.name, + context.runtime.trmPackage.manifest.private, + context.runtime.trmPackage.latestReleaseManifest ? context.runtime.trmPackage.latestReleaseManifest.private : undefined + ); + if(validateVisibility !== true){ + throw new Error(validateVisibility); + } } } },