Israeli Bank Importer - v1.44.5
    Preparing search index...

    Persists app-OTP requests and their answers as files on a shared volume.

    Index
    • Publishes a new request as its own file.

      Parameters

      • bankId: string

        The bank the OTP is for.

      • ttlMs: number

        Time-to-live in milliseconds before the request expires.

      • now: number = ...

        Current time in epoch ms (defaults to Date.now()).

      Returns IOtpRequest

      The created request.

      StorageError when the request cannot be published.

    • Lists the live requests that have no answer yet, oldest first.

      Parameters

      • now: number = ...

        Current time in epoch ms (defaults to Date.now()).

      Returns IOtpRequest[]

      The pending requests; none when the directory cannot be read.

    • Publishes the user's code as a live request's answer.

      Once the code is published, the request is read again: an importer that gives the request up removes the request file before its last look at the answer, so a missing request means that look may be over. The code is then withdrawn, unless the importer has already used it.

      Parameters

      • id: string

        The request id to submit against.

      • code: string

        The OTP code entered by the user.

      • now: number = ...

        Current time in epoch ms (defaults to Date.now()).

      Returns boolean

      True when the code was accepted; false when there is no such live request, it already has an answer, or the importer gave it up while the code was being published.

      StorageError when the request cannot be read or the answer saved, or, after withdrawing the code, when the request cannot be read again.

    • Looks for the answer to a request, settling it once there is one or the deadline is reached.

      A code ends the request: it is returned, the request file removed and the code replaced by a tombstone, all best-effort, so a code that has arrived is never withheld. Settling, with a code or an expiry, also removes any staged copy of the answer a publish left behind. At the deadline the importer races the portal for the answer: winning records the expiry, and losing means the portal published a code in time, which is returned. If the expiry cannot be recorded, the importer gives the request up, still taking a code that has arrived.

      Parameters

      • request: IOtpRequest

        The request create returned.

      • now: number = ...

        Current time in epoch ms (defaults to Date.now()).

      Returns OtpPoll

      Whether to keep waiting, the code, or that the request expired.

      StorageError when the expiry cannot be recorded and no code has arrived, or the answer that beat it cannot be read; the request file is removed first, so the portal stops offering it.