spikard 0.16.0.pre.rc.4 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ec20852770933e9219667b03301dd436625ff3088f9e04829ef8c1957da2340
4
- data.tar.gz: b79cb2c854a05cf4a7bd341315b4df2ea6b7bbcf8740b8841d7b27ff782c4afc
3
+ metadata.gz: 2c9b22ae1b233215e4e86f08289fb64749d9f30f1a0f62f18d6352e2afd50c43
4
+ data.tar.gz: 1b39eb8b78cb99cc15dde6e9aa782cdff1a3e60281b6d5bb7dbc9c80730684c9
5
5
  SHA512:
6
- metadata.gz: 49a8006a4ed29d8f73d07b977fc306de604a31f2fe6d822bc060b2d22e0b632ff87445efe7feb2484bd10ce758518b353b0c8b67a58657b8bff333fe8b124e57
7
- data.tar.gz: d3a1357c8188b8c1903f15cc38c377f4fed3b83cdbcb0601a591ee0bbc862db1dce28310cc982d3383cd016c53aa5a7a6dbe8a4a5d325a36a7eab6b4f014a6c7
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.102"
72
+ version = "1.0.103"
73
73
  source = "registry+https://github.com/rust-lang/crates.io-index"
74
- checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
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 = "20.1.0"
297
+ version = "21.0.0"
298
298
  source = "registry+https://github.com/rust-lang/crates.io-index"
299
- checksum = "43c6a2f1d97ee33c39f13dacc0f84ae781a9c2ed373a75bad1129094f5a7c4bd"
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",
@@ -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"
@@ -1679,9 +1712,9 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
1679
1712
 
1680
1713
  [[package]]
1681
1714
  name = "jiff"
1682
- version = "0.2.29"
1715
+ version = "0.2.31"
1683
1716
  source = "registry+https://github.com/rust-lang/crates.io-index"
1684
- checksum = "34f877a98676d2fb664698d74cc6a51ce6c484ce8c770f05d0108ec9090aeb46"
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.29"
1731
+ version = "0.2.31"
1699
1732
  source = "registry+https://github.com/rust-lang/crates.io-index"
1700
- checksum = "0666b5ab5ecaca213fc2a85b8c0083d9004e84ee2d5f9a7e0017aaf50986f25f"
1733
+ checksum = "e165e897f662d428f3cd3828a919dbe067c2d42bb1031eede74ef9d27ecdedd2"
1701
1734
  dependencies = [
1702
1735
  "proc-macro2",
1703
1736
  "quote",
@@ -1732,9 +1765,9 @@ dependencies = [
1732
1765
 
1733
1766
  [[package]]
1734
1767
  name = "jsonschema"
1735
- version = "0.46.6"
1768
+ version = "0.46.8"
1736
1769
  source = "registry+https://github.com/rust-lang/crates.io-index"
1737
- checksum = "8374249b1bdce1c1773a09fa294347e19e4bfeb86d845c2d8ebaf8a8dbf11233"
1770
+ checksum = "24fc8535da347b994f6d2fab0a84b74e3b31ad08ebe4204d95f3e755db7af49b"
1738
1771
  dependencies = [
1739
1772
  "ahash",
1740
1773
  "bytecount",
@@ -2489,9 +2522,9 @@ dependencies = [
2489
2522
 
2490
2523
  [[package]]
2491
2524
  name = "rand"
2492
- version = "0.10.1"
2525
+ version = "0.10.2"
2493
2526
  source = "registry+https://github.com/rust-lang/crates.io-index"
2494
- checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207"
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.6"
2648
+ version = "0.46.8"
2616
2649
  source = "registry+https://github.com/rust-lang/crates.io-index"
2617
- checksum = "65a910f9d63351f9c9d7dc3053d02b214ea3a005917140c70087d7b59cbc5bb1"
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.4.0"
2694
+ version = "2.5.0"
2662
2695
  source = "registry+https://github.com/rust-lang/crates.io-index"
2663
- checksum = "94070964579245eb2f76e62a7668fe87bd9969ed6c41256f3bf614e3323dd3cc"
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.1",
2776
+ "rand 0.10.2",
2744
2777
  "thiserror 2.0.18",
2745
2778
  ]
2746
2779
 
@@ -3051,9 +3084,9 @@ dependencies = [
3051
3084
 
3052
3085
  [[package]]
3053
3086
  name = "spikard"
3054
- version = "0.16.0-rc.4"
3087
+ version = "0.16.0"
3055
3088
  source = "registry+https://github.com/rust-lang/crates.io-index"
3056
- checksum = "a09796d63bb1f8625b23d57356f9f154d77a4014122d955ef510228199ab887d"
3089
+ checksum = "a121f06236315265570f6e6664a5c0125975f4a2c04baec0e4c8de6ce26a7b95"
3057
3090
  dependencies = [
3058
3091
  "anyhow",
3059
3092
  "axum",
@@ -3071,9 +3104,9 @@ dependencies = [
3071
3104
 
3072
3105
  [[package]]
3073
3106
  name = "spikard-core"
3074
- version = "0.16.0-rc.4"
3107
+ version = "0.16.0"
3075
3108
  source = "registry+https://github.com/rust-lang/crates.io-index"
3076
- checksum = "0e58a4adfbc691a2edd686da4f49ac29b3d7bdd5701059c5d7a00d1de57fd9a2"
3109
+ checksum = "e604decda23b08f899803cc97c68f7d3a439f610c45d0725b440b0e515949490"
3077
3110
  dependencies = [
3078
3111
  "anyhow",
3079
3112
  "base64",
@@ -3097,9 +3130,9 @@ dependencies = [
3097
3130
 
3098
3131
  [[package]]
3099
3132
  name = "spikard-graphql"
3100
- version = "0.16.0-rc.4"
3133
+ version = "0.16.0"
3101
3134
  source = "registry+https://github.com/rust-lang/crates.io-index"
3102
- checksum = "b621e9b24f7b7d1c26764dc149d2983eb8b8ff5d77ef36a985423b22d60b3190"
3135
+ checksum = "c91bdbc87c985cb1f3940d21a6c5b02b4488e5c60473adc490c6bb9dcb3cca05"
3103
3136
  dependencies = [
3104
3137
  "async-graphql",
3105
3138
  "axum",
@@ -3118,9 +3151,9 @@ dependencies = [
3118
3151
 
3119
3152
  [[package]]
3120
3153
  name = "spikard-http"
3121
- version = "0.16.0-rc.4"
3154
+ version = "0.16.0"
3122
3155
  source = "registry+https://github.com/rust-lang/crates.io-index"
3123
- checksum = "2512110f59ff7463bdc700469b262e3f22fee1bb813ece014c906ab6b3d82df6"
3156
+ checksum = "d913f6b16125798145c7d40ec8a78d92744cea37dd10653b2a58fb4db7c5ac20"
3124
3157
  dependencies = [
3125
3158
  "ahash",
3126
3159
  "anyhow",
@@ -3173,7 +3206,7 @@ dependencies = [
3173
3206
 
3174
3207
  [[package]]
3175
3208
  name = "spikard-rb"
3176
- version = "0.16.0-rc.4"
3209
+ version = "0.16.0"
3177
3210
  dependencies = [
3178
3211
  "magnus",
3179
3212
  "rb-sys",
@@ -3348,9 +3381,9 @@ dependencies = [
3348
3381
 
3349
3382
  [[package]]
3350
3383
  name = "time"
3351
- version = "0.3.51"
3384
+ version = "0.3.53"
3352
3385
  source = "registry+https://github.com/rust-lang/crates.io-index"
3353
- checksum = "85c17d80feb7334b40c484e45ed1a5273dfd8bfda537c3be2e74a06a6686f327"
3386
+ checksum = "18dfaaeddcb932337b5e7866ee7d0ce9b76d2fd092997146f187ec09b4558a50"
3354
3387
  dependencies = [
3355
3388
  "deranged",
3356
3389
  "num-conv",
@@ -3368,9 +3401,9 @@ checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109"
3368
3401
 
3369
3402
  [[package]]
3370
3403
  name = "time-macros"
3371
- version = "0.2.30"
3404
+ version = "0.2.31"
3372
3405
  source = "registry+https://github.com/rust-lang/crates.io-index"
3373
- checksum = "dcef1a61bdb119096e153208ec5cbec23944ce8bca13be5c7f60c634f7403935"
3406
+ checksum = "c431b87111666e491a90baa837f914fb45cd5dc3c268591b0220ff5057f2085f"
3374
3407
  dependencies = [
3375
3408
  "num-conv",
3376
3409
  "time-core",
@@ -4214,9 +4247,9 @@ dependencies = [
4214
4247
 
4215
4248
  [[package]]
4216
4249
  name = "zlib-rs"
4217
- version = "0.6.4"
4250
+ version = "0.6.5"
4218
4251
  source = "registry+https://github.com/rust-lang/crates.io-index"
4219
- checksum = "977347db8caa080403f6b6b7c1cda9479a8e869316f7e13a59b19076a40f94e3"
4252
+ checksum = "5431d5661c32445236631278f27946e444ddafe4684cac70b185272d4f9c52d5"
4220
4253
 
4221
4254
  [[package]]
4222
4255
  name = "zmij"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "spikard-rb"
3
- version = "0.16.0-rc.4"
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-rc.4", features = ["di"] }
29
- spikard-core = { version = "0.16.0-rc.4" }
30
- spikard-graphql = { version = "0.16.0-rc.4" }
31
- spikard-http = { version = "0.16.0-rc.4" }
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"] }
@@ -1,5 +1,5 @@
1
1
  // This file is auto-generated by alef. DO NOT EDIT.
2
- // alef:hash:f080b02c2594d6e75c8d11e59bd6850cf348664e69ec56eb58939e731568749e
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
- Self {
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
- Self {
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 {
@@ -3848,15 +3816,6 @@ unsafe impl IntoValueFromNative for SecuritySchemeInfo {}
3848
3816
  unsafe impl TryConvertOwned for SecuritySchemeInfo {}
3849
3817
  impl SecuritySchemeInfo {}
3850
3818
 
3851
- impl SecuritySchemeInfo {
3852
- pub fn _factory_http(scheme: String, bearer_format: Option<String>) -> Self {
3853
- Self::Http { scheme, bearer_format }
3854
- }
3855
- pub fn _factory_api_key(location: String, name: String) -> Self {
3856
- Self::ApiKey { location, name }
3857
- }
3858
- }
3859
-
3860
3819
  #[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
3861
3820
  pub enum SnapshotError {
3862
3821
  InvalidHeader { _0: String },
@@ -4089,6 +4048,26 @@ impl From<spikard::FullSchemaConfig> for FullSchemaConfig {
4089
4048
  }
4090
4049
  }
4091
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
+
4092
4071
  #[allow(clippy::redundant_closure, clippy::useless_conversion)]
4093
4072
  impl From<BackgroundTaskConfig> for spikard::BackgroundTaskConfig {
4094
4073
  fn from(val: BackgroundTaskConfig) -> Self {
@@ -4529,26 +4508,6 @@ impl From<spikard_core::ProblemDetails> for ProblemDetails {
4529
4508
  }
4530
4509
  }
4531
4510
 
4532
- #[allow(clippy::redundant_closure, clippy::useless_conversion)]
4533
- impl From<AsyncApiConfig> for spikard_http::AsyncApiConfig {
4534
- fn from(val: AsyncApiConfig) -> Self {
4535
- Self {
4536
- enabled: val.enabled,
4537
- spec: val.spec.as_ref().and_then(|s| serde_json::from_str(s).ok()),
4538
- }
4539
- }
4540
- }
4541
-
4542
- #[allow(clippy::redundant_closure, clippy::useless_conversion)]
4543
- impl From<spikard_http::AsyncApiConfig> for AsyncApiConfig {
4544
- fn from(val: spikard_http::AsyncApiConfig) -> Self {
4545
- Self {
4546
- enabled: val.enabled,
4547
- spec: val.spec.as_ref().map(ToString::to_string),
4548
- }
4549
- }
4550
- }
4551
-
4552
4511
  #[allow(clippy::redundant_closure, clippy::useless_conversion)]
4553
4512
  impl From<spikard_http::ParsedChannel> for ParsedChannel {
4554
4513
  fn from(val: spikard_http::ParsedChannel) -> Self {
@@ -4984,6 +4943,14 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
4984
4943
 
4985
4944
  class.define_method("depth_limit", method!(FullSchemaConfig::depth_limit, 0))?;
4986
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
+
4987
4954
  let class = module.define_class("BackgroundTaskConfig", ruby.class_object())?;
4988
4955
 
4989
4956
  class.define_singleton_method("new", function!(BackgroundTaskConfig::new, -1))?;
@@ -5281,14 +5248,6 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
5281
5248
 
5282
5249
  class.define_method("to_json_pretty", method!(ProblemDetails::to_json_pretty, 0))?;
5283
5250
 
5284
- let class = module.define_class("AsyncApiConfig", ruby.class_object())?;
5285
-
5286
- class.define_singleton_method("new", function!(AsyncApiConfig::new, -1))?;
5287
-
5288
- class.define_method("enabled", method!(AsyncApiConfig::enabled, 0))?;
5289
-
5290
- class.define_method("spec", method!(AsyncApiConfig::spec, 0))?;
5291
-
5292
5251
  let class = module.define_class("ParsedChannel", ruby.class_object())?;
5293
5252
 
5294
5253
  class.define_singleton_method("new", function!(ParsedChannel::new, -1))?;
@@ -5440,12 +5399,6 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
5440
5399
  method!(TestClient::graphql_subscription_async, 3),
5441
5400
  )?;
5442
5401
 
5443
- let class = module.define_class("SecuritySchemeInfo", ruby.class_object())?;
5444
-
5445
- class.define_singleton_method("http", function!(SecuritySchemeInfo::_factory_http, 2))?;
5446
-
5447
- class.define_singleton_method("api_key", function!(SecuritySchemeInfo::_factory_api_key, 2))?;
5448
-
5449
5402
  let class = module.define_class("WebSocketMessage", ruby.class_object())?;
5450
5403
 
5451
5404
  class.define_singleton_method("close", function!(WebSocketMessage::_factory_close, 2))?;
@@ -1,5 +1,5 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:f080b02c2594d6e75c8d11e59bd6850cf348664e69ec56eb58939e731568749e
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
@@ -8,13 +8,11 @@ module Spikard
8
8
  # Create a new application with the default server configuration.
9
9
  @registrations = []
10
10
  end
11
-
12
11
  def config(config)
13
12
  # Set the server configuration.
14
13
  @config = config
15
14
  self
16
15
  end
17
-
18
16
  def route(builder, &block)
19
17
  # Register a route using the provided builder and handler function.
20
18
  #
@@ -24,67 +22,56 @@ module Spikard
24
22
  @registrations.push(["route", [builder], block])
25
23
  self
26
24
  end
27
-
28
25
  def register_route(builder, handler)
29
26
  # Register a route callback directly without block syntax.
30
27
  @registrations.push(["route", [builder], handler])
31
28
  self
32
29
  end
33
-
34
30
  def get(path: String, &block)
35
31
  # Register a GET route at the given path.
36
32
  @registrations.push(["get", [spikard::Method::Get, path], block])
37
33
  self
38
34
  end
39
-
40
35
  def post(path: String, &block)
41
36
  # Register a POST route at the given path.
42
37
  @registrations.push(["post", [spikard::Method::Post, path], block])
43
38
  self
44
39
  end
45
-
46
40
  def put(path: String, &block)
47
41
  # Register a PUT route at the given path.
48
42
  @registrations.push(["put", [spikard::Method::Put, path], block])
49
43
  self
50
44
  end
51
-
52
45
  def patch(path: String, &block)
53
46
  # Register a PATCH route at the given path.
54
47
  @registrations.push(["patch", [spikard::Method::Patch, path], block])
55
48
  self
56
49
  end
57
-
58
50
  def delete(path: String, &block)
59
51
  # Register a DELETE route at the given path.
60
52
  @registrations.push(["delete", [spikard::Method::Delete, path], block])
61
53
  self
62
54
  end
63
-
64
55
  def head(path: String, &block)
65
56
  # Register a HEAD route at the given path.
66
57
  @registrations.push(["head", [spikard::Method::Head, path], block])
67
58
  self
68
59
  end
69
-
70
60
  def options(path: String, &block)
71
61
  # Register an OPTIONS route at the given path.
72
62
  @registrations.push(["options", [spikard::Method::Options, path], block])
73
63
  self
74
64
  end
75
-
76
65
  def connect(path: String, &block)
77
66
  # Register a CONNECT route at the given path.
78
67
  @registrations.push(["connect", [spikard::Method::Connect, path], block])
79
68
  self
80
69
  end
81
-
82
70
  def trace(path: String, &block)
83
71
  # Register a TRACE route at the given path.
84
72
  @registrations.push(["trace", [spikard::Method::Trace, path], block])
85
73
  self
86
74
  end
87
-
88
75
  def run
89
76
  # Run the HTTP server using the configured routes.
90
77
  #
@@ -93,7 +80,6 @@ module Spikard
93
80
  # Returns an error if server construction or execution fails.
94
81
  Spikard.app_run(@registrations)
95
82
  end
96
-
97
83
  def into_router
98
84
  # Build the underlying Axum router.
99
85
  #
@@ -1,10 +1,10 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:f080b02c2594d6e75c8d11e59bd6850cf348664e69ec56eb58939e731568749e
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.pre.rc.4"
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:f080b02c2594d6e75c8d11e59bd6850cf348664e69ec56eb58939e731568749e
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:f080b02c2594d6e75c8d11e59bd6850cf348664e69ec56eb58939e731568749e
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spikard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0.pre.rc.4
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Na'aman Hirschfeld <nhirschfeld@gmail.com>