Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@cord-sdk/api-types
Advanced tools
TypeScript type definitions and JSON schema objects for the data types used by the Cord REST API
This package contains TypeScript type definitions and JSON schema objects for the data types used by the Cord REST API.
npm install @cord-sdk/api-types
To use proper type definitions for the data structures send to and received from the Cord REST API, import them from this package, e.g.:
import { PlatformUserVariables } from '@cord-sdk/api-types';
You can use the JSON schema shipped in this package to validate data structures send to or received from the Cord REST API at run-time.
For example, to do run-time validation using the AJV package in TypeScript:
import Ajv from "ajv";
import { schema } from '@cord-sdk/api-types';
import type { PlatformUserVariables } from '@cord-sdk/api-types';
const ajv = new Ajv();
const validatePlatformUserVariables = ajv.compile<PlatformUserVariables>(schema['PlatformUserVariables']);
The validatePlatformUserVariables
function takes data as an argument and returns a boolean indicating whether the given data conforms to the schema for PlatformUserVariables
. The function is declared as a type guard, so if you use it as the conditional in an if statement, TypeScript understands that within the true-branch, the data is of type PlatformUserVariables
.
FAQs
TypeScript type definitions and JSON schema objects for the data types used by the Cord REST API
The npm package @cord-sdk/api-types receives a total of 349 weekly downloads. As such, @cord-sdk/api-types popularity was classified as not popular.
We found that @cord-sdk/api-types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 12 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.