spikard 0.16.0.pre.rc.3 → 0.16.0
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.
- checksums.yaml +4 -4
- data/ext/spikard_rb/native/Cargo.lock +86 -52
- data/ext/spikard_rb/native/Cargo.toml +5 -5
- data/ext/spikard_rb/src/lib.rs +113 -131
- data/lib/spikard/errors.rb +65 -58
- data/lib/spikard/native.rb +1 -1
- data/lib/spikard/version.rb +2 -2
- data/lib/spikard.rb +10 -1
- data/lib/spikard_rb.so +0 -0
- data/sig/types.rbs +10 -8
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c9b22ae1b233215e4e86f08289fb64749d9f30f1a0f62f18d6352e2afd50c43
|
|
4
|
+
data.tar.gz: 1b39eb8b78cb99cc15dde6e9aa782cdff1a3e60281b6d5bb7dbc9c80730684c9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 56c04624eb0ae08a943514b67fd852f7adeb4e27c55287b27f29274f8cbbfb154bfcca4c98b096e8f686a3334d056166af549ca0b8d1d6e9ec46e745a2a00d57
|
|
7
|
+
data.tar.gz: 8d9f438028202c3b34b5611a1acf84309e359c6cd91bab3e0f87fd55e0406d55edba9eebb34f7462dd1b6e06cc1b93af741a156ebcf16f53981c0f24729e0acd
|
|
@@ -69,9 +69,9 @@ dependencies = [
|
|
|
69
69
|
|
|
70
70
|
[[package]]
|
|
71
71
|
name = "anyhow"
|
|
72
|
-
version = "1.0.
|
|
72
|
+
version = "1.0.103"
|
|
73
73
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
74
|
-
checksum = "
|
|
74
|
+
checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3"
|
|
75
75
|
|
|
76
76
|
[[package]]
|
|
77
77
|
name = "arbitrary"
|
|
@@ -294,9 +294,9 @@ dependencies = [
|
|
|
294
294
|
|
|
295
295
|
[[package]]
|
|
296
296
|
name = "axum-test"
|
|
297
|
-
version = "
|
|
297
|
+
version = "21.0.0"
|
|
298
298
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
299
|
-
checksum = "
|
|
299
|
+
checksum = "3ce104337e4cced59ded9c61f9f18dab0a4670fd339e84f334312686440a9958"
|
|
300
300
|
dependencies = [
|
|
301
301
|
"anyhow",
|
|
302
302
|
"axum",
|
|
@@ -304,6 +304,7 @@ dependencies = [
|
|
|
304
304
|
"bytes",
|
|
305
305
|
"bytesize",
|
|
306
306
|
"cookie",
|
|
307
|
+
"educe",
|
|
307
308
|
"expect-json",
|
|
308
309
|
"futures-util",
|
|
309
310
|
"http",
|
|
@@ -477,9 +478,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|
|
477
478
|
|
|
478
479
|
[[package]]
|
|
479
480
|
name = "chacha20"
|
|
480
|
-
version = "0.10.
|
|
481
|
+
version = "0.10.1"
|
|
481
482
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
482
|
-
checksum = "
|
|
483
|
+
checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81"
|
|
483
484
|
dependencies = [
|
|
484
485
|
"cfg-if",
|
|
485
486
|
"cpufeatures 0.3.0",
|
|
@@ -894,6 +895,18 @@ dependencies = [
|
|
|
894
895
|
"zeroize",
|
|
895
896
|
]
|
|
896
897
|
|
|
898
|
+
[[package]]
|
|
899
|
+
name = "educe"
|
|
900
|
+
version = "0.6.0"
|
|
901
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
902
|
+
checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417"
|
|
903
|
+
dependencies = [
|
|
904
|
+
"enum-ordinalize",
|
|
905
|
+
"proc-macro2",
|
|
906
|
+
"quote",
|
|
907
|
+
"syn",
|
|
908
|
+
]
|
|
909
|
+
|
|
897
910
|
[[package]]
|
|
898
911
|
name = "either"
|
|
899
912
|
version = "1.16.0"
|
|
@@ -939,6 +952,26 @@ dependencies = [
|
|
|
939
952
|
"cfg-if",
|
|
940
953
|
]
|
|
941
954
|
|
|
955
|
+
[[package]]
|
|
956
|
+
name = "enum-ordinalize"
|
|
957
|
+
version = "4.4.1"
|
|
958
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
959
|
+
checksum = "07f808d588c10e464ea6f7d3eaed500049eff30aaac103460f61828c2d65b3eb"
|
|
960
|
+
dependencies = [
|
|
961
|
+
"enum-ordinalize-derive",
|
|
962
|
+
]
|
|
963
|
+
|
|
964
|
+
[[package]]
|
|
965
|
+
name = "enum-ordinalize-derive"
|
|
966
|
+
version = "4.4.1"
|
|
967
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
968
|
+
checksum = "42e528e2d34ba8a67a1a650b86beae8ef69fc5fdb638016f386b973226590432"
|
|
969
|
+
dependencies = [
|
|
970
|
+
"proc-macro2",
|
|
971
|
+
"quote",
|
|
972
|
+
"syn",
|
|
973
|
+
]
|
|
974
|
+
|
|
942
975
|
[[package]]
|
|
943
976
|
name = "equivalent"
|
|
944
977
|
version = "1.0.2"
|
|
@@ -1321,9 +1354,9 @@ dependencies = [
|
|
|
1321
1354
|
|
|
1322
1355
|
[[package]]
|
|
1323
1356
|
name = "handlebars"
|
|
1324
|
-
version = "6.4.
|
|
1357
|
+
version = "6.4.2"
|
|
1325
1358
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1326
|
-
checksum = "
|
|
1359
|
+
checksum = "f26569a2763497b7bd3fbd19374b774ea6038c5293678771259cd534d49740ff"
|
|
1327
1360
|
dependencies = [
|
|
1328
1361
|
"derive_builder",
|
|
1329
1362
|
"log",
|
|
@@ -1679,9 +1712,9 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
|
1679
1712
|
|
|
1680
1713
|
[[package]]
|
|
1681
1714
|
name = "jiff"
|
|
1682
|
-
version = "0.2.
|
|
1715
|
+
version = "0.2.31"
|
|
1683
1716
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1684
|
-
checksum = "
|
|
1717
|
+
checksum = "ccfe6121cbe750cf81efa362d85c0bde7ea298ec43092d3a193baca59cdbd634"
|
|
1685
1718
|
dependencies = [
|
|
1686
1719
|
"defmt",
|
|
1687
1720
|
"jiff-static",
|
|
@@ -1695,9 +1728,9 @@ dependencies = [
|
|
|
1695
1728
|
|
|
1696
1729
|
[[package]]
|
|
1697
1730
|
name = "jiff-static"
|
|
1698
|
-
version = "0.2.
|
|
1731
|
+
version = "0.2.31"
|
|
1699
1732
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1700
|
-
checksum = "
|
|
1733
|
+
checksum = "e165e897f662d428f3cd3828a919dbe067c2d42bb1031eede74ef9d27ecdedd2"
|
|
1701
1734
|
dependencies = [
|
|
1702
1735
|
"proc-macro2",
|
|
1703
1736
|
"quote",
|
|
@@ -1721,9 +1754,9 @@ dependencies = [
|
|
|
1721
1754
|
|
|
1722
1755
|
[[package]]
|
|
1723
1756
|
name = "js-sys"
|
|
1724
|
-
version = "0.3.
|
|
1757
|
+
version = "0.3.103"
|
|
1725
1758
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1726
|
-
checksum = "
|
|
1759
|
+
checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102"
|
|
1727
1760
|
dependencies = [
|
|
1728
1761
|
"cfg-if",
|
|
1729
1762
|
"futures-util",
|
|
@@ -1732,9 +1765,9 @@ dependencies = [
|
|
|
1732
1765
|
|
|
1733
1766
|
[[package]]
|
|
1734
1767
|
name = "jsonschema"
|
|
1735
|
-
version = "0.46.
|
|
1768
|
+
version = "0.46.8"
|
|
1736
1769
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1737
|
-
checksum = "
|
|
1770
|
+
checksum = "24fc8535da347b994f6d2fab0a84b74e3b31ad08ebe4204d95f3e755db7af49b"
|
|
1738
1771
|
dependencies = [
|
|
1739
1772
|
"ahash",
|
|
1740
1773
|
"bytecount",
|
|
@@ -2447,9 +2480,9 @@ dependencies = [
|
|
|
2447
2480
|
|
|
2448
2481
|
[[package]]
|
|
2449
2482
|
name = "quote"
|
|
2450
|
-
version = "1.0.
|
|
2483
|
+
version = "1.0.46"
|
|
2451
2484
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2452
|
-
checksum = "
|
|
2485
|
+
checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368"
|
|
2453
2486
|
dependencies = [
|
|
2454
2487
|
"proc-macro2",
|
|
2455
2488
|
]
|
|
@@ -2489,9 +2522,9 @@ dependencies = [
|
|
|
2489
2522
|
|
|
2490
2523
|
[[package]]
|
|
2491
2524
|
name = "rand"
|
|
2492
|
-
version = "0.10.
|
|
2525
|
+
version = "0.10.2"
|
|
2493
2526
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2494
|
-
checksum = "
|
|
2527
|
+
checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80"
|
|
2495
2528
|
dependencies = [
|
|
2496
2529
|
"chacha20",
|
|
2497
2530
|
"getrandom 0.4.3",
|
|
@@ -2612,9 +2645,9 @@ dependencies = [
|
|
|
2612
2645
|
|
|
2613
2646
|
[[package]]
|
|
2614
2647
|
name = "referencing"
|
|
2615
|
-
version = "0.46.
|
|
2648
|
+
version = "0.46.8"
|
|
2616
2649
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2617
|
-
checksum = "
|
|
2650
|
+
checksum = "1c8dceb372b46fecd006be48ca335468b49ad887a7f0150cabd6098fa4fc500f"
|
|
2618
2651
|
dependencies = [
|
|
2619
2652
|
"ahash",
|
|
2620
2653
|
"fluent-uri",
|
|
@@ -2658,9 +2691,9 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
|
|
|
2658
2691
|
|
|
2659
2692
|
[[package]]
|
|
2660
2693
|
name = "reserve-port"
|
|
2661
|
-
version = "2.
|
|
2694
|
+
version = "2.5.0"
|
|
2662
2695
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2663
|
-
checksum = "
|
|
2696
|
+
checksum = "71ea98a177596a4579881992bd2bd4af27772fc95d0e5f5668a8f9535eca6380"
|
|
2664
2697
|
dependencies = [
|
|
2665
2698
|
"thiserror 2.0.18",
|
|
2666
2699
|
]
|
|
@@ -2740,7 +2773,7 @@ dependencies = [
|
|
|
2740
2773
|
"futures-util",
|
|
2741
2774
|
"http",
|
|
2742
2775
|
"mime",
|
|
2743
|
-
"rand 0.10.
|
|
2776
|
+
"rand 0.10.2",
|
|
2744
2777
|
"thiserror 2.0.18",
|
|
2745
2778
|
]
|
|
2746
2779
|
|
|
@@ -2897,6 +2930,7 @@ version = "1.0.150"
|
|
|
2897
2930
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2898
2931
|
checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
|
|
2899
2932
|
dependencies = [
|
|
2933
|
+
"indexmap",
|
|
2900
2934
|
"itoa",
|
|
2901
2935
|
"memchr",
|
|
2902
2936
|
"serde",
|
|
@@ -3050,9 +3084,9 @@ dependencies = [
|
|
|
3050
3084
|
|
|
3051
3085
|
[[package]]
|
|
3052
3086
|
name = "spikard"
|
|
3053
|
-
version = "0.16.0
|
|
3087
|
+
version = "0.16.0"
|
|
3054
3088
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3055
|
-
checksum = "
|
|
3089
|
+
checksum = "a121f06236315265570f6e6664a5c0125975f4a2c04baec0e4c8de6ce26a7b95"
|
|
3056
3090
|
dependencies = [
|
|
3057
3091
|
"anyhow",
|
|
3058
3092
|
"axum",
|
|
@@ -3070,9 +3104,9 @@ dependencies = [
|
|
|
3070
3104
|
|
|
3071
3105
|
[[package]]
|
|
3072
3106
|
name = "spikard-core"
|
|
3073
|
-
version = "0.16.0
|
|
3107
|
+
version = "0.16.0"
|
|
3074
3108
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3075
|
-
checksum = "
|
|
3109
|
+
checksum = "e604decda23b08f899803cc97c68f7d3a439f610c45d0725b440b0e515949490"
|
|
3076
3110
|
dependencies = [
|
|
3077
3111
|
"anyhow",
|
|
3078
3112
|
"base64",
|
|
@@ -3096,9 +3130,9 @@ dependencies = [
|
|
|
3096
3130
|
|
|
3097
3131
|
[[package]]
|
|
3098
3132
|
name = "spikard-graphql"
|
|
3099
|
-
version = "0.16.0
|
|
3133
|
+
version = "0.16.0"
|
|
3100
3134
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3101
|
-
checksum = "
|
|
3135
|
+
checksum = "c91bdbc87c985cb1f3940d21a6c5b02b4488e5c60473adc490c6bb9dcb3cca05"
|
|
3102
3136
|
dependencies = [
|
|
3103
3137
|
"async-graphql",
|
|
3104
3138
|
"axum",
|
|
@@ -3117,9 +3151,9 @@ dependencies = [
|
|
|
3117
3151
|
|
|
3118
3152
|
[[package]]
|
|
3119
3153
|
name = "spikard-http"
|
|
3120
|
-
version = "0.16.0
|
|
3154
|
+
version = "0.16.0"
|
|
3121
3155
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3122
|
-
checksum = "
|
|
3156
|
+
checksum = "d913f6b16125798145c7d40ec8a78d92744cea37dd10653b2a58fb4db7c5ac20"
|
|
3123
3157
|
dependencies = [
|
|
3124
3158
|
"ahash",
|
|
3125
3159
|
"anyhow",
|
|
@@ -3172,7 +3206,7 @@ dependencies = [
|
|
|
3172
3206
|
|
|
3173
3207
|
[[package]]
|
|
3174
3208
|
name = "spikard-rb"
|
|
3175
|
-
version = "0.16.0
|
|
3209
|
+
version = "0.16.0"
|
|
3176
3210
|
dependencies = [
|
|
3177
3211
|
"magnus",
|
|
3178
3212
|
"rb-sys",
|
|
@@ -3347,9 +3381,9 @@ dependencies = [
|
|
|
3347
3381
|
|
|
3348
3382
|
[[package]]
|
|
3349
3383
|
name = "time"
|
|
3350
|
-
version = "0.3.
|
|
3384
|
+
version = "0.3.53"
|
|
3351
3385
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3352
|
-
checksum = "
|
|
3386
|
+
checksum = "18dfaaeddcb932337b5e7866ee7d0ce9b76d2fd092997146f187ec09b4558a50"
|
|
3353
3387
|
dependencies = [
|
|
3354
3388
|
"deranged",
|
|
3355
3389
|
"num-conv",
|
|
@@ -3367,9 +3401,9 @@ checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109"
|
|
|
3367
3401
|
|
|
3368
3402
|
[[package]]
|
|
3369
3403
|
name = "time-macros"
|
|
3370
|
-
version = "0.2.
|
|
3404
|
+
version = "0.2.31"
|
|
3371
3405
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3372
|
-
checksum = "
|
|
3406
|
+
checksum = "c431b87111666e491a90baa837f914fb45cd5dc3c268591b0220ff5057f2085f"
|
|
3373
3407
|
dependencies = [
|
|
3374
3408
|
"num-conv",
|
|
3375
3409
|
"time-core",
|
|
@@ -3817,9 +3851,9 @@ checksum = "e2eebbbfe4093922c2b6734d7c679ebfebd704a0d7e56dfcb0d05818ce28977d"
|
|
|
3817
3851
|
|
|
3818
3852
|
[[package]]
|
|
3819
3853
|
name = "uuid"
|
|
3820
|
-
version = "1.23.
|
|
3854
|
+
version = "1.23.4"
|
|
3821
3855
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3822
|
-
checksum = "
|
|
3856
|
+
checksum = "bf80a72845275afea99e7f2b434723d3bc7e38470fcd1c7ed39a599c73319a53"
|
|
3823
3857
|
dependencies = [
|
|
3824
3858
|
"getrandom 0.4.3",
|
|
3825
3859
|
"js-sys",
|
|
@@ -3891,9 +3925,9 @@ dependencies = [
|
|
|
3891
3925
|
|
|
3892
3926
|
[[package]]
|
|
3893
3927
|
name = "wasm-bindgen"
|
|
3894
|
-
version = "0.2.
|
|
3928
|
+
version = "0.2.126"
|
|
3895
3929
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3896
|
-
checksum = "
|
|
3930
|
+
checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4"
|
|
3897
3931
|
dependencies = [
|
|
3898
3932
|
"cfg-if",
|
|
3899
3933
|
"once_cell",
|
|
@@ -3904,9 +3938,9 @@ dependencies = [
|
|
|
3904
3938
|
|
|
3905
3939
|
[[package]]
|
|
3906
3940
|
name = "wasm-bindgen-macro"
|
|
3907
|
-
version = "0.2.
|
|
3941
|
+
version = "0.2.126"
|
|
3908
3942
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3909
|
-
checksum = "
|
|
3943
|
+
checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1"
|
|
3910
3944
|
dependencies = [
|
|
3911
3945
|
"quote",
|
|
3912
3946
|
"wasm-bindgen-macro-support",
|
|
@@ -3914,9 +3948,9 @@ dependencies = [
|
|
|
3914
3948
|
|
|
3915
3949
|
[[package]]
|
|
3916
3950
|
name = "wasm-bindgen-macro-support"
|
|
3917
|
-
version = "0.2.
|
|
3951
|
+
version = "0.2.126"
|
|
3918
3952
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3919
|
-
checksum = "
|
|
3953
|
+
checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e"
|
|
3920
3954
|
dependencies = [
|
|
3921
3955
|
"bumpalo",
|
|
3922
3956
|
"proc-macro2",
|
|
@@ -3927,18 +3961,18 @@ dependencies = [
|
|
|
3927
3961
|
|
|
3928
3962
|
[[package]]
|
|
3929
3963
|
name = "wasm-bindgen-shared"
|
|
3930
|
-
version = "0.2.
|
|
3964
|
+
version = "0.2.126"
|
|
3931
3965
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3932
|
-
checksum = "
|
|
3966
|
+
checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24"
|
|
3933
3967
|
dependencies = [
|
|
3934
3968
|
"unicode-ident",
|
|
3935
3969
|
]
|
|
3936
3970
|
|
|
3937
3971
|
[[package]]
|
|
3938
3972
|
name = "web-sys"
|
|
3939
|
-
version = "0.3.
|
|
3973
|
+
version = "0.3.103"
|
|
3940
3974
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3941
|
-
checksum = "
|
|
3975
|
+
checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141"
|
|
3942
3976
|
dependencies = [
|
|
3943
3977
|
"js-sys",
|
|
3944
3978
|
"wasm-bindgen",
|
|
@@ -4213,9 +4247,9 @@ dependencies = [
|
|
|
4213
4247
|
|
|
4214
4248
|
[[package]]
|
|
4215
4249
|
name = "zlib-rs"
|
|
4216
|
-
version = "0.6.
|
|
4250
|
+
version = "0.6.5"
|
|
4217
4251
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
4218
|
-
checksum = "
|
|
4252
|
+
checksum = "5431d5661c32445236631278f27946e444ddafe4684cac70b185272d4f9c52d5"
|
|
4219
4253
|
|
|
4220
4254
|
[[package]]
|
|
4221
4255
|
name = "zmij"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "spikard-rb"
|
|
3
|
-
version = "0.16.0
|
|
3
|
+
version = "0.16.0"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
license = "MIT"
|
|
6
6
|
description = "Rust-centric multi-language HTTP framework with polyglot bindings"
|
|
@@ -25,8 +25,8 @@ magnus = "0.8"
|
|
|
25
25
|
rb-sys = ">=0.9, <0.9.128"
|
|
26
26
|
serde = { version = "1", features = ["derive"] }
|
|
27
27
|
serde_json = "1"
|
|
28
|
-
spikard = { version = "0.16.0
|
|
29
|
-
spikard-core = { version = "0.16.0
|
|
30
|
-
spikard-graphql = { version = "0.16.0
|
|
31
|
-
spikard-http = { version = "0.16.0
|
|
28
|
+
spikard = { version = "0.16.0", features = ["di"] }
|
|
29
|
+
spikard-core = { version = "0.16.0" }
|
|
30
|
+
spikard-graphql = { version = "0.16.0" }
|
|
31
|
+
spikard-http = { version = "0.16.0" }
|
|
32
32
|
tokio = { version = "1", features = ["rt-multi-thread"] }
|
data/ext/spikard_rb/src/lib.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file is auto-generated by alef. DO NOT EDIT.
|
|
2
|
-
// alef:hash:
|
|
2
|
+
// alef:hash:311daba6328f0b9c14dde594f82aef8bd216642a26bb32c123069d3cb499f1f3
|
|
3
3
|
// Re-generate with: alef generate
|
|
4
4
|
#![allow(dead_code, unused_imports, unused_variables)]
|
|
5
5
|
#![allow(
|
|
@@ -570,6 +570,74 @@ impl FullSchemaConfig {
|
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
572
|
|
|
573
|
+
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
574
|
+
#[serde(default)]
|
|
575
|
+
#[magnus::wrap(class = "Spikard::AsyncApiConfig")]
|
|
576
|
+
pub struct AsyncApiConfig {
|
|
577
|
+
enabled: bool,
|
|
578
|
+
spec: Option<String>,
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
unsafe impl IntoValueFromNative for AsyncApiConfig {}
|
|
582
|
+
|
|
583
|
+
impl magnus::TryConvert for AsyncApiConfig {
|
|
584
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
585
|
+
if let Ok(r) = <&AsyncApiConfig as magnus::TryConvert>::try_convert(val) {
|
|
586
|
+
return Ok(r.clone());
|
|
587
|
+
}
|
|
588
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
589
|
+
s
|
|
590
|
+
} else {
|
|
591
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
592
|
+
magnus::Error::new(
|
|
593
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
594
|
+
format!("no implicit conversion into AsyncApiConfig: {}", e),
|
|
595
|
+
)
|
|
596
|
+
})?
|
|
597
|
+
};
|
|
598
|
+
serde_json::from_str::<AsyncApiConfig>(&json_str).map_err(|e| {
|
|
599
|
+
magnus::Error::new(
|
|
600
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
601
|
+
format!("failed to deserialize AsyncApiConfig: {}", e),
|
|
602
|
+
)
|
|
603
|
+
})
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
unsafe impl TryConvertOwned for AsyncApiConfig {}
|
|
608
|
+
|
|
609
|
+
impl Default for AsyncApiConfig {
|
|
610
|
+
fn default() -> Self {
|
|
611
|
+
spikard::AsyncApiConfig::default().into()
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
impl AsyncApiConfig {
|
|
616
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
617
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
618
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
619
|
+
let (kwargs_opt,) = args.optional;
|
|
620
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
621
|
+
Ok(Self {
|
|
622
|
+
enabled: kwargs
|
|
623
|
+
.get(ruby.to_symbol("enabled"))
|
|
624
|
+
.and_then(|v| bool::try_convert(v).ok())
|
|
625
|
+
.unwrap_or_default(),
|
|
626
|
+
spec: kwargs
|
|
627
|
+
.get(ruby.to_symbol("spec"))
|
|
628
|
+
.and_then(|v| String::try_convert(v).ok()),
|
|
629
|
+
})
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
fn enabled(&self) -> bool {
|
|
633
|
+
self.enabled
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
fn spec(&self) -> Option<String> {
|
|
637
|
+
self.spec.clone()
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
|
|
573
641
|
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
574
642
|
#[serde(default)]
|
|
575
643
|
#[magnus::wrap(class = "Spikard::BackgroundTaskConfig")]
|
|
@@ -1323,19 +1391,7 @@ unsafe impl TryConvertOwned for OpenApiConfig {}
|
|
|
1323
1391
|
|
|
1324
1392
|
impl Default for OpenApiConfig {
|
|
1325
1393
|
fn default() -> Self {
|
|
1326
|
-
|
|
1327
|
-
enabled: false,
|
|
1328
|
-
title: "API".to_string(),
|
|
1329
|
-
version: "1.0.0".to_string(),
|
|
1330
|
-
description: None,
|
|
1331
|
-
swagger_ui_path: String::new(),
|
|
1332
|
-
redoc_path: String::new(),
|
|
1333
|
-
openapi_json_path: String::new(),
|
|
1334
|
-
contact: None,
|
|
1335
|
-
license: None,
|
|
1336
|
-
servers: vec![],
|
|
1337
|
-
security_schemes: Default::default(),
|
|
1338
|
-
}
|
|
1394
|
+
spikard::OpenApiConfig::default().into()
|
|
1339
1395
|
}
|
|
1340
1396
|
}
|
|
1341
1397
|
|
|
@@ -1962,27 +2018,7 @@ unsafe impl TryConvertOwned for ServerConfig {}
|
|
|
1962
2018
|
|
|
1963
2019
|
impl Default for ServerConfig {
|
|
1964
2020
|
fn default() -> Self {
|
|
1965
|
-
|
|
1966
|
-
host: "127.0.0.1".to_string(),
|
|
1967
|
-
port: 8000,
|
|
1968
|
-
workers: 1,
|
|
1969
|
-
enable_request_id: false,
|
|
1970
|
-
max_body_size: None,
|
|
1971
|
-
request_timeout: None,
|
|
1972
|
-
compression: None,
|
|
1973
|
-
rate_limit: None,
|
|
1974
|
-
jwt_auth: None,
|
|
1975
|
-
api_key_auth: None,
|
|
1976
|
-
static_files: vec![],
|
|
1977
|
-
graceful_shutdown: true,
|
|
1978
|
-
shutdown_timeout: 30,
|
|
1979
|
-
asyncapi: None,
|
|
1980
|
-
openapi: None,
|
|
1981
|
-
jsonrpc: None,
|
|
1982
|
-
grpc: None,
|
|
1983
|
-
background_tasks: Default::default(),
|
|
1984
|
-
enable_http_trace: false,
|
|
1985
|
-
}
|
|
2021
|
+
spikard::ServerConfig::default().into()
|
|
1986
2022
|
}
|
|
1987
2023
|
}
|
|
1988
2024
|
|
|
@@ -2566,74 +2602,6 @@ impl ProblemDetails {
|
|
|
2566
2602
|
}
|
|
2567
2603
|
}
|
|
2568
2604
|
|
|
2569
|
-
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
2570
|
-
#[serde(default)]
|
|
2571
|
-
#[magnus::wrap(class = "Spikard::AsyncApiConfig")]
|
|
2572
|
-
pub struct AsyncApiConfig {
|
|
2573
|
-
enabled: bool,
|
|
2574
|
-
spec: Option<String>,
|
|
2575
|
-
}
|
|
2576
|
-
|
|
2577
|
-
unsafe impl IntoValueFromNative for AsyncApiConfig {}
|
|
2578
|
-
|
|
2579
|
-
impl magnus::TryConvert for AsyncApiConfig {
|
|
2580
|
-
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
2581
|
-
if let Ok(r) = <&AsyncApiConfig as magnus::TryConvert>::try_convert(val) {
|
|
2582
|
-
return Ok(r.clone());
|
|
2583
|
-
}
|
|
2584
|
-
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
2585
|
-
s
|
|
2586
|
-
} else {
|
|
2587
|
-
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
2588
|
-
magnus::Error::new(
|
|
2589
|
-
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
2590
|
-
format!("no implicit conversion into AsyncApiConfig: {}", e),
|
|
2591
|
-
)
|
|
2592
|
-
})?
|
|
2593
|
-
};
|
|
2594
|
-
serde_json::from_str::<AsyncApiConfig>(&json_str).map_err(|e| {
|
|
2595
|
-
magnus::Error::new(
|
|
2596
|
-
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
2597
|
-
format!("failed to deserialize AsyncApiConfig: {}", e),
|
|
2598
|
-
)
|
|
2599
|
-
})
|
|
2600
|
-
}
|
|
2601
|
-
}
|
|
2602
|
-
|
|
2603
|
-
unsafe impl TryConvertOwned for AsyncApiConfig {}
|
|
2604
|
-
|
|
2605
|
-
impl Default for AsyncApiConfig {
|
|
2606
|
-
fn default() -> Self {
|
|
2607
|
-
spikard_http::AsyncApiConfig::default().into()
|
|
2608
|
-
}
|
|
2609
|
-
}
|
|
2610
|
-
|
|
2611
|
-
impl AsyncApiConfig {
|
|
2612
|
-
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
2613
|
-
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
2614
|
-
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
2615
|
-
let (kwargs_opt,) = args.optional;
|
|
2616
|
-
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
2617
|
-
Ok(Self {
|
|
2618
|
-
enabled: kwargs
|
|
2619
|
-
.get(ruby.to_symbol("enabled"))
|
|
2620
|
-
.and_then(|v| bool::try_convert(v).ok())
|
|
2621
|
-
.unwrap_or_default(),
|
|
2622
|
-
spec: kwargs
|
|
2623
|
-
.get(ruby.to_symbol("spec"))
|
|
2624
|
-
.and_then(|v| String::try_convert(v).ok()),
|
|
2625
|
-
})
|
|
2626
|
-
}
|
|
2627
|
-
|
|
2628
|
-
fn enabled(&self) -> bool {
|
|
2629
|
-
self.enabled
|
|
2630
|
-
}
|
|
2631
|
-
|
|
2632
|
-
fn spec(&self) -> Option<String> {
|
|
2633
|
-
self.spec.clone()
|
|
2634
|
-
}
|
|
2635
|
-
}
|
|
2636
|
-
|
|
2637
2605
|
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
2638
2606
|
#[magnus::wrap(class = "Spikard::ParsedChannel")]
|
|
2639
2607
|
pub struct ParsedChannel {
|
|
@@ -3827,9 +3795,11 @@ impl magnus::TryConvert for SecuritySchemeInfo {
|
|
|
3827
3795
|
})?
|
|
3828
3796
|
};
|
|
3829
3797
|
// Try deserializing as JSON first (handles JSON strings like "\"markdown\"" or "{\"click\":{\"selector\":\"...\"}}\"")
|
|
3798
|
+
// For internally-tagged enums, a bare variant string is wrapped as {"<tag>": value}.
|
|
3830
3799
|
// If that fails, try treating it as a plain string value and wrap in quotes
|
|
3831
3800
|
// If both fail, try as Custom variant (for untagged enum support)
|
|
3832
3801
|
serde_json::from_str(&json_str)
|
|
3802
|
+
.or_else(|_| serde_json::from_value(serde_json::json!({ "type": json_str })))
|
|
3833
3803
|
.or_else(|_| serde_json::from_str(&format!("\"{json_str}\"")))
|
|
3834
3804
|
.or_else(|_| {
|
|
3835
3805
|
// Try as a JSON string for Custom variant (untagged enums accept any remaining value)
|
|
@@ -3882,6 +3852,7 @@ impl magnus::TryConvert for SnapshotError {
|
|
|
3882
3852
|
})?
|
|
3883
3853
|
};
|
|
3884
3854
|
// Try deserializing as JSON first (handles JSON strings like "\"markdown\"" or "{\"click\":{\"selector\":\"...\"}}\"")
|
|
3855
|
+
// For internally-tagged enums, a bare variant string is wrapped as {"<tag>": value}.
|
|
3885
3856
|
// If that fails, try treating it as a plain string value and wrap in quotes
|
|
3886
3857
|
// If both fail, try as Custom variant (for untagged enum support)
|
|
3887
3858
|
serde_json::from_str(&json_str)
|
|
@@ -3939,6 +3910,7 @@ impl magnus::TryConvert for WebSocketMessage {
|
|
|
3939
3910
|
})?
|
|
3940
3911
|
};
|
|
3941
3912
|
// Try deserializing as JSON first (handles JSON strings like "\"markdown\"" or "{\"click\":{\"selector\":\"...\"}}\"")
|
|
3913
|
+
// For internally-tagged enums, a bare variant string is wrapped as {"<tag>": value}.
|
|
3942
3914
|
// If that fails, try treating it as a plain string value and wrap in quotes
|
|
3943
3915
|
// If both fail, try as Custom variant (for untagged enum support)
|
|
3944
3916
|
serde_json::from_str(&json_str)
|
|
@@ -3957,6 +3929,12 @@ impl magnus::TryConvert for WebSocketMessage {
|
|
|
3957
3929
|
unsafe impl IntoValueFromNative for WebSocketMessage {}
|
|
3958
3930
|
unsafe impl TryConvertOwned for WebSocketMessage {}
|
|
3959
3931
|
|
|
3932
|
+
impl WebSocketMessage {
|
|
3933
|
+
pub fn _factory_close(code: u16, reason: Option<String>) -> Self {
|
|
3934
|
+
Self::Close { code, reason }
|
|
3935
|
+
}
|
|
3936
|
+
}
|
|
3937
|
+
|
|
3960
3938
|
fn schema_query_only() -> QueryOnlyConfig {
|
|
3961
3939
|
spikard_graphql::schema_query_only().into()
|
|
3962
3940
|
}
|
|
@@ -4070,6 +4048,26 @@ impl From<spikard::FullSchemaConfig> for FullSchemaConfig {
|
|
|
4070
4048
|
}
|
|
4071
4049
|
}
|
|
4072
4050
|
|
|
4051
|
+
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
|
|
4052
|
+
impl From<AsyncApiConfig> for spikard::AsyncApiConfig {
|
|
4053
|
+
fn from(val: AsyncApiConfig) -> Self {
|
|
4054
|
+
Self {
|
|
4055
|
+
enabled: val.enabled,
|
|
4056
|
+
spec: val.spec.as_ref().and_then(|s| serde_json::from_str(s).ok()),
|
|
4057
|
+
}
|
|
4058
|
+
}
|
|
4059
|
+
}
|
|
4060
|
+
|
|
4061
|
+
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
|
|
4062
|
+
impl From<spikard::AsyncApiConfig> for AsyncApiConfig {
|
|
4063
|
+
fn from(val: spikard::AsyncApiConfig) -> Self {
|
|
4064
|
+
Self {
|
|
4065
|
+
enabled: val.enabled,
|
|
4066
|
+
spec: val.spec.as_ref().map(ToString::to_string),
|
|
4067
|
+
}
|
|
4068
|
+
}
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4073
4071
|
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
|
|
4074
4072
|
impl From<BackgroundTaskConfig> for spikard::BackgroundTaskConfig {
|
|
4075
4073
|
fn from(val: BackgroundTaskConfig) -> Self {
|
|
@@ -4510,26 +4508,6 @@ impl From<spikard_core::ProblemDetails> for ProblemDetails {
|
|
|
4510
4508
|
}
|
|
4511
4509
|
}
|
|
4512
4510
|
|
|
4513
|
-
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
|
|
4514
|
-
impl From<AsyncApiConfig> for spikard_http::AsyncApiConfig {
|
|
4515
|
-
fn from(val: AsyncApiConfig) -> Self {
|
|
4516
|
-
Self {
|
|
4517
|
-
enabled: val.enabled,
|
|
4518
|
-
spec: val.spec.as_ref().and_then(|s| serde_json::from_str(s).ok()),
|
|
4519
|
-
}
|
|
4520
|
-
}
|
|
4521
|
-
}
|
|
4522
|
-
|
|
4523
|
-
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
|
|
4524
|
-
impl From<spikard_http::AsyncApiConfig> for AsyncApiConfig {
|
|
4525
|
-
fn from(val: spikard_http::AsyncApiConfig) -> Self {
|
|
4526
|
-
Self {
|
|
4527
|
-
enabled: val.enabled,
|
|
4528
|
-
spec: val.spec.as_ref().map(ToString::to_string),
|
|
4529
|
-
}
|
|
4530
|
-
}
|
|
4531
|
-
}
|
|
4532
|
-
|
|
4533
4511
|
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
|
|
4534
4512
|
impl From<spikard_http::ParsedChannel> for ParsedChannel {
|
|
4535
4513
|
fn from(val: spikard_http::ParsedChannel) -> Self {
|
|
@@ -4965,6 +4943,14 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
4965
4943
|
|
|
4966
4944
|
class.define_method("depth_limit", method!(FullSchemaConfig::depth_limit, 0))?;
|
|
4967
4945
|
|
|
4946
|
+
let class = module.define_class("AsyncApiConfig", ruby.class_object())?;
|
|
4947
|
+
|
|
4948
|
+
class.define_singleton_method("new", function!(AsyncApiConfig::new, -1))?;
|
|
4949
|
+
|
|
4950
|
+
class.define_method("enabled", method!(AsyncApiConfig::enabled, 0))?;
|
|
4951
|
+
|
|
4952
|
+
class.define_method("spec", method!(AsyncApiConfig::spec, 0))?;
|
|
4953
|
+
|
|
4968
4954
|
let class = module.define_class("BackgroundTaskConfig", ruby.class_object())?;
|
|
4969
4955
|
|
|
4970
4956
|
class.define_singleton_method("new", function!(BackgroundTaskConfig::new, -1))?;
|
|
@@ -5262,14 +5248,6 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
5262
5248
|
|
|
5263
5249
|
class.define_method("to_json_pretty", method!(ProblemDetails::to_json_pretty, 0))?;
|
|
5264
5250
|
|
|
5265
|
-
let class = module.define_class("AsyncApiConfig", ruby.class_object())?;
|
|
5266
|
-
|
|
5267
|
-
class.define_singleton_method("new", function!(AsyncApiConfig::new, -1))?;
|
|
5268
|
-
|
|
5269
|
-
class.define_method("enabled", method!(AsyncApiConfig::enabled, 0))?;
|
|
5270
|
-
|
|
5271
|
-
class.define_method("spec", method!(AsyncApiConfig::spec, 0))?;
|
|
5272
|
-
|
|
5273
5251
|
let class = module.define_class("ParsedChannel", ruby.class_object())?;
|
|
5274
5252
|
|
|
5275
5253
|
class.define_singleton_method("new", function!(ParsedChannel::new, -1))?;
|
|
@@ -5421,6 +5399,10 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
5421
5399
|
method!(TestClient::graphql_subscription_async, 3),
|
|
5422
5400
|
)?;
|
|
5423
5401
|
|
|
5402
|
+
let class = module.define_class("WebSocketMessage", ruby.class_object())?;
|
|
5403
|
+
|
|
5404
|
+
class.define_singleton_method("close", function!(WebSocketMessage::_factory_close, 2))?;
|
|
5405
|
+
|
|
5424
5406
|
module.define_module_function("schema_query_only", function!(schema_query_only, 0))?;
|
|
5425
5407
|
|
|
5426
5408
|
module.define_module_function("schema_query_mutation", function!(schema_query_mutation, 0))?;
|
data/lib/spikard/errors.rb
CHANGED
|
@@ -2,65 +2,72 @@
|
|
|
2
2
|
|
|
3
3
|
module Spikard
|
|
4
4
|
module Errors
|
|
5
|
-
class Error < StandardError
|
|
6
|
-
|
|
5
|
+
class Error < StandardError
|
|
6
|
+
attr_reader :status_code, :problem_details_type
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
def initialize(message = nil, status_code: nil, problem_details_type: nil)
|
|
9
|
+
super(message)
|
|
10
|
+
@status_code = status_code
|
|
11
|
+
@problem_details_type = problem_details_type
|
|
12
|
+
end
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
class
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
end
|
|
14
|
+
def to_problem_details
|
|
15
|
+
{
|
|
16
|
+
type: @problem_details_type || "about:blank",
|
|
17
|
+
title: self.class.name.split("::").last,
|
|
18
|
+
status: @status_code || 500,
|
|
19
|
+
detail: message
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
class NotFoundError < Error
|
|
25
|
+
# Raised when the requested resource does not exist.
|
|
26
|
+
def initialize(message = nil)
|
|
27
|
+
super(message, status_code: 404, problem_details_type: nil)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
class ValidationError < Error
|
|
32
|
+
# Raised when input validation fails. Carries a list of field errors per RFC 9457.
|
|
33
|
+
def initialize(message = nil)
|
|
34
|
+
super(message, status_code: 422, problem_details_type: nil)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
class UnauthorizedError < Error
|
|
39
|
+
# Raised when the request lacks valid authentication credentials.
|
|
40
|
+
def initialize(message = nil)
|
|
41
|
+
super(message, status_code: 401, problem_details_type: nil)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
class ForbiddenError < Error
|
|
46
|
+
# Raised when the authenticated user lacks permission for the requested action.
|
|
47
|
+
def initialize(message = nil)
|
|
48
|
+
super(message, status_code: 403, problem_details_type: nil)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
class RateLimitedError < Error
|
|
53
|
+
# Raised when the client exceeds the configured request rate limit.
|
|
54
|
+
def initialize(message = nil)
|
|
55
|
+
super(message, status_code: 429, problem_details_type: nil)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
class ConflictError < Error
|
|
60
|
+
# Raised when the request conflicts with the current state of the resource.
|
|
61
|
+
def initialize(message = nil)
|
|
62
|
+
super(message, status_code: 409, problem_details_type: nil)
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
class InternalError < Error
|
|
67
|
+
# Raised when the server encounters an unexpected failure.
|
|
68
|
+
def initialize(message = nil)
|
|
69
|
+
super(message, status_code: 500, problem_details_type: nil)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
65
72
|
end
|
|
66
73
|
end
|
data/lib/spikard/native.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:311daba6328f0b9c14dde594f82aef8bd216642a26bb32c123069d3cb499f1f3
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
# frozen_string_literal: true
|
data/lib/spikard/version.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:311daba6328f0b9c14dde594f82aef8bd216642a26bb32c123069d3cb499f1f3
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
# frozen_string_literal: true
|
|
6
6
|
|
|
7
7
|
module Spikard
|
|
8
8
|
## The version string for this package.
|
|
9
|
-
VERSION = "0.16.0
|
|
9
|
+
VERSION = "0.16.0"
|
|
10
10
|
end
|
data/lib/spikard.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:311daba6328f0b9c14dde594f82aef8bd216642a26bb32c123069d3cb499f1f3
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
# frozen_string_literal: true
|
|
@@ -17,3 +17,12 @@ module Spikard
|
|
|
17
17
|
# Re-export all types and functions from native extension
|
|
18
18
|
require_relative "spikard/service"
|
|
19
19
|
end
|
|
20
|
+
|
|
21
|
+
# Bring top-level Spikard classes into the global namespace so callers
|
|
22
|
+
# (and the generated e2e suite) can reference them unqualified. The native
|
|
23
|
+
# extension has already been required above, so every type constant is defined
|
|
24
|
+
# under Spikard by this point.
|
|
25
|
+
Spikard.constants.each do |const_name|
|
|
26
|
+
value = Spikard.const_get(const_name)
|
|
27
|
+
::Object.const_set(const_name, value) if value.is_a?(Module) && !::Object.const_defined?(const_name)
|
|
28
|
+
end
|
data/lib/spikard_rb.so
CHANGED
|
Binary file
|
data/sig/types.rbs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:311daba6328f0b9c14dde594f82aef8bd216642a26bb32c123069d3cb499f1f3
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
|
|
@@ -71,6 +71,13 @@ module Spikard
|
|
|
71
71
|
def self.default: () -> FullSchemaConfig
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
+
class AsyncApiConfig
|
|
75
|
+
attr_accessor enabled: bool?
|
|
76
|
+
attr_accessor spec: json_value?
|
|
77
|
+
|
|
78
|
+
def initialize: (?enabled: bool, ?spec: json_value) -> void
|
|
79
|
+
end
|
|
80
|
+
|
|
74
81
|
class BackgroundTaskConfig
|
|
75
82
|
attr_accessor max_queue_size: Integer?
|
|
76
83
|
attr_accessor max_concurrent_tasks: Integer?
|
|
@@ -295,13 +302,6 @@ module Spikard
|
|
|
295
302
|
def self.bad_request: (String detail) -> ProblemDetails
|
|
296
303
|
end
|
|
297
304
|
|
|
298
|
-
class AsyncApiConfig
|
|
299
|
-
attr_accessor enabled: bool?
|
|
300
|
-
attr_accessor spec: json_value?
|
|
301
|
-
|
|
302
|
-
def initialize: (?enabled: bool, ?spec: json_value) -> void
|
|
303
|
-
end
|
|
304
|
-
|
|
305
305
|
class ParsedChannel
|
|
306
306
|
attr_reader name: String
|
|
307
307
|
attr_reader address: String
|
|
@@ -434,6 +434,8 @@ module Spikard
|
|
|
434
434
|
end
|
|
435
435
|
|
|
436
436
|
class WebSocketMessage
|
|
437
|
+
def self.close: (Integer code, ?String reason) -> WebSocketMessage
|
|
438
|
+
|
|
437
439
|
end
|
|
438
440
|
|
|
439
441
|
def self.schema_query_only: () -> QueryOnlyConfig
|