rcs 2.0.16.pre.rc.7 → 2.0.16.pre.rc.8

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: 17953e3edfa8734365e4598ee8358587f4609d53fee85d7fab986fe72579d31c
4
- data.tar.gz: 48c066b1d4170e0f20035204a386434fda5085d031187778ffd5a24e344f1920
3
+ metadata.gz: b81a3bfe52e9511027dbf9903a2267b6dc67827a0852c625ae92ec2444bc6b91
4
+ data.tar.gz: 2e309460492f37d4a1d3a11a0fcaf928d49f5e5dec62c473e3cbddfe4d5c9cec
5
5
  SHA512:
6
- metadata.gz: e295305c56d9d0b43286b932d1b9ed281a05b4505dff47b06cefff5509fde25b4d3aac68020a98ed2da6e43cad84dcc0622285e627b255d329563e104de0fe7a
7
- data.tar.gz: 79088a33244a6e07433eeffb84af7f9b7f387ad7636fa500ea69e77010834ad70f291a9bf397d545935a997411178d08e47822fbb302c949b98a64c57ac2f431
6
+ metadata.gz: 1a7677f03fe92b91957158f254e818ee5fcc783deae419fe92fc2bc91a34149c1d2130f2a9a5d2d6b7d3c135fa8b7a85471f4ea4f7d62589e5413e5ed52db704
7
+ data.tar.gz: b2d6f0b470217ea2b60039808b2370c637f86c7783452be53cd380da4e08a1ef28f1703ed21194d7bad35771115f92db07039870d1f5ad037a40707e1fe85827
data/.fern/metadata.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "cliVersion": "4.58.0",
3
3
  "generatorName": "fernapi/fern-ruby-sdk",
4
- "generatorVersion": "1.1.13",
4
+ "generatorVersion": "1.0.0-rc85",
5
5
  "generatorConfig": {
6
6
  "clientModuleName": "PinnacleBaseClient",
7
7
  "flattenModuleStructure": true,
8
8
  "useProvidedDefaults": true,
9
9
  "rubocopVariableNumberStyle": "snake_case"
10
10
  },
11
- "originGitCommit": "522418b47dda0cd1c81f634293bf392d7c4deaa6",
12
- "sdkVersion": "2.0.16.pre.rc.6"
11
+ "originGitCommit": "e667be79177837eb3116ebbe793539692905a235",
12
+ "sdkVersion": "2.0.16.pre.rc.8"
13
13
  }
data/.rubocop.yml CHANGED
@@ -59,11 +59,18 @@ Minitest/MultipleAssertions:
59
59
  Minitest/UselessAssertion:
60
60
  Enabled: false
61
61
 
62
- # Dynamic snippets are code samples for documentation, not standalone Ruby files.
63
- Style/FrozenStringLiteralComment:
62
+ # Auto-generated `internal/types/*.rb` ends with a bare `value` reference
63
+ # inside the type-coercion fallthrough — intentional, not dead code.
64
+ Lint/Void:
64
65
  Exclude:
65
- - "dynamic-snippets/**/*"
66
+ - "lib/pinnacle/internal/types/**/*.rb"
66
67
 
67
- Layout/FirstHashElementIndentation:
68
+ # Auto-generated test_union.rb uses `assert X.member?(Y)` because it's
69
+ # testing the `member?` API directly, not a generic collection check.
70
+ Minitest/AssertIncludes:
68
71
  Exclude:
69
- - "dynamic-snippets/**/*"
72
+ - "test/unit/internal/types/**/*.rb"
73
+
74
+ Minitest/RefuteIncludes:
75
+ Exclude:
76
+ - "test/unit/internal/types/**/*.rb"
@@ -108,7 +108,7 @@ module Pinnacle
108
108
  request = Pinnacle::Internal::JSON::Request.new(
109
109
  base_url: request_options[:base_url],
110
110
  method: "GET",
111
- path: "brands/#{URI.encode_uri_component(params[:id].to_s)}",
111
+ path: "brands/#{params[:id]}",
112
112
  query: query_params,
113
113
  request_options: request_options
114
114
  )
@@ -143,7 +143,7 @@ module Pinnacle
143
143
  request = Pinnacle::Internal::JSON::Request.new(
144
144
  base_url: request_options[:base_url],
145
145
  method: "POST",
146
- path: "brands/#{URI.encode_uri_component(params[:brand_id].to_s)}/submit",
146
+ path: "brands/#{params[:brand_id]}/submit",
147
147
  request_options: request_options
148
148
  )
149
149
  begin
@@ -216,7 +216,7 @@ module Pinnacle
216
216
  request = Pinnacle::Internal::JSON::Request.new(
217
217
  base_url: request_options[:base_url],
218
218
  method: "POST",
219
- path: "brands/#{URI.encode_uri_component(params[:brand_id].to_s)}/vet",
219
+ path: "brands/#{params[:brand_id]}/vet",
220
220
  body: body,
221
221
  request_options: request_options
222
222
  )
@@ -62,7 +62,7 @@ module Pinnacle
62
62
  request = Pinnacle::Internal::JSON::Request.new(
63
63
  base_url: request_options[:base_url],
64
64
  method: "GET",
65
- path: "campaigns/dlc/#{URI.encode_uri_component(params[:campaign_id].to_s)}",
65
+ path: "campaigns/dlc/#{params[:campaign_id]}",
66
66
  request_options: request_options
67
67
  )
68
68
  begin
@@ -96,7 +96,7 @@ module Pinnacle
96
96
  request = Pinnacle::Internal::JSON::Request.new(
97
97
  base_url: request_options[:base_url],
98
98
  method: "POST",
99
- path: "campaigns/dlc/submit/#{URI.encode_uri_component(params[:campaign_id].to_s)}",
99
+ path: "campaigns/dlc/submit/#{params[:campaign_id]}",
100
100
  request_options: request_options
101
101
  )
102
102
  begin
@@ -62,7 +62,7 @@ module Pinnacle
62
62
  request = Pinnacle::Internal::JSON::Request.new(
63
63
  base_url: request_options[:base_url],
64
64
  method: "GET",
65
- path: "campaigns/rcs/#{URI.encode_uri_component(params[:campaign_id].to_s)}",
65
+ path: "campaigns/rcs/#{params[:campaign_id]}",
66
66
  request_options: request_options
67
67
  )
68
68
  begin
@@ -96,7 +96,7 @@ module Pinnacle
96
96
  request = Pinnacle::Internal::JSON::Request.new(
97
97
  base_url: request_options[:base_url],
98
98
  method: "POST",
99
- path: "campaigns/rcs/submit/#{URI.encode_uri_component(params[:campaign_id].to_s)}",
99
+ path: "campaigns/rcs/submit/#{params[:campaign_id]}",
100
100
  request_options: request_options
101
101
  )
102
102
  begin
@@ -62,7 +62,7 @@ module Pinnacle
62
62
  request = Pinnacle::Internal::JSON::Request.new(
63
63
  base_url: request_options[:base_url],
64
64
  method: "GET",
65
- path: "campaigns/toll-free/#{URI.encode_uri_component(params[:campaign_id].to_s)}",
65
+ path: "campaigns/toll-free/#{params[:campaign_id]}",
66
66
  request_options: request_options
67
67
  )
68
68
  begin
@@ -96,7 +96,7 @@ module Pinnacle
96
96
  request = Pinnacle::Internal::JSON::Request.new(
97
97
  base_url: request_options[:base_url],
98
98
  method: "POST",
99
- path: "campaigns/toll-free/submit/#{URI.encode_uri_component(params[:campaign_id].to_s)}",
99
+ path: "campaigns/toll-free/submit/#{params[:campaign_id]}",
100
100
  request_options: request_options
101
101
  )
102
102
  begin
@@ -10,7 +10,7 @@ module Pinnacle
10
10
  @raw_client = Pinnacle::Internal::Http::RawClient.new(
11
11
  base_url: base_url || Pinnacle::Environment::DEFAULT,
12
12
  headers: {
13
- "User-Agent" => "rcs/2.0.16.pre.rc.6",
13
+ "User-Agent" => "rcs/2.0.16.pre.rc.8",
14
14
  "X-Fern-Language" => "Ruby",
15
15
  "PINNACLE-API-KEY" => api_key.to_s
16
16
  }
@@ -147,7 +147,7 @@ module Pinnacle
147
147
  request = Pinnacle::Internal::JSON::Request.new(
148
148
  base_url: request_options[:base_url],
149
149
  method: "POST",
150
- path: "conversations/#{URI.encode_uri_component(params[:id].to_s)}/messages",
150
+ path: "conversations/#{params[:id]}/messages",
151
151
  query: query_params,
152
152
  request_options: request_options
153
153
  )
@@ -27,7 +27,7 @@ module Pinnacle
27
27
  request = Pinnacle::Internal::JSON::Request.new(
28
28
  base_url: request_options[:base_url],
29
29
  method: "GET",
30
- path: "forms/#{URI.encode_uri_component(params[:id].to_s)}",
30
+ path: "forms/#{params[:id]}",
31
31
  request_options: request_options
32
32
  )
33
33
  begin
@@ -66,7 +66,7 @@ module Pinnacle
66
66
  request = Pinnacle::Internal::JSON::Request.new(
67
67
  base_url: request_options[:base_url],
68
68
  method: "PATCH",
69
- path: "forms/#{URI.encode_uri_component(params[:id].to_s)}",
69
+ path: "forms/#{params[:id]}",
70
70
  body: body,
71
71
  request_options: request_options
72
72
  )
@@ -33,7 +33,7 @@ module Pinnacle
33
33
  request = Pinnacle::Internal::JSON::Request.new(
34
34
  base_url: request_options[:base_url],
35
35
  method: "POST",
36
- path: "forms/#{URI.encode_uri_component(params[:id].to_s)}/submissions/list",
36
+ path: "forms/#{params[:id]}/submissions/list",
37
37
  body: body,
38
38
  request_options: request_options
39
39
  )
@@ -31,20 +31,6 @@ module Pinnacle
31
31
  # Child classes should implement:
32
32
  # - encode_headers: Returns the encoded HTTP request headers.
33
33
  # - encode_body: Returns the encoded HTTP request body.
34
-
35
- private
36
-
37
- # Merges additional_headers from request_options into sdk_headers, filtering out
38
- # any keys that collide with SDK-set or client-protected headers (case-insensitive).
39
- # @param sdk_headers [Hash] Headers set by the SDK for this request type.
40
- # @param protected_keys [Array<String>] Additional header keys that must not be overridden.
41
- # @return [Hash] The merged headers.
42
- def merge_additional_headers(sdk_headers, protected_keys: [])
43
- additional_headers = @request_options&.dig(:additional_headers) || @request_options&.dig("additional_headers") || {}
44
- all_protected = (sdk_headers.keys + protected_keys).to_set { |k| k.to_s.downcase }
45
- filtered = additional_headers.reject { |key, _| all_protected.include?(key.to_s.downcase) }
46
- sdk_headers.merge(filtered)
47
- end
48
34
  end
49
35
  end
50
36
  end
@@ -43,7 +43,7 @@ module Pinnacle
43
43
  http_request = build_http_request(
44
44
  url:,
45
45
  method: request.method,
46
- headers: request.encode_headers(protected_keys: @default_headers.keys),
46
+ headers: request.encode_headers,
47
47
  body: request.encode_body
48
48
  )
49
49
 
@@ -120,8 +120,6 @@ module Pinnacle
120
120
  [delay + jitter, 0].max
121
121
  end
122
122
 
123
- LOCALHOST_HOSTS = %w[localhost 127.0.0.1 [::1]].freeze
124
-
125
123
  # @param request [Pinnacle::Internal::Http::BaseRequest] The HTTP request.
126
124
  # @return [URI::Generic] The URL.
127
125
  def build_url(request)
@@ -131,29 +129,14 @@ module Pinnacle
131
129
  if request.path.start_with?("http://", "https://")
132
130
  url = request.path
133
131
  url = "#{url}?#{encode_query(encoded_query)}" if encoded_query&.any?
134
- parsed = URI.parse(url)
135
- validate_https!(parsed)
136
- return parsed
132
+ return URI.parse(url)
137
133
  end
138
134
 
139
135
  path = request.path.start_with?("/") ? request.path[1..] : request.path
140
136
  base = request.base_url || @base_url
141
137
  url = "#{base.chomp("/")}/#{path}"
142
138
  url = "#{url}?#{encode_query(encoded_query)}" if encoded_query&.any?
143
- parsed = URI.parse(url)
144
- validate_https!(parsed)
145
- parsed
146
- end
147
-
148
- # Raises if the URL uses http:// for a non-localhost host, which would
149
- # send authentication credentials in plaintext.
150
- # @param url [URI::Generic] The parsed URL.
151
- def validate_https!(url)
152
- return if url.scheme != "http"
153
- return if LOCALHOST_HOSTS.include?(url.host)
154
-
155
- raise ArgumentError, "Refusing to send request to non-HTTPS URL: #{url}. " \
156
- "HTTP is only allowed for localhost. Use HTTPS or pass a localhost URL."
139
+ URI.parse(url)
157
140
  end
158
141
 
159
142
  # @param url [URI::Generic] The url to the resource.
@@ -197,7 +180,6 @@ module Pinnacle
197
180
 
198
181
  http = Net::HTTP.new(url.host, port)
199
182
  http.use_ssl = is_https
200
- http.verify_mode = OpenSSL::SSL::VERIFY_PEER if is_https
201
183
  # NOTE: We handle retries at the application level with HTTP status code awareness,
202
184
  # so we set max_retries to 0 to disable Net::HTTP's built-in network-level retries.
203
185
  http.max_retries = 0
@@ -21,14 +21,12 @@ module Pinnacle
21
21
  end
22
22
 
23
23
  # @return [Hash] The encoded HTTP request headers.
24
- # @param protected_keys [Array<String>] Header keys set by the SDK client (e.g. auth, metadata)
25
- # that must not be overridden by additional_headers from request_options.
26
- def encode_headers(protected_keys: [])
27
- sdk_headers = {
24
+ def encode_headers
25
+ additional_headers = @request_options&.dig(:additional_headers) || @request_options&.dig("additional_headers") || {}
26
+ {
28
27
  "Content-Type" => "application/json",
29
28
  "Accept" => "application/json"
30
- }.merge(@headers)
31
- merge_additional_headers(sdk_headers, protected_keys:)
29
+ }.merge(@headers).merge(additional_headers)
32
30
  end
33
31
 
34
32
  # @return [String, nil] The encoded HTTP request body.
@@ -21,13 +21,11 @@ module Pinnacle
21
21
  end
22
22
 
23
23
  # @return [Hash] The encoded HTTP request headers.
24
- # @param protected_keys [Array<String>] Header keys set by the SDK client (e.g. auth, metadata)
25
- # that must not be overridden by additional_headers from request_options.
26
- def encode_headers(protected_keys: [])
27
- sdk_headers = {
24
+ def encode_headers
25
+ additional_headers = @request_options&.dig(:additional_headers) || @request_options&.dig("additional_headers") || {}
26
+ {
28
27
  "Content-Type" => @body.content_type
29
- }.merge(@headers)
30
- merge_additional_headers(sdk_headers, protected_keys:)
28
+ }.merge(@headers).merge(additional_headers)
31
29
  end
32
30
 
33
31
  # @return [String, nil] The encoded HTTP request body.
@@ -17,7 +17,7 @@ module Pinnacle
17
17
  def self.coerce(value, strict: strict?)
18
18
  case value
19
19
  when TrueClass, FalseClass
20
- return value
20
+ value
21
21
  when Integer
22
22
  return value == 1
23
23
  when String
@@ -21,7 +21,7 @@ module Pinnacle
21
21
  self
22
22
  end
23
23
 
24
- def type_member?(type)
24
+ def member?(type)
25
25
  members.any? { |_key, type_fn| type == type_fn.call }
26
26
  end
27
27
 
@@ -81,10 +81,10 @@ module Pinnacle
81
81
  }
82
82
  return type.coerce(value, strict: strict)
83
83
  else
84
- value # rubocop:disable Lint/Void
84
+ value
85
85
  end
86
86
  else
87
- value # rubocop:disable Lint/Void
87
+ value
88
88
  end
89
89
 
90
90
  raise Errors::TypeError, "cannot coerce value of type `#{value.class}` to `#{target}`" if strict
@@ -27,7 +27,7 @@ module Pinnacle
27
27
  request = Pinnacle::Internal::JSON::Request.new(
28
28
  base_url: request_options[:base_url],
29
29
  method: "GET",
30
- path: "messages/#{URI.encode_uri_component(params[:id].to_s)}",
30
+ path: "messages/#{params[:id]}",
31
31
  request_options: request_options
32
32
  )
33
33
  begin
@@ -31,7 +31,7 @@ module Pinnacle
31
31
  request = Pinnacle::Internal::JSON::Request.new(
32
32
  base_url: request_options[:base_url],
33
33
  method: "DELETE",
34
- path: "messages/schedule/#{URI.encode_uri_component(params[:id].to_s)}",
34
+ path: "messages/schedule/#{params[:id]}",
35
35
  request_options: request_options
36
36
  )
37
37
  begin
@@ -30,7 +30,7 @@ module Pinnacle
30
30
  request = Pinnacle::Internal::JSON::Request.new(
31
31
  base_url: request_options[:base_url],
32
32
  method: "GET",
33
- path: "rcs/#{URI.encode_uri_component(params[:agent_id].to_s)}",
33
+ path: "rcs/#{params[:agent_id]}",
34
34
  request_options: request_options
35
35
  )
36
36
  begin
@@ -115,7 +115,7 @@ module Pinnacle
115
115
  request = Pinnacle::Internal::JSON::Request.new(
116
116
  base_url: request_options[:base_url],
117
117
  method: "PATCH",
118
- path: "rcs/test/agents/#{URI.encode_uri_component(params[:agent_id].to_s)}",
118
+ path: "rcs/test/agents/#{params[:agent_id]}",
119
119
  body: body,
120
120
  request_options: request_options
121
121
  )
@@ -186,7 +186,7 @@ module Pinnacle
186
186
  request = Pinnacle::Internal::JSON::Request.new(
187
187
  base_url: request_options[:base_url],
188
188
  method: "POST",
189
- path: "rcs/test/agents/#{URI.encode_uri_component(params[:agent_id].to_s)}/whitelist",
189
+ path: "rcs/test/agents/#{params[:agent_id]}/whitelist",
190
190
  body: body,
191
191
  request_options: request_options
192
192
  )
@@ -252,7 +252,7 @@ module Pinnacle
252
252
  request = Pinnacle::Internal::JSON::Request.new(
253
253
  base_url: request_options[:base_url],
254
254
  method: "GET",
255
- path: "rcs/test/agents/#{URI.encode_uri_component(params[:agent_id].to_s)}/numbers",
255
+ path: "rcs/test/agents/#{params[:agent_id]}/numbers",
256
256
  query: query_params,
257
257
  request_options: request_options
258
258
  )
@@ -28,7 +28,7 @@ module Pinnacle
28
28
  request = Pinnacle::Internal::JSON::Request.new(
29
29
  base_url: request_options[:base_url],
30
30
  method: "GET",
31
- path: "status/brand/#{URI.encode_uri_component(params[:brand_id].to_s)}",
31
+ path: "status/brand/#{params[:brand_id]}",
32
32
  request_options: request_options
33
33
  )
34
34
  begin
@@ -62,7 +62,7 @@ module Pinnacle
62
62
  request = Pinnacle::Internal::JSON::Request.new(
63
63
  base_url: request_options[:base_url],
64
64
  method: "GET",
65
- path: "status/toll-free-campaign/#{URI.encode_uri_component(params[:campaign_id].to_s)}",
65
+ path: "status/toll-free-campaign/#{params[:campaign_id]}",
66
66
  request_options: request_options
67
67
  )
68
68
  begin
@@ -96,7 +96,7 @@ module Pinnacle
96
96
  request = Pinnacle::Internal::JSON::Request.new(
97
97
  base_url: request_options[:base_url],
98
98
  method: "GET",
99
- path: "status/dlc-campaign/#{URI.encode_uri_component(params[:campaign_id].to_s)}",
99
+ path: "status/dlc-campaign/#{params[:campaign_id]}",
100
100
  request_options: request_options
101
101
  )
102
102
  begin
@@ -130,7 +130,7 @@ module Pinnacle
130
130
  request = Pinnacle::Internal::JSON::Request.new(
131
131
  base_url: request_options[:base_url],
132
132
  method: "GET",
133
- path: "status/rcs-campaign/#{URI.encode_uri_component(params[:campaign_id].to_s)}",
133
+ path: "status/rcs-campaign/#{params[:campaign_id]}",
134
134
  request_options: request_options
135
135
  )
136
136
  begin
@@ -166,7 +166,7 @@ module Pinnacle
166
166
  request = Pinnacle::Internal::JSON::Request.new(
167
167
  base_url: request_options[:base_url],
168
168
  method: "GET",
169
- path: "status/phone-number/#{URI.encode_uri_component(params[:phone_number].to_s)}",
169
+ path: "status/phone-number/#{params[:phone_number]}",
170
170
  request_options: request_options
171
171
  )
172
172
  begin
@@ -62,7 +62,7 @@ module Pinnacle
62
62
  request = Pinnacle::Internal::JSON::Request.new(
63
63
  base_url: request_options[:base_url],
64
64
  method: "GET",
65
- path: "tools/url/#{URI.encode_uri_component(params[:link_id].to_s)}",
65
+ path: "tools/url/#{params[:link_id]}",
66
66
  request_options: request_options
67
67
  )
68
68
  begin
@@ -101,7 +101,7 @@ module Pinnacle
101
101
  request = Pinnacle::Internal::JSON::Request.new(
102
102
  base_url: request_options[:base_url],
103
103
  method: "PUT",
104
- path: "tools/url/#{URI.encode_uri_component(params[:link_id].to_s)}",
104
+ path: "tools/url/#{params[:link_id]}",
105
105
  body: body,
106
106
  request_options: request_options
107
107
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pinnacle
4
- VERSION = "2.0.16.pre.rc.7"
4
+ VERSION = "2.0.16.pre.rc.8"
5
5
  end