From f01301e9935fe1e3adb1b69c0d68e3fd079ca459 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Thu, 31 Oct 2024 11:18:24 -0500 Subject: [PATCH] CE-1887 - Add frontend, middleware, and application name & version properties --- .../javalin/executors/MetaDataExecutor.java | 11 +- .../javalin/executors/io/MetaDataInput.java | 194 ++++++++++++++++++ .../javalin/specs/v1/MetaDataSpecV1.java | 60 ++++++ 3 files changed, 264 insertions(+), 1 deletion(-) diff --git a/qqq-middleware-javalin/src/main/java/com/kingsrook/qqq/middleware/javalin/executors/MetaDataExecutor.java b/qqq-middleware-javalin/src/main/java/com/kingsrook/qqq/middleware/javalin/executors/MetaDataExecutor.java index 8daeb8dd..b16d8496 100644 --- a/qqq-middleware-javalin/src/main/java/com/kingsrook/qqq/middleware/javalin/executors/MetaDataExecutor.java +++ b/qqq-middleware-javalin/src/main/java/com/kingsrook/qqq/middleware/javalin/executors/MetaDataExecutor.java @@ -41,8 +41,17 @@ public class MetaDataExecutor extends AbstractMiddlewareExecutor defineRequestParameters() + { + return List.of( + + new Parameter() + .withName("frontendName") + .withDescription(""" + Name of the frontend requesting the meta-data. + Generally a QQQ frontend library, unless a custom application frontend has been built.""") + .withIn(In.QUERY) + .withSchema(new Schema().withType(Type.STRING)) + .withExample("qqq-frontend-material-dashboard"), + + new Parameter() + .withName("frontendVersion") + .withDescription("Version of the frontend requesting the meta-data.") + .withIn(In.QUERY) + .withSchema(new Schema().withType(Type.STRING)) + .withExample("0.23.0"), + + new Parameter() + .withName("applicationName") + .withDescription(""" + Name of the application requesting the meta-data. e.g., an instance of a specific frontend + (i.e., an application might be deployed with 2 different qqq-frontend-material-dashboard frontends, + in which case this attribute allows differentiation between them).""") + .withIn(In.QUERY) + .withSchema(new Schema().withType(Type.STRING)) + .withExample("my-admin-web-app"), + + new Parameter() + .withName("applicationVersion") + .withDescription("Version of the application requesting the meta-data.") + .withIn(In.QUERY) + .withSchema(new Schema().withType(Type.STRING)) + .withExample("20241021") + + ); + } + + + /*************************************************************************** ** ***************************************************************************/ @@ -101,6 +151,16 @@ public class MetaDataSpecV1 extends AbstractEndpointSpec