New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

message-mover

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

message-mover

Message mover to GCP pubsub

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

message-mover

This package contains a Javascript function to send messages to GCP PubSub.

Table of Contents

  • Installation
  • Features
  • Release notes

Installation

npm install message-mover

Features

In this package you will find the following features:

SendMessage

This function publish a message to GCP PubSub.

Usage

const messageMover = require('message-mover');

// some async function to use
const callSendMessage = async () => {

	// Object with all the PubSub parameters needed to send a message
	const psObject = {
		// Required fields
		PUBSUB_PROJECT_ID: process.env.PUBSUB_PROJECT_ID,
		PUBSUB_CLIENT_EMAIL: process.env.PUBSUB_CLIENT_EMAIL,
		PUBSUB_PRIVATE_KEY: process.env.PUBSUB_PRIVATE_KEY,
		TOPIC_NAME: process.env.TOPIC_NAME,
		MESSAGE_ENTITY_TYPE: process.env.MESSAGE_ENTITY_TYPE,
		MESSAGE_COUNTRY: process.env.MESSAGE_COUNTRY,
		MESSAGE_COMMERCE: process.env.MESSAGE_COMMERCE,
		MESSAGE_BUSINESS_UNIT: process.env.MESSAGE_BUSINESS_UNIT,
		MESSAGE_DOMAIN: process.env.MESSAGE_DOMAIN,
		MESSAGE_CAPABILITY: process.env.MESSAGE_CAPABILITY,

		// Optional fields, if not defined, will be used with the default values
		MESSAGE_VERSION: '1.0',
		MESSAGE_EVENT_TYPE: 'notifyNewRecord',
		MESSAGE_CHANNEL: 'Async-PubSub',
		MESSAGE_MIME_TYPE:'application/json'
	};

	// Array with data object that contains their own id
	const dataList = [{ id: 1, data: { field_1: XXX, ..., field_N: YYY } }];

	await messageMover.sendMessage(psObject, dataList).then((resp) => {
		console.log(resp);
	});
};

callSendMessage();

This function additionally validates the input parameters to ensure that the message could be sent correctly.

Release notes

1.0.X

This version contains the following features:

  • SendMessage

Keywords

Javascript

FAQs

Package last updated on 01 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts