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

@honcho/messages-gateway

v1.0.23

Published

Teams Integration gateway that runs behind the client firewall and filters messages, only sending to Honcho messages of monitored users

Downloads

40

Readme

Overview

Teams Messages Gateway it's a NodeJs Server that runs behind the client firewall. The Gateway subscribes to MS Graph Notifications, requesting ALL Teams Messages, and filters those notifications sending to Honcho only those from specified Monitored Users

Requirements

Install & Configure

  1. Run npm init
  2. Install the gateway integration running npm install @honcho/messages-gateway
  3. Edit the config/.env, adding the right values and configuration for the messages gateway
   # App Configs
   SERVER_URL='server.client.com' # The internet exposed URL used by MS Graph to send notifications
   PORT=3000 # The HTTP port (only needed if HTTP_ENABLED)
   HTTPS_PORT=8443 # The HTTPS port (only needed if HTTPS_ENABLED)

   # Endpoints
   ENDPOINT_GRAPH_LOGIN_BASE='https://login.microsoftonline.com' # Do not change
   ENDPOINT_GRAPH_BASE="https://graph.microsoft.com" # Do not change
   ENDPOINT_GRAPH_LOGIN="/oauth2/v2.0/token" # Do not change
   ENDPOINT_GRAPH_SCOPE=".default" # Do not change
   ENDPOINT_GRAPH="v1.0/teams" # Do not change
   ENDPOINT_GRAPH_SUBSCRIPTIONS='beta/subscriptions' # Do not change
   ENDPOINT_HONCHO_BASE="https://teams.getwhistler.io" # Do not change
   MEMBERS_ENDPOINT="members" # Do not change
   HONCHO_MONITORED_USERS_ENDPOINT="" # Do not change
   HONCHO_NOTIFICATIONS_ENDPOINT="" # Do not change

   # Other configs
   HTTPS_CERT="" # The path to the Cert
   HTTPS_KEY="" # The path to the Key
   HTTPS_ENABLED=false # Set to true to run HTTPS Server
   HTTP_ENABLED=true # Set to true to run HTTP Server
   CLIENT_ID="<ms_graph_app_id>" # MS Graph App Id (can be retrieved on Azure)
   TENANT_ID="<ms_graph_tenant_id>" # MS Graph Tenant Id (can be retrieved on Azure)
  1. Create a config/.env.private file, adding decreption key and app secret (look at config.env.private.example)
    DECRYPTION_KEY=123123123abcdefg # Base64 Private Key used to decrypt notifications
    CLIENT_PUBLIC_KEY=00000000 # Base64 Public Key or Certificate used to encrypt notification by MS Graph
    CLIENT_SECRET=123123123 # MS Graph Secret (can be retrieved on Azure)
  1. Populate config/monitored_users.json with a list of users that are supposed to be monitored. The list is a JSON Array of Object. The only mandatory field, at the moment, is the teamsId.
[    
    {
        "teamsId": "123123123" 
    },  
    {
        "teamsId": "abcdefghi" 
    }
]
  1. Run command npm run restart

NOTE: Any configuration changes must be followed by an app restart. ( Step 5 above )

HTTPS

The notification URL ( HONCHO_NOTIFICATIONS_ENDPOINT ), in .env is required to be under HTTPS. How this will be implemented depends on client infrastructure and it is a configurable / editable value by the client. The Gateway could be started as an HTTP or HTTPS server (look at the config/.env configuration file). In the latter case it would require for key and cert path to be specified inside the config/.env file.

Troubleshooting

Logs

Run npm run log to navigate through the gateway logs. Is possible to run npm run monit to get more details about the process running.

Debug

You can run npm run debug to zip the entire folder (excluding .env.private file) and the gateway logs. Then you can send the zip file to Honcho's Customer Support via email, in order to receive a better and quicker support.