Skip to content

Commit

Permalink
Merge pull request #28 from RegestaItalia/major
Browse files Browse the repository at this point in the history
Major release
  • Loading branch information
simonegaffurini authored Jul 1, 2024
2 parents a786163 + 6cd7475 commit a172026
Show file tree
Hide file tree
Showing 58 changed files with 2,088 additions and 1,713 deletions.
1,471 changes: 656 additions & 815 deletions docs/commands.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To sum up the installation:

- Download the RFC SDK from the SAP® Support Portal (follow the updated link of the note in [this section](https://support.sap.com/en/product/connectors/nwrfcsdk.html?anchorId=section_1291717368))

> **TRM DOESN'T PROVIDE THE REQUIRED SDK, IT CAN AND SHOULD ONLY BE DOWNLOADED FROM OFFICIAL SOURCES**
> **TRM DOESN'T PROVIDE THE REQUIRED SDK, IT CAN BE DOWNLOADED FROM OFFICIAL SOURCES**
- On Windows
- Create the folder `C:\nwrfcsdk`
Expand Down Expand Up @@ -57,7 +57,7 @@ To sum up the installation:

- Download the RFC SDK from [SAP® Software Download Center](https://support.sap.com/en/my-support/software-downloads.html)

> **TRM DOESN'T PROVIDE THE R3TRANS PROGRAM, IT CAN AND SHOULD ONLY BE DOWNLOADED FROM OFFICIAL SOURCES**
> **TRM DOESN'T PROVIDE THE R3TRANS PROGRAM, IT CAN BE DOWNLOADED FROM OFFICIAL SOURCES**
- On Windows

Expand Down
108 changes: 99 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trm-client",
"version": "2.3.1",
"version": "3.0.0",
"description": "TRM (Transport Request Manager) Client",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -39,7 +39,7 @@
"get-root-path": "^2.0.2",
"ini": "^4.1.1",
"semver": "^7.5.4",
"trm-core": "^2.2.3",
"trm-core": "^3.1.5",
"trm-registry-types": "^1.0.3",
"xml2js": "^0.6.2"
},
Expand Down
19 changes: 10 additions & 9 deletions src/commands/addRegistry.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Inquirer, Logger } from "trm-core";
import { RegistryAlias } from "../registryAlias";
import { ActionArguments, AddRegistryArguments } from "./arguments";
import { AddRegistryArguments } from "./arguments";

export async function addRegistry(commandArgs: AddRegistryArguments, actionArgs: ActionArguments) {
const logger = actionArgs.logger;
const inquirer = actionArgs.inquirer;
const registryName = commandArgs.registry.trim();
export async function addRegistry(commandArgs: AddRegistryArguments) {
const registryName = commandArgs.registryName.trim();
const auth = commandArgs.authentication;
var endpoint = commandArgs.endpoint;
var oAuth;
Expand All @@ -18,24 +17,26 @@ export async function addRegistry(commandArgs: AddRegistryArguments, actionArgs:
throw new Error(`Invalid authentication JSON object.`);
}
}
const inq1 = await inquirer.prompt({
const inq1 = await Inquirer.prompt({
type: "input",
name: "endpoint",
message: "Registry endpoint",
default: endpoint,
when: !endpoint
});
endpoint = inq1.endpoint || endpoint;
const registry = RegistryAlias.create(registryName, endpoint, oAuth, logger);
const registry = RegistryAlias.create(registryName, endpoint, oAuth)
var pingSuccess = true;
try{
await registry.getRegistry(false, inquirer)
const ping = await registry.getRegistry().ping();
Logger.registryResponse(ping.wallMessage);
}catch(e){
Logger.error(`Ping to registry "${registryName}" (${endpoint}) failed.`);
pingSuccess = false;
throw e;
}finally{
if(pingSuccess){
logger.success(`Registry added.`);
Logger.success(`Registry "${registryName}" added.`);
}else{
RegistryAlias.delete(registryName);
}
Expand Down
Loading

0 comments on commit a172026

Please sign in to comment.