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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0a3d6de667a48f878769b774eccd367018ed52f1c6628cd730e1ff8c9fdaabe
4
- data.tar.gz: 737c8e8de705a5dc0eadf303afe1b1fa7a5d2292a700642aa5d82416565661ae
3
+ metadata.gz: 42507b7d1ba08a805a576fbff8db77567d4cc258c520bb11bfa02e7afa004084
4
+ data.tar.gz: ca506b9966b60f6c715996cd887f40a4d4970b606422800cf1c6300d9af8436a
5
5
  SHA512:
6
- metadata.gz: 4493abc121849ba91d73c18ceaf060f0008b409bbe8c3402f74fa224c8906e6b4ea07e43e3c0f477bd028b37899db73c144ec49daabff0cce54f4878475d54a5
7
- data.tar.gz: 22e71db5b421dcb9a78ef599261036d5b32dde80b92abb995933d57261a6b68b9a5505482fe9392c3420e363f8ff42b798c2659d2e012930e4df0d4cd97c5a41
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.0.1...HEAD
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spyglasses (1.1.0)
4
+ spyglasses (1.1.2)
5
5
  json (>= 2.0)
6
6
  rack (>= 2.0)
7
7
 
@@ -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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spyglasses
4
- VERSION = '1.1.0'
4
+ VERSION = '1.1.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spyglasses
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orchestra AI, Inc.