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 🙏

© 2026 – Pkg Stats / Ryan Hefner

catdv

v4.0.2

Published

CatDV REST API client library

Readme

CatDV REST API Client Library

Allows NodeJS scripts to automate Square Box System's CatDV Media Asset Management System using the CatDV REST API.

Install

$ npm install catdv

Usage

Basic usage of the API is shown below:

var catdv = require('catdv');
var $catdv = new catdv.RestApi("http://catdvserver:8080");

$catdv.login("username", "password");

      :

$catdv.logout();

API

// Login/Out
login(username: string, encryptedPassword: string):SessionInfo
logout():any

// Catalogs
getCatalog(catalogId: any):Catalog
getCatalogs():Catalog[]
getCatalogsBasicInfo():Catalog[]
saveCatalog(catalog: Catalog):any
deleteCatalog(catalogID: number):any

// Clips
getClip(clipId: any):Clip
getClips(params: StdParams):PartialResultSet<Clip>
getClipIDs(params: StdParams):number[]
getClipCount(params):number
saveClip(clip: any):any
saveClips(clips: Clip[]):number
deleteClip(clipID: number):any
bulkUpdateMediaLocation(fromDirectory: string, toDirectory: string)

// Smart Folders
getSmartFolders():SmartFolder[]
saveSmartFolder(smartFolder: any):any
deleteSmartFolder(smartFolderID: number):any

// Clip Lists
getClipLists():ClipList[]
addToClipList(clipListID: number, clipIDs: number[]):any
removeFromClipList(clipListID: number, clipIDs: number[]):any
saveClipList(clipList: any):number
deleteClipList(clipListID: number):any

// Field Groups / Field Definitions
getFieldGroup(fieldGroupID: number):FieldGroup
getFieldGroups(params: any):FieldGroup[]
getFieldListValues(field: string):string[]
getFields(params: any):PartialResultSet<FieldDefinition>
getFieldDefinitions(fieldIDs: string[]):FieldDefinition[]
getFieldDefinition(fieldDefID: number):PartialResultSet<FieldDefinition>
saveField(field: any):any
saveFieldGroup(fieldGroup: any):any
deleteField(fieldDefID: string, forceDelete: boolean):any
deleteFieldGroup(fieldGroupDefID: string):any

// Panel Definitions
getPanelSetsWithPanels():PanelDefinition[]
getPanelDefinitions(groupID: number):PanelDefinition[]
getSharedLinkPanelDefinitions(linkUID: string):PanelDefinition[]
getPanelFields(panelDefID: number):PanelField[]
savePanel(panel: PanelDefinition):any
updatePicklist(fieldID: string, picklist: Picklist):string[]

// View Definitions
getViewSetsWithViews():ViewDefinition[]
getViewDefinitions():ViewDefinition[]
getViewFields(viewType: string, viewDefID: number):ViewField[]
saveViewSet(viewType: string, viewSet: BaseViewSet):any
saveView(viewType: string, view: ViewDefinition):any
deleteViewSet(viewSetID: number):any
deleteView(viewID: number):any

// Form Definitions
getFormSetsWithForms():PanelDefinition[]
getCurrentUploadForm():PanelDefinition
getCurrentSearchForm():PanelDefinition
saveForm(form: FormDefinition):any

// Media Stores
getMediaStores():MediaStore[]
getMediaStore_MediaTypes():EnumItem[]
getMediaStore_PathTargets():EnumItem[]
saveMediaStore(mediaStore: MediaStore):MediaStore
saveMediaStorePath(mediaStorePath: MediaStorePath):MediaStorePath
deleteMediaStore(mediastoreID: number):any
deleteMediaStorePath(mediastoreID: number, mediastorePathID: number):any

// Shared Links
getSharedLinks(params: any):PartialResultSet<SharedLink>
getSharedLink(sharedLinkID: number):SharedLink[]
createSharedLink(sharedLink: SharedLink):any
updateSharedLink(sharedLink: SharedLink):any
deleteSharedLink(sharedLinkID: number):any

// Services / Jobs
getServices():Service[]
getJob(jobID: number):Job
getJobs(params: any):PartialResultSet<Job>

// Media / Thumbnails
getThumbnailsForMedia(mediaID: number):Thumbnail[]
getMedia(mediaID: number, params: any): any

// Uploads
initiateUpload(filename: string, fileSize: number, metadata: any):any

// Groups
getGroups(params: any):any
getGroupRolePermissions(groupID: number):Role[]
saveGroup(group: any):any
updateGroupRolePermissions(groupID: number, roles: Role[]):Role[]
deleteGroup(groupID: number):any

// Roles
getRoles(params: any):Role[]
getRoleGroupPermissions(roleID: number):Group[]
saveRole(role: any):any
updateRoleGroupPermissions(roleID: number, groups: Group[]):Role[]
deleteRole(roleID: number):any

// Users
getUser(userID: number):User
getUsers(params: any):User[]
insertUser(user: User):any
updateUser(user: User):any
deleteUser(userID: number):any

// Server Commands
getServerCommands(params: any)
callServerCommand(commandUID: string, params: any):CommandResults
execServerCommand(commandID: number, commandParams: CommandParams):CommandResults

// Audit Log
getLogEntries(params: any):PartialResultSet<LogEntry>

// Server Properties
getServerProperties(propertyNames: string[]):string[]
getServerProperty(propertyName: string):string
setServerProperties(propertySet: any)

Simple Example

The simple example below retrieve the list of catalogs from the server:

import catdv = require("catdv");

var $catdv = new catdv.RestApi("http://catdv_server:8080");

try
{
    $catdv.login("username", "password");
    
    var catalogs = $catdv.getCatalogsBasicInfo();
    console.log(JSON.stringify(catalogs, null, 4));
}
finally
{
     $catdv.logout();
}

Asynchronous API (Beta)

The original version of the CatDV Node SDK makes use of synchronous calls (in other words execution waits for the reply from the server before continuing). This makes complex scripts, which make many API calls, easier to write compared to traditional asynchronous calls that make use of callbacks, but creates a significant performance penalty.

To address this there is now an asynchronous version of the API that makes use of modern JavaScript's async/await mechanism. This is dramatically faster than the old synchronous API, and is recomended for new develops.

This is simple example of an asynchronous call:


import catdv = require("catdv");

async function getCatalogsInfo()
{
    var $catdv = new catdv.AsyncRestApi("http://catdv_server:8080");

    try
    {
        await $catdv.login("username", "password");
        
        return await $catdv.getCatalogsBasicInfo();   
    }
    finally
    {
        await $catdv.logout();
    }
}

getCatalogsInfo()
    .then((catalogs) => {
        console.log(JSON.stringify(catalogs, null, 4));
    })
    .catch((e) => {
        console.log("ERROR:" + e);
    });