From 16d3561c6145a859b26be23765fed7c954645796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Sultan?= Date: Wed, 16 Oct 2024 15:29:05 +0200 Subject: [PATCH] feat: spec gen api interface (#1) * feat: specgen api interface * fix: remove useless dependencies --- .circleci/config.yml | 35 +++++++++++++ .github/CODEOWNERS | 1 + .github/renovate.json | 7 +++ .gitignore | 4 ++ pom.xml | 52 +++++++++++++++++++ .../gravitee/spec/gen/api/EndpointType.java | 24 +++++++++ .../io/gravitee/spec/gen/api/Operation.java | 25 +++++++++ .../spec/gen/api/SchedulingConfiguration.java | 18 +++++++ .../gravitee/spec/gen/api/SchedulingUnit.java | 22 ++++++++ .../gravitee/spec/gen/api/SpecGenRequest.java | 26 ++++++++++ .../spec/gen/api/SpecGenRequestState.java | 27 ++++++++++ 11 files changed, 241 insertions(+) create mode 100644 .circleci/config.yml create mode 100644 .github/CODEOWNERS create mode 100644 .github/renovate.json create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/io/gravitee/spec/gen/api/EndpointType.java create mode 100644 src/main/java/io/gravitee/spec/gen/api/Operation.java create mode 100644 src/main/java/io/gravitee/spec/gen/api/SchedulingConfiguration.java create mode 100644 src/main/java/io/gravitee/spec/gen/api/SchedulingUnit.java create mode 100644 src/main/java/io/gravitee/spec/gen/api/SpecGenRequest.java create mode 100644 src/main/java/io/gravitee/spec/gen/api/SpecGenRequestState.java diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..ea1ec78 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,35 @@ +version: 2.1 + +# this allows you to use CircleCI's dynamic configuration feature +setup: true + +orbs: + gravitee: gravitee-io/gravitee@4.7.2 + +# our single workflow, that triggers the setup job defined above, filters on tag and branches are needed otherwise +# some workflow and job will not be triggered for tags (default CircleCI behavior) +workflows: + setup_build: + when: + not: << pipeline.git.tag >> + jobs: + - gravitee/setup_lib-build-config: + filters: + tags: + ignore: + - /.*/ + + setup_release: + when: + matches: + pattern: "/^[0-9]+\\.[0-9]+\\.[0-9]+(-(alpha|beta|rc)\\.[0-9]+)?$/" + value: << pipeline.git.tag >> + jobs: + - gravitee/setup_lib-release-config: + filters: + branches: + ignore: + - /.*/ + tags: + only: + - /^[0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta|rc)\.[0-9]+)?$/ diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..31d9318 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @gravitee-io/data diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..08d870c --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,7 @@ +{ + "extends": ["config:base"], + "prConcurrentLimit": 3, + "dependencyDashboard": true, + "commitMessageTopic": "{{depName}}", + "packageRules": [] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bd81d7c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +.idea/ +.mvn +target diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..ce87198 --- /dev/null +++ b/pom.xml @@ -0,0 +1,52 @@ + + + + 4.0.0 + + + io.gravitee + gravitee-parent + 22.1.12 + + + io.gravitee.spec.gen.api + gravitee-spec-gen-api + 0.1.0 + + Gravitee SpecGen API + + + UTF-8 + 17 + 8.1.16 + + + + + + io.gravitee + gravitee-bom + ${gravitee-bom.version} + import + pom + + + + diff --git a/src/main/java/io/gravitee/spec/gen/api/EndpointType.java b/src/main/java/io/gravitee/spec/gen/api/EndpointType.java new file mode 100644 index 0000000..8352041 --- /dev/null +++ b/src/main/java/io/gravitee/spec/gen/api/EndpointType.java @@ -0,0 +1,24 @@ +/* + * Copyright © 2015 The Gravitee team (http://gravitee.io) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.gravitee.spec.gen.api; + +/** + * @author Rémi SULTAN (remi.sultan at graviteesource.com) + * @author GraviteeSource Team + */ +public enum EndpointType { + OPEN_API, +} diff --git a/src/main/java/io/gravitee/spec/gen/api/Operation.java b/src/main/java/io/gravitee/spec/gen/api/Operation.java new file mode 100644 index 0000000..61a5fb6 --- /dev/null +++ b/src/main/java/io/gravitee/spec/gen/api/Operation.java @@ -0,0 +1,25 @@ +/* + * Copyright © 2015 The Gravitee team (http://gravitee.io) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.gravitee.spec.gen.api; + +/** + * @author Rémi SULTAN (remi.sultan at graviteesource.com) + * @author GraviteeSource Team + */ +public enum Operation { + GET_STATE, + POST_JOB, +} diff --git a/src/main/java/io/gravitee/spec/gen/api/SchedulingConfiguration.java b/src/main/java/io/gravitee/spec/gen/api/SchedulingConfiguration.java new file mode 100644 index 0000000..5b3aee1 --- /dev/null +++ b/src/main/java/io/gravitee/spec/gen/api/SchedulingConfiguration.java @@ -0,0 +1,18 @@ +/* + * Copyright © 2015 The Gravitee team (http://gravitee.io) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.gravitee.spec.gen.api; + +public record SchedulingConfiguration(SchedulingUnit unit, Integer value) {} diff --git a/src/main/java/io/gravitee/spec/gen/api/SchedulingUnit.java b/src/main/java/io/gravitee/spec/gen/api/SchedulingUnit.java new file mode 100644 index 0000000..dd2cea7 --- /dev/null +++ b/src/main/java/io/gravitee/spec/gen/api/SchedulingUnit.java @@ -0,0 +1,22 @@ +/* + * Copyright © 2015 The Gravitee team (http://gravitee.io) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.gravitee.spec.gen.api; + +public enum SchedulingUnit { + SECONDS, + DAYS, + COUNT, +} diff --git a/src/main/java/io/gravitee/spec/gen/api/SpecGenRequest.java b/src/main/java/io/gravitee/spec/gen/api/SpecGenRequest.java new file mode 100644 index 0000000..63dbb41 --- /dev/null +++ b/src/main/java/io/gravitee/spec/gen/api/SpecGenRequest.java @@ -0,0 +1,26 @@ +/* + * Copyright © 2015 The Gravitee team (http://gravitee.io) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.gravitee.spec.gen.api; + +/** + * @author Rémi SULTAN (remi.sultan at graviteesource.com) + * @author GraviteeSource Team + */ +public record SpecGenRequest( + String apiId, + EndpointType endpointType, + Operation operation +) {} diff --git a/src/main/java/io/gravitee/spec/gen/api/SpecGenRequestState.java b/src/main/java/io/gravitee/spec/gen/api/SpecGenRequestState.java new file mode 100644 index 0000000..ba672c2 --- /dev/null +++ b/src/main/java/io/gravitee/spec/gen/api/SpecGenRequestState.java @@ -0,0 +1,27 @@ +/* + * Copyright © 2015 The Gravitee team (http://gravitee.io) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.gravitee.spec.gen.api; + +/** + * @author Rémi SULTAN (remi.sultan at graviteesource.com) + * @author GraviteeSource Team + */ +public enum SpecGenRequestState { + AVAILABLE, + UNAVAILABLE, + STARTED, + GENERATING, +}