@yoshteq/ti365-ts-sdk
    Preparing search index...

    Class CardService

    Provides high-level operations for managing and interacting with cards in the Ti365 system.

    The CardService class encapsulates logic for retrieving card information, managing PINs, and handling certificate-related operations. It interacts with various services provided by the TI365 connector, including event, card, and certificate services.

    • Caches card data for performance, with optional cache purging.
    • Delegates PIN and certificate operations to the appropriate connector services.
    const cardService = new CardService(session);
    const cards = await cardService.getCards();
    const pinStatus = await cardService.getPinStatus(card, pinType);
    Index

    Methods

    • Retrieves a card of the specified type from the available cards.

      Parameters

      • type: CardType

        The type of card to retrieve

      • purgeCache: boolean = false

        Optional flag to force refresh the card cache. Defaults to false

      Returns Promise<undefined | Card>

      A Promise that resolves to the found card or undefined if no matching card exists

    • Finds a card with the specified ICCSN (Integrated Circuit Card Serial Number).

      Parameters

      • iccsn: string

        The ICCSN to search for

      • purgeCache: boolean = false

        Optional flag to force refresh the card cache. Defaults to false

      Returns Promise<undefined | Card>

      A Promise that resolves to the found card or undefined if no matching card exists

    • Finds a card with the specified card handle.

      Parameters

      • cardHandle: string

        The card handle to search for

      • purgeCache: boolean = false

        Optional flag to force refresh the card cache. Defaults to false

      Returns Promise<undefined | Card>

      A Promise that resolves to the found card or undefined if no matching card exists

    • Retrieves all available cards.

      Parameters

      • purgeCache: boolean = false

        Optional flag to force refresh the card cache. Defaults to false

      Returns Promise<Card[]>

      A Promise that resolves to an array of all available cards

    • Triggers the PIN verification process for a specific card and PIN type. The process will take place on the card terminal.

      Parameters

      • card: Card

        The card to verify PIN for

      • pinType: PinType

        The type of PIN to verify

      Returns Promise<VerifyPinResponse>

      A Promise that resolves to the PIN verification response

    • Triggers the PIN change process for a specific card and PIN type. The process will take place on the card terminal.

      Parameters

      • card: Card

        The card to change PIN for

      • pinType: PinType

        The type of PIN to change

      Returns Promise<ChangePinResponse>

      A Promise that resolves to the PIN change response

    • Triggers the PIN unblock process for a specific card and PIN type. The process will take place on the card terminal.

      Parameters

      • card: Card

        The card to unblock PIN for

      • pinType: PinType

        The type of PIN to unblock

      • setNewPin: boolean = false

        Optional flag to set a new PIN after unblocking. Defaults to false

      Returns Promise<UnblockPinResponse>

      A Promise that resolves to the PIN unblock response

    • Reads the Telematik ID from the specified certificate references on a card.

      Parameters

      • card: Card

        The card to read the Telematik ID from

      • ...certRefs: CertRefEnum[]

        One or more certificate references to check

      Returns Promise<undefined | string>

      A Promise that resolves to the Telematik ID or undefined if not found

    • Verifies a certificate's validity.

      Parameters

      • raw: string | BufferSource

        The raw certificate data as a string or BufferSource

      Returns Promise<VerificationStatus>

      A Promise that resolves to the certificate verification status