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

@cumulus-consulting/mfgx-io-api-client

v3.3.0

Published

Client package for api.mfgx.io

Downloads

123

Readme

@cumulus-consulting/mfgx-io-api-client

API client designed to simplify use of MFGx APIs. Works in Node and browser environments.

Install via npm

npm install --save @cumulus-consulting/mfgx-io-api-client

Quick Start (ES6)

import { apiClient } from '@cumulus-consulting/mfgx-io-api-client';

apiClient.setBaseUrl('https://api.instance.mfgx.io');

await apiClient.signIn({
	email: '[email protected]',
	password: 'password'
});

const { data: { userMany } } = await apiClient.graphQL({
	query: `{
	  userMany {
	    id
	    email
	  }
	}`
});

Documentation

Exports

import { 
  // Pre-constructed API client instance with default options.
  apiClient, 
  // Main API client class, used to construct a new instance or extend the client.
  MFGxClient, 
  // Map of MFGx APIs; see APIs section below
  APIS 
} from '@cumulus-consulting/mfgx-io-api-client'; 

Constructor Options

{
  // Base MFGx API url (i.e. 'https://api.instance.mfgx.io').  Can also be set
  // or changed via the setBaseUrl function on a client instance.
	url,
	// Promise-returning functions to get, set, and clear a token from storage.
	// Default behavior is to store tokens in a closure; override provides the
	// ability to store tokens in persistent or secure storage.
	tokenStorage: {
		get,
		set,
		clear,
	},
	// When true, token expiration 401 errors will be automatically caught, the
  // token will attempt to be refreshed, and the request retried.  Defaults to
  // false.
	autoRefreshToken: false,
  // Callback called when errors occur, in addition to function throws.  
  // Can be used to display error UI or for global error logging.
	onError,
	// Promise-returning callback used to request device information when
	// needed by the client.  Device information returned should match the
	// format of the DeviceInformationInput type in the signIn API.
	onRequestDeviceInformation,
}

APIs

{
	// Primary graphQL sign-in API.
	SIGN_IN:  '/signIn',
	// Main graphQL application API.
	GRAPHQL:  '/graphql',
	// Metadata graphQL API for system data.
	METADATA:  '/metadata',
	OCR: {
		// REST API to execute raw OCR requests; only applicable if OCR is enabled.
		RAW:  '/ocr/raw'
	},
	DOCUMENTS: {
		// REST API to generate PDF documents.
		GENERATE:  '/documents/generate'
	},
	WEBHOOKS: {
		// REST API to publish into a user-defined webhook.
		UDT:  '/webhooks/udt'
	},
	INTEGRATION: {
		// REST API for standardized requests to external systems.
		ENDPOINT:  '/integration/endpoint'
	},
	// Transformation graphQL API for executing MFGx scripts.
	TRANSFORMATION:  '/transformation'
}