-
-
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
27 changed files
with
841 additions
and
365 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 | ||
) { | ||
} |
33 changes: 33 additions & 0 deletions
33
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,33 @@ | ||
/* | ||
* 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 com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public enum Channel { | ||
@JsonProperty("default") | ||
DEFAULT, | ||
@JsonProperty("experimental") | ||
EXPERIMENTAL; | ||
} |
39 changes: 39 additions & 0 deletions
39
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,39 @@ | ||
/* | ||
* 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; | ||
import org.intellij.lang.annotations.Language; | ||
|
||
@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 | ||
) { | ||
// NOTE: this pattern cannot contain any capturing groups | ||
@Language("RegExp") | ||
public static final String NAME_PATTERN = "[a-zA-Z0-9._-]+"; | ||
} |
67 changes: 67 additions & 0 deletions
67
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,67 @@ | ||
/* | ||
* 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.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( | ||
@Schema(name = "project_id", pattern = "[a-z]+", example = "paper") | ||
String project_id, | ||
|
||
@Schema(name = "project_name", example = "Paper") | ||
String project_name, | ||
|
||
@Schema(name = "version", pattern = VersionEntity.PATTERN, example = "1.18") | ||
String version, | ||
|
||
@Schema(name = "build", pattern = "\\d+", example = "10") | ||
int build, | ||
|
||
@Schema(name = "time") | ||
Instant time, | ||
|
||
@JsonSerialize(using = LegacyChannelSerializer.class) | ||
@Schema(name = "channel") | ||
Channel channel, | ||
|
||
@Schema(name = "promoted") | ||
boolean promoted, | ||
|
||
@Schema(name = "changes") | ||
List<Change> changes, | ||
|
||
@Schema(name = "downloads") | ||
Map<String, Download> downloads | ||
) { | ||
} |
70 changes: 70 additions & 0 deletions
70
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,70 @@ | ||
/* | ||
* 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 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( | ||
@Schema(name = "project_id", pattern = "[a-z]+", example = "paper") | ||
String project_id, | ||
|
||
@Schema(name = "project_name", example = "Paper") | ||
String project_name, | ||
|
||
@Schema(name = "version", pattern = VersionEntity.PATTERN, example = "1.18") | ||
String version, | ||
|
||
@Schema(name = "builds") | ||
List<VersionBuild> builds | ||
) { | ||
@Schema | ||
public record VersionBuild( | ||
@Schema(name = "build", pattern = "\\d+", example = "10") | ||
int build, | ||
|
||
@Schema(name = "time") | ||
Instant time, | ||
|
||
@Schema(name = "channel") | ||
Channel channel, | ||
|
||
@Schema(name = "promoted") | ||
boolean promoted, | ||
|
||
@Schema(name = "changes") | ||
List<Change> changes, | ||
|
||
@Schema(name = "downloads") | ||
Map<String, Download> downloads | ||
) { | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
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,43 @@ | ||
/* | ||
* 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 io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.List; | ||
|
||
@Schema | ||
public record ProjectResponse( | ||
@Schema(name = "project_id", pattern = "[a-z]+", example = "paper") | ||
String project_id, | ||
|
||
@Schema(name = "project_name", example = "Paper") | ||
String project_name, | ||
|
||
@Schema(name = "version_groups") | ||
List<String> version_groups, | ||
|
||
@Schema(name = "versions") | ||
List<String> versions | ||
) { | ||
} |
34 changes: 34 additions & 0 deletions
34
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,34 @@ | ||
/* | ||
* 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 io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.List; | ||
|
||
@Schema | ||
public record ProjectsResponse( | ||
@Schema(name = "projects") | ||
List<String> projects | ||
) { | ||
} |
Oops, something went wrong.