New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

smsg

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smsg - npm Package Compare versions

Comparing version 1.0.61 to 1.1.0

60

lib/index.js

@@ -11,5 +11,17 @@ 'use strict'

if (type[0] === 'image') {
const isMedia = (s) => {
switch (s) {
case 'image':
case 'video':
case 'audio':
case 'file':
return true
default:
return false
}
}
if (isMedia(type[0])) {
att = {
type: 'image',
type: type[0],
payload: {

@@ -70,2 +82,18 @@ url: text

const phone_number = function (title, url) {
if (typeof title !== 'string') {
throw TypeError(`[smsg#phone_number] 'title' must be a string.`)
}
if (typeof url !== 'string') {
throw TypeError(`[smsg#phone_number] 'payload' must be a string.`)
}
return {
title: title,
url: url,
type: 'phone_number'
}
}
const postback = function (title, payload) {

@@ -105,2 +133,26 @@ if (typeof title !== 'string') {

const video = function (url) {
if (typeof url !== 'string') {
throw TypeError(`[smsg#video] 'url' must be a string.`)
}
return _attachment('video', url)
}
const audio = function (url) {
if (typeof url !== 'string') {
throw TypeError(`[smsg#audio] 'url' must be a string.`)
}
return _attachment('audio', url)
}
const file = function (url) {
if (typeof url !== 'string') {
throw TypeError(`[smsg#file] 'url' must be a string.`)
}
return _attachment('file', url)
}
const button_template = function (text, buttons) {

@@ -132,8 +184,12 @@ if (typeof text !== 'string') {

_attachment: _attachment,
audio: audio,
button_template: button_template,
file: file,
generic_template: generic_template,
image: image,
phone_number: phone_number,
postback: postback,
text: text,
video: video,
web_url: web_url
}

2

package.json
{
"name": "smsg",
"version": "1.0.61",
"version": "1.1.0",
"description": "A simple library for constructing structured messages for the Messenger Platform Send API.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc