oneday-core
Advanced tools
Comparing version 1.0.41 to 1.0.42
@@ -110,3 +110,2 @@ const aws = require('aws-sdk'); | ||
console.log('Created entry in table: ' + params.TableName); | ||
console.log(result); | ||
@@ -141,3 +140,2 @@ if (isPublish === true) { | ||
console.log('Updated table: ' + params.TableName); | ||
console.log(result); | ||
@@ -170,3 +168,2 @@ if (isPublish === true) { | ||
console.log('Deleted record from table: ' + params.TableName); | ||
console.log(result); | ||
@@ -173,0 +170,0 @@ if (isPublish === true) { |
{ | ||
"name": "oneday-core", | ||
"version": "1.0.41", | ||
"version": "1.0.42", | ||
"description": "Basic AWS util functions to ease development.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -34,6 +34,2 @@ 'use strict'; | ||
// entity: rep by topic name | ||
// event_type: create, up, del, read | ||
// data: full record | ||
// change: properties that were changed (only in case of update) | ||
async function publishToTopic(topicName, eventType, data, requestId, change = []) { // Sends the given message object to given sns topic | ||
@@ -72,2 +68,6 @@ | ||
StringValue: eventType | ||
}, | ||
'EntityType': { | ||
DataType: 'String', | ||
StringValue: topicName.split('-')[0] | ||
} | ||
@@ -79,3 +79,3 @@ }, | ||
const result = await sns.publish(params).promise(); | ||
console.log(result); | ||
console.log('Message (' + result.MessageId + ') is sent to topic: ' + params.TopicArn); | ||
@@ -82,0 +82,0 @@ } catch (error) { |
25080
666