
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
@datx/jsonapi
Advanced tools
DatX is an opinionated data store. It features support for references to other models and first-class TypeScript support.
@datx/jsonapi
is a datx mixin that adds JSON API support.
import { Collection, Model, Attribute } from '@datx/core';
import { jsonapiCollection, jsonapiModel } from '@datx/jsonapi';
class Person extends jsonapiModel(Model) {
public static type = 'person'; // Unique name of the model class
@Attribute()
public name: string; // A normal attribute without a default value
@Attribute()
public surname: string;
@Attribute({ toOne: Person })
public spouse?: Person; // A reference to a Person model
public get fullName() {
return `${this.name} ${this.surname}`;
}
}
class AppData extends jsonapiCollection(Collection) {
public static types = [Person]; // A list of models available in the collection
}
const store = new AppData();
const john = store.add(new Person({ name: 'John', surname: 'Smith' })); // Add a model instance to the store
const jane = store.add({ name: 'Jane', surname: 'Smith', spouse: john }, Person); // Add a model to the store
await john.save(); // POST to the server
const people = await store.fetchAll(Person); // Get all people from the server
npm install --save @datx/jsonapi
The lib makes use of the following features that are not yet available everywhere. Based on your browser support, you might want to polyfill them:
How to add the polyfills. Note: Fetch API is not included in the polyfills mentioned in the Troubleshooting page. Instead, you need to add it as a separate library. If you don't have any special requirements (like server-side rendering), you can use the window.fetch polyfill.
Having issues with the library? Check out the troubleshooting page or open an issue.
The MIT License
datx-jsonapi is maintained and sponsored by Infinum.
FAQs
DatX mixin for JSON API support
The npm package @datx/jsonapi receives a total of 467 weekly downloads. As such, @datx/jsonapi popularity was classified as not popular.
We found that @datx/jsonapi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.