ddapi 2.0.2__tar.gz → 2.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. {ddapi-2.0.2 → ddapi-2.0.3}/Cargo.lock +1 -1
  2. {ddapi-2.0.2 → ddapi-2.0.3}/Cargo.toml +1 -1
  3. {ddapi-2.0.2 → ddapi-2.0.3}/PKG-INFO +1 -1
  4. {ddapi-2.0.2 → ddapi-2.0.3}/src/api/ddnet.rs +1 -1
  5. {ddapi-2.0.2 → ddapi-2.0.3}/src/scheme/ddnet/query_map.rs +2 -1
  6. {ddapi-2.0.2 → ddapi-2.0.3}/tests/schema_ddnet.rs +6 -0
  7. {ddapi-2.0.2 → ddapi-2.0.3}/.ai/rules.md +0 -0
  8. {ddapi-2.0.2 → ddapi-2.0.3}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  9. {ddapi-2.0.2 → ddapi-2.0.3}/.github/dependabot.yml +0 -0
  10. {ddapi-2.0.2 → ddapi-2.0.3}/.github/workflows/crate_type.yaml +0 -0
  11. {ddapi-2.0.2 → ddapi-2.0.3}/.github/workflows/rust.yml +0 -0
  12. {ddapi-2.0.2 → ddapi-2.0.3}/.github/workflows/schema_check.yml +0 -0
  13. {ddapi-2.0.2 → ddapi-2.0.3}/.gitignore +0 -0
  14. {ddapi-2.0.2 → ddapi-2.0.3}/LICENSE +0 -0
  15. {ddapi-2.0.2 → ddapi-2.0.3}/README.md +0 -0
  16. {ddapi-2.0.2 → ddapi-2.0.3}/pyproject.toml +0 -0
  17. {ddapi-2.0.2 → ddapi-2.0.3}/python/ddapi/__init__.py +0 -0
  18. {ddapi-2.0.2 → ddapi-2.0.3}/python/ddapi/_convert.py +0 -0
  19. {ddapi-2.0.2 → ddapi-2.0.3}/python/ddapi/ddnet.py +0 -0
  20. {ddapi-2.0.2 → ddapi-2.0.3}/python/ddapi/ddstats.py +0 -0
  21. {ddapi-2.0.2 → ddapi-2.0.3}/release-guide.md +0 -0
  22. {ddapi-2.0.2 → ddapi-2.0.3}/src/api/ddstats.rs +0 -0
  23. {ddapi-2.0.2 → ddapi-2.0.3}/src/api/mod.rs +0 -0
  24. {ddapi-2.0.2 → ddapi-2.0.3}/src/error.rs +0 -0
  25. {ddapi-2.0.2 → ddapi-2.0.3}/src/lib.rs +0 -0
  26. {ddapi-2.0.2 → ddapi-2.0.3}/src/python/ddstats.rs +0 -0
  27. {ddapi-2.0.2 → ddapi-2.0.3}/src/python/mod.rs +0 -0
  28. {ddapi-2.0.2 → ddapi-2.0.3}/src/scheme/ddnet/latest_finishes.rs +0 -0
  29. {ddapi-2.0.2 → ddapi-2.0.3}/src/scheme/ddnet/map.rs +0 -0
  30. {ddapi-2.0.2 → ddapi-2.0.3}/src/scheme/ddnet/master.rs +0 -0
  31. {ddapi-2.0.2 → ddapi-2.0.3}/src/scheme/ddnet/mod.rs +0 -0
  32. {ddapi-2.0.2 → ddapi-2.0.3}/src/scheme/ddnet/player.rs +0 -0
  33. {ddapi-2.0.2 → ddapi-2.0.3}/src/scheme/ddnet/query.rs +0 -0
  34. {ddapi-2.0.2 → ddapi-2.0.3}/src/scheme/ddnet/query_mapper.rs +0 -0
  35. {ddapi-2.0.2 → ddapi-2.0.3}/src/scheme/ddnet/releases_maps.rs +0 -0
  36. {ddapi-2.0.2 → ddapi-2.0.3}/src/scheme/ddnet/skins.rs +0 -0
  37. {ddapi-2.0.2 → ddapi-2.0.3}/src/scheme/ddnet/status.rs +0 -0
  38. {ddapi-2.0.2 → ddapi-2.0.3}/src/scheme/ddstats.rs +0 -0
  39. {ddapi-2.0.2 → ddapi-2.0.3}/src/scheme/mod.rs +0 -0
  40. {ddapi-2.0.2 → ddapi-2.0.3}/src/util/encoding.rs +0 -0
  41. {ddapi-2.0.2 → ddapi-2.0.3}/src/util/mod.rs +0 -0
  42. {ddapi-2.0.2 → ddapi-2.0.3}/src/util/time.rs +0 -0
  43. {ddapi-2.0.2 → ddapi-2.0.3}/src/util/tw_addr.rs +0 -0
  44. {ddapi-2.0.2 → ddapi-2.0.3}/tests/fixtures/ddnet/latest_finishes.json +0 -0
  45. {ddapi-2.0.2 → ddapi-2.0.3}/tests/fixtures/ddnet/map.json +0 -0
  46. {ddapi-2.0.2 → ddapi-2.0.3}/tests/fixtures/ddnet/query.json +0 -0
  47. {ddapi-2.0.2 → ddapi-2.0.3}/tests/fixtures/ddnet/query_map.json +0 -0
  48. {ddapi-2.0.2 → ddapi-2.0.3}/tests/fixtures/ddnet/query_mapper.json +0 -0
  49. {ddapi-2.0.2 → ddapi-2.0.3}/tests/fixtures/ddnet/status.json +0 -0
  50. {ddapi-2.0.2 → ddapi-2.0.3}/tests/fixtures/ddstats/map.json +0 -0
  51. {ddapi-2.0.2 → ddapi-2.0.3}/tests/fixtures/ddstats/profile.json +0 -0
  52. {ddapi-2.0.2 → ddapi-2.0.3}/tests/python/test_ddapi.py +0 -0
  53. {ddapi-2.0.2 → ddapi-2.0.3}/tests/schema_ddstats.rs +0 -0
  54. {ddapi-2.0.2 → ddapi-2.0.3}/tests/util/mod.rs +0 -0
  55. {ddapi-2.0.2 → ddapi-2.0.3}/typos.toml +0 -0
@@ -204,7 +204,7 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
204
204
 
205
205
  [[package]]
206
206
  name = "ddapi-rs"
207
- version = "2.0.2"
207
+ version = "2.0.3"
208
208
  dependencies = [
209
209
  "chrono",
210
210
  "moka",
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  name = "ddapi-rs"
3
3
  description = "A simple Rust library to get data from DDNet and DDStats APIs"
4
- version = "2.0.2"
4
+ version = "2.0.3"
5
5
  authors = ["ByFox213 <byfox213@gmail.com>"]
6
6
  edition = "2021"
7
7
  repository = "https://github.com/ByFox213/ddapi-rs"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ddapi
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3 :: Only
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -119,7 +119,7 @@ impl DDnetApi for DDApi {
119
119
  /// let api = DDApi::new();
120
120
  /// let query: Vec<QueryMap> = api.query_map("multi").await?;
121
121
  /// for map in &query {
122
- /// println!("{}: {} | {}", map.name, map.mapper, map.r#type);
122
+ /// println!("{}: {} | {}", map.name, map.mapper.as_deref().unwrap_or(""), map.r#type);
123
123
  /// }
124
124
  /// ```
125
125
  async fn query_map(&self, map: &str) -> Result<Vec<QueryMap>> {
@@ -6,7 +6,8 @@ use serde::{Deserialize, Serialize};
6
6
  pub struct QueryMap {
7
7
  pub name: String,
8
8
  pub r#type: String,
9
- pub mapper: String,
9
+ #[serde(default, skip_serializing_if = "Option::is_none")]
10
+ pub mapper: Option<String>,
10
11
  }
11
12
 
12
13
  impl QueryMap {
@@ -36,6 +36,12 @@ fn query_map_schema_matches() {
36
36
  assert_schema_matches::<Vec<QueryMap>>(&load_fixture("ddnet/query_map.json"));
37
37
  }
38
38
 
39
+ #[test]
40
+ fn query_map_without_mapper_matches() {
41
+ let raw = r#"[{"name": "1TeeMap", "type": "Oldschool"}]"#;
42
+ assert_schema_matches::<Vec<QueryMap>>(raw);
43
+ }
44
+
39
45
  #[test]
40
46
  fn query_mapper_schema_matches() {
41
47
  assert_schema_matches::<Vec<QueryMapper>>(&load_fixture("ddnet/query_mapper.json"));
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes