From 6b7e05d23203a575badd808cc18b2d82b2eab4a7 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 8 Aug 2022 09:58:24 +0200 Subject: [PATCH 01/99] Init commit --- .github/dependabot.yml | 26 ++ .github/workflows/checkBuild.yml | 59 ++++ .github/workflows/release.yml | 280 +++++++++++++++++ .github/workflows/test-deploy.yml | 29 ++ .gitignore | 109 +++++++ .idea/checkstyle-idea.xml | 18 ++ .idea/codeStyles/Project.xml | 82 +++++ .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/inspectionProfiles/Project_Default.xml | 6 + .idea/saveactions_settings.xml | 21 ++ LICENSE | 201 ++++++++++++ README.md | 60 ++++ assets/demo.gif | Bin 0 -> 14257 bytes assets/demo.png | Bin 0 -> 14257 bytes config/checkstyle/checkstyle.xml | 311 +++++++++++++++++++ 15 files changed, 1207 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/checkBuild.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test-deploy.yml create mode 100644 .gitignore create mode 100644 .idea/checkstyle-idea.xml create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/saveactions_settings.xml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 assets/demo.gif create mode 100644 assets/demo.png create mode 100644 config/checkstyle/checkstyle.xml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5ae384c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,26 @@ +version: 2 +updates: +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + # Run it at a specific time so that we don't get emails all day long + time: "00:00" + open-pull-requests-limit: 10 + ignore: + - dependency-name: "*" + # GitHub actions are using git tags (v1 = v1.2 = v1.2.3) which should be compatible until a major change is performed + update-types: + - "version-update:semver-minor" + - "version-update:semver-patch" +- package-ecosystem: maven + directory: "/" + schedule: + interval: daily + # Run it at a specific time so that we don't get emails all day long + time: "00:00" + open-pull-requests-limit: 10 + ignore: + - dependency-name: "org.eclipse.jetty:jetty-maven-plugin" + # Version 11+ requires jakarta.* instead of javax.* (see https://www.eclipse.org/jetty/download.php#what-jetty-version) + versions: ">=11.0.0" diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml new file mode 100644 index 0000000..8cbdd16 --- /dev/null +++ b/.github/workflows/checkBuild.yml @@ -0,0 +1,59 @@ +name: Check Build + +on: + workflow_dispatch: + push: + branches: [ develop ] + paths-ignore: + - '**.md' + pull_request: + branches: [ develop ] + paths-ignore: + - '**.md' + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + java: [11, 17] + distribution: [temurin] + + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + cache: 'maven' + + - name: Build with Maven + run: mvn -B clean package -Pproduction + + - name: Check for uncommited changes + run: | + if [[ "$(git status --porcelain)" != "" ]]; then + echo ---------------------------------------- + echo git status + echo ---------------------------------------- + git status + echo ---------------------------------------- + echo git diff + echo ---------------------------------------- + git diff + echo ---------------------------------------- + echo Troubleshooting + echo ---------------------------------------- + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean package -Pproduction" + exit 1 + fi + + - name: Upload demo files + uses: actions/upload-artifact@v3 + with: + name: demo-files-java-${{ matrix.java }} + path: vaadin-addon-template-demo/target/vaadin-addon-template-demo.war + if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..93c9085 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,280 @@ +name: Release + +on: + push: + branches: [ master ] + +jobs: + check_code: # Validates the code (see develop.yml) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + + - name: Cache local Maven repository + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Build with Maven + run: mvn -B clean package -Pproduction + + - name: Check for uncommited changes + run: | + if [[ "$(git status --porcelain)" != "" ]]; then + echo ---------------------------------------- + echo git status + echo ---------------------------------------- + git status + echo ---------------------------------------- + echo git diff + echo ---------------------------------------- + git diff + echo ---------------------------------------- + echo Troubleshooting + echo ---------------------------------------- + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean package -Pproduction" + exit 1 + fi + + prepare_release: + runs-on: ubuntu-latest + needs: [check_code] + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + steps: + - uses: actions/checkout@v3 + + - name: Configure Git + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + + - name: Un-SNAP root + run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false + + - name: Un-SNAP demo + run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false + working-directory: vaadin-addon-template-demo + + - name: Un-SNAP + run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false + working-directory: vaadin-addon-template + + - name: Get version + id: version + run: | + version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "::set-output name=release::$version" + echo "::set-output name=releasenumber::${version//[!0-9]/}" + working-directory: vaadin-addon-template + + - name: Commit and Push + run: | + git add -A + git commit -m "Release ${{ steps.version.outputs.release }}" + git push origin + git tag v${{ steps.version.outputs.release }} + git push origin --tags + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ steps.version.outputs.release }} + release_name: v${{ steps.version.outputs.release }} + commitish: master + body: | + ## [Changelog](https://github.com/xdev-software/vaadin-addon-template/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) + See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/xdev-software/vaadin-addon-template/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information. + + ## Installation + Add the following lines to your pom: + ```XML + + com.xdev-software + vaadin-addon-template + ${{ steps.version.outputs.release }} + + ``` + draft: false + prerelease: false + + publish_central: # Publish the code to central + runs-on: ubuntu-latest + needs: [prepare_release] + steps: + - uses: actions/checkout@v3 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Set up JDK Apache Maven Central + uses: actions/setup-java@v3 + with: # running setup-java again overwrites the settings.xml + java-version: '11' + distribution: 'temurin' + server-id: ossrh + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + - name: Publish to Apache Maven Central + run: mvn -B deploy -Possrh + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + working-directory: vaadin-addon-template + + build_directory: # Build a ZIP that can be uploaded to Vaadin Directory + runs-on: ubuntu-latest + needs: [prepare_release] + steps: + - uses: actions/checkout@v3 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + + - name: Build for Vaadin Directory + run: mvn -B install -Pdirectory + working-directory: vaadin-addon-template + + - name: Upload asset + uses: actions/upload-artifact@v3 + with: + name: vaadin-directory-files + path: vaadin-addon-template/target/vaadin-addon-template-*.zip + if-no-files-found: error + + - name: Get version + id: version + run: | + echo "::set-output name=release::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" + working-directory: vaadin-addon-template + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.prepare_release.outputs.upload_url }} + asset_path: vaadin-addon-template/target/vaadin-addon-template-${{ steps.version.outputs.release }}.zip + asset_name: vaadin-addon-template-${{ steps.version.outputs.release }}.zip + asset_content_type: application/zip + + publish-pages: + name: Publish dependencies and licenses to github pages + runs-on: ubuntu-latest + needs: [prepare_release] + steps: + - uses: actions/checkout@v3 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Setup - Java + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + cache: 'maven' + + - name: Build dependencies/licenses files + run: mvn -B project-info-reports:dependencies + working-directory: vaadin-addon-template + + - name: Upload licenses - Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: dependencies-licenses + path: vaadin-addon-template/target/site + + - name: Generate docs/dependencies dir + run: mkdir -p docs/dependencies + + - name: Move built files into docs/dependencies + run: mv vaadin-addon-template/target/site/* docs/dependencies + + - name: Rename dependencies.html to index.html + working-directory: docs/dependencies + run: mv dependencies.html index.html + + - name: Copy Readme into docs (as index.md) + run: cp README.md docs/index.md + + - name: Configure Pages + working-directory: docs + run: |- + echo "theme: jekyll-theme-tactile" > _config.yml + + - name: Deploy to Github pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs + enable_jekyll: true + + after_release: + runs-on: ubuntu-latest + needs: [publish_central, build_directory] + steps: + - uses: actions/checkout@v3 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Inc Version and SNAP root + run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true + + - name: Inc Version and SNAP demo + run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true + working-directory: vaadin-addon-template-demo + + - name: Inc Version and SNAP + run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true + working-directory: vaadin-addon-template + + - name: Git Commit and Push + run: | + git add -A + git commit -m "Preparing for next development iteration" + git push origin + + - name: pull-request + uses: repo-sync/pull-request@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + destination_branch: "develop" + pr_title: "Sync back" + pr_body: "An automated PR to sync changes back" + diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml new file mode 100644 index 0000000..8150f11 --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,29 @@ +name: Test Deployment + +on: + workflow_dispatch: + +jobs: + publish_central: # Publish the code to central + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK OSSRH + uses: actions/setup-java@v3 + with: # running setup-java again overwrites the settings.xml + distribution: 'temurin' + java-version: '11' + server-id: ossrh + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + - name: Publish to OSSRH + run: mvn -B deploy -Possrh + working-directory: vaadin-addon-template + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ae788cb --- /dev/null +++ b/.gitignore @@ -0,0 +1,109 @@ +# Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package/Binary Files don't belong into a git repo +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar +*.dll +*.exe +*.bin + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + + +# bin / compiled stuff +target/ + + +# JRebel +**/resources/rebel.xml +**/resources/rebel-remote.xml + +# eclispe stuff for root +/.settings/ +/.classpath +/.project + + +# eclispe stuff for modules +/*/.metadata/ +/*/.apt_generated_tests/ +/*/.settings/ +/*/.classpath +/*/.project +/*/RemoteSystemsTempFiles/ + + +#vaadin/node webpack/frontend stuff +# Ignore Node +node/ + +# The following files are generated/updated by vaadin-maven-plugin +node_modules/ + +# Vaadin +package.json +package-lock.json +webpack.generated.js +webpack.config.js +tsconfig.json +types.d.ts +/*/frontend/generated/ +/*/frontend/index.html + +#custom +.flattened-pom.xml +.tern-project + +# Ignore Testcontainer generic folders +PutObjectStoreDirHere/ +ObjectStore/ + +# == IntelliJ == +*.iml +*.ipr + +# Some files are user/installation independent and are used for configuring the IDE +# See also https://stackoverflow.com/a/35279076 + +.idea/* +!.idea/saveactions_settings.xml +!.idea/checkstyle-idea.xml + +!.idea/inspectionProfiles/ +.idea/inspectionProfiles/* +!.idea/inspectionProfiles/Project_Default.xml + +!.idea/codeStyles/ +.idea/codeStyles/* +!.idea/codeStyles/codeStyleConfig.xml +!.idea/codeStyles/Project.xml diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..0353d7b --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..ec7a61d --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,82 @@ + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..6a1691d --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/saveactions_settings.xml b/.idea/saveactions_settings.xml new file mode 100644 index 0000000..71a42c4 --- /dev/null +++ b/.idea/saveactions_settings.xml @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9c4a4b1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 XDEV Software + + 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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0d2dd93 --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadin-addon-template) +[![Latest version](https://img.shields.io/maven-central/v/com.xdev-software/vaadin-addon-template)](https://mvnrepository.com/artifact/com.xdev-software/vaadin-addon-template) +[![Build](https://img.shields.io/github/workflow/status/xdev-software/vaadin-addon-template/Check%20Build/develop)](https://github.com/xdev-software/vaadin-addon-template/actions/workflows/checkBuild.yml?query=branch%3Adevelop) +![Vaadin 23+](https://img.shields.io/badge/Vaadin%20Platform/Flow-23+-00b4f0.svg) + +# vaadin-addon-template +A Vaadin Template Repo + +![demo](assets/demo.png) + + +## Installation +[Installation guide for the latest release](https://github.com/xdev-software/vaadin-addon-template/releases/latest#Installation) + + +## Run the Demo +* Checkout the repo +* Run ``mvn clean install`` +* Navigate into ``vaadin-addon-template-demo`` +* Run ``mvn jetty:run`` +* Open http://localhost:8080 + + +
+ Show example + + ![demo](assets/demo.gif) +
+ + +## Dependencies and Licenses +View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/vaadin-addon-template/dependencies/) + + +## Releasing [![Build](https://img.shields.io/github/workflow/status/xdev-software/vaadin-addon-template/Release?label=Release)](https://github.com/xdev-software/vaadin-addon-template/actions/workflows/release.yml) +If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes + +When the release is finished do the following: +* Merge the auto-generated PR (with the incremented version number) back into the ``develop`` +* Upload the generated release asset zip into the [Vaadin Directory](https://vaadin.com/directory) and update the component there + + +## Developing + +### Software Requirements +You should have the following things installed: +* Git +* Java 11 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/)) +* Maven + +### Recommended setup +* Install ``IntelliJ`` (Community Edition is sufficient) + * Install the following plugins: + * [Save Actions](https://plugins.jetbrains.com/plugin/7642-save-actions) - Provides save actions, like running the formatter or adding ``final`` to fields + * [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis + * [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis + * (Optional) [Maven Helper](https://plugins.jetbrains.com/plugin/7179-maven-helper) - Better dependency overview + * Import the project + * Ensure that everything is encoded in ``UTF-8`` + * Ensure that the JDK/Java-Version is correct diff --git a/assets/demo.gif b/assets/demo.gif new file mode 100644 index 0000000000000000000000000000000000000000..a5d9bad454d7b33bbff75213cf70fddcd316a031 GIT binary patch literal 14257 zcmeI3X;c&E8pqSC*8>zq3tlTKCQ)&LFv$d2h9q3W4kl58g1FF-3>YC9OacL<#Ck|Y zi)>ZAf`A*h!NdES}d z{7=3;d)9D0rW=_X5eS6oUY@SL=x3e&WiSPO&-{8z0f7LTiv0o<0i4y45RupjL`X1f z6D^5AeSLrt-25{C8T@V>ew6&p8 zgjBjM(bmoevfr98QkP<o=M_CT>m;F}aacJ|PfQ2}BDb0GbUInCy%eGSEfHMFtBLh|CW` z!dc_D?=F_XN<PWp<7l!cEy7LgEu!(j<5 zRmf3iwBI@t384@~CJ`uDVu>IW1|p=P4B-9ZN3U=Es?k`Wu>>Y_`Rk=mKFYu34Dg7I|Wx-c2Q1mo$#bzw4q z3C7cf>%wFJ6O5+|*M-RdCKyi_t_za^Ofa4^urK-VhK#3f!0*eT0eUb z*)mv&GV}Ee9|=(?1u~fMCo>KIy5X*$I5CXy+#n|qKK)Gp`lPudei&V(uUYNqHaa@G zaN$B8kJs4Ps8Xp+OiXk-9r~k2qj7e24hjk?Dk{p&%>@7;B_&0x)glOzHBW;O2vf_w zTvz!;-|o$9&rDcmtWM)x?jOmG+P`FKUd5AR^@WFY!~W}yy99!U|Mp`dRyt zv-!z^ySSV8?SIN2=(J1axcA38#qI~RjGE?{odrBYFD7YA&1)c%QI@4^Usf!zWJ!}w zcldpKAcjGyPF4)E>(-81+OhAu6eRu9xkAJW>;e)JwF%*C+2NmU%$rw%1h6B%D@+~{VZ{(}0Ew6>X+1o9) zC3U}AqrE%31kR>aNrP-ebBff5e^4@Ax?ldiMBi$HnD)?k;vhkNBIEi6Z zJ#@CmbOC9_P0hBUBP*mnL7wSi_4QfzuRXV_VArpnS-WGYt?ed=og7oWc4b^z>Z9Yk zE1wy_Zw)xZ9lH#*)Y4IFQEdxkj4vnHHXC_d;Qdw7l;|IOj% z5r?~tWU*KHi5n%x3+Da9JgWTF6!zl&nD*i}b#(FE_@H|p+_IiFi;cBI*DdOm390+E zDQ+QhL#?W`SO&|eD+jn2E}h=ae@V~mXe>=`8=MPLF59WBMzoGs9LVjKJXpkiNs}U45NSQaH3zS==&%cm9cNznj&@=`Et2kdvqLojG^v`|jtrTW3BW zIKX0NZO+c^Ejr1R_GHhEDv9)e6bT&4t8_XPkfTXdBY_9+l(*H!-|U)Sdwu(hW>c9@ z&!uus^J7I*#^wVTzP{FwQ`OknbEM-^S;lt*6(Zx9e_EHP34?XdTOq?Qht_7FY?)SZ zJHXPhb+w_q*DPp5eQT+3TF{L1wg)nVPgdp5Ea{^kJ!)yBGD|-YU@2;m`zP-3uDfjd zG;HI4iqt29>89Y}t6`7-eMGUcpZ82lTpZPLtCXo;0L`AO^B!Vv+gp8-mM&esG?28M zRmiFLN zA63H_nzGbutq)Qq^uJ#WNwQ^E+UG)ld**t^+#@STYmnxsxf;HMe#@uTx0$!jb3^wj zj|9(qZ;x`XZt^^2ahgK0+DuO=$S~uZi%09Mn`eWiD+`7B`MK(Z^CnTD18Gx>cm`fS zRk`g+w>Nm`Px4Ndv|KVvhq^D$*~gzBSL^iP<+`6w z&iuPInfuoDSBj?hYHkIT2l8}g>B_SqdHHuQ^k$y0mMb6r%%3JnOvx!ZxJ8qBaZy`R orEAyH?}tq;|M7q2<11BJD#EH({_yj+o^(Cw<;Ha_WPh>ie-JZQGynhq literal 0 HcmV?d00001 diff --git a/assets/demo.png b/assets/demo.png new file mode 100644 index 0000000000000000000000000000000000000000..a5d9bad454d7b33bbff75213cf70fddcd316a031 GIT binary patch literal 14257 zcmeI3X;c&E8pqSC*8>zq3tlTKCQ)&LFv$d2h9q3W4kl58g1FF-3>YC9OacL<#Ck|Y zi)>ZAf`A*h!NdES}d z{7=3;d)9D0rW=_X5eS6oUY@SL=x3e&WiSPO&-{8z0f7LTiv0o<0i4y45RupjL`X1f z6D^5AeSLrt-25{C8T@V>ew6&p8 zgjBjM(bmoevfr98QkP<o=M_CT>m;F}aacJ|PfQ2}BDb0GbUInCy%eGSEfHMFtBLh|CW` z!dc_D?=F_XN<PWp<7l!cEy7LgEu!(j<5 zRmf3iwBI@t384@~CJ`uDVu>IW1|p=P4B-9ZN3U=Es?k`Wu>>Y_`Rk=mKFYu34Dg7I|Wx-c2Q1mo$#bzw4q z3C7cf>%wFJ6O5+|*M-RdCKyi_t_za^Ofa4^urK-VhK#3f!0*eT0eUb z*)mv&GV}Ee9|=(?1u~fMCo>KIy5X*$I5CXy+#n|qKK)Gp`lPudei&V(uUYNqHaa@G zaN$B8kJs4Ps8Xp+OiXk-9r~k2qj7e24hjk?Dk{p&%>@7;B_&0x)glOzHBW;O2vf_w zTvz!;-|o$9&rDcmtWM)x?jOmG+P`FKUd5AR^@WFY!~W}yy99!U|Mp`dRyt zv-!z^ySSV8?SIN2=(J1axcA38#qI~RjGE?{odrBYFD7YA&1)c%QI@4^Usf!zWJ!}w zcldpKAcjGyPF4)E>(-81+OhAu6eRu9xkAJW>;e)JwF%*C+2NmU%$rw%1h6B%D@+~{VZ{(}0Ew6>X+1o9) zC3U}AqrE%31kR>aNrP-ebBff5e^4@Ax?ldiMBi$HnD)?k;vhkNBIEi6Z zJ#@CmbOC9_P0hBUBP*mnL7wSi_4QfzuRXV_VArpnS-WGYt?ed=og7oWc4b^z>Z9Yk zE1wy_Zw)xZ9lH#*)Y4IFQEdxkj4vnHHXC_d;Qdw7l;|IOj% z5r?~tWU*KHi5n%x3+Da9JgWTF6!zl&nD*i}b#(FE_@H|p+_IiFi;cBI*DdOm390+E zDQ+QhL#?W`SO&|eD+jn2E}h=ae@V~mXe>=`8=MPLF59WBMzoGs9LVjKJXpkiNs}U45NSQaH3zS==&%cm9cNznj&@=`Et2kdvqLojG^v`|jtrTW3BW zIKX0NZO+c^Ejr1R_GHhEDv9)e6bT&4t8_XPkfTXdBY_9+l(*H!-|U)Sdwu(hW>c9@ z&!uus^J7I*#^wVTzP{FwQ`OknbEM-^S;lt*6(Zx9e_EHP34?XdTOq?Qht_7FY?)SZ zJHXPhb+w_q*DPp5eQT+3TF{L1wg)nVPgdp5Ea{^kJ!)yBGD|-YU@2;m`zP-3uDfjd zG;HI4iqt29>89Y}t6`7-eMGUcpZ82lTpZPLtCXo;0L`AO^B!Vv+gp8-mM&esG?28M zRmiFLN zA63H_nzGbutq)Qq^uJ#WNwQ^E+UG)ld**t^+#@STYmnxsxf;HMe#@uTx0$!jb3^wj zj|9(qZ;x`XZt^^2ahgK0+DuO=$S~uZi%09Mn`eWiD+`7B`MK(Z^CnTD18Gx>cm`fS zRk`g+w>Nm`Px4Ndv|KVvhq^D$*~gzBSL^iP<+`6w z&iuPInfuoDSBj?hYHkIT2l8}g>B_SqdHHuQ^k$y0mMb6r%%3JnOvx!ZxJ8qBaZy`R orEAyH?}tq;|M7q2<11BJD#EH({_yj+o^(Cw<;Ha_WPh>ie-JZQGynhq literal 0 HcmV?d00001 diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml new file mode 100644 index 0000000..710e3e6 --- /dev/null +++ b/config/checkstyle/checkstyle.xml @@ -0,0 +1,311 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d111ea3e4aca461ab490b19f8e4fe2c76ad83db6 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 8 Aug 2022 10:23:52 +0200 Subject: [PATCH 02/99] Use constants for modules --- .github/workflows/checkBuild.yml | 6 ++++- .github/workflows/release.yml | 38 +++++++++++++++++-------------- .github/workflows/test-deploy.yml | 5 +++- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 8cbdd16..f1e0118 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -11,6 +11,10 @@ on: paths-ignore: - '**.md' +env: + PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} + DEMO_MAVEN_MODULE: ${{ env.PRIMARY_MAVEN_MODULE }}-demo + jobs: build: runs-on: ubuntu-latest @@ -55,5 +59,5 @@ jobs: uses: actions/upload-artifact@v3 with: name: demo-files-java-${{ matrix.java }} - path: vaadin-addon-template-demo/target/vaadin-addon-template-demo.war + path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.war if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93c9085..e0c72e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,10 @@ on: push: branches: [ master ] +env: + PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} + DEMO_MAVEN_MODULE: ${{ env.PRIMARY_MAVEN_MODULE }}-demo + jobs: check_code: # Validates the code (see develop.yml) runs-on: ubuntu-latest @@ -63,11 +67,11 @@ jobs: - name: Un-SNAP demo run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false - working-directory: vaadin-addon-template-demo + working-directory: ${{ env.DEMO_MAVEN_MODULE }} - name: Un-SNAP run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false - working-directory: vaadin-addon-template + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Get version id: version @@ -75,7 +79,7 @@ jobs: version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) echo "::set-output name=release::$version" echo "::set-output name=releasenumber::${version//[!0-9]/}" - working-directory: vaadin-addon-template + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Commit and Push run: | @@ -95,15 +99,15 @@ jobs: release_name: v${{ steps.version.outputs.release }} commitish: master body: | - ## [Changelog](https://github.com/xdev-software/vaadin-addon-template/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) - See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/xdev-software/vaadin-addon-template/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information. + ## [Changelog](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) + See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information. ## Installation Add the following lines to your pom: ```XML com.xdev-software - vaadin-addon-template + ${{ env.PRIMARY_MAVEN_MODULE }} ${{ steps.version.outputs.release }} ``` @@ -139,7 +143,7 @@ jobs: MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - working-directory: vaadin-addon-template + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} build_directory: # Build a ZIP that can be uploaded to Vaadin Directory runs-on: ubuntu-latest @@ -161,20 +165,20 @@ jobs: - name: Build for Vaadin Directory run: mvn -B install -Pdirectory - working-directory: vaadin-addon-template + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Upload asset uses: actions/upload-artifact@v3 with: name: vaadin-directory-files - path: vaadin-addon-template/target/vaadin-addon-template-*.zip + path: ${{ env.PRIMARY_MAVEN_MODULE }}/target/${{ env.PRIMARY_MAVEN_MODULE }}-*.zip if-no-files-found: error - name: Get version id: version run: | echo "::set-output name=release::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" - working-directory: vaadin-addon-template + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Upload Release Asset uses: actions/upload-release-asset@v1 @@ -182,8 +186,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.prepare_release.outputs.upload_url }} - asset_path: vaadin-addon-template/target/vaadin-addon-template-${{ steps.version.outputs.release }}.zip - asset_name: vaadin-addon-template-${{ steps.version.outputs.release }}.zip + asset_path: ${{ env.PRIMARY_MAVEN_MODULE }}/target/${{ env.PRIMARY_MAVEN_MODULE }}-${{ steps.version.outputs.release }}.zip + asset_name: ${{ env.PRIMARY_MAVEN_MODULE }}-${{ steps.version.outputs.release }}.zip asset_content_type: application/zip publish-pages: @@ -208,19 +212,19 @@ jobs: - name: Build dependencies/licenses files run: mvn -B project-info-reports:dependencies - working-directory: vaadin-addon-template + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Upload licenses - Upload Artifact uses: actions/upload-artifact@v3 with: name: dependencies-licenses - path: vaadin-addon-template/target/site + path: ${{ env.PRIMARY_MAVEN_MODULE }}/target/site - name: Generate docs/dependencies dir run: mkdir -p docs/dependencies - name: Move built files into docs/dependencies - run: mv vaadin-addon-template/target/site/* docs/dependencies + run: mv ${{ env.PRIMARY_MAVEN_MODULE }}/target/site/* docs/dependencies - name: Rename dependencies.html to index.html working-directory: docs/dependencies @@ -258,11 +262,11 @@ jobs: - name: Inc Version and SNAP demo run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true - working-directory: vaadin-addon-template-demo + working-directory: ${{ env.DEMO_MAVEN_MODULE }} - name: Inc Version and SNAP run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true - working-directory: vaadin-addon-template + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Git Commit and Push run: | diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 8150f11..f6809fd 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -3,6 +3,9 @@ name: Test Deployment on: workflow_dispatch: +env: + PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} + jobs: publish_central: # Publish the code to central runs-on: ubuntu-latest @@ -22,7 +25,7 @@ jobs: - name: Publish to OSSRH run: mvn -B deploy -Possrh - working-directory: vaadin-addon-template + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} env: MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} From 78c9012c20fdf2d2896ce3df708cab4c57d3c01a Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 8 Aug 2022 10:26:18 +0200 Subject: [PATCH 03/99] Can't use env in env... --- .github/workflows/checkBuild.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index f1e0118..27119f7 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -13,7 +13,7 @@ on: env: PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} - DEMO_MAVEN_MODULE: ${{ env.PRIMARY_MAVEN_MODULE }}-demo + DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo jobs: build: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e0c72e4..45ce499 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: env: PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} - DEMO_MAVEN_MODULE: ${{ env.PRIMARY_MAVEN_MODULE }}-demo + DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo jobs: check_code: # Validates the code (see develop.yml) From 5e59837a9b2204351729b9b22cba783b7764d982 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 8 Aug 2022 15:20:50 +0200 Subject: [PATCH 04/99] Create update-from-template.yml --- .github/workflows/update-from-template.yml | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/update-from-template.yml diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml new file mode 100644 index 0000000..44941f7 --- /dev/null +++ b/.github/workflows/update-from-template.yml @@ -0,0 +1,77 @@ +name: Update from Template + +on: + schedule: + - cron: '55 2 * * 1' + workflow_dispatch: + +env: + UPDATE_BRANCH: update-from-template + REMOTE_URL: https://github.com/xdev-software/vaadin-addon-template.git + REMOTE_BRANCH: master + +jobs: + update: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Init Git + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + + - name: Main workflow + id: main + run: | + echo "Adding remote template-repo" + git remote add template ${{ env.REMOTE_URL }} + + echo "Fetching remote template repo" + git fetch template + + echo "Deleting local branch that will contain the updates - if present" + git branch -D ${{ env.UPDATE_BRANCH }} || true + + echo "Checking if the remote template repo has new commits" + git rev-list ..template/${{ env.REMOTE_BRANCH }} + + if [ $(git rev-list --count ..template/${{ env.REMOTE_BRANCH }}) -eq 0 ]; then + echo "There are no commits new commits on the template repo" + + echo "Deleting origin branch that contains the updates - if present" + git push -f origin --delete ${{ env.UPDATE_BRANCH }} || true + + echo "::set-output name=abort::1" + exit 0 + fi + + echo "Found new commits on the template repo" + + echo "Creating update branch" + git branch ${{ env.UPDATE_BRANCH }} template/${{ env.REMOTE_BRANCH }} + git branch --unset-upstream ${{ env.UPDATE_BRANCH }} + + echo "Pushing update branch" + git push -f -u origin ${{ env.UPDATE_BRANCH }} + + echo "Getting current branch" + currentbranch=$(git branch --show-current) + echo "Current branch is $currentbranch" + echo "::set-output name=currentbranch::$currentbranch" + + echo "::set-output name=abort::0" + + - name: pull-request + uses: repo-sync/pull-request@v2 + if: steps.main.outputs.abort == 0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + source_branch: ${{ env.UPDATE_BRANCH }} + destination_branch: ${{ steps.main.outputs.currentbranch }} + pr_title: "Sync from template" + pr_body: "An automated PR to sync changes from the template into this repo" + From 855cd5860403715dc590e1f9cfa7732bdc5f9506 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 8 Aug 2022 16:44:17 +0200 Subject: [PATCH 05/99] Updated doc --- .github/workflows/update-from-template.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml index 44941f7..330ff35 100644 --- a/.github/workflows/update-from-template.yml +++ b/.github/workflows/update-from-template.yml @@ -1,5 +1,10 @@ name: Update from Template +# This workflow keeps the repo up to date with changes from the template repo (REMOTE_URL) +# It duplicates the REMOTE_BRANCH (into UPDATE_BRANCH) and tries to merge it into the +# this repos default branch (which is checked out here) +# Note that this requires a PAT (Personal Access Token) - at best from a servicing account + on: schedule: - cron: '55 2 * * 1' @@ -17,7 +22,11 @@ jobs: steps: - uses: actions/checkout@v3 with: + # Required because otherwise there are always changes detected when executing diff/rev-list fetch-depth: 0 + # If no PAT is used the following error occurs on a push: + # refusing to allow a GitHub App to create or update workflow `.github/workflows/xxx.yml` without `workflows` permission + token: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }} - name: Init Git run: | @@ -59,9 +68,9 @@ jobs: git push -f -u origin ${{ env.UPDATE_BRANCH }} echo "Getting current branch" - currentbranch=$(git branch --show-current) - echo "Current branch is $currentbranch" - echo "::set-output name=currentbranch::$currentbranch" + current_branch=$(git branch --show-current) + echo "Current branch is $current_branch" + echo "::set-output name=current_branch::$current_branch" echo "::set-output name=abort::0" @@ -71,7 +80,7 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} source_branch: ${{ env.UPDATE_BRANCH }} - destination_branch: ${{ steps.main.outputs.currentbranch }} - pr_title: "Sync from template" + destination_branch: ${{ steps.main.outputs.current_branch }} + pr_title: "Update from template" pr_body: "An automated PR to sync changes from the template into this repo" From 5f0a6474fe5ac645f4c4e1e546b039ab36e169ea Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 8 Aug 2022 16:48:48 +0200 Subject: [PATCH 06/99] Update doc --- .github/workflows/update-from-template.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml index 330ff35..bdaf8cf 100644 --- a/.github/workflows/update-from-template.yml +++ b/.github/workflows/update-from-template.yml @@ -4,6 +4,8 @@ name: Update from Template # It duplicates the REMOTE_BRANCH (into UPDATE_BRANCH) and tries to merge it into the # this repos default branch (which is checked out here) # Note that this requires a PAT (Personal Access Token) - at best from a servicing account +# Also note that you should have at least once merged the template repo into the current repo manually +# otherwise a "refusing to merge unrelated histories" error might occur. on: schedule: From ca1adacf3cfd082f0d29f7e93ce0dcf082d27838 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 8 Aug 2022 16:55:35 +0200 Subject: [PATCH 07/99] Added explicit permissions --- .github/workflows/update-from-template.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml index bdaf8cf..c598d45 100644 --- a/.github/workflows/update-from-template.yml +++ b/.github/workflows/update-from-template.yml @@ -17,6 +17,10 @@ env: REMOTE_URL: https://github.com/xdev-software/vaadin-addon-template.git REMOTE_BRANCH: master +permissions: + contents: write + pull-requests: write + jobs: update: runs-on: ubuntu-latest From b8cf671ab4993f06c44065f1b3a8de5873992759 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 8 Aug 2022 17:38:24 +0200 Subject: [PATCH 08/99] Update README.md Removed IntelliJ built-in functionallity --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0d2dd93..78d892f 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,6 @@ You should have the following things installed: * [Save Actions](https://plugins.jetbrains.com/plugin/7642-save-actions) - Provides save actions, like running the formatter or adding ``final`` to fields * [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis * [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis - * (Optional) [Maven Helper](https://plugins.jetbrains.com/plugin/7179-maven-helper) - Better dependency overview * Import the project * Ensure that everything is encoded in ``UTF-8`` * Ensure that the JDK/Java-Version is correct From 7700fffb639b7657ccb4aad4198241a8183c1f71 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 9 Aug 2022 08:16:52 +0200 Subject: [PATCH 09/99] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 78d892f..2b5d8cb 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,11 @@ View the [license of the current project](LICENSE) or the [summary including all ## Releasing [![Build](https://img.shields.io/github/workflow/status/xdev-software/vaadin-addon-template/Release?label=Release)](https://github.com/xdev-software/vaadin-addon-template/actions/workflows/release.yml) + +Before releasing: +* Consider doing a [test-deployment](https://github.com/xdev-software/vaadin-addon-template/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing. +* Check the [changelog](CHANGELOG.md) + If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes When the release is finished do the following: From 48e9076056ce21a0c1b3ff94ead41dea382d57b8 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 9 Aug 2022 09:20:43 +0200 Subject: [PATCH 10/99] Added abstract poms --- pom.xml | 30 ++ vaadin-addon-template-demo/pom.xml | 146 ++++++++++ vaadin-addon-template/assembly/MANIFEST.MF | 6 + vaadin-addon-template/assembly/assembly.xml | 42 +++ vaadin-addon-template/pom.xml | 302 ++++++++++++++++++++ 5 files changed, 526 insertions(+) create mode 100644 pom.xml create mode 100644 vaadin-addon-template-demo/pom.xml create mode 100644 vaadin-addon-template/assembly/MANIFEST.MF create mode 100644 vaadin-addon-template/assembly/assembly.xml create mode 100644 vaadin-addon-template/pom.xml diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..900d7cc --- /dev/null +++ b/pom.xml @@ -0,0 +1,30 @@ + + + + 4.0.0 + + com.xdev-software + vaadin-addon-template-root + pom + 1.0.0-SNAPSHOT + + + XDEV Software + https://xdev.software/en + + + + vaadin-addon-template + vaadin-addon-template-demo + + + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml new file mode 100644 index 0000000..2f428a7 --- /dev/null +++ b/vaadin-addon-template-demo/pom.xml @@ -0,0 +1,146 @@ + + + 4.0.0 + + + com.xdev-software + vaadin-addon-template-demo + 1.0.0-SNAPSHOT + war + + 2020 + + + XDEV Software + https://xdev.software/en + + + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + apache_v2 + + 11 + ${javaVersion} + + UTF-8 + UTF-8 + + + 23.1.4 + + + + + + + com.vaadin + vaadin-bom + pom + import + ${vaadin.version} + + + + + + + com.vaadin + vaadin-core + + + com.xdev-software + vaadin-addon-template + ${project.version} + + + org.slf4j + slf4j-simple + + + + + ${project.artifactId} + + + + + org.eclipse.jetty + jetty-maven-plugin + 10.0.11 + + 1 + + + + com.vaadin + vaadin-maven-plugin + ${vaadin.version} + + + + prepare-frontend + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + ${maven.compiler.release} + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.2 + + false + + + + + + + + production + + true + + + + com.vaadin + flow-server-production-mode + + + + + + + com.vaadin + vaadin-maven-plugin + ${vaadin.version} + + + + prepare-frontend + build-frontend + + + + + + + + + + diff --git a/vaadin-addon-template/assembly/MANIFEST.MF b/vaadin-addon-template/assembly/MANIFEST.MF new file mode 100644 index 0000000..f798110 --- /dev/null +++ b/vaadin-addon-template/assembly/MANIFEST.MF @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +Vaadin-Package-Version: 1 +Vaadin-Addon: ${project.build.finalName}.${project.packaging} +Implementation-Vendor: ${organization.name} +Implementation-Title: ${project.name} +Implementation-Version: ${project.version} diff --git a/vaadin-addon-template/assembly/assembly.xml b/vaadin-addon-template/assembly/assembly.xml new file mode 100644 index 0000000..88b97a1 --- /dev/null +++ b/vaadin-addon-template/assembly/assembly.xml @@ -0,0 +1,42 @@ + + + game-card + + + zip + + + + false + + + + .. + + LICENSE + README.md + + + + target + + + *.jar + *.pdf + + + + + + + + assembly/MANIFEST.MF + META-INF + true + + + \ No newline at end of file diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml new file mode 100644 index 0000000..a7bb8b0 --- /dev/null +++ b/vaadin-addon-template/pom.xml @@ -0,0 +1,302 @@ + + + + 4.0.0 + + com.xdev-software + vaadin-addon-template + + jar + 1.0.0-SNAPSHOT + + DateRangePicker for Vaadin + DateRangePicker for Vaadin + https://github.com/xdev-software/vaadin-addon-template + + + https://github.com/xdev-software/vaadin-addon-template + https://github.com/xdev-software/vaadin-addon-template.git + + + 2020 + + + XDEV Software + https://xdev.software/en + + + + + XDEV Software + XDEV Software + https://xdev.software/en + + + + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + apache_v2 + + 11 + ${javaVersion} + + UTF-8 + UTF-8 + + + 23.1.4 + + + + + + com.vaadin + vaadin-bom + pom + import + ${vaadin.version} + + + + + + + + central + https://repo.maven.apache.org/maven2 + + false + + + + + + + + central + https://repo.maven.apache.org/maven2 + + false + + + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + com.vaadin + vaadin-core + + + + + + + + org.codehaus.mojo + license-maven-plugin + 2.0.0 + + + first + + update-file-header + + process-sources + + + src/main/java + src/test/java + + + + + + + + + com.vaadin + vaadin-maven-plugin + ${vaadin.version} + + + + prepare-frontend + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + ${maven.compiler.release} + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.0 + + + attach-javadocs + verify + + jar + + + + + true + none + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + verify + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.2 + + + true + + false + true + + + + 1 + + + + + + META-INF/VAADIN/ + + + + + + + + + ossrh + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + --pinentry-mode + loopback + + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://oss.sonatype.org/ + + 30 + true + + + + + + + directory + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.4.2 + + false + + assembly/assembly.xml + + + + + + single + + install + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.2 + + + + + META-INF/VAADIN/ + + + + + + + + + From 8eeb657a1e2e7eab70372aa194f571ddb5acb0ee Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 9 Aug 2022 09:53:39 +0200 Subject: [PATCH 11/99] Fix ``inceptionYear`` --- vaadin-addon-template-demo/pom.xml | 2 +- vaadin-addon-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index 2f428a7..685145e 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -10,7 +10,7 @@ 1.0.0-SNAPSHOT war - 2020 + 2022 XDEV Software diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml index a7bb8b0..8ab74c5 100644 --- a/vaadin-addon-template/pom.xml +++ b/vaadin-addon-template/pom.xml @@ -20,7 +20,7 @@ https://github.com/xdev-software/vaadin-addon-template.git - 2020 + 2022 XDEV Software From ce41e1e2c12cf37b30a901f49d18191484148490 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 9 Aug 2022 09:56:16 +0200 Subject: [PATCH 12/99] Use correct name --- vaadin-addon-template/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml index 8ab74c5..776f8e8 100644 --- a/vaadin-addon-template/pom.xml +++ b/vaadin-addon-template/pom.xml @@ -11,8 +11,8 @@ jar 1.0.0-SNAPSHOT - DateRangePicker for Vaadin - DateRangePicker for Vaadin + vaadin-addon-template + vaadin-addon-template https://github.com/xdev-software/vaadin-addon-template From aa6f09e4c60b841039dbd08752e39a711be20627 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Aug 2022 01:01:07 +0000 Subject: [PATCH 13/99] Bump vaadin.version from 23.1.4 to 23.1.6 Bumps `vaadin.version` from 23.1.4 to 23.1.6. Updates `vaadin-bom` from 23.1.4 to 23.1.6 Updates `vaadin-maven-plugin` from 23.1.4 to 23.1.6 --- updated-dependencies: - dependency-name: com.vaadin:vaadin-bom dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.vaadin:vaadin-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vaadin-addon-template-demo/pom.xml | 2 +- vaadin-addon-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index 685145e..0d602c0 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -34,7 +34,7 @@ UTF-8 - 23.1.4 + 23.1.6 diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml index 776f8e8..cda4549 100644 --- a/vaadin-addon-template/pom.xml +++ b/vaadin-addon-template/pom.xml @@ -53,7 +53,7 @@ UTF-8 - 23.1.4 + 23.1.6 From 78ff7bfd930a53093c7cea3353ba94e0624ef5f3 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Fri, 12 Aug 2022 13:42:03 +0200 Subject: [PATCH 14/99] Use better caching strategy --- .github/workflows/release.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 45ce499..e36d423 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,14 +19,7 @@ jobs: with: java-version: '11' distribution: 'temurin' - - - name: Cache local Maven repository - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + cache: 'maven' - name: Build with Maven run: mvn -B clean package -Pproduction From 3172498e8b97a64020d454318df5ef080fac6c5d Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Fri, 12 Aug 2022 13:44:49 +0200 Subject: [PATCH 15/99] Made poms more equal --- vaadin-addon-template/pom.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml index cda4549..e318bc9 100644 --- a/vaadin-addon-template/pom.xml +++ b/vaadin-addon-template/pom.xml @@ -2,14 +2,12 @@ - 4.0.0 com.xdev-software vaadin-addon-template - - jar 1.0.0-SNAPSHOT + jar vaadin-addon-template vaadin-addon-template From 801c2066472b25f90e96d6671167caafbb881301 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Fri, 12 Aug 2022 13:44:53 +0200 Subject: [PATCH 16/99] Made poms more equal --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 900d7cc..1285df9 100644 --- a/pom.xml +++ b/pom.xml @@ -2,13 +2,12 @@ - 4.0.0 com.xdev-software vaadin-addon-template-root - pom 1.0.0-SNAPSHOT + pom XDEV Software From 7eb2cef47bec8e513d8ce5d70db520a55d9a493c Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Fri, 12 Aug 2022 13:44:57 +0200 Subject: [PATCH 17/99] Made poms more equal --- vaadin-addon-template-demo/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index 0d602c0..f70abb9 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -4,7 +4,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.xdev-software vaadin-addon-template-demo 1.0.0-SNAPSHOT From d162d04e0f6ad8da58d55b3c8cda5c82de909e78 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 01:26:41 +0000 Subject: [PATCH 18/99] Bump maven-javadoc-plugin from 3.4.0 to 3.4.1 Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.4.0 to 3.4.1. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.4.0...maven-javadoc-plugin-3.4.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vaadin-addon-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml index e318bc9..3814e89 100644 --- a/vaadin-addon-template/pom.xml +++ b/vaadin-addon-template/pom.xml @@ -158,7 +158,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.0 + 3.4.1 attach-javadocs From 219488d344e12e470de5a6573d79b9df2cf31afd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Aug 2022 01:35:49 +0000 Subject: [PATCH 19/99] Bump vaadin.version from 23.1.6 to 23.1.7 Bumps `vaadin.version` from 23.1.6 to 23.1.7. Updates `vaadin-bom` from 23.1.6 to 23.1.7 Updates `vaadin-maven-plugin` from 23.1.6 to 23.1.7 --- updated-dependencies: - dependency-name: com.vaadin:vaadin-bom dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.vaadin:vaadin-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vaadin-addon-template-demo/pom.xml | 2 +- vaadin-addon-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index f70abb9..7e8f8ca 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -33,7 +33,7 @@ UTF-8 - 23.1.6 + 23.1.7 diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml index 3814e89..1c2ddbd 100644 --- a/vaadin-addon-template/pom.xml +++ b/vaadin-addon-template/pom.xml @@ -51,7 +51,7 @@ UTF-8 - 23.1.6 + 23.1.7 From d8a04d9f0bb87b4469e569279749ea13971a933c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 01:24:42 +0000 Subject: [PATCH 20/99] Bump maven-jar-plugin from 3.2.2 to 3.3.0 Bumps [maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.2.2 to 3.3.0. - [Release notes](https://github.com/apache/maven-jar-plugin/releases) - [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.2.2...maven-jar-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-jar-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- vaadin-addon-template/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml index 1c2ddbd..f517a33 100644 --- a/vaadin-addon-template/pom.xml +++ b/vaadin-addon-template/pom.xml @@ -190,7 +190,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.2 + 3.3.0 true @@ -283,7 +283,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.2 + 3.3.0 From 41733b434523a06321d65c9fbcdaaa9b39343436 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 01:24:47 +0000 Subject: [PATCH 21/99] Bump vaadin.version from 23.1.7 to 23.2.1 Bumps `vaadin.version` from 23.1.7 to 23.2.1. Updates `vaadin-bom` from 23.1.7 to 23.2.1 Updates `vaadin-maven-plugin` from 23.1.7 to 23.2.1 --- updated-dependencies: - dependency-name: com.vaadin:vaadin-bom dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.vaadin:vaadin-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- vaadin-addon-template-demo/pom.xml | 2 +- vaadin-addon-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index 7e8f8ca..276a2aa 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -33,7 +33,7 @@ UTF-8 - 23.1.7 + 23.2.1 diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml index 1c2ddbd..bbfd5d0 100644 --- a/vaadin-addon-template/pom.xml +++ b/vaadin-addon-template/pom.xml @@ -51,7 +51,7 @@ UTF-8 - 23.1.7 + 23.2.1 From 31d0222e7edd55d1d46cf4dfbdd9315376552fbd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 01:24:55 +0000 Subject: [PATCH 22/99] Bump jetty-maven-plugin from 10.0.11 to 10.0.12 Bumps [jetty-maven-plugin](https://github.com/eclipse/jetty.project) from 10.0.11 to 10.0.12. - [Release notes](https://github.com/eclipse/jetty.project/releases) - [Commits](https://github.com/eclipse/jetty.project/compare/jetty-10.0.11...jetty-10.0.12) --- updated-dependencies: - dependency-name: org.eclipse.jetty:jetty-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vaadin-addon-template-demo/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index 7e8f8ca..e58f1ba 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -73,7 +73,7 @@ org.eclipse.jetty jetty-maven-plugin - 10.0.11 + 10.0.12 1 From a3c1c02e033dae6269358783291ea25dd482e318 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 20 Sep 2022 10:58:50 +0200 Subject: [PATCH 23/99] Updated gitignore for Vaadin 23.2 (vite) --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index ae788cb..f807ee1 100644 --- a/.gitignore +++ b/.gitignore @@ -77,6 +77,8 @@ webpack.generated.js webpack.config.js tsconfig.json types.d.ts +vite.config.ts +vite.generated.ts /*/frontend/generated/ /*/frontend/index.html From 17d405a924309422867f57439791389fe5238df2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 00:43:16 +0000 Subject: [PATCH 24/99] Bump vaadin.version from 23.2.1 to 23.2.2 Bumps `vaadin.version` from 23.2.1 to 23.2.2. Updates `vaadin-bom` from 23.2.1 to 23.2.2 Updates `vaadin-maven-plugin` from 23.2.1 to 23.2.2 --- updated-dependencies: - dependency-name: com.vaadin:vaadin-bom dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.vaadin:vaadin-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vaadin-addon-template-demo/pom.xml | 2 +- vaadin-addon-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index f3b25d3..0c49c91 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -33,7 +33,7 @@ UTF-8 - 23.2.1 + 23.2.2 diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml index cad4331..cfdaf17 100644 --- a/vaadin-addon-template/pom.xml +++ b/vaadin-addon-template/pom.xml @@ -51,7 +51,7 @@ UTF-8 - 23.2.1 + 23.2.2 From 64f6b5b43d07f08eabc2dc95d9787bb5ebe221fa Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 29 Sep 2022 12:42:47 +0200 Subject: [PATCH 25/99] Improve protection against Java Annotation Processor Supply chain attack scenarios --- vaadin-addon-template-demo/pom.xml | 3 +++ vaadin-addon-template/pom.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index 0c49c91..fe4d344 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -96,6 +96,9 @@ 3.10.1 ${maven.compiler.release} + + -proc:none + diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml index cfdaf17..817327a 100644 --- a/vaadin-addon-template/pom.xml +++ b/vaadin-addon-template/pom.xml @@ -153,6 +153,9 @@ 3.10.1 ${maven.compiler.release} + + -proc:none + From 1d08f0190cffe2e7cb264b7cc18e460e4e3af487 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 01:41:14 +0000 Subject: [PATCH 26/99] Bump vaadin.version from 23.2.2 to 23.2.4 Bumps `vaadin.version` from 23.2.2 to 23.2.4. Updates `vaadin-bom` from 23.2.2 to 23.2.4 Updates `vaadin-maven-plugin` from 23.2.2 to 23.2.4 --- updated-dependencies: - dependency-name: com.vaadin:vaadin-bom dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.vaadin:vaadin-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vaadin-addon-template-demo/pom.xml | 2 +- vaadin-addon-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index fe4d344..ccafaea 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -33,7 +33,7 @@ UTF-8 - 23.2.2 + 23.2.4 diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml index 817327a..2e18775 100644 --- a/vaadin-addon-template/pom.xml +++ b/vaadin-addon-template/pom.xml @@ -51,7 +51,7 @@ UTF-8 - 23.2.2 + 23.2.4 From 79168ea97e82f6d8a29f90124b9f55b1cd308534 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 01:07:59 +0000 Subject: [PATCH 27/99] Bump jetty-maven-plugin from 10.0.12 to 10.0.13 Bumps [jetty-maven-plugin](https://github.com/eclipse/jetty.project) from 10.0.12 to 10.0.13. - [Release notes](https://github.com/eclipse/jetty.project/releases) - [Commits](https://github.com/eclipse/jetty.project/compare/jetty-10.0.12...jetty-10.0.13) --- updated-dependencies: - dependency-name: org.eclipse.jetty:jetty-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vaadin-addon-template-demo/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index ccafaea..d84106e 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -73,7 +73,7 @@ org.eclipse.jetty jetty-maven-plugin - 10.0.12 + 10.0.13 1 From f4bee41a7205bf98193e23baa65ba9d9c33514b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Jan 2023 00:34:29 +0000 Subject: [PATCH 28/99] Bump vaadin.version from 23.2.4 to 23.3.3 Bumps `vaadin.version` from 23.2.4 to 23.3.3. Updates `vaadin-bom` from 23.2.4 to 23.3.3 Updates `vaadin-maven-plugin` from 23.2.4 to 23.3.3 --- updated-dependencies: - dependency-name: com.vaadin:vaadin-bom dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.vaadin:vaadin-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- vaadin-addon-template-demo/pom.xml | 2 +- vaadin-addon-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index ccafaea..831197e 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -33,7 +33,7 @@ UTF-8 - 23.2.4 + 23.3.3 diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml index 2e18775..e85fbb9 100644 --- a/vaadin-addon-template/pom.xml +++ b/vaadin-addon-template/pom.xml @@ -51,7 +51,7 @@ UTF-8 - 23.2.4 + 23.3.3 From a8d025c575ba5f89aee4d69ac791f52024cce6be Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 11 Jan 2023 16:02:54 +0100 Subject: [PATCH 29/99] Update codestyles --- .idea/codeStyles/Project.xml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index ec7a61d..4e97375 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -26,6 +26,10 @@ + - - org.apache.maven.plugins - maven-war-plugin - 3.3.2 - - false - - @@ -140,6 +157,23 @@ + + org.springframework.boot + spring-boot-maven-plugin + + ${mainClass} + true + + + + repackage + + repackage + + package + + + diff --git a/vaadin-addon-template-demo/src/main/java/software/xdev/vaadin/Application.java b/vaadin-addon-template-demo/src/main/java/software/xdev/vaadin/Application.java new file mode 100644 index 0000000..f5a4d96 --- /dev/null +++ b/vaadin-addon-template-demo/src/main/java/software/xdev/vaadin/Application.java @@ -0,0 +1,22 @@ +package software.xdev.vaadin; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +import com.vaadin.flow.component.page.AppShellConfigurator; +import com.vaadin.flow.component.page.Push; +import com.vaadin.flow.spring.annotation.EnableVaadin; + + +@SpringBootApplication +@EnableVaadin +@Push +public class Application extends SpringBootServletInitializer implements AppShellConfigurator +{ + public static void main(final String[] args) + { + SpringApplication.run(Application.class, args); + } +} + From 5a56889400896e10f662bc05c28579f67bbcf637 Mon Sep 17 00:00:00 2001 From: AB Date: Fri, 27 Jan 2023 12:38:12 +0100 Subject: [PATCH 40/99] Update .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index f807ee1..eb79c2a 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,6 @@ ObjectStore/ .idea/codeStyles/* !.idea/codeStyles/codeStyleConfig.xml !.idea/codeStyles/Project.xml + +# Prohibit changes to managed run configuration +.run/* From ff6e247de93c9c6504e3c952b8cc7a659b44f1f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Jan 2023 11:40:57 +0000 Subject: [PATCH 41/99] Bump vaadin.version from 23.3.4 to 23.3.5 Bumps `vaadin.version` from 23.3.4 to 23.3.5. Updates `vaadin-bom` from 23.3.4 to 23.3.5 Updates `vaadin-maven-plugin` from 23.3.4 to 23.3.5 --- updated-dependencies: - dependency-name: com.vaadin:vaadin-bom dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.vaadin:vaadin-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vaadin-addon-template-demo/pom.xml | 2 +- vaadin-addon-template/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index f22b010..9f81e39 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -35,7 +35,7 @@ software.xdev.vaadin.Application - 23.3.4 + 23.3.5 2.7.7 diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml index 277f475..75e57c2 100644 --- a/vaadin-addon-template/pom.xml +++ b/vaadin-addon-template/pom.xml @@ -49,7 +49,7 @@ UTF-8 - 23.3.4 + 23.3.5 From 55a8e6908b77925f9285ee748b7a96654e02da4b Mon Sep 17 00:00:00 2001 From: AB Date: Fri, 27 Jan 2023 12:45:05 +0100 Subject: [PATCH 42/99] Introduce CONTRIBUTING.md --- CONTRIBUTING.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 51 +++++------------------------------------ 2 files changed, 65 insertions(+), 46 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..1f72af4 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,60 @@ +## Contributing + +We would absolutely love to get the community involved, and we welcome any form of contributions – comments and questions on different communication channels, issues and pull request in the repositories, and anything that you build and share using our components. + +### Get in touch with the team + +Twitter: https://twitter.com/xdevsoftware +
+Mail: opensource@xdev-software.de + +### Some ways to help: + +- **Report bugs**: File issues on GitHub. +- **Send pull requests**: If you want to contribute code, check out the development instructions below. + +We encourage you to read the [contribution instructions by GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing) also. + +## Developing + +### Software Requirements +You should have the following things installed: +* Git +* Java 11 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/)) +* Maven + +### Recommended setup +* Install ``IntelliJ`` (Community Edition is sufficient) + * Install the following plugins: + * [Save Actions](https://plugins.jetbrains.com/plugin/7642-save-actions) - Provides save actions, like running the formatter or adding ``final`` to fields + * [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis + * [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis + * Import the project + * Ensure that everything is encoded in ``UTF-8`` + * Ensure that the JDK/Java-Version is correct + * To enable AUTOMATIC reloading/restarting while developing and running the app do this (further information in " + SpringBoot-Devtools" section below; [Source](https://stackoverflow.com/q/33349456)): + * ``Settings > Build, Execution, Deployment > Compiler``:
+ Enable [``Build project automatically``](https://www.jetbrains.com/help/idea/compiling-applications.html#auto-build) + * ``Settings > Advanced Settings``:
+ Enable [``Allow auto-make to start even if developed application is currently running``](https://www.jetbrains.com/help/idea/advanced-settings.html#advanced_compiler) + * To launch the Demo execute the predefined (launch) configuration ``Run Demo`` + +#### [SpringBoot-Developer-Tools](https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.devtools) +... should automatically be enabled.
+If you are changing a file and build the project, parts of the app get restarted.
+Bigger changes may require a complete restart. + * [Vaadin automatically reloads the UI on each restart](https://vaadin.com/docs/latest/configuration/live-reload/spring-boot).
+ You can control this behavior with the ``vaadin.devmode.liveReload.enabled`` property (default: ``true``). + +## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/vaadin-addon-template/release.yml?branch=master)](https://github.com/xdev-software/vaadin-addon-template/actions/workflows/release.yml) + +Before releasing: +* Consider doing a [test-deployment](https://github.com/xdev-software/vaadin-addon-template/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing. +* Check the [changelog](CHANGELOG.md) + +If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes + +When the release is finished do the following: +* Merge the auto-generated PR (with the incremented version number) back into the ``develop`` +* Upload the generated release asset zip into the [Vaadin Directory](https://vaadin.com/directory) and update the component there diff --git a/README.md b/README.md index 865b0d4..0b41226 100644 --- a/README.md +++ b/README.md @@ -26,52 +26,11 @@ A Vaadin Template Repo ![demo](assets/demo.gif) +## Support +If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support). + +## Contributing +See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project. ## Dependencies and Licenses View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/vaadin-addon-template/dependencies/) - - -## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/vaadin-addon-template/release.yml?branch=master)](https://github.com/xdev-software/vaadin-addon-template/actions/workflows/release.yml) - -Before releasing: -* Consider doing a [test-deployment](https://github.com/xdev-software/vaadin-addon-template/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing. -* Check the [changelog](CHANGELOG.md) - -If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes - -When the release is finished do the following: -* Merge the auto-generated PR (with the incremented version number) back into the ``develop`` -* Upload the generated release asset zip into the [Vaadin Directory](https://vaadin.com/directory) and update the component there - - -## Developing - -### Software Requirements -You should have the following things installed: -* Git -* Java 11 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/)) -* Maven - -### Recommended setup -* Install ``IntelliJ`` (Community Edition is sufficient) - * Install the following plugins: - * [Save Actions](https://plugins.jetbrains.com/plugin/7642-save-actions) - Provides save actions, like running the formatter or adding ``final`` to fields - * [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis - * [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis - * Import the project - * Ensure that everything is encoded in ``UTF-8`` - * Ensure that the JDK/Java-Version is correct - * To enable AUTOMATIC reloading/restarting while developing and running the app do this (further information in " - SpringBoot-Devtools" section below; [Source](https://stackoverflow.com/q/33349456)): - * ``Settings > Build, Execution, Deployment > Compiler``:
- Enable [``Build project automatically``](https://www.jetbrains.com/help/idea/compiling-applications.html#auto-build) - * ``Settings > Advanced Settings``:
- Enable [``Allow auto-make to start even if developed application is currently running``](https://www.jetbrains.com/help/idea/advanced-settings.html#advanced_compiler) - * To launch the Demo execute the predefined (launch) configuration ``Run Demo`` - -#### [SpringBoot-Developer-Tools](https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.devtools) -... should automatically be enabled.
-If you are changing a file and build the project, parts of the app get restarted.
-Bigger changes may require a complete restart. - * [Vaadin automatically reloads the UI on each restart](https://vaadin.com/docs/latest/configuration/live-reload/spring-boot).
- You can control this behavior with the ``vaadin.devmode.liveReload.enabled`` property (default: ``true``).
\ No newline at end of file From ba4e89a5ae810b43d9bb7bc1e7a8451facb7448e Mon Sep 17 00:00:00 2001 From: AB Date: Fri, 27 Jan 2023 12:45:22 +0100 Subject: [PATCH 43/99] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1f72af4..03b6c73 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,7 @@ We encourage you to read the [contribution instructions by GitHub](https://guide ### Software Requirements You should have the following things installed: * Git -* Java 11 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/)) +* Java 11 or 17 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/)) * Maven ### Recommended setup From 1f164295ad4622921ad49527ca0f7b62244ff842 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 30 Jan 2023 10:32:48 +0100 Subject: [PATCH 44/99] Update dependabot.yml --- .github/dependabot.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5ae384c..2ea8f0a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -21,6 +21,6 @@ updates: time: "00:00" open-pull-requests-limit: 10 ignore: - - dependency-name: "org.eclipse.jetty:jetty-maven-plugin" - # Version 11+ requires jakarta.* instead of javax.* (see https://www.eclipse.org/jetty/download.php#what-jetty-version) - versions: ">=11.0.0" + - dependency-name: "org.springframework.boot:*" + # Version 3+ requires Vaadin 24 + versions: ">=3.0.0" From c2c0d5aefaa379a29aa1b2e7a641de2d9e5f01e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 09:36:06 +0000 Subject: [PATCH 45/99] Bump org.springframework.boot.version from 2.7.7 to 2.7.8 Bumps `org.springframework.boot.version` from 2.7.7 to 2.7.8. Updates `spring-boot-dependencies` from 2.7.7 to 2.7.8 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v2.7.7...v2.7.8) Updates `spring-boot-maven-plugin` from 2.7.7 to 2.7.8 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v2.7.7...v2.7.8) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-dependencies dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.springframework.boot:spring-boot-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vaadin-addon-template-demo/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index 9f81e39..00d52fe 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -37,7 +37,7 @@ 23.3.5 - 2.7.7 + 2.7.8 From 1de376b7b00f723465b385f9d3b42d3cee5b9570 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 30 Jan 2023 10:42:14 +0100 Subject: [PATCH 46/99] Revert "Update .gitignore" This reverts commit 5a56889400896e10f662bc05c28579f67bbcf637. --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index eb79c2a..f807ee1 100644 --- a/.gitignore +++ b/.gitignore @@ -109,6 +109,3 @@ ObjectStore/ .idea/codeStyles/* !.idea/codeStyles/codeStyleConfig.xml !.idea/codeStyles/Project.xml - -# Prohibit changes to managed run configuration -.run/* From 06442e12f353e5b7e8ecece442156d1e12554b7d Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 30 Jan 2023 11:16:34 +0100 Subject: [PATCH 47/99] Update pom.xml Fix logging --- vaadin-addon-template-demo/pom.xml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index 00d52fe..2a43ad2 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -73,10 +73,7 @@ vaadin-addon-template ${project.version} - - org.slf4j - slf4j-simple - + com.vaadin From 352e4334f8e36ae646ce1a716ca59102d58407ad Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 30 Jan 2023 11:25:14 +0100 Subject: [PATCH 48/99] Fork is deprecated/gone in SB 3.0.0 https://youtrack.jetbrains.com/issue/IDEA-306949 https://docs.spring.io/spring-boot/docs/2.7.8/maven-plugin/reference/htmlsingle/#run <-> https://docs.spring.io/spring-boot/docs/3.0.0/maven-plugin/reference/htmlsingle/#run --- vaadin-addon-template-demo/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml index 2a43ad2..7160f52 100644 --- a/vaadin-addon-template-demo/pom.xml +++ b/vaadin-addon-template-demo/pom.xml @@ -159,7 +159,6 @@ spring-boot-maven-plugin ${mainClass} - true From f4901ebbce917f035e5c2c1d22cd0e0428f7644a Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Thu, 2 Feb 2023 12:37:03 +0100 Subject: [PATCH 49/99] Formatter: Remove useless empty lines --- .idea/codeStyles/Project.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 4e97375..ffd40bd 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -34,7 +34,7 @@
- vaadin-addon-template - vaadin-addon-template-demo + universe-client + universe-client-demo diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml new file mode 100644 index 0000000..6328ce6 --- /dev/null +++ b/universe-client-demo/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + com.xdev-software + universe-client-demo + 1.0.0-SNAPSHOT + jar + + 2023 + + + XDEV Software + https://xdev.software + + + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + apache_v2 + + 11 + ${javaVersion} + ${javaVersion} + ${javaVersion} + + UTF-8 + UTF-8 + + + + + com.xdev-software + universe-client + ${project.version} + + + + + io.smallrye.config + smallrye-config + 3.1.3 + + + + org.apache.logging.log4j + log4j-core + 2.20.0 + + + diff --git a/universe-client-demo/src/main/resources/log4j2.xml b/universe-client-demo/src/main/resources/log4j2.xml new file mode 100644 index 0000000..ae17585 --- /dev/null +++ b/universe-client-demo/src/main/resources/log4j2.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + diff --git a/universe-client/pom.xml b/universe-client/pom.xml new file mode 100644 index 0000000..5f22ea6 --- /dev/null +++ b/universe-client/pom.xml @@ -0,0 +1,272 @@ + + + 4.0.0 + + com.xdev-software + universe-client + 1.0.0-SNAPSHOT + jar + + Sessionize API for Java + This library provides an easy Java-API to read data from the Universe GraphQL-API + https://github.com/xdev-software/universe-client + + + https://github.com/xdev-software/universe-client + https://github.com/xdev-software/universe-client.git + + + 2023 + + + XDEV Software + https://xdev.software + + + + + XDEV Software + XDEV Software + https://xdev.software + + + + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + 11 + ${javaVersion} + + UTF-8 + UTF-8 + + + + + + central + https://repo.maven.apache.org/maven2 + + false + + + + + + + + central + https://repo.maven.apache.org/maven2 + + false + + + + + + + com.fasterxml.jackson.core + jackson-databind + 2.14.2 + + + + + com.github.rholder + guava-retrying + 2.0.0 + + + + + + org.apache.httpcomponents + httpclient + 4.5.13 + + + + + + org.eclipse.microprofile + microprofile + 6.0 + pom + + + + org.apache.logging.log4j + log4j-api + 2.20.0 + + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + + com.mycila + license-maven-plugin + 4.1 + + + ${project.organization.url} + + + +
com/mycila/maven/plugin/license/templates/APACHE-2.txt
+ + src/main/java/** + src/test/java/** + +
+
+
+ + + first + + format + + process-sources + + +
+ + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + ${maven.compiler.release} + + -proc:none + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + + attach-javadocs + verify + + jar + + + + + true + none + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + verify + + jar-no-fork + + + + +
+
+ + + ossrh + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + --pinentry-mode + loopback + + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://oss.sonatype.org/ + + 30 + true + + + + + + + directory + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.5.0 + + false + + assembly/assembly.xml + + + + + + single + + install + + + + + + + +
diff --git a/universe-client/src/main/java/software/xdev/sched/HasLogger.java b/universe-client/src/main/java/software/xdev/sched/HasLogger.java new file mode 100644 index 0000000..c2f1b0f --- /dev/null +++ b/universe-client/src/main/java/software/xdev/sched/HasLogger.java @@ -0,0 +1,28 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.sched; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + + +public interface HasLogger +{ + default Logger getLogger() + { + return LogManager.getLogger(this.getClass()); + } +} diff --git a/vaadin-addon-template-demo/pom.xml b/vaadin-addon-template-demo/pom.xml deleted file mode 100644 index 3a41372..0000000 --- a/vaadin-addon-template-demo/pom.xml +++ /dev/null @@ -1,178 +0,0 @@ - - - 4.0.0 - - com.xdev-software - vaadin-addon-template-demo - 1.0.0-SNAPSHOT - jar - - 2022 - - - XDEV Software - https://xdev.software - - - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - - - - - apache_v2 - - 11 - ${javaVersion} - - UTF-8 - UTF-8 - - software.xdev.vaadin.Application - - - 23.3.6 - - 2.7.8 - - - - - - com.vaadin - vaadin-bom - pom - import - ${vaadin.version} - - - - - - - org.springframework.boot - spring-boot-dependencies - ${org.springframework.boot.version} - pom - import - - - - - - - com.vaadin - vaadin-core - - - com.xdev-software - vaadin-addon-template - ${project.version} - - - - - com.vaadin - vaadin-spring-boot-starter - - - org.springframework.boot - spring-boot-devtools - true - - - - - ${project.artifactId} - - - - - org.springframework.boot - spring-boot-maven-plugin - ${org.springframework.boot.version} - - - - - - - com.vaadin - vaadin-maven-plugin - ${vaadin.version} - - - - prepare-frontend - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.10.1 - - ${maven.compiler.release} - - -proc:none - - - - - - - - - production - - true - - - - com.vaadin - flow-server-production-mode - - - - - - - com.vaadin - vaadin-maven-plugin - ${vaadin.version} - - - - prepare-frontend - build-frontend - - - - - - org.springframework.boot - spring-boot-maven-plugin - - ${mainClass} - - - - repackage - - repackage - - package - - - - - - - - - diff --git a/vaadin-addon-template-demo/src/main/java/software/xdev/vaadin/Application.java b/vaadin-addon-template-demo/src/main/java/software/xdev/vaadin/Application.java deleted file mode 100644 index f5a4d96..0000000 --- a/vaadin-addon-template-demo/src/main/java/software/xdev/vaadin/Application.java +++ /dev/null @@ -1,22 +0,0 @@ -package software.xdev.vaadin; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; - -import com.vaadin.flow.component.page.AppShellConfigurator; -import com.vaadin.flow.component.page.Push; -import com.vaadin.flow.spring.annotation.EnableVaadin; - - -@SpringBootApplication -@EnableVaadin -@Push -public class Application extends SpringBootServletInitializer implements AppShellConfigurator -{ - public static void main(final String[] args) - { - SpringApplication.run(Application.class, args); - } -} - diff --git a/vaadin-addon-template/assembly/MANIFEST.MF b/vaadin-addon-template/assembly/MANIFEST.MF deleted file mode 100644 index f798110..0000000 --- a/vaadin-addon-template/assembly/MANIFEST.MF +++ /dev/null @@ -1,6 +0,0 @@ -Manifest-Version: 1.0 -Vaadin-Package-Version: 1 -Vaadin-Addon: ${project.build.finalName}.${project.packaging} -Implementation-Vendor: ${organization.name} -Implementation-Title: ${project.name} -Implementation-Version: ${project.version} diff --git a/vaadin-addon-template/assembly/assembly.xml b/vaadin-addon-template/assembly/assembly.xml deleted file mode 100644 index 88b97a1..0000000 --- a/vaadin-addon-template/assembly/assembly.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - game-card - - - zip - - - - false - - - - .. - - LICENSE - README.md - - - - target - - - *.jar - *.pdf - - - - - - - - assembly/MANIFEST.MF - META-INF - true - - - \ No newline at end of file diff --git a/vaadin-addon-template/pom.xml b/vaadin-addon-template/pom.xml deleted file mode 100644 index 290d170..0000000 --- a/vaadin-addon-template/pom.xml +++ /dev/null @@ -1,308 +0,0 @@ - - - 4.0.0 - - com.xdev-software - vaadin-addon-template - 1.0.0-SNAPSHOT - jar - - vaadin-addon-template - vaadin-addon-template - https://github.com/xdev-software/vaadin-addon-template - - - https://github.com/xdev-software/vaadin-addon-template - https://github.com/xdev-software/vaadin-addon-template.git - - - 2022 - - - XDEV Software - https://xdev.software - - - - - XDEV Software - XDEV Software - https://xdev.software - - - - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - 11 - ${javaVersion} - - UTF-8 - UTF-8 - - - 23.3.6 - - - - - - com.vaadin - vaadin-bom - pom - import - ${vaadin.version} - - - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - - - com.vaadin - vaadin-core - - - - - - - com.mycila - license-maven-plugin - 4.1 - - - ${project.organization.url} - - - -
com/mycila/maven/plugin/license/templates/APACHE-2.txt
- - src/main/java/** - src/test/java/** - -
-
-
- - - first - - format - - process-sources - - -
- - - - com.vaadin - vaadin-maven-plugin - ${vaadin.version} - - - - prepare-frontend - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.10.1 - - ${maven.compiler.release} - - -proc:none - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.1 - - - attach-javadocs - verify - - jar - - - - - true - none - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-sources - verify - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.3.0 - - - true - - false - true - - - - 1 - - - - - - META-INF/VAADIN/ - - - - -
-
- - - ossrh - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - sign-artifacts - verify - - sign - - - - - - --pinentry-mode - loopback - - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - true - - ossrh - https://oss.sonatype.org/ - - 30 - true - - - - - - - directory - - - - org.apache.maven.plugins - maven-assembly-plugin - 3.4.2 - - false - - assembly/assembly.xml - - - - - - single - - install - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.3.0 - - - - - META-INF/VAADIN/ - - - - - - - - -
From eccd7197117f4cb6181005fd279523c06f35c66a Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 1 Mar 2023 15:06:40 +0100 Subject: [PATCH 52/99] Gitignore fix --- .gitignore | 4 ++-- assets/demo.gif | Bin 14257 -> 0 bytes assets/demo.png | Bin 14257 -> 0 bytes 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 assets/demo.gif delete mode 100644 assets/demo.png diff --git a/.gitignore b/.gitignore index c8034aa..d8cbe4b 100644 --- a/.gitignore +++ b/.gitignore @@ -65,7 +65,7 @@ target/ #custom .flattened-pom.xml .tern-project -sched-client-demo/src/main/resources/META-INF/microprofile-config.properties +universe-client-demo/src/main/resources/META-INF/microprofile-config.properties # == IntelliJ == *.iml @@ -85,4 +85,4 @@ sched-client-demo/src/main/resources/META-INF/microprofile-config.properties !.idea/codeStyles/ .idea/codeStyles/* !.idea/codeStyles/codeStyleConfig.xml -!.idea/codeStyles/Project.xml \ No newline at end of file +!.idea/codeStyles/Project.xml diff --git a/assets/demo.gif b/assets/demo.gif deleted file mode 100644 index a5d9bad454d7b33bbff75213cf70fddcd316a031..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14257 zcmeI3X;c&E8pqSC*8>zq3tlTKCQ)&LFv$d2h9q3W4kl58g1FF-3>YC9OacL<#Ck|Y zi)>ZAf`A*h!NdES}d z{7=3;d)9D0rW=_X5eS6oUY@SL=x3e&WiSPO&-{8z0f7LTiv0o<0i4y45RupjL`X1f z6D^5AeSLrt-25{C8T@V>ew6&p8 zgjBjM(bmoevfr98QkP<o=M_CT>m;F}aacJ|PfQ2}BDb0GbUInCy%eGSEfHMFtBLh|CW` z!dc_D?=F_XN<PWp<7l!cEy7LgEu!(j<5 zRmf3iwBI@t384@~CJ`uDVu>IW1|p=P4B-9ZN3U=Es?k`Wu>>Y_`Rk=mKFYu34Dg7I|Wx-c2Q1mo$#bzw4q z3C7cf>%wFJ6O5+|*M-RdCKyi_t_za^Ofa4^urK-VhK#3f!0*eT0eUb z*)mv&GV}Ee9|=(?1u~fMCo>KIy5X*$I5CXy+#n|qKK)Gp`lPudei&V(uUYNqHaa@G zaN$B8kJs4Ps8Xp+OiXk-9r~k2qj7e24hjk?Dk{p&%>@7;B_&0x)glOzHBW;O2vf_w zTvz!;-|o$9&rDcmtWM)x?jOmG+P`FKUd5AR^@WFY!~W}yy99!U|Mp`dRyt zv-!z^ySSV8?SIN2=(J1axcA38#qI~RjGE?{odrBYFD7YA&1)c%QI@4^Usf!zWJ!}w zcldpKAcjGyPF4)E>(-81+OhAu6eRu9xkAJW>;e)JwF%*C+2NmU%$rw%1h6B%D@+~{VZ{(}0Ew6>X+1o9) zC3U}AqrE%31kR>aNrP-ebBff5e^4@Ax?ldiMBi$HnD)?k;vhkNBIEi6Z zJ#@CmbOC9_P0hBUBP*mnL7wSi_4QfzuRXV_VArpnS-WGYt?ed=og7oWc4b^z>Z9Yk zE1wy_Zw)xZ9lH#*)Y4IFQEdxkj4vnHHXC_d;Qdw7l;|IOj% z5r?~tWU*KHi5n%x3+Da9JgWTF6!zl&nD*i}b#(FE_@H|p+_IiFi;cBI*DdOm390+E zDQ+QhL#?W`SO&|eD+jn2E}h=ae@V~mXe>=`8=MPLF59WBMzoGs9LVjKJXpkiNs}U45NSQaH3zS==&%cm9cNznj&@=`Et2kdvqLojG^v`|jtrTW3BW zIKX0NZO+c^Ejr1R_GHhEDv9)e6bT&4t8_XPkfTXdBY_9+l(*H!-|U)Sdwu(hW>c9@ z&!uus^J7I*#^wVTzP{FwQ`OknbEM-^S;lt*6(Zx9e_EHP34?XdTOq?Qht_7FY?)SZ zJHXPhb+w_q*DPp5eQT+3TF{L1wg)nVPgdp5Ea{^kJ!)yBGD|-YU@2;m`zP-3uDfjd zG;HI4iqt29>89Y}t6`7-eMGUcpZ82lTpZPLtCXo;0L`AO^B!Vv+gp8-mM&esG?28M zRmiFLN zA63H_nzGbutq)Qq^uJ#WNwQ^E+UG)ld**t^+#@STYmnxsxf;HMe#@uTx0$!jb3^wj zj|9(qZ;x`XZt^^2ahgK0+DuO=$S~uZi%09Mn`eWiD+`7B`MK(Z^CnTD18Gx>cm`fS zRk`g+w>Nm`Px4Ndv|KVvhq^D$*~gzBSL^iP<+`6w z&iuPInfuoDSBj?hYHkIT2l8}g>B_SqdHHuQ^k$y0mMb6r%%3JnOvx!ZxJ8qBaZy`R orEAyH?}tq;|M7q2<11BJD#EH({_yj+o^(Cw<;Ha_WPh>ie-JZQGynhq diff --git a/assets/demo.png b/assets/demo.png deleted file mode 100644 index a5d9bad454d7b33bbff75213cf70fddcd316a031..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14257 zcmeI3X;c&E8pqSC*8>zq3tlTKCQ)&LFv$d2h9q3W4kl58g1FF-3>YC9OacL<#Ck|Y zi)>ZAf`A*h!NdES}d z{7=3;d)9D0rW=_X5eS6oUY@SL=x3e&WiSPO&-{8z0f7LTiv0o<0i4y45RupjL`X1f z6D^5AeSLrt-25{C8T@V>ew6&p8 zgjBjM(bmoevfr98QkP<o=M_CT>m;F}aacJ|PfQ2}BDb0GbUInCy%eGSEfHMFtBLh|CW` z!dc_D?=F_XN<PWp<7l!cEy7LgEu!(j<5 zRmf3iwBI@t384@~CJ`uDVu>IW1|p=P4B-9ZN3U=Es?k`Wu>>Y_`Rk=mKFYu34Dg7I|Wx-c2Q1mo$#bzw4q z3C7cf>%wFJ6O5+|*M-RdCKyi_t_za^Ofa4^urK-VhK#3f!0*eT0eUb z*)mv&GV}Ee9|=(?1u~fMCo>KIy5X*$I5CXy+#n|qKK)Gp`lPudei&V(uUYNqHaa@G zaN$B8kJs4Ps8Xp+OiXk-9r~k2qj7e24hjk?Dk{p&%>@7;B_&0x)glOzHBW;O2vf_w zTvz!;-|o$9&rDcmtWM)x?jOmG+P`FKUd5AR^@WFY!~W}yy99!U|Mp`dRyt zv-!z^ySSV8?SIN2=(J1axcA38#qI~RjGE?{odrBYFD7YA&1)c%QI@4^Usf!zWJ!}w zcldpKAcjGyPF4)E>(-81+OhAu6eRu9xkAJW>;e)JwF%*C+2NmU%$rw%1h6B%D@+~{VZ{(}0Ew6>X+1o9) zC3U}AqrE%31kR>aNrP-ebBff5e^4@Ax?ldiMBi$HnD)?k;vhkNBIEi6Z zJ#@CmbOC9_P0hBUBP*mnL7wSi_4QfzuRXV_VArpnS-WGYt?ed=og7oWc4b^z>Z9Yk zE1wy_Zw)xZ9lH#*)Y4IFQEdxkj4vnHHXC_d;Qdw7l;|IOj% z5r?~tWU*KHi5n%x3+Da9JgWTF6!zl&nD*i}b#(FE_@H|p+_IiFi;cBI*DdOm390+E zDQ+QhL#?W`SO&|eD+jn2E}h=ae@V~mXe>=`8=MPLF59WBMzoGs9LVjKJXpkiNs}U45NSQaH3zS==&%cm9cNznj&@=`Et2kdvqLojG^v`|jtrTW3BW zIKX0NZO+c^Ejr1R_GHhEDv9)e6bT&4t8_XPkfTXdBY_9+l(*H!-|U)Sdwu(hW>c9@ z&!uus^J7I*#^wVTzP{FwQ`OknbEM-^S;lt*6(Zx9e_EHP34?XdTOq?Qht_7FY?)SZ zJHXPhb+w_q*DPp5eQT+3TF{L1wg)nVPgdp5Ea{^kJ!)yBGD|-YU@2;m`zP-3uDfjd zG;HI4iqt29>89Y}t6`7-eMGUcpZ82lTpZPLtCXo;0L`AO^B!Vv+gp8-mM&esG?28M zRmiFLN zA63H_nzGbutq)Qq^uJ#WNwQ^E+UG)ld**t^+#@STYmnxsxf;HMe#@uTx0$!jb3^wj zj|9(qZ;x`XZt^^2ahgK0+DuO=$S~uZi%09Mn`eWiD+`7B`MK(Z^CnTD18Gx>cm`fS zRk`g+w>Nm`Px4Ndv|KVvhq^D$*~gzBSL^iP<+`6w z&iuPInfuoDSBj?hYHkIT2l8}g>B_SqdHHuQ^k$y0mMb6r%%3JnOvx!ZxJ8qBaZy`R orEAyH?}tq;|M7q2<11BJD#EH({_yj+o^(Cw<;Ha_WPh>ie-JZQGynhq From 503dfff157704ad245cae8faa5aa48aabde6a1bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Mar 2023 14:07:13 +0000 Subject: [PATCH 53/99] Bump maven-compiler-plugin from 3.10.1 to 3.11.0 Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.10.1 to 3.11.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.10.1...maven-compiler-plugin-3.11.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- universe-client/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/universe-client/pom.xml b/universe-client/pom.xml index 5f22ea6..d2b911e 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -156,7 +156,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.11.0 ${maven.compiler.release} From b88ad6f52dee0d3af51cefe6a92ab4c05e0131df Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 1 Mar 2023 14:07:52 +0000 Subject: [PATCH 54/99] Release 1.0.0 --- pom.xml | 2 +- universe-client-demo/pom.xml | 2 +- universe-client/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 82d195a..da2a077 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.xdev-software universe-client-root - 1.0.0-SNAPSHOT + 1.0.0 pom diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index 6328ce6..76b59e2 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -6,7 +6,7 @@ com.xdev-software universe-client-demo - 1.0.0-SNAPSHOT + 1.0.0 jar 2023 diff --git a/universe-client/pom.xml b/universe-client/pom.xml index 5f22ea6..2c5725d 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -6,7 +6,7 @@ com.xdev-software universe-client - 1.0.0-SNAPSHOT + 1.0.0 jar Sessionize API for Java From 6ab5764991e0c9782773b55e83b856a43e6fb36b Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 1 Mar 2023 15:37:20 +0100 Subject: [PATCH 55/99] First test --- .../software/xdev/universe/demo/Demo.java | 19 +++++ universe-client/pom.xml | 23 +----- .../xdev/{sched => universe}/HasLogger.java | 2 +- .../xdev/universe/UniverseApiException.java | 29 +++++++ .../xdev/universe/UniverseClient.java | 82 +++++++++++++++++++ 5 files changed, 135 insertions(+), 20 deletions(-) create mode 100644 universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java rename universe-client/src/main/java/software/xdev/{sched => universe}/HasLogger.java (96%) create mode 100644 universe-client/src/main/java/software/xdev/universe/UniverseApiException.java create mode 100644 universe-client/src/main/java/software/xdev/universe/UniverseClient.java diff --git a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java new file mode 100644 index 0000000..5a45e14 --- /dev/null +++ b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java @@ -0,0 +1,19 @@ +package software.xdev.universe.demo; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import software.xdev.universe.UniverseApiException; +import software.xdev.universe.UniverseClient; + + +public class Demo +{ + private static final Logger logger = LogManager.getLogger(Demo.class); + + public static void main(final String[] args) throws UniverseApiException + { + final UniverseClient client = new UniverseClient(); + logger.info(client.main()); + } +} diff --git a/universe-client/pom.xml b/universe-client/pom.xml index 5f22ea6..5925f27 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -9,7 +9,7 @@ 1.0.0-SNAPSHOT jar - Sessionize API for Java + Universe API for Java This library provides an easy Java-API to read data from the Universe GraphQL-API https://github.com/xdev-software/universe-client @@ -75,24 +75,9 @@ - com.fasterxml.jackson.core - jackson-databind - 2.14.2 - - - - - com.github.rholder - guava-retrying - 2.0.0 - - - - - - org.apache.httpcomponents - httpclient - 4.5.13 + com.graphql-java + graphql-java + 20.0 diff --git a/universe-client/src/main/java/software/xdev/sched/HasLogger.java b/universe-client/src/main/java/software/xdev/universe/HasLogger.java similarity index 96% rename from universe-client/src/main/java/software/xdev/sched/HasLogger.java rename to universe-client/src/main/java/software/xdev/universe/HasLogger.java index c2f1b0f..addd1c1 100644 --- a/universe-client/src/main/java/software/xdev/sched/HasLogger.java +++ b/universe-client/src/main/java/software/xdev/universe/HasLogger.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package software.xdev.sched; +package software.xdev.universe; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/universe-client/src/main/java/software/xdev/universe/UniverseApiException.java b/universe-client/src/main/java/software/xdev/universe/UniverseApiException.java new file mode 100644 index 0000000..1343f1f --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/UniverseApiException.java @@ -0,0 +1,29 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe; + +public class UniverseApiException extends Exception +{ + public UniverseApiException(final String message) + { + super(message); + } + + public UniverseApiException(final String errorMessage, final Exception e) + { + super(errorMessage, e); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java new file mode 100644 index 0000000..d019a92 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java @@ -0,0 +1,82 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe; + +import static graphql.schema.idl.RuntimeWiring.newRuntimeWiring; + +import org.eclipse.microprofile.config.ConfigProvider; + +import graphql.ExecutionResult; +import graphql.GraphQL; +import graphql.schema.GraphQLSchema; +import graphql.schema.StaticDataFetcher; +import graphql.schema.idl.RuntimeWiring; +import graphql.schema.idl.SchemaGenerator; +import graphql.schema.idl.SchemaParser; +import graphql.schema.idl.TypeDefinitionRegistry; + + +/** + * Client to communicate with the sessionize API. + */ +public class UniverseClient +{ + public static final String PROPERTY_SESSIONIZE_API_KEY = "universe.api.key"; + public static final String FAILED_TO_EXECUTE_CALL_TO_SESSIONIZE_API = "Failed to execute call to Sessionize-API."; + + private String apiKey = null; + + public UniverseClient withApiKey(final String apiKey) + { + this.apiKey = apiKey; + return this; + } + + private String getApiKey() + { + if(this.apiKey == null) + { + this.apiKey = ConfigProvider.getConfig().getValue(PROPERTY_SESSIONIZE_API_KEY, String.class); + if(this.apiKey == null) + { + throw new RuntimeException( + "Sessionize API-Key not configured. Please set Property '" + PROPERTY_SESSIONIZE_API_KEY + + "' in the properties or call method #withApiKey."); + } + } + return this.apiKey; + } + + public String main() + { + String schema = "type Query{hello: String}"; + + SchemaParser schemaParser = new SchemaParser(); + TypeDefinitionRegistry typeDefinitionRegistry = schemaParser.parse(schema); + + RuntimeWiring runtimeWiring = newRuntimeWiring() + .type("Query", builder -> builder.dataFetcher("hello", new StaticDataFetcher("world"))) + .build(); + + SchemaGenerator schemaGenerator = new SchemaGenerator(); + GraphQLSchema graphQLSchema = schemaGenerator.makeExecutableSchema(typeDefinitionRegistry, runtimeWiring); + + GraphQL build = GraphQL.newGraphQL(graphQLSchema).build(); + ExecutionResult executionResult = build.execute("{hello}"); + + return executionResult.getData().toString(); + } +} From d1c212fcdb5c546a216f1352bf37f8eeabda935a Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 1 Mar 2023 16:14:41 +0100 Subject: [PATCH 56/99] First try for client --- .../software/xdev/universe/demo/Demo.java | 5 +- universe-client/pom.xml | 8 ++ .../xdev/universe/UniverseClient.java | 106 +++++++++++++----- 3 files changed, 90 insertions(+), 29 deletions(-) diff --git a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java index 5a45e14..77121a5 100644 --- a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java +++ b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java @@ -1,5 +1,8 @@ package software.xdev.universe.demo; +import java.io.IOException; +import java.net.URISyntaxException; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -11,7 +14,7 @@ public class Demo { private static final Logger logger = LogManager.getLogger(Demo.class); - public static void main(final String[] args) throws UniverseApiException + public static void main(final String[] args) throws UniverseApiException, IOException, URISyntaxException { final UniverseClient client = new UniverseClient(); logger.info(client.main()); diff --git a/universe-client/pom.xml b/universe-client/pom.xml index 5925f27..f1e34b7 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -80,6 +80,14 @@ 20.0 + + + org.apache.httpcomponents + httpclient + 4.5.14 + + + diff --git a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java index d019a92..a81278d 100644 --- a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java +++ b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java @@ -15,19 +15,22 @@ */ package software.xdev.universe; -import static graphql.schema.idl.RuntimeWiring.newRuntimeWiring; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; +import java.util.stream.Collectors; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; import org.eclipse.microprofile.config.ConfigProvider; -import graphql.ExecutionResult; -import graphql.GraphQL; -import graphql.schema.GraphQLSchema; -import graphql.schema.StaticDataFetcher; -import graphql.schema.idl.RuntimeWiring; -import graphql.schema.idl.SchemaGenerator; -import graphql.schema.idl.SchemaParser; -import graphql.schema.idl.TypeDefinitionRegistry; - /** * Client to communicate with the sessionize API. @@ -36,9 +39,48 @@ public class UniverseClient { public static final String PROPERTY_SESSIONIZE_API_KEY = "universe.api.key"; public static final String FAILED_TO_EXECUTE_CALL_TO_SESSIONIZE_API = "Failed to execute call to Sessionize-API."; - + public static final String UNIVERSE_GRAPHQL_URL = "https://www.universe.com/graphql"; private String apiKey = null; + public static final String requestBuyers(String eventId) + { + return " \"query\": \"query GraphqlExample {\n" + + " event(id: " + eventId + ") {\n" + + " orders {\n" + + " totalCount\n" + + " nodes(limit: 2) {\n" + + " id\n" + + " state\n" + + " createdAt\n" + + " orderItems {\n" + + " totalCount\n" + + " }\n" + + " timeSlot {\n" + + " startAt\n" + + " endAt\n" + + " }\n" + + " buyer {\n" + + " name\n" + + " email\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + " }\""; + } + + public static CloseableHttpResponse callGraphQLService(String url, String query) + throws URISyntaxException, IOException + { + CloseableHttpClient client = HttpClientBuilder.create().build(); + HttpGet request = new HttpGet(url); + URI uri = new URIBuilder(request.getURI()) + .addParameter("query", query) + .build(); + request.setURI(uri); + return client.execute(request); + } + public UniverseClient withApiKey(final String apiKey) { this.apiKey = apiKey; @@ -60,23 +102,31 @@ private String getApiKey() return this.apiKey; } - public String main() + public String main() throws IOException, URISyntaxException { - String schema = "type Query{hello: String}"; - - SchemaParser schemaParser = new SchemaParser(); - TypeDefinitionRegistry typeDefinitionRegistry = schemaParser.parse(schema); - - RuntimeWiring runtimeWiring = newRuntimeWiring() - .type("Query", builder -> builder.dataFetcher("hello", new StaticDataFetcher("world"))) - .build(); - - SchemaGenerator schemaGenerator = new SchemaGenerator(); - GraphQLSchema graphQLSchema = schemaGenerator.makeExecutableSchema(typeDefinitionRegistry, runtimeWiring); - - GraphQL build = GraphQL.newGraphQL(graphQLSchema).build(); - ExecutionResult executionResult = build.execute("{hello}"); - - return executionResult.getData().toString(); + HttpResponse httpResponse = callGraphQLService(UNIVERSE_GRAPHQL_URL, requestBuyers("63d23a98cf489d0021b396b3" + )); + try(BufferedReader reader = new BufferedReader(new InputStreamReader(httpResponse.getEntity() + .getContent(), StandardCharsets.UTF_8))) + { + return reader.lines().parallel().collect(Collectors.joining("\n")); + } + // + // String schema = "type Query{hello: String}"; + // + // SchemaParser schemaParser = new SchemaParser(); + // TypeDefinitionRegistry typeDefinitionRegistry = schemaParser.parse(schema); + // + // RuntimeWiring runtimeWiring = newRuntimeWiring() + // .type("Query", builder -> builder.dataFetcher("hello", new StaticDataFetcher("world"))) + // .build(); + // + // SchemaGenerator schemaGenerator = new SchemaGenerator(); + // GraphQLSchema graphQLSchema = schemaGenerator.makeExecutableSchema(typeDefinitionRegistry, runtimeWiring); + // + // GraphQL build = GraphQL.newGraphQL(graphQLSchema).build(); + // ExecutionResult executionResult = build.execute("{hello}"); + // + // return executionResult.getData().toString(); } } From d5f614d9184c3287449a22b9f8e00a18b1544cf5 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 1 Mar 2023 16:16:22 +0100 Subject: [PATCH 57/99] Revert "Release 1.0.0" This reverts commit b88ad6f52dee0d3af51cefe6a92ab4c05e0131df. --- pom.xml | 2 +- universe-client-demo/pom.xml | 2 +- universe-client/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index da2a077..82d195a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.xdev-software universe-client-root - 1.0.0 + 1.0.0-SNAPSHOT pom diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index 76b59e2..6328ce6 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -6,7 +6,7 @@ com.xdev-software universe-client-demo - 1.0.0 + 1.0.0-SNAPSHOT jar 2023 diff --git a/universe-client/pom.xml b/universe-client/pom.xml index c3e70f6..f1e34b7 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -6,7 +6,7 @@ com.xdev-software universe-client - 1.0.0 + 1.0.0-SNAPSHOT jar Universe API for Java From 8a22da90912c2e4fe2a1363ad5820b3e51292fd5 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 2 Mar 2023 12:42:33 +0100 Subject: [PATCH 58/99] First working version --- README.md | 19 ++ .../software/xdev/universe/demo/Demo.java | 10 +- .../microprofile-config-template.properties | 5 + .../src/main/resources/log4j2.xml | 2 +- universe-client/pom.xml | 10 + .../xdev/universe/UniverseApiException.java | 29 --- .../xdev/universe/UniverseClient.java | 235 ++++++++++++------ .../xdev/universe/UniverseConfiguration.java | 110 ++++++++ .../xdev/universe/dtos/get_buyers/Buyer.java | 229 +++++++++++++++++ .../xdev/universe/dtos/get_buyers/Data.java | 49 ++++ .../xdev/universe/dtos/get_buyers/Event.java | 49 ++++ .../xdev/universe/dtos/get_buyers/Node.java | 49 ++++ .../xdev/universe/dtos/get_buyers/Orders.java | 50 ++++ .../dtos/get_buyers/ResponseGetBuyers.java | 49 ++++ .../universe/requests/GetBuyersRequest.java | 58 +++++ .../universe/requests/UniverseRequest.java | 6 + 16 files changed, 844 insertions(+), 115 deletions(-) create mode 100644 universe-client-demo/src/main/resources/META-INF/microprofile-config-template.properties delete mode 100644 universe-client/src/main/java/software/xdev/universe/UniverseApiException.java create mode 100644 universe-client/src/main/java/software/xdev/universe/UniverseConfiguration.java create mode 100644 universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Buyer.java create mode 100644 universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Data.java create mode 100644 universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Event.java create mode 100644 universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Node.java create mode 100644 universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Orders.java create mode 100644 universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/ResponseGetBuyers.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/GetBuyersRequest.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/UniverseRequest.java diff --git a/README.md b/README.md index 6f0380d..02c6b69 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,25 @@ client.getAlluniverseSessions().forEach( ); ``` +## GraphQL +We are using the [Universe GraphQL API](https://developers.universe.com/docs/graphql). +Here are some thing to help with orientation with GraphQL. + +You can test requests on [Universes GraphiQL (Explorer)](https://www.universe.com/graphiql); + +Get Schema: +``` +{ + __schema { + queryType { + fields { + name + } + } + } +} +``` + ## Installation [Installation guide for the latest release](https://github.com/xdev-software/universe-client/releases/latest#Installation) diff --git a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java index 77121a5..3531a01 100644 --- a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java +++ b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java @@ -1,22 +1,24 @@ package software.xdev.universe.demo; import java.io.IOException; -import java.net.URISyntaxException; +import java.util.List; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import software.xdev.universe.UniverseApiException; import software.xdev.universe.UniverseClient; +import software.xdev.universe.dtos.get_buyers.Buyer; public class Demo { private static final Logger logger = LogManager.getLogger(Demo.class); - public static void main(final String[] args) throws UniverseApiException, IOException, URISyntaxException + public static void main(final String[] args) throws IOException { final UniverseClient client = new UniverseClient(); - logger.info(client.main()); + final List buyers = client.requestBuyersInEvent("EVENT_ID"); + logger.info("Amount of Buyers: " + buyers.size()); + buyers.forEach(buyer -> logger.info("Buyer: " + buyer.getName())); } } diff --git a/universe-client-demo/src/main/resources/META-INF/microprofile-config-template.properties b/universe-client-demo/src/main/resources/META-INF/microprofile-config-template.properties new file mode 100644 index 0000000..2cab8fe --- /dev/null +++ b/universe-client-demo/src/main/resources/META-INF/microprofile-config-template.properties @@ -0,0 +1,5 @@ +universe.application.id= +universe.application.secret= +universe.authorization.code= +universe.redirect.uri= +universe.bearer.token= diff --git a/universe-client-demo/src/main/resources/log4j2.xml b/universe-client-demo/src/main/resources/log4j2.xml index ae17585..1429811 100644 --- a/universe-client-demo/src/main/resources/log4j2.xml +++ b/universe-client-demo/src/main/resources/log4j2.xml @@ -9,7 +9,7 @@ - + diff --git a/universe-client/pom.xml b/universe-client/pom.xml index f1e34b7..00f22df 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -87,6 +87,16 @@ 4.5.14 + + commons-lang + commons-lang + 2.4 + + + com.fasterxml.jackson.core + jackson-databind + 2.14.2 + diff --git a/universe-client/src/main/java/software/xdev/universe/UniverseApiException.java b/universe-client/src/main/java/software/xdev/universe/UniverseApiException.java deleted file mode 100644 index 1343f1f..0000000 --- a/universe-client/src/main/java/software/xdev/universe/UniverseApiException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright © 2023 XDEV Software (https://xdev.software) - * - * 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 software.xdev.universe; - -public class UniverseApiException extends Exception -{ - public UniverseApiException(final String message) - { - super(message); - } - - public UniverseApiException(final String errorMessage, final Exception e) - { - super(errorMessage, e); - } -} diff --git a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java index a81278d..f4bc210 100644 --- a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java +++ b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java @@ -18,115 +18,188 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; -import java.net.URI; -import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; +import java.util.List; import java.util.stream.Collectors; import org.apache.http.HttpResponse; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.utils.URIBuilder; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClientBuilder; -import org.eclipse.microprofile.config.ConfigProvider; +import org.apache.http.client.HttpClient; +import org.apache.http.client.config.CookieSpecs; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.HttpClients; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import software.xdev.universe.dtos.get_buyers.Buyer; +import software.xdev.universe.dtos.get_buyers.ResponseGetBuyers; +import software.xdev.universe.requests.GetBuyersRequest; /** * Client to communicate with the sessionize API. */ -public class UniverseClient +public class UniverseClient implements HasLogger { - public static final String PROPERTY_SESSIONIZE_API_KEY = "universe.api.key"; - public static final String FAILED_TO_EXECUTE_CALL_TO_SESSIONIZE_API = "Failed to execute call to Sessionize-API."; public static final String UNIVERSE_GRAPHQL_URL = "https://www.universe.com/graphql"; - private String apiKey = null; + public static final String UNIVERSE_OAUTH_TOKEN = "https://www.universe.com/oauth/token"; + public static final String UNIVERSE_OAUTH_AUTHORIZE_URL = "https://www.universe.com/oauth/authorize"; - public static final String requestBuyers(String eventId) + private UniverseConfiguration config = new UniverseConfiguration(); + + private static final String requestToken( + final String applicationId, + final String applicationSecret, + final String authorizationCode, + final String redirectUri) { - return " \"query\": \"query GraphqlExample {\n" - + " event(id: " + eventId + ") {\n" - + " orders {\n" - + " totalCount\n" - + " nodes(limit: 2) {\n" - + " id\n" - + " state\n" - + " createdAt\n" - + " orderItems {\n" - + " totalCount\n" - + " }\n" - + " timeSlot {\n" - + " startAt\n" - + " endAt\n" - + " }\n" - + " buyer {\n" - + " name\n" - + " email\n" - + " }\n" - + " }\n" - + " }\n" - + " }\n" - + " }\""; + return "{ \"grant_type\": \"authorization_code\", \"client_id\":\"" + applicationId + "\", \"client_secret" + + "\":\"" + + applicationSecret + "\", \"redirect_uri\":\"" + redirectUri + "\", \"code\":\"" + authorizationCode + + "\"}"; } - public static CloseableHttpResponse callGraphQLService(String url, String query) - throws URISyntaxException, IOException + public UniverseClient withConfig(UniverseConfiguration config) { - CloseableHttpClient client = HttpClientBuilder.create().build(); - HttpGet request = new HttpGet(url); - URI uri = new URIBuilder(request.getURI()) - .addParameter("query", query) - .build(); - request.setURI(uri); - return client.execute(request); + this.config = config; + return this; } - public UniverseClient withApiKey(final String apiKey) + public UniverseConfiguration getConfig() { - this.apiKey = apiKey; - return this; + return this.config; } - private String getApiKey() + /** + * After authorization on the returned URL, the authorization code is displayed. We need this code to call + * {@link #getBearerToken()}. + * + * @return a url to call to get the {@link UniverseConfiguration#getAuthorizationCode()} + */ + public String getUrlToGetAuthorizationCode() { - if(this.apiKey == null) - { - this.apiKey = ConfigProvider.getConfig().getValue(PROPERTY_SESSIONIZE_API_KEY, String.class); - if(this.apiKey == null) - { - throw new RuntimeException( - "Sessionize API-Key not configured. Please set Property '" + PROPERTY_SESSIONIZE_API_KEY - + "' in the properties or call method #withApiKey."); - } - } - return this.apiKey; + return getUrlToGetAuthorizationCode( + getConfig().getApplicationId(), + getConfig().getRedirectUri() + ); + } + + /** + * After authorization on the returned URL, the authorization code is displayed. We need this code to call + * {@link #getBearerToken()}. + * + * @return a url to call to get the {@link UniverseConfiguration#getAuthorizationCode()} + */ + public String getUrlToGetAuthorizationCode( + final String applicationId, + final String redirectUri + ) + { + return UNIVERSE_OAUTH_AUTHORIZE_URL + "?" + + "response_type=code&" + + "scope=public&" + + "client_id=" + applicationId + + "&redirect_uri=" + redirectUri; + } + + public String getBearerToken() throws IOException + { + return getBearerToken( + getConfig().getApplicationId(), + getConfig().getApplicationSecret(), + getConfig().getAuthorizationCode(), + getConfig().getRedirectUri() + ); } - public String main() throws IOException, URISyntaxException + public String getBearerToken( + final String applicationId, + final String applicationSecret, + final String authorizationCode, + final String redirectUri + ) throws IOException { - HttpResponse httpResponse = callGraphQLService(UNIVERSE_GRAPHQL_URL, requestBuyers("63d23a98cf489d0021b396b3" - )); + return sendRequest( + sendPostMessage( + UNIVERSE_OAUTH_TOKEN, + requestToken( + applicationId, + applicationSecret, + authorizationCode, + redirectUri + ) + ) + ); + } + + public List requestBuyersInEvent(String eventId) throws IOException + { + final GetBuyersRequest getBuyersRequest = new GetBuyersRequest(); + final String responseAsString = sendRequest( + sendPostMessage( + UNIVERSE_GRAPHQL_URL, + getBuyersRequest.getQuery(eventId), + getConfig().getBearerToken() + ) + ); + final ResponseGetBuyers responseGetBuyers = + new ObjectMapper().readValue(responseAsString, getBuyersRequest.getResponseClass()); + return responseGetBuyers.getData() + .getEvent() + .getOrders() + .getNodes() + .stream() + .map(node -> node.getBuyer()) + .collect(Collectors.toList()); + } + + private String sendRequest(HttpResponse httpResponse) throws IOException + { + this.getLogger().debug("StatusCode: " + httpResponse.getStatusLine().getStatusCode()); try(BufferedReader reader = new BufferedReader(new InputStreamReader(httpResponse.getEntity() .getContent(), StandardCharsets.UTF_8))) { - return reader.lines().parallel().collect(Collectors.joining("\n")); + String responseString = reader.lines().parallel().collect(Collectors.joining("\n")); + this.getLogger().debug("ResponseString: " + responseString); + return responseString; } - // - // String schema = "type Query{hello: String}"; - // - // SchemaParser schemaParser = new SchemaParser(); - // TypeDefinitionRegistry typeDefinitionRegistry = schemaParser.parse(schema); - // - // RuntimeWiring runtimeWiring = newRuntimeWiring() - // .type("Query", builder -> builder.dataFetcher("hello", new StaticDataFetcher("world"))) - // .build(); - // - // SchemaGenerator schemaGenerator = new SchemaGenerator(); - // GraphQLSchema graphQLSchema = schemaGenerator.makeExecutableSchema(typeDefinitionRegistry, runtimeWiring); - // - // GraphQL build = GraphQL.newGraphQL(graphQLSchema).build(); - // ExecutionResult executionResult = build.execute("{hello}"); - // - // return executionResult.getData().toString(); + } + + private HttpResponse sendPostMessage( + final String urlToCall, + final String jsonData, + final String bearerToken) throws IOException + { + HttpClient httpClient = HttpClients.custom() + .setDefaultRequestConfig(RequestConfig.custom() + .setCookieSpec(CookieSpecs.STANDARD).build()) + .build(); + HttpPost con2 = new HttpPost(urlToCall); + con2.addHeader( + "Authorization", + "Bearer " + bearerToken); + con2.addHeader("Content-Type", "application/json"); + con2.setEntity(new StringEntity(jsonData, ContentType.APPLICATION_JSON)); + + this.getLogger().debug("Request: " + con2); + return httpClient.execute(con2); + } + + private HttpResponse sendPostMessage( + final String urlToCall, + final String jsonData) throws IOException + { + HttpClient httpClient = HttpClients.custom() + .setDefaultRequestConfig(RequestConfig.custom() + .setCookieSpec(CookieSpecs.STANDARD).build()) + .build(); + HttpPost con2 = new HttpPost(urlToCall); + con2.addHeader("Content-Type", "application/json"); + con2.setEntity(new StringEntity(jsonData, ContentType.APPLICATION_JSON)); + + this.getLogger().debug("Request: " + con2); + return httpClient.execute(con2); } } diff --git a/universe-client/src/main/java/software/xdev/universe/UniverseConfiguration.java b/universe-client/src/main/java/software/xdev/universe/UniverseConfiguration.java new file mode 100644 index 0000000..00e8787 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/UniverseConfiguration.java @@ -0,0 +1,110 @@ +package software.xdev.universe; + +import org.eclipse.microprofile.config.ConfigProvider; + + +public class UniverseConfiguration +{ + public static final String PROPERTY_KEY_APPLICATION_ID = "universe.application.id"; + public static final String PROPERTY_KEY_APPLICATION_SECRET = "universe.application.secret"; + public static final String PROPERTY_KEY_AUTHORIZATION_CODE = "universe.authorization.code"; + public static final String PROPERTY_KEY_REDIRECT_URI = "universe.redirect.uri"; + public static final String PROPERTY_KEY_BEARER_TOKEN = "universe.bearer.token"; + + private String applicationId; + private String applicationSecret; + private String authorizationCode; + private String redirectUri; + private String bearerToken; + + public UniverseConfiguration withApplicationId(final String applicationId) + { + this.applicationId = applicationId; + return this; + } + + public String getApplicationId() + { + if(this.applicationId == null) + { + this.applicationId = ConfigProvider.getConfig().getValue(PROPERTY_KEY_APPLICATION_ID, String.class); + return this.applicationId; + } + return this.applicationId; + } + + public UniverseConfiguration withApplicationSecret(final String applicationSecret) + { + this.applicationSecret = applicationSecret; + return this; + } + + public String getApplicationSecret() + { + if(this.applicationSecret == null) + { + this.applicationSecret = ConfigProvider.getConfig().getValue( + PROPERTY_KEY_APPLICATION_SECRET, + String.class); + return this.applicationSecret; + } + return this.applicationSecret; + } + + public UniverseConfiguration withAuthorizationCode(final String authorizationCode) + { + this.authorizationCode = authorizationCode; + return this; + } + + public String getAuthorizationCode() + { + if(this.authorizationCode == null) + { + this.authorizationCode = ConfigProvider.getConfig().getValue( + PROPERTY_KEY_AUTHORIZATION_CODE, + String.class); + return this.authorizationCode; + } + return this.authorizationCode; + } + + public UniverseConfiguration withRedirectUri(final String redirectUri) + { + this.redirectUri = redirectUri; + return this; + } + + /** + * Default value: {@code urn:ietf:wg:oauth:2.0:oob} which is the value for local calls. + */ + public String getRedirectUri() + { + if(this.redirectUri == null) + { + this.redirectUri = ConfigProvider.getConfig().getValue(PROPERTY_KEY_REDIRECT_URI, String.class); + if(this.redirectUri == null) + { + return "urn:ietf:wg:oauth:2.0:oob"; + } + return this.redirectUri; + } + return this.redirectUri; + } + + public UniverseConfiguration withBearerToken(final String bearerToken) + { + this.bearerToken = bearerToken; + return this; + } + + public String getBearerToken() + { + if(this.bearerToken == null) + { + this.bearerToken = ConfigProvider.getConfig().getValue(PROPERTY_KEY_BEARER_TOKEN, String.class); + return this.bearerToken; + } + return this.bearerToken; + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Buyer.java b/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Buyer.java new file mode 100644 index 0000000..776760f --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Buyer.java @@ -0,0 +1,229 @@ +package software.xdev.universe.dtos.get_buyers; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "id", + "name", + "firstName", + "lastName", + "email", + "businessEmail", + "businessAddress", + "businessPhoneNumber", + "isBusinessSeller", + "locale", + "description", + "avatarUrl", + "smallAvatarUrl" +}) +public class Buyer +{ + + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("id") + private String id; + @JsonProperty("name") + private String name; + @JsonProperty("firstName") + private String firstName; + @JsonProperty("lastName") + private String lastName; + @JsonProperty("email") + private String email; + @JsonProperty("businessEmail") + private Object businessEmail; + @JsonProperty("businessAddress") + private Object businessAddress; + @JsonProperty("businessPhoneNumber") + private Object businessPhoneNumber; + @JsonProperty("isBusinessSeller") + private Boolean isBusinessSeller; + @JsonProperty("locale") + private String locale; + @JsonProperty("description") + private Object description; + @JsonProperty("avatarUrl") + private Object avatarUrl; + @JsonProperty("smallAvatarUrl") + private Object smallAvatarUrl; + + @JsonProperty("id") + public String getId() + { + return id; + } + + @JsonProperty("id") + public void setId(String id) + { + this.id = id; + } + + @JsonProperty("name") + public String getName() + { + return name; + } + + @JsonProperty("name") + public void setName(String name) + { + this.name = name; + } + + @JsonProperty("firstName") + public String getFirstName() + { + return firstName; + } + + @JsonProperty("firstName") + public void setFirstName(String firstName) + { + this.firstName = firstName; + } + + @JsonProperty("lastName") + public String getLastName() + { + return lastName; + } + + @JsonProperty("lastName") + public void setLastName(String lastName) + { + this.lastName = lastName; + } + + @JsonProperty("email") + public String getEmail() + { + return email; + } + + @JsonProperty("email") + public void setEmail(String email) + { + this.email = email; + } + + @JsonProperty("businessEmail") + public Object getBusinessEmail() + { + return businessEmail; + } + + @JsonProperty("businessEmail") + public void setBusinessEmail(Object businessEmail) + { + this.businessEmail = businessEmail; + } + + @JsonProperty("businessAddress") + public Object getBusinessAddress() + { + return businessAddress; + } + + @JsonProperty("businessAddress") + public void setBusinessAddress(Object businessAddress) + { + this.businessAddress = businessAddress; + } + + @JsonProperty("businessPhoneNumber") + public Object getBusinessPhoneNumber() + { + return businessPhoneNumber; + } + + @JsonProperty("businessPhoneNumber") + public void setBusinessPhoneNumber(Object businessPhoneNumber) + { + this.businessPhoneNumber = businessPhoneNumber; + } + + @JsonProperty("isBusinessSeller") + public Boolean getIsBusinessSeller() + { + return isBusinessSeller; + } + + @JsonProperty("isBusinessSeller") + public void setIsBusinessSeller(Boolean isBusinessSeller) + { + this.isBusinessSeller = isBusinessSeller; + } + + @JsonProperty("locale") + public String getLocale() + { + return locale; + } + + @JsonProperty("locale") + public void setLocale(String locale) + { + this.locale = locale; + } + + @JsonProperty("description") + public Object getDescription() + { + return description; + } + + @JsonProperty("description") + public void setDescription(Object description) + { + this.description = description; + } + + @JsonProperty("avatarUrl") + public Object getAvatarUrl() + { + return avatarUrl; + } + + @JsonProperty("avatarUrl") + public void setAvatarUrl(Object avatarUrl) + { + this.avatarUrl = avatarUrl; + } + + @JsonProperty("smallAvatarUrl") + public Object getSmallAvatarUrl() + { + return smallAvatarUrl; + } + + @JsonProperty("smallAvatarUrl") + public void setSmallAvatarUrl(Object smallAvatarUrl) + { + this.smallAvatarUrl = smallAvatarUrl; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Data.java b/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Data.java new file mode 100644 index 0000000..8724e9d --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Data.java @@ -0,0 +1,49 @@ +package software.xdev.universe.dtos.get_buyers; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "event" +}) +public class Data +{ + + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("event") + private Event event; + + @JsonProperty("event") + public Event getEvent() + { + return event; + } + + @JsonProperty("event") + public void setEvent(Event event) + { + this.event = event; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Event.java b/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Event.java new file mode 100644 index 0000000..dc72781 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Event.java @@ -0,0 +1,49 @@ +package software.xdev.universe.dtos.get_buyers; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "orders" +}) +public class Event +{ + + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("orders") + private Orders orders; + + @JsonProperty("orders") + public Orders getOrders() + { + return orders; + } + + @JsonProperty("orders") + public void setOrders(Orders orders) + { + this.orders = orders; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Node.java b/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Node.java new file mode 100644 index 0000000..ab50261 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Node.java @@ -0,0 +1,49 @@ +package software.xdev.universe.dtos.get_buyers; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "buyer" +}) +public class Node +{ + + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("buyer") + private Buyer buyer; + + @JsonProperty("buyer") + public Buyer getBuyer() + { + return buyer; + } + + @JsonProperty("buyer") + public void setBuyer(Buyer buyer) + { + this.buyer = buyer; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Orders.java b/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Orders.java new file mode 100644 index 0000000..965bb90 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Orders.java @@ -0,0 +1,50 @@ +package software.xdev.universe.dtos.get_buyers; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "nodes" +}) +public class Orders +{ + + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("nodes") + private List nodes; + + @JsonProperty("nodes") + public List getNodes() + { + return nodes; + } + + @JsonProperty("nodes") + public void setNodes(List nodes) + { + this.nodes = nodes; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/ResponseGetBuyers.java b/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/ResponseGetBuyers.java new file mode 100644 index 0000000..b0ca6c1 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/ResponseGetBuyers.java @@ -0,0 +1,49 @@ +package software.xdev.universe.dtos.get_buyers; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "data" +}) +public class ResponseGetBuyers +{ + + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("data") + private Data data; + + @JsonProperty("data") + public Data getData() + { + return data; + } + + @JsonProperty("data") + public void setData(Data data) + { + this.data = data; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/GetBuyersRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/GetBuyersRequest.java new file mode 100644 index 0000000..91ccbb4 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/GetBuyersRequest.java @@ -0,0 +1,58 @@ +package software.xdev.universe.requests; + +import software.xdev.universe.dtos.get_buyers.ResponseGetBuyers; + + +public class GetBuyersRequest implements UniverseRequest +{ + @Override + public Class getResponseClass() + { + return ResponseGetBuyers.class; + } + + public final String getQuery(String eventId) + { + return "{ \"query\": \"{ event(id: \\\"" + eventId + "\\\") { orders { " + + "nodes(limit: 0) {" + + " buyer {" + + " id" + + " name" + + " firstName" + + " lastName" + + " email" + + " businessEmail" + + " businessAddress" + + " businessPhoneNumber" + + " isBusinessSeller" + + " locale" + + " description" + + " avatarUrl" + + " smallAvatarUrl" + + " }" + + " }" + + " } } }\"}"; + } + + // return "{ \"query\": \"{ event(id: \\\"" + eventId + "\\\") { orders { " + // + "nodes(limit: \\\"0\\\") {" + // + " buyer {" + // + " id" + // + " name" + // + " firstName" + // + " lastName" + // + " email" + // + " businessEmail" + // + " businessAddress" + // + " businessPhoneNumber" + // + " isBusinessSeller" + // + " locale" + // + " description" + // + " avatarUrl" + // + " smallAvatarUrl" + // + " }" + // + " }" + // + " } } }\"}"; +} + + diff --git a/universe-client/src/main/java/software/xdev/universe/requests/UniverseRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/UniverseRequest.java new file mode 100644 index 0000000..f659d99 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/UniverseRequest.java @@ -0,0 +1,6 @@ +package software.xdev.universe.requests; + +public interface UniverseRequest +{ + Class getResponseClass(); +} From 266d4afce43cb772d32c62504e442781d16d6b3f Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 2 Mar 2023 13:48:21 +0100 Subject: [PATCH 59/99] Expanded functionality --- .../software/xdev/universe/demo/Demo.java | 39 +++++- universe-client/pom.xml | 7 - .../xdev/universe/UniverseClient.java | 118 +++++++++++------ .../universe/requests/GetBuyersRequest.java | 58 -------- .../GetBearerTokenRequest.java | 27 ++++ .../GetBearerTokenResponse.java | 124 ++++++++++++++++++ .../{dtos => requests}/get_buyers/Buyer.java | 2 +- .../{dtos => requests}/get_buyers/Data.java | 2 +- .../{dtos => requests}/get_buyers/Event.java | 2 +- .../requests/get_buyers/GetBuyersRequest.java | 38 ++++++ .../get_buyers/GetBuyersResponse.java | 49 +++++++ .../{dtos => requests}/get_buyers/Node.java | 2 +- .../{dtos => requests}/get_buyers/Orders.java | 2 +- .../universe/requests/get_events/Data.java | 49 +++++++ .../universe/requests/get_events/Event.java | 94 +++++++++++++ .../universe/requests/get_events/Events.java | 50 +++++++ .../requests/get_events/GetEventsRequest.java | 31 +++++ .../get_events/GetEventsResponse.java | 48 +++++++ .../universe/requests/get_events/Host.java | 49 +++++++ .../xdev/universe/requests/get_host/Data.java | 49 +++++++ .../requests/get_host/GetHostRequest.java | 26 ++++ .../get_host/GetHostResponse.java} | 8 +- .../universe/requests/get_host/Viewer.java | 78 +++++++++++ 23 files changed, 834 insertions(+), 118 deletions(-) delete mode 100644 universe-client/src/main/java/software/xdev/universe/requests/GetBuyersRequest.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenRequest.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java rename universe-client/src/main/java/software/xdev/universe/{dtos => requests}/get_buyers/Buyer.java (98%) rename universe-client/src/main/java/software/xdev/universe/{dtos => requests}/get_buyers/Data.java (95%) rename universe-client/src/main/java/software/xdev/universe/{dtos => requests}/get_buyers/Event.java (95%) create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersResponse.java rename universe-client/src/main/java/software/xdev/universe/{dtos => requests}/get_buyers/Node.java (95%) rename universe-client/src/main/java/software/xdev/universe/{dtos => requests}/get_buyers/Orders.java (95%) create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_events/Data.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_events/Event.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_events/Events.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsResponse.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_events/Host.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_host/Data.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostRequest.java rename universe-client/src/main/java/software/xdev/universe/{dtos/get_buyers/ResponseGetBuyers.java => requests/get_host/GetHostResponse.java} (92%) create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_host/Viewer.java diff --git a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java index 3531a01..2ac0e18 100644 --- a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java +++ b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java @@ -1,24 +1,55 @@ package software.xdev.universe.demo; +import java.awt.Desktop; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.util.List; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import software.xdev.universe.UniverseClient; -import software.xdev.universe.dtos.get_buyers.Buyer; +import software.xdev.universe.requests.get_buyers.Buyer; +import software.xdev.universe.requests.get_events.Event; public class Demo { private static final Logger logger = LogManager.getLogger(Demo.class); - public static void main(final String[] args) throws IOException + public static void main(final String[] args) throws IOException, URISyntaxException { final UniverseClient client = new UniverseClient(); - final List buyers = client.requestBuyersInEvent("EVENT_ID"); - logger.info("Amount of Buyers: " + buyers.size()); + + // STEP 1: Get Authorization Code + // After getting the authorization code it must be set in the microprofile-config.properties + // or through client.getConfig().withAuthorizationCode() + openBrowserToGetAuthorizationCode(); + + // STEP 2: Get Bearer Token + // After getting the bearer token it must be set in the microprofile-config.properties + // or through client.getConfig().withBearerToken() + final String bearerToken = client.requestBearerToken(); + + // STEP 3: Get Host Id + final String hostId = client.requestHostId(); + + // STEP 4: Get Events + final List events = client.requestEvents(hostId); + events.forEach(event -> logger.info("Event: " + event.getTitle() + "(id:" + event.getId() + ")")); + + // STEP 5: Get Buyers + final List buyers = client.requestBuyersInEvent(events.get(0).getId()); buyers.forEach(buyer -> logger.info("Buyer: " + buyer.getName())); } + + private static void openBrowserToGetAuthorizationCode() throws URISyntaxException, IOException + { + final UniverseClient client = new UniverseClient(); + if(Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) + { + Desktop.getDesktop().browse(new URI(client.getUrlToGetAuthorizationCode())); + } + } } diff --git a/universe-client/pom.xml b/universe-client/pom.xml index 00f22df..bab0b5d 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -74,13 +74,6 @@ - - com.graphql-java - graphql-java - 20.0 - - - org.apache.httpcomponents httpclient diff --git a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java index f4bc210..9e631fa 100644 --- a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java +++ b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java @@ -33,9 +33,17 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import software.xdev.universe.dtos.get_buyers.Buyer; -import software.xdev.universe.dtos.get_buyers.ResponseGetBuyers; -import software.xdev.universe.requests.GetBuyersRequest; +import software.xdev.universe.requests.UniverseRequest; +import software.xdev.universe.requests.get_bearer_token.GetBearerTokenRequest; +import software.xdev.universe.requests.get_bearer_token.GetBearerTokenResponse; +import software.xdev.universe.requests.get_buyers.Buyer; +import software.xdev.universe.requests.get_buyers.GetBuyersRequest; +import software.xdev.universe.requests.get_buyers.GetBuyersResponse; +import software.xdev.universe.requests.get_events.Event; +import software.xdev.universe.requests.get_events.GetEventsRequest; +import software.xdev.universe.requests.get_events.GetEventsResponse; +import software.xdev.universe.requests.get_host.GetHostRequest; +import software.xdev.universe.requests.get_host.GetHostResponse; /** @@ -46,21 +54,9 @@ public class UniverseClient implements HasLogger public static final String UNIVERSE_GRAPHQL_URL = "https://www.universe.com/graphql"; public static final String UNIVERSE_OAUTH_TOKEN = "https://www.universe.com/oauth/token"; public static final String UNIVERSE_OAUTH_AUTHORIZE_URL = "https://www.universe.com/oauth/authorize"; - + private final ObjectMapper objectMapper = new ObjectMapper(); private UniverseConfiguration config = new UniverseConfiguration(); - private static final String requestToken( - final String applicationId, - final String applicationSecret, - final String authorizationCode, - final String redirectUri) - { - return "{ \"grant_type\": \"authorization_code\", \"client_id\":\"" + applicationId + "\", \"client_secret" - + "\":\"" - + applicationSecret + "\", \"redirect_uri\":\"" + redirectUri + "\", \"code\":\"" + authorizationCode - + "\"}"; - } - public UniverseClient withConfig(UniverseConfiguration config) { this.config = config; @@ -74,7 +70,7 @@ public UniverseConfiguration getConfig() /** * After authorization on the returned URL, the authorization code is displayed. We need this code to call - * {@link #getBearerToken()}. + * {@link #requestBearerToken()}. * * @return a url to call to get the {@link UniverseConfiguration#getAuthorizationCode()} */ @@ -88,7 +84,7 @@ public String getUrlToGetAuthorizationCode() /** * After authorization on the returned URL, the authorization code is displayed. We need this code to call - * {@link #getBearerToken()}. + * {@link #requestBearerToken()}. * * @return a url to call to get the {@link UniverseConfiguration#getAuthorizationCode()} */ @@ -104,9 +100,9 @@ public String getUrlToGetAuthorizationCode( + "&redirect_uri=" + redirectUri; } - public String getBearerToken() throws IOException + public String requestBearerToken() throws IOException { - return getBearerToken( + return requestBearerToken( getConfig().getApplicationId(), getConfig().getApplicationSecret(), getConfig().getAuthorizationCode(), @@ -114,38 +110,42 @@ public String getBearerToken() throws IOException ); } - public String getBearerToken( + public String requestBearerToken( final String applicationId, final String applicationSecret, final String authorizationCode, final String redirectUri ) throws IOException { - return sendRequest( - sendPostMessage( - UNIVERSE_OAUTH_TOKEN, - requestToken( - applicationId, - applicationSecret, - authorizationCode, - redirectUri + final GetBearerTokenRequest getBearerTokenRequest = new GetBearerTokenRequest(); + final GetBearerTokenResponse responseGetBearerToken = + sendRequestAndParseResponse( + getBearerTokenRequest, + sendPostMessage( + UNIVERSE_OAUTH_TOKEN, + getBearerTokenRequest.getQuery( + applicationId, + applicationSecret, + authorizationCode, + redirectUri + ) ) - ) - ); + ); + return responseGetBearerToken.getAccessToken(); } public List requestBuyersInEvent(String eventId) throws IOException { final GetBuyersRequest getBuyersRequest = new GetBuyersRequest(); - final String responseAsString = sendRequest( - sendPostMessage( - UNIVERSE_GRAPHQL_URL, - getBuyersRequest.getQuery(eventId), - getConfig().getBearerToken() - ) - ); - final ResponseGetBuyers responseGetBuyers = - new ObjectMapper().readValue(responseAsString, getBuyersRequest.getResponseClass()); + final GetBuyersResponse responseGetBuyers = + sendRequestAndParseResponse( + getBuyersRequest, + sendPostMessage( + UNIVERSE_GRAPHQL_URL, + getBuyersRequest.getQuery(eventId), + getConfig().getBearerToken() + ) + ); return responseGetBuyers.getData() .getEvent() .getOrders() @@ -155,6 +155,44 @@ public List requestBuyersInEvent(String eventId) throws IOException .collect(Collectors.toList()); } + public String requestHostId() throws IOException + { + final GetHostRequest getHostRequest = new GetHostRequest(); + final GetHostResponse getHostResponse = + sendRequestAndParseResponse( + getHostRequest, + sendPostMessage( + UNIVERSE_GRAPHQL_URL, + getHostRequest.getQuery(), + getConfig().getBearerToken() + ) + ); + return getHostResponse.getData().getViewer().getId(); + } + + public List requestEvents(String hostId) throws IOException + { + final GetEventsRequest getEventsRequest = new GetEventsRequest(); + final GetEventsResponse getEventsResponse = + sendRequestAndParseResponse( + getEventsRequest, + sendPostMessage( + UNIVERSE_GRAPHQL_URL, + getEventsRequest.getQuery(hostId), + getConfig().getBearerToken() + ) + ); + return getEventsResponse.getData().getHost().getEvents().getNodes(); + } + + private T sendRequestAndParseResponse( + UniverseRequest request, + HttpResponse httpResponse) throws IOException + { + final String responseAsString = sendRequest(httpResponse); + return objectMapper.readValue(responseAsString, request.getResponseClass()); + } + private String sendRequest(HttpResponse httpResponse) throws IOException { this.getLogger().debug("StatusCode: " + httpResponse.getStatusLine().getStatusCode()); diff --git a/universe-client/src/main/java/software/xdev/universe/requests/GetBuyersRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/GetBuyersRequest.java deleted file mode 100644 index 91ccbb4..0000000 --- a/universe-client/src/main/java/software/xdev/universe/requests/GetBuyersRequest.java +++ /dev/null @@ -1,58 +0,0 @@ -package software.xdev.universe.requests; - -import software.xdev.universe.dtos.get_buyers.ResponseGetBuyers; - - -public class GetBuyersRequest implements UniverseRequest -{ - @Override - public Class getResponseClass() - { - return ResponseGetBuyers.class; - } - - public final String getQuery(String eventId) - { - return "{ \"query\": \"{ event(id: \\\"" + eventId + "\\\") { orders { " - + "nodes(limit: 0) {" - + " buyer {" - + " id" - + " name" - + " firstName" - + " lastName" - + " email" - + " businessEmail" - + " businessAddress" - + " businessPhoneNumber" - + " isBusinessSeller" - + " locale" - + " description" - + " avatarUrl" - + " smallAvatarUrl" - + " }" - + " }" - + " } } }\"}"; - } - - // return "{ \"query\": \"{ event(id: \\\"" + eventId + "\\\") { orders { " - // + "nodes(limit: \\\"0\\\") {" - // + " buyer {" - // + " id" - // + " name" - // + " firstName" - // + " lastName" - // + " email" - // + " businessEmail" - // + " businessAddress" - // + " businessPhoneNumber" - // + " isBusinessSeller" - // + " locale" - // + " description" - // + " avatarUrl" - // + " smallAvatarUrl" - // + " }" - // + " }" - // + " } } }\"}"; -} - - diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenRequest.java new file mode 100644 index 0000000..becd90b --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenRequest.java @@ -0,0 +1,27 @@ +package software.xdev.universe.requests.get_bearer_token; + +import software.xdev.universe.requests.UniverseRequest; + + +public class GetBearerTokenRequest implements UniverseRequest +{ + @Override + public Class getResponseClass() + { + return GetBearerTokenResponse.class; + } + + public final String getQuery( + final String applicationId, + final String applicationSecret, + final String authorizationCode, + final String redirectUri) + { + return "{ \"grant_type\": \"authorization_code\", \"client_id\":\"" + applicationId + "\", \"client_secret" + + "\":\"" + + applicationSecret + "\", \"redirect_uri\":\"" + redirectUri + "\", \"code\":\"" + authorizationCode + + "\"}"; + } +} + + diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java new file mode 100644 index 0000000..824ae29 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java @@ -0,0 +1,124 @@ +package software.xdev.universe.requests.get_bearer_token; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "access_token", + "token_type", + "expires_in", + "refresh_token", + "scope", + "created_at" +}) +public class GetBearerTokenResponse +{ + + @JsonProperty("access_token") + private String accessToken; + @JsonProperty("token_type") + private String tokenType; + @JsonProperty("expires_in") + private Integer expiresIn; + @JsonProperty("refresh_token") + private String refreshToken; + @JsonProperty("scope") + private String scope; + @JsonProperty("created_at") + private Integer createdAt; + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + + @JsonProperty("access_token") + public String getAccessToken() + { + return accessToken; + } + + @JsonProperty("access_token") + public void setAccessToken(String accessToken) + { + this.accessToken = accessToken; + } + + @JsonProperty("token_type") + public String getTokenType() + { + return tokenType; + } + + @JsonProperty("token_type") + public void setTokenType(String tokenType) + { + this.tokenType = tokenType; + } + + @JsonProperty("expires_in") + public Integer getExpiresIn() + { + return expiresIn; + } + + @JsonProperty("expires_in") + public void setExpiresIn(Integer expiresIn) + { + this.expiresIn = expiresIn; + } + + @JsonProperty("refresh_token") + public String getRefreshToken() + { + return refreshToken; + } + + @JsonProperty("refresh_token") + public void setRefreshToken(String refreshToken) + { + this.refreshToken = refreshToken; + } + + @JsonProperty("scope") + public String getScope() + { + return scope; + } + + @JsonProperty("scope") + public void setScope(String scope) + { + this.scope = scope; + } + + @JsonProperty("created_at") + public Integer getCreatedAt() + { + return createdAt; + } + + @JsonProperty("created_at") + public void setCreatedAt(Integer createdAt) + { + this.createdAt = createdAt; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Buyer.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Buyer.java similarity index 98% rename from universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Buyer.java rename to universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Buyer.java index 776760f..be1d125 100644 --- a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Buyer.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Buyer.java @@ -1,4 +1,4 @@ -package software.xdev.universe.dtos.get_buyers; +package software.xdev.universe.requests.get_buyers; import java.util.LinkedHashMap; import java.util.Map; diff --git a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Data.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Data.java similarity index 95% rename from universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Data.java rename to universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Data.java index 8724e9d..b4b50f1 100644 --- a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Data.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Data.java @@ -1,4 +1,4 @@ -package software.xdev.universe.dtos.get_buyers; +package software.xdev.universe.requests.get_buyers; import java.util.LinkedHashMap; import java.util.Map; diff --git a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Event.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Event.java similarity index 95% rename from universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Event.java rename to universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Event.java index dc72781..782b5ad 100644 --- a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Event.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Event.java @@ -1,4 +1,4 @@ -package software.xdev.universe.dtos.get_buyers; +package software.xdev.universe.requests.get_buyers; import java.util.LinkedHashMap; import java.util.Map; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java new file mode 100644 index 0000000..8fdf335 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java @@ -0,0 +1,38 @@ +package software.xdev.universe.requests.get_buyers; + +import software.xdev.universe.requests.UniverseRequest; + + +public class GetBuyersRequest implements UniverseRequest +{ + @Override + public Class getResponseClass() + { + return GetBuyersResponse.class; + } + + public final String getQuery(String eventId) + { + return "{ \"query\": \"{ event(id: \\\"" + eventId + "\\\") { orders { " + + "nodes(limit: 0) {" + + " buyer {" + + " id" + + " name" + + " firstName" + + " lastName" + + " email" + + " businessEmail" + + " businessAddress" + + " businessPhoneNumber" + + " isBusinessSeller" + + " locale" + + " description" + + " avatarUrl" + + " smallAvatarUrl" + + " }" + + " }" + + " } } }\"}"; + } +} + + diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersResponse.java new file mode 100644 index 0000000..61f1d2f --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersResponse.java @@ -0,0 +1,49 @@ +package software.xdev.universe.requests.get_buyers; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "data" +}) +public class GetBuyersResponse +{ + + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("data") + private Data data; + + @JsonProperty("data") + public Data getData() + { + return data; + } + + @JsonProperty("data") + public void setData(Data data) + { + this.data = data; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Node.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Node.java similarity index 95% rename from universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Node.java rename to universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Node.java index ab50261..0838c91 100644 --- a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Node.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Node.java @@ -1,4 +1,4 @@ -package software.xdev.universe.dtos.get_buyers; +package software.xdev.universe.requests.get_buyers; import java.util.LinkedHashMap; import java.util.Map; diff --git a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Orders.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Orders.java similarity index 95% rename from universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Orders.java rename to universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Orders.java index 965bb90..54f8986 100644 --- a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/Orders.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Orders.java @@ -1,4 +1,4 @@ -package software.xdev.universe.dtos.get_buyers; +package software.xdev.universe.requests.get_buyers; import java.util.LinkedHashMap; import java.util.List; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Data.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Data.java new file mode 100644 index 0000000..eca1702 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Data.java @@ -0,0 +1,49 @@ +package software.xdev.universe.requests.get_events; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "host" +}) +public class Data +{ + + @JsonProperty("host") + private Host host; + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + + @JsonProperty("host") + public Host getHost() + { + return host; + } + + @JsonProperty("host") + public void setHost(Host host) + { + this.host = host; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Event.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Event.java new file mode 100644 index 0000000..552de08 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Event.java @@ -0,0 +1,94 @@ +package software.xdev.universe.requests.get_events; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "id", + "title", + "description", + "url" +}) +public class Event +{ + + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("id") + private String id; + @JsonProperty("title") + private String title; + @JsonProperty("description") + private String description; + @JsonProperty("url") + private String url; + + @JsonProperty("id") + public String getId() + { + return id; + } + + @JsonProperty("id") + public void setId(String id) + { + this.id = id; + } + + @JsonProperty("title") + public String getTitle() + { + return title; + } + + @JsonProperty("title") + public void setTitle(String title) + { + this.title = title; + } + + @JsonProperty("description") + public String getDescription() + { + return description; + } + + @JsonProperty("description") + public void setDescription(String description) + { + this.description = description; + } + + @JsonProperty("url") + public String getUrl() + { + return url; + } + + @JsonProperty("url") + public void setUrl(String url) + { + this.url = url; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Events.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Events.java new file mode 100644 index 0000000..ac5855a --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Events.java @@ -0,0 +1,50 @@ +package software.xdev.universe.requests.get_events; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "nodes" +}) +public class Events +{ + + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("nodes") + private List nodes; + + @JsonProperty("nodes") + public List getNodes() + { + return nodes; + } + + @JsonProperty("nodes") + public void setNodes(List nodes) + { + this.nodes = nodes; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java new file mode 100644 index 0000000..e51dfe3 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java @@ -0,0 +1,31 @@ +package software.xdev.universe.requests.get_events; + +import software.xdev.universe.requests.UniverseRequest; + + +public class GetEventsRequest implements UniverseRequest +{ + @Override + public Class getResponseClass() + { + return GetEventsResponse.class; + } + + public final String getQuery(final String hostId) + { + return "{ \"query\": \"{" + + " host(id: \\\"" + hostId + "\\\") {" + + " events {" + + " nodes {" + + " id" + + " title" + + " description" + + " url" + + " }" + + " }" + + " }" + + "}\"}"; + } +} + + diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsResponse.java new file mode 100644 index 0000000..2d669bc --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsResponse.java @@ -0,0 +1,48 @@ +package software.xdev.universe.requests.get_events; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "data" +}) +public class GetEventsResponse +{ + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("data") + private Data data; + + @JsonProperty("data") + public Data getData() + { + return data; + } + + @JsonProperty("data") + public void setData(Data data) + { + this.data = data; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Host.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Host.java new file mode 100644 index 0000000..aaefaca --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Host.java @@ -0,0 +1,49 @@ +package software.xdev.universe.requests.get_events; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "events" +}) +public class Host +{ + + @JsonProperty("events") + private Events events; + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + + @JsonProperty("events") + public Events getEvents() + { + return events; + } + + @JsonProperty("events") + public void setEvents(Events events) + { + this.events = events; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_host/Data.java b/universe-client/src/main/java/software/xdev/universe/requests/get_host/Data.java new file mode 100644 index 0000000..fcdba16 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_host/Data.java @@ -0,0 +1,49 @@ +package software.xdev.universe.requests.get_host; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "viewer" +}) +public class Data +{ + + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("viewer") + private Viewer viewer; + + @JsonProperty("viewer") + public Viewer getViewer() + { + return viewer; + } + + @JsonProperty("viewer") + public void setViewer(Viewer viewer) + { + this.viewer = viewer; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostRequest.java new file mode 100644 index 0000000..71e6bb9 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostRequest.java @@ -0,0 +1,26 @@ +package software.xdev.universe.requests.get_host; + +import software.xdev.universe.requests.UniverseRequest; + + +public class GetHostRequest implements UniverseRequest +{ + @Override + public Class getResponseClass() + { + return GetHostResponse.class; + } + + public final String getQuery() + { + return "{ \"query\": \"{" + + " viewer {" + + " id" + + " firstName" + + " lastName" + + " }" + + "}\"}"; + } +} + + diff --git a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/ResponseGetBuyers.java b/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostResponse.java similarity index 92% rename from universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/ResponseGetBuyers.java rename to universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostResponse.java index b0ca6c1..3b35928 100644 --- a/universe-client/src/main/java/software/xdev/universe/dtos/get_buyers/ResponseGetBuyers.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostResponse.java @@ -1,4 +1,4 @@ -package software.xdev.universe.dtos.get_buyers; +package software.xdev.universe.requests.get_host; import java.util.LinkedHashMap; import java.util.Map; @@ -15,13 +15,13 @@ @JsonPropertyOrder({ "data" }) -public class ResponseGetBuyers +public class GetHostResponse { - @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); @JsonProperty("data") private Data data; + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); @JsonProperty("data") public Data getData() diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_host/Viewer.java b/universe-client/src/main/java/software/xdev/universe/requests/get_host/Viewer.java new file mode 100644 index 0000000..1c7442c --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_host/Viewer.java @@ -0,0 +1,78 @@ +package software.xdev.universe.requests.get_host; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "id", + "firstName", + "lastName" +}) +public class Viewer +{ + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("id") + private String id; + @JsonProperty("firstName") + private String firstName; + @JsonProperty("lastName") + private Object lastName; + + @JsonProperty("id") + public String getId() + { + return id; + } + + @JsonProperty("id") + public void setId(String id) + { + this.id = id; + } + + @JsonProperty("firstName") + public String getFirstName() + { + return firstName; + } + + @JsonProperty("firstName") + public void setFirstName(String firstName) + { + this.firstName = firstName; + } + + @JsonProperty("lastName") + public Object getLastName() + { + return lastName; + } + + @JsonProperty("lastName") + public void setLastName(Object lastName) + { + this.lastName = lastName; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} From 48551780a6fe3d165d7e25b64aa65f1dd655c803 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 2 Mar 2023 14:54:56 +0100 Subject: [PATCH 60/99] Added limits and bearer token validUntil --- .../software/xdev/universe/demo/Demo.java | 17 ++++++++++---- .../xdev/universe/UniverseClient.java | 23 +++++++++++++++---- .../GetBearerTokenResponse.java | 13 +++++++++-- .../requests/get_buyers/GetBuyersRequest.java | 4 ++-- .../requests/get_events/GetEventsRequest.java | 4 ++-- 5 files changed, 46 insertions(+), 15 deletions(-) diff --git a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java index 2ac0e18..3d35bee 100644 --- a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java +++ b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java @@ -5,11 +5,13 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.List; +import java.util.Scanner; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import software.xdev.universe.UniverseClient; +import software.xdev.universe.requests.get_bearer_token.GetBearerTokenResponse; import software.xdev.universe.requests.get_buyers.Buyer; import software.xdev.universe.requests.get_events.Event; @@ -25,12 +27,14 @@ public static void main(final String[] args) throws IOException, URISyntaxExcept // STEP 1: Get Authorization Code // After getting the authorization code it must be set in the microprofile-config.properties // or through client.getConfig().withAuthorizationCode() - openBrowserToGetAuthorizationCode(); + final String authorizationCode = openBrowserToGetAuthorizationCodeAndWaitForInput(); + client.getConfig().withAuthorizationCode(authorizationCode); // STEP 2: Get Bearer Token // After getting the bearer token it must be set in the microprofile-config.properties // or through client.getConfig().withBearerToken() - final String bearerToken = client.requestBearerToken(); + final GetBearerTokenResponse bearerToken = client.requestBearerToken(); + client.getConfig().withBearerToken(bearerToken.getAccessToken()); // STEP 3: Get Host Id final String hostId = client.requestHostId(); @@ -40,16 +44,21 @@ public static void main(final String[] args) throws IOException, URISyntaxExcept events.forEach(event -> logger.info("Event: " + event.getTitle() + "(id:" + event.getId() + ")")); // STEP 5: Get Buyers - final List buyers = client.requestBuyersInEvent(events.get(0).getId()); + final List buyers = client.requestBuyersInEvent(events.get(0).getId(), 50, 100); buyers.forEach(buyer -> logger.info("Buyer: " + buyer.getName())); } - private static void openBrowserToGetAuthorizationCode() throws URISyntaxException, IOException + private static String openBrowserToGetAuthorizationCodeAndWaitForInput() throws URISyntaxException, IOException { final UniverseClient client = new UniverseClient(); if(Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) { Desktop.getDesktop().browse(new URI(client.getUrlToGetAuthorizationCode())); } + try(Scanner scanner = new Scanner(System.in)) + { + System.out.println("Please input displayed authorization code:"); + return scanner.nextLine(); + } } } diff --git a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java index 9e631fa..6c0ff53 100644 --- a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java +++ b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java @@ -100,7 +100,7 @@ public String getUrlToGetAuthorizationCode( + "&redirect_uri=" + redirectUri; } - public String requestBearerToken() throws IOException + public GetBearerTokenResponse requestBearerToken() throws IOException { return requestBearerToken( getConfig().getApplicationId(), @@ -110,7 +110,7 @@ public String requestBearerToken() throws IOException ); } - public String requestBearerToken( + public GetBearerTokenResponse requestBearerToken( final String applicationId, final String applicationSecret, final String authorizationCode, @@ -131,10 +131,23 @@ public String requestBearerToken( ) ) ); - return responseGetBearerToken.getAccessToken(); + return responseGetBearerToken; } + /** + * @param eventId to get the events from + */ public List requestBuyersInEvent(String eventId) throws IOException + { + return requestBuyersInEvent(eventId, 0, 0); + } + + /** + * @param eventId to get the events from + * @param limit 0 is unlimited, 50 is max amount. Default is 0 + * @param offset Default is 0 + */ + public List requestBuyersInEvent(String eventId, int limit, int offset) throws IOException { final GetBuyersRequest getBuyersRequest = new GetBuyersRequest(); final GetBuyersResponse responseGetBuyers = @@ -142,7 +155,7 @@ public List requestBuyersInEvent(String eventId) throws IOException getBuyersRequest, sendPostMessage( UNIVERSE_GRAPHQL_URL, - getBuyersRequest.getQuery(eventId), + getBuyersRequest.getQuery(eventId, limit, offset), getConfig().getBearerToken() ) ); @@ -178,7 +191,7 @@ public List requestEvents(String hostId) throws IOException getEventsRequest, sendPostMessage( UNIVERSE_GRAPHQL_URL, - getEventsRequest.getQuery(hostId), + getEventsRequest.getQuery(hostId, 0), getConfig().getBearerToken() ) ); diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java index 824ae29..3aa0acb 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java @@ -1,5 +1,6 @@ package software.xdev.universe.requests.get_bearer_token; +import java.time.Duration; import java.util.LinkedHashMap; import java.util.Map; @@ -23,6 +24,8 @@ public class GetBearerTokenResponse { + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); @JsonProperty("access_token") private String accessToken; @JsonProperty("token_type") @@ -35,8 +38,6 @@ public class GetBearerTokenResponse private String scope; @JsonProperty("created_at") private Integer createdAt; - @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); @JsonProperty("access_token") public String getAccessToken() @@ -62,6 +63,9 @@ public void setTokenType(String tokenType) this.tokenType = tokenType; } + /** + * @return number of seconds to expiration + */ @JsonProperty("expires_in") public Integer getExpiresIn() { @@ -74,6 +78,11 @@ public void setExpiresIn(Integer expiresIn) this.expiresIn = expiresIn; } + public Duration getExpiresInAsDuration() + { + return Duration.ofSeconds(getExpiresIn()); + } + @JsonProperty("refresh_token") public String getRefreshToken() { diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java index 8fdf335..e95752d 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java @@ -11,10 +11,10 @@ public Class getResponseClass() return GetBuyersResponse.class; } - public final String getQuery(String eventId) + public final String getQuery(String eventId, int limit, int offset) { return "{ \"query\": \"{ event(id: \\\"" + eventId + "\\\") { orders { " - + "nodes(limit: 0) {" + + "nodes(limit: " + limit + " offset: " + offset + ") {" + " buyer {" + " id" + " name" diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java index e51dfe3..10b1f1a 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java @@ -11,12 +11,12 @@ public Class getResponseClass() return GetEventsResponse.class; } - public final String getQuery(final String hostId) + public final String getQuery(final String hostId, int limit) { return "{ \"query\": \"{" + " host(id: \\\"" + hostId + "\\\") {" + " events {" - + " nodes {" + + " nodes(limit: " + limit + ") {" + " id" + " title" + " description" From 5d03d14092168bd2e94238b9698a96ec9a056616 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Mar 2023 01:25:54 +0000 Subject: [PATCH 61/99] Bump commons-lang from 2.4 to 2.6 Bumps commons-lang from 2.4 to 2.6. --- updated-dependencies: - dependency-name: commons-lang:commons-lang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- universe-client/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/universe-client/pom.xml b/universe-client/pom.xml index bab0b5d..b42cf2e 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -83,7 +83,7 @@ commons-lang commons-lang - 2.4 + 2.6 com.fasterxml.jackson.core From b708c29f6f8f73207ac6cf30ba548e2922f3d823 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 3 Mar 2023 07:37:25 +0100 Subject: [PATCH 62/99] Extended functionality to request attendees --- .../software/xdev/universe/demo/Demo.java | 18 +- .../xdev/universe/UniverseClient.java | 33 +++ .../requests/get_attendees/Answer.java | 64 ++++++ .../requests/get_attendees/Attendee.java | 193 ++++++++++++++++++ .../requests/get_attendees/Attendees.java | 50 +++++ .../universe/requests/get_attendees/Data.java | 49 +++++ .../get_attendees/DefaultQuestions.java | 22 ++ .../requests/get_attendees/Event.java | 49 +++++ .../get_attendees/GetAttendeesRequest.java | 45 ++++ .../get_attendees/GetAttendeesResponse.java | 49 +++++ .../requests/get_attendees/Order.java | 64 ++++++ .../requests/get_attendees/Question.java | 79 +++++++ .../universe/requests/get_attendees/Rate.java | 49 +++++ 13 files changed, 763 insertions(+), 1 deletion(-) create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Answer.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendee.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendees.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Data.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_attendees/DefaultQuestions.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Event.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesRequest.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesResponse.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Order.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Question.java create mode 100644 universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Rate.java diff --git a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java index 3d35bee..1218b57 100644 --- a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java +++ b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java @@ -11,6 +11,8 @@ import org.apache.logging.log4j.Logger; import software.xdev.universe.UniverseClient; +import software.xdev.universe.requests.get_attendees.Attendee; +import software.xdev.universe.requests.get_attendees.DefaultQuestions; import software.xdev.universe.requests.get_bearer_token.GetBearerTokenResponse; import software.xdev.universe.requests.get_buyers.Buyer; import software.xdev.universe.requests.get_events.Event; @@ -44,8 +46,22 @@ public static void main(final String[] args) throws IOException, URISyntaxExcept events.forEach(event -> logger.info("Event: " + event.getTitle() + "(id:" + event.getId() + ")")); // STEP 5: Get Buyers - final List buyers = client.requestBuyersInEvent(events.get(0).getId(), 50, 100); + final List buyers = client.requestBuyersInEvent(events.get(0).getId(), 5, 0); buyers.forEach(buyer -> logger.info("Buyer: " + buyer.getName())); + + // STEP 6: Get Attendees + final List attendees = client.requestAttendeesInEvent("63d23a98cf489d0021b396b3", 5, 0); + attendees.forEach(attendee -> + logger.info( + "Attendee: " + + "\n Name:" + attendee.getTypedAnswerToQuestion(DefaultQuestions.FIRST_NAME) + + " " + attendee.getTypedAnswerToQuestion(DefaultQuestions.LAST_NAME) + + "\n Email: " + attendee.getTypedAnswerToQuestion(DefaultQuestions.EMAIL) + + "\n Company: " + attendee.getTypedAnswerToQuestion(DefaultQuestions.COMPANY) + + "\n Job: " + attendee.getTypedAnswerToQuestion(DefaultQuestions.JOB_TITLE) + + "\n Country: " + attendee.getTypedAnswerToQuestion(DefaultQuestions.COUNTRY) + ) + ); } private static String openBrowserToGetAuthorizationCodeAndWaitForInput() throws URISyntaxException, IOException diff --git a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java index 6c0ff53..f4fa822 100644 --- a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java +++ b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java @@ -34,6 +34,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import software.xdev.universe.requests.UniverseRequest; +import software.xdev.universe.requests.get_attendees.Attendee; +import software.xdev.universe.requests.get_attendees.GetAttendeesRequest; +import software.xdev.universe.requests.get_attendees.GetAttendeesResponse; import software.xdev.universe.requests.get_bearer_token.GetBearerTokenRequest; import software.xdev.universe.requests.get_bearer_token.GetBearerTokenResponse; import software.xdev.universe.requests.get_buyers.Buyer; @@ -168,6 +171,36 @@ public List requestBuyersInEvent(String eventId, int limit, int offset) t .collect(Collectors.toList()); } + /** + * @param eventId to get the events from + */ + public List requestAttendeesInEvent(String eventId) throws IOException + { + return requestAttendeesInEvent(eventId, 0, 0); + } + + /** + * @param eventId to get the events from + * @param limit 0 is unlimited, 50 is max amount. Default is 0 + * @param offset Default is 0 + */ + public List requestAttendeesInEvent(String eventId, int limit, int offset) throws IOException + { + final GetAttendeesRequest getBuyersRequest = new GetAttendeesRequest(); + final GetAttendeesResponse responseGetBuyers = + sendRequestAndParseResponse( + getBuyersRequest, + sendPostMessage( + UNIVERSE_GRAPHQL_URL, + getBuyersRequest.getQuery(eventId, limit, offset), + getConfig().getBearerToken() + ) + ); + return responseGetBuyers.getData() + .getEvent() + .getAttendees().getNodes(); + } + public String requestHostId() throws IOException { final GetHostRequest getHostRequest = new GetHostRequest(); diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Answer.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Answer.java new file mode 100644 index 0000000..873fd23 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Answer.java @@ -0,0 +1,64 @@ +package software.xdev.universe.requests.get_attendees; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "question", + "value" +}) +public class Answer +{ + + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("question") + private Question question; + @JsonProperty("value") + private String value; + + @JsonProperty("question") + public Question getQuestion() + { + return question; + } + + @JsonProperty("question") + public void setQuestion(Question question) + { + this.question = question; + } + + @JsonProperty("value") + public String getValue() + { + return value; + } + + @JsonProperty("value") + public void setValue(String value) + { + this.value = value; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendee.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendee.java new file mode 100644 index 0000000..1eb4c2e --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendee.java @@ -0,0 +1,193 @@ +package software.xdev.universe.requests.get_attendees; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "id", + "firstName", + "lastName", + "email", + "rate", + "order", + "answers" +}) +public class Attendee +{ + + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("id") + private String id; + @JsonProperty("firstName") + private String firstName; + @JsonProperty("lastName") + private String lastName; + @JsonProperty("email") + private String email; + @JsonProperty("rate") + private Rate rate; + @JsonProperty("order") + private Order order; + @JsonProperty("answers") + private List answers; + + @JsonProperty("id") + public String getId() + { + return id; + } + + @JsonProperty("id") + public void setId(String id) + { + this.id = id; + } + + @JsonProperty("firstName") + public String getFirstName() + { + return firstName; + } + + @JsonProperty("firstName") + public void setFirstName(String firstName) + { + this.firstName = firstName; + } + + @JsonProperty("lastName") + public String getLastName() + { + return lastName; + } + + @JsonProperty("lastName") + public void setLastName(String lastName) + { + this.lastName = lastName; + } + + @JsonProperty("email") + public String getEmail() + { + return email; + } + + @JsonProperty("email") + public void setEmail(String email) + { + this.email = email; + } + + @JsonProperty("rate") + public Rate getRate() + { + return rate; + } + + @JsonProperty("rate") + public void setRate(Rate rate) + { + this.rate = rate; + } + + @JsonProperty("order") + public Order getOrder() + { + return order; + } + + @JsonProperty("order") + public void setOrder(Order order) + { + this.order = order; + } + + @JsonProperty("answers") + public List getAnswers() + { + return answers; + } + + @JsonProperty("answers") + public void setAnswers(List answers) + { + this.answers = answers; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } + + /** + * @return {@code null} if no Question or answer is found + */ + public String getUntypedAnswerToQuestion(String question) + { + return getTypedAnswerToQuestion( + new TypedQuestion<>( + question, + value -> value) + ); + } + + /** + * Default questions can be found in {@link DefaultQuestions}. + * + * @return {@code null} if no Question or answer is found + */ + public T getTypedAnswerToQuestion(TypedQuestion question) + { + final Optional answerForQuestion = this.getAnswers().stream().filter( + answer -> question.getQuestionTitle().equals(answer.getQuestion().getQuestion()) + ).findFirst(); + if(answerForQuestion.isEmpty()) + { + return null; + } + return question.parseValue(answerForQuestion.get().getValue()); + } + + public static class TypedQuestion + { + private final String questionTitle; + private final Function parseFunction; + + TypedQuestion(String questionTitle, Function parseFunction) + { + this.questionTitle = questionTitle; + this.parseFunction = parseFunction; + } + + public String getQuestionTitle() + { + return this.questionTitle; + } + + public T parseValue(String value) + { + return parseFunction.apply(value); + } + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendees.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendees.java new file mode 100644 index 0000000..2fcb25e --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendees.java @@ -0,0 +1,50 @@ +package software.xdev.universe.requests.get_attendees; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "nodes" +}) +public class Attendees +{ + + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + @JsonProperty("nodes") + private List nodes; + + @JsonProperty("nodes") + public List getNodes() + { + return nodes; + } + + @JsonProperty("nodes") + public void setNodes(List nodes) + { + this.nodes = nodes; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Data.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Data.java new file mode 100644 index 0000000..bc95ba8 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Data.java @@ -0,0 +1,49 @@ +package software.xdev.universe.requests.get_attendees; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "event" +}) +public class Data +{ + + @JsonProperty("event") + private Event event; + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + + @JsonProperty("event") + public Event getEvent() + { + return event; + } + + @JsonProperty("event") + public void setEvent(Event event) + { + this.event = event; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/DefaultQuestions.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/DefaultQuestions.java new file mode 100644 index 0000000..4be823d --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/DefaultQuestions.java @@ -0,0 +1,22 @@ +package software.xdev.universe.requests.get_attendees; + +public class DefaultQuestions +{ + public static Attendee.TypedQuestion COMPANY = new Attendee.TypedQuestion<>( + "Company / Organisation", + value -> value); + public static Attendee.TypedQuestion JOB_TITLE = + new Attendee.TypedQuestion<>("Job Title", value -> value); + public static Attendee.TypedQuestion COUNTRY = new Attendee.TypedQuestion<>( + "Country", + value -> value); + public static Attendee.TypedQuestion FIRST_NAME = new Attendee.TypedQuestion<>( + "First Name", + value -> value); + public static Attendee.TypedQuestion LAST_NAME = new Attendee.TypedQuestion<>( + "Last Name", + value -> value); + public static Attendee.TypedQuestion EMAIL = new Attendee.TypedQuestion<>( + "Email", + value -> value); +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Event.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Event.java new file mode 100644 index 0000000..e0b00df --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Event.java @@ -0,0 +1,49 @@ +package software.xdev.universe.requests.get_attendees; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "attendees" +}) +public class Event +{ + + @JsonProperty("attendees") + private Attendees attendees; + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + + @JsonProperty("attendees") + public Attendees getAttendees() + { + return attendees; + } + + @JsonProperty("attendees") + public void setAttendees(Attendees attendees) + { + this.attendees = attendees; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesRequest.java new file mode 100644 index 0000000..65a1ddd --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesRequest.java @@ -0,0 +1,45 @@ +package software.xdev.universe.requests.get_attendees; + +import software.xdev.universe.requests.UniverseRequest; + + +public class GetAttendeesRequest implements UniverseRequest +{ + @Override + public Class getResponseClass() + { + return GetAttendeesResponse.class; + } + + public final String getQuery(String eventId, int limit, int offset) + { + return "{ \"query\": \"{ event(id: \\\"" + eventId + "\\\") {" + + " attendees {" + + " nodes(limit: " + limit + " offset: " + offset + ") {" + + " id" + + " firstName" + + " lastName" + + " email" + + " rate {" + + " name" + + " }" + + " order {" + + " state" + + " id" + + " }" + + " answers {" + + " question {" + + " id" + + " question" + + " type" + + " }" + + " value" + + " }" + + " }" + + " }" + + " }" + + " } \"}"; + } +} + + diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesResponse.java new file mode 100644 index 0000000..72ba4b0 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesResponse.java @@ -0,0 +1,49 @@ +package software.xdev.universe.requests.get_attendees; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "data" +}) +public class GetAttendeesResponse +{ + + @JsonProperty("data") + private Data data; + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + + @JsonProperty("data") + public Data getData() + { + return data; + } + + @JsonProperty("data") + public void setData(Data data) + { + this.data = data; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Order.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Order.java new file mode 100644 index 0000000..12967d1 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Order.java @@ -0,0 +1,64 @@ +package software.xdev.universe.requests.get_attendees; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "state", + "id" +}) +public class Order +{ + + @JsonProperty("state") + private String state; + @JsonProperty("id") + private String id; + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + + @JsonProperty("state") + public String getState() + { + return state; + } + + @JsonProperty("state") + public void setState(String state) + { + this.state = state; + } + + @JsonProperty("id") + public String getId() + { + return id; + } + + @JsonProperty("id") + public void setId(String id) + { + this.id = id; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Question.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Question.java new file mode 100644 index 0000000..9289eba --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Question.java @@ -0,0 +1,79 @@ +package software.xdev.universe.requests.get_attendees; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "id", + "question", + "type" +}) +public class Question +{ + + @JsonProperty("id") + private String id; + @JsonProperty("question") + private String question; + @JsonProperty("type") + private String type; + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + + @JsonProperty("id") + public String getId() + { + return id; + } + + @JsonProperty("id") + public void setId(String id) + { + this.id = id; + } + + @JsonProperty("question") + public String getQuestion() + { + return question; + } + + @JsonProperty("question") + public void setQuestion(String question) + { + this.question = question; + } + + @JsonProperty("type") + public String getType() + { + return type; + } + + @JsonProperty("type") + public void setType(String type) + { + this.type = type; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Rate.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Rate.java new file mode 100644 index 0000000..d0f3f65 --- /dev/null +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Rate.java @@ -0,0 +1,49 @@ +package software.xdev.universe.requests.get_attendees; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "name" +}) +public class Rate +{ + + @JsonProperty("name") + private String name; + @JsonIgnore + private final Map additionalProperties = new LinkedHashMap(); + + @JsonProperty("name") + public String getName() + { + return name; + } + + @JsonProperty("name") + public void setName(String name) + { + this.name = name; + } + + @JsonAnyGetter + public Map getAdditionalProperties() + { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) + { + this.additionalProperties.put(name, value); + } +} From 51dc43e010b7246374acee404280d78c5dcdeafe Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 3 Mar 2023 07:40:58 +0100 Subject: [PATCH 63/99] Added licenses --- .../java/software/xdev/universe/demo/Demo.java | 2 +- .../xdev/universe/UniverseConfiguration.java | 15 +++++++++++++++ .../xdev/universe/requests/UniverseRequest.java | 15 +++++++++++++++ .../universe/requests/get_attendees/Answer.java | 15 +++++++++++++++ .../universe/requests/get_attendees/Attendee.java | 15 +++++++++++++++ .../requests/get_attendees/Attendees.java | 15 +++++++++++++++ .../universe/requests/get_attendees/Data.java | 15 +++++++++++++++ .../requests/get_attendees/DefaultQuestions.java | 15 +++++++++++++++ .../universe/requests/get_attendees/Event.java | 15 +++++++++++++++ .../get_attendees/GetAttendeesRequest.java | 15 +++++++++++++++ .../get_attendees/GetAttendeesResponse.java | 15 +++++++++++++++ .../universe/requests/get_attendees/Order.java | 15 +++++++++++++++ .../universe/requests/get_attendees/Question.java | 15 +++++++++++++++ .../universe/requests/get_attendees/Rate.java | 15 +++++++++++++++ .../get_bearer_token/GetBearerTokenRequest.java | 15 +++++++++++++++ .../get_bearer_token/GetBearerTokenResponse.java | 15 +++++++++++++++ .../xdev/universe/requests/get_buyers/Buyer.java | 15 +++++++++++++++ .../xdev/universe/requests/get_buyers/Data.java | 15 +++++++++++++++ .../xdev/universe/requests/get_buyers/Event.java | 15 +++++++++++++++ .../requests/get_buyers/GetBuyersRequest.java | 15 +++++++++++++++ .../requests/get_buyers/GetBuyersResponse.java | 15 +++++++++++++++ .../xdev/universe/requests/get_buyers/Node.java | 15 +++++++++++++++ .../xdev/universe/requests/get_buyers/Orders.java | 15 +++++++++++++++ .../xdev/universe/requests/get_events/Data.java | 15 +++++++++++++++ .../xdev/universe/requests/get_events/Event.java | 15 +++++++++++++++ .../xdev/universe/requests/get_events/Events.java | 15 +++++++++++++++ .../requests/get_events/GetEventsRequest.java | 15 +++++++++++++++ .../requests/get_events/GetEventsResponse.java | 15 +++++++++++++++ .../xdev/universe/requests/get_events/Host.java | 15 +++++++++++++++ .../xdev/universe/requests/get_host/Data.java | 15 +++++++++++++++ .../requests/get_host/GetHostRequest.java | 15 +++++++++++++++ .../requests/get_host/GetHostResponse.java | 15 +++++++++++++++ .../xdev/universe/requests/get_host/Viewer.java | 15 +++++++++++++++ 33 files changed, 481 insertions(+), 1 deletion(-) diff --git a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java index 1218b57..550713e 100644 --- a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java +++ b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java @@ -54,7 +54,7 @@ public static void main(final String[] args) throws IOException, URISyntaxExcept attendees.forEach(attendee -> logger.info( "Attendee: " - + "\n Name:" + attendee.getTypedAnswerToQuestion(DefaultQuestions.FIRST_NAME) + + "\n Name: " + attendee.getTypedAnswerToQuestion(DefaultQuestions.FIRST_NAME) + " " + attendee.getTypedAnswerToQuestion(DefaultQuestions.LAST_NAME) + "\n Email: " + attendee.getTypedAnswerToQuestion(DefaultQuestions.EMAIL) + "\n Company: " + attendee.getTypedAnswerToQuestion(DefaultQuestions.COMPANY) diff --git a/universe-client/src/main/java/software/xdev/universe/UniverseConfiguration.java b/universe-client/src/main/java/software/xdev/universe/UniverseConfiguration.java index 00e8787..1744e03 100644 --- a/universe-client/src/main/java/software/xdev/universe/UniverseConfiguration.java +++ b/universe-client/src/main/java/software/xdev/universe/UniverseConfiguration.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe; import org.eclipse.microprofile.config.ConfigProvider; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/UniverseRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/UniverseRequest.java index f659d99..628ff2c 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/UniverseRequest.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/UniverseRequest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests; public interface UniverseRequest diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Answer.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Answer.java index 873fd23..37f5120 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Answer.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Answer.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_attendees; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendee.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendee.java index 1eb4c2e..d82539d 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendee.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendee.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_attendees; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendees.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendees.java index 2fcb25e..fab5ea6 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendees.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendees.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_attendees; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Data.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Data.java index bc95ba8..9e1fc41 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Data.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Data.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_attendees; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/DefaultQuestions.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/DefaultQuestions.java index 4be823d..8297b57 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/DefaultQuestions.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/DefaultQuestions.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_attendees; public class DefaultQuestions diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Event.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Event.java index e0b00df..69c8bfc 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Event.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Event.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_attendees; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesRequest.java index 65a1ddd..9dc5a97 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesRequest.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesRequest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_attendees; import software.xdev.universe.requests.UniverseRequest; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesResponse.java index 72ba4b0..9f850e6 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesResponse.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesResponse.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_attendees; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Order.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Order.java index 12967d1..a57e1a9 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Order.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Order.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_attendees; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Question.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Question.java index 9289eba..9c1bf00 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Question.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Question.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_attendees; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Rate.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Rate.java index d0f3f65..ce84514 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Rate.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Rate.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_attendees; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenRequest.java index becd90b..580eea8 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenRequest.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenRequest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_bearer_token; import software.xdev.universe.requests.UniverseRequest; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java index 3aa0acb..625f5a5 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_bearer_token; import java.time.Duration; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Buyer.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Buyer.java index be1d125..4988ad9 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Buyer.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Buyer.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_buyers; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Data.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Data.java index b4b50f1..066937a 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Data.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Data.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_buyers; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Event.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Event.java index 782b5ad..0ed075d 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Event.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Event.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_buyers; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java index e95752d..3ea5c19 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_buyers; import software.xdev.universe.requests.UniverseRequest; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersResponse.java index 61f1d2f..2be0857 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersResponse.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersResponse.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_buyers; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Node.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Node.java index 0838c91..53c9c34 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Node.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Node.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_buyers; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Orders.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Orders.java index 54f8986..8aec82f 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Orders.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Orders.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_buyers; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Data.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Data.java index eca1702..4e0eea8 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Data.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Data.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_events; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Event.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Event.java index 552de08..5274378 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Event.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Event.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_events; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Events.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Events.java index ac5855a..2e40e2a 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Events.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Events.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_events; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java index 10b1f1a..b4c7db4 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_events; import software.xdev.universe.requests.UniverseRequest; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsResponse.java index 2d669bc..4e4a312 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsResponse.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsResponse.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_events; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Host.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Host.java index aaefaca..cecf838 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Host.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Host.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_events; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_host/Data.java b/universe-client/src/main/java/software/xdev/universe/requests/get_host/Data.java index fcdba16..a37c7a4 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_host/Data.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_host/Data.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_host; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostRequest.java index 71e6bb9..3cf1b2f 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostRequest.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostRequest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_host; import software.xdev.universe.requests.UniverseRequest; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostResponse.java index 3b35928..f598239 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostResponse.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostResponse.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_host; import java.util.LinkedHashMap; diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_host/Viewer.java b/universe-client/src/main/java/software/xdev/universe/requests/get_host/Viewer.java index 1c7442c..a060a7d 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_host/Viewer.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_host/Viewer.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 XDEV Software (https://xdev.software) + * + * 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 software.xdev.universe.requests.get_host; import java.util.LinkedHashMap; From ddb6d8bc3e59c96cb4ea277742baa2698b47cb64 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 3 Mar 2023 07:43:53 +0100 Subject: [PATCH 64/99] Deleted uploading of demo files --- .github/workflows/checkBuild.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index a06ffe7..5984f3b 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -54,10 +54,3 @@ jobs: echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean package -Pproduction" exit 1 fi - - - name: Upload demo files - uses: actions/upload-artifact@v3 - with: - name: demo-files-java-${{ matrix.java }} - path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar - if-no-files-found: error From 1e58f8b6304e27a31755d184324044149e61845f Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 3 Mar 2023 08:27:37 +0100 Subject: [PATCH 65/99] Changed groupId --- pom.xml | 6 +++--- universe-client-demo/pom.xml | 2 +- universe-client/pom.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 82d195a..44fae96 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,10 @@ - 4.0.0 - com.xdev-software + software.xdev universe-client-root 1.0.0-SNAPSHOT pom diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index 6328ce6..338cb9b 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.xdev-software + software.xdev universe-client-demo 1.0.0-SNAPSHOT jar diff --git a/universe-client/pom.xml b/universe-client/pom.xml index b2621da..1366ce6 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.xdev-software + software.xdev universe-client 1.0.0-SNAPSHOT jar From b2044bc594274cdce200bee39ab2be9d7a1de881 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 3 Mar 2023 10:06:02 +0100 Subject: [PATCH 66/99] changed nexus url --- universe-client/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/universe-client/pom.xml b/universe-client/pom.xml index 1366ce6..ac80632 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -110,11 +110,11 @@ ossrh - https://oss.sonatype.org/content/repositories/snapshots + https://s01.oss.sonatype.org/content/repositories/snapshots ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ @@ -229,7 +229,7 @@ true ossrh - https://oss.sonatype.org/ + https://s01.oss.sonatype.org/ 30 true From b7b3815c200bd6ca6ef041823aa95838aaed5637 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 3 Mar 2023 10:13:25 +0100 Subject: [PATCH 67/99] Fixes for release --- .github/workflows/release.yml | 2 +- universe-client-demo/pom.xml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6fa3191..afddeb6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -101,7 +101,7 @@ jobs: Add the following lines to your pom: ```XML - com.xdev-software + software.xdev ${{ env.PRIMARY_MAVEN_MODULE }} ${{ steps.version.outputs.release }} diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index 338cb9b..253e70d 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -56,4 +56,10 @@ 2.20.0 + + + + production + +
From 4df9252de4e4348d2a9a73b76f7b0ff06efaaa1a Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 3 Mar 2023 10:28:05 +0100 Subject: [PATCH 68/99] Update pom.xml --- universe-client-demo/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index 253e70d..c782154 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -37,7 +37,7 @@ - com.xdev-software + software.xdev universe-client ${project.version} From 6e7c5c293aa3f381a23b7399f804180143fc0065 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 3 Mar 2023 10:28:43 +0100 Subject: [PATCH 69/99] Update pom.xml --- universe-client-demo/pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index c782154..b0b3558 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -9,6 +9,8 @@ 1.0.0-SNAPSHOT jar + Universe API for Java - Demo + 2023 From b917c621f5f3d7409097bb8853965c3b9324dac9 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 3 Mar 2023 09:30:08 +0000 Subject: [PATCH 70/99] Release 1.0.0 --- pom.xml | 2 +- universe-client-demo/pom.xml | 2 +- universe-client/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 44fae96..0bf4e98 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client-root - 1.0.0-SNAPSHOT + 1.0.0 pom diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index b0b3558..b0de792 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client-demo - 1.0.0-SNAPSHOT + 1.0.0 jar Universe API for Java - Demo diff --git a/universe-client/pom.xml b/universe-client/pom.xml index ac80632..f5ccc01 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client - 1.0.0-SNAPSHOT + 1.0.0 jar Universe API for Java From 7c8cbc7729d60569d563520e840e905760a35e56 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 3 Mar 2023 10:33:26 +0100 Subject: [PATCH 71/99] Deleted building vaadin package --- .github/workflows/release.yml | 43 ----------------------------------- 1 file changed, 43 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index afddeb6..2b1b4bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -138,49 +138,6 @@ jobs: MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - build_directory: # Build a ZIP that can be uploaded to Vaadin Directory - runs-on: ubuntu-latest - needs: [prepare_release] - steps: - - uses: actions/checkout@v3 - - - name: Init Git and pull - run: | - git config --global user.email "actions@github.com" - git config --global user.name "GitHub Actions" - git pull - - - name: Set up JDK - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - - - name: Build for Vaadin Directory - run: mvn -B install -Pdirectory - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - - - name: Upload asset - uses: actions/upload-artifact@v3 - with: - name: vaadin-directory-files - path: ${{ env.PRIMARY_MAVEN_MODULE }}/target/${{ env.PRIMARY_MAVEN_MODULE }}-*.zip - if-no-files-found: error - - - name: Get version - id: version - run: | - echo "release=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - - - name: Upload Release Asset - uses: shogo82148/actions-upload-release-asset@v1 - with: - upload_url: ${{ needs.prepare_release.outputs.upload_url }} - asset_path: ${{ env.PRIMARY_MAVEN_MODULE }}/target/${{ env.PRIMARY_MAVEN_MODULE }}-${{ steps.version.outputs.release }}.zip - asset_name: ${{ env.PRIMARY_MAVEN_MODULE }}-${{ steps.version.outputs.release }}.zip - asset_content_type: application/zip - publish-pages: name: Publish dependencies and licenses to github pages runs-on: ubuntu-latest From 82f1c20d751513f8b116fdbf51606971d2bc50e6 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 3 Mar 2023 10:48:18 +0100 Subject: [PATCH 72/99] Expanded README --- README.md | 34 +++++++++++++------ .../software/xdev/universe/demo/Demo.java | 2 +- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 02c6b69..7251c61 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Latest version](https://img.shields.io/maven-central/v/com.xdev-software/universe-client)](https://mvnrepository.com/artifact/com.xdev-software/universe-client) +[![Latest version](https://img.shields.io/maven-central/v/software.xdev/universe-client)](https://mvnrepository.com/artifact/software.xdev/universe-client) [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/universe-client/checkBuild.yml?branch=develop)](https://github.com/xdev-software/universe-client/actions/workflows/checkBuild.yml?query=branch%3Adevelop) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_universe-client&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_universe-client) @@ -9,20 +9,32 @@ Here is the [documentation of the actual universe API](https://universe.com/api) ## Usage -You can set the **API-Key** and the **API-URL** through the ``microprofile-config.properties`` ( -See [microprofile-config-template.properties](universe-client-demo/src/main/resources/META-INF/microprofile-config-template.properties)) -or with ``#withApiKey`` and ``#withUrl`` ( -see [Demo](universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java)). +Before you can start, there are a few config-entries that must be set. +They can get configured through the ``microprofile-config.properties`` (see [microprofile-config-template.properties](universe-client-demo/src/main/resources/META-INF/microprofile-config-template.properties))) +or through the UniverseConfiguration with ``client.getConfig().with...`` (see [Demo](universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java)). + +The two basic entries are the ``ApplicationId`` and the ``RedirectUri``. They **must** be set. + +If these two entries are set, you need to get ``AuthorizationCode``. This is a one-time-only code, which +you get by calling the URL provided by ``client.getUrlToGetAuthorizationCode()``. + +With this ``AuthorizationCode`` you can request a ``BearerToken``. You can can request the ``BearerToken`` only +one time with one ``AuthorizationCode``. After that the ``AuthorizationCode`` is invalidated. +This can be achieved with ``client.requestBearerToken()``. +The ``BearerToken`` can be used for all your future requests. It is usually valid for one month. + +If the ``BearerToken`` is set, you can use the actual API calls. ### Example +Full example, see [Demo](universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java)). ```java -final universeClient client = new universeClient() - .withApiKey("TEST-API") - .withUri("https://your_conference.universe.com/api"); -client.getAlluniverseSessions().forEach( - session->logger.info(session.getSpeakers()+" - "+session.getName()) -); +final UniverseClient client = new UniverseClient(); +// Get Events +final List events = client.requestEvents(hostId); +events.forEach(event -> logger.info("Event: " + event.getTitle() + "(id:" + event.getId() + ")")); +// Get Attendees +final List attendees = client.requestAttendeesInEvent(events.get(0).getId(), 5, 0); ``` ## GraphQL diff --git a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java index 550713e..8e04eb9 100644 --- a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java +++ b/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java @@ -50,7 +50,7 @@ public static void main(final String[] args) throws IOException, URISyntaxExcept buyers.forEach(buyer -> logger.info("Buyer: " + buyer.getName())); // STEP 6: Get Attendees - final List attendees = client.requestAttendeesInEvent("63d23a98cf489d0021b396b3", 5, 0); + final List attendees = client.requestAttendeesInEvent(events.get(0).getId(), 5, 0); attendees.forEach(attendee -> logger.info( "Attendee: " From 18218c5d3ca9edb45f4fe5059b5e11fa6384ea00 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 3 Mar 2023 10:54:07 +0100 Subject: [PATCH 73/99] Slight cleanup --- README.md | 2 +- pom.xml | 2 +- universe-client-demo/pom.xml | 2 +- universe-client/pom.xml | 10 ++++------ 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7251c61..5ade00b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/universe-client/checkBuild.yml?branch=develop)](https://github.com/xdev-software/universe-client/actions/workflows/checkBuild.yml?query=branch%3Adevelop) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_universe-client&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_universe-client) -# universe client for java +# Universe client for Java A simple Java API for easy usage of [universe](https://universe.com/). Here is the [documentation of the actual universe API](https://universe.com/api). diff --git a/pom.xml b/pom.xml index 44fae96..ea461e9 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client-root - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT pom diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index b0b3558..4c031e3 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client-demo - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT jar Universe API for Java - Demo diff --git a/universe-client/pom.xml b/universe-client/pom.xml index ac80632..2b2169b 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client - 1.0.0-SNAPSHOT + 1.0.1-SNAPSHOT jar Universe API for Java @@ -92,12 +92,10 @@ - - org.eclipse.microprofile - microprofile - 6.0 - pom + org.eclipse.microprofile.config + microprofile-config-api + 3.0.2 From bea485dff707ff361de574bbcd5c1b9a67fdb711 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 3 Mar 2023 10:55:52 +0100 Subject: [PATCH 74/99] Update release.yml --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2b1b4bb..ec8fc0b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -137,7 +137,7 @@ jobs: MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - + publish-pages: name: Publish dependencies and licenses to github pages runs-on: ubuntu-latest @@ -195,7 +195,7 @@ jobs: after_release: runs-on: ubuntu-latest - needs: [publish_central, build_directory] + needs: [publish_central] steps: - uses: actions/checkout@v3 From f71f7c8b23ddf0d2971db9d1184f09ffb81bde20 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 3 Mar 2023 09:58:24 +0000 Subject: [PATCH 75/99] Release 1.0.1 --- pom.xml | 2 +- universe-client-demo/pom.xml | 2 +- universe-client/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ea461e9..49872b8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client-root - 1.0.1-SNAPSHOT + 1.0.1 pom diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index 4c031e3..bde8a14 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client-demo - 1.0.1-SNAPSHOT + 1.0.1 jar Universe API for Java - Demo diff --git a/universe-client/pom.xml b/universe-client/pom.xml index 2b2169b..e943b7d 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client - 1.0.1-SNAPSHOT + 1.0.1 jar Universe API for Java From d1db4f00709533d8d7d3b4a769001dd97a1236ce Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 3 Mar 2023 10:00:00 +0000 Subject: [PATCH 76/99] Preparing for next development iteration --- pom.xml | 2 +- universe-client-demo/pom.xml | 2 +- universe-client/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 49872b8..d0f8697 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client-root - 1.0.1 + 1.0.2-SNAPSHOT pom diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index bde8a14..0f42660 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client-demo - 1.0.1 + 1.0.2-SNAPSHOT jar Universe API for Java - Demo diff --git a/universe-client/pom.xml b/universe-client/pom.xml index e943b7d..b7dcd61 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client - 1.0.1 + 1.0.2-SNAPSHOT jar Universe API for Java From b8b3c3b664aa74b2bbdb6b0187f7f73b8b77b707 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Thu, 27 Apr 2023 09:49:30 +0200 Subject: [PATCH 77/99] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5ade00b..4d80fd4 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ # Universe client for Java A simple Java API for easy usage of [universe](https://universe.com/). -Here is the [documentation of the actual universe API](https://universe.com/api). +Here is the [documentation of the actual universe API](https://developers.universe.com/). ## Usage @@ -26,7 +26,7 @@ The ``BearerToken`` can be used for all your future requests. It is usually vali If the ``BearerToken`` is set, you can use the actual API calls. ### Example -Full example, see [Demo](universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java)). +Full example, see [Demo](universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java). ```java final UniverseClient client = new UniverseClient(); From 5030e997907ad8844d465747328be837d0775a84 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:25:53 +0200 Subject: [PATCH 78/99] Patch --- .github/workflows/update-from-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml index 5dadb2b..7da8af8 100644 --- a/.github/workflows/update-from-template.yml +++ b/.github/workflows/update-from-template.yml @@ -14,7 +14,7 @@ on: env: UPDATE_BRANCH: update-from-template - REMOTE_URL: https://github.com/xdev-software/vaadin-addon-template.git + REMOTE_URL: https://github.com/xdev-software/standard-maven-template.git REMOTE_BRANCH: master permissions: From d7b7fb77cb555c2612a5350aa20d43d6bde83e17 Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 10 Apr 2024 15:44:50 +0200 Subject: [PATCH 79/99] Patch poms I --- standard-maven-template-demo/pom.xml | 113 ------------ standard-maven-template/pom.xml | 251 --------------------------- 2 files changed, 364 deletions(-) delete mode 100644 standard-maven-template-demo/pom.xml delete mode 100644 standard-maven-template/pom.xml diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml deleted file mode 100644 index 0a4432d..0000000 --- a/standard-maven-template-demo/pom.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - 4.0.0 - - software.xdev - standard-maven-template-demo - 1.0.0-SNAPSHOT - jar - - 2022 - - - XDEV Software - https://xdev.software - - - - 17 - ${javaVersion} - - UTF-8 - UTF-8 - - software.xdev.Application - - - - - software.xdev - standard-maven-template - ${project.version} - - - - - ${project.artifactId} - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.13.0 - - ${maven.compiler.release} - - -proc:none - - - - - org.apache.maven.plugins - maven-assembly-plugin - 3.7.1 - - - - ${mainClass} - - - true - - - - jar-with-dependencies - - false - - - - make-assembly - package - - single - - - - - - - - - checkstyle - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.3.1 - - - com.puppycrawl.tools - checkstyle - 10.15.0 - - - - ../.config/checkstyle/checkstyle.xml - - - - - check - - - - - - - - - diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml deleted file mode 100644 index f25578a..0000000 --- a/standard-maven-template/pom.xml +++ /dev/null @@ -1,251 +0,0 @@ - - - 4.0.0 - - software.xdev - standard-maven-template - 1.0.0-SNAPSHOT - jar - - standard-maven-template - standard-maven-template - https://github.com/xdev-software/standard-maven-template - - - https://github.com/xdev-software/standard-maven-template - scm:git:https://github.com/xdev-software/standard-maven-template.git - - - 2023 - - - XDEV Software - https://xdev.software - - - - - XDEV Software - XDEV Software - https://xdev.software - - - - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - 17 - ${javaVersion} - - UTF-8 - UTF-8 - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - - - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - - - - - org.apache.maven.plugins - maven-site-plugin - 4.0.0-M13 - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 3.5.0 - - - - - - com.mycila - license-maven-plugin - 4.3 - - - ${project.organization.url} - - - -
com/mycila/maven/plugin/license/templates/APACHE-2.txt
- - src/main/java/** - src/test/java/** - -
-
-
- - - first - - format - - process-sources - - -
- - - org.apache.maven.plugins - maven-compiler-plugin - 3.13.0 - - ${maven.compiler.release} - - -proc:none - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.6.3 - - - attach-javadocs - verify - - jar - - - - - true - none - - - - org.apache.maven.plugins - maven-source-plugin - 3.3.1 - - - attach-sources - verify - - jar-no-fork - - - - -
-
- - - ossrh - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.2.2 - - - sign-artifacts - verify - - sign - - - - - - --pinentry-mode - loopback - - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - true - - ossrh - https://s01.oss.sonatype.org/ - - 30 - true - - - - - - - checkstyle - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.3.1 - - - com.puppycrawl.tools - checkstyle - 10.15.0 - - - - ../.config/checkstyle/checkstyle.xml - - - - - check - - - - - - - - -
From ff5828cd0a217c4be22415affc9f96ac2ac4e20c Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 10 Apr 2024 15:44:55 +0200 Subject: [PATCH 80/99] Patch poms II --- universe-client-demo/pom.xml | 160 +++++++---- universe-client/pom.xml | 513 +++++++++++++++++------------------ 2 files changed, 352 insertions(+), 321 deletions(-) diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index 0f42660..0a4432d 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -1,67 +1,113 @@ - - 4.0.0 + + 4.0.0 - software.xdev - universe-client-demo - 1.0.2-SNAPSHOT - jar + software.xdev + standard-maven-template-demo + 1.0.0-SNAPSHOT + jar - Universe API for Java - Demo + 2022 - 2023 + + XDEV Software + https://xdev.software + - - XDEV Software - https://xdev.software - + + 17 + ${javaVersion} - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - - + UTF-8 + UTF-8 - - apache_v2 + software.xdev.Application + - 11 - ${javaVersion} - ${javaVersion} - ${javaVersion} + + + software.xdev + standard-maven-template + ${project.version} + + - UTF-8 - UTF-8 - - - - - software.xdev - universe-client - ${project.version} - - - - - io.smallrye.config - smallrye-config - 3.1.3 - - - - org.apache.logging.log4j - log4j-core - 2.20.0 - - - - - - production - - + + ${project.artifactId} + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + ${maven.compiler.release} + + -proc:none + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.7.1 + + + + ${mainClass} + + + true + + + + jar-with-dependencies + + false + + + + make-assembly + package + + single + + + + + + + + + checkstyle + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.3.1 + + + com.puppycrawl.tools + checkstyle + 10.15.0 + + + + ../.config/checkstyle/checkstyle.xml + + + + + check + + + + + + + + diff --git a/universe-client/pom.xml b/universe-client/pom.xml index b7dcd61..f25578a 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -1,266 +1,251 @@ - - 4.0.0 - - software.xdev - universe-client - 1.0.2-SNAPSHOT - jar - - Universe API for Java - This library provides an easy Java-API to read data from the Universe GraphQL-API - https://github.com/xdev-software/universe-client - - - https://github.com/xdev-software/universe-client - https://github.com/xdev-software/universe-client.git - - - 2023 - - - XDEV Software - https://xdev.software - - - - - XDEV Software - XDEV Software - https://xdev.software - - - - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - 11 - ${javaVersion} - - UTF-8 - UTF-8 - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - - - - org.apache.httpcomponents - httpclient - 4.5.14 - - - - commons-lang - commons-lang - 2.6 - - - com.fasterxml.jackson.core - jackson-databind - 2.14.2 - - - - - org.eclipse.microprofile.config - microprofile-config-api - 3.0.2 - - - - org.apache.logging.log4j - log4j-api - 2.20.0 - - - - - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - - - - com.mycila - license-maven-plugin - 4.1 - - - ${project.organization.url} - - - -
com/mycila/maven/plugin/license/templates/APACHE-2.txt
- - src/main/java/** - src/test/java/** - -
-
-
- - - first - - format - - process-sources - - -
- - - org.apache.maven.plugins - maven-compiler-plugin - 3.11.0 - - ${maven.compiler.release} - - -proc:none - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.5.0 - - - attach-javadocs - verify - - jar - - - - - true - none - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-sources - verify - - jar-no-fork - - - - -
-
- - - ossrh - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - sign-artifacts - verify - - sign - - - - - - --pinentry-mode - loopback - - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - true - - ossrh - https://s01.oss.sonatype.org/ - - 30 - true - - - - - - - directory - - - - org.apache.maven.plugins - maven-assembly-plugin - 3.5.0 - - false - - assembly/assembly.xml - - - - - - single - - install - - - - - - - + + 4.0.0 + + software.xdev + standard-maven-template + 1.0.0-SNAPSHOT + jar + + standard-maven-template + standard-maven-template + https://github.com/xdev-software/standard-maven-template + + + https://github.com/xdev-software/standard-maven-template + scm:git:https://github.com/xdev-software/standard-maven-template.git + + + 2023 + + + XDEV Software + https://xdev.software + + + + + XDEV Software + XDEV Software + https://xdev.software + + + + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + 17 + ${javaVersion} + + UTF-8 + UTF-8 + + + + + + central + https://repo.maven.apache.org/maven2 + + false + + + + + + + + central + https://repo.maven.apache.org/maven2 + + false + + + + + + + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + + + org.apache.maven.plugins + maven-site-plugin + 4.0.0-M13 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.5.0 + + + + + + com.mycila + license-maven-plugin + 4.3 + + + ${project.organization.url} + + + +
com/mycila/maven/plugin/license/templates/APACHE-2.txt
+ + src/main/java/** + src/test/java/** + +
+
+
+ + + first + + format + + process-sources + + +
+ + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + ${maven.compiler.release} + + -proc:none + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.6.3 + + + attach-javadocs + verify + + jar + + + + + true + none + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.1 + + + attach-sources + verify + + jar-no-fork + + + + +
+
+ + + ossrh + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.2 + + + sign-artifacts + verify + + sign + + + + + + --pinentry-mode + loopback + + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://s01.oss.sonatype.org/ + + 30 + true + + + + + + + checkstyle + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.3.1 + + + com.puppycrawl.tools + checkstyle + 10.15.0 + + + + ../.config/checkstyle/checkstyle.xml + + + + + check + + + + + + + +
From e17d4ce278945be3d4ffa63b9603de85d8be3d82 Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 10 Apr 2024 15:45:36 +0200 Subject: [PATCH 81/99] Patch poms III --- universe-client-demo/pom.xml | 4 ++-- universe-client/pom.xml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index 0a4432d..f0193e2 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -5,7 +5,7 @@ 4.0.0 software.xdev - standard-maven-template-demo + universe-client-demo 1.0.0-SNAPSHOT jar @@ -29,7 +29,7 @@ software.xdev - standard-maven-template + universe-client ${project.version} diff --git a/universe-client/pom.xml b/universe-client/pom.xml index f25578a..e468621 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -5,17 +5,17 @@ 4.0.0 software.xdev - standard-maven-template + universe-client 1.0.0-SNAPSHOT jar - standard-maven-template - standard-maven-template - https://github.com/xdev-software/standard-maven-template + universe-client + universe-client + https://github.com/xdev-software/universe-client - https://github.com/xdev-software/standard-maven-template - scm:git:https://github.com/xdev-software/standard-maven-template.git + https://github.com/xdev-software/universe-client + scm:git:https://github.com/xdev-software/universe-client.git 2023 From e38e20c5e50b264ed2eb297c237794adb14b7b99 Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 10 Apr 2024 16:05:41 +0200 Subject: [PATCH 82/99] Cleanup --- .run/Run Demo.run.xml | 16 - config/checkstyle/checkstyle.xml | 311 ------------------ .../demo/Demo.java => Application.java} | 51 +-- .../microprofile-config-template.properties | 5 - .../src/main/resources/log4j2.xml | 16 - universe-client/pom.xml | 14 + .../software/xdev/universe/HasLogger.java | 28 -- .../xdev/universe/UniverseClient.java | 184 ++++++----- .../xdev/universe/UniverseConfiguration.java | 113 +------ 9 files changed, 158 insertions(+), 580 deletions(-) delete mode 100644 .run/Run Demo.run.xml delete mode 100644 config/checkstyle/checkstyle.xml rename universe-client-demo/src/main/java/software/xdev/{universe/demo/Demo.java => Application.java} (64%) delete mode 100644 universe-client-demo/src/main/resources/META-INF/microprofile-config-template.properties delete mode 100644 universe-client-demo/src/main/resources/log4j2.xml delete mode 100644 universe-client/src/main/java/software/xdev/universe/HasLogger.java diff --git a/.run/Run Demo.run.xml b/.run/Run Demo.run.xml deleted file mode 100644 index e121f25..0000000 --- a/.run/Run Demo.run.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml deleted file mode 100644 index 710e3e6..0000000 --- a/config/checkstyle/checkstyle.xml +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java b/universe-client-demo/src/main/java/software/xdev/Application.java similarity index 64% rename from universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java rename to universe-client-demo/src/main/java/software/xdev/Application.java index 8e04eb9..4516057 100644 --- a/universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java +++ b/universe-client-demo/src/main/java/software/xdev/Application.java @@ -1,4 +1,4 @@ -package software.xdev.universe.demo; +package software.xdev; import java.awt.Desktop; import java.io.IOException; @@ -7,52 +7,51 @@ import java.util.List; import java.util.Scanner; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - import software.xdev.universe.UniverseClient; +import software.xdev.universe.UniverseConfiguration; import software.xdev.universe.requests.get_attendees.Attendee; import software.xdev.universe.requests.get_attendees.DefaultQuestions; -import software.xdev.universe.requests.get_bearer_token.GetBearerTokenResponse; import software.xdev.universe.requests.get_buyers.Buyer; import software.xdev.universe.requests.get_events.Event; -public class Demo +public final class Application { - private static final Logger logger = LogManager.getLogger(Demo.class); - - public static void main(final String[] args) throws IOException, URISyntaxException + public static void main(final String[] args) { - final UniverseClient client = new UniverseClient(); + final UniverseClient client = new UniverseClient(new UniverseConfiguration( + System.getProperty("applicationId"), + System.getProperty("applicationSecret"), + System.getProperty("redirectUri"), + System.getProperty("authorizationCode"), + System.getProperty("bearerToken") + )); // STEP 1: Get Authorization Code // After getting the authorization code it must be set in the microprofile-config.properties // or through client.getConfig().withAuthorizationCode() - final String authorizationCode = openBrowserToGetAuthorizationCodeAndWaitForInput(); - client.getConfig().withAuthorizationCode(authorizationCode); + client.withAuthorizationCode(openBrowserToGetAuthorizationCodeAndWaitForInput(client)); // STEP 2: Get Bearer Token // After getting the bearer token it must be set in the microprofile-config.properties // or through client.getConfig().withBearerToken() - final GetBearerTokenResponse bearerToken = client.requestBearerToken(); - client.getConfig().withBearerToken(bearerToken.getAccessToken()); + client.withBearerToken(client.requestBearerToken().getAccessToken()); // STEP 3: Get Host Id final String hostId = client.requestHostId(); // STEP 4: Get Events final List events = client.requestEvents(hostId); - events.forEach(event -> logger.info("Event: " + event.getTitle() + "(id:" + event.getId() + ")")); + events.forEach(event -> System.out.println(("Event: " + event.getTitle() + "(id:" + event.getId() + ")"))); // STEP 5: Get Buyers final List buyers = client.requestBuyersInEvent(events.get(0).getId(), 5, 0); - buyers.forEach(buyer -> logger.info("Buyer: " + buyer.getName())); + buyers.forEach(buyer -> System.out.println(("Buyer: " + buyer.getName()))); // STEP 6: Get Attendees final List attendees = client.requestAttendeesInEvent(events.get(0).getId(), 5, 0); attendees.forEach(attendee -> - logger.info( + System.out.println( "Attendee: " + "\n Name: " + attendee.getTypedAnswerToQuestion(DefaultQuestions.FIRST_NAME) + " " + attendee.getTypedAnswerToQuestion(DefaultQuestions.LAST_NAME) @@ -64,17 +63,27 @@ public static void main(final String[] args) throws IOException, URISyntaxExcept ); } - private static String openBrowserToGetAuthorizationCodeAndWaitForInput() throws URISyntaxException, IOException + private static String openBrowserToGetAuthorizationCodeAndWaitForInput(final UniverseClient client) { - final UniverseClient client = new UniverseClient(); if(Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) { - Desktop.getDesktop().browse(new URI(client.getUrlToGetAuthorizationCode())); + try + { + Desktop.getDesktop().browse(new URI(client.getUrlToGetAuthorizationCode())); + } + catch(final IOException | URISyntaxException ex) + { + throw new RuntimeException(ex); + } } - try(Scanner scanner = new Scanner(System.in)) + try(final Scanner scanner = new Scanner(System.in)) { System.out.println("Please input displayed authorization code:"); return scanner.nextLine(); } } + + private Application() + { + } } diff --git a/universe-client-demo/src/main/resources/META-INF/microprofile-config-template.properties b/universe-client-demo/src/main/resources/META-INF/microprofile-config-template.properties deleted file mode 100644 index 2cab8fe..0000000 --- a/universe-client-demo/src/main/resources/META-INF/microprofile-config-template.properties +++ /dev/null @@ -1,5 +0,0 @@ -universe.application.id= -universe.application.secret= -universe.authorization.code= -universe.redirect.uri= -universe.bearer.token= diff --git a/universe-client-demo/src/main/resources/log4j2.xml b/universe-client-demo/src/main/resources/log4j2.xml deleted file mode 100644 index 1429811..0000000 --- a/universe-client-demo/src/main/resources/log4j2.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/universe-client/pom.xml b/universe-client/pom.xml index e468621..d23f6fc 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -84,6 +84,20 @@ + + + org.apache.httpcomponents + httpclient + 4.5.14 + + + + com.fasterxml.jackson.core + jackson-databind + 2.14.2 + + + diff --git a/universe-client/src/main/java/software/xdev/universe/HasLogger.java b/universe-client/src/main/java/software/xdev/universe/HasLogger.java deleted file mode 100644 index addd1c1..0000000 --- a/universe-client/src/main/java/software/xdev/universe/HasLogger.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright © 2023 XDEV Software (https://xdev.software) - * - * 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 software.xdev.universe; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - - -public interface HasLogger -{ - default Logger getLogger() - { - return LogManager.getLogger(this.getClass()); - } -} diff --git a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java index f4fa822..5c09b6c 100644 --- a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java +++ b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java @@ -18,6 +18,7 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; +import java.io.UncheckedIOException; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.stream.Collectors; @@ -42,6 +43,7 @@ import software.xdev.universe.requests.get_buyers.Buyer; import software.xdev.universe.requests.get_buyers.GetBuyersRequest; import software.xdev.universe.requests.get_buyers.GetBuyersResponse; +import software.xdev.universe.requests.get_buyers.Node; import software.xdev.universe.requests.get_events.Event; import software.xdev.universe.requests.get_events.GetEventsRequest; import software.xdev.universe.requests.get_events.GetEventsResponse; @@ -50,25 +52,43 @@ /** - * Client to communicate with the sessionize API. + * Client to communicate with the universe API. */ -public class UniverseClient implements HasLogger +public class UniverseClient { public static final String UNIVERSE_GRAPHQL_URL = "https://www.universe.com/graphql"; public static final String UNIVERSE_OAUTH_TOKEN = "https://www.universe.com/oauth/token"; public static final String UNIVERSE_OAUTH_AUTHORIZE_URL = "https://www.universe.com/oauth/authorize"; - private final ObjectMapper objectMapper = new ObjectMapper(); - private UniverseConfiguration config = new UniverseConfiguration(); - public UniverseClient withConfig(UniverseConfiguration config) + protected final ObjectMapper objectMapper = new ObjectMapper(); + + protected String applicationId; + protected String applicationSecret; + protected String redirectUri; + + protected String authorizationCode; + + protected String bearerToken; + + public UniverseClient(final UniverseConfiguration config) + { + this.applicationId = config.applicationId(); + this.applicationSecret = config.applicationSecret(); + this.redirectUri = config.redirectUri(); + this.authorizationCode = config.authorizationCode(); + this.bearerToken = config.bearerToken(); + } + + public UniverseClient withAuthorizationCode(final String authorizationCode) { - this.config = config; + this.authorizationCode = authorizationCode; return this; } - public UniverseConfiguration getConfig() + public UniverseClient withBearerToken(final String bearerToken) { - return this.config; + this.bearerToken = bearerToken; + return this; } /** @@ -79,9 +99,9 @@ public UniverseConfiguration getConfig() */ public String getUrlToGetAuthorizationCode() { - return getUrlToGetAuthorizationCode( - getConfig().getApplicationId(), - getConfig().getRedirectUri() + return this.getUrlToGetAuthorizationCode( + this.applicationId, + this.redirectUri ); } @@ -93,23 +113,22 @@ public String getUrlToGetAuthorizationCode() */ public String getUrlToGetAuthorizationCode( final String applicationId, - final String redirectUri - ) + final String redirectUri) { - return UNIVERSE_OAUTH_AUTHORIZE_URL + "?" - + "response_type=code&" - + "scope=public&" - + "client_id=" + applicationId + return UNIVERSE_OAUTH_AUTHORIZE_URL + + "?response_type=code" + + "&scope=public" + + "&client_id=" + applicationId + "&redirect_uri=" + redirectUri; } - public GetBearerTokenResponse requestBearerToken() throws IOException + public GetBearerTokenResponse requestBearerToken() { - return requestBearerToken( - getConfig().getApplicationId(), - getConfig().getApplicationSecret(), - getConfig().getAuthorizationCode(), - getConfig().getRedirectUri() + return this.requestBearerToken( + this.applicationId, + this.applicationSecret, + this.authorizationCode, + this.redirectUri ); } @@ -117,14 +136,12 @@ public GetBearerTokenResponse requestBearerToken( final String applicationId, final String applicationSecret, final String authorizationCode, - final String redirectUri - ) throws IOException + final String redirectUri) { final GetBearerTokenRequest getBearerTokenRequest = new GetBearerTokenRequest(); - final GetBearerTokenResponse responseGetBearerToken = - sendRequestAndParseResponse( + return this.sendRequestAndParseResponse( getBearerTokenRequest, - sendPostMessage( + this.sendPostMessage( UNIVERSE_OAUTH_TOKEN, getBearerTokenRequest.getQuery( applicationId, @@ -134,15 +151,14 @@ public GetBearerTokenResponse requestBearerToken( ) ) ); - return responseGetBearerToken; } /** * @param eventId to get the events from */ - public List requestBuyersInEvent(String eventId) throws IOException + public List requestBuyersInEvent(final String eventId) { - return requestBuyersInEvent(eventId, 0, 0); + return this.requestBuyersInEvent(eventId, 0, 0); } /** @@ -150,16 +166,16 @@ public List requestBuyersInEvent(String eventId) throws IOException * @param limit 0 is unlimited, 50 is max amount. Default is 0 * @param offset Default is 0 */ - public List requestBuyersInEvent(String eventId, int limit, int offset) throws IOException + public List requestBuyersInEvent(final String eventId, final int limit, final int offset) { final GetBuyersRequest getBuyersRequest = new GetBuyersRequest(); final GetBuyersResponse responseGetBuyers = - sendRequestAndParseResponse( + this.sendRequestAndParseResponse( getBuyersRequest, - sendPostMessage( + this.sendPostMessage( UNIVERSE_GRAPHQL_URL, getBuyersRequest.getQuery(eventId, limit, offset), - getConfig().getBearerToken() + this.bearerToken ) ); return responseGetBuyers.getData() @@ -167,16 +183,16 @@ public List requestBuyersInEvent(String eventId, int limit, int offset) t .getOrders() .getNodes() .stream() - .map(node -> node.getBuyer()) + .map(Node::getBuyer) .collect(Collectors.toList()); } /** * @param eventId to get the events from */ - public List requestAttendeesInEvent(String eventId) throws IOException + public List requestAttendeesInEvent(final String eventId) { - return requestAttendeesInEvent(eventId, 0, 0); + return this.requestAttendeesInEvent(eventId, 0, 0); } /** @@ -184,16 +200,16 @@ public List requestAttendeesInEvent(String eventId) throws IOException * @param limit 0 is unlimited, 50 is max amount. Default is 0 * @param offset Default is 0 */ - public List requestAttendeesInEvent(String eventId, int limit, int offset) throws IOException + public List requestAttendeesInEvent(final String eventId, final int limit, final int offset) { final GetAttendeesRequest getBuyersRequest = new GetAttendeesRequest(); final GetAttendeesResponse responseGetBuyers = - sendRequestAndParseResponse( + this.sendRequestAndParseResponse( getBuyersRequest, - sendPostMessage( + this.sendPostMessage( UNIVERSE_GRAPHQL_URL, getBuyersRequest.getQuery(eventId, limit, offset), - getConfig().getBearerToken() + this.bearerToken ) ); return responseGetBuyers.getData() @@ -201,89 +217,103 @@ public List requestAttendeesInEvent(String eventId, int limit, int off .getAttendees().getNodes(); } - public String requestHostId() throws IOException + public String requestHostId() { final GetHostRequest getHostRequest = new GetHostRequest(); final GetHostResponse getHostResponse = - sendRequestAndParseResponse( + this.sendRequestAndParseResponse( getHostRequest, - sendPostMessage( + this.sendPostMessage( UNIVERSE_GRAPHQL_URL, getHostRequest.getQuery(), - getConfig().getBearerToken() + this.bearerToken ) ); return getHostResponse.getData().getViewer().getId(); } - public List requestEvents(String hostId) throws IOException + public List requestEvents(final String hostId) { final GetEventsRequest getEventsRequest = new GetEventsRequest(); final GetEventsResponse getEventsResponse = - sendRequestAndParseResponse( + this.sendRequestAndParseResponse( getEventsRequest, - sendPostMessage( + this.sendPostMessage( UNIVERSE_GRAPHQL_URL, getEventsRequest.getQuery(hostId, 0), - getConfig().getBearerToken() + this.bearerToken ) ); return getEventsResponse.getData().getHost().getEvents().getNodes(); } private T sendRequestAndParseResponse( - UniverseRequest request, - HttpResponse httpResponse) throws IOException + final UniverseRequest request, + final HttpResponse httpResponse) { - final String responseAsString = sendRequest(httpResponse); - return objectMapper.readValue(responseAsString, request.getResponseClass()); + try + { + final String responseAsString = this.sendRequest(httpResponse); + return this.objectMapper.readValue(responseAsString, request.getResponseClass()); + } + catch(final IOException ioe) + { + throw new UncheckedIOException(ioe); + } } - private String sendRequest(HttpResponse httpResponse) throws IOException + private String sendRequest(final HttpResponse httpResponse) throws IOException { - this.getLogger().debug("StatusCode: " + httpResponse.getStatusLine().getStatusCode()); - try(BufferedReader reader = new BufferedReader(new InputStreamReader(httpResponse.getEntity() + try(final BufferedReader reader = new BufferedReader(new InputStreamReader(httpResponse.getEntity() .getContent(), StandardCharsets.UTF_8))) { - String responseString = reader.lines().parallel().collect(Collectors.joining("\n")); - this.getLogger().debug("ResponseString: " + responseString); - return responseString; + return reader.lines().collect(Collectors.joining("\n")); } } private HttpResponse sendPostMessage( final String urlToCall, final String jsonData, - final String bearerToken) throws IOException + final String bearerToken) { - HttpClient httpClient = HttpClients.custom() + final HttpClient httpClient = HttpClients.custom() .setDefaultRequestConfig(RequestConfig.custom() .setCookieSpec(CookieSpecs.STANDARD).build()) .build(); - HttpPost con2 = new HttpPost(urlToCall); - con2.addHeader( - "Authorization", - "Bearer " + bearerToken); - con2.addHeader("Content-Type", "application/json"); - con2.setEntity(new StringEntity(jsonData, ContentType.APPLICATION_JSON)); + final HttpPost post = new HttpPost(urlToCall); + post.addHeader("Authorization", "Bearer " + bearerToken); + post.addHeader("Content-Type", "application/json"); + post.setEntity(new StringEntity(jsonData, ContentType.APPLICATION_JSON)); - this.getLogger().debug("Request: " + con2); - return httpClient.execute(con2); + try + { + return httpClient.execute(post); + } + catch(final IOException ioe) + { + throw new UncheckedIOException(ioe); + } } private HttpResponse sendPostMessage( final String urlToCall, - final String jsonData) throws IOException + final String jsonData) { - HttpClient httpClient = HttpClients.custom() + final HttpClient httpClient = HttpClients.custom() .setDefaultRequestConfig(RequestConfig.custom() .setCookieSpec(CookieSpecs.STANDARD).build()) .build(); - HttpPost con2 = new HttpPost(urlToCall); - con2.addHeader("Content-Type", "application/json"); - con2.setEntity(new StringEntity(jsonData, ContentType.APPLICATION_JSON)); + final HttpPost post = new HttpPost(urlToCall); + post.addHeader("Content-Type", "application/json"); + post.setEntity(new StringEntity(jsonData, ContentType.APPLICATION_JSON)); - this.getLogger().debug("Request: " + con2); - return httpClient.execute(con2); + try + { + return httpClient.execute(post); + } + catch(final IOException e) + { + throw new UncheckedIOException(e); + } } } diff --git a/universe-client/src/main/java/software/xdev/universe/UniverseConfiguration.java b/universe-client/src/main/java/software/xdev/universe/UniverseConfiguration.java index 1744e03..54d3ab2 100644 --- a/universe-client/src/main/java/software/xdev/universe/UniverseConfiguration.java +++ b/universe-client/src/main/java/software/xdev/universe/UniverseConfiguration.java @@ -15,111 +15,12 @@ */ package software.xdev.universe; -import org.eclipse.microprofile.config.ConfigProvider; - - -public class UniverseConfiguration +public record UniverseConfiguration( + String applicationId, + String applicationSecret, + String redirectUri, + String authorizationCode, + String bearerToken +) { - public static final String PROPERTY_KEY_APPLICATION_ID = "universe.application.id"; - public static final String PROPERTY_KEY_APPLICATION_SECRET = "universe.application.secret"; - public static final String PROPERTY_KEY_AUTHORIZATION_CODE = "universe.authorization.code"; - public static final String PROPERTY_KEY_REDIRECT_URI = "universe.redirect.uri"; - public static final String PROPERTY_KEY_BEARER_TOKEN = "universe.bearer.token"; - - private String applicationId; - private String applicationSecret; - private String authorizationCode; - private String redirectUri; - private String bearerToken; - - public UniverseConfiguration withApplicationId(final String applicationId) - { - this.applicationId = applicationId; - return this; - } - - public String getApplicationId() - { - if(this.applicationId == null) - { - this.applicationId = ConfigProvider.getConfig().getValue(PROPERTY_KEY_APPLICATION_ID, String.class); - return this.applicationId; - } - return this.applicationId; - } - - public UniverseConfiguration withApplicationSecret(final String applicationSecret) - { - this.applicationSecret = applicationSecret; - return this; - } - - public String getApplicationSecret() - { - if(this.applicationSecret == null) - { - this.applicationSecret = ConfigProvider.getConfig().getValue( - PROPERTY_KEY_APPLICATION_SECRET, - String.class); - return this.applicationSecret; - } - return this.applicationSecret; - } - - public UniverseConfiguration withAuthorizationCode(final String authorizationCode) - { - this.authorizationCode = authorizationCode; - return this; - } - - public String getAuthorizationCode() - { - if(this.authorizationCode == null) - { - this.authorizationCode = ConfigProvider.getConfig().getValue( - PROPERTY_KEY_AUTHORIZATION_CODE, - String.class); - return this.authorizationCode; - } - return this.authorizationCode; - } - - public UniverseConfiguration withRedirectUri(final String redirectUri) - { - this.redirectUri = redirectUri; - return this; - } - - /** - * Default value: {@code urn:ietf:wg:oauth:2.0:oob} which is the value for local calls. - */ - public String getRedirectUri() - { - if(this.redirectUri == null) - { - this.redirectUri = ConfigProvider.getConfig().getValue(PROPERTY_KEY_REDIRECT_URI, String.class); - if(this.redirectUri == null) - { - return "urn:ietf:wg:oauth:2.0:oob"; - } - return this.redirectUri; - } - return this.redirectUri; - } - - public UniverseConfiguration withBearerToken(final String bearerToken) - { - this.bearerToken = bearerToken; - return this; - } - - public String getBearerToken() - { - if(this.bearerToken == null) - { - this.bearerToken = ConfigProvider.getConfig().getValue(PROPERTY_KEY_BEARER_TOKEN, String.class); - return this.bearerToken; - } - return this.bearerToken; - } } From 3bfdf9d3efba339deaa003dfd002c769c4a5d397 Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 10 Apr 2024 16:08:11 +0200 Subject: [PATCH 83/99] Prep 2.0.0 --- CHANGELOG.md | 7 ++++++- pom.xml | 2 +- universe-client-demo/pom.xml | 4 +--- universe-client/pom.xml | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf92f77..39e1178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ -# 1.0.0 +# 2.0.0 +Major refactoring +* Now requires less dependencies +* API was changed so that it's easier usable +* Requires Java 17+ +# 1.0.0 Initial release diff --git a/pom.xml b/pom.xml index a9748a6..c963391 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client-root - 1.0.2-SNAPSHOT + 2.0.0-SNAPSHOT pom diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index f0193e2..f6c9d7a 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -6,11 +6,9 @@ software.xdev universe-client-demo - 1.0.0-SNAPSHOT + 2.0.0-SNAPSHOT jar - 2022 - XDEV Software https://xdev.software diff --git a/universe-client/pom.xml b/universe-client/pom.xml index d23f6fc..a1bde8c 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client - 1.0.0-SNAPSHOT + 2.0.0-SNAPSHOT jar universe-client From 5dd7f97d447cd50c65bf13cf4af9c4a1396bf1ef Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 10 Apr 2024 16:10:51 +0200 Subject: [PATCH 84/99] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1d68089..6252fca 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ # Universe client for Java +A simple Java client for the [Universe API](https://universe.com/api). + ## Usage Before you can start, there are a few config-entries that must be set. From d52de68b8c37067ae24fdb29b6c299db66fc41d6 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Wed, 10 Apr 2024 14:12:32 +0000 Subject: [PATCH 85/99] Update dependency com.fasterxml.jackson.core:jackson-databind to v2.17.0 --- universe-client/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/universe-client/pom.xml b/universe-client/pom.xml index a1bde8c..3f747c0 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -94,7 +94,7 @@ com.fasterxml.jackson.core jackson-databind - 2.14.2 + 2.17.0
From cb5dc156a12137d151629ab785c028b5371f3dcf Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 10 Apr 2024 16:28:33 +0200 Subject: [PATCH 86/99] Use httpclient5 --- CHANGELOG.md | 1 + .../main/java/software/xdev/Application.java | 8 +-- universe-client/pom.xml | 6 +- .../xdev/universe/UniverseClient.java | 69 +++++++++---------- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39e1178..d5ae935 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * Now requires less dependencies * API was changed so that it's easier usable * Requires Java 17+ +* Updated dependencies # 1.0.0 Initial release diff --git a/universe-client-demo/src/main/java/software/xdev/Application.java b/universe-client-demo/src/main/java/software/xdev/Application.java index 4516057..9a75d64 100644 --- a/universe-client-demo/src/main/java/software/xdev/Application.java +++ b/universe-client-demo/src/main/java/software/xdev/Application.java @@ -2,8 +2,8 @@ import java.awt.Desktop; import java.io.IOException; +import java.io.UncheckedIOException; import java.net.URI; -import java.net.URISyntaxException; import java.util.List; import java.util.Scanner; @@ -69,11 +69,11 @@ private static String openBrowserToGetAuthorizationCodeAndWaitForInput(final Uni { try { - Desktop.getDesktop().browse(new URI(client.getUrlToGetAuthorizationCode())); + Desktop.getDesktop().browse(URI.create(client.getUrlToGetAuthorizationCode())); } - catch(final IOException | URISyntaxException ex) + catch(final IOException ex) { - throw new RuntimeException(ex); + throw new UncheckedIOException(ex); } } try(final Scanner scanner = new Scanner(System.in)) diff --git a/universe-client/pom.xml b/universe-client/pom.xml index a1bde8c..7f4fddd 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -86,9 +86,9 @@ - org.apache.httpcomponents - httpclient - 4.5.14 + org.apache.httpcomponents.client5 + httpclient5 + 5.3.1 diff --git a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java index 5c09b6c..bc29751 100644 --- a/universe-client/src/main/java/software/xdev/universe/UniverseClient.java +++ b/universe-client/src/main/java/software/xdev/universe/UniverseClient.java @@ -15,22 +15,17 @@ */ package software.xdev.universe; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStreamReader; import java.io.UncheckedIOException; -import java.nio.charset.StandardCharsets; import java.util.List; import java.util.stream.Collectors; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.config.CookieSpecs; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClients; +import org.apache.hc.client5.http.classic.methods.HttpPost; +import org.apache.hc.client5.http.impl.classic.BasicHttpClientResponseHandler; +import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; +import org.apache.hc.client5.http.impl.classic.HttpClients; +import org.apache.hc.core5.http.ContentType; +import org.apache.hc.core5.http.io.entity.StringEntity; import com.fasterxml.jackson.databind.ObjectMapper; @@ -54,7 +49,7 @@ /** * Client to communicate with the universe API. */ -public class UniverseClient +public class UniverseClient implements AutoCloseable { public static final String UNIVERSE_GRAPHQL_URL = "https://www.universe.com/graphql"; public static final String UNIVERSE_OAUTH_TOKEN = "https://www.universe.com/oauth/token"; @@ -70,13 +65,22 @@ public class UniverseClient protected String bearerToken; + protected CloseableHttpClient httpClient; + public UniverseClient(final UniverseConfiguration config) + { + this(config, HttpClients.createDefault()); + } + + public UniverseClient(final UniverseConfiguration config, final CloseableHttpClient httpClient) { this.applicationId = config.applicationId(); this.applicationSecret = config.applicationSecret(); this.redirectUri = config.redirectUri(); this.authorizationCode = config.authorizationCode(); this.bearerToken = config.bearerToken(); + + this.httpClient = httpClient; } public UniverseClient withAuthorizationCode(final String authorizationCode) @@ -249,11 +253,10 @@ public List requestEvents(final String hostId) private T sendRequestAndParseResponse( final UniverseRequest request, - final HttpResponse httpResponse) + final String responseAsString) { try { - final String responseAsString = this.sendRequest(httpResponse); return this.objectMapper.readValue(responseAsString, request.getResponseClass()); } catch(final IOException ioe) @@ -262,24 +265,11 @@ private T sendRequestAndParseResponse( } } - private String sendRequest(final HttpResponse httpResponse) throws IOException - { - try(final BufferedReader reader = new BufferedReader(new InputStreamReader(httpResponse.getEntity() - .getContent(), StandardCharsets.UTF_8))) - { - return reader.lines().collect(Collectors.joining("\n")); - } - } - - private HttpResponse sendPostMessage( + private String sendPostMessage( final String urlToCall, final String jsonData, final String bearerToken) { - final HttpClient httpClient = HttpClients.custom() - .setDefaultRequestConfig(RequestConfig.custom() - .setCookieSpec(CookieSpecs.STANDARD).build()) - .build(); final HttpPost post = new HttpPost(urlToCall); post.addHeader("Authorization", "Bearer " + bearerToken); post.addHeader("Content-Type", "application/json"); @@ -287,7 +277,7 @@ private HttpResponse sendPostMessage( try { - return httpClient.execute(post); + return this.httpClient.execute(post, new BasicHttpClientResponseHandler()); } catch(final IOException ioe) { @@ -295,21 +285,30 @@ private HttpResponse sendPostMessage( } } - private HttpResponse sendPostMessage( + private String sendPostMessage( final String urlToCall, final String jsonData) { - final HttpClient httpClient = HttpClients.custom() - .setDefaultRequestConfig(RequestConfig.custom() - .setCookieSpec(CookieSpecs.STANDARD).build()) - .build(); final HttpPost post = new HttpPost(urlToCall); post.addHeader("Content-Type", "application/json"); post.setEntity(new StringEntity(jsonData, ContentType.APPLICATION_JSON)); try { - return httpClient.execute(post); + return this.httpClient.execute(post, new BasicHttpClientResponseHandler()); + } + catch(final IOException e) + { + throw new UncheckedIOException(e); + } + } + + @Override + public void close() + { + try + { + this.httpClient.close(); } catch(final IOException e) { From d1436ad52f6953baa92045ff7a5de30ac15fbd43 Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 10 Apr 2024 16:33:45 +0200 Subject: [PATCH 87/99] Fix checkstyle --- .../requests/get_attendees/Answer.java | 12 ++-- .../requests/get_attendees/Attendee.java | 44 +++++++-------- .../requests/get_attendees/Attendees.java | 8 +-- .../universe/requests/get_attendees/Data.java | 8 +-- .../get_attendees/DefaultQuestions.java | 21 ++++--- .../requests/get_attendees/Event.java | 8 +-- .../get_attendees/GetAttendeesRequest.java | 2 +- .../get_attendees/GetAttendeesResponse.java | 8 +-- .../requests/get_attendees/Order.java | 12 ++-- .../requests/get_attendees/Question.java | 16 +++--- .../universe/requests/get_attendees/Rate.java | 8 +-- .../GetBearerTokenResponse.java | 30 +++++----- .../universe/requests/get_buyers/Buyer.java | 56 +++++++++---------- .../universe/requests/get_buyers/Data.java | 8 +-- .../universe/requests/get_buyers/Event.java | 8 +-- .../requests/get_buyers/GetBuyersRequest.java | 2 +- .../get_buyers/GetBuyersResponse.java | 8 +-- .../universe/requests/get_buyers/Node.java | 8 +-- .../universe/requests/get_buyers/Orders.java | 8 +-- .../universe/requests/get_events/Data.java | 8 +-- .../universe/requests/get_events/Event.java | 20 +++---- .../universe/requests/get_events/Events.java | 8 +-- .../requests/get_events/GetEventsRequest.java | 2 +- .../get_events/GetEventsResponse.java | 8 +-- .../universe/requests/get_events/Host.java | 8 +-- .../xdev/universe/requests/get_host/Data.java | 8 +-- .../requests/get_host/GetHostResponse.java | 8 +-- .../universe/requests/get_host/Viewer.java | 16 +++--- 28 files changed, 183 insertions(+), 178 deletions(-) diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Answer.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Answer.java index 37f5120..815f83b 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Answer.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Answer.java @@ -35,7 +35,7 @@ public class Answer { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("question") private Question question; @JsonProperty("value") @@ -44,11 +44,11 @@ public class Answer @JsonProperty("question") public Question getQuestion() { - return question; + return this.question; } @JsonProperty("question") - public void setQuestion(Question question) + public void setQuestion(final Question question) { this.question = question; } @@ -56,11 +56,11 @@ public void setQuestion(Question question) @JsonProperty("value") public String getValue() { - return value; + return this.value; } @JsonProperty("value") - public void setValue(String value) + public void setValue(final String value) { this.value = value; } @@ -72,7 +72,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendee.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendee.java index d82539d..d963bb1 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendee.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendee.java @@ -43,7 +43,7 @@ public class Attendee { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("id") private String id; @JsonProperty("firstName") @@ -62,11 +62,11 @@ public class Attendee @JsonProperty("id") public String getId() { - return id; + return this.id; } @JsonProperty("id") - public void setId(String id) + public void setId(final String id) { this.id = id; } @@ -74,11 +74,11 @@ public void setId(String id) @JsonProperty("firstName") public String getFirstName() { - return firstName; + return this.firstName; } @JsonProperty("firstName") - public void setFirstName(String firstName) + public void setFirstName(final String firstName) { this.firstName = firstName; } @@ -86,11 +86,11 @@ public void setFirstName(String firstName) @JsonProperty("lastName") public String getLastName() { - return lastName; + return this.lastName; } @JsonProperty("lastName") - public void setLastName(String lastName) + public void setLastName(final String lastName) { this.lastName = lastName; } @@ -98,11 +98,11 @@ public void setLastName(String lastName) @JsonProperty("email") public String getEmail() { - return email; + return this.email; } @JsonProperty("email") - public void setEmail(String email) + public void setEmail(final String email) { this.email = email; } @@ -110,11 +110,11 @@ public void setEmail(String email) @JsonProperty("rate") public Rate getRate() { - return rate; + return this.rate; } @JsonProperty("rate") - public void setRate(Rate rate) + public void setRate(final Rate rate) { this.rate = rate; } @@ -122,11 +122,11 @@ public void setRate(Rate rate) @JsonProperty("order") public Order getOrder() { - return order; + return this.order; } @JsonProperty("order") - public void setOrder(Order order) + public void setOrder(final Order order) { this.order = order; } @@ -134,11 +134,11 @@ public void setOrder(Order order) @JsonProperty("answers") public List getAnswers() { - return answers; + return this.answers; } @JsonProperty("answers") - public void setAnswers(List answers) + public void setAnswers(final List answers) { this.answers = answers; } @@ -150,7 +150,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } @@ -158,9 +158,9 @@ public void setAdditionalProperty(String name, Object value) /** * @return {@code null} if no Question or answer is found */ - public String getUntypedAnswerToQuestion(String question) + public String getUntypedAnswerToQuestion(final String question) { - return getTypedAnswerToQuestion( + return this.getTypedAnswerToQuestion( new TypedQuestion<>( question, value -> value) @@ -172,7 +172,7 @@ public String getUntypedAnswerToQuestion(String question) * * @return {@code null} if no Question or answer is found */ - public T getTypedAnswerToQuestion(TypedQuestion question) + public T getTypedAnswerToQuestion(final TypedQuestion question) { final Optional answerForQuestion = this.getAnswers().stream().filter( answer -> question.getQuestionTitle().equals(answer.getQuestion().getQuestion()) @@ -189,7 +189,7 @@ public static class TypedQuestion private final String questionTitle; private final Function parseFunction; - TypedQuestion(String questionTitle, Function parseFunction) + TypedQuestion(final String questionTitle, final Function parseFunction) { this.questionTitle = questionTitle; this.parseFunction = parseFunction; @@ -200,9 +200,9 @@ public String getQuestionTitle() return this.questionTitle; } - public T parseValue(String value) + public T parseValue(final String value) { - return parseFunction.apply(value); + return this.parseFunction.apply(value); } } } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendees.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendees.java index fab5ea6..1d99f5d 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendees.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Attendees.java @@ -35,18 +35,18 @@ public class Attendees { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("nodes") private List nodes; @JsonProperty("nodes") public List getNodes() { - return nodes; + return this.nodes; } @JsonProperty("nodes") - public void setNodes(List nodes) + public void setNodes(final List nodes) { this.nodes = nodes; } @@ -58,7 +58,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Data.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Data.java index 9e1fc41..83ccae5 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Data.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Data.java @@ -36,16 +36,16 @@ public class Data @JsonProperty("event") private Event event; @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("event") public Event getEvent() { - return event; + return this.event; } @JsonProperty("event") - public void setEvent(Event event) + public void setEvent(final Event event) { this.event = event; } @@ -57,7 +57,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/DefaultQuestions.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/DefaultQuestions.java index 8297b57..c2d03a6 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/DefaultQuestions.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/DefaultQuestions.java @@ -15,23 +15,28 @@ */ package software.xdev.universe.requests.get_attendees; -public class DefaultQuestions +public final class DefaultQuestions { - public static Attendee.TypedQuestion COMPANY = new Attendee.TypedQuestion<>( + public static final Attendee.TypedQuestion COMPANY = new Attendee.TypedQuestion<>( "Company / Organisation", value -> value); - public static Attendee.TypedQuestion JOB_TITLE = - new Attendee.TypedQuestion<>("Job Title", value -> value); - public static Attendee.TypedQuestion COUNTRY = new Attendee.TypedQuestion<>( + public static final Attendee.TypedQuestion JOB_TITLE = new Attendee.TypedQuestion<>( + "Job Title", + value -> value); + public static final Attendee.TypedQuestion COUNTRY = new Attendee.TypedQuestion<>( "Country", value -> value); - public static Attendee.TypedQuestion FIRST_NAME = new Attendee.TypedQuestion<>( + public static final Attendee.TypedQuestion FIRST_NAME = new Attendee.TypedQuestion<>( "First Name", value -> value); - public static Attendee.TypedQuestion LAST_NAME = new Attendee.TypedQuestion<>( + public static final Attendee.TypedQuestion LAST_NAME = new Attendee.TypedQuestion<>( "Last Name", value -> value); - public static Attendee.TypedQuestion EMAIL = new Attendee.TypedQuestion<>( + public static final Attendee.TypedQuestion EMAIL = new Attendee.TypedQuestion<>( "Email", value -> value); + + private DefaultQuestions() + { + } } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Event.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Event.java index 69c8bfc..6607514 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Event.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Event.java @@ -36,16 +36,16 @@ public class Event @JsonProperty("attendees") private Attendees attendees; @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("attendees") public Attendees getAttendees() { - return attendees; + return this.attendees; } @JsonProperty("attendees") - public void setAttendees(Attendees attendees) + public void setAttendees(final Attendees attendees) { this.attendees = attendees; } @@ -57,7 +57,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesRequest.java index 9dc5a97..f501a8c 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesRequest.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesRequest.java @@ -26,7 +26,7 @@ public Class getResponseClass() return GetAttendeesResponse.class; } - public final String getQuery(String eventId, int limit, int offset) + public final String getQuery(final String eventId, final int limit, final int offset) { return "{ \"query\": \"{ event(id: \\\"" + eventId + "\\\") {" + " attendees {" diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesResponse.java index 9f850e6..7048154 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesResponse.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/GetAttendeesResponse.java @@ -36,16 +36,16 @@ public class GetAttendeesResponse @JsonProperty("data") private Data data; @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("data") public Data getData() { - return data; + return this.data; } @JsonProperty("data") - public void setData(Data data) + public void setData(final Data data) { this.data = data; } @@ -57,7 +57,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Order.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Order.java index a57e1a9..284aadf 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Order.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Order.java @@ -39,16 +39,16 @@ public class Order @JsonProperty("id") private String id; @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("state") public String getState() { - return state; + return this.state; } @JsonProperty("state") - public void setState(String state) + public void setState(final String state) { this.state = state; } @@ -56,11 +56,11 @@ public void setState(String state) @JsonProperty("id") public String getId() { - return id; + return this.id; } @JsonProperty("id") - public void setId(String id) + public void setId(final String id) { this.id = id; } @@ -72,7 +72,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Question.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Question.java index 9c1bf00..4ee085e 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Question.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Question.java @@ -42,16 +42,16 @@ public class Question @JsonProperty("type") private String type; @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("id") public String getId() { - return id; + return this.id; } @JsonProperty("id") - public void setId(String id) + public void setId(final String id) { this.id = id; } @@ -59,11 +59,11 @@ public void setId(String id) @JsonProperty("question") public String getQuestion() { - return question; + return this.question; } @JsonProperty("question") - public void setQuestion(String question) + public void setQuestion(final String question) { this.question = question; } @@ -71,11 +71,11 @@ public void setQuestion(String question) @JsonProperty("type") public String getType() { - return type; + return this.type; } @JsonProperty("type") - public void setType(String type) + public void setType(final String type) { this.type = type; } @@ -87,7 +87,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Rate.java b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Rate.java index ce84514..4c06086 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Rate.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_attendees/Rate.java @@ -36,16 +36,16 @@ public class Rate @JsonProperty("name") private String name; @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("name") public String getName() { - return name; + return this.name; } @JsonProperty("name") - public void setName(String name) + public void setName(final String name) { this.name = name; } @@ -57,7 +57,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java index 625f5a5..90d3c4f 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_bearer_token/GetBearerTokenResponse.java @@ -40,7 +40,7 @@ public class GetBearerTokenResponse { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("access_token") private String accessToken; @JsonProperty("token_type") @@ -57,11 +57,11 @@ public class GetBearerTokenResponse @JsonProperty("access_token") public String getAccessToken() { - return accessToken; + return this.accessToken; } @JsonProperty("access_token") - public void setAccessToken(String accessToken) + public void setAccessToken(final String accessToken) { this.accessToken = accessToken; } @@ -69,11 +69,11 @@ public void setAccessToken(String accessToken) @JsonProperty("token_type") public String getTokenType() { - return tokenType; + return this.tokenType; } @JsonProperty("token_type") - public void setTokenType(String tokenType) + public void setTokenType(final String tokenType) { this.tokenType = tokenType; } @@ -84,28 +84,28 @@ public void setTokenType(String tokenType) @JsonProperty("expires_in") public Integer getExpiresIn() { - return expiresIn; + return this.expiresIn; } @JsonProperty("expires_in") - public void setExpiresIn(Integer expiresIn) + public void setExpiresIn(final Integer expiresIn) { this.expiresIn = expiresIn; } public Duration getExpiresInAsDuration() { - return Duration.ofSeconds(getExpiresIn()); + return Duration.ofSeconds(this.getExpiresIn()); } @JsonProperty("refresh_token") public String getRefreshToken() { - return refreshToken; + return this.refreshToken; } @JsonProperty("refresh_token") - public void setRefreshToken(String refreshToken) + public void setRefreshToken(final String refreshToken) { this.refreshToken = refreshToken; } @@ -113,11 +113,11 @@ public void setRefreshToken(String refreshToken) @JsonProperty("scope") public String getScope() { - return scope; + return this.scope; } @JsonProperty("scope") - public void setScope(String scope) + public void setScope(final String scope) { this.scope = scope; } @@ -125,11 +125,11 @@ public void setScope(String scope) @JsonProperty("created_at") public Integer getCreatedAt() { - return createdAt; + return this.createdAt; } @JsonProperty("created_at") - public void setCreatedAt(Integer createdAt) + public void setCreatedAt(final Integer createdAt) { this.createdAt = createdAt; } @@ -141,7 +141,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Buyer.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Buyer.java index 4988ad9..ee6a299 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Buyer.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Buyer.java @@ -46,7 +46,7 @@ public class Buyer { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("id") private String id; @JsonProperty("name") @@ -77,11 +77,11 @@ public class Buyer @JsonProperty("id") public String getId() { - return id; + return this.id; } @JsonProperty("id") - public void setId(String id) + public void setId(final String id) { this.id = id; } @@ -89,11 +89,11 @@ public void setId(String id) @JsonProperty("name") public String getName() { - return name; + return this.name; } @JsonProperty("name") - public void setName(String name) + public void setName(final String name) { this.name = name; } @@ -101,11 +101,11 @@ public void setName(String name) @JsonProperty("firstName") public String getFirstName() { - return firstName; + return this.firstName; } @JsonProperty("firstName") - public void setFirstName(String firstName) + public void setFirstName(final String firstName) { this.firstName = firstName; } @@ -113,11 +113,11 @@ public void setFirstName(String firstName) @JsonProperty("lastName") public String getLastName() { - return lastName; + return this.lastName; } @JsonProperty("lastName") - public void setLastName(String lastName) + public void setLastName(final String lastName) { this.lastName = lastName; } @@ -125,11 +125,11 @@ public void setLastName(String lastName) @JsonProperty("email") public String getEmail() { - return email; + return this.email; } @JsonProperty("email") - public void setEmail(String email) + public void setEmail(final String email) { this.email = email; } @@ -137,11 +137,11 @@ public void setEmail(String email) @JsonProperty("businessEmail") public Object getBusinessEmail() { - return businessEmail; + return this.businessEmail; } @JsonProperty("businessEmail") - public void setBusinessEmail(Object businessEmail) + public void setBusinessEmail(final Object businessEmail) { this.businessEmail = businessEmail; } @@ -149,11 +149,11 @@ public void setBusinessEmail(Object businessEmail) @JsonProperty("businessAddress") public Object getBusinessAddress() { - return businessAddress; + return this.businessAddress; } @JsonProperty("businessAddress") - public void setBusinessAddress(Object businessAddress) + public void setBusinessAddress(final Object businessAddress) { this.businessAddress = businessAddress; } @@ -161,11 +161,11 @@ public void setBusinessAddress(Object businessAddress) @JsonProperty("businessPhoneNumber") public Object getBusinessPhoneNumber() { - return businessPhoneNumber; + return this.businessPhoneNumber; } @JsonProperty("businessPhoneNumber") - public void setBusinessPhoneNumber(Object businessPhoneNumber) + public void setBusinessPhoneNumber(final Object businessPhoneNumber) { this.businessPhoneNumber = businessPhoneNumber; } @@ -173,11 +173,11 @@ public void setBusinessPhoneNumber(Object businessPhoneNumber) @JsonProperty("isBusinessSeller") public Boolean getIsBusinessSeller() { - return isBusinessSeller; + return this.isBusinessSeller; } @JsonProperty("isBusinessSeller") - public void setIsBusinessSeller(Boolean isBusinessSeller) + public void setIsBusinessSeller(final Boolean isBusinessSeller) { this.isBusinessSeller = isBusinessSeller; } @@ -185,11 +185,11 @@ public void setIsBusinessSeller(Boolean isBusinessSeller) @JsonProperty("locale") public String getLocale() { - return locale; + return this.locale; } @JsonProperty("locale") - public void setLocale(String locale) + public void setLocale(final String locale) { this.locale = locale; } @@ -197,11 +197,11 @@ public void setLocale(String locale) @JsonProperty("description") public Object getDescription() { - return description; + return this.description; } @JsonProperty("description") - public void setDescription(Object description) + public void setDescription(final Object description) { this.description = description; } @@ -209,11 +209,11 @@ public void setDescription(Object description) @JsonProperty("avatarUrl") public Object getAvatarUrl() { - return avatarUrl; + return this.avatarUrl; } @JsonProperty("avatarUrl") - public void setAvatarUrl(Object avatarUrl) + public void setAvatarUrl(final Object avatarUrl) { this.avatarUrl = avatarUrl; } @@ -221,11 +221,11 @@ public void setAvatarUrl(Object avatarUrl) @JsonProperty("smallAvatarUrl") public Object getSmallAvatarUrl() { - return smallAvatarUrl; + return this.smallAvatarUrl; } @JsonProperty("smallAvatarUrl") - public void setSmallAvatarUrl(Object smallAvatarUrl) + public void setSmallAvatarUrl(final Object smallAvatarUrl) { this.smallAvatarUrl = smallAvatarUrl; } @@ -237,7 +237,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Data.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Data.java index 066937a..638acdf 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Data.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Data.java @@ -34,18 +34,18 @@ public class Data { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("event") private Event event; @JsonProperty("event") public Event getEvent() { - return event; + return this.event; } @JsonProperty("event") - public void setEvent(Event event) + public void setEvent(final Event event) { this.event = event; } @@ -57,7 +57,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Event.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Event.java index 0ed075d..6dabbfc 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Event.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Event.java @@ -34,18 +34,18 @@ public class Event { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("orders") private Orders orders; @JsonProperty("orders") public Orders getOrders() { - return orders; + return this.orders; } @JsonProperty("orders") - public void setOrders(Orders orders) + public void setOrders(final Orders orders) { this.orders = orders; } @@ -57,7 +57,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java index 3ea5c19..40015f8 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersRequest.java @@ -26,7 +26,7 @@ public Class getResponseClass() return GetBuyersResponse.class; } - public final String getQuery(String eventId, int limit, int offset) + public final String getQuery(final String eventId, final int limit, final int offset) { return "{ \"query\": \"{ event(id: \\\"" + eventId + "\\\") { orders { " + "nodes(limit: " + limit + " offset: " + offset + ") {" diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersResponse.java index 2be0857..9ca48d3 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersResponse.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/GetBuyersResponse.java @@ -34,18 +34,18 @@ public class GetBuyersResponse { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("data") private Data data; @JsonProperty("data") public Data getData() { - return data; + return this.data; } @JsonProperty("data") - public void setData(Data data) + public void setData(final Data data) { this.data = data; } @@ -57,7 +57,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Node.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Node.java index 53c9c34..7d864a1 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Node.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Node.java @@ -34,18 +34,18 @@ public class Node { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("buyer") private Buyer buyer; @JsonProperty("buyer") public Buyer getBuyer() { - return buyer; + return this.buyer; } @JsonProperty("buyer") - public void setBuyer(Buyer buyer) + public void setBuyer(final Buyer buyer) { this.buyer = buyer; } @@ -57,7 +57,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Orders.java b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Orders.java index 8aec82f..7e289de 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Orders.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_buyers/Orders.java @@ -35,18 +35,18 @@ public class Orders { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("nodes") private List nodes; @JsonProperty("nodes") public List getNodes() { - return nodes; + return this.nodes; } @JsonProperty("nodes") - public void setNodes(List nodes) + public void setNodes(final List nodes) { this.nodes = nodes; } @@ -58,7 +58,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Data.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Data.java index 4e0eea8..5f33df1 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Data.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Data.java @@ -36,16 +36,16 @@ public class Data @JsonProperty("host") private Host host; @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("host") public Host getHost() { - return host; + return this.host; } @JsonProperty("host") - public void setHost(Host host) + public void setHost(final Host host) { this.host = host; } @@ -57,7 +57,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Event.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Event.java index 5274378..f27731d 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Event.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Event.java @@ -37,7 +37,7 @@ public class Event { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("id") private String id; @JsonProperty("title") @@ -50,11 +50,11 @@ public class Event @JsonProperty("id") public String getId() { - return id; + return this.id; } @JsonProperty("id") - public void setId(String id) + public void setId(final String id) { this.id = id; } @@ -62,11 +62,11 @@ public void setId(String id) @JsonProperty("title") public String getTitle() { - return title; + return this.title; } @JsonProperty("title") - public void setTitle(String title) + public void setTitle(final String title) { this.title = title; } @@ -74,11 +74,11 @@ public void setTitle(String title) @JsonProperty("description") public String getDescription() { - return description; + return this.description; } @JsonProperty("description") - public void setDescription(String description) + public void setDescription(final String description) { this.description = description; } @@ -86,11 +86,11 @@ public void setDescription(String description) @JsonProperty("url") public String getUrl() { - return url; + return this.url; } @JsonProperty("url") - public void setUrl(String url) + public void setUrl(final String url) { this.url = url; } @@ -102,7 +102,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Events.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Events.java index 2e40e2a..271767a 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Events.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Events.java @@ -35,18 +35,18 @@ public class Events { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("nodes") private List nodes; @JsonProperty("nodes") public List getNodes() { - return nodes; + return this.nodes; } @JsonProperty("nodes") - public void setNodes(List nodes) + public void setNodes(final List nodes) { this.nodes = nodes; } @@ -58,7 +58,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java index b4c7db4..53beaef 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsRequest.java @@ -26,7 +26,7 @@ public Class getResponseClass() return GetEventsResponse.class; } - public final String getQuery(final String hostId, int limit) + public final String getQuery(final String hostId, final int limit) { return "{ \"query\": \"{" + " host(id: \\\"" + hostId + "\\\") {" diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsResponse.java index 4e4a312..325bdb8 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsResponse.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/GetEventsResponse.java @@ -33,18 +33,18 @@ public class GetEventsResponse { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("data") private Data data; @JsonProperty("data") public Data getData() { - return data; + return this.data; } @JsonProperty("data") - public void setData(Data data) + public void setData(final Data data) { this.data = data; } @@ -56,7 +56,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Host.java b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Host.java index cecf838..e1a3640 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_events/Host.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_events/Host.java @@ -36,16 +36,16 @@ public class Host @JsonProperty("events") private Events events; @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("events") public Events getEvents() { - return events; + return this.events; } @JsonProperty("events") - public void setEvents(Events events) + public void setEvents(final Events events) { this.events = events; } @@ -57,7 +57,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_host/Data.java b/universe-client/src/main/java/software/xdev/universe/requests/get_host/Data.java index a37c7a4..ca1de05 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_host/Data.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_host/Data.java @@ -34,18 +34,18 @@ public class Data { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("viewer") private Viewer viewer; @JsonProperty("viewer") public Viewer getViewer() { - return viewer; + return this.viewer; } @JsonProperty("viewer") - public void setViewer(Viewer viewer) + public void setViewer(final Viewer viewer) { this.viewer = viewer; } @@ -57,7 +57,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostResponse.java b/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostResponse.java index f598239..a28e8d3 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostResponse.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_host/GetHostResponse.java @@ -36,16 +36,16 @@ public class GetHostResponse @JsonProperty("data") private Data data; @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("data") public Data getData() { - return data; + return this.data; } @JsonProperty("data") - public void setData(Data data) + public void setData(final Data data) { this.data = data; } @@ -57,7 +57,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } diff --git a/universe-client/src/main/java/software/xdev/universe/requests/get_host/Viewer.java b/universe-client/src/main/java/software/xdev/universe/requests/get_host/Viewer.java index a060a7d..1c4fac3 100644 --- a/universe-client/src/main/java/software/xdev/universe/requests/get_host/Viewer.java +++ b/universe-client/src/main/java/software/xdev/universe/requests/get_host/Viewer.java @@ -35,7 +35,7 @@ public class Viewer { @JsonIgnore - private final Map additionalProperties = new LinkedHashMap(); + private final Map additionalProperties = new LinkedHashMap<>(); @JsonProperty("id") private String id; @JsonProperty("firstName") @@ -46,11 +46,11 @@ public class Viewer @JsonProperty("id") public String getId() { - return id; + return this.id; } @JsonProperty("id") - public void setId(String id) + public void setId(final String id) { this.id = id; } @@ -58,11 +58,11 @@ public void setId(String id) @JsonProperty("firstName") public String getFirstName() { - return firstName; + return this.firstName; } @JsonProperty("firstName") - public void setFirstName(String firstName) + public void setFirstName(final String firstName) { this.firstName = firstName; } @@ -70,11 +70,11 @@ public void setFirstName(String firstName) @JsonProperty("lastName") public Object getLastName() { - return lastName; + return this.lastName; } @JsonProperty("lastName") - public void setLastName(Object lastName) + public void setLastName(final Object lastName) { this.lastName = lastName; } @@ -86,7 +86,7 @@ public Map getAdditionalProperties() } @JsonAnySetter - public void setAdditionalProperty(String name, Object value) + public void setAdditionalProperty(final String name, final Object value) { this.additionalProperties.put(name, value); } From 8edee87022f69d6494b172cf29278730de1e5e66 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:36:04 +0200 Subject: [PATCH 88/99] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6252fca..df980a7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # Universe client for Java -A simple Java client for the [Universe API](https://universe.com/api). +A simple Java client for the [Universe API](https://developers.universe.com). ## Usage From 272afa05df617675dac72cda3c311ef958334da3 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:38:40 +0200 Subject: [PATCH 89/99] Update README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index df980a7..06e4341 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,6 @@ A simple Java client for the [Universe API](https://developers.universe.com). ## Usage -Before you can start, there are a few config-entries that must be set. -They can get configured through the ``microprofile-config.properties`` (see [microprofile-config-template.properties](universe-client-demo/src/main/resources/META-INF/microprofile-config-template.properties))) -or through the UniverseConfiguration with ``client.getConfig().with...`` (see [Demo](universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java)). - The two basic entries are the ``ApplicationId`` and the ``RedirectUri``. They **must** be set. If these two entries are set, you need to get ``AuthorizationCode``. This is a one-time-only code, which From 296b88c79a54300e251bf0a1eef314bf9b989623 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:39:45 +0200 Subject: [PATCH 90/99] Update README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 06e4341..52fe1d5 100644 --- a/README.md +++ b/README.md @@ -21,15 +21,17 @@ The ``BearerToken`` can be used for all your future requests. It is usually vali If the ``BearerToken`` is set, you can use the actual API calls. ### Example -Full example, see [Demo](universe-client-demo/src/main/java/software/xdev/universe/demo/Demo.java). +Full example, see [Demo](universe-client-demo/src/main/java/software/xdev/Application.java). ```java -final UniverseClient client = new UniverseClient(); +UniverseClient client = new UniverseClient(yourConfig); + // Get Events -final List events = client.requestEvents(hostId); +List events = client.requestEvents(hostId); events.forEach(event -> logger.info("Event: " + event.getTitle() + "(id:" + event.getId() + ")")); + // Get Attendees -final List attendees = client.requestAttendeesInEvent(events.get(0).getId(), 5, 0); +List attendees = client.requestAttendeesInEvent(events.get(0).getId(), 5, 0); ``` ## GraphQL From 9481e827cf168c64f7d3f458379fbd9990c37eba Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 11 Apr 2024 09:42:40 +0000 Subject: [PATCH 91/99] Release 2.0.0 --- pom.xml | 2 +- universe-client-demo/pom.xml | 2 +- universe-client/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c963391..108389c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client-root - 2.0.0-SNAPSHOT + 2.0.0 pom diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index f6c9d7a..18c1c33 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client-demo - 2.0.0-SNAPSHOT + 2.0.0 jar diff --git a/universe-client/pom.xml b/universe-client/pom.xml index 7ab150d..b0db239 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client - 2.0.0-SNAPSHOT + 2.0.0 jar universe-client From 692ceb3f3a25c81493326711e32f3b06d2b6b59f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 11 Apr 2024 09:45:43 +0000 Subject: [PATCH 92/99] Preparing for next development iteration --- pom.xml | 2 +- universe-client-demo/pom.xml | 2 +- universe-client/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 108389c..88f54c3 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client-root - 2.0.0 + 2.0.1-SNAPSHOT pom diff --git a/universe-client-demo/pom.xml b/universe-client-demo/pom.xml index 18c1c33..c38c140 100644 --- a/universe-client-demo/pom.xml +++ b/universe-client-demo/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client-demo - 2.0.0 + 2.0.1-SNAPSHOT jar diff --git a/universe-client/pom.xml b/universe-client/pom.xml index b0db239..1662a87 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -6,7 +6,7 @@ software.xdev universe-client - 2.0.0 + 2.0.1-SNAPSHOT jar universe-client From 7190f6ec95dc8339315a2745d2d8cc2470bedf3f Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 23 Apr 2024 09:33:55 +0200 Subject: [PATCH 93/99] Rename I --- .run/Run Demo.run.xml | 2 +- CONTRIBUTING.md | 4 ++-- README.md | 12 ++++++------ SECURITY.md | 2 +- pom.xml | 6 +++--- template-placeholder-demo/pom.xml | 4 ++-- template-placeholder/pom.xml | 12 ++++++------ 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.run/Run Demo.run.xml b/.run/Run Demo.run.xml index 5fb2bc2..f1f0693 100644 --- a/.run/Run Demo.run.xml +++ b/.run/Run Demo.run.xml @@ -1,7 +1,7 @@ - template-placeholder - template-placeholder-demo + universe-client + universe-client-demo diff --git a/template-placeholder-demo/pom.xml b/template-placeholder-demo/pom.xml index 78b4a3e..8b02fdc 100644 --- a/template-placeholder-demo/pom.xml +++ b/template-placeholder-demo/pom.xml @@ -5,7 +5,7 @@ 4.0.0 software.xdev - template-placeholder-demo + universe-client-demo 1.0.0-SNAPSHOT jar @@ -27,7 +27,7 @@ software.xdev - template-placeholder + universe-client ${project.version} diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index b72a766..8254a9c 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -5,17 +5,17 @@ 4.0.0 software.xdev - template-placeholder + universe-client 1.0.0-SNAPSHOT jar - template-placeholder - template-placeholder - https://github.com/xdev-software/template-placeholder + universe-client + universe-client + https://github.com/xdev-software/universe-client - https://github.com/xdev-software/template-placeholder - scm:git:https://github.com/xdev-software/template-placeholder.git + https://github.com/xdev-software/universe-client + scm:git:https://github.com/xdev-software/universe-client.git 2023 From d617d9daf5bc7fbe9b3054e0de35be89327c7561 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 23 Apr 2024 09:34:10 +0200 Subject: [PATCH 94/99] Rename II --- {template-placeholder-demo => universe-client-demo}/pom.xml | 0 {template-placeholder => universe-client}/pom.xml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {template-placeholder-demo => universe-client-demo}/pom.xml (100%) rename {template-placeholder => universe-client}/pom.xml (100%) diff --git a/template-placeholder-demo/pom.xml b/universe-client-demo/pom.xml similarity index 100% rename from template-placeholder-demo/pom.xml rename to universe-client-demo/pom.xml diff --git a/template-placeholder/pom.xml b/universe-client/pom.xml similarity index 100% rename from template-placeholder/pom.xml rename to universe-client/pom.xml From 0a02887cb02104e1690b4f4002fc063d475c6174 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Wed, 29 May 2024 16:13:45 +0200 Subject: [PATCH 95/99] Delete .github/dependabot.yml --- .github/dependabot.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 2ea8f0a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: 2 -updates: -- package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily - # Run it at a specific time so that we don't get emails all day long - time: "00:00" - open-pull-requests-limit: 10 - ignore: - - dependency-name: "*" - # GitHub actions are using git tags (v1 = v1.2 = v1.2.3) which should be compatible until a major change is performed - update-types: - - "version-update:semver-minor" - - "version-update:semver-patch" -- package-ecosystem: maven - directory: "/" - schedule: - interval: daily - # Run it at a specific time so that we don't get emails all day long - time: "00:00" - open-pull-requests-limit: 10 - ignore: - - dependency-name: "org.springframework.boot:*" - # Version 3+ requires Vaadin 24 - versions: ">=3.0.0" From 8157aa41e880e71b5208cc13741d7dacd3f57a3a Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 12 Jun 2024 09:53:49 +0200 Subject: [PATCH 96/99] Fill in template --- .github/ISSUE_TEMPLATE/bug_report.yml | 4 ++-- .github/ISSUE_TEMPLATE/enhancement.yml | 2 +- .github/ISSUE_TEMPLATE/question.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 68299d5..3300fd8 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -14,9 +14,9 @@ body: attributes: label: "Checklist" options: - - label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/template-placeholder/releases/latest)" + - label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/universe-client/releases/latest)" required: true - - label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to." + - label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/universe-client/issues) or [closed](https://github.com/xdev-software/universe-client/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to." required: true - label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise." required: true diff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.yml index 7523129..b3c02ea 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.yml +++ b/.github/ISSUE_TEMPLATE/enhancement.yml @@ -12,7 +12,7 @@ body: attributes: label: "Checklist" options: - - label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to." + - label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/universe-client/issues) or [closed](https://github.com/xdev-software/universe-client/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to." required: true - label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise." required: true diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index 6ecd6ad..9f3f4d0 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -12,7 +12,7 @@ body: attributes: label: "Checklist" options: - - label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to." + - label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/universe-client/issues) or [closed](https://github.com/xdev-software/universe-client/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to." required: true - label: "I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise." required: true From 3676be985183fbb36a19a3284d8c392e70654e4c Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Wed, 12 Jun 2024 08:01:00 +0000 Subject: [PATCH 97/99] Update dependency com.fasterxml.jackson.core:jackson-databind to v2.17.1 --- universe-client/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/universe-client/pom.xml b/universe-client/pom.xml index b9f2230..f2333d4 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -94,7 +94,7 @@ com.fasterxml.jackson.core jackson-databind - 2.17.0 + 2.17.1 From fa562b1e56c162bbf4e60a7e6ebedd3a96f77413 Mon Sep 17 00:00:00 2001 From: AB Date: Fri, 28 Jun 2024 10:25:27 +0200 Subject: [PATCH 98/99] Fill in template --- renovate.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index 11024f4..7e0a775 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -4,7 +4,7 @@ "packageRules": [ { "description": "Ignore project internal dependencies", - "packagePattern": "^software.xdev:template-placeholder", + "packagePattern": "^software.xdev:universe-client", "datasources": [ "maven" ], From c891f70691145ff65808628f57bea76f1bb0814c Mon Sep 17 00:00:00 2001 From: AB Date: Fri, 28 Jun 2024 10:28:53 +0200 Subject: [PATCH 99/99] Ignore auto generated code --- pom.xml | 3 +++ universe-client/pom.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pom.xml b/pom.xml index 2e9f4cf..b0c81f5 100644 --- a/pom.xml +++ b/pom.xml @@ -77,6 +77,9 @@ .config/pmd/ruleset.xml + + software/xdev/universe/requests/** + diff --git a/universe-client/pom.xml b/universe-client/pom.xml index b1ec53d..545841c 100644 --- a/universe-client/pom.xml +++ b/universe-client/pom.xml @@ -293,6 +293,9 @@ ../.config/pmd/ruleset.xml + + software/xdev/universe/requests/** +