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

@dialob/fill-api

v1.4.8

Published

Dialob filling API

Downloads

38

Readme

Dialob Fill API

Install

yarn add @dialob/fill-api

Quick-start

import DialobFill from '@dialob/fill-api';

// Replace `sessionId` and `endpoint` with appropriate values
const sessionId = '8bab410b7bfac6f64fbbb1024d52a96f';
const session = DialobFill.newSession(sessionId, {
  endpoint: 'https://instance.dialob.io/',
});

// Now you have a session object that holds the state of the session. You should first pull data
// from the server
session.pull();

// Update answer
session.setAnswer('itemId', 'newAnswer');

// Add row to row group
session.addRowToGroup('rowGroup1');

// Delete row from row group
session.deleteRow('rowGroup1.1');

// Next page
session.next();

// Previous page
session.previous();

// Go directly to a page
session.goToPage(pageId);

// Complete the session
session.complete();

// Get item
session.getItem(itemId);

// Get item errors
session.getItemErrors(itemId);

// Get valueSet
session.getValueSet(valueSetId);

// Get locale
session.getLocale();

// Set locale
session.setLocale(locale);

// Get context or expression variable value
session.getVariable(id);

// The session object batches updates and syncs them at appropriate times, however, it also updates
// its local cache instantly. The `update` event is emitted on any state change, local or remote.
session.on('update', () => {
  console.log('onUpdate');
});

// `sync` event is emitted when syncing starts or ends.
session.on('sync' (syncState) => {
  // `syncState` can be either `INPROGRESS` (syncing is ongoing) or `DONE` (syncing was successfully
  // completed)
  console.log('onSync', syncState);
});

// `error` event is emitted if some error happens that can't be handled by the library
session.on('error', (type, error) => {
  // `type` is either `SYNC` (sync error) or `SYNC-REPEATED` (repeated sync error, indication of systematic failure and should require user interaction)
  console.error(type, error);
});

// You can remove listeners with `removeListener()`
session.removeListener('update', updateFn);

Session options

You can define session options as the third argument to the session constructor:

const session = DialobFill.newSession(sessionId, transport, options);

The possible options are:

interface SessionOptions {
  // Defines how many milliseconds session should batch actions for before syncing them to server.
  // A value of -1 disables the batching logic and always immediately syncs each action. This can
  // be used if you want to do debouncing yourself, for example.
  syncWait?: number;
}

Compatibility

This API does not follow the same versioning as Dialob backend. To ensure full compatibility, refer to this table. Each row documents a compatibility change, any versions in between can be assumed to be compatible with eachother.

| fill-api | backend | | ---------- | -------- | | 1.4.0 | 1.0.11 | | 1.3.0 | 1.0.8 | | 1.0.0 | 1.0.0 |