formatting code
This commit is contained in:
parent
39723f6f97
commit
c0904936e4
@ -174,19 +174,17 @@ export class LibeufinNexusService {
|
||||
await pingProc(this.nexusProc, url, "libeufin-nexus");
|
||||
}
|
||||
|
||||
async createNexusSuperuser(
|
||||
details: LibeufinNexusUser,
|
||||
): Promise<void> {
|
||||
|
||||
async createNexusSuperuser(details: LibeufinNexusUser): Promise<void> {
|
||||
const stdout = await sh(
|
||||
this.globalTestState,
|
||||
"libeufin-nexus",
|
||||
`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 {
|
||||
@ -262,14 +260,13 @@ export class LibeufinCli {
|
||||
async createEbicsSubscriber(
|
||||
details: LibeufinEbicsSubscriberDetails,
|
||||
): Promise<void> {
|
||||
|
||||
const stdout = await sh(
|
||||
this.globalTestState,
|
||||
"libeufin-cli-createebicssubscriber",
|
||||
"libeufin-cli sandbox ebicssubscriber create" +
|
||||
` --host-id=${details.hostId}` +
|
||||
` --partner-id=${details.partnerId}` +
|
||||
` --user-id=${details.userId}`,
|
||||
` --partner-id=${details.partnerId}` +
|
||||
` --user-id=${details.userId}`,
|
||||
extendEnv({ LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl }),
|
||||
);
|
||||
console.log(stdout);
|
||||
@ -279,28 +276,24 @@ export class LibeufinCli {
|
||||
sd: LibeufinEbicsSubscriberDetails,
|
||||
bankAccountDetails: LibeufinBankAccountDetails,
|
||||
): Promise<void> {
|
||||
|
||||
const stdout = await sh(
|
||||
this.globalTestState,
|
||||
"libeufin-cli-createebicsbankaccount",
|
||||
"libeufin-cli sandbox ebicsbankaccount create" +
|
||||
` --currency=${bankAccountDetails.currency}` +
|
||||
` --iban=${bankAccountDetails.iban}` +
|
||||
` --currency=${bankAccountDetails.currency}` +
|
||||
` --iban=${bankAccountDetails.iban}` +
|
||||
` --bic=${bankAccountDetails.bic}` +
|
||||
` --person-name='${bankAccountDetails.personName}'` +
|
||||
` --account-name=${bankAccountDetails.accountName}` +
|
||||
` --ebics-host-id=${sd.hostId}` +
|
||||
` --ebics-partner-id=${sd.partnerId}` +
|
||||
` --ebics-user-id=${sd.userId}`,
|
||||
` --ebics-host-id=${sd.hostId}` +
|
||||
` --ebics-partner-id=${sd.partnerId}` +
|
||||
` --ebics-user-id=${sd.userId}`,
|
||||
extendEnv({ LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl }),
|
||||
);
|
||||
console.log(stdout);
|
||||
}
|
||||
|
||||
async generateTransactions(
|
||||
accountName: string,
|
||||
): Promise<void> {
|
||||
|
||||
async generateTransactions(accountName: string): Promise<void> {
|
||||
const stdout = await sh(
|
||||
this.globalTestState,
|
||||
"libeufin-cli-generatetransactions",
|
||||
@ -310,10 +303,7 @@ export class LibeufinCli {
|
||||
console.log(stdout);
|
||||
}
|
||||
|
||||
async showSandboxTransactions(
|
||||
accountName: string,
|
||||
): Promise<void> {
|
||||
|
||||
async showSandboxTransactions(accountName: string): Promise<void> {
|
||||
const stdout = await sh(
|
||||
this.globalTestState,
|
||||
"libeufin-cli-showsandboxtransactions",
|
||||
@ -326,58 +316,51 @@ export class LibeufinCli {
|
||||
async createEbicsConnection(
|
||||
connectionDetails: LibeufinEbicsConnectionDetails,
|
||||
): Promise<void> {
|
||||
|
||||
const stdout = await sh(
|
||||
this.globalTestState,
|
||||
"libeufin-cli-createebicsconnection",
|
||||
`libeufin-cli connections new-ebics-connection` +
|
||||
` --ebics-url=${connectionDetails.ebicsUrl}` +
|
||||
` --host-id=${connectionDetails.subscriberDetails.hostId}` +
|
||||
` --partner-id=${connectionDetails.subscriberDetails.partnerId}` +
|
||||
` --ebics-user-id=${connectionDetails.subscriberDetails.partnerId}` +
|
||||
` ${connectionDetails.connectionName}`,
|
||||
` --ebics-url=${connectionDetails.ebicsUrl}` +
|
||||
` --host-id=${connectionDetails.subscriberDetails.hostId}` +
|
||||
` --partner-id=${connectionDetails.subscriberDetails.partnerId}` +
|
||||
` --ebics-user-id=${connectionDetails.subscriberDetails.partnerId}` +
|
||||
` ${connectionDetails.connectionName}`,
|
||||
extendEnv({
|
||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
||||
}),
|
||||
);
|
||||
console.log(stdout);
|
||||
}
|
||||
|
||||
async createBackupFile(
|
||||
details: LibeufinBackupFileDetails,
|
||||
): Promise<void> {
|
||||
|
||||
async createBackupFile(details: LibeufinBackupFileDetails): Promise<void> {
|
||||
const stdout = await sh(
|
||||
this.globalTestState,
|
||||
"libeufin-cli-createbackupfile",
|
||||
`libeufin-cli connections export-backup` +
|
||||
` --passphrase=${details.passphrase}` +
|
||||
` --output-file=${details.outputFile}` +
|
||||
` ${details.connectionName}`,
|
||||
` --passphrase=${details.passphrase}` +
|
||||
` --output-file=${details.outputFile}` +
|
||||
` ${details.connectionName}`,
|
||||
extendEnv({
|
||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
||||
}),
|
||||
);
|
||||
console.log(stdout);
|
||||
}
|
||||
|
||||
async createKeyLetter(
|
||||
details: LibeufinKeyLetterDetails,
|
||||
): Promise<void> {
|
||||
|
||||
async createKeyLetter(details: LibeufinKeyLetterDetails): Promise<void> {
|
||||
const stdout = await sh(
|
||||
this.globalTestState,
|
||||
"libeufin-cli-createkeyletter",
|
||||
`libeufin-cli connections get-key-letter` +
|
||||
` ${details.connectionName} ${details.outputFile}`,
|
||||
` ${details.connectionName} ${details.outputFile}`,
|
||||
extendEnv({
|
||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
||||
}),
|
||||
);
|
||||
console.log(stdout);
|
||||
|
@ -47,7 +47,7 @@ export async function runLibeufinTutorialTest(t: GlobalTestState) {
|
||||
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, {
|
||||
sandboxUrl: libeufinSandbox.baseUrl,
|
||||
nexusUrl: libeufinNexus.baseUrl,
|
||||
@ -57,13 +57,17 @@ export async function runLibeufinTutorialTest(t: GlobalTestState) {
|
||||
});
|
||||
|
||||
const ebicsDetails = {
|
||||
hostId: "testhost", partnerId: "partner01", userId: "user01"
|
||||
}
|
||||
hostId: "testhost",
|
||||
partnerId: "partner01",
|
||||
userId: "user01",
|
||||
};
|
||||
const bankAccountDetails = {
|
||||
currency: "EUR", iban: "DE18500105172929531888", bic: "INGDDEFFXXX",
|
||||
personName: "Jane Normal", accountName: "testacct01"
|
||||
}
|
||||
|
||||
currency: "EUR",
|
||||
iban: "DE18500105172929531888",
|
||||
bic: "INGDDEFFXXX",
|
||||
personName: "Jane Normal",
|
||||
accountName: "testacct01",
|
||||
};
|
||||
|
||||
await libeufinCli.checkSandbox();
|
||||
await libeufinCli.createEbicsHost("testhost");
|
||||
@ -79,13 +83,13 @@ export async function runLibeufinTutorialTest(t: GlobalTestState) {
|
||||
subscriberDetails: ebicsDetails,
|
||||
ebicsUrl: `${libeufinSandbox.baseUrl}ebicsweb`, // FIXME: need appropriate URL concatenation
|
||||
connectionName: "my-ebics-conn",
|
||||
}
|
||||
};
|
||||
await libeufinCli.createEbicsConnection(connectionDetails);
|
||||
await libeufinCli.createBackupFile({
|
||||
passphrase: "secret",
|
||||
outputFile: `${t.testDir}/connection-backup.json`,
|
||||
connectionName: connectionDetails.connectionName,
|
||||
})
|
||||
});
|
||||
await libeufinCli.createKeyLetter({
|
||||
outputFile: `${t.testDir}/letter.pdf`,
|
||||
connectionName: connectionDetails.connectionName,
|
||||
|
Loading…
Reference in New Issue
Block a user