lahirujayathilake commented on code in PR #496:
URL: https://github.com/apache/airavata-custos/pull/496#discussion_r3438958383
##########
web/scripts/gen-api.mts:
##########
@@ -0,0 +1,57 @@
+import path from "node:path";
+import { fileURLToPath } from "node:url";
+import { createClient } from "@hey-api/openapi-ts";
+
+const here = path.dirname(fileURLToPath(import.meta.url));
+const webRoot = path.resolve(here, "..");
+const repoRoot = path.resolve(webRoot, "..");
+
+type ModuleSpec = {
+ name: string;
+ input: string;
+ output: string;
+};
+
+const modules: ModuleSpec[] = [
+ {
+ name: "core",
+ input: path.join(repoRoot, "api", "core.openapi.yaml"),
+ output: path.join(webRoot, "src", "generated", "core"),
+ },
+ {
+ name: "amie",
+ input: path.join(
+ repoRoot,
+ "connectors",
+ "ACCESS",
+ "AMIE-Processor",
+ "api",
+ "amie.openapi.yaml",
+ ),
+ output: path.join(webRoot, "src", "generated", "amie"),
+ },
+];
+
+async function main() {
+ for (const mod of modules) {
+ await createClient({
Review Comment:
Hey @mrlubos , thanks for taking a look. I checked and that's the cleaner
approach. Will include the update in a follow-up.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]