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 { payload = {}, event: event_action = {} } = body; | |
const { event = {}, event_type = {}, invitee = {}, questions_and_answers, time } = payload; | |
const { name: event_name } = event_type; | |
const { email } = invitee; | |
const ident = { | |
email, | |
anonymous_id: email | |
} |
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
######################################################################### | |
# Title: Cloudbox: Homeassistant Role # | |
# Author(s): l3uddz, desimaniac # | |
# URL: https://github.com/cloudbox/cloudbox # | |
# Docker Image: homeassistant/home-assistant # | |
# -- # | |
# Part of the Cloudbox project: https://cloudbox.works # | |
######################################################################### | |
# GNU General Public License v3.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
# Javascript Node CircleCI 2.0 configuration file | |
# | |
# Check https://circleci.com/docs/2.0/language-javascript/ for more details | |
# | |
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: circleci/node:8.9 | |
working_directory: ~/repo |
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
//Returns the category of the customer based on the NPS score, | |
const getCategory = nps => { | |
if (nps > 8) return "promoter"; | |
if (nps > 6) return "passive"; | |
return "detractor"; | |
} | |
if (changes && changes.user) { | |
const { nps_rating } = changes.user; | |
// If the NPS Rating Changes |
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
if (isInSegment("Highly Qualified") && isInSegment("Connected This week")) { | |
traits({ category: 'active' }); | |
} else if (isInSegment("Not Qualified") && !isInSegment("Connected This week")) { | |
traits({ category: 'no_fit' }); | |
} else if (isInSegment("Highly Qualified") && !isInSegment("Connected This week")) { | |
traits({ category: 'churn_risk' }); | |
} else if (isInSegment("Not Qualified") && isInSegment("Connected This week")) { | |
traits({ category: 'needs_onboarding' }); | |
} else { | |
traits({ category: 'manual_operation' }); |
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
//Create an array of all the points we give | |
const scores = []; | |
//Helper method to push to the scores array. | |
const addToScore = points => points && scores.push(points); | |
//Scoring based on User Attributes. | |
const { | |
is_beta, |
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
type FirehoseEvent = { | |
claims: FirehoseClaim, | |
params: TrackParams | TraitsParams | AliasParams, | |
context: TrackContext | TrackContext | AliasContext | |
}; | |
type Metric: { | |
[ToBeDetermined]: any | |
}; |