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

@opentext/otts-module-api

v1.0.2

Published

This will include otts_module_api.js file in your project

Downloads

9

Readme

OTTS Module API

The purpose of this package is to provide application and component developers with convenient JavaScript-based APIs to integrate with OpenText LiveSite Content Services (LSCS) APIs and OpenText TeamSite Module datums (properties). Note: This module is only compatible with OpenText TeamSite 23.2 and later.

Prerequisites

  • Create or clone a JavaScript application/component project workspace (e.g., React, Angular, Vue, Vanilla JS, etc.)
  • OpenText TeamSite 23.2 or later

Installation

To install this package, run the following command in the root of your project:

> npm install otts-api

Setup

After installation, add the otts_module_api.js file to the root folder of your project. Copy this file to the appropriate third-party source folder. For example, for React projects, this is likely the /public folder. For Angular projects, it is likely the /src folder.

Usage

LCSC API values and Module Datum values are retrieved based on the environment in which your application/component is running. While testing in your local development environment, the package will retrieve LSCS content and Component Datum values from iw_module_stubs.js.

Note: iw_module_config.json must be present in the same directory as otts_module_api.js. Data spec and default values are loaded during bootstrap and before the main app launches.

Note: To ensure that local testing functions correctly, You must load this API script into the DOM AFTER iw_module_stubs.js.

API

All functions are static and accessible using the global iw variable.

iw.init() For applications/components that need control over when to initialize themselves.

iw.getPropertyValue(moduleId, datumId) Retrieves the datum/property value for the provided component and datum.

  • moduleId : string - The generated TeamSite module ID
  • datumId : string - The developer-defined datum/property ID

iw.queryLscs(api, params, callback, useStagingInAuthoring) Retrieves content from LSCS.

  • api : string - The LSCS API to use ("documents" or "documents-meta")
  • params : object - The developer-defined datum/property ID. For additional help, refer to the LSCS documentation.
  • callback : function - The callback function
  • useStagingInAuthoring : boolean - Whether or not to use Staging content in the Authoring environment (default is false)

iw.getProjects(callback) Retrieves the projects, to be used as an input for LSCS queries.

  • callback : function - The callback function

Sample usage (TypeScript)

const iw : any = window['iw'];

/*
 * to get datum/property values
 */

// a potential way of retrieving the module/app ID
const root = document.getElementById('root');
const id = root.dataset['appId'];
   
const myBooleanValue = iw.getPropertyValue(id, 'D001');
const mySelectedCheckBox = iw.getPropertyValue(id, 'D002').value;

/* 
 * to query LSCS
 */

// basic example wildcard query
let params = { 
	q: '*',
	includeDCRContent: true,
	format: 'json'
};
iw.queryLscs(api, params, (data) => {
	// callback function
});

// query with additional filters
let params = {
	q: 'ast_relative_path:*/' + searchQuery,
	project: selectedProject,
	includeDCRContent: true,
	format: 'json'
}
iw.queryLscs('documents', params, (data) => {
	// callback function
});