This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "kustomer.conversation.email", | |
"app": "kustomer", | |
"type": "internal_api", | |
"inputTemplate": { | |
"orgId": "/#_env.orgId", | |
"userId": "/#userId", | |
"uri": "http://drafts:8000/v1/customers/{{customer}}/drafts", | |
"method": "POST", | |
"data": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"eventName": "kustomer.conversation.create", | |
"app": "kustomer", | |
"outputTemplate": { | |
"sentiment": "/#data.attributes.sentiment", | |
"suggestedTags": "/#data.attributes.suggestedTags", | |
"tags": "/#data.attributes.tags", | |
"satisfaction": "/#data.attributes.satisfaction", | |
"messageCount": "/#data.attributes.messageCount", | |
"done": "/#data.attributes.done", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Promise = require('bluebird') | |
const request = require('request-promise'); | |
const cheerio = require('cheerio') | |
const fs = require('fs'); | |
const fsWriteFile = Promise.promisify(fs.writeFile); | |
const fsMkdir = Promise.promisify(fs.mkdir); | |
const simpleParser = require('mailparser').simpleParser; | |
const messagesArr = require('./messages.json'); | |
const _ = require('lodash') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "kustomer.kobject.create-with-customer", | |
"app": "kustomer", | |
"type": "internal_api", | |
"inputTemplate": { | |
"orgId": "/#_env.orgId", | |
"uri": "http://sobjects:8000/v1/customers/{{{customer}}}/klasses/{{{klassName}}}", | |
"method": "POST", | |
"data": { | |
"externalId": "/#externalId", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "kustomer.kobject.create-with-customer", | |
"app": "kustomer", | |
"type": "internal_api", | |
"inputTemplate": { | |
"orgId": "/#_env.orgId", | |
"uri": "http://sobjects:8000/v1/customers/{{{customer}}}/klasses/{{{klassName}}}", | |
"method": "POST", | |
"data": { | |
"externalId": "/#externalId", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "kustomer.kobject.update", | |
"app": "kustomer", | |
"type": "internal_api", | |
"inputTemplate": { | |
"data": { | |
"custom": "/#custom", | |
"tags": "/#tags", | |
"data": "/#data", | |
"icon": "/#icon", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "kustomer.kobject.find-last", | |
"type": "internal_api", | |
"inputTemplate": { | |
"method": "GET", | |
"uri": "http://sobjects:8000/v1/customers/{{{customer}}}/klasses/{{klass}}?sort=desc&pageSize=1", | |
"orgId": "/#_env.orgId" | |
}, | |
"outputTemplate": { | |
"data": "/#body.data.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"description": "", | |
"name": "update-by-last-kobject", | |
"steps": [ | |
{ | |
"action": "kustomer.message.find-last", | |
"id": "2", | |
"params": { | |
"klass": "order", | |
"customer": "/#steps.1.id", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var kapi = require('../index')({ | |
type: 'prod', | |
token: '' | |
}) | |
function clearAll(notifs) { | |
return kapi.notifications.clear(notifs); | |
} | |
function fetchNotifs(next) { |