npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

resume-node-rest-connector

v1.3.3

Published

Resume API Connector for Node.JS (sati.co.th)

Readme

Resume Node.JS REST API Connector

Resume API Connector for Node.JS

About the Project

Resume™ (RE-SU-ME), the Medical Speech to Clinical Summarized Text, is the API developed by Thai SaTI Partnership, Limited (SaTI™).

Resume Node.JS REST API Connector provides simplicity to connect Resume API as REST Client (and WebSocket Client in the future). For more detail about SaTI's Resume Service, Please follow sati.co.th.

Built With

Getting Started

Install

npm install resume-node-rest-connector

Pass Credentials and Configuration

The credentials is for authenication to Resume API. And the configuration will be default values for the API of the client. More details about ResumeCredentials and configuration are in docs/config.md.

Place credentials file

You can place credentials.js file from Resume Administration System in server root folder. The config.js of Resume REST API Connector will parse it when server starts. The example of credentials file locate at ../credentials.template.json.
Example content in `credentials.js

{
  "host": "https://resume.sati.co.th",
  "username": "USERNAME",
  "password": "PASSWORD",
  "section_id_default": 0
}

Pass credentials as environmental variables

You can also specified Authenication information for Resume API via environmental variable. This method suits for Docker Container development. Please see Environment variables in Compose for more details.
Example of docker-compose.yaml for Resume Socket.IO container.

version: "3.4"

services:
  resume-demo:
    # ...

    environment:
      REST_HOST: https://resume.sati.co.th
      REST_USER: USERNAME
      REST_PW: PASSWORD
    
    # ...

You can also place these secret in ".env" file as Docker suggestion.
Example of .env for Resume Socket.IO container.

REST_HOST=https://resume.sati.co.th
REST_USER=USERNAME
REST_PW=PASSWORD
REST_DEFAULT_SECTION=0
REST_LANG=["th","en"]

Programmatic input

You can give Resume Host, Username, and Password to the class constructor directly. Please read create the object.

Usage

Create the object

const { HttpClient } = require('resume-node-rest-connector');
restClient = new HttpClient();

You can override credentials from configuration in ResumeCredentials by passing as constructor parameters.

const { HttpClient } = require('resume-node-rest-connector');

const HOST = "https://resume.sati.co.th";
const USER = "USERNAME";
const PW = "PASSWORD";

const restClient = new HttpClient(HOST, USER, PW);

HttpClient constructor

Request for new Session ID from Resume API

restClient.newSession(sectionId, lang, hint, docFormat, multiSpeaker, userStartTime)
    .then(res => {
        var sessionID = res.data.session_id;
        var pseudoIdentifier = res.data.pseudoIdentifier;
        var cookies = res.cookies;
    })
    .catch(err => { /*  Error handling  */ });

HttpClient.newSession method

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.

Push Sound Chunk to Resume API

/* tell the API to keep the session */
let isEnd = false;

/* create ResumeSoundInfo */
let info = {
    _id: soundID, /* Index of sound chunk in this session, count from 0 - n */
    datetime: new Date().toJSON(),
    is_end: isEnd,
    tag: tag, /* form name for Resume Combination or Dictation mode */
    user_transcript: userTranscript /* User input in this form, used for feedback the transcription result */
}


/* Upload to Resume API */
restClient.sendSound(sessionId, sectionID, info, blob, cookies)
    .then(transcript => {
        /* Resume API feedback that the session is ended. */
        let completeEnd = transcript.is_end; 
        
        /* process the transcript */

        // About the transcript object
        // Please Read docs/Resume-REST-API-Connect.md#module_Resume-REST-API-Connect..Transcript
    }).catch(err => { /*  Error handling  */ });

Note: Don't send sound after the session end, it will result in 500 HTTP Error.

Get Updated Result from Resume API

let lastUpdate = null;   /* set last update time, or null */

restClient.updateResult(sessionId, sectionID, lastUpdate, cookies)
    .then(function (transcript) {
        if (transcript) {
            // transcript is not null.

            /* Handling updated transcript */

        } else {
            // If no updated result since lastUpdate,
            // transcript will be null.
            
        }
    }).catch(err => { /*  Error handling  */ });

Note:

  1. transcript response can be null. Please check it before next process to prevent exeception.
  2. If the session is ended, the server will respond Transcript.is_end = true.

End the Session

Set ResumeSoundInfo.is_end = true

/* tell the API to end the session */
let isEnd = true; 

/* create ResumeSoundInfo */
let info = {
    _id: soundID, /* Index of sound chunk in this session, count from 0 - n */
    datetime: new Date().toJSON(),
    is_end: isEnd,
    tag: tag, /* form name for Resume Combination or Dictation mode */
    user_transcript: userTranscript /* User input in this form, used for feedback the transcription result */
}


/* Upload to Resume API */
restClient.sendSound(sessionId, sectionID, info, blob, cookies)
    .then(transcript => {
        /* Resume API feedback that the session is ended. */
        let completeEnd = transcript.is_end; 
        
        /* process the transcript */

        // About the transcript object
        // Please Read docs/Resume-REST-API-Connect.md#module_Resume-REST-API-Connect..Transcript
    }).catch(err => { /*  Error handling  */ });

Differences between Resume API mode

| Part | Conversation Mode | Dictation Mode | Combinatory Mode | | --- | --- | --- | --- | | transcript result | contains MlGroupTxt | both MlGroupTxt and TagRawTxt | same to Dictation Mode | | multiSpeaker parameter in HttpClient.newSession method | true | false | true | | Need to set tag property | No | Yes: for every sound chunk | Every sound chunk in Dictation periods. Set to null for sound chunks in Conversation mode. |

More information


© 2021 - copyright by Tanapat Kahabodeekanokkul - the founder of RESUME.