Skip to content

Commit 39e86a2

Browse files
Update api (#49)
* updated generated api clients * clippy
1 parent 662f9f9 commit 39e86a2

27 files changed

+254
-204
lines changed

Makefile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
gen_http_client:
22
echo "Running demo server..."
33
- pkill reactor_nctrl
4-
# - kill $(lsof -ti :3000)
4+
55
cargo run --features swagger --bin reactor_nctrl -- --port 3000 /tmp &
66
SERVER_PID=$!
77
sleep 5
8+
89
echo "Generating client"
9-
# docker run --rm --network=host -v $PWD:/local -u $(id -u):$(id -g) \
10-
# openapitools/openapi-generator-cli generate -i http://host.docker.internal:3000/api-doc/openapi.json \
11-
# -g rust -o /local/rpc_client/ --additional-properties=packageName=reactor-client
12-
docker run --rm --network=host -v $PWD:/local -u $(id -u):$(id -g) \
13-
openapitools/openapi-generator-cli generate -i http://localhost:3000/api-doc/openapi.json \
14-
-g rust -o /local/rpc_client/ --additional-properties=packageName=reactor-client
15-
kill ${SERVER_PID}
10+
openapi-generator-cli generate -i http://localhost:3000/api-doc/openapi.json \
11+
-g rust -o rpc_client/ --additional-properties=packageName=reactor-client
12+
13+
openapi-generator-cli generate -i http://localhost:3000/api-doc/openapi.json \
14+
-g typescript-axios -o ./reactor-dashboard/api-client/src --additional-properties=packageName=reactor-client
15+
16+
- pkill reactor_nctrl

reactor-dashboard/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Prerequisites
2+
1. Install npm
3+
4+
# How to run
5+
1. `cd ui`
6+
2. `npm install ../api-client`
7+
3. `npm install`
8+
4. `npm run --dev -- --host`
9+
10+
11+
# How to (re)generate `api-client`
12+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "all"
5+
}
6+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import globals from "globals";
2+
import tseslint from "typescript-eslint";
3+
import { defineConfig } from "eslint/config";
4+
5+
export default defineConfig([
6+
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], languageOptions: { globals: globals.browser } },
7+
tseslint.configs.recommended,
8+
]);

reactor-dashboard/api-client/package.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,20 @@
55
"types": "dist/index.d.ts",
66
"scripts": {
77
"build": "tsc -b",
8-
"prepare": "npm run build"
8+
"prepare": "npm run build",
9+
"lint": "eslint .",
10+
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\""
911
},
1012
"devDependencies": {
11-
"typescript": "~5.8.3"
13+
"@eslint/js": "^9.33.0",
14+
"eslint": "^9.34.0",
15+
"globals": "^16.3.0",
16+
"prettier": "^3.6.2",
17+
"typescript": "~5.8.3",
18+
"typescript-eslint": "^8.41.0"
1219
},
1320
"dependencies": {
14-
"axios": "^1.11.0"
21+
"axios": "^1.11.0",
22+
"jiti": "^2.5.1"
1523
}
1624
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
wwwroot/*.js
2+
node_modules
3+
typings
4+
dist
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.gitignore
2+
.npmignore
3+
.openapi-generator-ignore
4+
api.ts
5+
base.ts
6+
common.ts
7+
configuration.ts
8+
docs/DefaultApi.md
9+
docs/RegistrationArgs.md
10+
docs/RemoteActorInfo.md
11+
docs/SpawnArgs.md
12+
docs/StatusResponse.md
13+
git_push.sh
14+
index.ts
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.14.0

0 commit comments

Comments
 (0)