whop_sdk 1.0.11 → 1.0.12

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: 8187c35fd7e2a5826257f9cfe2910e80f3a75d15ddf36ae91ba98565be9a204e
4
- data.tar.gz: 47627c9b71a00846c63a860a64a593eda46723eaacee9238b4af842dac3b48d5
3
+ metadata.gz: 6b9d224f549b7e16ee1bb5de5d10d1a50706dbd1b746be4c450feeb700a160d5
4
+ data.tar.gz: 3429efb80021dc870ba0bc4c9599c4ca97efa2e4ad9ddce312e54dc2124f340e
5
5
  SHA512:
6
- metadata.gz: 14db9c283348d1231147372234d2d8a1cf5bfe679e13cee3cd7770a122e350befd0bb2657a89f5794260e4812cae8b5904b5e7702de2c04b26c4e15b0df52492
7
- data.tar.gz: 36136fa35d4a5165336d3d185f1293d807da435f2790cbf831efe2eac2363b04fccf418224fdd5319deea2f44b74ddb93f8088dd8f66d016619cd6d463eb9d9c
6
+ metadata.gz: 687fe8d7db55950f6a70e20fcbd4778ceeb6187290c6fc37dda4611b0f367b0626ca3a4a58832a13383fceb8f42eb63b602e0f6387308d7be0f4ae3bc2a397ea
7
+ data.tar.gz: 8f378d3b28200bf60ab53e36581482a8b7f79d5eb9529c5b652a1a57213c52d33be85ec2f0dfadbdb5d93b83ba5ba8382434c364e9c94e74e4ed244163796966
data/.fernignore CHANGED
@@ -38,7 +38,25 @@
38
38
  # `require "whop_sdk"` — the gem stops loading for everyone, not just user-token callers.
39
39
  # ci.yml asserts all three every run so a regeneration that drops any of them fails there
40
40
  # instead of on a caller's machine.
41
+ #
42
+ # lib/whop_sdk/internal/iterators/cursor_page_iterator.rb is a patched copy of a generated
43
+ # file. The generated clients all pass cursor_field: :end_cursor, but the response models
44
+ # declare end_cursor on page_info rather than at the root and Internal::Types::Model has no
45
+ # method_missing — so the root lookup raised NoMethodError on the first page of every list
46
+ # in 1.0.11. The patch tries the root first and falls back to page_info, so it stays correct
47
+ # if the generator is fixed. Delete this entry and the file once fern-ruby-sdk emits the
48
+ # nested lookup itself.
49
+ #
50
+ # lib/whop_sdk/internal/types/utils.rb is a patched copy of a generated file. The Ruby
51
+ # generator maps every OpenAPI `number` to Integer — there is not one Float declaration in
52
+ # the gem, and `format: float` in the spec does not change it — so Utils.coerce's `value.to_i`
53
+ # silently truncated every decimal: initial_price 10.43 became 10, in both directions. The
54
+ # patch returns a Float unchanged when it has a fractional part, and still normalises whole
55
+ # floats to Integer so genuinely integral fields are unaffected. Delete this entry and the
56
+ # file once fern-ruby-sdk maps `number` to Float.
41
57
  .github/workflows/ci.yml
42
58
  .github/workflows/publish-main.yml
43
59
  CHANGELOG.md
44
60
  lib/whop_sdk/helpers
61
+ lib/whop_sdk/internal/iterators/cursor_page_iterator.rb
62
+ lib/whop_sdk/internal/types/utils.rb
@@ -35,7 +35,7 @@ module Whop_sdk
35
35
  @default_headers = {
36
36
  "X-Fern-Language": "Ruby",
37
37
  "X-Fern-SDK-Name": "whop_sdk",
38
- "X-Fern-SDK-Version": "1.0.11"
38
+ "X-Fern-SDK-Version": "1.0.12"
39
39
  }.merge(headers)
40
40
  @overridable_headers = overridable_headers.to_set { |name| name.to_s.downcase }
41
41
  end
@@ -55,9 +55,25 @@ module Whop_sdk
55
55
  else
56
56
  fetched_page = result
57
57
  end
58
- @cursor = fetched_page.send(@cursor_field)
58
+ @cursor = extract_cursor(fetched_page)
59
59
  fetched_page
60
60
  end
61
+
62
+ private
63
+
64
+ # The generated clients pass cursor_field: :end_cursor, but the response models
65
+ # declare end_cursor on page_info rather than at the root, and Internal::Types::Model
66
+ # has no method_missing — so the root lookup raises NoMethodError on the first page of
67
+ # every list. Remove this file from .fernignore once fern-ruby-sdk emits the nested
68
+ # lookup itself.
69
+ def extract_cursor(page)
70
+ return page.send(@cursor_field) if page.respond_to?(@cursor_field)
71
+
72
+ page_info = page.respond_to?(:page_info) ? page.page_info : nil
73
+ return page_info.send(@cursor_field) if page_info.respond_to?(@cursor_field)
74
+
75
+ nil
76
+ end
61
77
  end
62
78
  end
63
79
  end
@@ -58,6 +58,8 @@ module Whop_sdk
58
58
  end
59
59
  in ->(t) { t <= Integer }
60
60
  case value
61
+ when Float
62
+ return value == value.to_i ? value.to_i : value
61
63
  when Numeric, String, Time
62
64
  return value.to_i
63
65
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Whop_sdk
4
- VERSION = "1.0.11"
4
+ VERSION = "1.0.12"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whop_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Whop_sdk