spyglasses 1.1.0 → 1.1.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 +4 -4
- data/CHANGELOG.md +11 -1
- data/Gemfile.lock +1 -1
- data/lib/spyglasses/types.rb +11 -3
- data/lib/spyglasses/version.rb +1 -1
- 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: 42507b7d1ba08a805a576fbff8db77567d4cc258c520bb11bfa02e7afa004084
|
4
|
+
data.tar.gz: ca506b9966b60f6c715996cd887f40a4d4970b606422800cf1c6300d9af8436a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c91ac50201b054dfa371d2e68a24e0787020b4d310a131f37dbf3ebf031e0c5e9bc516be6306482e4f6e83d782b501e6978526617e40878afd881165ca947e2b
|
7
|
+
data.tar.gz: 3baa0824e06e8474fd659308ebf531500f826bcc69898005ef58814ec0fbead47d57900465feb3504a44c092e07e86022694e4eeb8dcfbf7815ce32eae9a79f1
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [1.1.2] - 2024-12-29
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
- Fixed optional field handling in JSON payload to prevent validation errors
|
12
|
+
- Optional fields (`request_body`, `referrer`) are now omitted when nil instead of sending null
|
13
|
+
- Resolves TypeScript API validation issues with null vs undefined distinction
|
14
|
+
- Enhanced collector API compatibility for both bot and AI referrer events
|
15
|
+
|
8
16
|
## [1.1.0] - 2024-12-29
|
9
17
|
|
10
18
|
### Fixed
|
@@ -55,6 +63,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
55
63
|
- **Performance**: Pattern caching, background logging, minimal overhead
|
56
64
|
- **Framework Support**: Universal Rack middleware design
|
57
65
|
|
58
|
-
[Unreleased]: https://github.com/spyglasses/spyglasses-ruby/compare/v1.
|
66
|
+
[Unreleased]: https://github.com/spyglasses/spyglasses-ruby/compare/v1.1.2...HEAD
|
67
|
+
[1.1.2]: https://github.com/spyglasses/spyglasses-ruby/compare/v1.1.0...v1.1.2
|
68
|
+
[1.1.0]: https://github.com/spyglasses/spyglasses-ruby/compare/v1.0.1...v1.1.0
|
59
69
|
[1.0.1]: https://github.com/spyglasses/spyglasses-ruby/compare/v1.0.0...v1.0.1
|
60
70
|
[1.0.0]: https://github.com/spyglasses/spyglasses-ruby/releases/tag/v1.0.0
|
data/Gemfile.lock
CHANGED
data/lib/spyglasses/types.rb
CHANGED
@@ -184,22 +184,30 @@ module Spyglasses
|
|
184
184
|
end
|
185
185
|
|
186
186
|
def to_h
|
187
|
-
{
|
187
|
+
payload = {
|
188
188
|
url: @url,
|
189
189
|
user_agent: @user_agent,
|
190
|
+
# Ensure required string fields are never nil - use empty string as default
|
190
191
|
ip_address: @ip_address || '',
|
191
192
|
request_method: @request_method,
|
192
193
|
request_path: @request_path,
|
194
|
+
# request_query is required as string in API schema
|
193
195
|
request_query: @request_query || '',
|
194
|
-
request_body: @request_body,
|
195
|
-
referrer: @referrer,
|
196
196
|
response_status: @response_status,
|
197
197
|
response_time_ms: @response_time_ms,
|
198
198
|
headers: @headers,
|
199
199
|
timestamp: @timestamp,
|
200
|
+
# Convert snake_case to camelCase to match TypeScript API
|
200
201
|
platformType: @platform_type,
|
201
202
|
metadata: @metadata
|
202
203
|
}
|
204
|
+
|
205
|
+
# Only include optional fields if they have values (not nil)
|
206
|
+
# This prevents sending null which fails TypeScript validation
|
207
|
+
payload[:request_body] = @request_body if @request_body
|
208
|
+
payload[:referrer] = @referrer if @referrer
|
209
|
+
|
210
|
+
payload
|
203
211
|
end
|
204
212
|
|
205
213
|
def to_json(*args)
|
data/lib/spyglasses/version.rb
CHANGED