-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ATL-4256-add-metrics-for-connection-flow
- Loading branch information
Showing
50 changed files
with
2,890 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Publish prism-agent clients | ||
|
||
on: | ||
push: | ||
tags: | ||
- "prism-agent-v*" | ||
|
||
jobs: | ||
publish-clients: | ||
name: 'Build and publish Prism-Agent clients' | ||
runs-on: ubuntu-latest | ||
env: | ||
VERSION_TAG: ${{github.ref_name}} | ||
ATALA_GITHUB_ACTOR: ${{secrets.ATALA_GITHUB_ACTOR}} | ||
ATALA_GITHUB_TOKEN: ${{secrets.ATALA_GITHUB_TOKEN}} | ||
NODE_AUTH_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "lts/*" | ||
registry-url: https://npm.pkg.github.com/ | ||
scope: "@input-output-hk" | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Login to Github Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.ATALA_GITHUB_ACTOR }} | ||
password: ${{ secrets.ATALA_GITHUB_TOKEN }} | ||
|
||
- name: Install generator dependencies | ||
working-directory: prism-agent/client/generator | ||
run: yarn install | ||
|
||
- name: Generate clients | ||
working-directory: prism-agent/client/generator | ||
run: yarn generate:all | ||
|
||
- name: Publish clients | ||
working-directory: prism-agent/client/generator | ||
run: yarn publish:clients |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
MERCURY_MEDIATOR_VERSION=0.3.0 | ||
IRIS_SERVICE_VERSION=0.1.0 | ||
PRISM_AGENT_VERSION=1.6.0 | ||
PRISM_NODE_VERSION=v2.1.3 | ||
PRISM_AGENT_VERSION=1.9.2 | ||
PRISM_NODE_VERSION=2.2.1 | ||
PORT=80 | ||
NETWORK=prism | ||
VAULT_DEV_ROOT_TOKEN_ID=root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
target | ||
node_modules/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea/modules.xml | ||
.idea/jarRepositories.xml | ||
.idea/compiler.xml | ||
.idea/libraries/ | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
.idea | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Prism-agent client generator | ||
|
||
This project goal is to generate the models based on the OpenAPI Specification. | ||
|
||
## Generating models | ||
|
||
Then run the generator scripts: | ||
|
||
```bash | ||
cd generator | ||
yarn generate | ||
``` | ||
|
||
To publish the clients: | ||
|
||
```bash | ||
cd generator | ||
yarn publish:clients | ||
``` | ||
|
||
## Prism-agent lifecycle | ||
|
||
`prism-client-generator` creates the clients after the `prism-agent-v*` tag is created. | ||
|
||
## Supported clients | ||
|
||
1. Kotlin | ||
2. Typescript | ||
|
||
### Work in progress | ||
|
||
1. Python | ||
|
||
# Caution note | ||
|
||
Some of the OAS3 schema types are not fully supported. | ||
|
||
The generated files that are not supported were fixed manually and ignored from the generation, in the `.openapi-generator-ignore` file, therefore it requires a diligence work to keep them updated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
git clean -dfx ../kotlin | ||
git clean -dfx ../python | ||
git clean -dfx ../typescript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# generate kotlin models | ||
yarn openapi-generator-cli generate \ | ||
-g kotlin \ | ||
-i ../../service/api/http/prism-agent-openapi-spec.yaml \ | ||
-o ../kotlin \ | ||
--ignore-file-override ../kotlin/.openapi-generator-ignore \ | ||
--additional-properties=packageName=io.iohk.atala.prism,serializationLibrary=gson | ||
|
||
# generate typescript models | ||
yarn openapi-generator-cli generate \ | ||
-g typescript \ | ||
-i ../../service/api/http/prism-agent-openapi-spec.yaml \ | ||
-o ../typescript \ | ||
--ignore-file-override ../typescript/.openapi-generator-ignore | ||
|
||
# generate python models | ||
# yarn openapi-generator-cli generate -g python -i oas.yml --skip-validate-spec -o ../python --ignore-file-override ../python/.openapi-generator-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", | ||
"spaces": 2, | ||
"generator-cli": { | ||
"version": "6.6.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "prism-agent-clients-generator", | ||
"version": "1.0.0", | ||
"description": "Generates the clients based on the OAS for many languages", | ||
"author": "Allain Magyar", | ||
"license": "Apache-2.0", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"generate": "npm-run-all clean:all generate:all", | ||
"generate:all": "./generate-clients.sh", | ||
"clean:all": "./clean.sh", | ||
"publish:clients": "./publish-clients.sh" | ||
}, | ||
"dependencies": { | ||
"@openapitools/openapi-generator-cli": "2.7.0", | ||
"npm-run-all": "^4.1.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
PRISM_AGENT_VERSION=${VERSION_TAG:13} | ||
|
||
# install dependencies | ||
yarn | ||
|
||
# kotlin | ||
gradle -p ../kotlin -Pversion=${PRISM_AGENT_VERSION} publish | ||
|
||
# typescript | ||
yarn --cwd ../typescript | ||
yarn --cwd ../typescript publish --new-version ${PRISM_AGENT_VERSION} --no-git-tag-version | ||
|
||
# python |
Oops, something went wrong.