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

@8base/utils

Package Overview
Dependencies
Maintainers
3
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@8base/utils - npm Package Compare versions

Comparing version 0.28.4 to 0.28.5

15

dist/queryGenerators/createQueryString.js

@@ -17,3 +17,3 @@ "use strict";

const { fields = [] } = getTableByName(tablesList, tableName) || {};
const { deep = DEFAULT_DEPTH, withMeta = true, relationItemsCount, includeColumns } = queryObjectConfig;
const { deep = DEFAULT_DEPTH, withMeta = true, relationItemsCount, includeColumns, permissions = {}, } = queryObjectConfig;
let queryObject = '';

@@ -23,3 +23,14 @@ fields

const isMeta = tableFieldSelectors.isMetaField(field);
return withMeta ? true : !isMeta;
const isRelation = tableFieldSelectors.isRelationField(field);
let shouldIncludeField = withMeta ? true : !isMeta;
if (isRelation) {
const refTableName = tableFieldSelectors.getRelationTableName(field);
const refTableAllowed = R.pathOr(true, ['data', refTableName, 'permission', 'read', 'allow'], permissions);
shouldIncludeField = refTableAllowed && shouldIncludeField;
}
else {
const fieldAllowed = R.pathOr(true, ['data', tableName, 'permission', 'read', 'fields', field.name], permissions);
shouldIncludeField = fieldAllowed && shouldIncludeField;
}
return shouldIncludeField;
})

@@ -26,0 +37,0 @@ .forEach(field => {

@@ -79,2 +79,3 @@ import { FIELD_TYPE, SWITCH_FORMATS, TEXT_FORMATS, NUMBER_FORMATS, FILE_FORMATS, DATE_FORMATS, MUTATION_TYPE, SMART_FORMATS } from './constants';

includeColumns?: null | string[];
permissions?: Object;
};

@@ -81,0 +82,0 @@ export declare type FormatDataAfterQueryOptions = {

2

package.json
{
"name": "@8base/utils",
"version": "0.28.4",
"version": "0.28.5",
"repository": "https://github.com/8base/sdk",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/8base/sdk/tree/master/packages/utils#readme",

@@ -25,3 +25,9 @@ import * as R from 'ramda';

const { fields = [] } = getTableByName(tablesList, tableName) || {};
const { deep = DEFAULT_DEPTH, withMeta = true, relationItemsCount, includeColumns } = queryObjectConfig;
const {
deep = DEFAULT_DEPTH,
withMeta = true,
relationItemsCount,
includeColumns,
permissions = {},
} = queryObjectConfig;

@@ -33,4 +39,22 @@ let queryObject = '';

const isMeta = tableFieldSelectors.isMetaField(field);
const isRelation = tableFieldSelectors.isRelationField(field);
return withMeta ? true : !isMeta;
let shouldIncludeField = withMeta ? true : !isMeta;
if (isRelation) {
const refTableName = tableFieldSelectors.getRelationTableName(field);
const refTableAllowed = R.pathOr(true, ['data', refTableName, 'permission', 'read', 'allow'], permissions);
shouldIncludeField = refTableAllowed && shouldIncludeField;
} else {
const fieldAllowed = R.pathOr(
true,
['data', tableName, 'permission', 'read', 'fields', field.name],
permissions,
);
shouldIncludeField = fieldAllowed && shouldIncludeField;
}
return shouldIncludeField;
})

@@ -37,0 +61,0 @@ .forEach(field => {

@@ -102,2 +102,3 @@ import {

includeColumns?: null | string[];
permissions?: Object;
};

@@ -104,0 +105,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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