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

@startupjs/server-aggregate

Package Overview
Dependencies
Maintainers
6
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@startupjs/server-aggregate - npm Package Compare versions

Comparing version 0.56.0-alpha.0 to 0.56.0-alpha.53

4

package.json
{
"name": "@startupjs/server-aggregate",
"version": "0.56.0-alpha.0",
"version": "0.56.0-alpha.53",
"description": "Module for describing aggregations on the server",

@@ -13,3 +13,3 @@ "publishConfig": {

},
"gitHead": "076772b216a09281ed38b32866b576024562f099"
"gitHead": "b262ddbd0ca367a0bd1669d3d39c2adae3739aba"
}

@@ -12,3 +12,3 @@ import ShareDBAccessError from './error.js'

export default (backend, customCheck) => {
export default (backend, { customCheck } = {}) => {
backend.addAggregate = (collection, queryName, queryFunction) => {

@@ -24,3 +24,9 @@ QUERIES[collection + '.' + queryName] = queryFunction

if (query.$aggregate) throw new ShareDBAccessError(ERR_ACCESS_ONLY_SERVER_AGGREATE, `access denied - only server-queries for $aggregate are allowed, collection: '${collection}', query: '${query}'`)
if (query.$aggregate) {
throw new ShareDBAccessError(ERR_ACCESS_ONLY_SERVER_AGGREATE, `
access denied - only server-queries for $aggregate are allowed
collection: '${collection}',
query: \n${JSON.stringify(query, null, 2)}
`)
}
if (!queryName && !queryParams) return

@@ -50,2 +56,14 @@

if (Array.isArray(serverQuery)) serverQuery = { $aggregate: serverQuery }
if (typeof serverQuery !== 'object') {
throw new ShareDBAccessError(ERR_ACCESS_IN_SERVER_QUERY, `
access denied for server aggregation
{
collection: '${collection}',
$aggregationName: '${queryName}'
}
`)
}
if (customCheck) {

@@ -58,3 +76,3 @@ const customPermissionMessage = await customCheck(shareRequest)

shareRequest.query = { $aggregate: serverQuery }
shareRequest.query = serverQuery
}

@@ -61,0 +79,0 @@

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