Socket
Socket
Sign inDemoInstall

organizer-core

Package Overview
Dependencies
160
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.2 to 0.3.0

3

dist/Rest/doc/docParser.d.ts

@@ -8,2 +8,3 @@ import SwaggerParser from '@apidevtools/swagger-parser';

summary: string;
service: string;
}

@@ -17,3 +18,3 @@ interface Endpoints {

parse(file: string): Promise<OpenAPI.Document>;
getEndpointsByTags(file: string): Promise<Endpoints>;
getEndpointsByTags(file: string, service: string): Promise<Endpoints>;
private parseDefinition;

@@ -20,0 +21,0 @@ private getEndpoint;

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

}
getEndpointsByTags(file) {
getEndpointsByTags(file, service) {
return __awaiter(this, void 0, void 0, function* () {
try {
const definition = yield this.parse(file);
return this.parseDefinition(definition);
return this.parseDefinition(definition, service);
}

@@ -42,3 +42,3 @@ catch (e) {

}
parseDefinition(definition) {
parseDefinition(definition, service) {
const result = {};

@@ -48,3 +48,3 @@ for (const path in definition.paths) {

for (const pathMethod in pathEntry) {
const endpoint = this.getEndpoint(pathMethod, path, pathEntry[pathMethod]);
const endpoint = this.getEndpoint(pathMethod, path, pathEntry[pathMethod], service);
pathEntry[pathMethod].tags.map((tag) => {

@@ -62,3 +62,3 @@ if (!result.hasOwnProperty(tag)) {

}
getEndpoint(method, path, pathItem) {
getEndpoint(method, path, pathItem, service) {
return {

@@ -69,2 +69,3 @@ operationId: pathItem.operationId,

summary: pathItem.summary,
service,
};

@@ -71,0 +72,0 @@ }

import { NextFunction, Request, Response } from 'express';
declare const getDocHandler: (docPath: string) => (req: Request, res: Response, next: NextFunction) => Promise<void>;
declare const getDocHandler: (docPath: string, service: string) => (req: Request, res: Response, next: NextFunction) => Promise<void>;
export default getDocHandler;

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

const index_1 = require("./index");
const getDocHandler = (docPath) => (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
const getDocHandler = (docPath, service) => (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
try {
const result = yield index_1.DocParser.getEndpointsByTags(docPath);
const result = yield index_1.DocParser.getEndpointsByTags(docPath, service);
res.send(result);

@@ -18,0 +18,0 @@ }

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

if (docPath) {
router.get('/doc', __1.getDocHandler(docPath));
router.get('/doc', __1.getDocHandler(docPath, appName));
}

@@ -12,0 +12,0 @@ router.get('/', (req, res) => {

{
"name": "organizer-core",
"version": "0.2.2",
"version": "0.3.0",
"description": "Core modules for organizer",

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

},
"author": "Andrea Frittella <me.liveset@gmail.com>",
"author": "Andrea Frittella <info@andreafrittella.com>",
"license": "MIT",

@@ -20,18 +20,16 @@ "devDependencies": {

"@types/bcrypt": "^3.0.0",
"@types/jest": "^26.0.4",
"@types/jest": "^26.0.10",
"@types/jsonwebtoken": "^8.5.0",
"@types/node": "^14.0.23",
"@types/node": "^14.6.0",
"@types/source-map-support": "^0.5.2",
"@types/supertest": "^2.0.10",
"@typescript-eslint/eslint-plugin": "^3.6.1",
"@typescript-eslint/parser": "^3.6.1",
"eslint": "^7.4.0",
"@typescript-eslint/eslint-plugin": "^3.9.1",
"@typescript-eslint/parser": "^3.9.1",
"eslint": "^7.7.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"jest": "^26.0.1",
"jest": "^26.4.0",
"prettier": "^2.0.5",
"source-map-support": "^0.5.19",
"supertest": "^4.0.2",
"ts-jest": "^26.1.2",
"typescript": "^3.9.6"
"ts-jest": "^26.2.0",
"typescript": "^3.9.7"
},

@@ -44,4 +42,4 @@ "dependencies": {

"jsonwebtoken": "^8.5.1",
"swagger-parser": "^10.0.0"
"organizer-openapi": "^0.1.1"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc