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

@elodigit/client

v0.1.6

Published

ELO Digital Office REST API Client

Downloads

217

Readme

Features

  • ✅ Typescript support

  • ✅ Node.js and browser support

  • ✅ Easy to use and setup with npm

  • ✅ All enpoints available

  • ✅ Reuse of existing browser sessions

  • ✅ Async/await support

Installation

npm install @elodigit/client

Usage

Import and initialize a client using ELO login credentials.

import { Client } from "@elodigit/client";

// Initializing a client
const client = new Client({
  IX_URL: "http://playground.com/ix-Solutions",
  USERNAME: "Administrator",
  PASSWORD: "elo",
});
await client.connect();

OR reuse an existing ELO session (only available in browsers for e.g. web apps)

const client = new Client({
  IX_URL: "http://playground.com/ix-Solutions",
  USE_SESSION: true,
  REDIRECT: true,
});
await client.connect();

Make a request to any ELO API service/endpoint.

See the complete list of endpoints in the IX API Documentation

const response = await client.ix.checkoutSord({
  objId: "1",
  editInfoZ: EditInfoC.mbSord,
  lockZ: LockC.NO,
});

const sord = response.result?.sord;

Each method returns a Promise which resolves the response.

console.log(response);
{
  result: {
    sord: {
      TStamp: "2023.02.24.10.48.35",
      acl: "75PYJA",
      childCount: 0,
      doc: 33,
      guid: "(804CE708-8221-716F-7452-4FA201E7F858)",
      id: 1,
      kind: 1,
      mask: 0,
      name: "Solutions",
      ownerId: 0,
      parentId: 1,
      ...
    }
  }
}

Client options

The Client supports the following options on initialization. These options are all keys in the single constructor parameter.

| Option | Default value | Type | Required | Description | | ------------------ | ----------------------------------------- | -------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | IX_URL | undefined | string | true | Url to the IX service for connection e.g. https://playground.com/ix-Solutions | | USERNAME | undefined | string | Resolver | false | ELO username for basic authentication. This authentication method is discouraged in the browser because there is no CSRF protection. | | PASSWORD | undefined | string | Resolver | false | ELO password for basic authentication | | TIMEOUT | 10000 | number | false | Connection timeout to ELO server in ms. | | USE_SESSION | false | boolean | false | Reuses an existing session that's provided by e.g. the Java Client, Web Client, Mobile Client. This option is only available in browsers (e.g. for web apps) | | REDIRECT | true | boolean | false | Redirects to the login page if session expires. Works only in combination with USE_SESSION | | KEEP_ALIVE | true | boolean | false | Tries to keep the session alive by pinging the server every 60 seconds. Works only in combination with USE_SESSION or SESSION_TICKET | | CLIENT_INFO | language=en country=US timezone=UTC | ClientInfo | Resolver | false | The ClientInfo object containing the users language and country | | ELO_APPROVED | undefined | string | Resolver | false | CSRF token to send approved REST requests | | WITH_CREDENTIALS | true | boolean | false | Option is used to include cookies in the request. Required for option USE_SESSION | | SESSION_TICKET | undefined | string | Resolver | false | Session ticket that is used as Bearer-Header for authentication | | HEADERS | undefined | Headers | Resolver | false | Additional custom headers for request |

Resolver are async functions that can be passed instead of static values to the client. They provide the ability of resolving values at runtime.

async (options: ApiRequestOptions, config: OpenAPIConfig) => {
  return "Administrator";
};

Enable CORS

To enabled CORS add the "Access-Control-Allow-*" headers as entries in the Indexserver config.xml. At least "Access-Control-Allow-Origin" is requried. Example:

<entry key="Access-Control-Allow-Origin">*</entry>

TypeScript

This package contains type definitions for all request parameters and responses.

Constants

All ELO constants are available for e.g. endpoint requests. LockC.NO, SordC.mbAllIndex, etc.