New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

tmhcc-ir-apis

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tmhcc-ir-apis

TypeScript client for the Vertafore ImageRight REST APIs (accounts, files, folders, documents, pages, tasks, workflows, and more).

latest
Source
npmnpm
Version
1.0.12
Version published
Maintainers
2
Created
Source

tmhcc-ir-apis

A lightweight TypeScript client for the Vertafore ImageRight REST APIs.

It wraps the ImageRight HTTP endpoints (authentication, accounts, drawers, files, folders, documents, pages, tasks, workflows, images, etc.) behind a small, promise-based class so you don't have to hand-roll axios calls in every project.

CI npm version npm downloads license

Installation

npm install tmhcc-ir-apis

Peer runtime: any environment that can run modern axios (Node.js 20+ required — Node 18 is EOL). TypeScript type definitions are bundled.

Quick start

1. Authenticate with a username & password

import Library from 'tmhcc-ir-apis';

const lib = new Library('https://your-imageright-host/api');

const api = await lib.connect('username', 'password');

const me = await api.getCurrentUser();
console.log(me);

Library.connect(...) calls the ImageRight authentication endpoint, obtains an access token, and returns a ready-to-use ImageRight client.

2. Bring your own access token

If you already have an ImageRight access token (for example, issued by an upstream SSO flow), skip connect and construct the API directly:

import Library from 'tmhcc-ir-apis';

const lib = new Library('https://your-imageright-host/api');

const api = await lib.createAPI({ AccessToken: 'your-access-token' });

const drawers = await api.getDrawers();

3. Refresh the token later

ImageRight.authenticate(username, password) re-authenticates and updates the token used by the same instance:

await api.authenticate('username', 'new-password');

Supported API groups

Each group exposes a set of methods on the ImageRight instance returned by connect / createAPI:

GroupExample methods
AccountsgetAccount, getAllAccounts, getCurrentUserAccount, getCurrentUserGroups, getAccountGroups
AttributesgetAttributeById, getAttributeByName, getAttributeByObject
Authenticationauthenticate
BatchescreateBatch
ContainersgetContainers
DocumentscreateDocument, findDocuments, getDocumentById, moveDocument, copyDocument, deleteDocument, updateProperties
DrawersgetDrawers, getDrawerById, getDrawerByName, getDrawersInContainer, getDrawersInContainerByName
FilescreateFile, findFiles, getFileById, getRelatedFiles, createFileRelationship, deleteFileRelationship, mergeFiles, updateFilesV2
FolderscreateFolder, findFolders, getFolderById
ImagesgetImageById, getImageByIdV2
Object TypesgetObjectType, getAllowedTypes, getAllowedTypesForContainer, getAttributeDefinitionsForType, getFileTypeExtensions, getFileTypeTemplate, getSortOptionsForType, getTypesForClass
PagescreatePage, createPageV2, copyPage, getPageById, getAllPagesFromDocument, getPageImageMetadata, lockPage, unlockPage, movePage, movePageV2, mergeToDocument, rotatePage, updatePageContent, updatePageContentV2, updatePageProperties, checkReadPermissions
TaskscreateTask, getTasks, getPostTasks, getTasksByFileId, getTasksByFileIdPost, updateTask, killTask, lockTask, unlockTask, refreshTaskLock, releaseTask, releaseTaskByAnchor, releaseTaskSplitStep, routeTask
Task AttributesgetTaskAttributes, getTaskAttributeById, getTaskAttributeByName, setTaskAttributeById, setTaskAttributeByName
UsersgetCurrentUser, getCurrentUserData, getUserData, changeUserPassword
WorkflowsgetWorkflows, getSteps, getStepLinks, getDefaultStepLink, getSplitLinkParameters, getPriorityList, getStepAttributes, getStepAttributeById, getStepAttributeByName, getUsersToAssign

All methods return Promise<any> today; concrete response types will be added incrementally in future releases.

Example: find a file and list its tasks

import Library from 'tmhcc-ir-apis';

async function main() {
  const lib = new Library(process.env.IR_BASE_URL!);
  const api = await lib.connect(process.env.IR_USER!, process.env.IR_PASS!);

  const matches = await api.findFiles({ /* search criteria */ });
  const fileId = matches?.Files?.[0]?.Id;
  if (!fileId) return;

  const tasks = await api.getTasksByFileId(fileId, { /* options */ });
  console.log(tasks);
}

main().catch(console.error);

Configuration

  • baseUrl (constructor arg) — the fully-qualified base URL of your ImageRight REST API, e.g. https://ir.example.com/api.
  • AccessToken — sent as Authorization: AccessToken <token> on every request. Either provided via createAPI(...) or obtained through connect(...) / authenticate(...).

Building from source

git clone https://github.com/manikumarkv/imageright-apis.git
cd imageright-apis
npm install
npm run build   # tsc → dist/
npm test        # vitest run

The published tarball only ships the compiled dist/ output. Tests live under test/ and are excluded from the build.

Contributing

Issues and pull requests are welcome on the GitHub repository. When submitting a PR, please:

  • Keep changes focused and include a short description of the motivation.
  • Run npm run build locally and make sure it succeeds.
  • Bump the package version (npm version patch|minor|major) if the change is user-facing.

License

MIT © Mani Kumar

Keywords

vertafore

FAQs

Package last updated on 22 Jul 2026

Related posts