@idfy/sdk
Version:
Node.js SDK for Idfy REST API
164 lines (163 loc) • 6 kB
TypeScript
/// <reference types="node" />
import IdfyBaseService from '../IdfyBaseService';
import { CollectionWithPaging } from '../../model';
import { Attachment, AttachmentOptions, Document, DocumentCreateOptions, DocumentStatusSummary, DocumentSummary, DocumentUpdateOptions, FileRequest, ManualReminder, NotificationLogItem, Signer, SignerOptions } from './';
export declare class SignatureService extends IdfyBaseService {
private readonly _endpointBase;
/**
* Retrieves details of a single document.
* @param documentId
*/
getDocument(documentId: string): Promise<Document>;
/**
* Creates a new document.
* @param documentCreateOptions
*/
createDocument(documentCreateOptions: DocumentCreateOptions): Promise<Document>;
/**
* Updates a document.
* @param documentId
* @param documentUpdateOptions
*/
updateDocument(documentId: string, documentUpdateOptions: DocumentUpdateOptions): Promise<Document>;
/**
* Cancels a document.
* @param documentId
* @param reason
*/
cancelDocument(documentId: string, reason?: string): Promise<void>;
/**
* Retrieves the status of a document.
* @param documentId
*/
getDocumentStatus(documentId: string): Promise<DocumentStatusSummary>;
/**
* Retrieves the status of a document.
* @param documentId
*/
getDocumentSummary(documentId: string): Promise<DocumentSummary>;
/**
* Queries your documents using the provided parameters.
* @param externalId
* @param signerId
* @param externalSignerId
* @param fromDate
* @param toDate
* @param lastUpdated
* @param signedDate
* @param nameOfSigner
* @param title
* @param status
* @param tags
* @param offset
* @param limit
*/
listDocumentSummaries(externalId?: string, signerId?: string, externalSignerId?: string, fromDate?: Date, toDate?: Date, lastUpdated?: Date, signedDate?: Date, nameOfSigner?: string, title?: string, status?: string, tags?: string, offset?: number, limit?: number): Promise<CollectionWithPaging<DocumentSummary>>;
/**
* Retrieves the details of a single signer.
* @param documentId
* @param signerId
*/
getSigner(documentId: string, signerId: string): Promise<Signer>;
/**
* Creates a new signer.
* @param documentId
* @param signerOptions
*/
createSigner(documentId: string, signerOptions: SignerOptions): Promise<Signer>;
/**
* Updates a signer.
* @param documentId
* @param signerId
* @param signerOptions
*/
updateSigner(documentId: string, signerId: string, signerOptions: SignerOptions): Promise<Signer>;
/**
* Deletes a signer.
* @param documentId
* @param signerId
*/
deleteSigner(documentId: string, signerId: string): Promise<void>;
/**
* Lists all signers of a document.
* @param documentId
*/
listSigners(documentId: string): Promise<Signer[]>;
/**
* Retrieves the details of a single attachment.
* @param documentId
* @param attachmentId
*/
getAttachment(documentId: string, attachmentId: string): Promise<Attachment>;
/**
* Adds an attachment to the specified document.
* @param documentId
* @param attachmentOptions
*/
createAttachment(documentId: string, attachmentOptions: AttachmentOptions): Promise<Attachment>;
/**
* Updates the specified attachment (Will only take affect if no one has signed the document yet).
* @param documentId
* @param attachmentId
* @param attachmentOptions
*/
updateAttachment(documentId: string, attachmentId: string, attachmentOptions: AttachmentOptions): Promise<Attachment>;
/**
* Deletes the specified attachment (Will only take affect if no one has signed the document yet).
* @param documentId
* @param attachmentId
*/
deleteAttachment(documentId: string, attachmentId: string): Promise<void>;
/**
* Returns a list of all attachments for the specified document.
* @param documentId
*/
listAttachments(documentId: string): Promise<Attachment[]>;
/**
* Retrieves the signed document file.
* @param documentId
* @param fileFormat
*/
getFile(documentId: string, fileFormat: FileRequest.FileFormatEnum): Promise<Buffer>;
/**
* Retrieves the signed document file for the specified signer.
* @param documentId
* @param signerId
* @param fileFormat
*/
getFileForSigner(documentId: string, signerId: string, fileFormat: FileRequest.SignerFileFormatEnum): Promise<Buffer>;
/**
* Retrieves the attachment file.
* @param documentId
* @param attachmentId
* @param fileFormat
*/
getAttachmentFile(documentId: string, attachmentId: string, fileFormat: FileRequest.AttachmentFileFormatEnum): Promise<Buffer>;
/**
* Retrieves the attachment file for the specified signer.
* @param documentId
* @param attachmentId
* @param signerId
* @param fileFormat
*/
getAttachmentFileForSigner(documentId: string, attachmentId: string, signerId: string, fileFormat: FileRequest.SignerAttachmentFileFormatEnum): Promise<Buffer>;
/**
* Returns a list of all notifications that has been sent / attempted sent for a document.
* @param documentId
*/
listNotifications(documentId: string): Promise<NotificationLogItem>;
/**
* Sends a reminder to the specified signers.
* @param documentId
* @param manualReminder
*/
sendReminders(documentId: string, manualReminder: ManualReminder): Promise<ManualReminder>;
/**
* Returns a list of all color themes that can be used in the signature application.
*/
listThemes(): Promise<string[]>;
/**
* Returns a list of all spinners that can be used in the signature application.
*/
listSpinners(): Promise<string[]>;
}