From 496a6fa07346a6fe2ca0bd908aa8b0f3a7021e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mili=C4=87?= Date: Tue, 26 Nov 2024 13:30:31 +0100 Subject: [PATCH 1/4] feature/Enable API Explorer II for OBP API split portal/API mode --- package.json | 2 +- server/middlewares/OauthRequestTokenMiddleware.ts | 4 ++-- src/components/HeaderNav.vue | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 49c3f02..764851f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "api-explorer", - "version": "1.0.24", + "version": "1.0.25", "private": true, "scripts": { "dev": "vite & ts-node server/app.ts", diff --git a/server/middlewares/OauthRequestTokenMiddleware.ts b/server/middlewares/OauthRequestTokenMiddleware.ts index 39d40cf..19011fe 100644 --- a/server/middlewares/OauthRequestTokenMiddleware.ts +++ b/server/middlewares/OauthRequestTokenMiddleware.ts @@ -35,8 +35,8 @@ export default class OauthRequestTokenMiddleware implements ExpressMiddlewareInt constructor(private oauthInjectedService: OauthInjectedService) {} use(request: Request, response: Response): any { - const apiHost = process.env.VITE_OBP_API_PORTAL_HOST || process.env.VITE_OBP_API_HOST; - console.debug('OauthRequestTokenMiddleware - API Host:', apiHost); + const apiHost = process.env.VITE_OBP_API_PORTAL_HOST ? process.env.VITE_OBP_API_PORTAL_HOST : process.env.VITE_OBP_API_HOST + console.debug('process.env.VITE_OBP_API_PORTAL_HOST:', process.env.VITE_OBP_API_PORTAL_HOST) const oauthService = this.oauthInjectedService const consumer = oauthService.getConsumer() consumer.getOAuthRequestToken((error: any, oauthTokenKey: string, oauthTokenSecret: string) => { diff --git a/src/components/HeaderNav.vue b/src/components/HeaderNav.vue index 9ff9ec0..e89683b 100644 --- a/src/components/HeaderNav.vue +++ b/src/components/HeaderNav.vue @@ -43,7 +43,7 @@ const route = useRoute() const router = useRouter() const obpApiHost = ref(import.meta.env.VITE_OBP_API_HOST) const obpApiPortalHost = ref(import.meta.env.VITE_OBP_API_PORTAL_HOST) -const obpApiHybridPost = computed(() => obpApiPortalHost.value || obpApiHost.value) +const obpApiHybridPost = computed(() => obpApiPortalHost.value ? obpApiPortalHost.value : obpApiHost.value) const obpApiManagerHost = ref(import.meta.env.VITE_OBP_API_MANAGER_HOST) const loginUsername = ref('') const logoffurl = ref('') From 2a606b3ff3cac0763342e143e8e2d41d395c6233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mili=C4=87?= Date: Tue, 26 Nov 2024 15:40:21 +0100 Subject: [PATCH 2/4] bugfix/Add VITE_OBP_API_PORTAL_HOST to frontend_build.env --- Dockerfiles/frontend_build.env | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfiles/frontend_build.env b/Dockerfiles/frontend_build.env index bcd5a95..e54a1f1 100644 --- a/Dockerfiles/frontend_build.env +++ b/Dockerfiles/frontend_build.env @@ -1,4 +1,5 @@ VITE_OBP_API_HOST=VITE_OBP_API_HOST +VITE_OBP_API_PORTAL_HOST=VITE_OBP_API_PORTAL_HOST VITE_OBP_API_MANAGER_HOST=VITE_OBP_API_MANAGER_HOST VITE_OBP_API_VERSION=v5.1.0 From ec282f3d3b8bb0fea88f104efdc94e7eff49db76 Mon Sep 17 00:00:00 2001 From: tesobe-daniel Date: Tue, 26 Nov 2024 19:24:32 +0100 Subject: [PATCH 3/4] Add OBP Portal env var to frontend build process --- Dockerfiles/prestart.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfiles/prestart.go b/Dockerfiles/prestart.go index c9c6e85..e3b0be3 100644 --- a/Dockerfiles/prestart.go +++ b/Dockerfiles/prestart.go @@ -10,7 +10,7 @@ import ( ) func main() { - config := []string{"VITE_OBP_API_HOST", "VITE_OBP_API_MANAGER_HOST"} + config := []string{"VITE_OBP_API_HOST", "VITE_OBP_API_MANAGER_HOST", "VITE_OBP_API_PORTAL_HOST"} configMap := make(map[string]string) for _, key := range config { From 951a654d3a8c9c887c8cdcd7b106af4f1f4868b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mili=C4=87?= Date: Wed, 27 Nov 2024 12:17:03 +0100 Subject: [PATCH 4/4] refactor/Update API Explorer II dependancies --- package.json | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 764851f..ff7ab3d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "api-explorer", - "version": "1.0.25", + "version": "1.0.26", "private": true, "scripts": { "dev": "vite & ts-node server/app.ts", @@ -17,14 +17,14 @@ "@element-plus/icons-vue": "^2.1.0", "@fontsource/roboto": "^5.0.0", "@highlightjs/vue-plugin": "^2.1.0", - "axios": "^1.7.2", + "axios": "^1.7.4", "cheerio": "^1.0.0", "class-transformer": "^0.5.1", "class-validator": "^0.14.0", "connect-redis": "^7.1.1", "dotenv": "^16.3.1", "element-plus": "^2.3.9", - "express": "^4.18.2", + "express": "^4.21.0", "express-session": "^1.17.3", "highlight.js": "^11.8.0", "jsonwebtoken": "^9.0.2", @@ -40,40 +40,39 @@ "socket.io-client": "^4.7.5", "typedi": "^0.10.0", "uuid": "^9.0.1", - "vue": "^3.2.47", + "vue": "^3.5.1", "vue-i18n": "^9.4.0", - "vue-markdown-renderer": "^0.2.7", "vue-router": "^4.2.2", "vue-socket.io": "^3.0.10", "ws": "^8.18.0" }, "devDependencies": { "@rushstack/eslint-patch": "^1.4.0", - "@types/jsdom": "^21.1.0", + "@types/jsdom": "^21.1.7", "@types/jsonwebtoken": "^9.0.6", "@types/markdown-it": "^14.1.1", "@types/node": "^20.5.7", "@vitejs/plugin-vue": "^4.3.0", "@vitejs/plugin-vue-jsx": "^3.1.0", "@vue/eslint-config-prettier": "^9.0.0", - "@vue/eslint-config-typescript": "^12.0.0", + "@vue/eslint-config-typescript": "^14.0.0", "@vue/test-utils": "^2.4.0", "@vue/tsconfig": "^0.1.3", - "eslint": "^8.51.0", + "eslint": "^9.15.0", "eslint-plugin-vue": "^9.12.0", - "jsdom": "^22.1.0", - "npm-run-all": "^4.1.5", + "jsdom": "^25.0.1", + "npm-run-all2": "^7.0.1", "prettier": "^3.0.1", - "superagent": "^8.1.2", + "superagent": "^9.0.0", "ts-node": "^10.9.1", "typescript": "~5.2.2", "unplugin-auto-import": "^0.18.0", "unplugin-element-plus": "^0.8.0", - "unplugin-vue-components": "^0.26.0", + "unplugin-vue-components": "^0.27.0", "vite": "^4.4.0", "vite-plugin-node-polyfills": "^0.10.0", "vite-plugin-rewrite-all": "^1.0.2", "vitest": "^0.34.0", - "vue-tsc": "^1.6.5" + "vue-tsc": "^2.0.0" } }