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

addigy

v2.10.3

Published

![npm](https://img.shields.io/npm/v/addigy.svg?style=flat-square)

Downloads

301

Readme

npm

Addigy API SDK for Node.JS

This package takes the Addigy public API and wraps it into a consistent promise-based interface.

:warning: Use this at your own risk. To error is human, to propogate error across all of prod via API is DevOps.


Getting Started

You can install the package with the following command:

npm install addigy

You must import the package and pass in the clientId and clientSecret from addigy to the constructor, as so:

import { Addigy } from 'addigy'

const addigy = new Addigy({
    clientId: '52c6...',
    clientSecret: '8db7...',
})

From there, you can call any of the addigy package functions (all of which are Promise-based) using await or with => notation:

const policies = await addigy.getPolicies()

The response will be a JSON object or array, like so:

;[
    {
        color: '#8a4242',
        download_path: 'https://prod.addigy.com/download/addigy_agent/ca13b.../d4c...',
        policyId: 'd4c...',
        parent: null,
        orgid: 'ca13b...',
        creation_time: 1555527090,
        name: 'Prod Policy',
        icon: 'fa fa-desktop',
    },
    {
        color: '#000000',
        download_path: 'https://prod.addigy.com/download/addigy_agent/ca13b.../17b...',
        policyId: '17b...',
        parent: null,
        orgid: 'ca13b...',
        creation_time: 1557534783,
        name: 'Customer 2',
        icon: 'fa fa-university',
    },
    {
        color: '#00d000',
        download_path: 'https://prod.addigy.com/download/addigy_agent/ca13b.../af4...',
        policyId: 'af4...',
        parent: null,
        orgid: 'ca13b...',
        creation_time: 1557880460,
        name: 'Dev Policy',
        icon: 'fa fa-exchange',
    },
]

Don't forget to catch your promises.


Advanced Usage

This wrapper supports some advanced functions such as user management, retreival of billing information, creation of ScreenConnect links, and management of API keys. These all rely on use of Addigy's internal API, which can change at any time without notice. Usage of this module is unsuported in general, but consider use of these endpoints as even less than unsuported. I actively discourage their use. With that disclaimer out of the way, here's how to use them:

Expand the Constructor's parameters to include the username and password of a user account at the partnr tenant level that has 'Owner' access, as so:

import { Addigy } from 'addigy'

const addigy = new Addigy({
    clientId: '52c6...',
    clientSecret: '8db7...',
    adminUsername: '[email protected]',
    adminPassword: 'hunter2',
})

From there, call addigy.getAuthObject() to generate an authentication object that contains an auth token and other information needed by various internal calls. The auth object will look like so:

{
  orgId: 'a4d7...',
  emailAddress: '[email protected]',
  authToken: '35a8...'
}

From there, you can pass that auth object to any of the internal API endpoints, like so:

addigy
    .createUser(authObject, '[email protected]', 'First Last', [], 'user')
    .then((result) => {
        console.log(result)
    })
    .catch((err) => {
        console.log(err) // actually handle your errors though
    })

If you are a partner that manages multiple independent Addigy tenants, you can easily run commands against your child tenants by calling the getImpersonationAuthObject() function. It will return a new authentication object pertinent to the given tenant that can be used on subsequent calls. An example of the workflow is as follows:

const addigy = new Addigy({
    clientId: '52c6...',
    clientSecret: '8db7...',
    adminUsername: '[email protected]',
    adminPassword: '...',
})

const partnerAuthObject = await addigy.getAuthObject()
const desiredTenantOrgId = '078b...'

const impersonationObject = await addigy.getImpersonationAuthObject(
    partnerAuthObject,
    desiredTenantOrgId,
)

// Now we have a new authentication object to call Addigy's API for a given tenant

await addigy.getUsers(impersonationObject)

createKernelExtensionPolicy()

This method allows you to create a Kernel Extension Policy. This functions requires 4 parameters. The authObject, name of the Policy, allowing overrides, and the kernelExtension object.

The kernelExtensions object contains two arrays. allowedTeamIdentifers to pass a kernel extension's Team Identifier for approval or the allowedKernelExtensions to pass the Team Identifier and Bundle Identifiers.

Example:

const kernelExtensions = { allowedKernelExtensions: [
    {teamIdentifier: '2JJNSDF9', bundleIdentifiers: ['com.bundle.com'
      ]
    }
  ],
  allowedTeamIdentifiers: ['3NFJDID', '4JJSISJ'
  ]
}

await addigy.createKernelExtensionPolicy( authObject, 'Name', true, kernelExtensions)

createSystemExtensionPolicy()

This method allows you to create a System Extension Policy. This functions requires 4 parameters. The authObject, name of the Policy, allowing overrides, and the sytemExtension object.

The systemExtensions object contains three arrays to pass allowedSystemExtensions, allowedSystemExtensionTypes and allowedTeamIdentifiers.

Example:

const systemExtensions = [{
  allowedSystemExtensions: [{teamIdentifier: '2JJNSDF9', bundleIdentifiers: ['com.bundle.com'
    ]
  }],
  allowedSystemExtensionTypes: [{teamIdentifier: '3JJNSDF9', bundleIdentifiers: ['com.bundle.com'
    ]
  }],
  allowedTeamIdentifiers: ['3NFJDID', '4JJSISJ'
  ]
}

await addigy.createSystemExtensionPolicy( authObject, 'Name', true, systemExtensions)

createPPPCPolicy()

This method allows you to create a PPPC Policy. This functions requires 3 parameters. The authObject, name of the Policy, and the pppcPolicy object.

The pppcPolicy object allows you to pass an array of identifers and codeRequirements to be mapped to an array of services. The services array allowed you to choose and configure the options for each service you want the identifier and codeRequirement to be mapped to.

const pppcPolicy = [{identifier: 'ex_identifier', codeRequirement: 'ex_coderequirement', services: [
    {service: 'address_book', identifierType: "bundleID", allowed: true
    },
    {service: "screen_capture", identifierType: "bundleID", authorization: "AllowStandardUserToSetSystemService"
    },
  	{service: "apple_events", identifierType: "bundleID", allowed: true, identifier_type: "bundleId", 	    aeReceiverIdentifier: "com.microsoft.Powerpoint", aeReceiverIdentifierType: "bundleID", aeReceiverCodeRequirement: "identifier \"com.microsoft.Powerpoint...."
		}
  ]
}]

await addigy.createPPPCPolicy(authObject, 'Name', pppcPolicy)

Have fun.