mindee
    Preparing search index...

    Class LocalResponse

    Local response loaded from a file. Note: Has to be initialized through init() before use.

    Index

    Constructors

    Properties

    initialized: boolean = false

    Methods

    • Deserialize the loaded local response into the requested CommonResponse-derived class.

      Typically used when dealing with V2 webhook callbacks.

      Type Parameters

      Parameters

      • responseClass: new (serverResponse: StringDict) => ResponseT

        The constructor of the class into which the payload should be deserialized.

      Returns Promise<ResponseT>

      An instance of responseClass populated with the file content.

      MindeeError If the provided class cannot be instantiated.

    • Returns the HMAC signature of the local response, from the secret key provided.

      Parameters

      • secretKey: string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

        Secret key, either a string or a byte/byte array.

      Returns string

      The HMAC signature of the local response.

    • Checks if the HMAC signature of the local response is valid.

      Parameters

      • secretKey: string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

        Secret key, either a string or a byte/byte array.

      • signature: string

        The signature to be compared with.

      Returns boolean

      True if the HMAC signature is valid.