-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
890 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* This file is part of bibliothek, licensed under the MIT License. | ||
* | ||
* Copyright (c) 2019-2024 PaperMC | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package io.papermc.bibliothek.api.model; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@Schema | ||
public record Change( | ||
@Schema(name = "commit") | ||
String commit, | ||
@Schema(name = "summary") | ||
String summary, | ||
@Schema(name = "message") | ||
String message | ||
) { | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/io/papermc/bibliothek/api/model/Channel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* This file is part of bibliothek, licensed under the MIT License. | ||
* | ||
* Copyright (c) 2019-2024 PaperMC | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package io.papermc.bibliothek.api.model; | ||
|
||
public enum Channel { | ||
DEFAULT, | ||
EXPERIMENTAL; | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/io/papermc/bibliothek/api/model/Download.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* This file is part of bibliothek, licensed under the MIT License. | ||
* | ||
* Copyright (c) 2019-2024 PaperMC | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package io.papermc.bibliothek.api.model; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@Schema | ||
public record Download( | ||
@Schema(name = "name", pattern = "[a-z0-9._-]+", example = "paper-1.18-10.jar") | ||
String name, | ||
@Schema(name = "sha256", pattern = "[a-f0-9]{64}", example = "f065e2d345d9d772d5cf2a1ce5c495c4cc56eb2fcd6820e82856485fa19414c8") | ||
String sha256 | ||
) { | ||
} |
77 changes: 77 additions & 0 deletions
77
src/main/java/io/papermc/bibliothek/api/response/v2/BuildResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* This file is part of bibliothek, licensed under the MIT License. | ||
* | ||
* Copyright (c) 2019-2024 PaperMC | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package io.papermc.bibliothek.api.response.v2; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import io.papermc.bibliothek.api.model.Change; | ||
import io.papermc.bibliothek.api.model.Channel; | ||
import io.papermc.bibliothek.api.model.Download; | ||
import io.papermc.bibliothek.api.serialization.LegacyChannelSerializer; | ||
import io.papermc.bibliothek.database.model.VersionEntity; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.Instant; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@Schema | ||
public record BuildResponse( | ||
@JsonProperty("project_id") | ||
@Schema(name = "project_id", pattern = "[a-z]+", example = "paper") | ||
String projectId, | ||
|
||
@JsonProperty("project_name") | ||
@Schema(name = "project_name", example = "Paper") | ||
String projectName, | ||
|
||
@JsonProperty("version") | ||
@Schema(name = "version", pattern = VersionEntity.PATTERN, example = "1.18") | ||
String version, | ||
|
||
@JsonProperty("build") | ||
@Schema(name = "build", pattern = "\\d+", example = "10") | ||
int build, | ||
|
||
@JsonProperty("time") | ||
@Schema(name = "time") | ||
Instant time, | ||
|
||
@JsonProperty("channel") | ||
@JsonSerialize(using = LegacyChannelSerializer.class) | ||
@Schema(name = "channel") | ||
Channel channel, | ||
|
||
@JsonProperty("promoted") | ||
@Schema(name = "promoted") | ||
boolean promoted, | ||
|
||
@JsonProperty("changes") | ||
@Schema(name = "changes") | ||
List<Change> changes, | ||
|
||
@JsonProperty("downloads") | ||
@Schema(name = "downloads") | ||
Map<String, Download> downloads | ||
) { | ||
} |
81 changes: 81 additions & 0 deletions
81
src/main/java/io/papermc/bibliothek/api/response/v2/BuildsResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* This file is part of bibliothek, licensed under the MIT License. | ||
* | ||
* Copyright (c) 2019-2024 PaperMC | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package io.papermc.bibliothek.api.response.v2; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.papermc.bibliothek.api.model.Change; | ||
import io.papermc.bibliothek.api.model.Channel; | ||
import io.papermc.bibliothek.api.model.Download; | ||
import io.papermc.bibliothek.database.model.VersionEntity; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.Instant; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@Schema | ||
public record BuildsResponse( | ||
@JsonProperty("project_id") | ||
@Schema(name = "project_id", pattern = "[a-z]+", example = "paper") | ||
String projectId, | ||
|
||
@JsonProperty("project_name") | ||
@Schema(name = "project_name", example = "Paper") | ||
String projectName, | ||
|
||
@JsonProperty("version") | ||
@Schema(name = "version", pattern = VersionEntity.PATTERN, example = "1.18") | ||
String version, | ||
|
||
@JsonProperty("builds") | ||
@Schema(name = "builds") | ||
List<VersionBuild> builds | ||
) { | ||
@Schema | ||
public record VersionBuild( | ||
@JsonProperty("build") | ||
@Schema(name = "build", pattern = "\\d+", example = "10") | ||
int build, | ||
|
||
@JsonProperty("time") | ||
@Schema(name = "time") | ||
Instant time, | ||
|
||
@JsonProperty("channel") | ||
@Schema(name = "channel") | ||
Channel channel, | ||
|
||
@JsonProperty("promoted") | ||
@Schema(name = "promoted") | ||
boolean promoted, | ||
|
||
@JsonProperty("changes") | ||
@Schema(name = "changes") | ||
List<Change> changes, | ||
|
||
@JsonProperty("downloads") | ||
@Schema(name = "downloads") | ||
Map<String, Download> downloads | ||
) { | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/io/papermc/bibliothek/api/response/v2/ProjectResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* This file is part of bibliothek, licensed under the MIT License. | ||
* | ||
* Copyright (c) 2019-2024 PaperMC | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package io.papermc.bibliothek.api.response.v2; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.List; | ||
|
||
@Schema | ||
public record ProjectResponse( | ||
@JsonProperty("project_id") | ||
@Schema(name = "project_id", pattern = "[a-z]+", example = "paper") | ||
String projectId, | ||
|
||
@JsonProperty("project_name") | ||
@Schema(name = "project_name", example = "Paper") | ||
String projectName, | ||
|
||
@JsonProperty("version_groups") | ||
@Schema(name = "version_groups") | ||
List<String> versionGroups, | ||
|
||
@JsonProperty("versions") | ||
@Schema(name = "versions") | ||
List<String> versions | ||
) { | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/io/papermc/bibliothek/api/response/v2/ProjectsResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* This file is part of bibliothek, licensed under the MIT License. | ||
* | ||
* Copyright (c) 2019-2024 PaperMC | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package io.papermc.bibliothek.api.response.v2; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.List; | ||
|
||
@Schema | ||
public record ProjectsResponse( | ||
@JsonProperty("projects") | ||
@Schema(name = "projects") | ||
List<String> projects | ||
) { | ||
} |
Oops, something went wrong.