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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hcl-software/domino-rest-sdk-node

v0.1.6

Published

NodeJS library to interact with a HCL Domino compatible REST API

Downloads

40

Readme

Domino REST API Node.js SDK

Domino REST API Node.js SDK is a library that can help Node.js developers to build applications that uses Domino REST API. Domino REST API Node.js SDK also supports TypeScript.

(C) 2023 HCL America Inc. Apache-2.0 license https://www.apache.org/licenses/LICENSE-2.0

npm

📔 Documentation

⬇️ Installation

First, have a running Domino REST API server, and next, install Node.js. Make sure the version is >18.0.0 as Domino REST API Node.js uses the native fetch method available on that version. Then run:

npm install @hcl-software/domino-rest-sdk-node

⭐ Highlights

  • Supports both JavaScript and TypeScript.
  • Has built-in methods for the following Domino REST API calls:
    • Basis:
      • /document
      • /document/{unid}
      • /bulk/create
      • /bulk/{unid}
      • /bulk/update
      • /bulk/delete
      • /query
      • /lists
      • /lists/{name}
      • /listspivot/{name}
    • Setup:
      • /design/{designType}/{designName}
      • /admin/scope
      • /admin/scopes

📦 Importing

You can import the whole SDK via:

// Using Node.js `require()`
const drapiSdk = require('@hcl-software/domino-rest-sdk-node');

// Using ES6 imports
import drapiSdk from '@hcl-software/domino-rest-sdk-node';

Or, you can import only the modules that you need, like:

// Using Node.js `require()`
const { DominoAccess } = require('@hcl-software/domino-rest-sdk-node');

// Using ES6 imports
import { DominoAccess } from '@hcl-software/domino-rest-sdk-node';

🔬 Overview

Domino REST API Node SDK Model

Domino REST API Node SDK has four moving parts:

  • DominoAccess
  • DominoServer
  • DominoConnector
  • Sessions
    • DominoUserSession
    • DominoBasisSession
    • DominoSetupSession

ℹ️ DominoAccess

DominoAccess is a class that facilitates your access to the Domino REST API server. It takes in a baseUrl, which is your Idp provider, as well as your credentials, such as your username, password, scope and type (the authentication type: basic or oauth).

ℹ️ DominoServer

DominoServer is a class that gets information on what APIs are available on your current server. It takes in a url to your Domino REST API server as a parameter. This class produces a DominoConnector class base on your chosen API.

ℹ️ DominoConnector

DominoConnector is the class that does the actual communication between the Domino REST API Node SDK and your Domino REST API server.

ℹ️ Sessions

Sessions are classes that contains all the operations you can perform on your Domino REST API server. There are three classes under this, namely:

  • DominoUserSession
  • DominoBasisSession
  • DominoSetupSession

DominoUserSession has generic request methods, which allows you to perform an operation from scratch.

DominoBasisSession contains all built-in methods for BASIS API operations.

DominoSetupSession contains all built-in methods for SETUP API operations.

🎮 Running a Domino REST API operation using the SDK

Here is an example of how to use the four moving parts mentioned above in order to execute one Domino REST API Node SDK.

import drapiSdk from '@hcl-software/domino-rest-sdk-node';

const start = async () => {
  const credentials = {
    baseUrl: 'http://localhost:8880',
    credentials: {
      scope: '$DATA',
      type: 'basic',
      username: 'username',
      password: 'password',
    },
  };
  // Create DominoAccess
  const dominoAccess = new drapiSdk.DominoAccess(credentials);
  // Create DominoServer
  const dominoServer = await drapiSdk.DominoServer.getServer('http://localhost:8880');
  // Since in this example we will be performing a BASIS API operation (createDocument),
  // we will use the DominoBasisSession class in order to use the built-in createDocument method.
  const dominoBasisSession = await drapiSdk.DominoBasisSession.getBasisSession(dominoAccess, dominoServer);

  // Create a Domino document
  await dominoBasisSession.createDocument(...)
    .then((document) => console.log(JSON.stringify(document.toJson(), null, 2)))
    .catch((error) => console.log(error));
}

start();

For other examples, please go to our examples.