Node.JS module for HTTPS RESTful Resume API Client
- Resume-REST-API-Connect
- ~ResumeHttpAPIClient
- new ResumeHttpAPIClient([host], [username], [password])
- instance
- .test() ⇒
Promise.<axios>
- .testAnonymous() ⇒
Promise.<axios>
- .newSession() ⇒
Promise.<ResumeSessionResponse>
- .sendSound(sessionId, sectionID, info, soundStream, cookies) ⇒
Promise.<Transcript>
- .updateResult(sessionId, sectionID, [lastUpdate], cookies) ⇒
Promise.<(Transcript|null)>
- .test() ⇒
- static
- .responseResolve(res) ⇒
ResumeSoundInfo
- .responseResolve(res) ⇒
- ~ResumeNewSessionData
- ~GroupText :
Object.<string, Array.<string>>
- ~Transcript :
object
- ~ResumeSoundInfo :
object
- ~ResumeSessionResponse
- ~ResumeHttpAPIClient
Note: the HttpClient
object is totally stateless. Every method call, it always needs session ID, section ID, and cookies (for load balancer) to communication with correct session on Resume API.
Kind: inner class of Resume-REST-API-Connect
Summary: Class for connect Resume API via HTTPS/1.1 REST API
- ~ResumeHttpAPIClient
- new ResumeHttpAPIClient([host], [username], [password])
- instance
- .test() ⇒
Promise.<axios>
- .testAnonymous() ⇒
Promise.<axios>
- .newSession() ⇒
Promise.<ResumeSessionResponse>
- .sendSound(sessionId, sectionID, info, soundStream, cookies) ⇒
Promise.<Transcript>
- .updateResult(sessionId, sectionID, [lastUpdate], cookies) ⇒
Promise.<(Transcript|null)>
- .test() ⇒
- static
- .responseResolve(res) ⇒
ResumeSoundInfo
- .responseResolve(res) ⇒
Create ResumeHttpAPIClient
Param | Type | Description |
---|---|---|
[host] | string |
full host path for Resume API (https://resume.sati.co.th) |
[username] | string |
Resume API username if leave blank, will load from ResumeCredentials |
[password] | string |
Resume API password if leave blank, will load from ResumeCredentials |
Test Resume API connection and Authenication
Kind: instance method of ResumeHttpAPIClient
Returns: Promise.<axios>
- Promise.all() of axios object
Test Resume API connection without username and password
Kind: instance method of ResumeHttpAPIClient
Returns: Promise.<axios>
- Promise of axios object
Request new Resume Transcript Session from Resume API.
Kind: instance method of ResumeHttpAPIClient
Returns: Promise.<ResumeSessionResponse>
- Promise object of Session ID
Properties
Name | Type | Description |
---|---|---|
sectionId | int | string |
ID of section e.g. department number, section of organization name |
lang | Array.<string> |
language hints must be BCP-47 language code in string type or array of string type ordered by highest priority to suggest the speech-to-text API - the default is located in ./public/lang.json . See more detail of BCP-47 |
docFormat | string |
Format of document to let the speech-to-text API to generate returned data - reference the name from "C-CDA 1.1.0 on FHIR" otherwise will be "Default". Please read README.md and http://hl7.org/fhir/us/ccda/artifacts.html |
multiSpeaker | Boolean |
mode of transcription automatically given from ResumeOne().newSession(...) |
userStartTime | Date |
session starting datetime automatically given from ResumeOne().newSession(...) |
resumeHttpAPIClient.sendSound(sessionId, sectionID, info, soundStream, cookies) ⇒ Promise.<Transcript>
Send sound chunk to Resume API
Kind: instance method of ResumeHttpAPIClient
Returns: Promise.<Transcript>
- Promise object of Transcript from Resume API
Param | Type | Description |
---|---|---|
sessionId | string |
Resume API Session ID from newSession method |
sectionID | string | int |
ID of section e.g. department number, section of organization name |
info | ResumeSoundInfo |
sound chunk information for Resume API |
soundStream | Blob |
chunk of sound in WAV format |
cookies | string |
HTTP header-encoded cookies string from newSession return, important for Resume API server process |
resumeHttpAPIClient.updateResult(sessionId, sectionID, [lastUpdate], cookies) ⇒ Promise.<(Transcript|null)>
Request for Resume API transcription result
Kind: instance method of ResumeHttpAPIClient
Returns: Promise.<(Transcript|null)>
- Promise object of Transcript from Resume API, null if there is no new update for lastUpdate time.
Param | Type | Description |
---|---|---|
sessionId | string |
Resume API Session ID from newSession method |
sectionID | string | int |
ID of section e.g. department number, section of organization name |
[lastUpdate] | Date |
Last update datetime if user has caching. |
cookies | string |
HTTP header-encoded cookies string from newSession return, important for Resume API server process |
Process Response from Resume HTTP REST API
Kind: static method of ResumeHttpAPIClient
Returns: ResumeSoundInfo
- response from Resume API
Param | Type | Description |
---|---|---|
res | AxiosResponse |
AxiosResponse object |
Response data in ResumeSessionResponse
Kind: inner typedef of Resume-REST-API-Connect
Properties
Name | Type | Description |
---|---|---|
session_id | string |
Session ID of Resume Transcription API |
section_id | string | int |
Section ID given by user, response for feedback checking |
Object contains keys - part of document following Terminology of "C-CDA 1.1.0 on FHIR resource profile" (see README.md), and values - array of sentences or pharse (join into one string). {"problem_section":["This is sentence one.","more pharse here..."]}
Kind: inner typedef of Resume-REST-API-Connect
Summary: Object contains keys - part of document (as C-CDA on FHIR), and values - array of string.
Transcript response of sent sound from Resume API
Kind: inner typedef of Resume-REST-API-Connect
Properties
Name | Type | Description |
---|---|---|
[RawTxt] | Array.<Array.<string>> |
array of sentence. Each sentence is array of word. [["This","is","first","sentence","."],["...","next","and","more"]] |
[RawSpk] | Array.<int> |
array of speaker index correlated with sentence in RawTxt, starting from zero. |
[MlGroupTxt] | GroupText |
object of formatted and groupped text by Resume API Algorithm |
[TagRawTxt] | GroupText |
object of raw sentence groupped by client tag (ResumeOne.tag ). |
[user_transcript] | GroupText |
object of user-input form data |
Main format for sound chunk request and Transcript response of sent sound from Resume API
Kind: inner typedef of Resume-REST-API-Connect
Properties
Name | Type | Description |
---|---|---|
[RawTxt] | Array.<Array.<string>> |
array of sentence. Each sentence is array of word. [["This","is","first","sentence","."],["...","next","and","more"]] |
datetime | Date |
datetime that Resume.js send chunk of sound |
is_end | Boolean |
true if user or Resume.js end the transcription Resume session |
[tag] | string |
tag (form input name) used in Dictation or Combination mode should correlate Terminology of "C-CDA 1.1.0 on FHIR resource profile" (see README.md) |
[_id] | Array.<int> |
array of sound chunk index |
[user_transcript] | GroupText |
object of user-input form data |
Returns from newSession method
Kind: inner typedef of Resume-REST-API-Connect
Properties
Name | Type | Description |
---|---|---|
status | int |
HTTP response status |
data | ResumeNewSessionData |
response from Resume API containing session id and its information |
clientStartTime | Date |
time that function called in server-sided Node.JS (client of API) |
userStartTime | Date |
time that user (client-sided JavaScript) requests new Resume Session ID |
[pseudoIdentifier] | string |
fake (pseudo) identifier generated by Resume REST API Client and sent to server |
cookies | string |
HTTP header-encoded cookies string that Resume API responses. It must be included in consequenct resquest in same Session ID. Because it is important for API server routing. |
© 2021 - copyright by Tanapat Kahabodeekanokkul - the founder of RESUME
.