From 61718dce0d7d03ef0944c428e423fcdd2252e7f8 Mon Sep 17 00:00:00 2001 From: Thorsten Zoerner Date: Sun, 11 Aug 2024 13:24:29 +0200 Subject: [PATCH] Increment: Added basic OpenAPI documentation --- package-lock.json | 18 ++++++++++++++++-- package.json | 5 +++-- public/index.html | 4 +++- services/api.service.js | 10 ++++++++-- services/openapi.service.js | 29 +++++++++++++++++++++++++++++ 5 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 services/openapi.service.js diff --git a/package-lock.json b/package-lock.json index 95ecff4..d8bae56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,18 @@ { "name": "tydids-ssi-consent-router", - "version": "1.0.0", + "version": "1.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tydids-ssi-consent-router", - "version": "1.0.0", + "version": "1.0.3", "dependencies": { "axios": "^1.7.3", "dotenv": "^16.4.5", "ethers": "^4.0.49", "moleculer": "^0.14.26", + "moleculer-auto-openapi": "^1.1.6", "moleculer-web": "^0.10.4", "pouchdb": "^9.0.0" }, @@ -4430,6 +4431,14 @@ } } }, + "node_modules/moleculer-auto-openapi": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/moleculer-auto-openapi/-/moleculer-auto-openapi-1.1.6.tgz", + "integrity": "sha512-/loUqmhqtGjm+abHx0A11ZF2Sjcl/0Yrbk90/0gxaD8aXvIMFiH0gGk2jQ/ODreImd1vYo64DiIp/g45/1cFyg==", + "dependencies": { + "swagger-ui-dist": "^4.1.3" + } + }, "node_modules/moleculer-repl": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/moleculer-repl/-/moleculer-repl-0.7.4.tgz", @@ -5562,6 +5571,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/swagger-ui-dist": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-4.19.1.tgz", + "integrity": "sha512-n/gFn+R7G/BXWwl5UZLw6F1YgWOlf3zkwGlsPhTMhNtAAolBGKg0JS5b2RKt5NI6/hSopVaSrki2wTIMUDDy2w==" + }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", diff --git a/package.json b/package.json index f0dcca3..6539074 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tydids-ssi-consent-router", - "version": "1.0.3", + "version": "1.0.4", "description": "tydids-ssi-consent-router is a lightweight, SSI-based consent management solution. It acts as a proxy between web forms and backend systems, ensuring compliance with GDPR data privacy regulations. The router stores consent data, including SSI IDs and payloads, in a NoSQL database for efficient retrieval and management.", "scripts": { "dev": "moleculer-runner --hot services/**/*.service.js", @@ -12,7 +12,7 @@ "dc:logs": "docker-compose logs -f", "dc:down": "docker-compose down", "createPrivateKey": "./createPrivateKey.js", - "setup":"./setup.js" + "setup": "./setup.js" }, "keywords": [ "microservices", @@ -29,6 +29,7 @@ "dotenv": "^16.4.5", "ethers": "^4.0.49", "moleculer": "^0.14.26", + "moleculer-auto-openapi": "^1.1.6", "moleculer-web": "^0.10.4", "pouchdb": "^9.0.0" }, diff --git a/public/index.html b/public/index.html index e36f73f..fea9930 100644 --- a/public/index.html +++ b/public/index.html @@ -34,7 +34,9 @@

< tydidsConsent Sample Form

- + + OpenAPI/Swagger +