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

@nearform/aws-apn-connector

v1.0.4

Published

A Headless Web Browser Automation Library to allow for API integration with Amazon Web Services Partner Network (APN)

Downloads

2

Readme

AWS Amazon Partner Network (APN) API

Digital Bridge to AWS APN

This project is a web automation tool that uses Playwright to interact with the AWS Partner Network (APN) website, because they do not provide an API. It provides functionalities such as:

  • Authentication with the APN
  • Get all registered certifications for the partner
  • Get all registered opportunities and their status for the partner
  • Get all registered and active users
  • Deactivate a user with a provided name - must resolve to a single unique user. NOTE: It does not currently handle if the same name applies to two different individuals, in this case it will fail safely and throw an error.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You need to have Node.js installed on your machine to run this project. You can download it from here.

System Requirements

These are driven by the requirements for Playwright, which specifies these baseline operating environments.

  • Windows 10+, Windows Server 2016+ or Windows Subsystem for Linux (WSL).
  • MacOS 12 Monterey or MacOS 13 Ventura.
  • Debian 11, Debian 12, Ubuntu 20.04 or Ubuntu 22.04, with x86-64 or arm64 architecture.

Installing

Install the library from npm.

npm i @nearform/aws-apn-connector

Usage

Import the Client function from the index.js file and create a new instance. You can then use the connect method to authenticate and the users.deactivateByEmail method to deactivate a user. Please note that at this time there is no re-authentication model implemented within the library, so implementations are bound to the standard web session authentication length of time. That said the only penalty for authentication before each transaction is time roughly 2 seconds (there appears to be no throttling otherwise).

import { Client } from 'aws-apn-connector'

async function main () {
  // can pass in parameters for playwright to the Client constructor and it will apply them to the playwright instance
  const client = new Client()

  // executes against the web portal to create session
  await client.connect('username', 'password')

  // gets all certifications from the website
  const isRemoved = await client.users.deactivateByName('Irene Cara')  // Take your passion and make it happen.

  // gets all certifications from the website
  const certifications = await client.certifications.all()

  // gets all registered opportunities from the website
  const opportunities = await client.opportunities.all()

  await client.close()
}

main()

As-A-Service

This library has been built in a manner that it can be exposed as a web API service (code available at ./samples/server.js). There is also a Containerfile associated with this repository that can be used either directly or with enhancement to create a container deployable instance of this service into any container fabric. For either of these workflows to work, you will need to set environment variables for APN_USERNAME and APN_PASSWORD with your appropriate credentails.

Documentation

The library is pretty simple and I always welcome pull requests, but if you just want to consume the library, please find the documentation here.

Built With

  • Playwright - For headless chrome (by default, can change via configuration if desired) interactions with the AWS APN
  • XLSX - Used to handle Excel files - The preferred data format for everything AWS APN.

License

This project is licensed under the MIT License - see the LICENSE.md file for details