formatting code

This commit is contained in:
MS 2021-02-04 14:41:01 +01:00
parent 39723f6f97
commit c0904936e4
No known key found for this signature in database
GPG Key ID: 8D526861953F4C0F
2 changed files with 44 additions and 57 deletions

View File

@ -174,19 +174,17 @@ export class LibeufinNexusService {
await pingProc(this.nexusProc, url, "libeufin-nexus"); await pingProc(this.nexusProc, url, "libeufin-nexus");
} }
async createNexusSuperuser( async createNexusSuperuser(details: LibeufinNexusUser): Promise<void> {
details: LibeufinNexusUser,
): Promise<void> {
const stdout = await sh( const stdout = await sh(
this.globalTestState, this.globalTestState,
"libeufin-nexus", "libeufin-nexus",
`libeufin-nexus superuser ${details.username} --password=${details.password}`, `libeufin-nexus superuser ${details.username} --password=${details.password}`,
extendEnv({ LIBEUFIN_NEXUS_DB_CONNECTION: this.nexusConfig.databaseJdbcUri }), extendEnv({
LIBEUFIN_NEXUS_DB_CONNECTION: this.nexusConfig.databaseJdbcUri,
}),
); );
console.log(stdout); console.log(stdout);
} }
} }
export interface CreateEbicsSubscriberRequest { export interface CreateEbicsSubscriberRequest {
@ -262,7 +260,6 @@ export class LibeufinCli {
async createEbicsSubscriber( async createEbicsSubscriber(
details: LibeufinEbicsSubscriberDetails, details: LibeufinEbicsSubscriberDetails,
): Promise<void> { ): Promise<void> {
const stdout = await sh( const stdout = await sh(
this.globalTestState, this.globalTestState,
"libeufin-cli-createebicssubscriber", "libeufin-cli-createebicssubscriber",
@ -279,7 +276,6 @@ export class LibeufinCli {
sd: LibeufinEbicsSubscriberDetails, sd: LibeufinEbicsSubscriberDetails,
bankAccountDetails: LibeufinBankAccountDetails, bankAccountDetails: LibeufinBankAccountDetails,
): Promise<void> { ): Promise<void> {
const stdout = await sh( const stdout = await sh(
this.globalTestState, this.globalTestState,
"libeufin-cli-createebicsbankaccount", "libeufin-cli-createebicsbankaccount",
@ -297,10 +293,7 @@ export class LibeufinCli {
console.log(stdout); console.log(stdout);
} }
async generateTransactions( async generateTransactions(accountName: string): Promise<void> {
accountName: string,
): Promise<void> {
const stdout = await sh( const stdout = await sh(
this.globalTestState, this.globalTestState,
"libeufin-cli-generatetransactions", "libeufin-cli-generatetransactions",
@ -310,10 +303,7 @@ export class LibeufinCli {
console.log(stdout); console.log(stdout);
} }
async showSandboxTransactions( async showSandboxTransactions(accountName: string): Promise<void> {
accountName: string,
): Promise<void> {
const stdout = await sh( const stdout = await sh(
this.globalTestState, this.globalTestState,
"libeufin-cli-showsandboxtransactions", "libeufin-cli-showsandboxtransactions",
@ -326,7 +316,6 @@ export class LibeufinCli {
async createEbicsConnection( async createEbicsConnection(
connectionDetails: LibeufinEbicsConnectionDetails, connectionDetails: LibeufinEbicsConnectionDetails,
): Promise<void> { ): Promise<void> {
const stdout = await sh( const stdout = await sh(
this.globalTestState, this.globalTestState,
"libeufin-cli-createebicsconnection", "libeufin-cli-createebicsconnection",
@ -345,10 +334,7 @@ export class LibeufinCli {
console.log(stdout); console.log(stdout);
} }
async createBackupFile( async createBackupFile(details: LibeufinBackupFileDetails): Promise<void> {
details: LibeufinBackupFileDetails,
): Promise<void> {
const stdout = await sh( const stdout = await sh(
this.globalTestState, this.globalTestState,
"libeufin-cli-createbackupfile", "libeufin-cli-createbackupfile",
@ -365,10 +351,7 @@ export class LibeufinCli {
console.log(stdout); console.log(stdout);
} }
async createKeyLetter( async createKeyLetter(details: LibeufinKeyLetterDetails): Promise<void> {
details: LibeufinKeyLetterDetails,
): Promise<void> {
const stdout = await sh( const stdout = await sh(
this.globalTestState, this.globalTestState,
"libeufin-cli-createkeyletter", "libeufin-cli-createkeyletter",

View File

@ -47,7 +47,7 @@ export async function runLibeufinTutorialTest(t: GlobalTestState) {
databaseJdbcUri: `jdbc:sqlite:${t.testDir}/libeufin-nexus.sqlite3`, databaseJdbcUri: `jdbc:sqlite:${t.testDir}/libeufin-nexus.sqlite3`,
}); });
const nexusUser = {username: "foo", password: "secret"}; const nexusUser = { username: "foo", password: "secret" };
const libeufinCli = new LibeufinCli(t, { const libeufinCli = new LibeufinCli(t, {
sandboxUrl: libeufinSandbox.baseUrl, sandboxUrl: libeufinSandbox.baseUrl,
nexusUrl: libeufinNexus.baseUrl, nexusUrl: libeufinNexus.baseUrl,
@ -57,13 +57,17 @@ export async function runLibeufinTutorialTest(t: GlobalTestState) {
}); });
const ebicsDetails = { const ebicsDetails = {
hostId: "testhost", partnerId: "partner01", userId: "user01" hostId: "testhost",
} partnerId: "partner01",
userId: "user01",
};
const bankAccountDetails = { const bankAccountDetails = {
currency: "EUR", iban: "DE18500105172929531888", bic: "INGDDEFFXXX", currency: "EUR",
personName: "Jane Normal", accountName: "testacct01" iban: "DE18500105172929531888",
} bic: "INGDDEFFXXX",
personName: "Jane Normal",
accountName: "testacct01",
};
await libeufinCli.checkSandbox(); await libeufinCli.checkSandbox();
await libeufinCli.createEbicsHost("testhost"); await libeufinCli.createEbicsHost("testhost");
@ -79,13 +83,13 @@ export async function runLibeufinTutorialTest(t: GlobalTestState) {
subscriberDetails: ebicsDetails, subscriberDetails: ebicsDetails,
ebicsUrl: `${libeufinSandbox.baseUrl}ebicsweb`, // FIXME: need appropriate URL concatenation ebicsUrl: `${libeufinSandbox.baseUrl}ebicsweb`, // FIXME: need appropriate URL concatenation
connectionName: "my-ebics-conn", connectionName: "my-ebics-conn",
} };
await libeufinCli.createEbicsConnection(connectionDetails); await libeufinCli.createEbicsConnection(connectionDetails);
await libeufinCli.createBackupFile({ await libeufinCli.createBackupFile({
passphrase: "secret", passphrase: "secret",
outputFile: `${t.testDir}/connection-backup.json`, outputFile: `${t.testDir}/connection-backup.json`,
connectionName: connectionDetails.connectionName, connectionName: connectionDetails.connectionName,
}) });
await libeufinCli.createKeyLetter({ await libeufinCli.createKeyLetter({
outputFile: `${t.testDir}/letter.pdf`, outputFile: `${t.testDir}/letter.pdf`,
connectionName: connectionDetails.connectionName, connectionName: connectionDetails.connectionName,