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

@digitalroute/bagger

Package Overview
Dependencies
Maintainers
3
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digitalroute/bagger - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

dist/types/utils/validate-schema.d.ts

8

dist/compile.js

@@ -15,2 +15,3 @@ "use strict";

var clean_object_1 = require("./utils/clean_object");
var validate_schema_1 = require("./utils/validate-schema");
function compileRequests(requests) {

@@ -34,5 +35,10 @@ var compiledRequests = requests.map(function (request) { return request.compile(); });

var paths = compileRequests(requests);
return clean_object_1.cleanObject(__assign({}, configuration, { openapi: '3.0', paths: paths,
var swaggerDefinition = clean_object_1.cleanObject(__assign({}, configuration, { openapi: '3.0.0', paths: paths,
components: components }));
var errors = validate_schema_1.validateSchema(swaggerDefinition);
if (errors.length > 0) {
throw new Error(JSON.stringify(errors));
}
return swaggerDefinition;
}
exports.compile = compile;

20

dist/request.js
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -32,3 +43,3 @@ var BaggerRequest = /** @class */ (function () {

};
BaggerRequest.prototype.security = function (scheme, scopes) {
BaggerRequest.prototype.addSecurity = function (scheme, scopes) {
if (scopes === void 0) { scopes = []; }

@@ -47,7 +58,8 @@ if (!this.operationContext.security) {

};
BaggerRequest.prototype.response = function (response) {
BaggerRequest.prototype.addResponse = function (response) {
if (!this.operationContext.responses) {
this.operationContext.responses = [];
this.operationContext.responses = {};
}
this.operationContext.responses.push(response.compile());
var responseDefinition = response.compile();
this.operationContext.responses = __assign({}, responseDefinition, this.operationContext.responses);
return this;

@@ -54,0 +66,0 @@ };

@@ -15,6 +15,6 @@ import { BaggerResponse } from './response';

addTag(tag: string): BaggerRequest;
security(scheme: string, scopes?: string[]): BaggerRequest;
addSecurity(scheme: string, scopes?: string[]): BaggerRequest;
body(requestBody: BaggerRequestBody): BaggerRequest;
response(response: BaggerResponse): BaggerRequest;
addResponse(response: BaggerResponse): BaggerRequest;
compile(): PathsObject;
}
{
"name": "@digitalroute/bagger",
"version": "1.2.0",
"version": "1.3.0",
"description": "🎒 A joi-compatible tool for building swagger definitions",

@@ -50,2 +50,3 @@ "main": "dist/bagger.umd.js",

"@types/hapi__joi": "^15.0.3",
"ajv": "^6.10.2",
"content-type": "^1.0.4",

@@ -52,0 +53,0 @@ "joi": "^14.3.1",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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