spikard 0.15.5 → 0.15.6.pre.rc.2

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: 4433d10a69dd7a8bb2463159f40039e5ab6507f4433158ad79853d7b248f444e
4
- data.tar.gz: fd75eb997c7dbaab41f50039e05e3d36f2c9bfa6e173cb84195a6ff2b8898a3d
3
+ metadata.gz: 9a11f79c7103a6e8185785d51d2ea74fc15f0eabfe4fb32fd982a21a0ca0280d
4
+ data.tar.gz: 0eeb47f1819dd17c5172e3a93ccc083ca699c6220722a8b26a9bf5ff2e191d7c
5
5
  SHA512:
6
- metadata.gz: 531e8bd9d854a1dd142253fdaae3f3697437a7b53214721a0fd03f52bd084327c44ee980d64023946124afb3a45863cb0da31fdec8eb8ae89a74b3d8d1df01b6
7
- data.tar.gz: 128c01767018adce42db0c77227bd6684577c076f9a486d38839ec70ddbdce90ad057aa8a867be601f96082310304e1e1751753a85bdd4e83d93cea6f79749b1
6
+ metadata.gz: f3d8dcadcd8e6edc5f164467066b17659a77fc3b87092eebbbe59c7eac4642364211f098be06e1c4f19a5ec63f571a4a6d9d8594992d43a51728d034518b034e
7
+ data.tar.gz: bebad0873d19fc114e82bc6d15cdb9c62c30b070e4746ba2a7ad98c65f142bfb140af44302068d290028af8d7d2d73b3839bc0cd23a23222a1336404674f98a9
data/Steepfile CHANGED
@@ -1,6 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  target :lib do
4
- signature 'sig'
5
- check 'lib'
4
+ signature "sig"
5
+ check "lib"
6
+ # The generated `lib/spikard/native.rb` carries inline Sorbet
7
+ # `sig { ... }` blocks on tagged-enum variant Data classes. Sorbet's runtime
8
+ # provides those via `extend T::Sig`, but Steep does not understand the
9
+ # extension (it relies on RBS, not Sorbet sigs) and reports
10
+ # `Type `self` does not have method `sig`` on every block. RBS coverage
11
+ # for the same surface lives in `sig/types.rbs`, so we steer Steep to the
12
+ # RBS file by ignoring the .rb.
13
+ ignore "lib/spikard/native.rb"
6
14
  end
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'mkmf'
4
- require 'rb_sys/mkmf'
3
+ require "mkmf"
4
+ require "rb_sys/mkmf"
5
5
 
6
- default_profile = ENV.fetch('CARGO_PROFILE', 'release')
6
+ default_profile = ENV.fetch("CARGO_PROFILE", "release")
7
7
 
8
- create_rust_makefile('spikard_rb') do |config|
8
+ create_rust_makefile("spikard_rb") do |config|
9
9
  config.profile = default_profile.to_sym
10
- config.ext_dir = 'native'
10
+ config.ext_dir = "native"
11
11
  end
@@ -232,9 +232,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
232
232
 
233
233
  [[package]]
234
234
  name = "autocfg"
235
- version = "1.5.0"
235
+ version = "1.5.1"
236
236
  source = "registry+https://github.com/rust-lang/crates.io-index"
237
- checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
237
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
238
238
 
239
239
  [[package]]
240
240
  name = "axum"
@@ -419,9 +419,9 @@ dependencies = [
419
419
 
420
420
  [[package]]
421
421
  name = "bumpalo"
422
- version = "3.20.2"
422
+ version = "3.20.3"
423
423
  source = "registry+https://github.com/rust-lang/crates.io-index"
424
- checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb"
424
+ checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
425
425
 
426
426
  [[package]]
427
427
  name = "bytecount"
@@ -1708,9 +1708,9 @@ dependencies = [
1708
1708
 
1709
1709
  [[package]]
1710
1710
  name = "js-sys"
1711
- version = "0.3.98"
1711
+ version = "0.3.99"
1712
1712
  source = "registry+https://github.com/rust-lang/crates.io-index"
1713
- checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08"
1713
+ checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11"
1714
1714
  dependencies = [
1715
1715
  "cfg-if",
1716
1716
  "futures-util",
@@ -2875,9 +2875,9 @@ dependencies = [
2875
2875
 
2876
2876
  [[package]]
2877
2877
  name = "serde_json"
2878
- version = "1.0.149"
2878
+ version = "1.0.150"
2879
2879
  source = "registry+https://github.com/rust-lang/crates.io-index"
2880
- checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
2880
+ checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
2881
2881
  dependencies = [
2882
2882
  "itoa",
2883
2883
  "memchr",
@@ -3026,7 +3026,7 @@ dependencies = [
3026
3026
 
3027
3027
  [[package]]
3028
3028
  name = "spikard"
3029
- version = "0.15.5"
3029
+ version = "0.15.6-rc.2"
3030
3030
  dependencies = [
3031
3031
  "anyhow",
3032
3032
  "axum",
@@ -3044,7 +3044,7 @@ dependencies = [
3044
3044
 
3045
3045
  [[package]]
3046
3046
  name = "spikard-core"
3047
- version = "0.15.5"
3047
+ version = "0.15.6-rc.2"
3048
3048
  dependencies = [
3049
3049
  "anyhow",
3050
3050
  "base64",
@@ -3068,7 +3068,7 @@ dependencies = [
3068
3068
 
3069
3069
  [[package]]
3070
3070
  name = "spikard-graphql"
3071
- version = "0.15.5"
3071
+ version = "0.15.6-rc.2"
3072
3072
  dependencies = [
3073
3073
  "async-graphql",
3074
3074
  "axum",
@@ -3087,7 +3087,7 @@ dependencies = [
3087
3087
 
3088
3088
  [[package]]
3089
3089
  name = "spikard-http"
3090
- version = "0.15.5"
3090
+ version = "0.15.6-rc.2"
3091
3091
  dependencies = [
3092
3092
  "ahash",
3093
3093
  "anyhow",
@@ -3138,7 +3138,7 @@ dependencies = [
3138
3138
 
3139
3139
  [[package]]
3140
3140
  name = "spikard-rb"
3141
- version = "0.15.5"
3141
+ version = "0.15.6-rc.2"
3142
3142
  dependencies = [
3143
3143
  "magnus",
3144
3144
  "serde",
@@ -3907,9 +3907,9 @@ dependencies = [
3907
3907
 
3908
3908
  [[package]]
3909
3909
  name = "wasm-bindgen"
3910
- version = "0.2.121"
3910
+ version = "0.2.122"
3911
3911
  source = "registry+https://github.com/rust-lang/crates.io-index"
3912
- checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790"
3912
+ checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409"
3913
3913
  dependencies = [
3914
3914
  "cfg-if",
3915
3915
  "once_cell",
@@ -3920,9 +3920,9 @@ dependencies = [
3920
3920
 
3921
3921
  [[package]]
3922
3922
  name = "wasm-bindgen-macro"
3923
- version = "0.2.121"
3923
+ version = "0.2.122"
3924
3924
  source = "registry+https://github.com/rust-lang/crates.io-index"
3925
- checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578"
3925
+ checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6"
3926
3926
  dependencies = [
3927
3927
  "quote",
3928
3928
  "wasm-bindgen-macro-support",
@@ -3930,9 +3930,9 @@ dependencies = [
3930
3930
 
3931
3931
  [[package]]
3932
3932
  name = "wasm-bindgen-macro-support"
3933
- version = "0.2.121"
3933
+ version = "0.2.122"
3934
3934
  source = "registry+https://github.com/rust-lang/crates.io-index"
3935
- checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2"
3935
+ checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e"
3936
3936
  dependencies = [
3937
3937
  "bumpalo",
3938
3938
  "proc-macro2",
@@ -3943,9 +3943,9 @@ dependencies = [
3943
3943
 
3944
3944
  [[package]]
3945
3945
  name = "wasm-bindgen-shared"
3946
- version = "0.2.121"
3946
+ version = "0.2.122"
3947
3947
  source = "registry+https://github.com/rust-lang/crates.io-index"
3948
- checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441"
3948
+ checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437"
3949
3949
  dependencies = [
3950
3950
  "unicode-ident",
3951
3951
  ]
@@ -3986,9 +3986,9 @@ dependencies = [
3986
3986
 
3987
3987
  [[package]]
3988
3988
  name = "web-sys"
3989
- version = "0.3.98"
3989
+ version = "0.3.99"
3990
3990
  source = "registry+https://github.com/rust-lang/crates.io-index"
3991
- checksum = "4b572dff8bcf38bad0fa19729c89bb5748b2b9b1d8be70cf90df697e3a8f32aa"
3991
+ checksum = "6d621441cfc37b84979402712047321980c178f299193a3589d05b99e8763436"
3992
3992
  dependencies = [
3993
3993
  "js-sys",
3994
3994
  "wasm-bindgen",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "spikard-rb"
3
- version = "0.15.5"
3
+ version = "0.15.6-rc.2"
4
4
  edition = "2024"
5
5
  license = "MIT"
6
6
  description = "Rust-centric multi-language HTTP framework with polyglot bindings"
@@ -17,8 +17,8 @@ crate-type = ["cdylib"]
17
17
  magnus = "0.8"
18
18
  serde = { version = "1", features = ["derive"] }
19
19
  serde_json = "1"
20
- spikard = { path = "../../../../../crates/spikard", features = ["di"] }
21
- spikard-core = { path = "../../../../../crates/spikard-core" }
22
- spikard-graphql = { path = "../../../../../crates/spikard-graphql" }
23
- spikard-http = { path = "../../../../../crates/spikard-http" }
20
+ spikard = { version = "0.15.6-rc.2", path = "../../../../../crates/spikard", features = ["di"] }
21
+ spikard-core = { path = "../../../../../crates/spikard-core", version = "0.15.6-rc.2" }
22
+ spikard-graphql = { path = "../../../../../crates/spikard-graphql", version = "0.15.6-rc.2" }
23
+ spikard-http = { path = "../../../../../crates/spikard-http", version = "0.15.6-rc.2" }
24
24
  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:a0a2955098d9861289e6b431dcbcb6880e9b417f480d55540a7012dd826b9b5c
2
+ // alef:hash:b711472a972f8415b4fb7b6ad10178139c7794b5a2b1becb707ac3bf18a13de8
3
3
  // Re-generate with: alef generate
4
4
  #![allow(dead_code, unused_imports, unused_variables)]
5
5
  #![allow(
@@ -694,6 +694,19 @@ impl magnus::TryConvert for JsonRpcMethodInfo {
694
694
 
695
695
  unsafe impl TryConvertOwned for JsonRpcMethodInfo {}
696
696
 
697
+ impl Default for JsonRpcMethodInfo {
698
+ fn default() -> Self {
699
+ Self {
700
+ method_name: String::new(),
701
+ description: None,
702
+ params_schema: None,
703
+ result_schema: None,
704
+ deprecated: false,
705
+ tags: vec![],
706
+ }
707
+ }
708
+ }
709
+
697
710
  impl JsonRpcMethodInfo {
698
711
  fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
699
712
  let ruby = unsafe { magnus::Ruby::get_unchecked() };
@@ -717,11 +730,11 @@ impl JsonRpcMethodInfo {
717
730
  deprecated: kwargs
718
731
  .get(ruby.to_symbol("deprecated"))
719
732
  .and_then(|v| bool::try_convert(v).ok())
720
- .unwrap_or_default(),
733
+ .unwrap_or(false),
721
734
  tags: kwargs
722
735
  .get(ruby.to_symbol("tags"))
723
736
  .and_then(|v| <Vec<String>>::try_convert(v).ok())
724
- .unwrap_or_default(),
737
+ .unwrap_or(vec![]),
725
738
  })
726
739
  }
727
740
 
@@ -2916,6 +2929,18 @@ impl magnus::TryConvert for JwtConfig {
2916
2929
 
2917
2930
  unsafe impl TryConvertOwned for JwtConfig {}
2918
2931
 
2932
+ impl Default for JwtConfig {
2933
+ fn default() -> Self {
2934
+ Self {
2935
+ secret: String::new(),
2936
+ algorithm: String::new(),
2937
+ audience: None,
2938
+ issuer: None,
2939
+ leeway: 0,
2940
+ }
2941
+ }
2942
+ }
2943
+
2919
2944
  impl JwtConfig {
2920
2945
  fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
2921
2946
  let ruby = unsafe { magnus::Ruby::get_unchecked() };
@@ -2930,7 +2955,7 @@ impl JwtConfig {
2930
2955
  algorithm: kwargs
2931
2956
  .get(ruby.to_symbol("algorithm"))
2932
2957
  .and_then(|v| String::try_convert(v).ok())
2933
- .unwrap_or_default(),
2958
+ .unwrap_or(String::new()),
2934
2959
  audience: kwargs
2935
2960
  .get(ruby.to_symbol("audience"))
2936
2961
  .and_then(|v| <Vec<String>>::try_convert(v).ok()),
@@ -2940,7 +2965,7 @@ impl JwtConfig {
2940
2965
  leeway: kwargs
2941
2966
  .get(ruby.to_symbol("leeway"))
2942
2967
  .and_then(|v| u64::try_convert(v).ok())
2943
- .unwrap_or_default(),
2968
+ .unwrap_or(0),
2944
2969
  })
2945
2970
  }
2946
2971
 
@@ -3000,6 +3025,15 @@ impl magnus::TryConvert for ApiKeyConfig {
3000
3025
 
3001
3026
  unsafe impl TryConvertOwned for ApiKeyConfig {}
3002
3027
 
3028
+ impl Default for ApiKeyConfig {
3029
+ fn default() -> Self {
3030
+ Self {
3031
+ keys: vec![],
3032
+ header_name: String::new(),
3033
+ }
3034
+ }
3035
+ }
3036
+
3003
3037
  impl ApiKeyConfig {
3004
3038
  fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
3005
3039
  let ruby = unsafe { magnus::Ruby::get_unchecked() };
@@ -3014,7 +3048,7 @@ impl ApiKeyConfig {
3014
3048
  header_name: kwargs
3015
3049
  .get(ruby.to_symbol("header_name"))
3016
3050
  .and_then(|v| String::try_convert(v).ok())
3017
- .unwrap_or_default(),
3051
+ .unwrap_or(String::new()),
3018
3052
  })
3019
3053
  }
3020
3054
 
@@ -3064,6 +3098,17 @@ impl magnus::TryConvert for StaticFilesConfig {
3064
3098
 
3065
3099
  unsafe impl TryConvertOwned for StaticFilesConfig {}
3066
3100
 
3101
+ impl Default for StaticFilesConfig {
3102
+ fn default() -> Self {
3103
+ Self {
3104
+ directory: String::new(),
3105
+ route_prefix: String::new(),
3106
+ index_file: false,
3107
+ cache_control: None,
3108
+ }
3109
+ }
3110
+ }
3111
+
3067
3112
  impl StaticFilesConfig {
3068
3113
  fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
3069
3114
  let ruby = unsafe { magnus::Ruby::get_unchecked() };
@@ -3082,7 +3127,7 @@ impl StaticFilesConfig {
3082
3127
  index_file: kwargs
3083
3128
  .get(ruby.to_symbol("index_file"))
3084
3129
  .and_then(|v| bool::try_convert(v).ok())
3085
- .unwrap_or_default(),
3130
+ .unwrap_or(false),
3086
3131
  cache_control: kwargs
3087
3132
  .get(ruby.to_symbol("cache_control"))
3088
3133
  .and_then(|v| String::try_convert(v).ok()),
@@ -3447,8 +3492,8 @@ impl TestClient {
3447
3492
  fn get_async(
3448
3493
  &self,
3449
3494
  path: String,
3450
- query_params: Option<Vec<String>>,
3451
- headers: Option<Vec<String>>,
3495
+ query_params: Option<Vec<Vec<String>>>,
3496
+ headers: Option<Vec<Vec<String>>>,
3452
3497
  ) -> Result<ResponseSnapshot, Error> {
3453
3498
  Err(magnus::Error::new(
3454
3499
  unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
@@ -3460,10 +3505,10 @@ impl TestClient {
3460
3505
  &self,
3461
3506
  path: String,
3462
3507
  json: Option<String>,
3463
- form_data: Option<Vec<String>>,
3508
+ form_data: Option<Vec<Vec<String>>>,
3464
3509
  multipart: Option<String>,
3465
- query_params: Option<Vec<String>>,
3466
- headers: Option<Vec<String>>,
3510
+ query_params: Option<Vec<Vec<String>>>,
3511
+ headers: Option<Vec<Vec<String>>>,
3467
3512
  ) -> Result<ResponseSnapshot, Error> {
3468
3513
  Err(magnus::Error::new(
3469
3514
  unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
@@ -3476,8 +3521,8 @@ impl TestClient {
3476
3521
  method: Method,
3477
3522
  path: String,
3478
3523
  body: Vec<u8>,
3479
- query_params: Option<Vec<String>>,
3480
- headers: Option<Vec<String>>,
3524
+ query_params: Option<Vec<Vec<String>>>,
3525
+ headers: Option<Vec<Vec<String>>>,
3481
3526
  ) -> Result<ResponseSnapshot, Error> {
3482
3527
  Err(magnus::Error::new(
3483
3528
  unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
@@ -3489,8 +3534,8 @@ impl TestClient {
3489
3534
  &self,
3490
3535
  path: String,
3491
3536
  json: Option<String>,
3492
- query_params: Option<Vec<String>>,
3493
- headers: Option<Vec<String>>,
3537
+ query_params: Option<Vec<Vec<String>>>,
3538
+ headers: Option<Vec<Vec<String>>>,
3494
3539
  ) -> Result<ResponseSnapshot, Error> {
3495
3540
  Err(magnus::Error::new(
3496
3541
  unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
@@ -3502,8 +3547,8 @@ impl TestClient {
3502
3547
  &self,
3503
3548
  path: String,
3504
3549
  json: Option<String>,
3505
- query_params: Option<Vec<String>>,
3506
- headers: Option<Vec<String>>,
3550
+ query_params: Option<Vec<Vec<String>>>,
3551
+ headers: Option<Vec<Vec<String>>>,
3507
3552
  ) -> Result<ResponseSnapshot, Error> {
3508
3553
  Err(magnus::Error::new(
3509
3554
  unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
@@ -3514,8 +3559,8 @@ impl TestClient {
3514
3559
  fn delete_async(
3515
3560
  &self,
3516
3561
  path: String,
3517
- query_params: Option<Vec<String>>,
3518
- headers: Option<Vec<String>>,
3562
+ query_params: Option<Vec<Vec<String>>>,
3563
+ headers: Option<Vec<Vec<String>>>,
3519
3564
  ) -> Result<ResponseSnapshot, Error> {
3520
3565
  Err(magnus::Error::new(
3521
3566
  unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
@@ -3526,8 +3571,8 @@ impl TestClient {
3526
3571
  fn options_async(
3527
3572
  &self,
3528
3573
  path: String,
3529
- query_params: Option<Vec<String>>,
3530
- headers: Option<Vec<String>>,
3574
+ query_params: Option<Vec<Vec<String>>>,
3575
+ headers: Option<Vec<Vec<String>>>,
3531
3576
  ) -> Result<ResponseSnapshot, Error> {
3532
3577
  Err(magnus::Error::new(
3533
3578
  unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
@@ -3538,8 +3583,8 @@ impl TestClient {
3538
3583
  fn head_async(
3539
3584
  &self,
3540
3585
  path: String,
3541
- query_params: Option<Vec<String>>,
3542
- headers: Option<Vec<String>>,
3586
+ query_params: Option<Vec<Vec<String>>>,
3587
+ headers: Option<Vec<Vec<String>>>,
3543
3588
  ) -> Result<ResponseSnapshot, Error> {
3544
3589
  Err(magnus::Error::new(
3545
3590
  unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
@@ -3550,8 +3595,8 @@ impl TestClient {
3550
3595
  fn trace_async(
3551
3596
  &self,
3552
3597
  path: String,
3553
- query_params: Option<Vec<String>>,
3554
- headers: Option<Vec<String>>,
3598
+ query_params: Option<Vec<Vec<String>>>,
3599
+ headers: Option<Vec<Vec<String>>>,
3555
3600
  ) -> Result<ResponseSnapshot, Error> {
3556
3601
  Err(magnus::Error::new(
3557
3602
  unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
@@ -3727,15 +3772,26 @@ impl magnus::IntoValue for SnapshotError {
3727
3772
 
3728
3773
  impl magnus::TryConvert for SnapshotError {
3729
3774
  fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
3730
- let s: String = magnus::TryConvert::try_convert(val)?;
3731
- // Try deserializing as JSON first (handles JSON strings like "\"markdown\"")
3775
+ // For data enums with fields (e.g., PageAction), try to deserialize from JSON first.
3776
+ // For unit enums or when passed as a string, fall back to string-based conversion.
3777
+ let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
3778
+ s
3779
+ } else {
3780
+ val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
3781
+ magnus::Error::new(
3782
+ unsafe { Ruby::get_unchecked() }.exception_type_error(),
3783
+ format!("no implicit conversion into SnapshotError: {}", e),
3784
+ )
3785
+ })?
3786
+ };
3787
+ // Try deserializing as JSON first (handles JSON strings like "\"markdown\"" or "{\"click\":{\"selector\":\"...\"}}\"")
3732
3788
  // If that fails, try treating it as a plain string value and wrap in quotes
3733
3789
  // If both fail, try as Custom variant (for untagged enum support)
3734
- serde_json::from_str(&s)
3735
- .or_else(|_| serde_json::from_str(&format!("\"{s}\"")))
3790
+ serde_json::from_str(&json_str)
3791
+ .or_else(|_| serde_json::from_str(&format!("\"{json_str}\"")))
3736
3792
  .or_else(|_| {
3737
3793
  // Try as a JSON string for Custom variant (untagged enums accept any remaining value)
3738
- match serde_json::to_value(&s) {
3794
+ match serde_json::to_value(&json_str) {
3739
3795
  Ok(val) => serde_json::from_value(val),
3740
3796
  Err(e) => Err(e),
3741
3797
  }
@@ -3773,15 +3829,26 @@ impl magnus::IntoValue for WebSocketMessage {
3773
3829
 
3774
3830
  impl magnus::TryConvert for WebSocketMessage {
3775
3831
  fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
3776
- let s: String = magnus::TryConvert::try_convert(val)?;
3777
- // Try deserializing as JSON first (handles JSON strings like "\"markdown\"")
3832
+ // For data enums with fields (e.g., PageAction), try to deserialize from JSON first.
3833
+ // For unit enums or when passed as a string, fall back to string-based conversion.
3834
+ let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
3835
+ s
3836
+ } else {
3837
+ val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
3838
+ magnus::Error::new(
3839
+ unsafe { Ruby::get_unchecked() }.exception_type_error(),
3840
+ format!("no implicit conversion into WebSocketMessage: {}", e),
3841
+ )
3842
+ })?
3843
+ };
3844
+ // Try deserializing as JSON first (handles JSON strings like "\"markdown\"" or "{\"click\":{\"selector\":\"...\"}}\"")
3778
3845
  // If that fails, try treating it as a plain string value and wrap in quotes
3779
3846
  // If both fail, try as Custom variant (for untagged enum support)
3780
- serde_json::from_str(&s)
3781
- .or_else(|_| serde_json::from_str(&format!("\"{s}\"")))
3847
+ serde_json::from_str(&json_str)
3848
+ .or_else(|_| serde_json::from_str(&format!("\"{json_str}\"")))
3782
3849
  .or_else(|_| {
3783
3850
  // Try as a JSON string for Custom variant (untagged enums accept any remaining value)
3784
- match serde_json::to_value(&s) {
3851
+ match serde_json::to_value(&json_str) {
3785
3852
  Ok(val) => serde_json::from_value(val),
3786
3853
  Err(e) => Err(e),
3787
3854
  }
@@ -3885,15 +3952,26 @@ impl magnus::IntoValue for SecuritySchemeInfo {
3885
3952
 
3886
3953
  impl magnus::TryConvert for SecuritySchemeInfo {
3887
3954
  fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
3888
- let s: String = magnus::TryConvert::try_convert(val)?;
3889
- // Try deserializing as JSON first (handles JSON strings like "\"markdown\"")
3955
+ // For data enums with fields (e.g., PageAction), try to deserialize from JSON first.
3956
+ // For unit enums or when passed as a string, fall back to string-based conversion.
3957
+ let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
3958
+ s
3959
+ } else {
3960
+ val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
3961
+ magnus::Error::new(
3962
+ unsafe { Ruby::get_unchecked() }.exception_type_error(),
3963
+ format!("no implicit conversion into SecuritySchemeInfo: {}", e),
3964
+ )
3965
+ })?
3966
+ };
3967
+ // Try deserializing as JSON first (handles JSON strings like "\"markdown\"" or "{\"click\":{\"selector\":\"...\"}}\"")
3890
3968
  // If that fails, try treating it as a plain string value and wrap in quotes
3891
3969
  // If both fail, try as Custom variant (for untagged enum support)
3892
- serde_json::from_str(&s)
3893
- .or_else(|_| serde_json::from_str(&format!("\"{s}\"")))
3970
+ serde_json::from_str(&json_str)
3971
+ .or_else(|_| serde_json::from_str(&format!("\"{json_str}\"")))
3894
3972
  .or_else(|_| {
3895
3973
  // Try as a JSON string for Custom variant (untagged enums accept any remaining value)
3896
- match serde_json::to_value(&s) {
3974
+ match serde_json::to_value(&json_str) {
3897
3975
  Ok(val) => serde_json::from_value(val),
3898
3976
  Err(e) => Err(e),
3899
3977
  }
@@ -1,13 +1,13 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:5edec17b527ff92ce6cce13114f42972a434edf40e174a174cbb292c5f29567f
2
+ # alef:hash:aeeac38f0a23bcb68372578727b8552d8b76bdcd9e2255499c4677dd1775530f
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify --exit-code
5
5
  # Issues & docs: https://github.com/kreuzberg-dev/alef
6
6
  # frozen_string_literal: true
7
7
 
8
- require 'json'
9
- require 'sorbet-runtime'
10
- require 'spikard_rb'
8
+ require "json"
9
+ require "sorbet-runtime"
10
+ require "spikard_rb"
11
11
  module Spikard
12
12
  # Security scheme types
13
13
  module SecuritySchemeInfo
@@ -21,10 +21,10 @@ module Spikard
21
21
  # @return [variant_class] an instance of the appropriate variant
22
22
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.untyped) }
23
23
  def self.from_hash(hash)
24
- discriminator = hash[:type] || hash['type']
24
+ discriminator = hash[:type] || hash["type"]
25
25
  case discriminator
26
- when 'http' then SecuritySchemeInfoHttp.from_hash(hash)
27
- when 'apiKey' then SecuritySchemeInfoApiKey.from_hash(hash)
26
+ when "http" then SecuritySchemeInfoHttp.from_hash(hash)
27
+ when "apiKey" then SecuritySchemeInfoApiKey.from_hash(hash)
28
28
  else raise "Unknown discriminator: #{discriminator}"
29
29
  end
30
30
  end
@@ -53,7 +53,7 @@ module Spikard
53
53
  # @return [self]
54
54
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
55
55
  def self.from_hash(hash)
56
- new(scheme: hash[:scheme] || hash['scheme'], bearer_format: hash[:bearer_format] || hash['bearer_format'])
56
+ new(scheme: hash[:scheme] || hash["scheme"], bearer_format: hash[:bearer_format] || hash["bearer_format"])
57
57
  end
58
58
  end
59
59
 
@@ -80,7 +80,7 @@ module Spikard
80
80
  # @return [self]
81
81
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
82
82
  def self.from_hash(hash)
83
- new(location: hash[:location] || hash['location'], name: hash[:name] || hash['name'])
83
+ new(location: hash[:location] || hash["location"], name: hash[:name] || hash["name"])
84
84
  end
85
85
  end
86
86
  end
@@ -1,10 +1,10 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:4dfd960c94429eb62375af9c45977ae1e80030d027fce375ab2de451f4300436
2
+ # alef:hash:5b67d96a36bd0c8c091d6ad84b1e3397857b49fc9415f7ebe26097c2f7838be6
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify --exit-code
5
5
  # Issues & docs: https://github.com/kreuzberg-dev/alef
6
6
  # frozen_string_literal: true
7
7
 
8
8
  module Spikard
9
- VERSION = '0.15.5'
9
+ VERSION = "0.15.6.pre.rc.2"
10
10
  end
data/lib/spikard.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:5c62d312ae2c1f0cd7d066ce8b2986e3e074ad0372813b665ae9cd9525b62162
2
+ # alef:hash:b6c9bf252429eefefce208d5ef9f9c73e62607dfe4b285caaa6a1c664e525653
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify --exit-code
5
5
  # Issues & docs: https://github.com/kreuzberg-dev/alef
6
6
  # frozen_string_literal: true
7
7
 
8
- require_relative 'spikard/version'
9
- require_relative 'spikard/native'
8
+ require_relative "spikard/version"
9
+ require_relative "spikard/native"
10
10
 
11
11
  module Spikard
12
12
  # Re-export all types and functions from native extension
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:dbf8bf90f99d68da22b871df1d242fee8be43b6b6779f41c132936c3df22a1fd
2
+ # alef:hash:0f05d1e76815d7ed69abd826b2647829d5fe7ad70db79cc7d732a21d4a70d48e
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify --exit-code
5
5
  # Issues & docs: https://github.com/kreuzberg-dev/alef
@@ -9,7 +9,6 @@ module Spikard
9
9
  VERSION: String
10
10
 
11
11
  type json_value = Hash[String, untyped] | Array[untyped] | String | Integer | Float | bool | nil
12
- type JsonValue = json_value
13
12
 
14
13
  class UploadFile
15
14
  attr_reader filename: String
@@ -73,12 +72,12 @@ module Spikard
73
72
  class JsonRpcMethodInfo
74
73
  attr_reader method_name: String
75
74
  attr_reader description: String
76
- attr_reader params_schema: JsonValue
77
- attr_reader result_schema: JsonValue
75
+ attr_reader params_schema: json_value
76
+ attr_reader result_schema: json_value
78
77
  attr_reader deprecated: bool
79
78
  attr_reader tags: Array[String]
80
79
 
81
- def initialize: (method_name: String, ?description: String, ?params_schema: JsonValue, ?result_schema: JsonValue, deprecated: bool, tags: Array[String]) -> void
80
+ def initialize: (method_name: String, ?description: String, ?params_schema: json_value, ?result_schema: json_value, deprecated: bool, tags: Array[String]) -> void
82
81
  end
83
82
 
84
83
  class ProblemDetails
@@ -87,9 +86,9 @@ module Spikard
87
86
  attr_reader status: Integer
88
87
  attr_reader detail: String
89
88
  attr_reader instance: String
90
- attr_reader extensions: Hash[String, JsonValue]
89
+ attr_reader extensions: Hash[String, json_value]
91
90
 
92
- def initialize: (type_uri: String, title: String, status: Integer, ?detail: String, ?instance: String, extensions: Hash[String, JsonValue]) -> void
91
+ def initialize: (type_uri: String, title: String, status: Integer, ?detail: String, ?instance: String, extensions: Hash[String, json_value]) -> void
93
92
  def with_detail: (String detail) -> ProblemDetails
94
93
  def with_instance: (String instance) -> ProblemDetails
95
94
  def to_json: () -> String
@@ -150,18 +149,18 @@ module Spikard
150
149
 
151
150
  class AsyncApiConfig
152
151
  attr_accessor enabled: bool?
153
- attr_accessor spec: JsonValue?
152
+ attr_accessor spec: json_value?
154
153
 
155
- def initialize: (?enabled: bool, ?spec: JsonValue) -> void
154
+ def initialize: (?enabled: bool, ?spec: json_value) -> void
156
155
  end
157
156
 
158
157
  class ParsedChannel
159
158
  attr_reader name: String
160
159
  attr_reader address: String
161
160
  attr_reader messages: Array[String]
162
- attr_reader bindings: JsonValue
161
+ attr_reader bindings: json_value
163
162
 
164
- def initialize: (name: String, address: String, messages: Array[String], ?bindings: JsonValue) -> void
163
+ def initialize: (name: String, address: String, messages: Array[String], ?bindings: json_value) -> void
165
164
  end
166
165
 
167
166
  class ParsedOperation
@@ -174,9 +173,9 @@ module Spikard
174
173
 
175
174
  class ParsedMessage
176
175
  attr_reader name: String
177
- attr_reader schema: JsonValue
176
+ attr_reader schema: json_value
178
177
 
179
- def initialize: (name: String, ?schema: JsonValue) -> void
178
+ def initialize: (name: String, ?schema: json_value) -> void
180
179
  end
181
180
 
182
181
  class ParseResult
@@ -191,9 +190,9 @@ module Spikard
191
190
  end
192
191
 
193
192
  class ParseRequest
194
- attr_reader spec: JsonValue
193
+ attr_reader spec: json_value
195
194
 
196
- def initialize: (spec: JsonValue) -> void
195
+ def initialize: (spec: json_value) -> void
197
196
  end
198
197
 
199
198
  class ValidationResponse
@@ -204,12 +203,12 @@ module Spikard
204
203
  end
205
204
 
206
205
  class ValidateRequest
207
- attr_reader spec: JsonValue
206
+ attr_reader spec: json_value
208
207
  attr_reader channel: String
209
208
  attr_reader message: String
210
- attr_reader payload: JsonValue
209
+ attr_reader payload: json_value
211
210
 
212
- def initialize: (spec: JsonValue, channel: String, message: String, payload: JsonValue) -> void
211
+ def initialize: (spec: json_value, channel: String, message: String, payload: json_value) -> void
213
212
  end
214
213
 
215
214
  class BackgroundTaskConfig
@@ -294,11 +293,11 @@ module Spikard
294
293
  end
295
294
 
296
295
  class Response
297
- attr_accessor content: JsonValue?
296
+ attr_accessor content: json_value?
298
297
  attr_accessor status_code: Integer?
299
298
  attr_accessor headers: Hash[String, String]?
300
299
 
301
- def initialize: (?content: JsonValue, ?status_code: Integer, ?headers: Hash[String, String]) -> void
300
+ def initialize: (?content: json_value, ?status_code: Integer, ?headers: Hash[String, String]) -> void
302
301
  def set_header: (String key, String value) -> void
303
302
  def set_cookie: (String key, String value, bool secure, bool http_only, ?Integer max_age, ?String domain, ?String path, ?String same_site) -> void
304
303
  def self.default: () -> Response
@@ -306,11 +305,11 @@ module Spikard
306
305
 
307
306
  class SseEvent
308
307
  attr_reader event_type: String
309
- attr_reader data: JsonValue
308
+ attr_reader data: json_value
310
309
  attr_reader id: String
311
310
  attr_reader retry: Integer
312
311
 
313
- def initialize: (?event_type: String, data: JsonValue, ?id: String, ?retry: Integer) -> void
312
+ def initialize: (?event_type: String, data: json_value, ?id: String, ?retry: Integer) -> void
314
313
  def with_id: (String id) -> SseEvent
315
314
  def with_retry: (Integer retry_ms) -> SseEvent
316
315
  end
@@ -375,28 +374,28 @@ module Spikard
375
374
  class GraphQLSubscriptionSnapshot
376
375
  attr_reader operation_id: String
377
376
  attr_reader acknowledged: bool
378
- attr_reader event: JsonValue
379
- attr_reader errors: Array[JsonValue]
377
+ attr_reader event: json_value
378
+ attr_reader errors: Array[json_value]
380
379
  attr_reader complete_received: bool
381
380
 
382
- def initialize: (operation_id: String, acknowledged: bool, ?event: JsonValue, errors: Array[JsonValue], complete_received: bool) -> void
381
+ def initialize: (operation_id: String, acknowledged: bool, ?event: json_value, errors: Array[json_value], complete_received: bool) -> void
383
382
  end
384
383
 
385
384
  class TestClient
386
- def get: (String path, ?Array[String] query_params, ?Array[String] headers) -> ResponseSnapshot
387
- def post: (String path, ?JsonValue json, ?Array[String] form_data, String multipart, ?Array[String] query_params, ?Array[String] headers) -> ResponseSnapshot
388
- def request_raw: (Method method, String path, String body, ?Array[String] query_params, ?Array[String] headers) -> ResponseSnapshot
389
- def put: (String path, ?JsonValue json, ?Array[String] query_params, ?Array[String] headers) -> ResponseSnapshot
390
- def patch: (String path, ?JsonValue json, ?Array[String] query_params, ?Array[String] headers) -> ResponseSnapshot
391
- def delete: (String path, ?Array[String] query_params, ?Array[String] headers) -> ResponseSnapshot
392
- def options: (String path, ?Array[String] query_params, ?Array[String] headers) -> ResponseSnapshot
393
- def head: (String path, ?Array[String] query_params, ?Array[String] headers) -> ResponseSnapshot
394
- def trace: (String path, ?Array[String] query_params, ?Array[String] headers) -> ResponseSnapshot
395
- def graphql_at: (String endpoint, String query, ?JsonValue variables, ?String operation_name) -> ResponseSnapshot
396
- def graphql: (String query, ?JsonValue variables, ?String operation_name) -> ResponseSnapshot
397
- def graphql_with_status: (String query, ?JsonValue variables, ?String operation_name) -> String
398
- def graphql_subscription_at: (String endpoint, String query, ?JsonValue variables, ?String operation_name) -> GraphQLSubscriptionSnapshot
399
- def graphql_subscription: (String query, ?JsonValue variables, ?String operation_name) -> GraphQLSubscriptionSnapshot
385
+ def get: (String path, ?Array[Array[String]] query_params, ?Array[Array[String]] headers) -> ResponseSnapshot
386
+ def post: (String path, ?json_value json, ?Array[Array[String]] form_data, String multipart, ?Array[Array[String]] query_params, ?Array[Array[String]] headers) -> ResponseSnapshot
387
+ def request_raw: (Method method, String path, String body, ?Array[Array[String]] query_params, ?Array[Array[String]] headers) -> ResponseSnapshot
388
+ def put: (String path, ?json_value json, ?Array[Array[String]] query_params, ?Array[Array[String]] headers) -> ResponseSnapshot
389
+ def patch: (String path, ?json_value json, ?Array[Array[String]] query_params, ?Array[Array[String]] headers) -> ResponseSnapshot
390
+ def delete: (String path, ?Array[Array[String]] query_params, ?Array[Array[String]] headers) -> ResponseSnapshot
391
+ def options: (String path, ?Array[Array[String]] query_params, ?Array[Array[String]] headers) -> ResponseSnapshot
392
+ def head: (String path, ?Array[Array[String]] query_params, ?Array[Array[String]] headers) -> ResponseSnapshot
393
+ def trace: (String path, ?Array[Array[String]] query_params, ?Array[Array[String]] headers) -> ResponseSnapshot
394
+ def graphql_at: (String endpoint, String query, ?json_value variables, ?String operation_name) -> ResponseSnapshot
395
+ def graphql: (String query, ?json_value variables, ?String operation_name) -> ResponseSnapshot
396
+ def graphql_with_status: (String query, ?json_value variables, ?String operation_name) -> String
397
+ def graphql_subscription_at: (String endpoint, String query, ?json_value variables, ?String operation_name) -> GraphQLSubscriptionSnapshot
398
+ def graphql_subscription: (String query, ?json_value variables, ?String operation_name) -> GraphQLSubscriptionSnapshot
400
399
  end
401
400
 
402
401
  class SnapshotError
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.15.5
4
+ version: 0.15.6.pre.rc.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Na'aman Hirschfeld <nhirschfeld@gmail.com>