Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DocumentWebService

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected http

http: Http

Protected options

Static Protected instance

Methods

create

  • create(userId: string, document: DocumentSchema): Promise<Document>
  • Create a new Document in the platform.

    Parameters

    • userId: string

      The Consumer's User ID.

    • document: DocumentSchema

      The Document schema.

    Returns Promise<Document>

delete

  • delete(userId: string, documentId: string): Promise<boolean>

findAll

  • findAll(userId: string, pagination: Pagination): Promise<PaginatedArray<Document>>
  • Find all Documents from a Consumer. This method won't return pictures.

    Parameters

    • userId: string

      The Consumer's User ID.

    • pagination: Pagination

      The pagination parameters.

    Returns Promise<PaginatedArray<Document>>

findOne

  • findOne(userId: string, documentIdOrType: string): Promise<Document>
  • Find an Document based on it's ID or type. This method will return pictures.

    Parameters

    • userId: string

      The Consumer's User ID.

    • documentIdOrType: string

    Returns Promise<Document>

update

  • update(userId: string, documentId: string, document: Partial<DocumentSchema>): Promise<Document>
  • Partially update an existing Document.

    Parameters

    • userId: string

      The Consumer's User ID.

    • documentId: string

      The Document ID.

    • document: Partial<DocumentSchema>

      The partial Document schema.

    Returns Promise<Document>

uploadPicture

  • uploadPicture(userId: string, type: DocumentType, side: "front" | "back" | "selfie", picture: File): Promise<Document>
  • Upload a new Document picture.

    Parameters

    • userId: string

      The Consumer's User id.

    • type: DocumentType

      The Document type.

    • side: "front" | "back" | "selfie"

      The Document picture side.

    • picture: File

      The picture to be uploaded.

    Returns Promise<Document>

uploadPictureFromBase64

  • uploadPictureFromBase64(userId: string, type: DocumentType, side: "front" | "back" | "selfie", picture: string): Promise<Document>
  • Upload a new Document picture.

    Parameters

    • userId: string

      The Consumer's User id.

    • type: DocumentType

      The Document type.

    • side: "front" | "back" | "selfie"

      The Document picture side.

    • picture: string

      The base64 representation of the picture to be uploaded.

    Returns Promise<Document>

Static getInstance

Static initialize

Generated using TypeDoc