move bank API client to taler-util, update typescript config
This commit is contained in:
parent
7450bede5b
commit
b63937703c
31
.vscode/tasks.json
vendored
31
.vscode/tasks.json
vendored
@ -1,18 +1,17 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "typescript",
|
||||
"tsconfig": "tsconfig.build.json",
|
||||
"problemMatcher": [
|
||||
"$tsc"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true,
|
||||
},
|
||||
}
|
||||
]
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "typescript",
|
||||
"tsconfig": "tsconfig.build.json",
|
||||
"problemMatcher": ["$tsc"],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"label": "tsc: build - tsconfig.build.json"
|
||||
}
|
||||
]
|
||||
}
|
@ -15,6 +15,7 @@
|
||||
"eslint": "^8.29.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"nx": "15.0.1",
|
||||
"prettier": "^2.8.8"
|
||||
"prettier": "^2.8.8",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@
|
||||
"postcss": "^8.4.23",
|
||||
"postcss-cli": "^10.1.0",
|
||||
"tailwindcss": "^3.3.2",
|
||||
"typescript": "5.1.3"
|
||||
"typescript": "5.2.2"
|
||||
},
|
||||
"pogen": {
|
||||
"domain": "aml-backoffice"
|
||||
|
@ -1,12 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
"target": "ES5",
|
||||
"module": "ES6",
|
||||
"lib": [
|
||||
"DOM",
|
||||
"ES2017"
|
||||
],
|
||||
"target": "ES2020",
|
||||
"module": "Node16",
|
||||
"lib": ["DOM", "ES2020"],
|
||||
"allowJs": true /* Allow javascript files to be compiled. */,
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
"jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
|
||||
@ -45,7 +42,5 @@
|
||||
/* Advanced Options */
|
||||
"skipLibCheck": true /* Skip type checking of declaration files. */
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
]
|
||||
"include": ["src/**/*"]
|
||||
}
|
@ -33,12 +33,12 @@
|
||||
"@types/node": "^18.11.17",
|
||||
"prettier": "^2.8.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typedoc": "^0.24.8",
|
||||
"typescript": "^5.1.3"
|
||||
"typedoc": "^0.25.1",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@gnu-taler/taler-util": "workspace:*",
|
||||
"@gnu-taler/anastasis-core": "workspace:*",
|
||||
"@gnu-taler/taler-util": "workspace:*",
|
||||
"tslib": "^2.5.3"
|
||||
}
|
||||
}
|
||||
|
@ -2,11 +2,11 @@
|
||||
"compileOnSave": true,
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ES2018",
|
||||
"module": "ESNext",
|
||||
"target": "ES2020",
|
||||
"module": "Node16",
|
||||
"moduleResolution": "Node16",
|
||||
"sourceMap": true,
|
||||
"lib": ["es6"],
|
||||
"lib": ["ES2020"],
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"strict": true,
|
||||
|
@ -18,7 +18,7 @@
|
||||
"devDependencies": {
|
||||
"ava": "^4.3.3",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^5.1.3"
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@gnu-taler/taler-util": "workspace:*",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"module": "Node16",
|
||||
"moduleResolution": "Node16",
|
||||
"sourceMap": true,
|
||||
"lib": ["ES2020"],
|
||||
|
@ -44,6 +44,6 @@
|
||||
"chai": "^4.3.6",
|
||||
"mocha": "^9.2.0",
|
||||
"sass": "1.56.1",
|
||||
"typescript": "^5.1.3"
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
"target": "ES5",
|
||||
"module": "ES6",
|
||||
"target": "ES2020",
|
||||
"module": "Node16",
|
||||
"lib": [
|
||||
"DOM",
|
||||
"ES2017"
|
||||
"ES2020"
|
||||
],
|
||||
"allowJs": true /* Allow javascript files to be compiled. */,
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
|
@ -60,7 +60,7 @@
|
||||
"po2json": "^0.4.5",
|
||||
"preact-render-to-string": "^5.2.6",
|
||||
"sass": "1.56.1",
|
||||
"typescript": "5.1.3"
|
||||
"typescript": "5.2.2"
|
||||
},
|
||||
"pogen": {
|
||||
"domain": "bank"
|
||||
|
@ -1,12 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
"target": "ES5",
|
||||
"module": "ES6",
|
||||
"lib": [
|
||||
"DOM",
|
||||
"ES2016"
|
||||
],
|
||||
"target": "ES2020",
|
||||
"module": "Node16",
|
||||
"lib": ["DOM", "ES2020"],
|
||||
"allowJs": true /* Allow javascript files to be compiled. */,
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
"jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
|
||||
@ -45,7 +42,5 @@
|
||||
/* Advanced Options */
|
||||
"skipLibCheck": true /* Skip type checking of declaration files. */
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
]
|
||||
"include": ["src/**/*"]
|
||||
}
|
@ -29,7 +29,7 @@
|
||||
"ava": "^5.3.1",
|
||||
"prettier": "^2.8.8",
|
||||
"rimraf": "^5.0.1",
|
||||
"typescript": "^5.1.6"
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^2.6.0"
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"lib": ["es6"],
|
||||
"module": "ES2020",
|
||||
"lib": ["ES2020"],
|
||||
"module": "Node16",
|
||||
"moduleResolution": "Node16",
|
||||
"target": "ES2020",
|
||||
"allowJs": true,
|
||||
|
@ -65,6 +65,6 @@
|
||||
"sirv-cli": "^1.0.11",
|
||||
"ts-node": "^10.9.1",
|
||||
"tslib": "2.5.3",
|
||||
"typescript": "5.1.3"
|
||||
"typescript": "5.2.2"
|
||||
}
|
||||
}
|
||||
|
@ -75,8 +75,8 @@
|
||||
"rimraf": "^3.0.2",
|
||||
"sass": "1.56.1",
|
||||
"source-map-support": "^0.5.21",
|
||||
"typedoc": "^0.24.8",
|
||||
"typescript": "5.1.3"
|
||||
"typedoc": "^0.25.1",
|
||||
"typescript": "5.2.2"
|
||||
},
|
||||
"pogen": {
|
||||
"domain": "taler-merchant-backoffice"
|
||||
|
@ -1,61 +1,58 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
"target": "ES6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
|
||||
"module": "ESNext", /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||
"lib": [
|
||||
"es2021",
|
||||
"dom"
|
||||
], /* Specify library files to be included in the compilation: */
|
||||
// "allowJs": true, /* Allow javascript files to be compiled. */
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
"jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||
"jsxFactory": "h", /* Specify the JSX factory function to use when targeting react JSX emit, e.g. React.createElement or h. */
|
||||
"jsxFragmentFactory": "Fragment", // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#custom-jsx-factories
|
||||
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
||||
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
// "outDir": "./", /* Redirect output structure to the directory. */
|
||||
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||
// "removeComments": true, /* Do not emit comments to output. */
|
||||
"noEmit": true, /* Do not emit outputs. */
|
||||
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
// "strictNullChecks": true, /* Enable strict null checks. */
|
||||
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
||||
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
||||
/* Additional Checks */
|
||||
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
||||
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
/* Module Resolution Options */
|
||||
"moduleResolution": "node16", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||
"esModuleInterop": true, /* */
|
||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
// "types": [], /* Type declaration files to be included in compilation. */
|
||||
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||
/* Source Map Options */
|
||||
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
||||
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
/* Advanced Options */
|
||||
"skipLibCheck": true /* Skip type checking of declaration files. */
|
||||
},
|
||||
"include": [
|
||||
"src/**/*",
|
||||
"tests/**/*"
|
||||
]
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
"target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */,
|
||||
"module": "Node16" /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
|
||||
"lib": [
|
||||
"es2020",
|
||||
"dom"
|
||||
] /* Specify library files to be included in the compilation: */,
|
||||
// "allowJs": true, /* Allow javascript files to be compiled. */
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
"jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
|
||||
"jsxFactory": "h" /* Specify the JSX factory function to use when targeting react JSX emit, e.g. React.createElement or h. */,
|
||||
"jsxFragmentFactory": "Fragment", // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#custom-jsx-factories
|
||||
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
||||
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
// "outDir": "./", /* Redirect output structure to the directory. */
|
||||
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||
// "removeComments": true, /* Do not emit comments to output. */
|
||||
"noEmit": true /* Do not emit outputs. */,
|
||||
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true /* Enable all strict type-checking options. */,
|
||||
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
// "strictNullChecks": true, /* Enable strict null checks. */
|
||||
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
||||
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
||||
/* Additional Checks */
|
||||
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
||||
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
/* Module Resolution Options */
|
||||
"moduleResolution": "node16" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
|
||||
"esModuleInterop": true /* */,
|
||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
// "types": [], /* Type declaration files to be included in compilation. */
|
||||
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||
/* Source Map Options */
|
||||
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
||||
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
/* Advanced Options */
|
||||
"skipLibCheck": true /* Skip type checking of declaration files. */
|
||||
},
|
||||
"include": ["src/**/*", "tests/**/*"]
|
||||
}
|
@ -11,7 +11,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"po2json": "^0.4.5",
|
||||
"typescript": "^5.1.3"
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "^18.11.17",
|
||||
|
@ -7,7 +7,7 @@
|
||||
"incremental": true,
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": true,
|
||||
"lib": ["es6"],
|
||||
"lib": ["ES2020"],
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
|
@ -35,7 +35,7 @@
|
||||
"esbuild": "^0.17.7",
|
||||
"prettier": "^2.8.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^5.1.3"
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@gnu-taler/taler-util": "workspace:*",
|
||||
|
@ -28,6 +28,7 @@ import {
|
||||
AccountAddDetails,
|
||||
AmountJson,
|
||||
Amounts,
|
||||
BankAccessApiClient,
|
||||
Configuration,
|
||||
CoreApiResponse,
|
||||
Duration,
|
||||
@ -46,13 +47,11 @@ import {
|
||||
stringToBytes,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import {
|
||||
HttpRequestLibrary,
|
||||
createPlatformHttpLib,
|
||||
expectSuccessResponseOrThrow,
|
||||
} from "@gnu-taler/taler-util/http";
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
BankServiceHandle,
|
||||
HarnessExchangeBankAccount,
|
||||
WalletCoreApiClient,
|
||||
WalletCoreRequestType,
|
||||
WalletCoreResponseType,
|
||||
@ -569,6 +568,13 @@ class BankServiceBase {
|
||||
) {}
|
||||
}
|
||||
|
||||
export interface HarnessExchangeBankAccount {
|
||||
accountName: string;
|
||||
accountPassword: string;
|
||||
accountPaytoUri: string;
|
||||
wireGatewayApiBaseUrl: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of the bank service using the "taler-fakebank-run" tool.
|
||||
*/
|
||||
@ -701,6 +707,11 @@ export class FakebankService
|
||||
// Use libeufin bank instead of pybank.
|
||||
const useLibeufinBank = false;
|
||||
|
||||
export interface BankServiceHandle {
|
||||
readonly bankAccessApiBaseUrl: string;
|
||||
readonly http: HttpRequestLibrary;
|
||||
}
|
||||
|
||||
export type BankService = BankServiceHandle;
|
||||
export const BankService = FakebankService;
|
||||
|
||||
|
@ -25,21 +25,18 @@
|
||||
*/
|
||||
import {
|
||||
AmountString,
|
||||
BankAccessApiClient,
|
||||
ConfirmPayResultType,
|
||||
MerchantContractTerms,
|
||||
Duration,
|
||||
PreparePayResultType,
|
||||
NotificationType,
|
||||
WalletNotification,
|
||||
TransactionMajorState,
|
||||
Logger,
|
||||
MerchantApiClient,
|
||||
MerchantContractTerms,
|
||||
NotificationType,
|
||||
PreparePayResultType,
|
||||
TransactionMajorState,
|
||||
WalletNotification,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
HarnessExchangeBankAccount,
|
||||
WalletApiOperation,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||
import { CoinConfig, defaultCoinConfig } from "./denomStructures.js";
|
||||
import {
|
||||
FaultInjectedExchangeService,
|
||||
@ -51,16 +48,17 @@ import {
|
||||
ExchangeService,
|
||||
ExchangeServiceInterface,
|
||||
FakebankService,
|
||||
getPayto,
|
||||
GlobalTestState,
|
||||
HarnessExchangeBankAccount,
|
||||
MerchantService,
|
||||
MerchantServiceInterface,
|
||||
setupDb,
|
||||
setupSharedDb,
|
||||
WalletCli,
|
||||
WalletClient,
|
||||
WalletService,
|
||||
WithAuthorization,
|
||||
getPayto,
|
||||
setupDb,
|
||||
setupSharedDb,
|
||||
} from "./harness.js";
|
||||
|
||||
import * as fs from "fs";
|
||||
|
@ -20,6 +20,7 @@
|
||||
import {
|
||||
addPaytoQueryParams,
|
||||
Amounts,
|
||||
BankAccessApiClient,
|
||||
Configuration,
|
||||
decodeCrock,
|
||||
j2s,
|
||||
@ -31,7 +32,6 @@ import {
|
||||
import { clk } from "@gnu-taler/taler-util/clk";
|
||||
import { createPlatformHttpLib } from "@gnu-taler/taler-util/http";
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
CryptoDispatcher,
|
||||
downloadExchangeInfo,
|
||||
SynchronousCryptoWorkerFactoryPlain,
|
||||
|
@ -17,11 +17,7 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
WalletApiOperation,
|
||||
WireGatewayApiClient,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||
import { defaultCoinConfig } from "../harness/denomStructures.js";
|
||||
import { getWireMethodForTest, GlobalTestState } from "../harness/harness.js";
|
||||
import {
|
||||
@ -30,7 +26,11 @@ import {
|
||||
makeTestPaymentV2,
|
||||
withdrawViaBankV2,
|
||||
} from "../harness/helpers.js";
|
||||
import { MerchantApiClient } from "@gnu-taler/taler-util";
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
MerchantApiClient,
|
||||
WireGatewayApiClient,
|
||||
} from "@gnu-taler/taler-util";
|
||||
|
||||
/**
|
||||
* Run test for basic, bank-integrated withdrawal and payment.
|
||||
|
@ -17,12 +17,13 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import { createEddsaKeyPair, encodeCrock } from "@gnu-taler/taler-util";
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
CreditDebitIndicator,
|
||||
WireGatewayApiClient,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
createEddsaKeyPair,
|
||||
encodeCrock,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { defaultCoinConfig } from "../harness/denomStructures.js";
|
||||
import {
|
||||
BankService,
|
||||
|
@ -18,29 +18,27 @@
|
||||
* Imports.
|
||||
*/
|
||||
import {
|
||||
GlobalTestState,
|
||||
WalletCli,
|
||||
setupDb,
|
||||
BankService,
|
||||
ExchangeService,
|
||||
MerchantService,
|
||||
getPayto,
|
||||
} from "../harness/harness.js";
|
||||
import {
|
||||
WalletApiOperation,
|
||||
BankAccessApiClient,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
import {
|
||||
ExchangesListResponse,
|
||||
URL,
|
||||
TalerErrorCode,
|
||||
URL,
|
||||
j2s,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||
import { defaultCoinConfig } from "../harness/denomStructures.js";
|
||||
import {
|
||||
FaultInjectedExchangeService,
|
||||
FaultInjectionResponseContext,
|
||||
} from "../harness/faultInjection.js";
|
||||
import { defaultCoinConfig } from "../harness/denomStructures.js";
|
||||
import {
|
||||
BankService,
|
||||
ExchangeService,
|
||||
GlobalTestState,
|
||||
MerchantService,
|
||||
WalletCli,
|
||||
getPayto,
|
||||
setupDb,
|
||||
} from "../harness/harness.js";
|
||||
|
||||
/**
|
||||
* Test if the wallet handles outdated exchange versions correctly.
|
||||
|
@ -18,6 +18,7 @@
|
||||
* Imports.
|
||||
*/
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
Duration,
|
||||
j2s,
|
||||
Logger,
|
||||
@ -27,10 +28,7 @@ import {
|
||||
TransactionType,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { createPlatformHttpLib } from "@gnu-taler/taler-util/http";
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
WalletApiOperation,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||
import * as http from "node:http";
|
||||
import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js";
|
||||
import {
|
||||
|
@ -22,15 +22,13 @@ import {
|
||||
Duration,
|
||||
MerchantContractTerms,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import {
|
||||
HarnessExchangeBankAccount,
|
||||
WalletApiOperation,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||
import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js";
|
||||
import {
|
||||
DbInfo,
|
||||
ExchangeService,
|
||||
GlobalTestState,
|
||||
HarnessExchangeBankAccount,
|
||||
MerchantService,
|
||||
WalletClient,
|
||||
setupDb,
|
||||
|
@ -24,11 +24,9 @@ import {
|
||||
URL,
|
||||
durationFromSpec,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||
import {
|
||||
BankServiceHandle,
|
||||
WalletApiOperation,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
import {
|
||||
ExchangeServiceInterface,
|
||||
GlobalTestState,
|
||||
MerchantServiceInterface,
|
||||
|
@ -21,11 +21,12 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import { CoreApiResponse, MerchantApiClient } from "@gnu-taler/taler-util";
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
WalletApiOperation,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
CoreApiResponse,
|
||||
MerchantApiClient,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||
import { defaultCoinConfig } from "../harness/denomStructures.js";
|
||||
import {
|
||||
FaultInjectedExchangeService,
|
||||
|
@ -18,13 +18,13 @@
|
||||
* Imports.
|
||||
*/
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
MerchantApiClient,
|
||||
TransactionMajorState,
|
||||
WireGatewayApiClient,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
WalletApiOperation,
|
||||
WireGatewayApiClient,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
import { GlobalTestState, getWireMethodForTest } from "../harness/harness.js";
|
||||
import { createSimpleTestkudosEnvironmentV2 } from "../harness/helpers.js";
|
||||
|
@ -18,14 +18,12 @@
|
||||
* Imports.
|
||||
*/
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
Duration,
|
||||
NotificationType,
|
||||
TransactionMajorState,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
WalletApiOperation,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||
import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js";
|
||||
import {
|
||||
ExchangeService,
|
||||
|
@ -17,11 +17,8 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import { TalerErrorCode } from "@gnu-taler/taler-util";
|
||||
import {
|
||||
WalletApiOperation,
|
||||
BankAccessApiClient,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
import { BankAccessApiClient, TalerErrorCode } from "@gnu-taler/taler-util";
|
||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||
import { GlobalTestState } from "../harness/harness.js";
|
||||
import { createSimpleTestkudosEnvironmentV2 } from "../harness/helpers.js";
|
||||
|
||||
|
@ -17,13 +17,8 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import { GlobalTestState } from "../harness/harness.js";
|
||||
import { createSimpleTestkudosEnvironmentV2 } from "../harness/helpers.js";
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
WalletApiOperation,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
import {
|
||||
j2s,
|
||||
NotificationType,
|
||||
TransactionMajorState,
|
||||
@ -31,6 +26,9 @@ import {
|
||||
TransactionType,
|
||||
WithdrawalType,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||
import { GlobalTestState } from "../harness/harness.js";
|
||||
import { createSimpleTestkudosEnvironmentV2 } from "../harness/helpers.js";
|
||||
|
||||
/**
|
||||
* Run test for basic, bank-integrated withdrawal.
|
||||
|
@ -17,11 +17,8 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import { j2s } from "@gnu-taler/taler-util";
|
||||
import {
|
||||
BankAccessApiClient,
|
||||
WalletApiOperation,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
import { BankAccessApiClient, j2s } from "@gnu-taler/taler-util";
|
||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||
import { CoinConfig } from "../harness/denomStructures.js";
|
||||
import {
|
||||
BankService,
|
||||
|
@ -17,12 +17,14 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import { AbsoluteTime, Logger, j2s } from "@gnu-taler/taler-util";
|
||||
import {
|
||||
AbsoluteTime,
|
||||
BankAccessApiClient,
|
||||
WalletApiOperation,
|
||||
Logger,
|
||||
WireGatewayApiClient,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
j2s,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||
import { GlobalTestState } from "../harness/harness.js";
|
||||
import { createSimpleTestkudosEnvironmentV2 } from "../harness/helpers.js";
|
||||
|
||||
|
@ -3,10 +3,10 @@
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ES2018",
|
||||
"module": "ESNext",
|
||||
"module": "Node16",
|
||||
"moduleResolution": "Node16",
|
||||
"sourceMap": true,
|
||||
"lib": ["es6"],
|
||||
"lib": ["ES2020"],
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"strict": true,
|
||||
|
@ -68,14 +68,14 @@
|
||||
"esbuild": "^0.17.7",
|
||||
"prettier": "^2.8.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^5.1.3"
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"big-integer": "^1.6.51",
|
||||
"fflate": "^0.7.4",
|
||||
"hash-wasm": "^4.9.0",
|
||||
"jed": "^1.1.1",
|
||||
"tslib": "^2.5.3",
|
||||
"hash-wasm": "^4.9.0"
|
||||
"tslib": "^2.5.3"
|
||||
},
|
||||
"ava": {
|
||||
"files": [
|
||||
|
@ -58,11 +58,6 @@ export interface BankAccountBalanceResponse {
|
||||
};
|
||||
}
|
||||
|
||||
export interface BankServiceHandle {
|
||||
readonly bankAccessApiBaseUrl: string;
|
||||
readonly http: HttpRequestLibrary;
|
||||
}
|
||||
|
||||
export interface BankUser {
|
||||
username: string;
|
||||
password: string;
|
||||
@ -74,16 +69,6 @@ export interface WithdrawalOperationInfo {
|
||||
taler_withdraw_uri: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* FIXME: Rename, this is not part of the integration test harness anymore.
|
||||
*/
|
||||
export interface HarnessExchangeBankAccount {
|
||||
accountName: string;
|
||||
accountPassword: string;
|
||||
accountPaytoUri: string;
|
||||
wireGatewayApiBaseUrl: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to generate the "Authorization" HTTP header.
|
||||
*/
|
@ -16,7 +16,7 @@
|
||||
SPDX-License-Identifier: AGPL3.0-or-later
|
||||
*/
|
||||
|
||||
import { CancellationToken } from "./CancellationToken.js";
|
||||
import type { CancellationToken } from "./CancellationToken.js";
|
||||
import { Codec } from "./codec.js";
|
||||
import { j2s } from "./helpers.js";
|
||||
import {
|
||||
|
@ -41,3 +41,4 @@ export * from "./iban.js";
|
||||
export * from "./transaction-test-data.js";
|
||||
export * from "./libeufin-api-types.js";
|
||||
export * from "./MerchantApiClient.js";
|
||||
export * from "./bank-api-client.js";
|
||||
|
@ -5,8 +5,8 @@
|
||||
"declaration": true,
|
||||
"declarationMap": false,
|
||||
"target": "ES2020",
|
||||
"module": "ES2020",
|
||||
"moduleResolution": "node16",
|
||||
"module": "Node16",
|
||||
"moduleResolution": "Node16",
|
||||
"sourceMap": true,
|
||||
"lib": ["ES2020"],
|
||||
"types": ["node"],
|
||||
|
@ -33,8 +33,8 @@
|
||||
"@types/node": "^18.11.17",
|
||||
"prettier": "^2.8.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typedoc": "^0.24.8",
|
||||
"typescript": "^5.1.3"
|
||||
"typedoc": "^0.25.1",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@gnu-taler/taler-util": "workspace:*",
|
||||
|
@ -3,10 +3,10 @@
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ES2018",
|
||||
"module": "ESNext",
|
||||
"module": "Node16",
|
||||
"moduleResolution": "Node16",
|
||||
"sourceMap": true,
|
||||
"lib": ["es6"],
|
||||
"lib": ["ES2020"],
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"strict": true,
|
||||
|
@ -65,8 +65,8 @@
|
||||
"po2json": "^0.4.5",
|
||||
"prettier": "^2.8.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typedoc": "^0.24.8",
|
||||
"typescript": "^5.1.3"
|
||||
"typedoc": "^0.25.1",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@gnu-taler/idb-bridge": "workspace:*",
|
||||
|
@ -52,7 +52,7 @@ import {
|
||||
HttpRequestLibrary,
|
||||
readSuccessResponseJsonOrThrow,
|
||||
} from "@gnu-taler/taler-util/http";
|
||||
import { BankAccessApiClient, BankServiceHandle } from "./bank-api-client.js";
|
||||
import { BankAccessApiClient } from "../../taler-util/src/bank-api-client.js";
|
||||
import { TalerCryptoInterface } from "./crypto/cryptoImplementation.js";
|
||||
import { DenominationRecord } from "./db.js";
|
||||
import { isWithdrawableDenom } from "./index.js";
|
||||
@ -117,10 +117,6 @@ export async function topupReserveWithDemobank(
|
||||
args: TopupReserveWithDemobankArgs,
|
||||
) {
|
||||
const { http, bankAccessApiBaseUrl, amount, exchangeInfo, reservePub } = args;
|
||||
const bankHandle: BankServiceHandle = {
|
||||
bankAccessApiBaseUrl: bankAccessApiBaseUrl,
|
||||
http,
|
||||
};
|
||||
const bankClient = new BankAccessApiClient(bankAccessApiBaseUrl);
|
||||
const bankUser = await bankClient.createRandomBankUser();
|
||||
const wopi = await bankClient.createWithdrawalOperation(
|
||||
|
@ -44,8 +44,6 @@ export * from "./operations/backup/index.js";
|
||||
|
||||
export * from "./operations/exchanges.js";
|
||||
|
||||
export * from "./bank-api-client.js";
|
||||
|
||||
export * from "./operations/withdraw.js";
|
||||
export * from "./operations/refresh.js";
|
||||
|
||||
|
@ -129,10 +129,8 @@ import {
|
||||
codecForTestingSetTimetravelRequest,
|
||||
setDangerousTimetravel,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import {
|
||||
HttpRequestLibrary,
|
||||
readSuccessResponseJsonOrThrow,
|
||||
} from "@gnu-taler/taler-util/http";
|
||||
import type { HttpRequestLibrary } from "@gnu-taler/taler-util/http";
|
||||
import { readSuccessResponseJsonOrThrow } from "@gnu-taler/taler-util/http";
|
||||
import { TalerCryptoInterface } from "./crypto/cryptoImplementation.js";
|
||||
import {
|
||||
CryptoDispatcher,
|
||||
|
@ -4,12 +4,12 @@
|
||||
"composite": true,
|
||||
"declaration": true,
|
||||
"declarationMap": false,
|
||||
"target": "ES2017",
|
||||
"module": "ESNext",
|
||||
"target": "ES2020",
|
||||
"module": "Node16",
|
||||
"moduleResolution": "Node16",
|
||||
"resolveJsonModule": true,
|
||||
"sourceMap": true,
|
||||
"lib": ["es6"],
|
||||
"lib": ["ES2020"],
|
||||
"resolvePackageJsonImports": true,
|
||||
"types": ["node"],
|
||||
"noImplicitReturns": true,
|
||||
@ -33,8 +33,5 @@
|
||||
"path": "../taler-util/"
|
||||
}
|
||||
],
|
||||
"include": [
|
||||
"src/**/*",
|
||||
"src/*.json"
|
||||
]
|
||||
"include": ["src/**/*", "src/*.json", "../taler-util/src/bank-api-client.ts"]
|
||||
}
|
||||
|
@ -5,10 +5,10 @@
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"target": "ES6",
|
||||
"module": "ESNext",
|
||||
"module": "Node16",
|
||||
"moduleResolution": "Node16",
|
||||
"sourceMap": true,
|
||||
"lib": ["es6"],
|
||||
"lib": ["ES2020"],
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"strict": true,
|
||||
|
@ -64,7 +64,7 @@
|
||||
"preact-cli": "^3.3.5",
|
||||
"preact-render-to-string": "^5.1.19",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "5.1.3"
|
||||
"typescript": "5.2.2"
|
||||
},
|
||||
"nyc": {
|
||||
"include": [
|
||||
|
@ -51,14 +51,11 @@ import {
|
||||
importDb,
|
||||
openPromise,
|
||||
} from "@gnu-taler/taler-wallet-core";
|
||||
import {
|
||||
MessageFromBackend,
|
||||
MessageFromFrontend,
|
||||
MessageResponse,
|
||||
} from "./platform/api.js";
|
||||
import { MessageFromFrontend, MessageResponse } from "./platform/api.js";
|
||||
import { platform } from "./platform/background.js";
|
||||
import { ExtensionOperations } from "./taler-wallet-interaction-loader.js";
|
||||
import { BackgroundOperations } from "./wxApi.js";
|
||||
import { HttpRequestLibrary } from "@gnu-taler/taler-util/http";
|
||||
|
||||
/**
|
||||
* Currently active wallet instance. Might be unloaded and
|
||||
@ -297,7 +294,7 @@ async function reinitWallet(): Promise<void> {
|
||||
}
|
||||
currentDatabase = undefined;
|
||||
// setBadgeText({ text: "" });
|
||||
let httpLib;
|
||||
let httpLib: HttpRequestLibrary;
|
||||
let cryptoWorker;
|
||||
let timer;
|
||||
|
||||
@ -318,7 +315,7 @@ async function reinitWallet(): Promise<void> {
|
||||
logger.info("Setting up wallet");
|
||||
const wallet = await Wallet.create(
|
||||
indexedDB as any,
|
||||
httpLib,
|
||||
httpLib as any,
|
||||
timer,
|
||||
cryptoWorker,
|
||||
{
|
||||
|
@ -1,15 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"lib": [
|
||||
"es2021",
|
||||
"DOM"
|
||||
],
|
||||
"jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||
"jsxFactory": "h", /* Specify the JSX factory function to use when targeting react JSX emit, e.g. React.createElement or h. */
|
||||
"lib": ["es2020", "DOM"],
|
||||
"jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
|
||||
"jsxFactory": "h" /* Specify the JSX factory function to use when targeting react JSX emit, e.g. React.createElement or h. */,
|
||||
"jsxFragmentFactory": "Fragment", // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#custom-jsx-factories
|
||||
"moduleResolution": "Node16",
|
||||
"module": "ES2020",
|
||||
"module": "Node16",
|
||||
"target": "ES6",
|
||||
"skipLibCheck": true,
|
||||
"preserveSymlinks": true,
|
||||
@ -23,9 +20,7 @@
|
||||
"esModuleInterop": true,
|
||||
"importHelpers": true,
|
||||
"rootDir": "./src",
|
||||
"typeRoots": [
|
||||
"./node_modules/@types"
|
||||
]
|
||||
"typeRoots": ["./node_modules/@types"]
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
@ -35,7 +30,5 @@
|
||||
"path": "../taler-util/"
|
||||
}
|
||||
],
|
||||
"include": [
|
||||
"src/**/*"
|
||||
]
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
|
@ -56,7 +56,7 @@
|
||||
"sass": "1.56.1",
|
||||
"swr": "2.0.3",
|
||||
"tslib": "^2.5.3",
|
||||
"typescript": "^5.1.3",
|
||||
"typescript": "^5.2.2",
|
||||
"ws": "7.4.5"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -3,17 +3,14 @@
|
||||
"composite": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"target": "ES6",
|
||||
"module": "ESNext",
|
||||
"target": "ES2020",
|
||||
"module": "Node16",
|
||||
"jsx": "react",
|
||||
"jsxFactory": "h",
|
||||
"jsxFragmentFactory": "Fragment",
|
||||
"moduleResolution": "Node16",
|
||||
"sourceMap": true,
|
||||
"lib": [
|
||||
"DOM",
|
||||
"es6"
|
||||
],
|
||||
"lib": ["DOM", "ES2020"],
|
||||
"outDir": "lib",
|
||||
"preserveSymlinks": true,
|
||||
"skipLibCheck": true,
|
||||
@ -27,11 +24,7 @@
|
||||
"esModuleInterop": true,
|
||||
"importHelpers": true,
|
||||
"rootDir": "./src",
|
||||
"typeRoots": [
|
||||
"./node_modules/@types"
|
||||
]
|
||||
"typeRoots": ["./node_modules/@types"]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
]
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
|
1078
pnpm-lock.yaml
1078
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user