
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).
@last-rev/cms-fs-loader
Advanced tools
This library exports a single default function which creates a set of data loaders and fetchers for loading contentful structured content from a file system.
This library exports a single default function which creates a set of data loaders and fetchers for loading contentful structured content from a file system.
You must have a directory to which Contentful content has been synced. Please see the documentation for LastRev's cms-sync
CLI which will generate this structure for you.
The directory should follow the following structure
dir
└── {contentful space id}
└── { contentful environment name}
└── { preview|production }
├── assets
| ├── {assetId}.json
| └── ...
├── entries
| ├── {entryId}.json
| └── ...
├── entry_ids_by_content_type
| ├── {entryId}
| └── ...
└── content_types
├── {contentTypeId}.json
└── ...
import createLoaders from '@last-rev/contentful-fs-loader';
async function () {
const {
entryLoader,
assetLoader,
entriesByContentTypeLoader,
fetchAllContentTypes
} = await createLoaders(
'./graphql/content' // root directory
'saasdfgb34r8ffg7rtt', // contentful space ID
'master', // contentful environment
'preview' // one of 'preview' or 'production'
);
}
entryLoader
, assetLoader
, and entriesByContentTypeLoader
are all instances of dataloader. entryLoader
and assetLoader
are both keyed by contentful ID (string
), and entriesByContentTypeLoader
is keyed by a Contentful content type ID (string
).
const myEntry = await entryLoader('my-content-id-1234');
const myAsset = await assetLoader('my-asset-id-5432');
const myEntries = await entriesByContentTypeLoader('pageGeneral');
the other two functions, fetchAllPages
and fetchAllContent
are just convenience functions that return a list of all page content items (entries which have a slug field) and all content types.
FAQs
This library exports a single default function which creates a set of data loaders and fetchers for loading contentful structured content from a file system.
The npm package @last-rev/cms-fs-loader receives a total of 174 weekly downloads. As such, @last-rev/cms-fs-loader popularity was classified as not popular.
We found that @last-rev/cms-fs-loader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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.