trm-core 9.10.6 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/changelog.txt +11 -0
- package/dist/actions/cg3y/download.js +34 -4
- package/dist/actions/cg3y/index.d.ts +23 -0
- package/dist/actions/cg3y/index.js +13 -10
- package/dist/actions/cg3z/index.d.ts +67 -3
- package/dist/actions/cg3z/index.js +25 -14
- package/dist/actions/cg3z/upload.d.ts +20 -0
- package/dist/actions/cg3z/upload.js +165 -36
- package/dist/actions/checkEngines/analyze.d.ts +11 -0
- package/dist/actions/checkEngines/analyze.js +294 -0
- package/dist/actions/checkEngines/index.d.ts +87 -0
- package/dist/actions/checkEngines/index.js +38 -0
- package/dist/actions/checkEngines/init.d.ts +11 -0
- package/dist/actions/checkEngines/init.js +45 -0
- package/dist/actions/checkPackageDependencies/analyze.d.ts +10 -0
- package/dist/actions/checkPackageDependencies/analyze.js +37 -39
- package/dist/actions/checkPackageDependencies/index.d.ts +56 -0
- package/dist/actions/checkPackageDependencies/index.js +13 -10
- package/dist/actions/checkPackageDependencies/init.d.ts +8 -0
- package/dist/actions/checkPackageDependencies/init.js +24 -2
- package/dist/actions/checkSapEntries/analyze.d.ts +12 -0
- package/dist/actions/checkSapEntries/analyze.js +63 -47
- package/dist/actions/checkSapEntries/index.d.ts +35 -0
- package/dist/actions/checkSapEntries/index.js +12 -10
- package/dist/actions/checkSapEntries/init.d.ts +8 -0
- package/dist/actions/checkSapEntries/init.js +10 -2
- package/dist/actions/commons/IActionContext.d.ts +10 -0
- package/dist/actions/commons/checkServerAuth.d.ts +7 -0
- package/dist/actions/commons/checkServerAuth.js +10 -5
- package/dist/actions/commons/index.d.ts +1 -1
- package/dist/actions/commons/index.js +1 -1
- package/dist/actions/commons/prompts/index.d.ts +1 -0
- package/dist/actions/commons/prompts/index.js +1 -0
- package/dist/actions/commons/prompts/setLandscapeTarget.d.ts +14 -0
- package/dist/actions/commons/prompts/setLandscapeTarget.js +40 -0
- package/dist/actions/commons/prompts/setTransportTarget.d.ts +15 -0
- package/dist/actions/commons/prompts/setTransportTarget.js +20 -2
- package/dist/actions/commons/setSystemPackages.d.ts +7 -0
- package/dist/actions/commons/setSystemPackages.js +12 -2
- package/dist/actions/commons/utils/actionLocks.d.ts +32 -0
- package/dist/actions/commons/utils/actionLocks.js +135 -0
- package/dist/actions/commons/utils/dirtyEntries.d.ts +12 -0
- package/dist/actions/commons/utils/dirtyEntries.js +54 -0
- package/dist/actions/commons/utils/index.d.ts +10 -0
- package/dist/actions/commons/utils/index.js +26 -0
- package/dist/actions/commons/utils/installRegistry.d.ts +18 -0
- package/dist/actions/commons/utils/installRegistry.js +46 -0
- package/dist/actions/commons/utils/installedDependency.d.ts +15 -0
- package/dist/actions/commons/utils/installedDependency.js +30 -0
- package/dist/actions/commons/utils/owningInstallation.d.ts +6 -0
- package/dist/actions/commons/utils/owningInstallation.js +47 -0
- package/dist/actions/commons/utils/packageCleanup.d.ts +168 -0
- package/dist/actions/commons/utils/packageCleanup.js +1017 -0
- package/dist/actions/commons/utils/releaseDeletionTransport.d.ts +5 -0
- package/dist/actions/commons/utils/releaseDeletionTransport.js +67 -0
- package/dist/actions/commons/utils/restoreTransport.d.ts +6 -0
- package/dist/actions/commons/utils/restoreTransport.js +50 -0
- package/dist/actions/commons/utils/retainedWorkflow.d.ts +6 -0
- package/dist/actions/commons/utils/retainedWorkflow.js +49 -0
- package/dist/actions/commons/utils/withScopedPrefix.d.ts +5 -0
- package/dist/actions/commons/utils/withScopedPrefix.js +32 -0
- package/dist/actions/commons/workflowCallbacks.d.ts +21 -0
- package/dist/actions/commons/workflowCallbacks.js +157 -0
- package/dist/actions/index.d.ts +3 -0
- package/dist/actions/index.js +5 -0
- package/dist/actions/install/addNamespace.d.ts +18 -0
- package/dist/actions/install/addNamespace.js +121 -51
- package/dist/actions/install/checkDependants.d.ts +15 -0
- package/dist/actions/install/checkDependants.js +74 -0
- package/dist/actions/install/checkDependencies.d.ts +11 -0
- package/dist/actions/install/checkDependencies.js +32 -13
- package/dist/actions/install/checkDependencyCycles.d.ts +17 -0
- package/dist/actions/install/checkDependencyCycles.js +105 -0
- package/dist/actions/install/checkEngines.d.ts +11 -0
- package/dist/actions/install/checkEngines.js +100 -0
- package/dist/actions/install/checkInstallDevclass.d.ts +24 -0
- package/dist/actions/install/checkInstallDevclass.js +110 -0
- package/dist/actions/install/checkSapEntries.d.ts +9 -0
- package/dist/actions/install/checkSapEntries.js +20 -12
- package/dist/actions/install/checkTransports.d.ts +34 -0
- package/dist/actions/install/checkTransports.js +329 -170
- package/dist/actions/install/cleanupCheckpoint.d.ts +11 -0
- package/dist/actions/install/cleanupCheckpoint.js +62 -0
- package/dist/actions/install/defaultTransportLayer.d.ts +5 -0
- package/dist/actions/install/defaultTransportLayer.js +36 -0
- package/dist/actions/install/executePostActivities.d.ts +6 -0
- package/dist/actions/install/executePostActivities.js +28 -38
- package/dist/actions/install/generateDevclass.d.ts +10 -0
- package/dist/actions/install/generateDevclass.js +66 -20
- package/dist/actions/install/generateLandscapeTransport.d.ts +23 -0
- package/dist/actions/install/generateLandscapeTransport.js +136 -0
- package/dist/actions/install/generateUpdateTransport.d.ts +20 -0
- package/dist/actions/install/generateUpdateTransport.js +122 -0
- package/dist/actions/install/importBatch.d.ts +22 -0
- package/dist/actions/install/importBatch.js +0 -0
- package/dist/actions/install/index.d.ts +273 -44
- package/dist/actions/install/index.js +139 -59
- package/dist/actions/install/init.d.ts +14 -0
- package/dist/actions/install/init.js +215 -108
- package/dist/actions/install/installDependencies.d.ts +14 -0
- package/dist/actions/install/installDependencies.js +122 -45
- package/dist/actions/install/lockResources.d.ts +8 -0
- package/dist/actions/install/lockResources.js +100 -0
- package/dist/actions/install/prepareCust.d.ts +13 -0
- package/dist/actions/install/prepareCust.js +138 -0
- package/dist/actions/install/prepareDevc.d.ts +15 -0
- package/dist/actions/install/prepareDevc.js +113 -0
- package/dist/actions/install/prepareLang.d.ts +13 -0
- package/dist/actions/install/prepareLang.js +110 -0
- package/dist/actions/install/prepareTadir.d.ts +13 -0
- package/dist/actions/install/prepareTadir.js +95 -0
- package/dist/actions/install/releaseLandscapeTransport.d.ts +11 -0
- package/dist/actions/install/releaseLandscapeTransport.js +79 -0
- package/dist/actions/install/setInstallDevclass.d.ts +10 -0
- package/dist/actions/install/setInstallDevclass.js +140 -54
- package/dist/actions/install/updatePackageData.d.ts +9 -0
- package/dist/actions/install/updatePackageData.js +117 -13
- package/dist/actions/installDependency/checkInstalledRelease.d.ts +13 -0
- package/dist/actions/installDependency/checkInstalledRelease.js +50 -0
- package/dist/actions/installDependency/confirmDowngrade.d.ts +11 -0
- package/dist/actions/installDependency/confirmDowngrade.js +53 -0
- package/dist/actions/installDependency/findInstallRelease.d.ts +24 -0
- package/dist/actions/installDependency/findInstallRelease.js +42 -19
- package/dist/actions/installDependency/index.d.ts +64 -3
- package/dist/actions/installDependency/index.js +30 -13
- package/dist/actions/installDependency/init.d.ts +14 -0
- package/dist/actions/installDependency/init.js +24 -3
- package/dist/actions/installDependency/installRelease.d.ts +6 -0
- package/dist/actions/installDependency/installRelease.js +22 -12
- package/dist/actions/publish/enginesUi.d.ts +53 -0
- package/dist/actions/publish/enginesUi.js +289 -0
- package/dist/actions/publish/findDependencies.d.ts +19 -0
- package/dist/actions/publish/findDependencies.js +72 -37
- package/dist/actions/publish/generateCustTransport.d.ts +6 -0
- package/dist/actions/publish/generateCustTransport.js +42 -19
- package/dist/actions/publish/generateDevcTransport.d.ts +6 -0
- package/dist/actions/publish/generateDevcTransport.js +16 -18
- package/dist/actions/publish/generateLangTransport.d.ts +6 -0
- package/dist/actions/publish/generateLangTransport.js +20 -23
- package/dist/actions/publish/generateTadirTransport.d.ts +6 -0
- package/dist/actions/publish/generateTadirTransport.js +18 -17
- package/dist/actions/publish/getSystemEngines.d.ts +27 -0
- package/dist/actions/publish/getSystemEngines.js +112 -0
- package/dist/actions/publish/index.d.ts +162 -37
- package/dist/actions/publish/index.js +51 -34
- package/dist/actions/publish/init.d.ts +28 -0
- package/dist/actions/publish/init.js +304 -120
- package/dist/actions/publish/lockResources.d.ts +4 -0
- package/dist/actions/{install/refreshTmsTxt.js → publish/lockResources.js} +14 -17
- package/dist/actions/publish/publishToRegistry.d.ts +8 -0
- package/dist/actions/publish/publishToRegistry.js +18 -8
- package/dist/actions/publish/releaseTransports.d.ts +6 -0
- package/dist/actions/publish/releaseTransports.js +48 -20
- package/dist/actions/publish/setCustomizingTransports.d.ts +6 -0
- package/dist/actions/publish/setCustomizingTransports.js +227 -101
- package/dist/actions/publish/setManifestValues.d.ts +22 -0
- package/dist/actions/publish/setManifestValues.js +455 -119
- package/dist/actions/publish/setOptionalPublishData.d.ts +11 -0
- package/dist/actions/publish/setOptionalPublishData.js +133 -0
- package/dist/actions/publish/updatePackageData.d.ts +8 -0
- package/dist/actions/publish/updatePackageData.js +20 -7
- package/dist/actions/stopWarning.d.ts +5 -0
- package/dist/actions/stopWarning.js +5 -0
- package/dist/actions/uninstall/checkDependants.d.ts +7 -0
- package/dist/actions/uninstall/checkDependants.js +55 -0
- package/dist/actions/uninstall/forwardDeletionTransport.d.ts +10 -0
- package/dist/actions/uninstall/forwardDeletionTransport.js +51 -0
- package/dist/actions/uninstall/generateDeletionTransport.d.ts +10 -0
- package/dist/actions/uninstall/generateDeletionTransport.js +45 -0
- package/dist/actions/uninstall/index.d.ts +153 -0
- package/dist/actions/uninstall/index.js +141 -0
- package/dist/actions/uninstall/init.d.ts +17 -0
- package/dist/actions/uninstall/init.js +146 -0
- package/dist/actions/uninstall/lockResources.d.ts +4 -0
- package/dist/actions/{publish/setTransportTarget.js → uninstall/lockResources.js} +16 -7
- package/dist/actions/uninstall/removePackageData.d.ts +9 -0
- package/dist/actions/uninstall/removePackageData.js +64 -0
- package/dist/actions/uninstall/uninstallNestedPackages.d.ts +26 -0
- package/dist/actions/uninstall/uninstallNestedPackages.js +174 -0
- package/dist/client/ClientError.d.ts +3 -1
- package/dist/client/ClientError.js +2 -1
- package/dist/client/RESTClient.d.ts +18 -5
- package/dist/client/RESTClient.js +194 -52
- package/dist/client/RESTClientError.d.ts +1 -2
- package/dist/client/RESTClientError.js +3 -2
- package/dist/client/RFCClient.d.ts +28 -7
- package/dist/client/RFCClient.js +325 -77
- package/dist/client/RFCClientError.d.ts +1 -1
- package/dist/client/RFCClientError.js +2 -2
- package/dist/client/TransportEntries.d.ts +8 -0
- package/dist/client/TransportEntries.js +2 -0
- package/dist/client/components/BORM_ID.d.ts +1 -0
- package/dist/client/components/BORM_ID.js +2 -0
- package/dist/client/components/BORM_NAME.d.ts +1 -0
- package/dist/client/components/BORM_NAME.js +2 -0
- package/dist/client/components/BORM_NAMEL.d.ts +1 -0
- package/dist/client/components/BORM_NAMEL.js +2 -0
- package/dist/client/components/BORM_VEND.d.ts +1 -0
- package/dist/client/components/BORM_VEND.js +2 -0
- package/dist/client/components/BORM_VERS.d.ts +1 -0
- package/dist/client/components/BORM_VERS.js +2 -0
- package/dist/client/components/CWBNTNUMM.d.ts +1 -0
- package/dist/client/components/CWBNTNUMM.js +2 -0
- package/dist/client/components/CWBNTSTAT.d.ts +1 -0
- package/dist/client/components/CWBNTSTAT.js +2 -0
- package/dist/client/components/CWBNTVERS.d.ts +1 -0
- package/dist/client/components/CWBNTVERS.js +2 -0
- package/dist/client/components/CWBPRSTAT.d.ts +1 -0
- package/dist/client/components/CWBPRSTAT.js +2 -0
- package/dist/client/components/INSTSTATE.d.ts +1 -0
- package/dist/client/components/INSTSTATE.js +2 -0
- package/dist/client/components/RELC_TYPE.d.ts +1 -0
- package/dist/client/components/RELC_TYPE.js +2 -0
- package/dist/client/components/SAPPATCHLV.d.ts +1 -0
- package/dist/client/components/SAPPATCHLV.js +2 -0
- package/dist/client/components/SAPRELEASE.d.ts +1 -0
- package/dist/client/components/SAPRELEASE.js +2 -0
- package/dist/client/components/SYSYSID.d.ts +1 -0
- package/dist/client/components/SYSYSID.js +2 -0
- package/dist/client/components/ZTRM_INSTALLTR_TYPE.d.ts +1 -0
- package/dist/client/components/ZTRM_INSTALLTR_TYPE.js +2 -0
- package/dist/client/components/index.d.ts +15 -0
- package/dist/client/components/index.js +15 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/messageLog.d.ts +7 -0
- package/dist/client/messageLog.js +21 -0
- package/dist/client/struct/ActionLockKey.d.ts +6 -0
- package/dist/client/struct/ActionLockKey.js +2 -0
- package/dist/client/struct/CVERS.d.ts +7 -0
- package/dist/client/struct/CVERS.js +2 -0
- package/dist/client/struct/CWBNTCUST.d.ts +6 -0
- package/dist/client/struct/CWBNTCUST.js +2 -0
- package/dist/client/struct/CWBNTHEAD.d.ts +5 -0
- package/dist/client/struct/CWBNTHEAD.js +2 -0
- package/dist/client/struct/E070.d.ts +2 -1
- package/dist/client/struct/E071K.d.ts +9 -0
- package/dist/client/struct/E071K.js +2 -0
- package/dist/client/struct/PRDVERS.d.ts +9 -0
- package/dist/client/struct/PRDVERS.js +2 -0
- package/dist/client/struct/SCOMPKDTLN.d.ts +21 -0
- package/dist/client/struct/STMSCALERT.d.ts +21 -0
- package/dist/client/struct/STMSCALERT.js +2 -0
- package/dist/client/struct/STMS_TP_IMPORT.d.ts +14 -0
- package/dist/client/struct/STMS_TP_IMPORT.js +2 -0
- package/dist/client/struct/STMS_TR_REQUEST.d.ts +8 -0
- package/dist/client/struct/STMS_TR_REQUEST.js +2 -0
- package/dist/client/struct/TDEVC.d.ts +38 -0
- package/dist/client/struct/TPLOGPTR.d.ts +13 -0
- package/dist/client/struct/TPLOGPTR.js +2 -0
- package/dist/client/struct/TPSTDOUT.d.ts +3 -0
- package/dist/client/struct/TPSTDOUT.js +2 -0
- package/dist/client/struct/ZTRM_INSTALLTR.d.ts +8 -0
- package/dist/client/struct/ZTRM_INSTALLTR.js +2 -0
- package/dist/client/struct/index.d.ts +12 -0
- package/dist/client/struct/index.js +12 -0
- package/dist/commons/checkCoreTrmDependencies.js +1 -1
- package/dist/commons/getAxiosInstance.js +8 -17
- package/dist/commons/getNodePackage.js +7 -0
- package/dist/commons/getPackageHierarchy.js +2 -0
- package/dist/commons/getPackagesNamespace.d.ts +9 -0
- package/dist/commons/getPackagesNamespace.js +19 -0
- package/dist/commons/index.d.ts +4 -0
- package/dist/commons/index.js +4 -0
- package/dist/commons/packageDataFromTdevc.d.ts +12 -0
- package/dist/commons/packageDataFromTdevc.js +25 -0
- package/dist/commons/resolveCoreVersion.d.ts +10 -0
- package/dist/commons/resolveCoreVersion.js +24 -0
- package/dist/commons/summarizeForLog.d.ts +22 -0
- package/dist/commons/summarizeForLog.js +120 -0
- package/dist/connection/OpenRFCConnect.d.ts +13 -0
- package/dist/connection/OpenRFCConnect.js +23 -0
- package/dist/connection/index.d.ts +1 -0
- package/dist/connection/index.js +17 -0
- package/dist/dependencies/PackageDependencies.d.ts +2 -0
- package/dist/dependencies/PackageDependencies.js +24 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lockfile/Lockfile.d.ts +23 -1
- package/dist/lockfile/Lockfile.js +45 -9
- package/dist/manifest/Manifest.d.ts +9 -5
- package/dist/manifest/Manifest.js +82 -29
- package/dist/manifest/PostActivity.js +3 -3
- package/dist/manifest/TrmManifest.d.ts +0 -2
- package/dist/manifest/TrmManifestBase.d.ts +2 -0
- package/dist/manifest/TrmManifestEngines.d.ts +64 -0
- package/dist/manifest/TrmManifestEngines.js +2 -0
- package/dist/manifest/engines/index.d.ts +2 -0
- package/dist/manifest/engines/index.js +18 -0
- package/dist/manifest/engines/sapRange.d.ts +38 -0
- package/dist/manifest/engines/sapRange.js +135 -0
- package/dist/manifest/engines/validateEngines.d.ts +44 -0
- package/dist/manifest/engines/validateEngines.js +282 -0
- package/dist/manifest/index.d.ts +3 -0
- package/dist/manifest/index.js +3 -0
- package/dist/manifest/sapEntries.d.ts +14 -0
- package/dist/manifest/sapEntries.js +63 -0
- package/dist/protocol/Protocol.js +7 -0
- package/dist/registry/AbstractRegistry.d.ts +18 -3
- package/dist/registry/FileSystem.d.ts +22 -13
- package/dist/registry/FileSystem.js +69 -18
- package/dist/registry/RegistryDeletionTransportUnauthorizedError.d.ts +4 -0
- package/dist/registry/RegistryDeletionTransportUnauthorizedError.js +12 -0
- package/dist/registry/RegistryDeletionTransportUnavailableError.d.ts +9 -0
- package/dist/registry/RegistryDeletionTransportUnavailableError.js +17 -0
- package/dist/registry/RegistryPackageNotFoundError.d.ts +7 -0
- package/dist/registry/RegistryPackageNotFoundError.js +14 -0
- package/dist/registry/RegistryV2.d.ts +15 -5
- package/dist/registry/RegistryV2.js +308 -48
- package/dist/registry/index.d.ts +4 -0
- package/dist/registry/index.js +4 -0
- package/dist/registry/registryKey.d.ts +7 -0
- package/dist/registry/registryKey.js +21 -0
- package/dist/systemConnector/ActionLock.d.ts +1 -0
- package/dist/systemConnector/ActionLock.js +2 -0
- package/dist/systemConnector/ISystemConnector.d.ts +21 -4
- package/dist/systemConnector/ISystemConnectorBase.d.ts +16 -0
- package/dist/systemConnector/InstallTransport.d.ts +6 -0
- package/dist/systemConnector/InstallTransport.js +2 -0
- package/dist/systemConnector/OpenRFCSystemConnector.d.ts +12 -0
- package/dist/systemConnector/OpenRFCSystemConnector.js +51 -0
- package/dist/systemConnector/RESTSystemConnector.d.ts +22 -7
- package/dist/systemConnector/RESTSystemConnector.js +95 -23
- package/dist/systemConnector/RFCConnection.d.ts +0 -1
- package/dist/systemConnector/RFCSystemConnector.d.ts +25 -7
- package/dist/systemConnector/RFCSystemConnector.js +75 -16
- package/dist/systemConnector/SystemConnector.d.ts +38 -6
- package/dist/systemConnector/SystemConnector.js +138 -12
- package/dist/systemConnector/SystemConnectorBase.d.ts +24 -1
- package/dist/systemConnector/SystemConnectorBase.js +174 -22
- package/dist/systemConnector/index.d.ts +3 -0
- package/dist/systemConnector/index.js +3 -0
- package/dist/transport/E071KOwner.d.ts +10 -0
- package/dist/transport/E071KOwner.js +15 -0
- package/dist/transport/R3transLogParser.d.ts +19 -0
- package/dist/transport/R3transLogParser.js +148 -0
- package/dist/transport/Transport.d.ts +36 -3
- package/dist/transport/Transport.js +304 -138
- package/dist/transport/index.d.ts +2 -0
- package/dist/transport/index.js +2 -0
- package/dist/trmPackage/TransportBinary.d.ts +4 -1
- package/dist/trmPackage/TrmArtifact.d.ts +12 -8
- package/dist/trmPackage/TrmArtifact.js +93 -74
- package/dist/trmPackage/TrmPackage.d.ts +20 -6
- package/dist/trmPackage/TrmPackage.js +27 -1
- package/dist/validators/validateDevclass.js +4 -0
- package/package.json +15 -7
- package/dist/actions/commons/trmServerPa.d.ts +0 -3
- package/dist/actions/commons/trmServerPa.js +0 -40
- package/dist/actions/install/checkAlreadyInstalled.d.ts +0 -3
- package/dist/actions/install/checkAlreadyInstalled.js +0 -71
- package/dist/actions/install/checkObjectTypes.d.ts +0 -3
- package/dist/actions/install/checkObjectTypes.js +0 -50
- package/dist/actions/install/checkObjectsLock.d.ts +0 -3
- package/dist/actions/install/checkObjectsLock.js +0 -52
- package/dist/actions/install/generateInstallTransports.d.ts +0 -3
- package/dist/actions/install/generateInstallTransports.js +0 -128
- package/dist/actions/install/importCustTransport.d.ts +0 -3
- package/dist/actions/install/importCustTransport.js +0 -73
- package/dist/actions/install/importDevcTransport.d.ts +0 -3
- package/dist/actions/install/importDevcTransport.js +0 -93
- package/dist/actions/install/importLangTransport.d.ts +0 -3
- package/dist/actions/install/importLangTransport.js +0 -72
- package/dist/actions/install/importTadirTransport.d.ts +0 -3
- package/dist/actions/install/importTadirTransport.js +0 -83
- package/dist/actions/install/readDevc.d.ts +0 -3
- package/dist/actions/install/readDevc.js +0 -33
- package/dist/actions/install/readTadir.d.ts +0 -3
- package/dist/actions/install/readTadir.js +0 -101
- package/dist/actions/install/refreshTmsTxt.d.ts +0 -3
- package/dist/actions/install/releaseInstallTransport.d.ts +0 -3
- package/dist/actions/install/releaseInstallTransport.js +0 -80
- package/dist/actions/publish/checkAllObjectsReleased.d.ts +0 -3
- package/dist/actions/publish/checkAllObjectsReleased.js +0 -46
- package/dist/actions/publish/getSourceCode.d.ts +0 -3
- package/dist/actions/publish/getSourceCode.js +0 -49
- package/dist/actions/publish/setChangelog.d.ts +0 -3
- package/dist/actions/publish/setChangelog.js +0 -69
- package/dist/actions/publish/setDevclass.d.ts +0 -3
- package/dist/actions/publish/setDevclass.js +0 -74
- package/dist/actions/publish/setReadme.d.ts +0 -3
- package/dist/actions/publish/setReadme.js +0 -52
- package/dist/actions/publish/setTransportTarget.d.ts +0 -3
|
@@ -49,6 +49,8 @@ const xmldom_1 = require("@xmldom/xmldom");
|
|
|
49
49
|
const lodash_1 = __importDefault(require("lodash"));
|
|
50
50
|
const xml_beautify_1 = __importDefault(require("xml-beautify"));
|
|
51
51
|
const trm_commons_1 = require("trm-commons");
|
|
52
|
+
const engines_1 = require("./engines");
|
|
53
|
+
const sapEntries_1 = require("./sapEntries");
|
|
52
54
|
function getManifestAuthor(sAuthor) {
|
|
53
55
|
var author = {};
|
|
54
56
|
const emailRegex = new RegExp("<([^>]*)>");
|
|
@@ -65,8 +67,8 @@ class Manifest {
|
|
|
65
67
|
this._manifest = _manifest;
|
|
66
68
|
this._filePath = _filePath;
|
|
67
69
|
}
|
|
68
|
-
get(
|
|
69
|
-
return Manifest.normalize(this._manifest
|
|
70
|
+
get() {
|
|
71
|
+
return Manifest.normalize(this._manifest);
|
|
70
72
|
}
|
|
71
73
|
getKey(keepVersion = true) {
|
|
72
74
|
const manifest = this.get();
|
|
@@ -81,13 +83,6 @@ class Manifest {
|
|
|
81
83
|
this._manifest.srcFolder = src;
|
|
82
84
|
return this;
|
|
83
85
|
}
|
|
84
|
-
setLinkedTransport(transport) {
|
|
85
|
-
this._manifest.linkedTransport = transport;
|
|
86
|
-
return this;
|
|
87
|
-
}
|
|
88
|
-
getLinkedTransport() {
|
|
89
|
-
return this._manifest.linkedTransport;
|
|
90
|
-
}
|
|
91
86
|
setRegistryEndpoint(endpoint) {
|
|
92
87
|
this._manifest.registry = endpoint;
|
|
93
88
|
}
|
|
@@ -108,10 +103,11 @@ class Manifest {
|
|
|
108
103
|
"authors",
|
|
109
104
|
"keywords",
|
|
110
105
|
"dependencies",
|
|
106
|
+
"engines",
|
|
111
107
|
"sapEntries",
|
|
112
108
|
"postActivities"
|
|
113
109
|
];
|
|
114
|
-
var obj = this.get(
|
|
110
|
+
var obj = this.get();
|
|
115
111
|
ignoredKeys.forEach(k => {
|
|
116
112
|
delete obj[k];
|
|
117
113
|
});
|
|
@@ -282,6 +278,36 @@ class Manifest {
|
|
|
282
278
|
};
|
|
283
279
|
}
|
|
284
280
|
}
|
|
281
|
+
/*if (manifest.sapEntries) {
|
|
282
|
+
var sapEntries = [];
|
|
283
|
+
Object.keys(manifest.sapEntries).forEach(table => {
|
|
284
|
+
try {
|
|
285
|
+
var tableItems = [];
|
|
286
|
+
manifest.sapEntries[table].forEach(r => {
|
|
287
|
+
var record = {};
|
|
288
|
+
Object.keys(r).forEach(k => {
|
|
289
|
+
record[k] = {
|
|
290
|
+
"_text": r[k]
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
if (Object.keys(record).length > 0) {
|
|
294
|
+
tableItems.push(record);
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
sapEntries.push({
|
|
298
|
+
"TABLE": table,
|
|
299
|
+
"ENTRIES": {
|
|
300
|
+
"item": tableItems
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
} catch (e) { }
|
|
304
|
+
});
|
|
305
|
+
if (sapEntries.length > 0) {
|
|
306
|
+
oAbapXml['asx:abap']['asx:values']['TRM_MANIFEST']['SAP_ENTRIES'] = {
|
|
307
|
+
"item": sapEntries
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}*/
|
|
285
311
|
if (manifest.postActivities) {
|
|
286
312
|
var postActivities = [];
|
|
287
313
|
manifest.postActivities.forEach(pa => {
|
|
@@ -312,19 +338,34 @@ class Manifest {
|
|
|
312
338
|
};
|
|
313
339
|
}
|
|
314
340
|
}
|
|
341
|
+
if (manifest.engines) {
|
|
342
|
+
oAbapXml['asx:abap']['asx:values']['TRM_MANIFEST']['ENGINES'] = {
|
|
343
|
+
//escape xml special characters as json unicode escapes, JSON.parse restores them
|
|
344
|
+
"_text": JSON.stringify(manifest.engines).replace(/&/g, '\\u0026').replace(/</g, '\\u003c').replace(/>/g, '\\u003e')
|
|
345
|
+
};
|
|
346
|
+
}
|
|
315
347
|
const sXml = xml.js2xml(oAbapXml, { compact: true });
|
|
316
348
|
return sXml ? new xml_beautify_1.default({ useSelfClosingElement: true, parser: xmldom_1.DOMParser }).beautify(sXml) : null;
|
|
317
349
|
}
|
|
318
350
|
getPackage() {
|
|
319
|
-
const manifest = this.get(
|
|
351
|
+
const manifest = this.get();
|
|
320
352
|
const registry = registry_1.RegistryProvider.getRegistry(manifest.registry, this._filePath);
|
|
321
353
|
return new trmPackage_1.TrmPackage(manifest.name, registry, this);
|
|
322
354
|
}
|
|
323
|
-
|
|
355
|
+
/**
|
|
356
|
+
* Checks whether a dependency version is an acceptable semantic-version range.
|
|
357
|
+
*
|
|
358
|
+
* Stricter than `semver.validRange`: an empty or blank range (which semver reads as `*`)
|
|
359
|
+
* is rejected, so every dependency must declare an explicit range.
|
|
360
|
+
*/
|
|
361
|
+
static isValidDependencyRange(range) {
|
|
362
|
+
return typeof range === 'string' && range.trim().length > 0 && semver.validRange(range) !== null;
|
|
363
|
+
}
|
|
364
|
+
static normalize(manifest) {
|
|
365
|
+
//this function is also used for method get()
|
|
366
|
+
//only keys will throw error
|
|
367
|
+
//always check if property has value
|
|
324
368
|
var manifestClone = lodash_1.default.cloneDeep(manifest);
|
|
325
|
-
if (!keepRuntimeValues) {
|
|
326
|
-
delete manifestClone.linkedTransport;
|
|
327
|
-
}
|
|
328
369
|
if (!manifestClone.name) {
|
|
329
370
|
throw new Error('Package name missing.');
|
|
330
371
|
}
|
|
@@ -520,17 +561,21 @@ class Manifest {
|
|
|
520
561
|
delete manifestClone.sapEntries;
|
|
521
562
|
}
|
|
522
563
|
else {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
}
|
|
527
|
-
for (const item of manifestClone.sapEntries[key]) {
|
|
528
|
-
if (typeof item !== 'object' || item === null) {
|
|
529
|
-
throw new Error(`Invalid structure in SAP entries declaration.`);
|
|
530
|
-
}
|
|
531
|
-
}
|
|
564
|
+
const sapEntriesErrors = (0, sapEntries_1.validateSapEntries)(manifestClone.sapEntries);
|
|
565
|
+
if (sapEntriesErrors.length > 0) {
|
|
566
|
+
throw new Error(`Invalid SAP entries declaration: ${sapEntriesErrors[0]}`);
|
|
532
567
|
}
|
|
533
568
|
}
|
|
569
|
+
if (!manifestClone.engines || typeof manifestClone.engines !== 'object' || Object.keys(manifestClone.engines).length === 0) {
|
|
570
|
+
delete manifestClone.engines;
|
|
571
|
+
}
|
|
572
|
+
else {
|
|
573
|
+
const enginesErrors = (0, engines_1.validateEngines)(manifestClone.engines);
|
|
574
|
+
if (enginesErrors.length > 0) {
|
|
575
|
+
throw new Error(`Invalid engines declaration: ${enginesErrors[0]}`);
|
|
576
|
+
}
|
|
577
|
+
manifestClone.engines = (0, engines_1.normalizeEngines)(manifestClone.engines);
|
|
578
|
+
}
|
|
534
579
|
if (manifestClone.distFolder) {
|
|
535
580
|
try {
|
|
536
581
|
manifestClone.distFolder = manifestClone.distFolder.replace(/^\//, '');
|
|
@@ -602,9 +647,9 @@ class Manifest {
|
|
|
602
647
|
manifest = {
|
|
603
648
|
name: oAbapManifest.name.text,
|
|
604
649
|
version: oAbapManifest.version.text,
|
|
605
|
-
backwardsCompatible: false,
|
|
606
|
-
private: false,
|
|
607
|
-
registry: registry_1.PUBLIC_RESERVED_KEYWORD
|
|
650
|
+
backwardsCompatible: false, //default overwitten later
|
|
651
|
+
private: false, //default overwitten later,
|
|
652
|
+
registry: registry_1.PUBLIC_RESERVED_KEYWORD //default overwritten later
|
|
608
653
|
};
|
|
609
654
|
}
|
|
610
655
|
catch (e) {
|
|
@@ -710,6 +755,14 @@ class Manifest {
|
|
|
710
755
|
}];
|
|
711
756
|
}
|
|
712
757
|
}
|
|
758
|
+
if (oAbapManifest.engines && oAbapManifest.engines.text) {
|
|
759
|
+
try {
|
|
760
|
+
manifest.engines = JSON.parse(oAbapManifest.engines.text);
|
|
761
|
+
}
|
|
762
|
+
catch (e) {
|
|
763
|
+
trm_commons_1.Logger.error(`Couldn't parse engines in abap xml manifest`, true);
|
|
764
|
+
}
|
|
765
|
+
}
|
|
713
766
|
if (sapEntries && sapEntries.item) {
|
|
714
767
|
manifest.sapEntries = {};
|
|
715
768
|
try {
|
|
@@ -730,7 +783,7 @@ class Manifest {
|
|
|
730
783
|
}
|
|
731
784
|
catch (e) { }
|
|
732
785
|
}
|
|
733
|
-
return new Manifest(Manifest.normalize(manifest
|
|
786
|
+
return new Manifest(Manifest.normalize(manifest));
|
|
734
787
|
}
|
|
735
788
|
static _parseAbapXmlSapEntriesArray(input) {
|
|
736
789
|
var array = [];
|
|
@@ -756,7 +809,7 @@ class Manifest {
|
|
|
756
809
|
return array;
|
|
757
810
|
}
|
|
758
811
|
static fromJson(sJson) {
|
|
759
|
-
return new Manifest(Manifest.normalize(JSON.parse(sJson)
|
|
812
|
+
return new Manifest(Manifest.normalize(JSON.parse(sJson)));
|
|
760
813
|
}
|
|
761
814
|
static compare(o1, o2, checkVersion = false) {
|
|
762
815
|
const s1 = o1.getKey(checkVersion);
|
|
@@ -58,7 +58,7 @@ class PostActivity {
|
|
|
58
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
59
|
const data = Buffer.from(this._xml, 'utf8');
|
|
60
60
|
trm_commons_1.Logger.loading(`Post activity: ${this.data.name}`, silent);
|
|
61
|
-
if (!PostActivity.exists(this.data.name)) {
|
|
61
|
+
if (!(yield PostActivity.exists(this.data.name))) {
|
|
62
62
|
throw new Error(`Class "${this.data.name}" doesn't exist.`);
|
|
63
63
|
}
|
|
64
64
|
const description = yield this.getDescription();
|
|
@@ -112,7 +112,7 @@ class PostActivity {
|
|
|
112
112
|
v3: message.msgv3,
|
|
113
113
|
v4: message.msgv4,
|
|
114
114
|
});
|
|
115
|
-
trm_commons_1.Logger.msgty(message.msgty, parsedMessage, silent);
|
|
115
|
+
trm_commons_1.Logger.msgty(message.msgty, parsedMessage, { debug: silent, important: ['A', 'E', 'W'].includes(message.msgty) });
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
}
|
|
@@ -159,7 +159,7 @@ class PostActivity {
|
|
|
159
159
|
}
|
|
160
160
|
static exists(className) {
|
|
161
161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
-
const classObject = systemConnector_1.SystemConnector.getObject('R3TR', 'CLAS', className.trim().toUpperCase());
|
|
162
|
+
const classObject = yield systemConnector_1.SystemConnector.getObject('R3TR', 'CLAS', className.trim().toUpperCase());
|
|
163
163
|
return classObject ? true : false;
|
|
164
164
|
});
|
|
165
165
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Transport } from "../transport";
|
|
2
1
|
import { TrmManifestBase } from "./TrmManifestBase";
|
|
3
2
|
import { TrmManifestNamespace } from "./TrmManifestNamespace";
|
|
4
3
|
export interface TrmManifest extends TrmManifestBase {
|
|
@@ -6,7 +5,6 @@ export interface TrmManifest extends TrmManifestBase {
|
|
|
6
5
|
version: string;
|
|
7
6
|
private?: boolean;
|
|
8
7
|
registry?: string;
|
|
9
|
-
linkedTransport?: Transport;
|
|
10
8
|
distFolder?: string;
|
|
11
9
|
srcFolder?: string;
|
|
12
10
|
namespace?: TrmManifestNamespace;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TrmManifestAuthor } from "./TrmManifestAuthor";
|
|
2
2
|
import { TrmManifestDependency } from "./TrmManifestDependency";
|
|
3
|
+
import { TrmManifestEngines } from "./TrmManifestEngines";
|
|
3
4
|
import { TrmManifestPostActivity } from "./TrmManifestPostActivity";
|
|
4
5
|
export interface TrmManifestBase {
|
|
5
6
|
backwardsCompatible?: boolean;
|
|
@@ -12,4 +13,5 @@ export interface TrmManifestBase {
|
|
|
12
13
|
dependencies?: TrmManifestDependency[];
|
|
13
14
|
sapEntries?: any;
|
|
14
15
|
postActivities?: TrmManifestPostActivity[];
|
|
16
|
+
engines?: TrmManifestEngines;
|
|
15
17
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Software component constraint (table CVERS).
|
|
3
|
+
* - `true`: component must be installed
|
|
4
|
+
* - `false`: component must NOT be installed
|
|
5
|
+
* - object: component must be installed and match release/sp ranges
|
|
6
|
+
* - array: at least one of the constraints must match
|
|
7
|
+
*/
|
|
8
|
+
export type TrmManifestEngineComponentConstraint = {
|
|
9
|
+
release?: string;
|
|
10
|
+
sp?: string;
|
|
11
|
+
};
|
|
12
|
+
export type TrmManifestEngineComponent = boolean | TrmManifestEngineComponentConstraint | TrmManifestEngineComponentConstraint[];
|
|
13
|
+
/**
|
|
14
|
+
* Product constraint (table PRDVERS, installed versions only).
|
|
15
|
+
*/
|
|
16
|
+
export type TrmManifestEngineProductConstraint = {
|
|
17
|
+
version?: string;
|
|
18
|
+
};
|
|
19
|
+
export type TrmManifestEngineProduct = boolean | TrmManifestEngineProductConstraint | TrmManifestEngineProductConstraint[];
|
|
20
|
+
/**
|
|
21
|
+
* SAP Note constraint (tables CWBNTCUST/CWBNTHEAD).
|
|
22
|
+
* - `true`: note must be completely implemented
|
|
23
|
+
* - object: note must be completely implemented with a version matching the range
|
|
24
|
+
*/
|
|
25
|
+
export type TrmManifestEngineNoteConstraint = {
|
|
26
|
+
version?: string;
|
|
27
|
+
};
|
|
28
|
+
export type TrmManifestEngineNote = true | TrmManifestEngineNoteConstraint;
|
|
29
|
+
export type TrmManifestEngineTableOperator = 'EQ' | 'NE' | 'LT' | 'LE' | 'GT' | 'GE' | 'LIKE';
|
|
30
|
+
export type TrmManifestEngineTableCondition = {
|
|
31
|
+
field: string;
|
|
32
|
+
op?: TrmManifestEngineTableOperator;
|
|
33
|
+
value: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Table check: at least one row matching all conditions must exist.
|
|
37
|
+
*/
|
|
38
|
+
export type TrmManifestEngineTableCheck = {
|
|
39
|
+
table: string;
|
|
40
|
+
where: TrmManifestEngineTableCondition[];
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* TRM constraint: semver range of a TRM package.
|
|
44
|
+
* - `trm-core`: version of the trm-core running the install
|
|
45
|
+
* - `trm-server`: version of trm-server installed on the system
|
|
46
|
+
*/
|
|
47
|
+
export type TrmManifestEngineTrm = {
|
|
48
|
+
'trm-core'?: string;
|
|
49
|
+
'trm-server'?: string;
|
|
50
|
+
};
|
|
51
|
+
export type TrmManifestEngines = {
|
|
52
|
+
trm?: TrmManifestEngineTrm;
|
|
53
|
+
components?: {
|
|
54
|
+
[component: string]: TrmManifestEngineComponent;
|
|
55
|
+
};
|
|
56
|
+
products?: {
|
|
57
|
+
[product: string]: TrmManifestEngineProduct;
|
|
58
|
+
};
|
|
59
|
+
notes?: {
|
|
60
|
+
[note: string]: TrmManifestEngineNote;
|
|
61
|
+
};
|
|
62
|
+
tables?: TrmManifestEngineTableCheck[];
|
|
63
|
+
anyOf?: TrmManifestEngines[];
|
|
64
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./sapRange"), exports);
|
|
18
|
+
__exportStar(require("./validateEngines"), exports);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SAP-aware version ranges, used by manifest engines.
|
|
3
|
+
*
|
|
4
|
+
* Syntax (semver-like):
|
|
5
|
+
* - comparator: `>=`, `>`, `<=`, `<`, `=` or none (exact match), followed by a value
|
|
6
|
+
* - comparators separated by whitespace must all match (AND)
|
|
7
|
+
* - comparator sets separated by `||` are alternatives (OR)
|
|
8
|
+
*
|
|
9
|
+
* Comparison modes:
|
|
10
|
+
* - `release`: software component release (e.g. `758`, `75I`, `2020`). Numeric when both values
|
|
11
|
+
* are digits only, otherwise character-wise (0-9 < A-Z) when both values have the same length.
|
|
12
|
+
* Values that can't be compared never satisfy the comparator.
|
|
13
|
+
* - `version`: dotted numeric version (e.g. product version `7.52`, `2023`)
|
|
14
|
+
* - `number`: integer (e.g. support package level, SAP Note version)
|
|
15
|
+
*/
|
|
16
|
+
export type SapRangeMode = 'release' | 'version' | 'number';
|
|
17
|
+
/**
|
|
18
|
+
* Compares two values according to mode.
|
|
19
|
+
* Returns a negative number, zero or a positive number, or `undefined` when values can't be compared.
|
|
20
|
+
*/
|
|
21
|
+
export declare function compareSapValues(a: string, b: string, mode: SapRangeMode): number | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Normalizes a value read from the system (e.g. CVERS-EXTRELEASE `0000000002`) or declared in a range.
|
|
24
|
+
* Returns `undefined` when the value is not valid for mode.
|
|
25
|
+
*/
|
|
26
|
+
export declare function normalizeSapValue(value: string | number, mode: SapRangeMode): string | undefined;
|
|
27
|
+
export declare function validSapRange(range: string, mode: SapRangeMode): boolean;
|
|
28
|
+
export declare function satisfiesSapRange(value: string | number, range: string, mode: SapRangeMode): boolean;
|
|
29
|
+
export type SapSupportPackage = {
|
|
30
|
+
release: string;
|
|
31
|
+
sp: number;
|
|
32
|
+
component?: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Parses a support package name, e.g. `SAPK-75017INSAPUI` -> release `750`, sp `17`, component `SAPUI`.
|
|
36
|
+
* Also accepts the short form `SAPKB75017` (component not derivable).
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseSupportPackage(supportPackage: string): SapSupportPackage | undefined;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compareSapValues = compareSapValues;
|
|
4
|
+
exports.normalizeSapValue = normalizeSapValue;
|
|
5
|
+
exports.validSapRange = validSapRange;
|
|
6
|
+
exports.satisfiesSapRange = satisfiesSapRange;
|
|
7
|
+
exports.parseSupportPackage = parseSupportPackage;
|
|
8
|
+
const VALUE_PATTERNS = {
|
|
9
|
+
release: /^[0-9A-Z]+$/,
|
|
10
|
+
version: /^\d+(\.\d+)*$/,
|
|
11
|
+
number: /^\d+$/
|
|
12
|
+
};
|
|
13
|
+
const COMPARATOR_REGEX = /^(>=|<=|>|<|=)?(.+)$/;
|
|
14
|
+
function parseSapRange(range, mode) {
|
|
15
|
+
if (typeof range !== 'string') {
|
|
16
|
+
throw new Error(`Range must be a string.`);
|
|
17
|
+
}
|
|
18
|
+
const sets = range.split('||').map(set => {
|
|
19
|
+
//allow a space between operator and value (">= 750")
|
|
20
|
+
const tokens = set.trim().toUpperCase().replace(/(>=|<=|>|<|=)\s+/g, '$1').split(/\s+/).filter(t => t);
|
|
21
|
+
if (tokens.length === 0) {
|
|
22
|
+
throw new Error(`Empty comparator set in range "${range}".`);
|
|
23
|
+
}
|
|
24
|
+
return tokens.map(token => {
|
|
25
|
+
const match = COMPARATOR_REGEX.exec(token);
|
|
26
|
+
const value = match[2];
|
|
27
|
+
if (!VALUE_PATTERNS[mode].test(value)) {
|
|
28
|
+
throw new Error(`Invalid value "${value}" in range "${range}".`);
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
operator: (match[1] || '='),
|
|
32
|
+
value
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
return sets;
|
|
37
|
+
}
|
|
38
|
+
function compareVersion(a, b) {
|
|
39
|
+
const aParts = a.split('.').map(p => parseInt(p, 10));
|
|
40
|
+
const bParts = b.split('.').map(p => parseInt(p, 10));
|
|
41
|
+
const length = Math.max(aParts.length, bParts.length);
|
|
42
|
+
for (var i = 0; i < length; i++) {
|
|
43
|
+
const diff = (aParts[i] || 0) - (bParts[i] || 0);
|
|
44
|
+
if (diff !== 0) {
|
|
45
|
+
return diff;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Compares two values according to mode.
|
|
52
|
+
* Returns a negative number, zero or a positive number, or `undefined` when values can't be compared.
|
|
53
|
+
*/
|
|
54
|
+
function compareSapValues(a, b, mode) {
|
|
55
|
+
a = normalizeSapValue(a, mode);
|
|
56
|
+
b = normalizeSapValue(b, mode);
|
|
57
|
+
if (a === undefined || b === undefined) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
switch (mode) {
|
|
61
|
+
case 'number':
|
|
62
|
+
return parseInt(a, 10) - parseInt(b, 10);
|
|
63
|
+
case 'version':
|
|
64
|
+
return compareVersion(a, b);
|
|
65
|
+
case 'release':
|
|
66
|
+
if (/^\d+$/.test(a) && /^\d+$/.test(b)) {
|
|
67
|
+
return parseInt(a, 10) - parseInt(b, 10);
|
|
68
|
+
}
|
|
69
|
+
if (a.length !== b.length) {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Normalizes a value read from the system (e.g. CVERS-EXTRELEASE `0000000002`) or declared in a range.
|
|
77
|
+
* Returns `undefined` when the value is not valid for mode.
|
|
78
|
+
*/
|
|
79
|
+
function normalizeSapValue(value, mode) {
|
|
80
|
+
if (value === undefined || value === null) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
const sValue = value.toString().trim().toUpperCase();
|
|
84
|
+
if (!VALUE_PATTERNS[mode].test(sValue)) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
if (mode === 'number') {
|
|
88
|
+
return parseInt(sValue, 10).toString();
|
|
89
|
+
}
|
|
90
|
+
return sValue;
|
|
91
|
+
}
|
|
92
|
+
function validSapRange(range, mode) {
|
|
93
|
+
try {
|
|
94
|
+
parseSapRange(range, mode);
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
catch (e) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function satisfiesSapRange(value, range, mode) {
|
|
102
|
+
const sets = parseSapRange(range, mode);
|
|
103
|
+
const sValue = normalizeSapValue(value, mode);
|
|
104
|
+
if (sValue === undefined) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
return sets.some(set => set.every(comparator => {
|
|
108
|
+
const result = compareSapValues(sValue, comparator.value, mode);
|
|
109
|
+
if (result === undefined) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
switch (comparator.operator) {
|
|
113
|
+
case '>=': return result >= 0;
|
|
114
|
+
case '>': return result > 0;
|
|
115
|
+
case '<=': return result <= 0;
|
|
116
|
+
case '<': return result < 0;
|
|
117
|
+
case '=': return result === 0;
|
|
118
|
+
}
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Parses a support package name, e.g. `SAPK-75017INSAPUI` -> release `750`, sp `17`, component `SAPUI`.
|
|
123
|
+
* Also accepts the short form `SAPKB75017` (component not derivable).
|
|
124
|
+
*/
|
|
125
|
+
function parseSupportPackage(supportPackage) {
|
|
126
|
+
const match = /^SAPK[A-Z-]([0-9A-Z]{3})(\d{2})(?:IN([0-9A-Z_]+))?$/.exec((supportPackage || '').trim().toUpperCase());
|
|
127
|
+
if (!match) {
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
release: match[1],
|
|
132
|
+
sp: parseInt(match[2], 10),
|
|
133
|
+
component: match[3]
|
|
134
|
+
};
|
|
135
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TrmManifestEngines } from "../TrmManifestEngines";
|
|
2
|
+
import { SapRangeMode } from "./sapRange";
|
|
3
|
+
export declare const ENGINES_KEYS: readonly ["trm", "components", "products", "notes", "tables", "anyOf"];
|
|
4
|
+
export declare const ENGINES_TRM_PACKAGES: readonly ["trm-core", "trm-server"];
|
|
5
|
+
export declare const ENGINES_TABLE_OPERATORS: readonly ["EQ", "NE", "LT", "LE", "GT", "GE", "LIKE"];
|
|
6
|
+
export declare const ENGINES_MAX_ANYOF_DEPTH = 3;
|
|
7
|
+
export declare const COMPONENT_NAME_REGEX: RegExp;
|
|
8
|
+
export declare const PRODUCT_NAME_REGEX: RegExp;
|
|
9
|
+
export declare const NOTE_REGEX: RegExp;
|
|
10
|
+
export declare const TABLE_NAME_REGEX: RegExp;
|
|
11
|
+
export declare const FIELD_NAME_REGEX: RegExp;
|
|
12
|
+
export declare const ENGINES_COMPONENT_PROPS: {
|
|
13
|
+
[prop: string]: SapRangeMode;
|
|
14
|
+
};
|
|
15
|
+
export declare const ENGINES_PRODUCT_PROPS: {
|
|
16
|
+
[prop: string]: SapRangeMode;
|
|
17
|
+
};
|
|
18
|
+
export declare const ENGINES_NOTE_PROPS: {
|
|
19
|
+
[prop: string]: SapRangeMode;
|
|
20
|
+
};
|
|
21
|
+
export declare const ENGINES_TABLE_PROPS: readonly ["table", "where"];
|
|
22
|
+
export declare const ENGINES_TABLE_CONDITION_PROPS: readonly ["field", "op", "value"];
|
|
23
|
+
export declare const TABLE_VALUE_MAX_LENGTH = 32;
|
|
24
|
+
export declare const TABLE_VALUE_FORBIDDEN_REGEX: RegExp;
|
|
25
|
+
export type ValidateEnginesOptions = {
|
|
26
|
+
/**
|
|
27
|
+
* When true, unknown keys are reported as errors (use on publish).
|
|
28
|
+
* When false, unknown keys are ignored (forward compatibility).
|
|
29
|
+
*/
|
|
30
|
+
strict?: boolean;
|
|
31
|
+
};
|
|
32
|
+
export declare function normalizeEngineName(name: string): string;
|
|
33
|
+
export declare function normalizeNoteNumber(note: string | number): string;
|
|
34
|
+
export declare function validTrmRange(range: any): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Formally validates a manifest engines declaration.
|
|
37
|
+
* Returns the list of errors (empty when valid).
|
|
38
|
+
*/
|
|
39
|
+
export declare function validateEngines(engines: any, options?: ValidateEnginesOptions): string[];
|
|
40
|
+
/**
|
|
41
|
+
* Normalizes a (valid) engines declaration: uppercase names, note numbers without leading zeros,
|
|
42
|
+
* default table operator `EQ`. Unknown keys are kept untouched.
|
|
43
|
+
*/
|
|
44
|
+
export declare function normalizeEngines(engines: TrmManifestEngines): TrmManifestEngines;
|