Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@live-change/user-service

Package Overview
Dependencies
Maintainers
1
Versions
228
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@live-change/user-service - npm Package Compare versions

Comparing version 0.2.28 to 0.2.29

42

contactOrUserProperty.js

@@ -42,2 +42,5 @@ const definition = require("./definition.js")

const transferEventName = ['contactOrUser', ...(extendedWith.map(e => e[0].toUpperCase() + e.slice(1)))]
.join('And') + 'Owned' + modelName + 'Transferred'
service.trigger({

@@ -62,4 +65,10 @@ name: 'contactConnected',

const contactPropertyId = contactPath.map(p => JSON.stringify(p)).join(':')
const contactProperty = await modelRuntime().get(contactPropertyId)
if(contactProperty) {
const range = {
gte: contactPropertyId + '', // '' because it can be not-extended
lte: contactPropertyId + ':\xFF'
}
const contactProperties = await modelRuntime().rangeGet(range)
/// TODO: list based merge method
for(const contactProperty of contactProperties) {
console.log("CONTACT PROPERTY FOUND!", contactProperty, "MERGE =", config.merge)
const userPath = ['user_User', user]

@@ -74,4 +83,4 @@ const userPropertyId = userPath.map(p => JSON.stringify(p)).join(':')

identifiers: {
ownerType: 'user_User',
owner: user
contactOrUserType: 'user_User',
contactOrUser: user
},

@@ -84,4 +93,4 @@ data: mergeResult

identifiers: {
ownerType: 'user_User',
owner: user
contactOrUserType: 'user_User',
contactOrUser: user
},

@@ -94,4 +103,4 @@ data: mergeResult

identifiers: {
ownerType: contactType,
owner: contact
contactOrUserType: contactType,
contactOrUser: contact
}

@@ -101,11 +110,18 @@ })

if(!userProperty) {
const extendedIdentifiers = {}
for(const key of extendedWith) {
extendedIdentifiers[key+'Type'] = contactProperty[key+'Type']
extendedIdentifiers[key] = contactProperty[key]
}
emit({
type: 'contactOrUserOwned' + modelName + 'Transferred',
type: transferEventName,
from: {
ownerType: contactType,
owner: contact
contactOrUserType: contactType,
contactOrUser: contact,
...extendedIdentifiers
},
to: {
ownerType: 'user_User',
owner: user
contactOrUserType: 'user_User',
contactOrUser: user,
...extendedIdentifiers
}

@@ -112,0 +128,0 @@ })

{
"name": "@live-change/user-service",
"version": "0.2.28",
"version": "0.2.29",
"description": "",

@@ -24,7 +24,7 @@ "main": "index.js",

"dependencies": {
"@live-change/framework": "0.6.0",
"@live-change/relations-plugin": "0.6.0",
"@live-change/framework": "0.6.3",
"@live-change/relations-plugin": "0.6.3",
"pluralize": "8.0.0"
},
"gitHead": "34309fef58572e1a8794b52438430dd421c57d65"
"gitHead": "37d229ac05adf5e045ae3dcc826c6945d5dc3670"
}
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