Commit e008f314 authored by Daniel Perez's avatar Daniel Perez
Browse files

Adding second version of swagger

parent 657a3558
Pipeline #33739 passed with stages
in 5 minutes and 50 seconds
......@@ -2986,6 +2986,58 @@
"integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==",
"dev": true
},
"copyfiles": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz",
"integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==",
"requires": {
"glob": "^7.0.5",
"minimatch": "^3.0.3",
"mkdirp": "^1.0.4",
"noms": "0.0.0",
"through2": "^2.0.1",
"untildify": "^4.0.0",
"yargs": "^16.1.0"
},
"dependencies": {
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
},
"through2": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
"integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==",
"requires": {
"readable-stream": "~2.3.6",
"xtend": "~4.0.1"
}
}
}
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
......@@ -6514,6 +6566,38 @@
"process-on-spawn": "^1.0.0"
}
},
"noms": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz",
"integrity": "sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=",
"requires": {
"inherits": "^2.0.1",
"readable-stream": "~1.0.31"
},
"dependencies": {
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
},
"readable-stream": {
"version": "1.0.34",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
"integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "0.0.1",
"string_decoder": "~0.10.x"
}
},
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
}
}
},
"nopt": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
......@@ -9114,6 +9198,11 @@
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
},
"untildify": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz",
"integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw=="
},
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
......@@ -9562,8 +9651,7 @@
"xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
"dev": true
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
},
"y18n": {
"version": "4.0.1",
......
......@@ -15,7 +15,9 @@
"test": "env UTEST=true mocha -r ts-node/register tests/utest/test.ts",
"test-coverage": "env UTEST=true nyc mocha -r ts-node/register --reporter mocha-junit-reporter tests/utest/test.ts",
"test-automation": "npm run clean && npm install && npm run build && npm run test-coverage",
"test-e2e-parallel": "node ./tests/e2e/parallel/run_e2e_tests_parallel.js"
"test-e2e-parallel": "node ./tests/e2e/parallel/run_e2e_tests_parallel.js",
"copyStaticFiles": "copyfiles --error --up 1 ./src/swagger/swagger.yaml ./dist/",
"postbuild": "npm run copyStaticFiles"
},
"nyc": {
"include": [
......@@ -59,6 +61,7 @@
"aws-sdk": "^2.739.0",
"body-parser": "1.19.0",
"bull": "^3.20.0",
"copyfiles": "^2.4.1",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "4.17.1",
......
......@@ -26,7 +26,7 @@ import fs from 'fs';
import https from 'https';
import swaggerUi from 'swagger-ui-express';
import * as swaggerDocument from '../swagger/swagger.json';
import YAML from 'yamljs';
// -------------------------------------------------------------------
// Seismic Store Service
......@@ -70,6 +70,8 @@ export class Server {
}
constructor() {
const swaggerDocument = YAML.load('./dist/swagger/swagger.yaml');
this.app = express();
this.app.use(bodyparser.urlencoded({ extended: false }));
this.app.use(bodyparser.json());
......
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Api Documentation",
"description": "Api Documentation",
"license": {
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"securityDefinitions": {
"authentication": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
},
"paths": {
"/seistore-svc/api/v3/svcstatus": {
"get": {
"tags": [
"General"
],
"description": "Verify access",
"parameters": [
{
"name": "x-api-key",
"in": "header",
"required": false
},
{
"name": "appkey",
"in": "header",
"required": false
}
],
"produces": [
"text/plain"
],
"responses": {
"200": {
"description": "Service running"
},
"404": {
"description": "Service not running"
}
}
}
},
"/seistore-svc/api/v3/svcstatus/access": {
"get": {
"tags": [
"General"
],
"description": "Verify authorization",
"security":[
{
"authentication": []
}
],
"parameters": [
{
"name": "x-api-key",
"in": "header",
"required": false
},
{
"name": "appkey",
"in": "header",
"required": false
}
],
"produces": [
"text/plain"
],
"responses": {
"200": {
"description": "Authorization working fine"
},
"401": {
"description": "Unauthorized"
}
}
}
},
"/seistore-svc/api/v3/tenant/{tenant}": {
"get": {
"tags": [
"Tenant"
],
"description": "Get tenant",
"security":[
{
"authentication": []
}
],
"parameters": [
{
"name": "tenant",
"in": "path",
"required": true
},
{
"name": "x-api-key",
"in": "header",
"required": false
},
{
"name": "appkey",
"in": "header",
"required": false
}
],
"produces": [
"text/plain"
],
"responses": {
"200": {
"description": "Tenat returned"
},
"401": {
"description": "Unauthorized"
}
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment