slumber-python 0.0.2__tar.gz → 4.2.0__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 (64) hide show
  1. {slumber_python-0.0.2 → slumber_python-4.2.0}/Cargo.lock +82 -18
  2. {slumber_python-0.0.2 → slumber_python-4.2.0}/Cargo.toml +14 -9
  3. {slumber_python-0.0.2 → slumber_python-4.2.0}/PKG-INFO +11 -5
  4. {slumber_python-0.0.2/crates/python → slumber_python-4.2.0}/README.md +10 -4
  5. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/config/Cargo.toml +3 -3
  6. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/config/src/cereal.rs +56 -23
  7. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/config/src/lib.rs +50 -59
  8. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/config/src/tui/input.rs +62 -26
  9. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/config/src/tui/mime.rs +10 -4
  10. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/config/src/tui.rs +27 -9
  11. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/Cargo.toml +5 -3
  12. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/collection/cereal.rs +111 -56
  13. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/collection/models.rs +121 -80
  14. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/collection/recipe_tree.rs +80 -61
  15. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/collection/schema.rs +4 -1
  16. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/collection.rs +23 -21
  17. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/database/convert.rs +15 -6
  18. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/database.rs +221 -106
  19. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/http/content_type.rs +46 -14
  20. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/http/curl.rs +22 -11
  21. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/http/models.rs +126 -29
  22. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/http/tests.rs +22 -7
  23. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/http.rs +95 -70
  24. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/render/functions.rs +268 -46
  25. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/render/tests.rs +111 -23
  26. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/render.rs +46 -31
  27. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/test_util.rs +10 -4
  28. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/macros/Cargo.toml +1 -1
  29. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/python/Cargo.toml +3 -3
  30. {slumber_python-0.0.2 → slumber_python-4.2.0/crates/python}/README.md +10 -4
  31. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/python/mise.toml +8 -3
  32. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/python/slumber.pyi +8 -4
  33. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/python/src/lib.rs +99 -49
  34. slumber_python-4.2.0/crates/python/tests/slumber.yml +26 -0
  35. slumber_python-4.2.0/crates/python/tests/test.py +94 -0
  36. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/python/uv.lock +69 -292
  37. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/template/Cargo.toml +2 -3
  38. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/template/src/cereal.rs +43 -26
  39. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/template/src/error.rs +9 -9
  40. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/template/src/expression.rs +8 -0
  41. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/template/src/tests.rs +7 -12
  42. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/template/src/value.rs +2 -1
  43. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/util/Cargo.toml +0 -1
  44. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/util/src/lib.rs +58 -37
  45. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/util/src/paths.rs +17 -20
  46. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/util/src/test_util.rs +48 -26
  47. slumber_python-4.2.0/crates/util/src/yaml/error.rs +177 -0
  48. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/util/src/yaml/resolve.rs +10 -14
  49. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/util/src/yaml.rs +81 -212
  50. {slumber_python-0.0.2 → slumber_python-4.2.0}/pyproject.toml +14 -0
  51. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/config/src/tui/theme.rs +0 -0
  52. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/collection/json.rs +0 -0
  53. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/database/migrations.rs +0 -0
  54. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/database/tests.rs +0 -0
  55. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/lib.rs +0 -0
  56. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/render/util.rs +0 -0
  57. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/core/src/util.rs +0 -0
  58. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/macros/src/lib.rs +0 -0
  59. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/python/dev.py +0 -0
  60. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/template/proptest-regressions/parse.txt +0 -0
  61. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/template/src/display.rs +0 -0
  62. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/template/src/lib.rs +0 -0
  63. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/template/src/parse.rs +0 -0
  64. {slumber_python-0.0.2 → slumber_python-4.2.0}/crates/template/src/test_util.rs +0 -0
@@ -856,6 +856,7 @@ dependencies = [
856
856
  "clap",
857
857
  "itertools 0.13.0",
858
858
  "mdbook",
859
+ "quote",
859
860
  "serde_json",
860
861
  "syn 2.0.101",
861
862
  ]
@@ -877,9 +878,9 @@ checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"
877
878
 
878
879
  [[package]]
879
880
  name = "editor-command"
880
- version = "1.0.0"
881
+ version = "2.0.0"
881
882
  source = "registry+https://github.com/rust-lang/crates.io-index"
882
- checksum = "ee98e369cc618396b828ba0231d5bc39857ee1d8e9dcb1c1adef49a21bb5c427"
883
+ checksum = "233f7e1e39795915a24f5eac451b7f4e73b090ca60dd5d2bc7a06cc929e021b1"
883
884
  dependencies = [
884
885
  "shell-words",
885
886
  ]
@@ -1690,6 +1691,46 @@ version = "1.0.15"
1690
1691
  source = "registry+https://github.com/rust-lang/crates.io-index"
1691
1692
  checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
1692
1693
 
1694
+ [[package]]
1695
+ name = "jaq-core"
1696
+ version = "2.2.1"
1697
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1698
+ checksum = "77526a72eb79412c29fd141767a6549bbfcb1cb40e00556fe16532d5e878e098"
1699
+ dependencies = [
1700
+ "dyn-clone",
1701
+ "once_cell",
1702
+ "typed-arena",
1703
+ ]
1704
+
1705
+ [[package]]
1706
+ name = "jaq-json"
1707
+ version = "1.1.3"
1708
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1709
+ checksum = "01dbdbd07b076e8403abac68ce7744d93e2ecd953bbc44bf77bf00e1e81172bc"
1710
+ dependencies = [
1711
+ "foldhash",
1712
+ "indexmap 2.9.0",
1713
+ "jaq-core",
1714
+ "jaq-std",
1715
+ "serde_json",
1716
+ ]
1717
+
1718
+ [[package]]
1719
+ name = "jaq-std"
1720
+ version = "2.1.2"
1721
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1722
+ checksum = "2c264fe397c981705976c71f1bfe020382b9eda52ae950e57fe885e147bdd67d"
1723
+ dependencies = [
1724
+ "aho-corasick",
1725
+ "base64 0.22.1",
1726
+ "chrono",
1727
+ "jaq-core",
1728
+ "libm",
1729
+ "log",
1730
+ "regex-lite",
1731
+ "urlencoding",
1732
+ ]
1733
+
1693
1734
  [[package]]
1694
1735
  name = "jiff"
1695
1736
  version = "0.2.15"
@@ -1772,6 +1813,12 @@ version = "0.2.172"
1772
1813
  source = "registry+https://github.com/rust-lang/crates.io-index"
1773
1814
  checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
1774
1815
 
1816
+ [[package]]
1817
+ name = "libm"
1818
+ version = "0.2.15"
1819
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1820
+ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
1821
+
1775
1822
  [[package]]
1776
1823
  name = "libredox"
1777
1824
  version = "0.1.3"
@@ -2555,7 +2602,6 @@ version = "0.26.0"
2555
2602
  source = "registry+https://github.com/rust-lang/crates.io-index"
2556
2603
  checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383"
2557
2604
  dependencies = [
2558
- "anyhow",
2559
2605
  "indexmap 2.9.0",
2560
2606
  "indoc",
2561
2607
  "libc",
@@ -2893,6 +2939,12 @@ dependencies = [
2893
2939
  "regex-syntax",
2894
2940
  ]
2895
2941
 
2942
+ [[package]]
2943
+ name = "regex-lite"
2944
+ version = "0.1.8"
2945
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2946
+ checksum = "8d942b98df5e658f56f20d592c7f868833fe38115e65c33003d8cd224b0155da"
2947
+
2896
2948
  [[package]]
2897
2949
  name = "regex-syntax"
2898
2950
  version = "0.8.5"
@@ -3453,7 +3505,7 @@ dependencies = [
3453
3505
 
3454
3506
  [[package]]
3455
3507
  name = "slumber"
3456
- version = "4.1.0"
3508
+ version = "4.2.0"
3457
3509
  dependencies = [
3458
3510
  "anyhow",
3459
3511
  "console-subscriber",
@@ -3467,7 +3519,7 @@ dependencies = [
3467
3519
 
3468
3520
  [[package]]
3469
3521
  name = "slumber_cli"
3470
- version = "4.1.0"
3522
+ version = "4.2.0"
3471
3523
  dependencies = [
3472
3524
  "anyhow",
3473
3525
  "assert_cmd",
@@ -3500,9 +3552,8 @@ dependencies = [
3500
3552
 
3501
3553
  [[package]]
3502
3554
  name = "slumber_config"
3503
- version = "4.1.0"
3555
+ version = "4.2.0"
3504
3556
  dependencies = [
3505
- "anyhow",
3506
3557
  "derive_more 1.0.0",
3507
3558
  "dirs",
3508
3559
  "editor-command",
@@ -3520,14 +3571,14 @@ dependencies = [
3520
3571
  "serde_yaml",
3521
3572
  "slumber_util",
3522
3573
  "terminput",
3574
+ "thiserror 2.0.12",
3523
3575
  "tracing",
3524
3576
  ]
3525
3577
 
3526
3578
  [[package]]
3527
3579
  name = "slumber_core"
3528
- version = "4.1.0"
3580
+ version = "4.2.0"
3529
3581
  dependencies = [
3530
- "anyhow",
3531
3582
  "async-trait",
3532
3583
  "base64 0.22.1",
3533
3584
  "bytes",
@@ -3538,6 +3589,9 @@ dependencies = [
3538
3589
  "futures",
3539
3590
  "indexmap 2.9.0",
3540
3591
  "itertools 0.13.0",
3592
+ "jaq-core",
3593
+ "jaq-json",
3594
+ "jaq-std",
3541
3595
  "mime",
3542
3596
  "pretty_assertions",
3543
3597
  "proptest",
@@ -3570,7 +3624,7 @@ dependencies = [
3570
3624
 
3571
3625
  [[package]]
3572
3626
  name = "slumber_import"
3573
- version = "4.1.0"
3627
+ version = "4.2.0"
3574
3628
  dependencies = [
3575
3629
  "anyhow",
3576
3630
  "base64 0.22.1",
@@ -3602,7 +3656,7 @@ dependencies = [
3602
3656
 
3603
3657
  [[package]]
3604
3658
  name = "slumber_macros"
3605
- version = "4.1.0"
3659
+ version = "4.2.0"
3606
3660
  dependencies = [
3607
3661
  "proc-macro2",
3608
3662
  "quote",
@@ -3611,9 +3665,8 @@ dependencies = [
3611
3665
 
3612
3666
  [[package]]
3613
3667
  name = "slumber_python"
3614
- version = "0.0.2"
3668
+ version = "4.2.0"
3615
3669
  dependencies = [
3616
- "anyhow",
3617
3670
  "async-trait",
3618
3671
  "dialoguer",
3619
3672
  "indexmap 2.9.0",
@@ -3625,9 +3678,8 @@ dependencies = [
3625
3678
 
3626
3679
  [[package]]
3627
3680
  name = "slumber_template"
3628
- version = "4.1.0"
3681
+ version = "4.2.0"
3629
3682
  dependencies = [
3630
- "anyhow",
3631
3683
  "bytes",
3632
3684
  "derive_more 1.0.0",
3633
3685
  "futures",
@@ -3653,7 +3705,7 @@ dependencies = [
3653
3705
 
3654
3706
  [[package]]
3655
3707
  name = "slumber_tui"
3656
- version = "4.1.0"
3708
+ version = "4.2.0"
3657
3709
  dependencies = [
3658
3710
  "anyhow",
3659
3711
  "async-trait",
@@ -3669,6 +3721,7 @@ dependencies = [
3669
3721
  "notify-debouncer-full",
3670
3722
  "persisted",
3671
3723
  "pretty_assertions",
3724
+ "proptest",
3672
3725
  "ratatui",
3673
3726
  "reqwest",
3674
3727
  "rstest",
@@ -3694,9 +3747,8 @@ dependencies = [
3694
3747
 
3695
3748
  [[package]]
3696
3749
  name = "slumber_util"
3697
- version = "4.1.0"
3750
+ version = "4.2.0"
3698
3751
  dependencies = [
3699
- "anyhow",
3700
3752
  "derive_more 1.0.0",
3701
3753
  "dirs",
3702
3754
  "env-lock",
@@ -4325,6 +4377,12 @@ version = "0.2.5"
4325
4377
  source = "registry+https://github.com/rust-lang/crates.io-index"
4326
4378
  checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
4327
4379
 
4380
+ [[package]]
4381
+ name = "typed-arena"
4382
+ version = "2.0.2"
4383
+ source = "registry+https://github.com/rust-lang/crates.io-index"
4384
+ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a"
4385
+
4328
4386
  [[package]]
4329
4387
  name = "typenum"
4330
4388
  version = "1.18.0"
@@ -4420,6 +4478,12 @@ dependencies = [
4420
4478
  "serde",
4421
4479
  ]
4422
4480
 
4481
+ [[package]]
4482
+ name = "urlencoding"
4483
+ version = "2.1.3"
4484
+ source = "registry+https://github.com/rust-lang/crates.io-index"
4485
+ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
4486
+
4423
4487
  [[package]]
4424
4488
  name = "utf8_iter"
4425
4489
  version = "1.0.4"
@@ -20,7 +20,7 @@ homepage = "https://slumber.lucaspickering.me"
20
20
  keywords = ["rest", "http", "terminal", "tui"]
21
21
  license = "MIT"
22
22
  repository = "https://github.com/LucasPickering/slumber"
23
- version = "4.1.0"
23
+ version = "4.2.0"
24
24
  # Keep in sync w/ rust-toolchain.toml
25
25
  rust-version = "1.88.0"
26
26
 
@@ -41,6 +41,9 @@ indexmap = {version = "2.0.0", default-features = false}
41
41
  itertools = "0.13.0"
42
42
  mime = "0.3.17"
43
43
  pretty_assertions = "1.4.0"
44
+ proptest = "1.5.0"
45
+ proptest-derive = "0.5.0"
46
+ quote = "1.0.40"
44
47
  regex = {version = "1.10.5", default-features = false}
45
48
  reqwest = {version = "0.12.23", default-features = false}
46
49
  rstest = {version = "0.24.0", default-features = false}
@@ -51,14 +54,14 @@ serde_json = {version = "1.0.120", default-features = false, features = ["preser
51
54
  serde_json_path = "0.7.1"
52
55
  serde_test = "1.0.176"
53
56
  serde_yaml = {version = "0.9.0", default-features = false}
54
- slumber_cli = {path = "./crates/cli", version = "4.1.0" }
55
- slumber_config = {path = "./crates/config", version = "4.1.0" }
56
- slumber_core = {path = "./crates/core", version = "4.1.0" }
57
- slumber_import = {path = "./crates/import", version = "4.1.0" }
58
- slumber_macros = {path = "./crates/macros", version = "4.1.0" }
59
- slumber_template = {path = "./crates/template", version = "4.1.0" }
60
- slumber_tui = {path = "./crates/tui", version = "4.1.0" }
61
- slumber_util = {path = "./crates/util", version = "4.1.0" }
57
+ slumber_cli = {path = "./crates/cli", version = "4.2.0" }
58
+ slumber_config = {path = "./crates/config", version = "4.2.0" }
59
+ slumber_core = {path = "./crates/core", version = "4.2.0" }
60
+ slumber_import = {path = "./crates/import", version = "4.2.0" }
61
+ slumber_macros = {path = "./crates/macros", version = "4.2.0" }
62
+ slumber_template = {path = "./crates/template", version = "4.2.0" }
63
+ slumber_tui = {path = "./crates/tui", version = "4.2.0" }
64
+ slumber_util = {path = "./crates/util", version = "4.2.0" }
62
65
  strum = {version = "0.26.3", default-features = false}
63
66
  syn = "2.0.101"
64
67
  terminput = "0.5.3"
@@ -162,3 +165,5 @@ pr-run-mode = "plan"
162
165
  install-updater = false
163
166
  # Path that installers should place binaries in
164
167
  install-path = "CARGO_HOME"
168
+ # Don't build non-distributed crates
169
+ precise-builds = true
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: slumber-python
3
- Version: 0.0.2
3
+ Version: 4.2.0
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -10,11 +10,11 @@ License: MIT
10
10
  Requires-Python: >=3.10
11
11
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
12
12
 
13
- # `slumber-python`
13
+ # slumber-python
14
14
 
15
- [**Documentation**](https://slumber.lucaspickering.me/integration/python.html)
15
+ > This is not related to, or a replacement of, the [slumber](https://pypi.org/project/slumber/) package.
16
16
 
17
- > **Warning:** This is not related to, or a replacement of, the [slumber](https://pypi.org/project/slumber/) package.
17
+ [**Documentation**](https://slumber.lucaspickering.me/integration/python.html)
18
18
 
19
19
  Python bindings for [Slumber](https://slumber.lucaspickering.me/), the source-based REST API client. This library makes it easy to take your existing Slumber collection and use it in Python scripts.
20
20
 
@@ -30,14 +30,20 @@ pip install slumber-python
30
30
 
31
31
  ## Usage
32
32
 
33
+ First, [create a Slumber collection](https://slumber.lucaspickering.me/getting_started.html).
34
+
33
35
  ```py
34
36
 
35
37
  from slumber import Collection
36
38
 
37
39
  collection = Collection()
38
- response = collection.request('get_current_user')
40
+ response = collection.request('example_get')
39
41
  print(response.text)
40
42
  ```
41
43
 
42
44
  For more usage examples, [see the docs](https://slumber.lucaspickering.me/integration/python.html).
43
45
 
46
+ ## Versioning
47
+
48
+ For simplicity, the version of this package is synched to the main Slumber version and follows the same [releases](https://github.com/LucasPickering/slumber/releases). That means there may be releases of this package that don't actually change anything, or version bumps that are higher than necessary (e.g. minor versions with only patch changes). The versioning **is still semver compliant**.
49
+
@@ -1,8 +1,8 @@
1
- # `slumber-python`
1
+ # slumber-python
2
2
 
3
- [**Documentation**](https://slumber.lucaspickering.me/integration/python.html)
3
+ > This is not related to, or a replacement of, the [slumber](https://pypi.org/project/slumber/) package.
4
4
 
5
- > **Warning:** This is not related to, or a replacement of, the [slumber](https://pypi.org/project/slumber/) package.
5
+ [**Documentation**](https://slumber.lucaspickering.me/integration/python.html)
6
6
 
7
7
  Python bindings for [Slumber](https://slumber.lucaspickering.me/), the source-based REST API client. This library makes it easy to take your existing Slumber collection and use it in Python scripts.
8
8
 
@@ -18,13 +18,19 @@ pip install slumber-python
18
18
 
19
19
  ## Usage
20
20
 
21
+ First, [create a Slumber collection](https://slumber.lucaspickering.me/getting_started.html).
22
+
21
23
  ```py
22
24
 
23
25
  from slumber import Collection
24
26
 
25
27
  collection = Collection()
26
- response = collection.request('get_current_user')
28
+ response = collection.request('example_get')
27
29
  print(response.text)
28
30
  ```
29
31
 
30
32
  For more usage examples, [see the docs](https://slumber.lucaspickering.me/integration/python.html).
33
+
34
+ ## Versioning
35
+
36
+ For simplicity, the version of this package is synched to the main Slumber version and follows the same [releases](https://github.com/LucasPickering/slumber/releases). That means there may be releases of this package that don't actually change anything, or version bumps that are higher than necessary (e.g. minor versions with only patch changes). The versioning **is still semver compliant**.
@@ -11,9 +11,8 @@ rust-version = {workspace = true}
11
11
  version = {workspace = true}
12
12
 
13
13
  [dependencies]
14
- anyhow = {workspace = true}
15
14
  derive_more = {workspace = true, features = ["deref", "display"]}
16
- editor-command = {version = "1.0.0", optional = true}
15
+ editor-command = "2.0.0"
17
16
  glob = {version = "0.3.2", optional = true}
18
17
  indexmap = {workspace = true, features = ["serde"]}
19
18
  itertools = {workspace = true}
@@ -24,6 +23,7 @@ serde = {workspace = true, features = ["derive"]}
24
23
  serde_yaml = {workspace = true}
25
24
  slumber_util = {workspace = true}
26
25
  terminput = {workspace = true, optional = true}
26
+ thiserror = {workspace = true}
27
27
  tracing = {workspace = true}
28
28
 
29
29
  [dev-dependencies]
@@ -37,7 +37,7 @@ slumber_util = {workspace = true, features = ["test"]}
37
37
  [features]
38
38
  schema = ["dep:schemars"]
39
39
  # TUI-specific config fields and dependencies are gated behind this flag
40
- tui = ["dep:editor-command", "dep:glob", "dep:mime", "dep:ratatui-core", "dep:terminput"]
40
+ tui = ["dep:glob", "dep:mime", "dep:ratatui-core", "dep:terminput"]
41
41
 
42
42
  [lints]
43
43
  workspace = true
@@ -7,7 +7,8 @@
7
7
 
8
8
  use crate::{Config, HttpEngineConfig};
9
9
  use slumber_util::yaml::{
10
- self, DeserializeYaml, Expected, Field, SourcedYaml, StructDeserializer,
10
+ self, DeserializeYaml, Expected, Field, SourceMap, SourcedYaml,
11
+ StructDeserializer,
11
12
  };
12
13
 
13
14
  impl DeserializeYaml for Config {
@@ -15,18 +16,24 @@ impl DeserializeYaml for Config {
15
16
  Expected::Mapping
16
17
  }
17
18
 
18
- fn deserialize(mut yaml: SourcedYaml) -> yaml::Result<Self> {
19
+ fn deserialize(
20
+ mut yaml: SourcedYaml,
21
+ source_map: &SourceMap,
22
+ ) -> yaml::Result<Self> {
19
23
  // Drop all fields starting with `.`
20
24
  yaml.drop_dot_fields();
21
25
 
26
+ let default = Self::default();
22
27
  let mut deserializer = StructDeserializer::new(yaml)?;
23
28
 
24
29
  let config = Self {
30
+ editor: deserializer
31
+ .get(Field::new("editor").or(default.editor), source_map)?,
25
32
  // Both these configs get flattened to the top, so they share the
26
33
  // same deserializer
27
- http: deserialize_http_config(&mut deserializer)?,
34
+ http: deserialize_http_config(&mut deserializer, source_map)?,
28
35
  #[cfg(feature = "tui")]
29
- tui: tui::deserialize_tui_config(&mut deserializer)?,
36
+ tui: tui::deserialize_tui_config(&mut deserializer, source_map)?,
30
37
  };
31
38
 
32
39
  // If we're not running in TUI mode, we know there's still TUI fields
@@ -44,17 +51,23 @@ impl DeserializeYaml for Config {
44
51
  /// Deserialize HTTP-specific config fields from an existing deserializer
45
52
  fn deserialize_http_config(
46
53
  deserializer: &mut StructDeserializer,
54
+ source_map: &SourceMap,
47
55
  ) -> yaml::Result<HttpEngineConfig> {
48
56
  let default = HttpEngineConfig::default();
49
57
  Ok(HttpEngineConfig {
50
58
  ignore_certificate_hosts: deserializer.get(
51
59
  Field::new("ignore_certificate_hosts")
52
60
  .or(default.ignore_certificate_hosts),
61
+ source_map,
62
+ )?,
63
+ large_body_size: deserializer.get(
64
+ Field::new("large_body_size").or(default.large_body_size),
65
+ source_map,
66
+ )?,
67
+ follow_redirects: deserializer.get(
68
+ Field::new("follow_redirects").or(default.follow_redirects),
69
+ source_map,
53
70
  )?,
54
- large_body_size: deserializer
55
- .get(Field::new("large_body_size").or(default.large_body_size))?,
56
- follow_redirects: deserializer
57
- .get(Field::new("follow_redirects").or(default.follow_redirects))?,
58
71
  })
59
72
  }
60
73
 
@@ -65,30 +78,35 @@ mod tui {
65
78
  use ratatui_core::style::Color;
66
79
  use serde::de::{self, value::StringDeserializer};
67
80
  use slumber_util::yaml::{
68
- self, DeserializeYaml, Expected, Field, LocatedError, SourcedYaml,
69
- StructDeserializer,
81
+ self, DeserializeYaml, Expected, Field, LocatedError, SourceMap,
82
+ SourcedYaml, StructDeserializer,
70
83
  };
71
84
 
72
85
  /// Deserialize TUI-specific config fields from an existing deserializer
73
86
  pub fn deserialize_tui_config(
74
87
  deserializer: &mut StructDeserializer,
88
+ source_map: &SourceMap,
75
89
  ) -> yaml::Result<TuiConfig> {
76
90
  let default = TuiConfig::default();
77
91
  Ok(TuiConfig {
78
92
  commands: deserializer
79
- .get(Field::new("commands").or(default.commands))?,
80
- editor: deserializer
81
- .get(Field::new("editor").or(default.editor))?,
82
- pager: deserializer.get(Field::new("pager").or(default.pager))?,
93
+ .get(Field::new("commands").or(default.commands), source_map)?,
94
+ pager: deserializer
95
+ .get(Field::new("pager").or(default.pager), source_map)?,
83
96
  preview_templates: deserializer.get(
84
97
  Field::new("preview_templates").or(default.preview_templates),
98
+ source_map,
99
+ )?,
100
+ input_bindings: deserializer.get(
101
+ Field::new("input_bindings").or(default.input_bindings),
102
+ source_map,
85
103
  )?,
86
- input_bindings: deserializer
87
- .get(Field::new("input_bindings").or(default.input_bindings))?,
88
- theme: deserializer.get(Field::new("theme").or(default.theme))?,
89
- debug: deserializer.get(Field::new("debug").or(default.debug))?,
104
+ theme: deserializer
105
+ .get(Field::new("theme").or(default.theme), source_map)?,
106
+ debug: deserializer
107
+ .get(Field::new("debug").or(default.debug), source_map)?,
90
108
  persist: deserializer
91
- .get(Field::new("persist").or(default.persist))?,
109
+ .get(Field::new("persist").or(default.persist), source_map)?,
92
110
  })
93
111
  }
94
112
 
@@ -97,14 +115,18 @@ mod tui {
97
115
  Expected::Mapping
98
116
  }
99
117
 
100
- fn deserialize(yaml: SourcedYaml) -> yaml::Result<Self> {
118
+ fn deserialize(
119
+ yaml: SourcedYaml,
120
+ source_map: &SourceMap,
121
+ ) -> yaml::Result<Self> {
101
122
  let default = Self::default();
102
123
  let mut deserializer = StructDeserializer::new(yaml)?;
103
124
  let config = Self {
104
125
  shell: deserializer
105
- .get(Field::new("shell").or(default.shell))?,
126
+ .get(Field::new("shell").or(default.shell), source_map)?,
106
127
  default_query: deserializer.get(
107
128
  Field::new("default_query").or(default.default_query),
129
+ source_map,
108
130
  )?,
109
131
  };
110
132
  deserializer.done()?;
@@ -117,7 +139,10 @@ mod tui {
117
139
  Expected::Mapping
118
140
  }
119
141
 
120
- fn deserialize(yaml: SourcedYaml) -> yaml::Result<Self> {
142
+ fn deserialize(
143
+ yaml: SourcedYaml,
144
+ source_map: &SourceMap,
145
+ ) -> yaml::Result<Self> {
121
146
  let default = Self::default();
122
147
  let mut deserializer = StructDeserializer::new(yaml)?;
123
148
  let config = Self {
@@ -125,30 +150,35 @@ mod tui {
125
150
  .get::<Adopt<_>>(
126
151
  Field::new("primary_color")
127
152
  .or(Adopt(default.primary_color)),
153
+ source_map,
128
154
  )?
129
155
  .0,
130
156
  primary_text_color: deserializer
131
157
  .get::<Adopt<_>>(
132
158
  Field::new("primary_text_color")
133
159
  .or(Adopt(default.primary_text_color)),
160
+ source_map,
134
161
  )?
135
162
  .0,
136
163
  secondary_color: deserializer
137
164
  .get::<Adopt<_>>(
138
165
  Field::new("secondary_color")
139
166
  .or(Adopt(default.secondary_color)),
167
+ source_map,
140
168
  )?
141
169
  .0,
142
170
  success_color: deserializer
143
171
  .get::<Adopt<_>>(
144
172
  Field::new("success_color")
145
173
  .or(Adopt(default.success_color)),
174
+ source_map,
146
175
  )?
147
176
  .0,
148
177
  error_color: deserializer
149
178
  .get::<Adopt<_>>(
150
179
  Field::new("error_color")
151
180
  .or(Adopt(default.error_color)),
181
+ source_map,
152
182
  )?
153
183
  .0,
154
184
  };
@@ -166,7 +196,10 @@ mod tui {
166
196
  Expected::String
167
197
  }
168
198
 
169
- fn deserialize(yaml: SourcedYaml) -> yaml::Result<Self> {
199
+ fn deserialize(
200
+ yaml: SourcedYaml,
201
+ _source_map: &SourceMap,
202
+ ) -> yaml::Result<Self> {
170
203
  let location = yaml.location;
171
204
  let s = yaml.try_into_string()?;
172
205
  // Use the serde implementation for backward compatibility