trm-core 9.10.5 → 10.0.0
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 +3 -2
- 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 -56
- 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
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TABLE_VALUE_FORBIDDEN_REGEX = exports.TABLE_VALUE_MAX_LENGTH = exports.ENGINES_TABLE_CONDITION_PROPS = exports.ENGINES_TABLE_PROPS = exports.ENGINES_NOTE_PROPS = exports.ENGINES_PRODUCT_PROPS = exports.ENGINES_COMPONENT_PROPS = exports.FIELD_NAME_REGEX = exports.TABLE_NAME_REGEX = exports.NOTE_REGEX = exports.PRODUCT_NAME_REGEX = exports.COMPONENT_NAME_REGEX = exports.ENGINES_MAX_ANYOF_DEPTH = exports.ENGINES_TABLE_OPERATORS = exports.ENGINES_TRM_PACKAGES = exports.ENGINES_KEYS = void 0;
|
|
4
|
+
exports.normalizeEngineName = normalizeEngineName;
|
|
5
|
+
exports.normalizeNoteNumber = normalizeNoteNumber;
|
|
6
|
+
exports.validTrmRange = validTrmRange;
|
|
7
|
+
exports.validateEngines = validateEngines;
|
|
8
|
+
exports.normalizeEngines = normalizeEngines;
|
|
9
|
+
const sapRange_1 = require("./sapRange");
|
|
10
|
+
const semver_1 = require("semver");
|
|
11
|
+
exports.ENGINES_KEYS = ['trm', 'components', 'products', 'notes', 'tables', 'anyOf'];
|
|
12
|
+
//the only TRM packages an engines declaration can constrain
|
|
13
|
+
exports.ENGINES_TRM_PACKAGES = ['trm-core', 'trm-server'];
|
|
14
|
+
exports.ENGINES_TABLE_OPERATORS = ['EQ', 'NE', 'LT', 'LE', 'GT', 'GE', 'LIKE'];
|
|
15
|
+
exports.ENGINES_MAX_ANYOF_DEPTH = 3;
|
|
16
|
+
exports.COMPONENT_NAME_REGEX = /^[A-Z0-9_\/-]+$/;
|
|
17
|
+
exports.PRODUCT_NAME_REGEX = /^[A-Z0-9_\/\-. ]+$/;
|
|
18
|
+
exports.NOTE_REGEX = /^\d{1,10}$/;
|
|
19
|
+
exports.TABLE_NAME_REGEX = /^[A-Z0-9_\/]{1,30}$/;
|
|
20
|
+
exports.FIELD_NAME_REGEX = /^[A-Z0-9_\/]{1,30}$/;
|
|
21
|
+
//supported properties of each engine check, with the range mode of versioned properties
|
|
22
|
+
exports.ENGINES_COMPONENT_PROPS = { release: 'release', sp: 'number' };
|
|
23
|
+
exports.ENGINES_PRODUCT_PROPS = { version: 'version' };
|
|
24
|
+
exports.ENGINES_NOTE_PROPS = { version: 'number' };
|
|
25
|
+
exports.ENGINES_TABLE_PROPS = ['table', 'where'];
|
|
26
|
+
exports.ENGINES_TABLE_CONDITION_PROPS = ['field', 'op', 'value'];
|
|
27
|
+
//RFC_READ_TABLE option lines are limited to 72 characters (field + operator + quoted value)
|
|
28
|
+
exports.TABLE_VALUE_MAX_LENGTH = 32;
|
|
29
|
+
//read table options are split on AND/OR operators
|
|
30
|
+
exports.TABLE_VALUE_FORBIDDEN_REGEX = /\s(AND|OR)\s/i;
|
|
31
|
+
function isPlainObject(o) {
|
|
32
|
+
return typeof o === 'object' && o !== null && !Array.isArray(o);
|
|
33
|
+
}
|
|
34
|
+
function normalizeEngineName(name) {
|
|
35
|
+
return name.trim().toUpperCase().replace(/\s+/g, ' ');
|
|
36
|
+
}
|
|
37
|
+
function normalizeNoteNumber(note) {
|
|
38
|
+
return parseInt(note.toString().trim(), 10).toString();
|
|
39
|
+
}
|
|
40
|
+
function checkConstraint(errors, path, constraint, props, strict, expected) {
|
|
41
|
+
if (!isPlainObject(constraint)) {
|
|
42
|
+
errors.push(`${path}: expected ${expected}.`);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
Object.keys(constraint).forEach(prop => {
|
|
46
|
+
const mode = props[prop];
|
|
47
|
+
if (!mode) {
|
|
48
|
+
if (strict) {
|
|
49
|
+
errors.push(`${path}: unknown property "${prop}".`);
|
|
50
|
+
}
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (typeof constraint[prop] !== 'string' || !(0, sapRange_1.validSapRange)(constraint[prop], mode)) {
|
|
54
|
+
errors.push(`${path}.${prop}: invalid range "${constraint[prop]}".`);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//keys are case and whitespace (names) or leading-zero (notes) insensitive: two keys normalizing to the same value would collapse
|
|
59
|
+
function checkDuplicate(errors, path, seen, key, normalized) {
|
|
60
|
+
if (seen.has(normalized)) {
|
|
61
|
+
errors.push(`${path}: "${key}" duplicates "${seen.get(normalized)}".`);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
seen.set(normalized, key);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function checkVersionedMap(errors, path, map, nameRegex, props, allowFalse, strict) {
|
|
68
|
+
if (!isPlainObject(map)) {
|
|
69
|
+
errors.push(`${path}: expected an object.`);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const seen = new Map();
|
|
73
|
+
Object.keys(map).forEach(name => {
|
|
74
|
+
const itemPath = `${path}.${name}`;
|
|
75
|
+
if (!nameRegex.test(normalizeEngineName(name))) {
|
|
76
|
+
errors.push(`${itemPath}: invalid name.`);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
checkDuplicate(errors, path, seen, name, normalizeEngineName(name));
|
|
80
|
+
}
|
|
81
|
+
const value = map[name];
|
|
82
|
+
if (value === true || (value === false && allowFalse)) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (Array.isArray(value)) {
|
|
86
|
+
if (value.length === 0) {
|
|
87
|
+
errors.push(`${itemPath}: alternatives list is empty.`);
|
|
88
|
+
}
|
|
89
|
+
value.forEach((o, i) => checkConstraint(errors, `${itemPath}[${i}]`, o, props, strict, 'an object'));
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
checkConstraint(errors, itemPath, value, props, strict, `${allowFalse ? 'true, false' : 'true'}, an object or an array of objects`);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function checkNotes(errors, path, notes, strict) {
|
|
97
|
+
if (!isPlainObject(notes)) {
|
|
98
|
+
errors.push(`${path}: expected an object.`);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const seen = new Map();
|
|
102
|
+
Object.keys(notes).forEach(note => {
|
|
103
|
+
const itemPath = `${path}.${note}`;
|
|
104
|
+
if (!exports.NOTE_REGEX.test(note.trim()) || parseInt(note, 10) === 0) {
|
|
105
|
+
errors.push(`${itemPath}: invalid SAP Note number.`);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
checkDuplicate(errors, path, seen, note, normalizeNoteNumber(note));
|
|
109
|
+
}
|
|
110
|
+
const value = notes[note];
|
|
111
|
+
if (value === true) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
checkConstraint(errors, itemPath, value, exports.ENGINES_NOTE_PROPS, strict, 'true or an object');
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function validTrmRange(range) {
|
|
118
|
+
return typeof range === 'string' && range.trim().length > 0 && (0, semver_1.validRange)(range.trim()) !== null;
|
|
119
|
+
}
|
|
120
|
+
function checkTrm(errors, path, trm) {
|
|
121
|
+
if (!isPlainObject(trm) || Object.keys(trm).length === 0) {
|
|
122
|
+
errors.push(`${path}: expected an object with at least one of ${exports.ENGINES_TRM_PACKAGES.join(', ')}.`);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
Object.keys(trm).forEach(name => {
|
|
126
|
+
//unknown packages are errors even when not strict: these are the only packages that can be constrained
|
|
127
|
+
if (!exports.ENGINES_TRM_PACKAGES.includes(name)) {
|
|
128
|
+
errors.push(`${path}.${name}: unknown TRM package, expected one of ${exports.ENGINES_TRM_PACKAGES.join(', ')}.`);
|
|
129
|
+
}
|
|
130
|
+
else if (!validTrmRange(trm[name])) {
|
|
131
|
+
errors.push(`${path}.${name}: invalid range "${trm[name]}".`);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function checkTables(errors, path, tables, strict) {
|
|
136
|
+
if (!Array.isArray(tables)) {
|
|
137
|
+
errors.push(`${path}: expected an array.`);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
tables.forEach((check, i) => {
|
|
141
|
+
const itemPath = `${path}[${i}]`;
|
|
142
|
+
if (!isPlainObject(check)) {
|
|
143
|
+
errors.push(`${itemPath}: expected an object.`);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (strict) {
|
|
147
|
+
Object.keys(check).filter(k => !exports.ENGINES_TABLE_PROPS.includes(k)).forEach(k => errors.push(`${itemPath}: unknown property "${k}".`));
|
|
148
|
+
}
|
|
149
|
+
if (typeof check.table !== 'string' || !exports.TABLE_NAME_REGEX.test(check.table.trim().toUpperCase())) {
|
|
150
|
+
errors.push(`${itemPath}.table: invalid table name.`);
|
|
151
|
+
}
|
|
152
|
+
if (!Array.isArray(check.where) || check.where.length === 0) {
|
|
153
|
+
errors.push(`${itemPath}.where: expected a non-empty array of conditions.`);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
check.where.forEach((condition, j) => {
|
|
157
|
+
const conditionPath = `${itemPath}.where[${j}]`;
|
|
158
|
+
if (!isPlainObject(condition)) {
|
|
159
|
+
errors.push(`${conditionPath}: expected an object.`);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (strict) {
|
|
163
|
+
Object.keys(condition).filter(k => !exports.ENGINES_TABLE_CONDITION_PROPS.includes(k)).forEach(k => errors.push(`${conditionPath}: unknown property "${k}".`));
|
|
164
|
+
}
|
|
165
|
+
if (typeof condition.field !== 'string' || !exports.FIELD_NAME_REGEX.test(condition.field.trim().toUpperCase())) {
|
|
166
|
+
errors.push(`${conditionPath}.field: invalid field name.`);
|
|
167
|
+
}
|
|
168
|
+
if (condition.op !== undefined && (typeof condition.op !== 'string' || !exports.ENGINES_TABLE_OPERATORS.includes(condition.op.trim().toUpperCase()))) {
|
|
169
|
+
errors.push(`${conditionPath}.op: invalid operator "${condition.op}", expected one of ${exports.ENGINES_TABLE_OPERATORS.join(', ')}.`);
|
|
170
|
+
}
|
|
171
|
+
if ((typeof condition.value !== 'string' && typeof condition.value !== 'number') || condition.value.toString().length > exports.TABLE_VALUE_MAX_LENGTH) {
|
|
172
|
+
errors.push(`${conditionPath}.value: expected a string (max ${exports.TABLE_VALUE_MAX_LENGTH} characters).`);
|
|
173
|
+
}
|
|
174
|
+
else if (exports.TABLE_VALUE_FORBIDDEN_REGEX.test(condition.value.toString())) {
|
|
175
|
+
errors.push(`${conditionPath}.value: must not contain " AND " or " OR ".`);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function checkEngines(errors, path, engines, depth, strict) {
|
|
181
|
+
if (!isPlainObject(engines)) {
|
|
182
|
+
errors.push(`${path}: expected an object.`);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
Object.keys(engines).forEach(key => {
|
|
186
|
+
const keyPath = `${path}.${key}`;
|
|
187
|
+
switch (key) {
|
|
188
|
+
case 'trm':
|
|
189
|
+
checkTrm(errors, keyPath, engines.trm);
|
|
190
|
+
break;
|
|
191
|
+
case 'components':
|
|
192
|
+
checkVersionedMap(errors, keyPath, engines.components, exports.COMPONENT_NAME_REGEX, exports.ENGINES_COMPONENT_PROPS, true, strict);
|
|
193
|
+
break;
|
|
194
|
+
case 'products':
|
|
195
|
+
checkVersionedMap(errors, keyPath, engines.products, exports.PRODUCT_NAME_REGEX, exports.ENGINES_PRODUCT_PROPS, true, strict);
|
|
196
|
+
break;
|
|
197
|
+
case 'notes':
|
|
198
|
+
checkNotes(errors, keyPath, engines.notes, strict);
|
|
199
|
+
break;
|
|
200
|
+
case 'tables':
|
|
201
|
+
checkTables(errors, keyPath, engines.tables, strict);
|
|
202
|
+
break;
|
|
203
|
+
case 'anyOf':
|
|
204
|
+
if (depth >= exports.ENGINES_MAX_ANYOF_DEPTH) {
|
|
205
|
+
errors.push(`${keyPath}: maximum nesting depth (${exports.ENGINES_MAX_ANYOF_DEPTH}) exceeded.`);
|
|
206
|
+
}
|
|
207
|
+
else if (!Array.isArray(engines.anyOf) || engines.anyOf.length === 0) {
|
|
208
|
+
errors.push(`${keyPath}: expected a non-empty array.`);
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
engines.anyOf.forEach((o, i) => checkEngines(errors, `${keyPath}[${i}]`, o, depth + 1, strict));
|
|
212
|
+
}
|
|
213
|
+
break;
|
|
214
|
+
default:
|
|
215
|
+
if (strict) {
|
|
216
|
+
errors.push(`${keyPath}: unknown engine check.`);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Formally validates a manifest engines declaration.
|
|
223
|
+
* Returns the list of errors (empty when valid).
|
|
224
|
+
*/
|
|
225
|
+
function validateEngines(engines, options) {
|
|
226
|
+
const errors = [];
|
|
227
|
+
checkEngines(errors, 'engines', engines, 0, !!(options === null || options === void 0 ? void 0 : options.strict));
|
|
228
|
+
return errors;
|
|
229
|
+
}
|
|
230
|
+
function normalizeConstraint(constraint) {
|
|
231
|
+
if (typeof constraint === 'boolean') {
|
|
232
|
+
return constraint;
|
|
233
|
+
}
|
|
234
|
+
if (Array.isArray(constraint)) {
|
|
235
|
+
return constraint.map(normalizeConstraint);
|
|
236
|
+
}
|
|
237
|
+
const normalized = {};
|
|
238
|
+
Object.keys(constraint).forEach(prop => {
|
|
239
|
+
normalized[prop] = typeof constraint[prop] === 'string' ? constraint[prop].trim().toUpperCase() : constraint[prop];
|
|
240
|
+
});
|
|
241
|
+
return normalized;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Normalizes a (valid) engines declaration: uppercase names, note numbers without leading zeros,
|
|
245
|
+
* default table operator `EQ`. Unknown keys are kept untouched.
|
|
246
|
+
*/
|
|
247
|
+
function normalizeEngines(engines) {
|
|
248
|
+
const normalized = {};
|
|
249
|
+
Object.keys(engines).forEach(key => {
|
|
250
|
+
switch (key) {
|
|
251
|
+
case 'trm':
|
|
252
|
+
normalized.trm = {};
|
|
253
|
+
Object.keys(engines.trm).forEach(name => {
|
|
254
|
+
normalized.trm[name] = engines.trm[name].trim();
|
|
255
|
+
});
|
|
256
|
+
break;
|
|
257
|
+
case 'components':
|
|
258
|
+
case 'products':
|
|
259
|
+
normalized[key] = {};
|
|
260
|
+
Object.keys(engines[key]).forEach(name => {
|
|
261
|
+
normalized[key][normalizeEngineName(name)] = normalizeConstraint(engines[key][name]);
|
|
262
|
+
});
|
|
263
|
+
break;
|
|
264
|
+
case 'notes':
|
|
265
|
+
normalized.notes = {};
|
|
266
|
+
Object.keys(engines.notes).forEach(note => {
|
|
267
|
+
normalized.notes[normalizeNoteNumber(note)] = normalizeConstraint(engines.notes[note]);
|
|
268
|
+
});
|
|
269
|
+
break;
|
|
270
|
+
case 'tables':
|
|
271
|
+
//unknown properties are kept so the engines check can report them as unsupported
|
|
272
|
+
normalized.tables = engines.tables.map(check => (Object.assign(Object.assign({}, check), { table: check.table.trim().toUpperCase(), where: check.where.map(condition => (Object.assign(Object.assign({}, condition), { field: condition.field.trim().toUpperCase(), op: (condition.op || 'EQ').trim().toUpperCase(), value: condition.value.toString() }))) })));
|
|
273
|
+
break;
|
|
274
|
+
case 'anyOf':
|
|
275
|
+
normalized.anyOf = engines.anyOf.map(normalizeEngines);
|
|
276
|
+
break;
|
|
277
|
+
default:
|
|
278
|
+
normalized[key] = engines[key];
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
return normalized;
|
|
282
|
+
}
|
package/dist/manifest/index.d.ts
CHANGED
package/dist/manifest/index.js
CHANGED
|
@@ -22,3 +22,6 @@ __exportStar(require("./TrmManifestDependency"), exports);
|
|
|
22
22
|
__exportStar(require("./TrmManifestNamespace"), exports);
|
|
23
23
|
__exportStar(require("./TrmManifestPostActivity"), exports);
|
|
24
24
|
__exportStar(require("./PostActivity"), exports);
|
|
25
|
+
__exportStar(require("./TrmManifestEngines"), exports);
|
|
26
|
+
__exportStar(require("./engines"), exports);
|
|
27
|
+
__exportStar(require("./sapEntries"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const SAP_ENTRY_CONDITION_MAX_LENGTH = 72;
|
|
2
|
+
/**
|
|
3
|
+
* Builds the read-table conditions (`FIELD EQ 'value'`) identifying a required SAP entry.
|
|
4
|
+
*
|
|
5
|
+
* @throws When the entry is empty, a field name is invalid, a value is not a string or number,
|
|
6
|
+
* contains " AND " or " OR ", or its condition exceeds one option line.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getSapEntryConditions(sapEntry: any): string[];
|
|
9
|
+
/**
|
|
10
|
+
* Validates a manifest `sapEntries` map.
|
|
11
|
+
*
|
|
12
|
+
* @returns One message per invalid table name or entry; empty when the declaration is valid.
|
|
13
|
+
*/
|
|
14
|
+
export declare function validateSapEntries(sapEntries: any): string[];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SAP_ENTRY_CONDITION_MAX_LENGTH = void 0;
|
|
4
|
+
exports.getSapEntryConditions = getSapEntryConditions;
|
|
5
|
+
exports.validateSapEntries = validateSapEntries;
|
|
6
|
+
const engines_1 = require("./engines");
|
|
7
|
+
//RFC_READ_TABLE option lines are limited to 72 characters, and a single condition cannot be split
|
|
8
|
+
exports.SAP_ENTRY_CONDITION_MAX_LENGTH = 72;
|
|
9
|
+
/**
|
|
10
|
+
* Builds the read-table conditions (`FIELD EQ 'value'`) identifying a required SAP entry.
|
|
11
|
+
*
|
|
12
|
+
* @throws When the entry is empty, a field name is invalid, a value is not a string or number,
|
|
13
|
+
* contains " AND " or " OR ", or its condition exceeds one option line.
|
|
14
|
+
*/
|
|
15
|
+
function getSapEntryConditions(sapEntry) {
|
|
16
|
+
if (typeof sapEntry !== 'object' || sapEntry === null || Array.isArray(sapEntry) || Object.keys(sapEntry).length === 0) {
|
|
17
|
+
throw new Error(`SAP entry must be an object with at least one field.`);
|
|
18
|
+
}
|
|
19
|
+
return Object.keys(sapEntry).map(key => {
|
|
20
|
+
const field = key.trim().toUpperCase();
|
|
21
|
+
if (!engines_1.FIELD_NAME_REGEX.test(field)) {
|
|
22
|
+
throw new Error(`SAP entry field "${key}" is not a valid field name.`);
|
|
23
|
+
}
|
|
24
|
+
const value = sapEntry[key];
|
|
25
|
+
if (typeof value !== 'string' && typeof value !== 'number') {
|
|
26
|
+
throw new Error(`SAP entry field "${key}" must have a string or number value.`);
|
|
27
|
+
}
|
|
28
|
+
if (engines_1.TABLE_VALUE_FORBIDDEN_REGEX.test(value.toString())) {
|
|
29
|
+
throw new Error(`SAP entry field "${key}" value must not contain " AND " or " OR ".`);
|
|
30
|
+
}
|
|
31
|
+
const condition = `${field} EQ '${value.toString().replace(/'/g, "''")}'`;
|
|
32
|
+
if (condition.length > exports.SAP_ENTRY_CONDITION_MAX_LENGTH) {
|
|
33
|
+
throw new Error(`SAP entry field "${key}" value is too long (condition exceeds ${exports.SAP_ENTRY_CONDITION_MAX_LENGTH} characters).`);
|
|
34
|
+
}
|
|
35
|
+
return condition;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Validates a manifest `sapEntries` map.
|
|
40
|
+
*
|
|
41
|
+
* @returns One message per invalid table name or entry; empty when the declaration is valid.
|
|
42
|
+
*/
|
|
43
|
+
function validateSapEntries(sapEntries) {
|
|
44
|
+
const errors = [];
|
|
45
|
+
Object.keys(sapEntries).forEach(table => {
|
|
46
|
+
if (!engines_1.TABLE_NAME_REGEX.test(table.trim().toUpperCase())) {
|
|
47
|
+
errors.push(`sapEntries.${table}: invalid table name.`);
|
|
48
|
+
}
|
|
49
|
+
if (!Array.isArray(sapEntries[table])) {
|
|
50
|
+
errors.push(`sapEntries.${table}: expected an array.`);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
sapEntries[table].forEach((entry, i) => {
|
|
54
|
+
try {
|
|
55
|
+
getSapEntryConditions(entry);
|
|
56
|
+
}
|
|
57
|
+
catch (e) {
|
|
58
|
+
errors.push(`sapEntries.${table}[${i}]: ${e.message}`);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
return errors;
|
|
63
|
+
}
|
|
@@ -26,6 +26,13 @@ class Protocol {
|
|
|
26
26
|
const nodePath = process.execPath;
|
|
27
27
|
const address = this._server.address();
|
|
28
28
|
const url = `http://localhost:${address.port}`;
|
|
29
|
+
/*await ProtocolRegistry.register({
|
|
30
|
+
protocol: "trm",
|
|
31
|
+
command: `"${nodePath}" "${path.join(__dirname, "./callback.js")}" ${url} $_URL_`,
|
|
32
|
+
override: true,
|
|
33
|
+
terminal: false,
|
|
34
|
+
script: false
|
|
35
|
+
});*/
|
|
29
36
|
yield protocol_registry_1.default.register(`trm`, `"${nodePath}" "${path_1.default.join(__dirname, "./callback.js")}" ${url} $_URL_`, {
|
|
30
37
|
override: true,
|
|
31
38
|
terminal: true
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import { BatchCompareRequest, BatchCompareResponse, Deprecate, DistTagAdd, DistTagRm, Package,
|
|
1
|
+
import { BatchCompareRequest, BatchCompareResponse, Deprecate, DistTagAdd, DistTagRm, Package, Ping, WhoAmI } from "trm-registry-types";
|
|
2
2
|
import { RegistryType } from "./RegistryType";
|
|
3
3
|
import { TrmArtifact } from "../trmPackage";
|
|
4
|
+
import { BinaryTransport } from "../transport";
|
|
5
|
+
import { TransportEntries } from "../client";
|
|
6
|
+
export interface PublishAdditionalData {
|
|
7
|
+
readme?: string;
|
|
8
|
+
tags?: string;
|
|
9
|
+
changelog?: string;
|
|
10
|
+
retainedCustomizing?: string[];
|
|
11
|
+
}
|
|
12
|
+
/** Release data returned by a registry after publication. */
|
|
13
|
+
export interface PublishResult {
|
|
14
|
+
/** Integrity of the release as stored by the registry, when it can differ from the uploaded artifact. */
|
|
15
|
+
integrity?: string;
|
|
16
|
+
}
|
|
4
17
|
export declare abstract class AbstractRegistry {
|
|
5
18
|
endpoint: string;
|
|
6
19
|
name: string;
|
|
@@ -13,11 +26,13 @@ export declare abstract class AbstractRegistry {
|
|
|
13
26
|
abstract getPackage: (fullName: string, version: string) => Promise<Package>;
|
|
14
27
|
abstract downloadArtifact: (fullName: string, version: string) => Promise<TrmArtifact>;
|
|
15
28
|
abstract validatePublish: (fullName: string, version: string, isPrivate: boolean) => Promise<void>;
|
|
16
|
-
abstract publish: (fullName: string, version: string, artifact: TrmArtifact,
|
|
29
|
+
abstract publish: (fullName: string, version: string, artifact: TrmArtifact, additionalData?: PublishAdditionalData) => Promise<PublishResult | void>;
|
|
17
30
|
abstract unpublish: (fullName: string, version: string) => Promise<void>;
|
|
18
31
|
abstract deprecate: (fullName: string, version: string, deprecate: Deprecate) => Promise<void>;
|
|
19
32
|
abstract addDistTag: (fullName: string, distTag: DistTagAdd) => Promise<void>;
|
|
20
33
|
abstract rmDistTag: (fullName: string, distTag: DistTagRm) => Promise<void>;
|
|
21
34
|
abstract batchCompare: (packages: BatchCompareRequest) => Promise<BatchCompareResponse>;
|
|
22
|
-
abstract
|
|
35
|
+
abstract transport: (trkorr: string, target?: string) => Promise<BinaryTransport>;
|
|
36
|
+
abstract transportEntries: (fullName: string, version: string, trkorr: string) => Promise<TransportEntries>;
|
|
37
|
+
abstract delete: (transport: BinaryTransport) => Promise<BinaryTransport>;
|
|
23
38
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BatchCompareResponse, Package, Ping, WhoAmI } from "trm-registry-types";
|
|
2
2
|
import { AbstractRegistry } from "./AbstractRegistry";
|
|
3
3
|
import { RegistryType } from "./RegistryType";
|
|
4
|
-
import { TrmArtifact } from "../trmPackage";
|
|
4
|
+
import { TrmArtifact, TrmPackage } from "../trmPackage";
|
|
5
|
+
import { BinaryTransport } from "../transport";
|
|
6
|
+
import { TransportEntries } from "../client";
|
|
5
7
|
export declare const LOCAL_RESERVED_KEYWORD = "local";
|
|
6
8
|
export declare class FileSystem implements AbstractRegistry {
|
|
7
9
|
private _filePath?;
|
|
@@ -11,19 +13,26 @@ export declare class FileSystem implements AbstractRegistry {
|
|
|
11
13
|
constructor(_filePath?: string);
|
|
12
14
|
compare(registry: AbstractRegistry): boolean;
|
|
13
15
|
getRegistryType(): RegistryType;
|
|
14
|
-
authenticate(
|
|
16
|
+
authenticate(): Promise<AbstractRegistry>;
|
|
15
17
|
getAuthData(): any;
|
|
16
18
|
ping(): Promise<Ping>;
|
|
17
19
|
whoAmI(): Promise<WhoAmI>;
|
|
18
20
|
getPackage(fullName: string, version: string): Promise<Package>;
|
|
19
|
-
downloadArtifact(
|
|
20
|
-
getArtifact(
|
|
21
|
-
validatePublish(
|
|
22
|
-
publish(fullName: string, version: string, artifact: TrmArtifact
|
|
23
|
-
unpublish(
|
|
24
|
-
deprecate(
|
|
25
|
-
addDistTag(
|
|
26
|
-
rmDistTag(
|
|
27
|
-
batchCompare(
|
|
28
|
-
|
|
21
|
+
downloadArtifact(): Promise<TrmArtifact>;
|
|
22
|
+
getArtifact(): Promise<TrmArtifact>;
|
|
23
|
+
validatePublish(): Promise<void>;
|
|
24
|
+
publish(fullName: string, version: string, artifact: TrmArtifact): Promise<void>;
|
|
25
|
+
unpublish(): Promise<void>;
|
|
26
|
+
deprecate(): Promise<void>;
|
|
27
|
+
addDistTag(): Promise<void>;
|
|
28
|
+
rmDistTag(): Promise<void>;
|
|
29
|
+
batchCompare(): Promise<BatchCompareResponse>;
|
|
30
|
+
transport(): Promise<BinaryTransport>;
|
|
31
|
+
transportEntries(_fullName: string, _version: string, trkorr: string): Promise<TransportEntries>;
|
|
32
|
+
delete(_transport: BinaryTransport): Promise<BinaryTransport>;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the package of the local artifact, with the registry it was published to.
|
|
35
|
+
*/
|
|
36
|
+
getRealPackage(): Promise<TrmPackage>;
|
|
37
|
+
getRealRegistry(): Promise<AbstractRegistry>;
|
|
29
38
|
}
|
|
@@ -17,6 +17,9 @@ const os_1 = require("os");
|
|
|
17
17
|
const fs_1 = require("fs");
|
|
18
18
|
const path_1 = require("path");
|
|
19
19
|
const promises_1 = require("fs/promises");
|
|
20
|
+
const crypto_1 = require("crypto");
|
|
21
|
+
const RegistryPackageNotFoundError_1 = require("./RegistryPackageNotFoundError");
|
|
22
|
+
const RegistryDeletionTransportUnavailableError_1 = require("./RegistryDeletionTransportUnavailableError");
|
|
20
23
|
exports.LOCAL_RESERVED_KEYWORD = 'local';
|
|
21
24
|
class FileSystem {
|
|
22
25
|
constructor(_filePath) {
|
|
@@ -66,7 +69,7 @@ class FileSystem {
|
|
|
66
69
|
getRegistryType() {
|
|
67
70
|
return RegistryType_1.RegistryType.LOCAL;
|
|
68
71
|
}
|
|
69
|
-
authenticate(
|
|
72
|
+
authenticate() {
|
|
70
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
74
|
return this;
|
|
72
75
|
});
|
|
@@ -101,6 +104,13 @@ class FileSystem {
|
|
|
101
104
|
getPackage(fullName, version) {
|
|
102
105
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103
106
|
if (this._filePath) {
|
|
107
|
+
if (!(0, fs_1.existsSync)(this._filePath)) {
|
|
108
|
+
throw new RegistryPackageNotFoundError_1.RegistryPackageNotFoundError(fullName, version, this._filePath, undefined);
|
|
109
|
+
}
|
|
110
|
+
const artifact = yield this.getArtifact();
|
|
111
|
+
const manifest = artifact.getManifest();
|
|
112
|
+
const transportIndex = artifact.getTransportIndex();
|
|
113
|
+
const transportBinaries = yield artifact.getTransportBinaries();
|
|
104
114
|
return {
|
|
105
115
|
name: fullName,
|
|
106
116
|
dist_tags: {
|
|
@@ -109,21 +119,25 @@ class FileSystem {
|
|
|
109
119
|
versions: [],
|
|
110
120
|
yanked_versions: [],
|
|
111
121
|
deprecated: false,
|
|
112
|
-
manifest:
|
|
113
|
-
checksum:
|
|
114
|
-
download_link: this._filePath
|
|
122
|
+
manifest: manifest ? manifest.get() : undefined,
|
|
123
|
+
checksum: (0, crypto_1.createHash)('sha512').update(artifact.binary).digest('base64'),
|
|
124
|
+
download_link: this._filePath,
|
|
125
|
+
transports: transportIndex.map(transport => (Object.assign(Object.assign({}, transport), { contents: {
|
|
126
|
+
download_link: this._filePath,
|
|
127
|
+
checksum: transportBinaries.find(item => item.trkorr === transport.trkorr).entriesChecksum
|
|
128
|
+
} })))
|
|
115
129
|
};
|
|
116
130
|
}
|
|
117
131
|
throw new Error(`File system can't view packages!`);
|
|
118
132
|
});
|
|
119
133
|
}
|
|
120
|
-
downloadArtifact(
|
|
134
|
+
downloadArtifact() {
|
|
121
135
|
return __awaiter(this, void 0, void 0, function* () {
|
|
122
136
|
return new trmPackage_1.TrmArtifact((0, fs_1.readFileSync)(this._filePath));
|
|
123
137
|
});
|
|
124
138
|
}
|
|
125
|
-
getArtifact(
|
|
126
|
-
return __awaiter(this,
|
|
139
|
+
getArtifact() {
|
|
140
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
141
|
if (this._filePath) {
|
|
128
142
|
try {
|
|
129
143
|
if (!this._artifact) {
|
|
@@ -133,55 +147,92 @@ class FileSystem {
|
|
|
133
147
|
return this._artifact;
|
|
134
148
|
}
|
|
135
149
|
catch (e) {
|
|
136
|
-
throw new Error(`File system couldn't read package
|
|
150
|
+
throw new Error(`File system couldn't read package. The artifact may be incomplete or legacy; republish it with a current TRM version.`);
|
|
137
151
|
}
|
|
138
152
|
}
|
|
139
153
|
throw new Error(`Missing file path!`);
|
|
140
154
|
});
|
|
141
155
|
}
|
|
142
|
-
validatePublish(
|
|
156
|
+
validatePublish() {
|
|
143
157
|
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
//always valid, already checked in contructor
|
|
144
159
|
});
|
|
145
160
|
}
|
|
146
|
-
publish(fullName, version, artifact
|
|
161
|
+
publish(fullName, version, artifact) {
|
|
147
162
|
return __awaiter(this, void 0, void 0, function* () {
|
|
148
163
|
if (this._filePath) {
|
|
149
164
|
yield (0, promises_1.writeFile)(this._filePath, artifact.binary, {
|
|
150
165
|
flag: 'w'
|
|
151
166
|
});
|
|
152
|
-
return
|
|
167
|
+
return;
|
|
153
168
|
}
|
|
154
169
|
throw new Error(`Missing file path!`);
|
|
155
170
|
});
|
|
156
171
|
}
|
|
157
|
-
unpublish(
|
|
172
|
+
unpublish() {
|
|
158
173
|
return __awaiter(this, void 0, void 0, function* () {
|
|
159
174
|
throw new Error(`File system can't delete packages!`);
|
|
160
175
|
});
|
|
161
176
|
}
|
|
162
|
-
deprecate(
|
|
177
|
+
deprecate() {
|
|
163
178
|
return __awaiter(this, void 0, void 0, function* () {
|
|
164
179
|
throw new Error(`File system can't deprecate packages!`);
|
|
165
180
|
});
|
|
166
181
|
}
|
|
167
|
-
addDistTag(
|
|
182
|
+
addDistTag() {
|
|
168
183
|
return __awaiter(this, void 0, void 0, function* () {
|
|
169
184
|
throw new Error(`File system can't add dist tags!`);
|
|
170
185
|
});
|
|
171
186
|
}
|
|
172
|
-
rmDistTag(
|
|
187
|
+
rmDistTag() {
|
|
173
188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
174
189
|
throw new Error(`File system can't remove dist tags!`);
|
|
175
190
|
});
|
|
176
191
|
}
|
|
177
|
-
batchCompare(
|
|
192
|
+
batchCompare() {
|
|
178
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
179
194
|
throw new Error(`File system cannot compare package versions in registry!`);
|
|
180
195
|
});
|
|
181
196
|
}
|
|
182
|
-
|
|
197
|
+
transport() {
|
|
198
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
199
|
+
throw new Error(`File system can't fetch transports!`);
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
transportEntries(_fullName, _version, trkorr) {
|
|
203
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
204
|
+
const transport = (yield (yield this.getArtifact()).getTransportBinaries()).find(item => item.trkorr === trkorr);
|
|
205
|
+
if (!transport) {
|
|
206
|
+
throw new Error(`Transport ${trkorr} was not found in the local artifact.`);
|
|
207
|
+
}
|
|
208
|
+
return transport.entries;
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
delete(_transport) {
|
|
212
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
throw new RegistryDeletionTransportUnavailableError_1.RegistryDeletionTransportUnavailableError(exports.LOCAL_RESERVED_KEYWORD, `Local packages (.trm files) can't generate deletion transports.`);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Returns the package of the local artifact, with the registry it was published to.
|
|
218
|
+
*/
|
|
219
|
+
getRealPackage() {
|
|
220
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
221
|
+
if (this._filePath) {
|
|
222
|
+
try {
|
|
223
|
+
const artifact = yield this.getArtifact();
|
|
224
|
+
return artifact.getManifest().getPackage();
|
|
225
|
+
}
|
|
226
|
+
catch (e) {
|
|
227
|
+
throw new Error(`File system couldn't read package`);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
throw new Error(`Missing file path!`);
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
getRealRegistry() {
|
|
183
234
|
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
-
|
|
235
|
+
return (yield this.getRealPackage()).registry;
|
|
185
236
|
});
|
|
186
237
|
}
|
|
187
238
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RegistryDeletionTransportUnavailableError } from "./RegistryDeletionTransportUnavailableError";
|
|
2
|
+
export declare class RegistryDeletionTransportUnauthorizedError extends RegistryDeletionTransportUnavailableError {
|
|
3
|
+
constructor(registryEndpoint: string, originalError: unknown);
|
|
4
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RegistryDeletionTransportUnauthorizedError = void 0;
|
|
4
|
+
const RegistryDeletionTransportUnavailableError_1 = require("./RegistryDeletionTransportUnavailableError");
|
|
5
|
+
class RegistryDeletionTransportUnauthorizedError extends RegistryDeletionTransportUnavailableError_1.RegistryDeletionTransportUnavailableError {
|
|
6
|
+
constructor(registryEndpoint, originalError) {
|
|
7
|
+
super(registryEndpoint, `User is not authorized to generate deletion transports in registry "${registryEndpoint}".`, originalError);
|
|
8
|
+
this.name = 'RegistryDeletionTransportUnauthorizedError';
|
|
9
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.RegistryDeletionTransportUnauthorizedError = RegistryDeletionTransportUnauthorizedError;
|