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

tstdel-notify-msteam-callback

v1.0.0

Published

This is custom module used in TSTDEL projects to send error alert to ms team channel on incomingwebhook created for channel

Downloads

4

Readme

                                  #tstdel-notify_msteam_callback
  • Item 1 Project Title: tstdel-notify-msteam-callback

  • Item 2 Project Owner: Test Delivery Team

  • Item 3 Description: This node package contains functions that are used for sending msteam notification. This package is in the - act-npm repository

How to install:

npm --registry=https://maven.corporate.act.org/repository/npm-group install --save tstdel-notify-msteam-callback

How to use:

  • Constructor:
  • parameters:
    • properties
    • type: Object
    • description : properties to connect to msteam and message defaults attributes
    • attributes:
    • messagetype:
      • type: string
      • description: The "type" field must be "MessageCard".
    • themeColor:
      • type: string
      • description: set the message theme color e.g "0072C6".
    • summary:
      • type: string
      • description: Description of message
    • pretext:
      • type: string
      • description: header of incoming message in MSteam.
    • webhook:
      • type: string
      • description: incoming web hook URL where team channel message deliver. You can generate it by logging to ms team in connector section.

Function#1: notify Description: - This function publishes the message to the msteam.

  • parameters:
  • message
    type: string description: message to publish.
  • callback
    type:callback description: make a call to callback function notifyMessage for the final result.

Function#2: notifyCustomizedMessage Description: - This function publishes the customized message to the msteam.

  • parameters:
  • message
    type: string description: message to publish
  • messageProperties
    type: array description: Contained the customized message to send the msteam channel.
  • callback
    type:callback description: make a call to callback function notifyMessage for the final result.

Function#3: notifyAlternateMsteamDestination Description: - This function publishes the message to the different channel of msteam

  • parameters:

  • message
    type: string description: message to publish

  • msTeamProperties
    type: array description: contain the different ms team channel (setting)information used to override default settings picked frokm config file.

  • callback
    type:callback description: make a call to callback function notifyMessage for the final result.

Function#4: notifyMessage Description: - This is th main method communicate with ms team channel using the webhook for transmission of message.

  • parameters:

  • message
    type: string description: message to publish

  • messageProperties

  • summary: type: string description: Description of message

  • pretext: type: string description: header of incoming message in MSteam

  • msTeamProperties

  • messagetype: type: string description: The "type" field must be "MessageCard".

  • themeColor: type: string description: set the message theme color e.g "0072C6".

  • webhook: type: string description: incoming web hook URL where team channel message deliver. You can generate it by logging to ms team in connector section .

  • callback
    type:callback description: execute call back function and return the final result.

Sample code:
const tstdelNotifyMSTeamCallback = require('./tstdel_notify_msteam_callback');
function sendmsgteam(message, callback) {
  try {
    const props = {
      "type": "MessageCard",
      "themecolor": "theme color of message",
      "summary": "Description Message",
      "pretext": "MESSAGE SHOWN IN HEADER",
      "webhook": "https://actinc.webhook.office.com/webhookb2/9a4c9b49-d3ee-40be-b073-b0aa8ea07057@65cb0346-9d88-41d9-8ca6-f72047670d0f/IncomingWebhook/225a21849fbb4776a1015d9e53ee9e25/4a8e84dd-07b4-4e85-9815-d00bee0f2296"
    };

    const notifyMSTeam = new tstdelNofifyMSTeamAsync(props);
    notifyMSTeam.notify(message, (err, notifyMSTeamresponse) => {
      if (err) {
        return callback(err);
      } else {
        return callback(null, notifyMSTeamresponse);
      }
    });
  } catch (error) {
    callback(error);
  }
}

// Usage example
sendmsgteam('test message', (err, response) => {
  if (err) {
    console.error('Notification failed:', err.message);
  } else {
    console.log('Notification success:', response.status);
  }
});