Anastasis facade tooling.
This commit is contained in:
parent
ec713f04b8
commit
daf9dc507e
@ -704,6 +704,25 @@ export class LibeufinCli {
|
|||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async newAnastasisFacade(req: NewAnastasisFacadeReq): Promise<void> {
|
||||||
|
const stdout = await sh(
|
||||||
|
this.globalTestState,
|
||||||
|
"libeufin-cli-new-anastasis-facade",
|
||||||
|
`libeufin-cli facades new-anastasis-facade` +
|
||||||
|
` --currency ${req.currency}` +
|
||||||
|
` --facade-name ${req.facadeName}` +
|
||||||
|
` ${req.connectionName} ${req.accountName}`,
|
||||||
|
{
|
||||||
|
...process.env,
|
||||||
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
||||||
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
console.log(stdout);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async newTalerWireGatewayFacade(req: NewTalerWireGatewayReq): Promise<void> {
|
async newTalerWireGatewayFacade(req: NewTalerWireGatewayReq): Promise<void> {
|
||||||
const stdout = await sh(
|
const stdout = await sh(
|
||||||
this.globalTestState,
|
this.globalTestState,
|
||||||
@ -738,6 +757,13 @@ export class LibeufinCli {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface NewAnastasisFacadeReq {
|
||||||
|
facadeName: string;
|
||||||
|
connectionName: string;
|
||||||
|
accountName: string;
|
||||||
|
currency: string;
|
||||||
|
}
|
||||||
|
|
||||||
interface NewTalerWireGatewayReq {
|
interface NewTalerWireGatewayReq {
|
||||||
facadeName: string;
|
facadeName: string;
|
||||||
connectionName: string;
|
connectionName: string;
|
||||||
@ -892,6 +918,15 @@ export interface CreateEbicsBankConnectionRequest {
|
|||||||
systemID?: string;
|
systemID?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CreateAnastasisFacadeRequest {
|
||||||
|
name: string;
|
||||||
|
connectionName: string;
|
||||||
|
accountName: string;
|
||||||
|
currency: string;
|
||||||
|
reserveTransferLevel: "report" | "statement" | "notification";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface CreateTalerWireGatewayFacadeRequest {
|
export interface CreateTalerWireGatewayFacadeRequest {
|
||||||
name: string;
|
name: string;
|
||||||
connectionName: string;
|
connectionName: string;
|
||||||
@ -1301,6 +1336,33 @@ export namespace LibeufinNexusApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function createAnastasisFacade(
|
||||||
|
libeufinNexusService: LibeufinNexusServiceInterface,
|
||||||
|
req: CreateAnastasisFacadeRequest,
|
||||||
|
) {
|
||||||
|
const baseUrl = libeufinNexusService.baseUrl;
|
||||||
|
let url = new URL("facades", baseUrl);
|
||||||
|
await axios.post(
|
||||||
|
url.href,
|
||||||
|
{
|
||||||
|
name: req.name,
|
||||||
|
type: "anastasis",
|
||||||
|
config: {
|
||||||
|
bankAccount: req.accountName,
|
||||||
|
bankConnection: req.connectionName,
|
||||||
|
currency: req.currency,
|
||||||
|
reserveTransferLevel: req.reserveTransferLevel,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
auth: {
|
||||||
|
username: "admin",
|
||||||
|
password: "test",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export async function createTwgFacade(
|
export async function createTwgFacade(
|
||||||
libeufinNexusService: LibeufinNexusServiceInterface,
|
libeufinNexusService: LibeufinNexusServiceInterface,
|
||||||
req: CreateTalerWireGatewayFacadeRequest,
|
req: CreateTalerWireGatewayFacadeRequest,
|
||||||
|
Loading…
Reference in New Issue
Block a user