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

@live-change/relations-plugin

Package Overview
Dependencies
Maintainers
1
Versions
225
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@live-change/relations-plugin - npm Package Compare versions

Comparing version 0.6.5 to 0.6.6

entity.js

5

index.js

@@ -0,1 +1,3 @@

const entity = require('./entity.js')
const propertyOf = require('./propertyOf.js')

@@ -14,2 +16,3 @@ const itemOf = require('./itemOf.js')

const processors = [
entity,
propertyOf, itemOf,

@@ -27,2 +30,2 @@ propertyOfAny, itemOfAny,

...processors
]
]
const {
defineProperties, defineIndex,
processModelsAnnotation
processModelsAnnotation, addAccessControlParents
} = require('./utils.js')

@@ -21,2 +21,3 @@

context.identifiers = defineProperties(context.model, context.others, context.otherPropertyNames)
addAccessControlParents(context)
defineIndex(context.model, context.joinedOthersClassName, context.otherPropertyNames)

@@ -52,2 +53,2 @@

})
}
}
const {
defineAnyProperties, defineAnyIndexes,
processModelsAnyAnnotation
processModelsAnyAnnotation, addAccessControlAnyParents
} = require('./utilsAny.js')

@@ -21,2 +21,3 @@

context.identifiers = defineAnyProperties(context.model, context.otherPropertyNames)
addAccessControlAnyParents(context)
defineAnyIndexes(context.model, context.otherPropertyNames)

@@ -53,2 +54,2 @@

})
}
}

6

package.json
{
"name": "@live-change/relations-plugin",
"version": "0.6.5",
"version": "0.6.6",
"description": "",

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

"dependencies": {
"@live-change/framework": "^0.6.5",
"@live-change/framework": "^0.6.6",
"pluralize": "8.0.0"
},
"gitHead": "6ffba5113875638abf4203b56bdab5ed6a2e5e55"
"gitHead": "d6f4e8a34d88ecf90a3bf97bb367d4c8027ce7af"
}
const {
defineProperties, defineIndex,
processModelsAnnotation, generateId
processModelsAnnotation, generateId, addAccessControlParents
} = require('./utils.js')

@@ -19,2 +19,3 @@

context.identifiers = defineProperties(context.model, context.others, context.otherPropertyNames)
addAccessControlParents(context)
defineIndex(context.model, context.joinedOthersClassName, context.otherPropertyNames)

@@ -52,2 +53,2 @@

})
}
}
const {
defineAnyProperties, defineAnyIndexes,
processModelsAnyAnnotation, generateAnyId
processModelsAnyAnnotation, generateAnyId, addAccessControlAnyParents
} = require('./utilsAny.js')

@@ -22,2 +22,3 @@

context.identifiers = defineAnyProperties(context.model, context.otherPropertyNames)
addAccessControlAnyParents(context)
defineAnyIndexes(context.model, context.otherPropertyNames)

@@ -57,2 +58,2 @@

})
}
}

@@ -118,5 +118,23 @@ const App = require("@live-change/framework")

function addAccessControlParents(context) {
const { modelRuntime } = context
context.model.accessControlParents = async (id) => {
const data = await modelRuntime().get(id)
return context.otherPropertyNames.map(otherPropertyName => {
const objectType = (otherPropertyName.slice(0, 1).toUpperCase() + otherPropertyName.slice(1))
const object = data[otherPropertyName]
return { objectType, object }
}).filter(parent => parent.object && parent.objectType)
}
context.model.accessControlParentsSource = context.otherPropertyNames.map(
otherPropertyName => ({
property: otherPropertyName,
type: (otherPropertyName.slice(0, 1).toUpperCase() + otherPropertyName.slice(1))
})
)
}
module.exports = {
extractIdParts, extractIdentifiers, extractObjectData, defineProperties, defineIndex,
processModelsAnnotation, generateId
}
processModelsAnnotation, generateId, addAccessControlParents
}

@@ -120,6 +120,24 @@ const App = require("@live-change/framework")

function addAccessControlAnyParents(context) {
const { modelRuntime } = context
context.model.accessControlParents = async (id) => {
const data = await modelRuntime().get(id)
return context.otherPropertyNames.map(otherPropertyName => {
const objectType = data[otherPropertyName + 'Type']
const object = data[otherPropertyName]
return { objectType, object }
}).filter(parent => parent.object && parent.objectType)
}
context.model.accessControlParentsSource = context.otherPropertyNames.map(
otherPropertyName => ({
property: otherPropertyName
})
)
}
module.exports = {
extractTypeAndIdParts, extractIdentifiersWithTypes, defineAnyProperties,
defineAnyIndex, defineAnyIndexes,
processModelsAnyAnnotation, generateAnyId
}
processModelsAnyAnnotation, generateAnyId,
addAccessControlAnyParents
}
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