gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: fix up imports, no more esm i


From: gnunet
Subject: [taler-wallet-core] branch master updated: fix up imports, no more esm in tests
Date: Mon, 14 Jun 2021 16:09:04 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 1cde390c fix up imports, no more esm in tests
1cde390c is described below

commit 1cde390c23f2668a3777752632c48febd10a28ee
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon Jun 14 16:08:58 2021 +0200

    fix up imports, no more esm in tests
---
 packages/taler-util/package.json                   |  3 --
 packages/taler-util/src/codec.test.ts              |  2 +-
 packages/taler-util/src/helpers.test.ts            |  2 +-
 packages/taler-util/src/i18n.ts                    |  2 +-
 packages/taler-util/src/libtool-version.test.ts    |  2 +-
 packages/taler-util/src/payto.test.ts              |  2 +-
 packages/taler-util/src/talerconfig.test.ts        |  2 +-
 packages/taler-util/src/taleruri.test.ts           |  2 +-
 packages/taler-wallet-core/package.json            | 19 ++------
 .../taler-wallet-core/src/crypto/primitives/kdf.ts |  4 +-
 .../src/crypto/talerCrypto-test.ts                 |  6 +--
 .../taler-wallet-core/src/crypto/talerCrypto.ts    |  4 +-
 .../src/crypto/workers/cryptoApi.ts                |  6 +--
 packages/taler-wallet-core/src/db.ts               |  2 +-
 .../src/operations/backup/export.ts                |  9 ++--
 .../src/operations/backup/import.ts                |  6 +--
 .../src/operations/backup/index.ts                 | 26 +++++-----
 .../src/operations/backup/state.ts                 |  6 +--
 .../taler-wallet-core/src/operations/deposits.ts   | 14 +++---
 .../taler-wallet-core/src/operations/exchanges.ts  | 13 ++---
 packages/taler-wallet-core/src/operations/pay.ts   | 56 +++++++++++-----------
 .../taler-wallet-core/src/operations/pending.ts    |  6 +--
 .../taler-wallet-core/src/operations/recoup.ts     | 16 +++----
 .../taler-wallet-core/src/operations/refresh.ts    | 19 ++++----
 .../taler-wallet-core/src/operations/refund.ts     | 15 +++---
 packages/taler-wallet-core/src/operations/state.ts |  8 +---
 .../taler-wallet-core/src/operations/testing.ts    |  4 +-
 packages/taler-wallet-core/src/operations/tip.ts   | 15 +++---
 .../src/operations/transactions.ts                 |  4 +-
 .../src/operations/withdraw.test.ts                |  2 +-
 .../taler-wallet-core/src/operations/withdraw.ts   | 16 +++----
 .../src/util/coinSelection.test.ts                 |  4 +-
 .../taler-wallet-core/src/util/coinSelection.ts    |  2 +-
 packages/taler-wallet-core/src/util/http.ts        |  2 +-
 packages/taler-wallet-core/src/util/query.ts       |  3 +-
 pnpm-lock.yaml                                     | 14 +++++-
 36 files changed, 148 insertions(+), 170 deletions(-)

diff --git a/packages/taler-util/package.json b/packages/taler-util/package.json
index d0b70345..1f306041 100644
--- a/packages/taler-util/package.json
+++ b/packages/taler-util/package.json
@@ -40,9 +40,6 @@
     "tslib": "^2.1.0"
   },
   "ava": {
-    "require": [
-      "esm"
-    ],
     "files": [
       "lib/*test*"
     ]
diff --git a/packages/taler-util/src/codec.test.ts 
b/packages/taler-util/src/codec.test.ts
index f8f4c797..a4fa643c 100644
--- a/packages/taler-util/src/codec.test.ts
+++ b/packages/taler-util/src/codec.test.ts
@@ -25,7 +25,7 @@ import {
   codecForConstString,
   codecForString,
   buildCodecForUnion,
-} from "./codec";
+} from "./codec.js";
 
 interface MyObj {
   foo: string;
diff --git a/packages/taler-util/src/helpers.test.ts 
b/packages/taler-util/src/helpers.test.ts
index dbecf14b..0ea4c033 100644
--- a/packages/taler-util/src/helpers.test.ts
+++ b/packages/taler-util/src/helpers.test.ts
@@ -15,7 +15,7 @@
  */
 
 import test from "ava";
-import * as helpers from "./helpers";
+import * as helpers from "./helpers.js";
 
 test("URL canonicalization", (t) => {
   // converts to relative, adds https
diff --git a/packages/taler-util/src/i18n.ts b/packages/taler-util/src/i18n.ts
index a4b0bf81..4a938410 100644
--- a/packages/taler-util/src/i18n.ts
+++ b/packages/taler-util/src/i18n.ts
@@ -1,6 +1,6 @@
 // @ts-ignore: no type decl for this library
 import * as jedLib from "jed";
-import { Logger } from "./logging";
+import { Logger } from "./logging.js";
 
 const logger = new Logger("i18n/index.ts");
 
diff --git a/packages/taler-util/src/libtool-version.test.ts 
b/packages/taler-util/src/libtool-version.test.ts
index 19f99772..d3564251 100644
--- a/packages/taler-util/src/libtool-version.test.ts
+++ b/packages/taler-util/src/libtool-version.test.ts
@@ -14,7 +14,7 @@
  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 
-import * as LibtoolVersion from "./libtool-version";
+import * as LibtoolVersion from "./libtool-version.js";
 
 import test from "ava";
 
diff --git a/packages/taler-util/src/payto.test.ts 
b/packages/taler-util/src/payto.test.ts
index 01280b65..66a05b3a 100644
--- a/packages/taler-util/src/payto.test.ts
+++ b/packages/taler-util/src/payto.test.ts
@@ -16,7 +16,7 @@
 
 import test from "ava";
 
-import { parsePaytoUri } from "./payto";
+import { parsePaytoUri } from "./payto.js";
 
 test("basic payto parsing", (t) => {
   const r1 = parsePaytoUri("https://example.com/";);
diff --git a/packages/taler-util/src/talerconfig.test.ts 
b/packages/taler-util/src/talerconfig.test.ts
index 2f920fcc..dc4c4de1 100644
--- a/packages/taler-util/src/talerconfig.test.ts
+++ b/packages/taler-util/src/talerconfig.test.ts
@@ -18,7 +18,7 @@
  * Imports
  */
 import test from "ava";
-import { pathsub, Configuration } from "./talerconfig";
+import { pathsub, Configuration } from "./talerconfig.js";
 
 test("pathsub", (t) => {
   t.assert("foo" === pathsub("foo", () => undefined));
diff --git a/packages/taler-util/src/taleruri.test.ts 
b/packages/taler-util/src/taleruri.test.ts
index e80acc5c..5bf7ad4e 100644
--- a/packages/taler-util/src/taleruri.test.ts
+++ b/packages/taler-util/src/taleruri.test.ts
@@ -20,7 +20,7 @@ import {
   parseWithdrawUri,
   parseRefundUri,
   parseTipUri,
-} from "./taleruri";
+} from "./taleruri.js";
 
 test("taler pay url parsing: wrong scheme", (t) => {
   const url1 = "talerfoo://";
diff --git a/packages/taler-wallet-core/package.json 
b/packages/taler-wallet-core/package.json
index de974469..9956cb31 100644
--- a/packages/taler-wallet-core/package.json
+++ b/packages/taler-wallet-core/package.json
@@ -30,6 +30,7 @@
   ],
   "main": "./dist/taler-wallet-core.js",
   "module": "./lib/index.js",
+  "type": "module",
   "types": "./lib/index.d.ts",
   "devDependencies": {
     "@ava/typescript": "^1.1.1",
@@ -44,7 +45,6 @@
     "eslint-plugin-jsx-a11y": "^6.4.1",
     "eslint-plugin-react": "^7.22.0",
     "eslint-plugin-react-hooks": "^4.2.0",
-    "esm": "^3.2.25",
     "jed": "^1.1.1",
     "nyc": "^15.1.0",
     "po2json": "^0.4.5",
@@ -67,21 +67,8 @@
     "tslib": "^2.1.0"
   },
   "ava": {
-    "require": [
-      "esm"
-    ],
     "files": [
-      "src/**/*.test.*"
-    ],
-    "typescript": {
-      "extensions": [
-        "js",
-        "ts",
-        "tsx"
-      ],
-      "rewritePaths": {
-        "src/": "lib/"
-      }
-    }
+      "lib/**/*test*"
+    ]
   }
 }
diff --git a/packages/taler-wallet-core/src/crypto/primitives/kdf.ts 
b/packages/taler-wallet-core/src/crypto/primitives/kdf.ts
index edc681bc..af4d0503 100644
--- a/packages/taler-wallet-core/src/crypto/primitives/kdf.ts
+++ b/packages/taler-wallet-core/src/crypto/primitives/kdf.ts
@@ -14,8 +14,8 @@
  GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 
-import * as nacl from "./nacl-fast";
-import { sha256 } from "./sha256";
+import * as nacl from "./nacl-fast.js";
+import { sha256 } from "./sha256.js";
 
 export function sha512(data: Uint8Array): Uint8Array {
   return nacl.hash(data);
diff --git a/packages/taler-wallet-core/src/crypto/talerCrypto-test.ts 
b/packages/taler-wallet-core/src/crypto/talerCrypto-test.ts
index 99a0e12c..3718290d 100644
--- a/packages/taler-wallet-core/src/crypto/talerCrypto-test.ts
+++ b/packages/taler-wallet-core/src/crypto/talerCrypto-test.ts
@@ -30,9 +30,9 @@ import {
   stringToBytes,
   bytesToString,
   rsaVerify,
-} from "./talerCrypto";
-import { sha512, kdf } from "./primitives/kdf";
-import * as nacl from "./primitives/nacl-fast";
+} from "./talerCrypto.js";
+import { sha512, kdf } from "./primitives/kdf.js";
+import * as nacl from "./primitives/nacl-fast.js";
 
 test("encoding", (t) => {
   const s = "Hello, World";
diff --git a/packages/taler-wallet-core/src/crypto/talerCrypto.ts 
b/packages/taler-wallet-core/src/crypto/talerCrypto.ts
index 38189685..5739bc46 100644
--- a/packages/taler-wallet-core/src/crypto/talerCrypto.ts
+++ b/packages/taler-wallet-core/src/crypto/talerCrypto.ts
@@ -18,9 +18,9 @@
  * Native implementation of GNU Taler crypto.
  */
 
-import * as nacl from "./primitives/nacl-fast";
+import * as nacl from "./primitives/nacl-fast.js";
 import bigint from "big-integer";
-import { kdf } from "./primitives/kdf";
+import { kdf } from "./primitives/kdf.js";
 
 // @ts-ignore
 const decoder = new TextDecoder();
diff --git a/packages/taler-wallet-core/src/crypto/workers/cryptoApi.ts 
b/packages/taler-wallet-core/src/crypto/workers/cryptoApi.ts
index a3844106..54609977 100644
--- a/packages/taler-wallet-core/src/crypto/workers/cryptoApi.ts
+++ b/packages/taler-wallet-core/src/crypto/workers/cryptoApi.ts
@@ -22,9 +22,9 @@
 /**
  * Imports.
  */
-import { CoinRecord, DenominationRecord, WireFee } from "../../db";
+import { CoinRecord, DenominationRecord, WireFee } from "../../db.js";
 
-import { CryptoWorker } from "./cryptoWorker";
+import { CryptoWorker } from "./cryptoWorker.js";
 
 import { RecoupRequest, CoinDepositPermission } from "@gnu-taler/taler-util";
 
@@ -36,7 +36,7 @@ import {
   MakeSyncSignatureRequest,
 } from "@gnu-taler/taler-util";
 
-import * as timer from "../../util/timer";
+import * as timer from "../../util/timer.js";
 import { Logger } from "@gnu-taler/taler-util";
 import {
   DerivedRefreshSession,
diff --git a/packages/taler-wallet-core/src/db.ts 
b/packages/taler-wallet-core/src/db.ts
index 62b0e228..8f9d5757 100644
--- a/packages/taler-wallet-core/src/db.ts
+++ b/packages/taler-wallet-core/src/db.ts
@@ -26,7 +26,7 @@ import {
   StoreDescriptor,
   StoreWithIndexes,
   IndexDescriptor,
-} from "./util/query";
+} from "./util/query.js";
 import { IDBFactory, IDBDatabase, IDBTransaction } from 
"@gnu-taler/idb-bridge";
 import { Logger } from "@gnu-taler/taler-util";
 import {
diff --git a/packages/taler-wallet-core/src/operations/backup/export.ts 
b/packages/taler-wallet-core/src/operations/backup/export.ts
index a62c26d6..4eab9d5e 100644
--- a/packages/taler-wallet-core/src/operations/backup/export.ts
+++ b/packages/taler-wallet-core/src/operations/backup/export.ts
@@ -24,7 +24,7 @@
 /**
  * Imports.
  */
-import { hash } from "../../crypto/primitives/nacl-fast";
+import { hash } from "../../crypto/primitives/nacl-fast.js";
 import {
   WalletBackupContentV1,
   BackupExchange,
@@ -49,11 +49,8 @@ import {
   BackupRefreshSession,
   BackupExchangeDetails,
 } from "@gnu-taler/taler-util";
-import { InternalWalletState } from "../state";
-import {
-  provideBackupState,
-  getWalletBackupState,
-} from "./state";
+import { InternalWalletState } from "../state.js";
+import { provideBackupState, getWalletBackupState } from "./state";
 import { Amounts, getTimestampNow } from "@gnu-taler/taler-util";
 import {
   CoinSourceType,
diff --git a/packages/taler-wallet-core/src/operations/backup/import.ts 
b/packages/taler-wallet-core/src/operations/backup/import.ts
index b2949194..1caa508f 100644
--- a/packages/taler-wallet-core/src/operations/backup/import.ts
+++ b/packages/taler-wallet-core/src/operations/backup/import.ts
@@ -50,9 +50,9 @@ import { PayCoinSelection } from "../../util/coinSelection";
 import { j2s } from "@gnu-taler/taler-util";
 import { checkDbInvariant, checkLogicInvariant } from "../../util/invariants";
 import { Logger } from "@gnu-taler/taler-util";
-import { initRetryInfo } from "../../util/retries";
-import { InternalWalletState } from "../state";
-import { provideBackupState } from "./state";
+import { initRetryInfo } from "../../util/retries.js";
+import { InternalWalletState } from "../state.js";
+import { provideBackupState } from "./state.js";
 import { makeEventId, TombstoneTag } from "../transactions.js";
 import { getExchangeDetails } from "../exchanges.js";
 import { GetReadOnlyAccess, GetReadWriteAccess } from "../../util/query.js";
diff --git a/packages/taler-wallet-core/src/operations/backup/index.ts 
b/packages/taler-wallet-core/src/operations/backup/index.ts
index 86f1df54..00a76bd1 100644
--- a/packages/taler-wallet-core/src/operations/backup/index.ts
+++ b/packages/taler-wallet-core/src/operations/backup/index.ts
@@ -24,7 +24,7 @@
 /**
  * Imports.
  */
-import { InternalWalletState } from "../state";
+import { InternalWalletState } from "../state.js";
 import {
   AmountString,
   BackupRecovery,
@@ -38,7 +38,7 @@ import {
   WalletBackupConfState,
   WALLET_BACKUP_STATE_KEY,
 } from "../../db.js";
-import { checkDbInvariant, checkLogicInvariant } from "../../util/invariants";
+import { checkDbInvariant, checkLogicInvariant } from 
"../../util/invariants.js";
 import {
   bytesToString,
   decodeCrock,
@@ -49,7 +49,7 @@ import {
   hash,
   rsaBlind,
   stringToBytes,
-} from "../../crypto/talerCrypto";
+} from "../../crypto/talerCrypto.js";
 import { canonicalizeBaseUrl, canonicalJson, j2s } from 
"@gnu-taler/taler-util";
 import {
   durationFromSpec,
@@ -57,7 +57,7 @@ import {
   Timestamp,
   timestampAddDuration,
 } from "@gnu-taler/taler-util";
-import { URL } from "../../util/url";
+import { URL } from "../../util/url.js";
 import {
   buildCodecForObject,
   Codec,
@@ -70,11 +70,11 @@ import {
   HttpResponseStatus,
   readSuccessResponseJsonOrThrow,
   readTalerErrorResponse,
-} from "../../util/http";
+} from "../../util/http.js";
 import { Logger } from "@gnu-taler/taler-util";
 import { gunzipSync, gzipSync } from "fflate";
-import { kdf } from "../../crypto/primitives/kdf";
-import { initRetryInfo } from "../../util/retries";
+import { kdf } from "../../crypto/primitives/kdf.js";
+import { initRetryInfo } from "../../util/retries.js";
 import {
   ConfirmPayResultType,
   PreparePayResultType,
@@ -82,12 +82,12 @@ import {
   RecoveryMergeStrategy,
   TalerErrorDetails,
 } from "@gnu-taler/taler-util";
-import { CryptoApi } from "../../crypto/workers/cryptoApi";
-import { secretbox, secretbox_open } from "../../crypto/primitives/nacl-fast";
-import { checkPaymentByProposalId, confirmPay, preparePayForUri } from 
"../pay";
-import { exportBackup } from "./export";
-import { BackupCryptoPrecomputedData, importBackup } from "./import";
-import { provideBackupState, getWalletBackupState } from "./state";
+import { CryptoApi } from "../../crypto/workers/cryptoApi.js";
+import { secretbox, secretbox_open } from 
"../../crypto/primitives/nacl-fast.js";
+import { checkPaymentByProposalId, confirmPay, preparePayForUri } from 
"../pay.js";
+import { exportBackup } from "./export.js";
+import { BackupCryptoPrecomputedData, importBackup } from "./import.js";
+import { provideBackupState, getWalletBackupState } from "./state.js";
 
 const logger = new Logger("operations/backup.ts");
 
diff --git a/packages/taler-wallet-core/src/operations/backup/state.ts 
b/packages/taler-wallet-core/src/operations/backup/state.ts
index 1ab0c027..bb540d5a 100644
--- a/packages/taler-wallet-core/src/operations/backup/state.ts
+++ b/packages/taler-wallet-core/src/operations/backup/state.ts
@@ -14,16 +14,16 @@
  GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 
+import { encodeCrock, getRandomBytes } from "../../crypto/talerCrypto.js";
 import {
   ConfigRecord,
   WalletBackupConfState,
   WalletStoresV1,
   WALLET_BACKUP_STATE_KEY,
 } from "../../db.js";
-import { getRandomBytes, encodeCrock } from "../../index.js";
-import { checkDbInvariant } from "../../util/invariants";
+import { checkDbInvariant } from "../../util/invariants.js";
 import { GetReadOnlyAccess } from "../../util/query.js";
-import { InternalWalletState } from "../state";
+import { InternalWalletState } from "../state.js";
 
 export async function provideBackupState(
   ws: InternalWalletState,
diff --git a/packages/taler-wallet-core/src/operations/deposits.ts 
b/packages/taler-wallet-core/src/operations/deposits.ts
index 23cc435f..c376ae8e 100644
--- a/packages/taler-wallet-core/src/operations/deposits.ts
+++ b/packages/taler-wallet-core/src/operations/deposits.ts
@@ -14,16 +14,16 @@
  GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 
-import { kdf } from "../crypto/primitives/kdf";
+import { kdf } from "../crypto/primitives/kdf.js";
 import {
   encodeCrock,
   getRandomBytes,
   stringToBytes,
-} from "../crypto/talerCrypto";
-import { selectPayCoins } from "../util/coinSelection";
+} from "../crypto/talerCrypto.js";
+import { selectPayCoins } from "../util/coinSelection.js";
 import { canonicalJson } from "@gnu-taler/taler-util";
-import { readSuccessResponseJsonOrThrow } from "../util/http";
-import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries";
+import { readSuccessResponseJsonOrThrow } from "../util/http.js";
+import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries.js";
 import {
   Amounts,
   buildCodecForObject,
@@ -53,8 +53,8 @@ import {
   getCandidatePayCoins,
   getEffectiveDepositAmount,
   getTotalPaymentCost,
-} from "./pay";
-import { InternalWalletState } from "./state";
+} from "./pay.js";
+import { InternalWalletState } from "./state.js";
 import { Logger } from "@gnu-taler/taler-util";
 import { DepositGroupRecord } from "../db.js";
 
diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts 
b/packages/taler-wallet-core/src/operations/exchanges.ts
index 1f9a2ea6..1948f70e 100644
--- a/packages/taler-wallet-core/src/operations/exchanges.ts
+++ b/packages/taler-wallet-core/src/operations/exchanges.ts
@@ -47,15 +47,6 @@ import {
   WireInfo,
   WalletStoresV1,
 } from "../db.js";
-import {
-  URL,
-  readSuccessResponseJsonOrThrow,
-  getExpiryTimestamp,
-  readSuccessResponseTextOrThrow,
-  encodeCrock,
-  hash,
-  decodeCrock,
-} from "../index.js";
 import { j2s, canonicalizeBaseUrl } from "@gnu-taler/taler-util";
 import { updateRetryInfoTimeout, initRetryInfo } from "../util/retries.js";
 import {
@@ -69,9 +60,11 @@ import {
   WALLET_CACHE_BREAKER_CLIENT_VERSION,
   WALLET_EXCHANGE_PROTOCOL_VERSION,
 } from "./versions.js";
-import { HttpRequestLibrary } from "../util/http.js";
+import { getExpiryTimestamp, HttpRequestLibrary, 
readSuccessResponseJsonOrThrow, readSuccessResponseTextOrThrow } from 
"../util/http.js";
 import { CryptoApi } from "../crypto/workers/cryptoApi.js";
 import { DbAccess, GetReadOnlyAccess } from "../util/query.js";
+import { decodeCrock, encodeCrock, hash } from "../crypto/talerCrypto.js";
+import { URL } from "../util/url.js";
 
 const logger = new Logger("exchanges.ts");
 
diff --git a/packages/taler-wallet-core/src/operations/pay.ts 
b/packages/taler-wallet-core/src/operations/pay.ts
index 9bfad177..4425262b 100644
--- a/packages/taler-wallet-core/src/operations/pay.ts
+++ b/packages/taler-wallet-core/src/operations/pay.ts
@@ -54,29 +54,6 @@ import {
   getDurationRemaining,
 } from "@gnu-taler/taler-util";
 import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto";
-import {
-  AbortStatus,
-  AllowedAuditorInfo,
-  AllowedExchangeInfo,
-  CoinRecord,
-  CoinStatus,
-  DenominationRecord,
-  getHttpResponseErrorDetails,
-  guardOperationException,
-  HttpResponseStatus,
-  makeErrorDetails,
-  OperationFailedAndReportedError,
-  OperationFailedError,
-  ProposalRecord,
-  ProposalStatus,
-  PurchaseRecord,
-  readSuccessResponseJsonOrErrorCode,
-  readSuccessResponseJsonOrThrow,
-  readTalerErrorResponse,
-  throwUnexpectedRequestError,
-  URL,
-  WalletContractData,
-} from "../index.js";
 import {
   PayCoinSelection,
   CoinCandidateSelection,
@@ -94,10 +71,35 @@ import { getTotalRefreshCost, createRefreshGroup } from 
"./refresh.js";
 import { InternalWalletState, EXCHANGE_COINS_LOCK } from "./state.js";
 import { ContractTermsUtil } from "../util/contractTerms.js";
 import { getExchangeDetails } from "./exchanges.js";
-import { DbAccess, GetReadWriteAccess } from "../util/query.js";
-import { WalletStoresV1 } from "../db.js";
-import { Wallet } from "../wallet.js";
-import { x25519_edwards_keyPair_fromSecretKey } from 
"../crypto/primitives/nacl-fast.js";
+import { GetReadWriteAccess } from "../util/query.js";
+import {
+  AbortStatus,
+  AllowedAuditorInfo,
+  AllowedExchangeInfo,
+  CoinRecord,
+  CoinStatus,
+  DenominationRecord,
+  ProposalRecord,
+  ProposalStatus,
+  PurchaseRecord,
+  WalletContractData,
+  WalletStoresV1,
+} from "../db.js";
+import {
+  getHttpResponseErrorDetails,
+  HttpResponseStatus,
+  readSuccessResponseJsonOrErrorCode,
+  readSuccessResponseJsonOrThrow,
+  readTalerErrorResponse,
+  throwUnexpectedRequestError,
+} from "../util/http.js";
+import {
+  guardOperationException,
+  makeErrorDetails,
+  OperationFailedAndReportedError,
+  OperationFailedError,
+} from "./errors.js";
+import { URL } from "../util/url.js";
 
 /**
  * Logger.
diff --git a/packages/taler-wallet-core/src/operations/pending.ts 
b/packages/taler-wallet-core/src/operations/pending.ts
index 8ab114ca..8201e8cb 100644
--- a/packages/taler-wallet-core/src/operations/pending.ts
+++ b/packages/taler-wallet-core/src/operations/pending.ts
@@ -27,10 +27,10 @@ import {
   PendingOperationsResponse,
   PendingOperationType,
   ReserveType,
-} from "../pending-types";
+} from "../pending-types.js";
 import { getTimestampNow, Timestamp } from "@gnu-taler/taler-util";
-import { InternalWalletState } from "./state";
-import { getBalancesInsideTransaction } from "./balance";
+import { InternalWalletState } from "./state.js";
+import { getBalancesInsideTransaction } from "./balance.js";
 import { GetReadOnlyAccess } from "../util/query.js";
 
 async function gatherExchangePending(
diff --git a/packages/taler-wallet-core/src/operations/recoup.ts 
b/packages/taler-wallet-core/src/operations/recoup.ts
index 24ac828f..938422d3 100644
--- a/packages/taler-wallet-core/src/operations/recoup.ts
+++ b/packages/taler-wallet-core/src/operations/recoup.ts
@@ -32,7 +32,7 @@ import {
   RefreshReason,
   TalerErrorDetails,
 } from "@gnu-taler/taler-util";
-import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto";
+import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto.js";
 import {
   CoinRecord,
   CoinSourceType,
@@ -44,14 +44,14 @@ import {
   WalletStoresV1,
 } from "../db.js";
 
-import { readSuccessResponseJsonOrThrow } from "../util/http";
+import { readSuccessResponseJsonOrThrow } from "../util/http.js";
 import { Logger } from "@gnu-taler/taler-util";
-import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries";
-import { URL } from "../util/url";
-import { guardOperationException } from "./errors";
-import { createRefreshGroup, processRefreshGroup } from "./refresh";
-import { getReserveRequestTimeout, processReserve } from "./reserves";
-import { InternalWalletState } from "./state";
+import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries.js";
+import { URL } from "../util/url.js";
+import { guardOperationException } from "./errors.js";
+import { createRefreshGroup, processRefreshGroup } from "./refresh.js";
+import { getReserveRequestTimeout, processReserve } from "./reserves.js";
+import { InternalWalletState } from "./state.js";
 import { GetReadWriteAccess } from "../util/query.js";
 
 const logger = new Logger("operations/recoup.ts");
diff --git a/packages/taler-wallet-core/src/operations/refresh.ts 
b/packages/taler-wallet-core/src/operations/refresh.ts
index 0b0eb4c4..c442a7c9 100644
--- a/packages/taler-wallet-core/src/operations/refresh.ts
+++ b/packages/taler-wallet-core/src/operations/refresh.ts
@@ -14,7 +14,7 @@
  GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 
-import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto";
+import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto.js";
 import {
   CoinRecord,
   CoinSourceType,
@@ -36,10 +36,10 @@ import {
 } from "@gnu-taler/taler-util";
 import { AmountJson, Amounts } from "@gnu-taler/taler-util";
 import { amountToPretty } from "@gnu-taler/taler-util";
-import { readSuccessResponseJsonOrThrow } from "../util/http";
-import { checkDbInvariant } from "../util/invariants";
+import { readSuccessResponseJsonOrThrow } from "../util/http.js";
+import { checkDbInvariant } from "../util/invariants.js";
 import { Logger } from "@gnu-taler/taler-util";
-import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries";
+import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries.js";
 import {
   Duration,
   durationFromSpec,
@@ -51,14 +51,13 @@ import {
   timestampDifference,
   timestampMin,
 } from "@gnu-taler/taler-util";
-import { URL } from "../util/url";
-import { guardOperationException } from "./errors";
-import { updateExchangeFromUrl } from "./exchanges";
-import { EXCHANGE_COINS_LOCK, InternalWalletState } from "./state";
-import { isWithdrawableDenom, selectWithdrawalDenominations } from 
"./withdraw";
+import { URL } from "../util/url.js";
+import { guardOperationException } from "./errors.js";
+import { updateExchangeFromUrl } from "./exchanges.js";
+import { EXCHANGE_COINS_LOCK, InternalWalletState } from "./state.js";
+import { isWithdrawableDenom, selectWithdrawalDenominations } from 
"./withdraw.js";
 import { RefreshNewDenomInfo } from "../crypto/cryptoTypes.js";
 import { GetReadWriteAccess } from "../util/query.js";
-import { Wallet } from "../wallet.js";
 
 const logger = new Logger("refresh.ts");
 
diff --git a/packages/taler-wallet-core/src/operations/refund.ts 
b/packages/taler-wallet-core/src/operations/refund.ts
index b3d368af..6ef55e53 100644
--- a/packages/taler-wallet-core/src/operations/refund.ts
+++ b/packages/taler-wallet-core/src/operations/refund.ts
@@ -23,12 +23,10 @@
 /**
  * Imports.
  */
-import { InternalWalletState } from "./state";
-import { guardOperationException } from "./errors";
+import { InternalWalletState } from "./state.js";
+import { guardOperationException } from "./errors.js";
 import {
   getTimestampNow,
-  Timestamp,
-  durationAdd,
   timestampAddDuration,
   TalerErrorDetails,
   AbortingCoin,
@@ -47,10 +45,10 @@ import {
   RefreshReason,
 } from "@gnu-taler/taler-util";
 import { Logger } from "@gnu-taler/taler-util";
-import { readSuccessResponseJsonOrThrow } from "../util/http";
-import { URL } from "../util/url";
-import { updateRetryInfoTimeout, initRetryInfo } from "../util/retries";
-import { checkDbInvariant } from "../util/invariants";
+import { readSuccessResponseJsonOrThrow } from "../util/http.js";
+import { URL } from "../util/url.js";
+import { updateRetryInfoTimeout, initRetryInfo } from "../util/retries.js";
+import { checkDbInvariant } from "../util/invariants.js";
 import { TalerErrorCode } from "@gnu-taler/taler-util";
 import {
   PurchaseRecord,
@@ -62,7 +60,6 @@ import {
 } from "../db.js";
 import { getTotalRefreshCost, createRefreshGroup } from "./refresh.js";
 import { GetReadWriteAccess } from "../util/query.js";
-import { Wallet } from "../wallet.js";
 
 const logger = new Logger("refund.ts");
 
diff --git a/packages/taler-wallet-core/src/operations/state.ts 
b/packages/taler-wallet-core/src/operations/state.ts
index 9bf73142..66baa95a 100644
--- a/packages/taler-wallet-core/src/operations/state.ts
+++ b/packages/taler-wallet-core/src/operations/state.ts
@@ -22,16 +22,12 @@ import {
   BalancesResponse,
   Logger,
 } from "@gnu-taler/taler-util";
+import { CryptoApi, CryptoWorkerFactory } from 
"../crypto/workers/cryptoApi.js";
 import { WalletStoresV1 } from "../db.js";
-import {
-  CryptoApi,
-  OpenedPromise,
-  CryptoWorkerFactory,
-  openPromise,
-} from "../index.js";
 import { PendingOperationsResponse } from "../pending-types.js";
 import { AsyncOpMemoMap, AsyncOpMemoSingle } from "../util/asyncMemo.js";
 import { HttpRequestLibrary } from "../util/http";
+import { OpenedPromise, openPromise } from "../util/promiseUtils.js";
 import { DbAccess } from "../util/query.js";
 
 type NotificationListener = (n: WalletNotification) => void;
diff --git a/packages/taler-wallet-core/src/operations/testing.ts 
b/packages/taler-wallet-core/src/operations/testing.ts
index c9d99bf0..b163569a 100644
--- a/packages/taler-wallet-core/src/operations/testing.ts
+++ b/packages/taler-wallet-core/src/operations/testing.ts
@@ -22,7 +22,7 @@ import {
   HttpRequestLibrary,
   readSuccessResponseJsonOrThrow,
   checkSuccessResponseOrThrow,
-} from "../util/http";
+} from "../util/http.js";
 import {
   AmountString,
   codecForAny,
@@ -33,10 +33,10 @@ import {
   TestPayArgs,
   PreparePayResultType,
 } from "@gnu-taler/taler-util";
-import { URL } from "../index.js";
 import { Wallet } from "../wallet.js";
 import { createTalerWithdrawReserve } from "./reserves.js";
 import { InternalWalletState } from "./state.js";
+import { URL } from "../util/url.js";
 
 const logger = new Logger("operations/testing.ts");
 
diff --git a/packages/taler-wallet-core/src/operations/tip.ts 
b/packages/taler-wallet-core/src/operations/tip.ts
index b96a8fce..d8233163 100644
--- a/packages/taler-wallet-core/src/operations/tip.ts
+++ b/packages/taler-wallet-core/src/operations/tip.ts
@@ -37,19 +37,12 @@ import {
   CoinSourceType,
   CoinStatus,
 } from "../db.js";
-import {
-  URL,
-  readSuccessResponseJsonOrThrow,
-  encodeCrock,
-  getRandomBytes,
-  getHttpResponseErrorDetails,
-} from "../index.js";
 import { j2s } from "@gnu-taler/taler-util";
 import { checkDbInvariant, checkLogicInvariant } from "../util/invariants.js";
 import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries.js";
 import { guardOperationException, makeErrorDetails } from "./errors.js";
 import { updateExchangeFromUrl } from "./exchanges.js";
-import { InternalWalletState } from "./state";
+import { InternalWalletState } from "./state.js";
 import {
   getExchangeWithdrawalInfo,
   updateWithdrawalDenoms,
@@ -57,6 +50,12 @@ import {
   selectWithdrawalDenominations,
   denomSelectionInfoToState,
 } from "./withdraw.js";
+import { URL } from "../util/url.js";
+import {
+  getHttpResponseErrorDetails,
+  readSuccessResponseJsonOrThrow,
+} from "../util/http.js";
+import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto.js";
 
 const logger = new Logger("operations/tip.ts");
 
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts 
b/packages/taler-wallet-core/src/operations/transactions.ts
index ecef3c2c..3d9f1be4 100644
--- a/packages/taler-wallet-core/src/operations/transactions.ts
+++ b/packages/taler-wallet-core/src/operations/transactions.ts
@@ -17,7 +17,7 @@
 /**
  * Imports.
  */
-import { InternalWalletState } from "./state";
+import { InternalWalletState } from "./state.js";
 import {
   WalletRefundItem,
   RefundState,
@@ -36,7 +36,7 @@ import {
   WithdrawalDetails,
   OrderShortInfo,
 } from "@gnu-taler/taler-util";
-import { getFundingPaytoUris } from "./reserves";
+import { getFundingPaytoUris } from "./reserves.js";
 import { getExchangeDetails } from "./exchanges.js";
 
 /**
diff --git a/packages/taler-wallet-core/src/operations/withdraw.test.ts 
b/packages/taler-wallet-core/src/operations/withdraw.test.ts
index a059eef9..c6de0a32 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.test.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.test.ts
@@ -17,7 +17,7 @@
 import { Amounts } from "@gnu-taler/taler-util";
 import test from "ava";
 import { DenominationRecord, DenominationStatus } from "../db.js";
-import { selectWithdrawalDenominations } from "./withdraw";
+import { selectWithdrawalDenominations } from "./withdraw.js";
 
 test("withdrawal selection bug repro", (t) => {
   const amount = {
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts 
b/packages/taler-wallet-core/src/operations/withdraw.ts
index 9f5c225f..3400238e 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -35,7 +35,7 @@ import {
   DenomSelectionState,
   ExchangeRecord,
   ExchangeDetailsRecord,
-} from "../db";
+} from "../db.js";
 import {
   BankWithdrawDetails,
   TalerErrorDetails,
@@ -48,20 +48,20 @@ import {
   WithdrawResponse,
   codecForTalerConfigResponse,
 } from "@gnu-taler/taler-util";
-import { InternalWalletState } from "./state";
+import { InternalWalletState } from "./state.js";
 import { Logger } from "@gnu-taler/taler-util";
-import { getExchangeDetails, updateExchangeFromUrl } from "./exchanges";
+import { getExchangeDetails, updateExchangeFromUrl } from "./exchanges.js";
 import {
   WALLET_EXCHANGE_PROTOCOL_VERSION,
   WALLET_BANK_INTEGRATION_PROTOCOL_VERSION,
-} from "./versions";
+} from "./versions.js";
 
 import * as LibtoolVersion from "@gnu-taler/taler-util";
 import {
   guardOperationException,
   makeErrorDetails,
   OperationFailedError,
-} from "./errors";
+} from "./errors.js";
 import { NotificationType } from "@gnu-taler/taler-util";
 import {
   getTimestampNow,
@@ -69,10 +69,10 @@ import {
   timestampCmp,
   timestampSubtractDuraction,
 } from "@gnu-taler/taler-util";
-import { readSuccessResponseJsonOrThrow } from "../util/http";
-import { URL } from "../util/url";
+import { readSuccessResponseJsonOrThrow } from "../util/http.js";
+import { URL } from "../util/url.js";
 import { TalerErrorCode } from "@gnu-taler/taler-util";
-import { updateRetryInfoTimeout, initRetryInfo } from "../util/retries";
+import { updateRetryInfoTimeout, initRetryInfo } from "../util/retries.js";
 import { compare } from "@gnu-taler/taler-util";
 import { walletCoreDebugFlags } from "../util/debugFlags.js";
 import { getExchangeTrust } from "./currencies.js";
diff --git a/packages/taler-wallet-core/src/util/coinSelection.test.ts 
b/packages/taler-wallet-core/src/util/coinSelection.test.ts
index bfcd05cc..1e87bc1f 100644
--- a/packages/taler-wallet-core/src/util/coinSelection.test.ts
+++ b/packages/taler-wallet-core/src/util/coinSelection.test.ts
@@ -17,9 +17,9 @@
 /**
  * Imports.
  */
+ import test from "ava";
 import { AmountJson, Amounts } from "@gnu-taler/taler-util";
-import test from "ava";
-import { AvailableCoinInfo, selectPayCoins } from "./coinSelection";
+import { AvailableCoinInfo, selectPayCoins } from "./coinSelection.js";
 
 function a(x: string): AmountJson {
   const amt = Amounts.parse(x);
diff --git a/packages/taler-wallet-core/src/util/coinSelection.ts 
b/packages/taler-wallet-core/src/util/coinSelection.ts
index bd90526a..500cee5d 100644
--- a/packages/taler-wallet-core/src/util/coinSelection.ts
+++ b/packages/taler-wallet-core/src/util/coinSelection.ts
@@ -23,7 +23,7 @@
 /**
  * Imports.
  */
-import { AmountJson, AmountLike, Amounts } from "@gnu-taler/taler-util";
+import { AmountJson, Amounts } from "@gnu-taler/taler-util";
 import { strcmp, Logger } from "@gnu-taler/taler-util";
 
 const logger = new Logger("coinSelection.ts");
diff --git a/packages/taler-wallet-core/src/util/http.ts 
b/packages/taler-wallet-core/src/util/http.ts
index 649105f2..868619ad 100644
--- a/packages/taler-wallet-core/src/util/http.ts
+++ b/packages/taler-wallet-core/src/util/http.ts
@@ -24,7 +24,7 @@
 /**
  * Imports
  */
-import { OperationFailedError, makeErrorDetails } from "../operations/errors";
+import { OperationFailedError, makeErrorDetails } from 
"../operations/errors.js";
 import {
   Logger,
   Duration,
diff --git a/packages/taler-wallet-core/src/util/query.ts 
b/packages/taler-wallet-core/src/util/query.ts
index cf3f791d..c7c08b47 100644
--- a/packages/taler-wallet-core/src/util/query.ts
+++ b/packages/taler-wallet-core/src/util/query.ts
@@ -23,7 +23,7 @@
 /**
  * Imports.
  */
-import { openPromise } from "./promiseUtils";
+import { openPromise } from "./promiseUtils.js";
 import {
   IDBRequest,
   IDBTransaction,
@@ -31,7 +31,6 @@ import {
   IDBDatabase,
   IDBFactory,
   IDBVersionChangeEvent,
-  Event,
   IDBCursor,
   IDBKeyPath,
 } from "@gnu-taler/idb-bridge";
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 10198d6a..c02ed18d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -46,6 +46,7 @@ importers:
       '@types/node': ^14.14.22
       ava: ^3.15.0
       esbuild: ^0.9.2
+      esm: ^3.2.25
       jed: ^1.1.1
       prettier: ^2.2.1
       rimraf: ^3.0.2
@@ -58,6 +59,7 @@ importers:
       '@types/node': 14.14.34
       ava: 3.15.0
       esbuild: 0.9.2
+      esm: 3.2.25
       prettier: 2.2.1
       rimraf: 3.0.2
       typescript: 4.2.3
@@ -6163,7 +6165,7 @@ packages:
   /axios/0.21.1:
     resolution: {integrity: 
sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==}
     dependencies:
-      follow-redirects: 1.14.0_debug@4.3.1
+      follow-redirects: 1.14.0
     transitivePeerDependencies:
       - debug
 
@@ -9658,6 +9660,15 @@ packages:
       readable-stream: 2.3.7
     dev: true
 
+  /follow-redirects/1.14.0:
+    resolution: {integrity: 
sha512-0vRwd7RKQBTt+mgu87mtYeofLFZpTas2S9zY+jIeuLJMNvudIgF52nr19q40HOwH5RrhWIPuj9puybzSJiRrVg==}
+    engines: {node: '>=4.0'}
+    peerDependencies:
+      debug: '*'
+    peerDependenciesMeta:
+      debug:
+        optional: true
+
   /follow-redirects/1.14.0_debug@4.3.1:
     resolution: {integrity: 
sha512-0vRwd7RKQBTt+mgu87mtYeofLFZpTas2S9zY+jIeuLJMNvudIgF52nr19q40HOwH5RrhWIPuj9puybzSJiRrVg==}
     engines: {node: '>=4.0'}
@@ -9668,6 +9679,7 @@ packages:
         optional: true
     dependencies:
       debug: 4.3.1_supports-color@6.1.0
+    dev: true
 
   /for-each/0.3.3:
     resolution: {integrity: 
sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]