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

node-appsync

v1.0.4

Published

node.js client for AppSync API.

Downloads

79

Readme

node-appsync

nodejs client for AppSync API

Installation

npm install node-appsync

Documentation

var AppSync = require("node-appsync");

var aps = new AppSync({
  token: "<app_token>",
  debug: true, // enable debugging?
  useSandbox: true, // use the sandbox?
});

aps.getPluginToken(function (err, data) {
  if (err) console.log(err);
  else console.log(data);
});

aps.getMappedCustomers(
  {
    per_page: 4,
    current_page: 1,
    filter: "error",
    from_date: "2/14/2023",
    to_date: "2/15/2023",
    order_by: "updated_at",
    sort: "desc",
  },
  function (err, accounts) {
    accounts.QueryResponse.Account.forEach(function (account) {
      console.log(account.Name);
    });
  }
);

aps.updateCustomer(
  {
    CustomerId: "Q48nBE8J",
    FullyQualifiedName: "Eric James",
    sparse: true,
    PrimaryEmailAddr: {
      Address: "eric@example.com",
    },
  },
  function (err, data) {
    if (err) console.log(err);
    else console.log(data);
  }
);
Sorting

Basic ordering is achieved via the optional first argument object as well. Include asc or desc in the object whose values are the columns you wish to order on. For example:

aps.getMappedCustomers(
  {
    sort: "desc",
    order_by: "updated_at",
  },
  function (e, data) {
    console.log(data);
  }
);
Pagination

Pagination is achieved via the optional first argument object as well. Include per_page and/or current_page keys in the object whose values are the number of rows you wish to limit the result set to or from respectively. For example:

aps.getMappedCustomers(
  {
    per_page: 40,
    current_page: 1,
  },
  function (e, data) {
    console.log(data);
  }
);

Public Api

AppSync(token, useSandbox, debug)

Arguments

  • token - The app token received from AppSync
  • useSandbox - boolean flag to indicate whether to use Sandbox (i.e. for testing)
  • debug - boolean flag to log http requests, headers, and response bodies to the console

Admin

Create

Read

Update

Merchant

Create

Read

Update

Batch

createPluginToken(callback)

Creates the plugin's temporary access token

Arguments

  • callback - Callback function which is called with any error and the response data.

onboardMerchant(object, callback)

Creates new Merchant in AppSync.

Arguments

  • object - The unsaved Merchants, to be persisted in AppSync.
  • callback - Callback function which is called with any error and the response data.

getHostedPage(object, callback)

Retrieves Admin hosted page url.

Arguments

  • object - configuration object passed for initialization.
  • callback - Callback function which is called with any error and the response data.

createCustomer(object, callback)

Creates new customer in QuickBooks through AppSync.

Arguments

  • object - The customer object, to be synced with AppSync,
  • callback - Callback function which is called with any error and the response data.

createProduct(object, callback)

Creates new product in QuickBooks through AppSync.

Arguments

  • object - The product object, to be synced with AppSync,
  • callback - Callback function which is called with any error and the response data.

createInvoice(object, callback)

Creates new invoice in QuickBooks through AppSync.

Arguments

  • object - The invoice object, to be synced with AppSync,
  • callback - Callback function which is called with any error and the response data.

createPayment(object, callback)

Creates new payment in QuickBooks through AppSync.

Arguments

  • object - The payment object, to be synced with AppSync,
  • callback - Callback function which is called with any error and the response data.

getUserInfo(callback)

Retrieves user information from the AppSync

Arguments

  • callback - Callback function which is called with any error and the response data.

getAuthStartUrl(callback)

Retrieves OAuth start url to initialize connection with QuickBooks.

Arguments

  • callback - Callback function which is called with any error and the response data.

getOnboardedMerchants(callback)

Retrieves list of onboarded merchant's from the AppSync

Arguments

  • callback - Callback function which is called with any error and the response data.

getAnalytics(callback)

Retrieves count and overview data from the AppSync

Arguments

  • callback - Callback function which is called with any error and the response data.

getRecentSync(object, callback)

Retrieves list of successfully synced entities from the AppSync.

Arguments

  • object - Pagination, filter, sort params object.
  • callback - Callback function which is called with any error and the response data.

getMappedCustomers(object, callback)

Retrieves list of successfully synced customers from the AppSync.

Arguments

  • object - Pagination, filter, sort params object.
  • callback - Callback function which is called with any error and the response data.

getMappedProducts(object, callback)

Retrieves list of successfully synced products from the AppSync.

Arguments

  • object - Pagination, filter, sort params object.
  • callback - Callback function which is called with any error and the response data.

getMappedInvoices(object, callback)

Retrieves list of successfully synced invoices from the AppSync.

Arguments

  • object - Pagination, filter, sort params object.
  • callback - Callback function which is called with any error and the response data.

getMappedPayments(object, callback)

Retrieves list of successfully synced payments from the AppSync.

Arguments

  • object - Pagination, filter, sort params object.
  • callback - Callback function which is called with any error and the response data.

updateUserInfo(object, callback)

Updates User's information in AppSync.

Arguments

  • object - The unsaved User's information, to be persisted in AppSync.
  • callback - Callback function which is called with any error and the response data.

updateCustomer(object, callback)

Updates Customer object in QuickBooks through AppSync.

Arguments

  • object - The unsaved Customer object, to be persisted.
  • callback - Callback function which is called with any error and the response data.

updateProduct(object, callback)

Updates product object in QuickBooks through AppSync.

Arguments

  • object - The unsaved Product object, to be persisted.
  • callback - Callback function which is called with any error and the response data.

voidInvoice(object, callback)

Void's the Synced Invoice in QuickBooks.

Arguments

  • object - The unsaved Invoice object, to be voided.
  • callback - Callback function which is called with any error and the response data.

deleteInvoice(object, callback)

Delete's the Synced Invoice in QuickBooks.

Arguments

  • object - The unsaved Invoice object, to be deleted.
  • callback - Callback function which is called with any error and the response data.

updateMerchant(object, callback)

Updates onboarded merchant information in AppSync.

Arguments

  • object - The unsaved information of Merchant, to be persisted in AppSync.
  • callback - Callback function which is called with any error and the response data.

initiateBatchSync(object, callback)

Creates Sync Queue for batch data received from your application.

Arguments

  • object - Batch Data object to sync.
  • callback - Callback function which is called with any error and the response data.

initiateReverseSync(callback)

Retrieves information from platform and Add Sync Queue in AppSync.

Arguments

  • callback - Callback function which is called with any error and the response data.

triggerSync(callback)

Starts the sync process to create Data in QB received from Your Application

Arguments

  • callback - Callback function which is called with any error and the response data.

triggerReverseSync(callback)

Starts the sync process in reverse mode to send Data in Sync To Your Application

Arguments

  • callback - Callback function which is called with any error and the response data.