Simple Sign

export interface AbstractSimpleSign {
  getInfo(): Promise<GenericT1CResponse<SimpleSignInfoResponse>>;
  initializeContext(origin: string): Promise<GenericT1CResponse<SimpleSignInitializeResponse>>;
  uploadFileContext(origin: string, request: SimpleSignUploadFileContextRequest): Promise<GenericT1CResponse<SimpleSignUploadFileContextResponse>>;
}

export interface SimpleSignInfoResponse {
  version: string;
  localFolder: string;
}

export interface SimpleSignInitializeResponse {
  folderBootstrap: string;
  folderExternalUploaded: string;
  folderExternalSigned: string;
  filexOrigin: string;
  filexEntity: string;
  filexTypes: Array<string>;
}

export interface SimpleSignUploadFileContextResponse {
  origin: string;
  entity: string;
  filename: string;
  callback: string;
  externalId: string;
}

export interface SimpleSignUploadFileContextRequest {
  filename: string;
  callback: string;
  externalId: string;
}  

Functions

Get SimpleSign module object

T1CSdk.T1CClient.initialize(config).then(res => {
    client = res;
    let simplesign = client.simplesign();
}, err => {
    console.error(error)
})

Info

simplesign.getInfo();

The response will look like

{
    "success": true,
    "data": {
        "version": "0.2.5",
        "localFolder": "/Users/someuser/Desktop/simplesign"
    }
}

Initialize context

let origin = 'https://acc-rmc.t1t.io';
simplesign.initializeContext(origin);

The response will look like

{
    "success": true,
    "data": {
        "folderBootstrap": "/Users/someuser/Desktop/simplesign",
        "folderExternalUploaded": "/Users/someuser/Desktop/simplesign/_uploaded/_external",
        "folderExternalSigned": "/Users/someuser/Desktop/simplesign/_archived/_external",
        "filexOrigin": "https://acc-rmc.t1t.io",
        "filexEntity": "SimpleSign",
        "filexTypes": [
            "UPLOAD",
            "SIGNED"
        ]
    }
}

Upload file context

let origin = 'https://acc-rmc.t1t.io';
let request = {
    "filename": "T1T_test.pdf",
    "callback": "https://test.app",
    "externalId": "123456"
}
simplesign.uploadFileContext(origin, request);

The response will look like

{
    "success": true,
    "data": {
        "origin": "https://acc-rmc.t1t.io",
        "entity": "SimpleSign",
        "filename": "T1T_test.pdf",
        "callback": "https://test.app",
        "externalId": "123456"
    }
}

Last updated