
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
drupal_jsonapi_entities
Advanced tools
Build a Drupal Entity form/view field schema from your Drupal JSON:API entitiy with ease.
$ npm install drupal_jsonapi_entities
import drupalJSONAPIEntities from 'drupal_jsonapi_entities'
const drupalEntities = new drupalJSONAPIEntities(url, options)
The constructor takes two arguments:
url
: The base URL of the Drupal instance.options
: The API options.options
argument)const formSchema = await drupalEntities.getFormSchema(entityType, bundle, mode)
The method takes three arguments:
entityType
: The Drupal entity type ID.bundle
: The Drupal bundle ID for the entity type.mode
: The form display mode. Default: default
.Returns a JSON object:
JSON:API resources:
entity_form_display--entity_form_display
field_config--field_config
field_storage_config--field_storage_config
Permissions:
administer display modes
administer ENTITY_TYPE fields
const viewSchema = await drupalEntities.getViewSchema(entityType, bundle, mode)
The method takes three arguments:
entityType
: The Drupal entity type ID.bundle
: The Drupal bundle ID for the entity type.mode
: The view display mode. Default: default
.Returns a JSON object:
JSON:API resources:
entity_form_display--entity_form_display
entity_view_display--entity_view_display
field_config--field_config
field_storage_config--field_storage_config
Permissions:
administer display modes
administer ENTITY_TYPE fields
Drupal JSON:API Entities provides a Nuxt.js module for easily caching the schema(s).
Add drupal_jsonapi_entities/nuxt
to the modules section of your
nuxt.config.js
file.
module.exports = {
modules: [
// Drupal JSON:API entities.
[
'drupal_jsonapi_entities/nuxt',
{
baseUrl: process.env.API_URL,
auth: {
clientId: process.env.API_CONSUMER_CLIENT_ID,
clientSecret: process.env.API_CONSUMER_CLIENT_SECRET,
user: process.env.API_CONSUMER_USERNAME,
pass: process.env.API_CONSUMER_PASSWORD
}
}
],
]
}
Add a drupalJSONAPIEntities
section to your nuxt.config.js
file in the
following format for all required Entity types, Bundles, Schema types and
Modes:
module.exports = {
drupalJSONAPIEntities: {
'entityType': { 'bundle': { 'type': [ 'mode' ] } }
}
}
Example:
module.exports = {
drupalJSONAPIEntities: {
'node': {
'recipe': {
form: [ 'default' ],
view: [ 'default' ],
}
}
}
}
The module provides a plugin, which returns the Drupal JSON:API Entities schema(s).
this.$drupalJSONAPIEntities()
FAQs
Drupal JSON:API Entities
The npm package drupal_jsonapi_entities receives a total of 8 weekly downloads. As such, drupal_jsonapi_entities popularity was classified as not popular.
We found that drupal_jsonapi_entities demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.