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

whiz-sdk-node

v1.5.9

Published

SDK to connect with Whiz Microservices

Readme

whiz-sdk-node

Setup

Install in your project using npm

npm install whiz-sdk-node

Require in your file as

import WhizSDK from 'whiz-sdk-node';

const whizSDK = WhizSDK({
    apiUrl:  'https://api.example.com',
    clientId:  1,
    clientSecret: 'client_secret_hash'
});

Identity Methods

Validate Document Number (DNI)

const documentNumber = '71747124';
const person = await whizSDK.identity.validate({documentNumber});
console.log(person);

Person Methods

Create Person

const person = await whizSDK.person.create
({
	name: "Luis",
	lastName: "Torres",
	birthdate: "1994-04-04",
	documentType: "DNI",
	documentNumber: "71747125",
	phone: "983241622"
});
console.log(person);

Show Person

const personUuid = 'uuid-example';
const person = await whizSDK.person.get(personUuid);
console.log(person);

List Person

const people = await whizSDK.person.all({
    page: "1",
    limit: "10"
});
console.log(people);

User Methods

List Users

const users = await whizSDK.user.all();
console.log(users);

Get User

const user = await whizSDK.user.get('userUuid');
console.log(user);

Get User by Email

const user = await whizSDK.user.getByEmail({
    email: '[email protected]', role: 'roleUuid'
    });
console.log(user);

Login User

const login = await whizSDK.user.login({
    email: '[email protected]', password: 'passwordStrONG', role: 'roleUuid'
    });
console.log(login);

Create User with Person

const created_user = await whizSDK.user.createWithPerson({
    person: {
        name: "name",
        lastName: "lastName",
        birthDate: "birthdate",
        phone: "phone",
        documentType: "documentType",
        documentNumber: "documentNumber"
    },
    user: {
        email: "[email protected]",
        role: "roleUuid",
        password: "passwordStrONG"
    }
});
console.log(created_user);

Update User with Person

const user = await whizSDK.user.updateUserWithPerson({
    user: "userUuid",
    person: "personUuid",
    body: {
        person: {
            name: "userName",
            lastName: "lastName",
            birthDate: "birthdate",
            phone: "phone",
            documentType: "documentType",
            documentNumber: "documentNumber"
        },
        user: {
            password: "passwordStrONG"
        }
    }
});
console.log(user);

Mail Methods

Send Mail

const mail = await whizSDK.mail.send({
    cc: [{email: "[email protected]", name: "name"}],
    sender: {email: '[email protected]', name: 'Sender'}, 
    addressee: {email: '[email protected]', name: 'Receiver'}, 
    template: '<h1>Hi!</h1>',
    subject: 'Greetings'
});
console.log(mail);

Create Mail List

const mailList = await whizSDK.mail.list.create({
    name: 'name',
    description: 'description',
    category: 'category'
});
console.log(mailList);

Update Mail List

const mailList = await whizSDK.mail.list.update({
    list: 'mailListUuid',
    body: {
        name: 'name',
        description: 'description',
        category: 'category'
    }
});
console.log(mailList);

Delete Mail List

await whizSDK.mail.list.delete('mailListUuid');

Show Mail List

const mailList = await whizSDK.mail.list.get('uuid');
console.log(mailList);

Mail List Add People

await whizSDK.mail.list.addPeople({
    list: 'mailListUuid',
    body: {
        people: [{email: '[email protected]', name: 'name'}]
    }
});

Mail List Send mail

await whizSDK.mail.list.send({
    list: 'mailListUuid',
    body: {
        sender: {email: '[email protected]', name: 'Sender'},
        template: '<h1>Hi!</h1>',
        subject: 'Greetings'
    }
});

Image Methods

Upload Image

await whizSDK.image.upload({
    imageBuffer, 
    mimeType: "image/png"
    image: {
        tableName: "images",
        tableKey: "1",
        fileName: "name-from-image.png"
    }
});

Load Image by Url

await whizSDK.image.loadByUrl({
    images: [{
        tableName: "images",
        tableKey: "1",
        url: "https://url-from-image"
    }]
});

Delete Image

await whizSDK.image.delete('imageUuid');

Role Methods

List Role

const roles = await whizSDK.role.all();
console.log(roles);

Create Role

const role = await whizSDK.role.create({
    title: "admin",
    abilities: ["abilityUuid"]
});
console.log(role);

Update Role

const role = await whizSDK.role.update({
    uuid: "roleUuid",
    title: "admin",
    abilities: ["abilityUuid"]
});
console.log(role);

Ability Methods

Create Ability

const ability = await whizSDK.ability.create({
    title: 'manageCommercial'
});
console.log(ability);

Update Ability

const ability = await whizSDK.ability.update({
    ability: 'abilityUuid',
    body: {
        title: 'admin'
    }
});
console.log(ability);

Get Ability

const ability = await whizSDK.ability.get(abilityUuid);
console.log(ability);

List Ability

const abilities = await whizSDK.ability.all();
console.log(abilities);

Sheets (CSV and Excel)

List sheets

const sheets = await whizSDK.sheet.all({
    page: "1",
    limit: "10"
});
console.log(sheets);

Find sheet

const sheet = await whizSDK.sheet.find("uuid");
console.log(sheet);

Create sheet

const sheet = await whizSDK.sheet.initSheet
({
  headers: ["name", "email", "phone"];
  format: "csv";
});
console.log(sheet);

Update sheet with payload

const sheet = await whizSDK.sheet.addPayload
({
  sheet: "uuid", 
  body: {
    data: [
        {
            name: "Paolo",
            email: "[email protected]",
            phone: "123456789"
        },
        {
            name: "Eduardo",
            email: "[email protected]",
            phone: "123456788"
        }
    ]
  }
});
console.log(sheet);

Generate sheet

const sheet = await whizSDK.sheet.generateSheet("uuid");
console.log(sheet);