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

insightlyjs

v1.0.6

Published

JS/TS Insightly SDK

Downloads

3

Readme

insightlyjs

This package is under development. It is not yet ready for use.

insightlyjs is a lightweight Node.js library for the Insightly API v3.1.

The goal of InsightlyJS is to provide a simple and intuitive way to interact with the Insightly API.

Prerequisites

Node v18.0.0 or higher is recommended.

The fetch API will be polyfilled if it is not available.

InsightlyJS will throw an error if you are using an unsupported runtime environment and is unable to polyfill.

Installation

npm install insightlyjs --save

Loading and configuring the module

ES Modules (ESM)

import InsightlyJS from 'insightlyjs';

CommonJS (CJS)

const InsightlyJS = require('insightlyjs').default;

Alternatively, you can use the async import() function from CommonJS to load insightlyjs:

const InsightlyJS = await import('insightlyjs');

Configuration

const insightly = new InsightlyJS({
  apiKey: '<your-api-key>',
  apiUrl: 'https://api.insight.ly/v3.1',
});

Usage

InsightlyJS is in development. Many of the methods are not yet implemented, but will be added soon. If you would like to help, please contact me.

Activity Sets

getActivitySetList(options)

Retrieves a list of activity sets.

const activitySets = await insightly.getActivitySetList({
    // Only return the top level properties of the activity sets.
    brief?: boolean,
    // Number of records to skip
    skip?: number,
    // Limit the number of records returned
    top?: number,
    // Reutrn the total amount of records
    countTotal?: boolean
});

getActivitySet(id)

Retrieves an activity set by its ID.

const activitySet = await insightly.getActivitySet(12345);

Comments

getCommentFileAttachments(options)

Retrieves a list of comment file attachments.

const commentFileAttachments = await insightly.getCommentFileAttachments({
    // Required - the ID of the comment
    id: number,
    // Required - ISO 8601 date string in the format YYYY-MM-DDTHH:MM:SSZ of the earliest date the file attachment was last updated
    updatedAfterUtc?: string,
    // Number of records to skip
    skip?: number,
    // Limit the number of records returned
    top?: number,
    // Reutrn the total amount of records
    countTotal?: boolean
});

Contacts

getContacts(options)

Retrieves a list of all contacts.

const contacts = await insightly.getContacts({
    // Only return the top level properties of the contacts.
    brief?: boolean,
    // Number of records to skip
    skip?: number,
    // Limit the number of records returned
    top?: number,
    // Reutrn the total amount of records
    countTotal?: boolean
});

getContact(id)

Retrieves a contact by its ID.

const contact = await insightly.getContact(12345);

getContactDates(id)

Retrieves a list of contact dates by the contact's ID.

const contactDates = await insightly.getContactDates(12345);

getContactEmails(id)

Retrieves a list of contact emails by the contact's ID.

const contactEmails = await insightly.getContactEmails({
    // The ID of the contact
    contactId: number,
    // Earliest date the email was last updated
    updatedAfterUtc?: string,
    // Maximum number of records to return
    top?: number,
    // Number of records to skip
    skip?: number,
    // Reutrn the total amount of records
    countTotal?: boolean,
    // Return only the top level properties of the emails
    brief?: boolean
});

getContactEvents(options)

Retrieves a list of contact events by the contact's ID.

const contactEvents = await insightly.getContactEvents({
    // The ID of the contact
    contactId: number,
    // Earliest date the event was last updated
    updatedAfterUtc?: string,
    // Maximum number of records to return
    top?: number,
    // Number of records to skip
    skip?: number,
    // Reutrn the total amount of records
    countTotal?: boolean,
    // Return only the top level properties of the events
    brief?: boolean
});

getContactFileAttachments(options)

Retrieves a list of contact file attachments by the contact's ID.

const contactFileAttachments = await insightly.getContactFileAttachments({
    // The ID of the contact
    contactId: number,
    // Earliest date the file attachment was last updated
    updatedAfterUtc?: string,
    // Maximum number of records to return
    top?: number,
    // Number of records to skip
    skip?: number,
    // Reutrn the total amount of records
    countTotal?: boolean,
});

getContactFollowState(id)

Retrieves the follow state of a contact by its ID.

const contactFollowState = await insightly.getContactFollowState(12345);

getContactLinks(id)

Retrieves a list of contact links by the contact's ID.

const contactLinks = await insightly.getContactLinks(12345);

getContactNotes(options)

Retrieves a list of contact notes by the contact's ID.

const contactNotes = await insightly.getContactNotes({
    // The ID of the contact
    contactId: number,
    // Earliest date the note was last updated
    updatedAfterUtc?: string,
    // Maximum number of records to return
    top?: number,
    // Number of records to skip
    skip?: number,
    // Reutrn the total amount of records
    countTotal?: boolean,
    // Return only the top level properties of the notes
    brief?: boolean
});

getContactTags(id)

Retrieves a list of contact tags by the contact's ID.

const contactTags = await insightly.getContactTags(12345);

getContactTasks(options)

Retrieves a list of contact tasks by the contact's ID.

const contactTasks = await insightly.getContactTasks({
    // The ID of the contact
    contactId: number,
    // Earliest date the task was last updated
    updatedAfterUtc?: string,
    // Maximum number of records to return
    top?: number,
    // Number of records to skip
    skip?: number,
    // Reutrn the total amount of records
    countTotal?: boolean,
    // Return only the top level properties of the tasks
    brief?: boolean
});

searchContacts(options)

Retrieves a list of contacts that match the search criteria.

const searchResults = await insightly.searchContacts({
    query: {
        first_name: string
    },
    top?: number,
    skip?: number,
    countTotal?: boolean
    brief?: boolean
});

searchContactsByTag(options)

Retrieves a list of contacts that match the tag provided.

const searchResults = await insightly.searchContactsByTag({
    tagName: string,
    top?: number,
    skip?: number,
    countTotal?: boolean
    brief?: boolean
});

Examples

I am looking for someone to help build examples while I focus on the core functionalities of the library. Please contact me if you would like to help.

TypeScript

Types are bundled with the library, so you don't need to insstall any additional packages.

To use the types, import them into your project like so:

import { Contact } from "insightlyjs";

Completed modules

  • [x] Activity Sets
  • [x] Comments (needs testing)
  • [ ] Contacts (in progress)
  • [ ] Countries
  • [ ] Currencies
  • [ ] Custom Fields
  • [ ] Custom Objects
  • [ ] Custom Objects Records
  • [ ] Emails
  • [ ] Events
  • [ ] File Attachments
  • [ ] File Categories
  • [ ] Follows
  • [ ] Forum Categories
  • [ ] Forum Posts
  • [ ] Instance
  • [ ] Knowledge Article Categories
  • [ ] Knowledge Article Folders
  • [ ] Knowledge Articles
  • [ ] Leads
  • [ ] Lead Sources
  • [ ] Lead Statuses
  • [ ] Milestones
  • [ ] Notes
  • [ ] Opportunities
  • [ ] Opportunity Categories
  • [ ] Opportunity Products
  • [ ] Opportunity State Reasons
  • [ ] Organisations (Organizations)
  • [ ] Permissions
  • [ ] Pipelines
  • [ ] Pipeline Stages
  • [ ] Price Book Entries
  • [ ] Price Books
  • [ ] Products
  • [ ] Project Categories
  • [ ] Projects
  • [ ] Prospects
  • [ ] Quote Products
  • [ ] Quotes
  • [ ] Relationships
  • [ ] Scim
  • [ ] Tags
  • [ ] Task Categories
  • [ ] Tasks
  • [ ] Team Members
  • [ ] Teams
  • [ ] Tickets
  • [ ] Users

Other milestones to be completed

  • [ ] Input Validation
    • [ ] ISO 8601
    • [ ] String
    • [ ] Number

Contact

You can email me with any question, suggestions, or concerns.