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

@ritani/vendor-sdk

v4.1.3

Published

Ritani Diamond Vendor Inventory SDK

Downloads

60

Readme

Diamond Vendor Inventory SDK Quick Start

How To Install (node version 14 or higher is required):

npm -g install @ritani/vendor-sdk

To install node and npm, please refer to: pre-built installer for your platform

How To Use

Step 1: Get API and FTP credentials from Ritani:

If you already have it, you can skip step 1 and go to step 2 directly.

Sign up on Ritani's vendor portal:

Click to Sign up and create an account

Once sign up is complete, sign in and click on the account tab. There you will find your FTP and API credentials:

Username, Password and API key

Step 2: Create a project folder. Then run the SDK config command. This will guide you through the process of configuring the SDK.

for example: ritani-inventory as project folder, ritani-inventory/data as data folder

mkdir -p ritani-inventory/data

cd ritani-inventory

newecx --set-config

Enter your project directory: .../ritani-inventory
Enter your data directory: .../ritani-inventory/data
Enter your vendor API key: ...

Step 3: generate template with instruction and sample data

newecx --generate-template

template files are saved in .../ritani-inventory/template

Here is what we have in the project directory:
.
├── data
└── template
    ├── ...
    ...
    ├── agreed-header.js
    ├── fields-map.js
    ├── instruction.csv
    └── inventory.csv

Click below to view sample data:

  1. agreed-header.js
  2. fields-map.js
  3. instruction.csv
  4. inventory.csv

Step 4: explore newecx cli command

newecx -h

Usage: newecx [options]

Options:
-v, --version                              output the current version
-set --set-config                          to set project and data directories, ftp and api credentials
-sd --set-data-dir <data_directory>        to set data directory
-sp --set-project-dir <project_directory>  to set project directory
-gt --generate-template                    to generate template, instruction and sample data
-di --download-inventory                   to download latest inventory feed data from server
-dh --download-header                      to download agreed header from server
-df --download-fields-maps                 to download fields-maps from server
-da --download-all                         to download inventory, header and fields-maps from server
-uh --upload-header                        to upload agreed header to server
-uf --upload-fields-maps                   to upload fields-maps to server
-fuh --force-upload-header                 to force upload agreed header to server
-fuf --force-upload-fields-maps            to force upload fields-maps to server
-mh --make-header                          to make agreed-header.js from inventory data
-mf --make-fields-maps                     to make fields-maps.js from inventory data
-vi --validate-inventory                   to validate inventory csv
-ra --retrieve-assets                      to retrieve assets of passed diamonds
-si --submit-inventory                     to submit original inventory feed to server
-ssi --submit-std-inventory                to submit the generated standardized inventory csv to server
-sa --submit-assets                        to submit retrieved assets to server
-sb --submit-both-inventory-assets         to submit both inventory and assets to server
-h, --help                                 display help for command

Click here for the full documentation of the newecx cli command

Step 5: Example of Using Vendor SDK APIs

To upload your inventory feed (data/inventory.csv file):

'use strict';

const node_path = require('path');
const { api_upload_inventory } = require('@ritani/vendor-sdk').core;

(async () => {

    let inventory_filepath = node_path.join(__dirname(), 'data', 'inventory.csv');

    console.log('api upload inventory.csv');
    const result = await api_upload_inventory(inventory_filepath);
    console.log(result);

})();

Click here for full documentation of the Vendor SDK APIs