Skip to content

Commit

Permalink
feat(HMS-2721): generate rbac api client
Browse files Browse the repository at this point in the history
This change is on top of the PR below:
podengo-project#64

and this add the rbac client api generated
from the v1.2.0 repository tag from insights-rbac.

This allow us to attach the generation to a specific
state, and manage the change.

Signed-off-by: Alejandro Visiedo <[email protected]>
  • Loading branch information
avisiedo committed May 15, 2024
1 parent 370b761 commit 9947e4e
Show file tree
Hide file tree
Showing 9 changed files with 6,575 additions and 1 deletion.
15 changes: 14 additions & 1 deletion scripts/mk/crc-frontend.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ run:$(NODE_BIN)/fec ## Execute frontend

.PHONY: generate-api
generate-api: $(NODE_BIN)/openapi-generator-cli $(NODE_BIN)/prettier $(PUBLIC_OPENAPI) ## Generate the API client from openapi specification
@rm -rf "$(APIDIR)/idmsvc"
@rm -rf "$(APIDIR)/idmsvc" "$(APIDIR)/rbac"

# Generate idmsvc API client
TS_POST_PROCESS_FILE="node_modules/.bin/prettier --write" \
Expand All @@ -51,6 +51,19 @@ generate-api: $(NODE_BIN)/openapi-generator-cli $(NODE_BIN)/prettier $(PUBLIC_OP
"$(APIDIR)/idmsvc/git_push.sh" \
"$(APIDIR)/idmsvc/.gitignore"

# Generate rbac API client
TS_POST_PROCESS_FILE="node_modules/.bin/prettier --write" \
npm run openapi-generator-cli -- generate --enable-post-process-file \
-i "https://raw.githubusercontent.com/RedHatInsights/insights-rbac/v1.2.0/docs/source/specs/openapi.json" \
-g typescript-axios -o $(APIDIR)/rbac
@rm -rf \
"$(APIDIR)/rbac/.gitignore" \
"$(APIDIR)/rbac/.npmignore" \
"$(APIDIR)/rbac/git_push.sh" \
"$(APIDIR)/rbac/.gitignore"



.PHONY: update-api
update-api:
git submodule update --init --remote
Expand Down
23 changes: 23 additions & 0 deletions src/Api/rbac/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
9 changes: 9 additions & 0 deletions src/Api/rbac/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.gitignore
.npmignore
.openapi-generator-ignore
api.ts
base.ts
common.ts
configuration.ts
git_push.sh
index.ts
1 change: 1 addition & 0 deletions src/Api/rbac/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.6.0
Loading

0 comments on commit 9947e4e

Please sign in to comment.