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

oas-normalize

Package Overview
Dependencies
Maintainers
9
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oas-normalize - npm Package Compare versions

Comparing version 8.4.0 to 8.4.1

29

dist/index.js

@@ -75,3 +75,3 @@ "use strict";

};
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAPIDefinitionType = exports.isAPIDefinition = void 0;

@@ -94,3 +94,3 @@ var fs_1 = __importDefault(require("fs"));

bundle: false,
deref: false
deref: false,
};

@@ -127,3 +127,3 @@ }

case 2: return [2 /*return*/, resolve(this.file.toString())];
case 3: return [4 /*yield*/, (0, node_fetch_1["default"])(utils.normalizeURL(this.file)).then(function (res) { return res.text(); })];
case 3: return [4 /*yield*/, (0, node_fetch_1.default)(utils.normalizeURL(this.file)).then(function (res) { return res.text(); })];
case 4:

@@ -137,3 +137,3 @@ resp = _b.sent();

}
contents = fs_1["default"].readFileSync(this.file).toString();
contents = fs_1.default.readFileSync(this.file).toString();
if (!contents.trim()) {

@@ -152,3 +152,3 @@ return [2 /*return*/, Promise.reject(new Error('No file contents found.'))];

OASNormalize.convertPostmanToOpenAPI = function (schema) {
return (0, postman_to_openapi_1["default"])(JSON.stringify(schema), null, { outputFormat: 'json', replaceVars: true }).then(JSON.parse);
return (0, postman_to_openapi_1.default)(JSON.stringify(schema), null, { outputFormat: 'json', replaceVars: true }).then(JSON.parse);
};

@@ -175,3 +175,3 @@ /**

})
.then(function (schema) { return openapi_parser_1["default"].bundle(schema); })
.then(function (schema) { return openapi_parser_1.default.bundle(schema); })
.then(function (bundle) {

@@ -204,3 +204,3 @@ _this.cache.bundle = bundle;

})
.then(function (schema) { return openapi_parser_1["default"].dereference(schema); })
.then(function (schema) { return openapi_parser_1.default.dereference(schema); })
.then(function (dereferenced) {

@@ -251,3 +251,3 @@ _this.cache.deref = dereferenced;

clonedSchema = JSON.parse(JSON.stringify(schema));
return [2 /*return*/, openapi_parser_1["default"]
return [2 /*return*/, openapi_parser_1.default
.validate(clonedSchema, parserOptions)

@@ -258,6 +258,7 @@ .then(function () {

}
return swagger2openapi_1["default"]
return swagger2openapi_1.default
.convertObj(schema, { anchors: true })
.then(function (options) { return options.openapi; });
})["catch"](function (err) { return Promise.reject(err); })];
})
.catch(function (err) { return Promise.reject(err); })];
});

@@ -279,3 +280,3 @@ }); })];

specification: 'openapi',
version: schema.openapi
version: schema.openapi,
};

@@ -295,3 +296,3 @@ case 'postman':

specification: 'postman',
version: version
version: version,
};

@@ -301,3 +302,3 @@ case 'swagger':

specification: 'swagger',
version: schema.swagger
version: schema.swagger,
};

@@ -311,2 +312,2 @@ default:

}());
exports["default"] = OASNormalize;
exports.default = OASNormalize;

@@ -25,3 +25,3 @@ "use strict";

};
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAPIDefinitionType = exports.isAPIDefinition = exports.stringToJSON = exports.isSwagger = exports.isPostman = exports.isOpenAPI = exports.getType = exports.normalizeURL = exports.isBuffer = void 0;

@@ -119,3 +119,3 @@ var js_yaml_1 = __importStar(require("js-yaml"));

}
return js_yaml_1["default"].load(string, { schema: js_yaml_1.JSON_SCHEMA });
return js_yaml_1.default.load(string, { schema: js_yaml_1.JSON_SCHEMA });
}

@@ -122,0 +122,0 @@ exports.stringToJSON = stringToJSON;

{
"name": "oas-normalize",
"version": "8.4.0",
"version": "8.4.1",
"description": "Tooling for converting, valiating, and parsing OpenAPI, Swagger, and Postman API definitions",

@@ -46,3 +46,3 @@ "main": "dist/index.js",

"@readme/openapi-parser": "^2.5.0",
"@readme/postman-to-openapi": "^4.0.0",
"@readme/postman-to-openapi": "^4.1.0",
"js-yaml": "^4.1.0",

@@ -54,15 +54,15 @@ "node-fetch": "^2.6.1",

"devDependencies": {
"@readme/eslint-config": "^10.5.1",
"@readme/eslint-config": "^10.5.2",
"@readme/oas-examples": "^5.10.0",
"@types/jest": "^29.5.0",
"@types/jest": "^29.5.1",
"@types/js-yaml": "^4.0.5",
"@types/node-fetch": "^2.6.2",
"eslint": "^8.36.0",
"@types/node-fetch": "^2.6.3",
"eslint": "^8.39.0",
"jest": "^29.5.0",
"nock": "^13.3.0",
"prettier": "^2.8.7",
"ts-jest": "^29.0.5",
"typescript": "^4.9.5"
"nock": "^13.3.1",
"prettier": "^2.8.8",
"ts-jest": "^29.1.0",
"typescript": "^5.0.4"
},
"prettier": "@readme/eslint-config/prettier"
}
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