-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding storage to persist user_id and traits, replacing rl_message ke…
…y and rl_
- Loading branch information
1 parent
bc0f3ab
commit 6de3c16
Showing
5 changed files
with
170 additions
and
114 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//import nodeCode from "./node"; | ||
import { HubSpot } from "./browser"; | ||
|
||
export default process.browser ? { HubSpot } : { HubSpot }; | ||
export default process.browser ? HubSpot : HubSpot; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import * as HubSpot from "./HubSpot"; | ||
|
||
let integrations = { HS: HubSpot.default.HubSpot }; | ||
let integrations = { HS: HubSpot.default }; | ||
|
||
export { integrations }; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,39 @@ | ||
var RudderMessage = require("./RudderMessage.js").RudderMessage; | ||
//Individual element class containing Rudder Message | ||
class RudderElement { | ||
constructor() { | ||
this.rl_message = new RudderMessage(); | ||
} | ||
|
||
//Setters that in turn set the field values for the contained object | ||
setType(type) { | ||
this.rl_message.rl_type = type; | ||
} | ||
|
||
setProperty(rudderProperty) { | ||
this.rl_message.rl_properties = rudderProperty; | ||
} | ||
|
||
setUserProperty(rudderUserProperty) { | ||
this.rl_message.rl_user_properties = rudderUserProperty; | ||
} | ||
|
||
setUserId(userId) { | ||
this.rl_message.rl_user_id = userId; | ||
} | ||
|
||
setEventName(eventName) { | ||
this.rl_message.rl_event = eventName; | ||
} | ||
|
||
updateTraits(traits) { | ||
this.rl_message.rl_context.rl_traits = traits; | ||
} | ||
} | ||
module.exports = { | ||
RudderElement: RudderElement | ||
}; | ||
constructor() { | ||
this.rl_message = new RudderMessage(); | ||
} | ||
|
||
//Setters that in turn set the field values for the contained object | ||
setType(type) { | ||
this.rl_message.rl_type = type; | ||
} | ||
|
||
setProperty(rudderProperty) { | ||
this.rl_message.rl_properties = rudderProperty; | ||
} | ||
|
||
setUserProperty(rudderUserProperty) { | ||
this.rl_message.rl_user_properties = rudderUserProperty; | ||
} | ||
|
||
setUserId(userId) { | ||
this.rl_message.rl_user_id = userId; | ||
} | ||
|
||
setEventName(eventName) { | ||
this.rl_message.rl_event = eventName; | ||
} | ||
|
||
updateTraits(traits) { | ||
this.rl_message.rl_context.rl_traits = traits; | ||
} | ||
|
||
getElementContent() { | ||
return this.rl_message; | ||
} | ||
} | ||
module.exports = { | ||
RudderElement: RudderElement | ||
}; |
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