Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stoplight/prism-core

Package Overview
Dependencies
Maintainers
18
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stoplight/prism-core - npm Package Compare versions

Comparing version 3.0.4 to 3.1.0

dist/utils/security/handlers/apiKey.d.ts

17

dist/factory.js

@@ -5,5 +5,7 @@ "use strict";

const Either = require("fp-ts/lib/Either");
const Option_1 = require("fp-ts/lib/Option");
const pipeable_1 = require("fp-ts/lib/pipeable");
const TaskEither = require("fp-ts/lib/TaskEither");
const _1 = require(".");
const security_1 = require("./utils/security");
function factory(defaultConfig, defaultComponents) {

@@ -38,6 +40,12 @@ const prism = (customConfig, customComponents) => {

}
const inputValidationResult = inputValidations.concat(pipeable_1.pipe(security_1.validateSecurity(input, resource), Option_1.fold(() => [], value => [value])));
if (resource && components.mocker && configObj.mock) {
return pipeable_1.pipe(TaskEither.fromEither(components.mocker.mock({
resource,
input: { validations: { input: inputValidations }, data: input },
input: {
validations: {
input: inputValidationResult,
},
data: input,
},
config: configObj,

@@ -49,3 +57,8 @@ }, defaultComponents.mocker)(components.logger.child({ name: 'NEGOTIATOR' }))), TaskEither.map(output => ({ output, resource })));

resource,
input: { validations: { input: inputValidations }, data: input },
input: {
validations: {
input: inputValidationResult,
},
data: input,
},
config: configObj,

@@ -52,0 +65,0 @@ }, defaultComponents.forwarder), TaskEither.map(output => ({ output, resource })));

3

dist/types.d.ts

@@ -15,3 +15,4 @@ import { IDiagnostic } from '@stoplight/types';

security?: boolean | object;
validate?: boolean | object;
validateRequest: boolean;
validateResponse: boolean;
}

@@ -18,0 +19,0 @@ export declare type PrismConfigFactory<C, I> = (input: I, defaultConfig?: PrismConfig<C, I>) => C;

{
"name": "@stoplight/prism-core",
"version": "3.0.4",
"version": "3.1.0",
"main": "dist/index.js",

@@ -26,3 +26,3 @@ "types": "dist/index.d.ts",

},
"gitHead": "28464e102670f28e836e47a4dd0709b2214f158e"
"gitHead": "9628bb61932edca228c007ec1be477fcd3123ab7"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc