mirror of
https://github.com/valitydev/swag-dark-api.git
synced 2024-11-06 02:45:22 +00:00
TD-253: Add frontend codegen (#3)
This commit is contained in:
parent
5c7092adc8
commit
a3f16789bf
22
.github/workflows/frontend-pr.yml
vendored
Normal file
22
.github/workflows/frontend-pr.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
name: 'Frontend: PR'
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: ['*']
|
||||
|
||||
jobs:
|
||||
configured:
|
||||
uses: valitydev/action-frontend/.github/workflows/configured.yml@v0.1
|
||||
check:
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: configured
|
||||
if: needs.configured.outputs.exists == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: valitydev/action-frontend/setup@v0.1
|
||||
- run: npm ci
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Codegen
|
||||
run: npm run codegen
|
26
.github/workflows/frontend-publish.yml
vendored
Normal file
26
.github/workflows/frontend-publish.yml
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
name: 'Frontend: Publish'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['master', 'main']
|
||||
|
||||
jobs:
|
||||
configured:
|
||||
uses: valitydev/action-frontend/.github/workflows/configured.yml@v0.1
|
||||
publish:
|
||||
name: Publish
|
||||
runs-on: ubuntu-latest
|
||||
needs: configured
|
||||
if: needs.configured.outputs.exists == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: valitydev/action-frontend/setup@v0.1
|
||||
- run: npm ci
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Codegen
|
||||
run: npm run codegen
|
||||
- uses: valitydev/action-frontend/publish@v0.1
|
||||
with:
|
||||
npm-token: ${{ secrets.NPM_TOKEN }}
|
||||
directory: ./lib
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -57,4 +57,7 @@ web_deploy/
|
||||
|
||||
# Gradle:
|
||||
.idea/gradle.xml
|
||||
.idea/libraries
|
||||
.idea/libraries
|
||||
|
||||
# Frontend
|
||||
/lib
|
113
Makefile
113
Makefile
@ -1,113 +0,0 @@
|
||||
SUBMODULES = build_utils
|
||||
SUBTARGETS = $(patsubst %,%/.git,$(SUBMODULES))
|
||||
|
||||
UTILS_PATH := build_utils
|
||||
TEMPLATES_PATH := .
|
||||
|
||||
# Name of the service
|
||||
SERVICE_NAME := swag-dark-api
|
||||
# Service image default tag
|
||||
SERVICE_IMAGE_TAG ?= $(shell git rev-parse HEAD)
|
||||
# The tag for service image to be pushed with
|
||||
SERVICE_IMAGE_PUSH_TAG ?= $(SERVICE_IMAGE_TAG)
|
||||
|
||||
BUILD_IMAGE_TAG := f3732d29a5e622aabf80542b5138b3631a726adb
|
||||
|
||||
CALL_ANYWHERE := \
|
||||
all submodules init build java.compile java.deploy
|
||||
|
||||
CALL_W_CONTAINER := $(CALL_ANYWHERE)
|
||||
|
||||
all: compile
|
||||
|
||||
-include $(UTILS_PATH)/make_lib/utils_image.mk
|
||||
-include $(UTILS_PATH)/make_lib/utils_container.mk
|
||||
|
||||
.PHONY: $(CALL_W_CONTAINER)
|
||||
|
||||
$(SUBTARGETS): %/.git: %
|
||||
git submodule update --init $<
|
||||
touch $@
|
||||
|
||||
submodules: $(SUBTARGETS)
|
||||
|
||||
# NPM
|
||||
|
||||
init:
|
||||
npm install
|
||||
|
||||
build:
|
||||
npm run build
|
||||
|
||||
# Java
|
||||
|
||||
ifdef SETTINGS_XML
|
||||
DOCKER_RUN_OPTS = -v $(SETTINGS_XML):$(SETTINGS_XML)
|
||||
DOCKER_RUN_OPTS += -e SETTINGS_XML=$(SETTINGS_XML)
|
||||
endif
|
||||
|
||||
ifdef LOCAL_BUILD
|
||||
DOCKER_RUN_OPTS += -v $$HOME/.m2:/home/$(UNAME)/.m2:rw
|
||||
endif
|
||||
|
||||
COMMIT_HASH := $(shell git --no-pager log -1 --pretty=format:"%h")
|
||||
NUMBER_COMMITS := $(shell git rev-list --count HEAD)
|
||||
|
||||
JAVA_PKG_VERSION := 1.$(NUMBER_COMMITS)-$(COMMIT_HASH)
|
||||
|
||||
ifdef BRANCH_NAME
|
||||
ifeq "$(findstring epic,$(BRANCH_NAME))" "epic"
|
||||
JAVA_PKG_VERSION := $(JAVA_PKG_VERSION)-epic
|
||||
endif
|
||||
endif
|
||||
|
||||
MVN = mvn -s $(SETTINGS_XML) -Dcommit.number="$(NUMBER_COMMITS)"
|
||||
|
||||
java.swag.compile_client:
|
||||
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
|
||||
$(MVN) clean && \
|
||||
$(MVN) compile -P="client"
|
||||
|
||||
java.swag.deploy_client:
|
||||
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
|
||||
$(MVN) clean && \
|
||||
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-client" && \
|
||||
$(MVN) deploy -P="client"
|
||||
|
||||
java.swag.install_client:
|
||||
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
|
||||
$(MVN) clean && \
|
||||
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-client" && \
|
||||
$(MVN) install -P="client"
|
||||
|
||||
java.swag.compile_server:
|
||||
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
|
||||
$(MVN) clean && \
|
||||
$(MVN) compile -P="server"
|
||||
|
||||
java.swag.deploy_server:
|
||||
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
|
||||
$(MVN) clean && \
|
||||
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-server" && \
|
||||
$(MVN) deploy -P="server"
|
||||
|
||||
java.swag.install_server:
|
||||
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
|
||||
$(MVN) clean && \
|
||||
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-server" && \
|
||||
$(MVN) install -P="server"
|
||||
|
||||
java.compile: java.settings
|
||||
$(MVN) compile
|
||||
|
||||
java.deploy: java.settings
|
||||
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)" && \
|
||||
$(MVN) deploy
|
||||
|
||||
java.install: java.settings
|
||||
$(MVN) clean && \
|
||||
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)" && \
|
||||
$(MVN) install
|
||||
|
||||
java.settings:
|
||||
$(if $(SETTINGS_XML),, echo "SETTINGS_XML not defined"; exit 1)
|
7
openapitools.json
Normal file
7
openapitools.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
|
||||
"spaces": 2,
|
||||
"generator-cli": {
|
||||
"version": "5.4.0"
|
||||
}
|
||||
}
|
14781
package-lock.json
generated
14781
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
27
package.json
27
package.json
@ -1,8 +1,15 @@
|
||||
{
|
||||
"name": "Vality-darkapi-spec",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"bower": "^1.7.7",
|
||||
"name": "@vality/swag-dark-api",
|
||||
"version": "0.1.0",
|
||||
"scripts": {
|
||||
"build": "node ./scripts/build.js",
|
||||
"swagger": "swagger-repo",
|
||||
"validate": "swagger-repo validate",
|
||||
"start": "gulp serve",
|
||||
"codegen": "vality-openapi generate ./web_deploy/swagger.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vality/openapi-generator-cli": "0.1.1-fbfe66e.0",
|
||||
"connect": "^3.4.1",
|
||||
"cors": "^2.7.1",
|
||||
"deploy-to-gh-pages": "^1.1.0",
|
||||
@ -10,18 +17,10 @@
|
||||
"gulp-connect": "^4.2.0",
|
||||
"gulp-util": "^3.0.7",
|
||||
"json-merge-patch": "^0.2.3",
|
||||
"npm": "^5.8.0",
|
||||
"portfinder": "^1.0.3",
|
||||
"redoc-cli": "^0.10.2",
|
||||
"shelljs": "^0.7.0",
|
||||
"swagger-repo": "^1.0.0",
|
||||
"swagger-ui": "^2.1.4",
|
||||
"redoc-cli": "^0.10.2"
|
||||
},
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "node ./scripts/build.js",
|
||||
"swagger": "swagger-repo",
|
||||
"validate": "swagger-repo validate",
|
||||
"start": "gulp serve"
|
||||
"swagger-ui": "^2.1.4"
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
type: integer
|
||||
enum:
|
||||
- value: 100
|
||||
name: none
|
||||
- value: 200
|
||||
name: partial
|
||||
- value: 300
|
||||
name: full
|
||||
- 100 # none
|
||||
- 200 # partial
|
||||
- 300 # full
|
||||
|
@ -1,7 +1,5 @@
|
||||
type: object
|
||||
discriminator: type
|
||||
default:
|
||||
type: PaymentFlowInstant
|
||||
required:
|
||||
- type
|
||||
properties:
|
||||
@ -11,3 +9,4 @@ properties:
|
||||
enum:
|
||||
- PaymentFlowInstant
|
||||
- PaymentFlowHold
|
||||
default: PaymentFlowInstant
|
||||
|
Loading…
Reference in New Issue
Block a user