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

@linx-impulse/engage-wishlist-sdk-js

v0.3.4

Published

Linx Impulse Engage Wishlist SDK

Downloads

22

Readme

engage-wishlist-sdk-js

Wishlist SDK for Linx Impulse Wishlist API customers

Usage

Content

getAllLists

Parameters

  • options (object)
    • apiKey (string): API key unique to each store.
    • secretKey (string): Secret key unique to each store.
    • itemType (string): Type of item that can be included on the list, may be either 'product' or 'collection'.
    • userId (string): User ID

PS: options parameter and all of its properties are required.

Example

wishlist.getAllLists({
  apiKey: 'apiKeyFake',
  secretKey: 'secretKeyFake',
  itemType: 'product',
  userId: 'user123456',
})
.then((res) => {
  console.log(`Lists: ${res}`);
  /* Expected output:
  Lists: [
    {
        id: "94170ed7-2569-5499-96bc-62b3c35d0533",
        name: "Favoritos",
        isDefault: true,
        created: 1547587097766
    },
    {
        id: "c65da160-890f-52bb-906d-66694ac20eb7",
        name: "new_list",
        created: 1547588890391
    }
  ]
  */
});

getList

Parameters

  • options (object)
    • apiKey (string): API key unique to each store.
    • secretKey (string): Secret key unique to each store.
    • itemType (string): Type of item that can be included on the list, may be either 'product' or 'collection'.
    • userId (string): User ID.
    • listId (string): List ID.
    • productFormat (string): Format that determines which properties each product object will have, can be one of three: 'onlyIds', 'compact', 'complete'. Defaults to 'compact'.
    • showOnlyAvailable (boolean or number): In case of a list with detailed products, show only products which are available in stock. Will be ignore if productFormat is 'onlyIds'. Can be true, false, 1 or 0. Defaults to false.

Example

wishlist.getList({
  apiKey: 'apiKeyFake',
  secretKey: 'secretKeyFake',
  itemType: 'product',
  userId: 'user123456',
  listId: 'c15ca47b-a980-5ba9-af14-ad38a6b043d6',
  productFormat: 'onlyIds',
})
  .then((res) => {
    console.log(`List: ${res}`);
    /* Expected output:
    List: {
      id: '94170ed7-2569-5499-96bc-62b3c35d0533',
      name: 'Favoritos',
      isDefault: true,
      created: 1547587097766,
      items: [
        id: '10032490428',
      ],
    },
    */
  });

getListItemCount

Parameters

  • options (object)
    • apiKey (string): API key unique to each store.
    • secretKey (string): Secret key unique to each store.
    • itemType (string): Type of item that can be included on the list, may be either 'product' or 'collection'.
    • userId (string): User ID.
    • listId (string): List ID.
    • showOnlyAvailable (boolean or number): Will count only products which are available in stock. Can be true, false, 1 or 0. Defaults to false.

Example

wishlist.getListItemCount({
  apiKey: 'apiKeyFake',
  secretKey: 'secretKeyFake',
  itemType: 'product',
  userId: 'user123456',
  listId: 'c15ca47b-a980-5ba9-af14-ad38a6b043d6',
})
.then((res) => {
  console.log(`Count: ${res}`);
  /* Expected output:
  Count: 1
  */
});

insertItemOnList

Parameters

  • options (object)
    • apiKey (string): API key unique to each store.
    • secretKey (string): Secret key unique to each store.
    • itemType (string): Type of item that can be included on the list, may be either 'product' or 'collection'.
    • userId (string): User ID.
    • listId (string): List ID.
    • itemId (string): ID of the item that will be inserted on the list.
    • skuList (array): ID of the skus (if any) that will be inserted on the list (optional).

Example

wishlist.insertItemOnList({
  apiKey: 'apiKeyFake',
  secretKey: 'secretKeyFake',
  itemType: 'product',
  userId: 'user123456',
  listId: 'c15ca47b-a980-5ba9-af14-ad38a6b043d6',
  itemId: '10032490428',
})
.then((res) => {
  console.log(`${res}`);
  /* Expected output:
  Items successfully inserted on list
  */
});

removeItemFromList

Parameters

  • options (object)
    • apiKey (string): API key unique to each store.
    • secretKey (string): Secret key unique to each store.
    • itemType (string): Type of item that can be included on the list, may be either 'product' or 'collection'.
    • userId (string): User ID.
    • listId (string): List ID.
    • itemId (string): ID of the item that will be removed from the list.

Example

wishlist.removeItemFromList({
  apiKey: 'apiKeyFake',
  secretKey: 'secretKeyFake',
  itemType: 'product',
  userId: 'user123456',
  listId: 'c15ca47b-a980-5ba9-af14-ad38a6b043d6',
  itemId: '10032490428',
})
.then((res) => {
  console.log(`${res}`);
  /* Expected output:
  Items successfully removed from list
  */
});

createList

Parameters

  • options (object)
    • apiKey (string): API key unique to each store.
    • secretKey (string): Secret key unique to each store.
    • itemType (string): Type of item that can be included on the list, may be either 'product' or 'collection'.
    • userId (string): User ID.
    • name (string): Name of the list to be created.
    • extras (object): Object containing any properties to be added to the list (optional).

Example

wishlist.createList({
  apiKey: 'apiKeyFake',
  secretKey: 'secretKeyFake',
  itemType: 'product',
  userId: 'user123456',
  name: 'My list',
})
.then((res) => {
  console.log(`My list: ${res}`);
  /* Expected output:
  My List: {
    id: '94170ed7-2569-5499-96bc-62b3c35d0533',
    name: 'My list',
    created: 1547587097766,
    items: [],
  },
  */
});

updateList

Parameters

  • options (object)
    • apiKey (string): API key unique to each store.
    • secretKey (string): Secret key unique to each store.
    • itemType (string): Type of item that can be included on the list, may be either 'product' or 'collection'.
    • userId (string): User ID.
    • listId (string): List ID.
    • name (string): The new name for the list being updated.
    • extras (object): Object containing any properties to be added to the list (optional).

Example

wishlist.updateList({
  apiKey: 'apiKeyFake',
  secretKey: 'secretKeyFake',
  itemType: 'product',
  userId: 'user123456',
  listId: 'c15ca47b-a980-5ba9-af14-ad38a6b043d6',
  name: 'Wedding list',
  extras: {
    categories: ['appliances', 'decoration'],
  },
})
.then((res) => {
  console.log(`Wedding list: ${res}`);
  /* Expected output:
  Wedding list: {
    id: 'c15ca47b-a980-5ba9-af14-ad38a6b043d6',
    name: 'Wedding list',
    created: 1547587097766,
    items: [
      {
        id: '1314112124',
      }
    ],
    extras: {
      categories: ['appliances', 'decoration'],
    },
  },
  */
});

deleteList

Parameters

  • options (object)
    • apiKey (string): API key unique to each store.
    • secretKey (string): Secret key unique to each store.
    • itemType (string): Type of item that can be included on the list, may be either 'product' or 'collection'.
    • userId (string): User ID.
    • listId (string): List ID.

Example

wishlist.deleteList({
  apiKey: 'apiKeyFake',
  secretKey: 'secretKeyFake',
  itemType: 'product',
  userId: 'user123456',
  listId: 'c15ca47b-a980-5ba9-af14-ad38a6b043d6',
})
.then((res) => {
  console.log(res);
  /* Expected output:
  List deleted successfully
  */
});

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

PS: Do not forget the tests ;)