Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
dredd-transactions
Advanced tools
Compiles HTTP Transactions (Request-Response pairs) from an API description document
Dredd Transactions library compiles HTTP Transactions (simple Request-Response pairs) from API description document.
Note: To better understand emphasized terms in this documentation, please refer to the Glossary of Terms. All data structures are described using the MSON format.
This project supersedes Blueprint Transactions library.
Note: These features are to be superseded by whatever comes out of the proposal in apiaryio/dredd#227.
npm install dredd-transactions
Dredd Transactions library is written in JavaScript (ES2015+).
parse
Parses given API description document into API Elements with options specific to Dredd. Assumes that documents with unrecognizable format are API Blueprint. Turns any parser failures, including the unexpected ones, into API Elements annotations.
const parse = require('dredd-transactions/parse');
// const { parse } = require('dredd-transactions');
parse('# My API\n...', (error, parseResult) => {
// ...
});
compile
Compiles HTTP Transactions from given API Elements. HTTP Transactions are a backbone data structure to Dredd.
const compile = require('dredd-transactions/compile');
// const { compile } = require('dredd-transactions');
const compileResult = compile(mediaType, apiElements, filename);
Note: The
filename
argument is optional and about to get deprecated, see #6
Result of parsing.
mediaType
: text/vnd.apiblueprint
(string, default, nullable) - Media type of the input format, can be empty in case of some fatal errorsapiElements
(API Elements) - API Elements parse resultResult of compilation. Alongside compiled Transaction objects contains also errors and warnings, mainly from API description parser.
mediaType
: text/vnd.apiblueprint
(string, default, nullable) - Media type of the input format, defaults to API Blueprint format. Can be empty in case of some fatal errors.transactions
(array[Transaction]) - Compiled HTTP Transactions.annotations
(array[Annotation]) - Errors and warnings which occurred during parsing of the API description or during compilation of transactions.Represents a single HTTP Transaction (Request-Response pair) and its location in the API description document. The location is provided in two forms, both deprecated as of now:
name
- String representation, both human- and machine-readable.origin
- Object of references to nodes of API Elements derived from the original API description document.Note: These two forms of locating HTTP Transactions are to be superseded by whatever comes out of the proposal in apiaryio/dredd#227.
/message
(string) - Informative URI of the Request.Content-Type
(string)text/plain
(string)Hello world!\n
(string)200
(string)Content-Type
(string)text/plain
(string)Hello world! > Retrieve Message
(string) - Transaction Name, non-deterministic breadcrumb location of the HTTP Transaction within the API description document../api-description.apib
(string)My Api
(string)Greetings
(string)Hello, world!
(string)Retrieve Message
(string)First example
(string)Note: These properties are to be superseded by whatever comes out of the proposal in apiaryio/dredd#227.
Description of an error or warning which occurred during parsing of the API description or during compilation of transactions.
error
warning
apiDescriptionParser
parametersValidation
uriTemplateExpansion
null
otherwise
Hello world! > Retrieve Message
(string) - Transaction Name, non-deterministic breadcrumb location of the relevant HTTP Transaction within the API description document../api-description.apib
(string)My Api
(string)Greetings
(string)Hello, world!
(string)Retrieve Message
(string)First example
(string)Note: These properties are to be superseded by whatever comes out of the proposal in apiaryio/dredd#227.
FAQs
Compiles HTTP Transactions (Request-Response pairs) from an API description document
The npm package dredd-transactions receives a total of 7,169 weekly downloads. As such, dredd-transactions popularity was classified as popular.
We found that dredd-transactions 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.