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

    Read/write access to the durable long-term tokens, keyed by store key.

    The key is opaque and stored verbatim. Production passes `bankId:accountKey`, so two accounts at one bank keep separate tokens; an implementation that normalised the key would collapse them onto one entry, and since each mint revokes the token it replaces, both accounts would then cost an SMS on every run.

    interface IBankTokenStore {
        read: (storeKey: string) => Procedure<ITokenView>;
        write: (
            storeKey: string,
            token: string,
            login: string,
        ) => Procedure<IBankTokenWrite>;
        remove: (storeKey: string) => Procedure<IBankTokenWrite>;
        removeMatching: (
            storeKey: string,
            digest: string,
        ) => Procedure<TokenRetirement>;
        sweepStagedLeftovers: () => Procedure<ISweepReport>;
    }

    Implemented by

    Index
    read: (storeKey: string) => Procedure<ITokenView>

    Returns what the file says about one bank account.

    Type Declaration

      • (storeKey: string): Procedure<ITokenView>
      • Parameters

        • storeKey: string

          Opaque key identifying one bank account.

        Returns Procedure<ITokenView>

        The account's view of the file, or why the store is unreadable.

    write: (
        storeKey: string,
        token: string,
        login: string,
    ) => Procedure<IBankTokenWrite>

    Persists one bank account's long-term token, bound to the login that minted it.

    Type Declaration

      • (storeKey: string, token: string, login: string): Procedure<IBankTokenWrite>
      • Parameters

        • storeKey: string

          Opaque key identifying one bank account.

        • token: string

          The long-term token to persist.

        • login: string

          Fingerprint of the login that minted the token.

        Returns Procedure<IBankTokenWrite>

        Whether the file was replaced, or why it was not.

    remove: (storeKey: string) => Procedure<IBankTokenWrite>

    Deletes one bank account's entry, keeping every other entry as it was.

    Type Declaration

    removeMatching: (storeKey: string, digest: string) => Procedure<TokenRetirement>

    Deletes one bank account's entry only while it still holds a given token.

    Type Declaration

      • (storeKey: string, digest: string): Procedure<TokenRetirement>
      • Parameters

        • storeKey: string

          Opaque key identifying one bank account.

        • digest: string

          Digest of the token to retire; never the token itself.

        Returns Procedure<TokenRetirement>

        What the entry held, or why the file could not be read or replaced.

    sweepStagedLeftovers: () => Procedure<ISweepReport>

    Deletes staged token files an earlier run was killed before cleaning up.

    Type Declaration