spyglasses 1.1.1 → 1.1.3
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 +23 -6
- data/DEVELOPMENT.md +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +4 -4
- data/lib/spyglasses/types.rb +11 -3
- data/lib/spyglasses/version.rb +1 -1
- data/spyglasses.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6552b09f0d7a6cd216481c941bfe12b15cd2651659655c8e52e7188db27c5746
|
4
|
+
data.tar.gz: 83d50c1a9cfc7e82ad16225859469b82c167aaeaf5c854f06182023291193ad6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ca75554f8d9bcab4d48bfa3260ad97e04cd4f49968fd639d19417a8e1b2767287075e2e6bbb2d4085e6ebb92c3e19d1c9e891cdb84a42e09c8939be540cca0b
|
7
|
+
data.tar.gz: 3a316a2d6794c98a5176f095a56ab6e9401d9fcdba6757cf4b0bab330913b3349b955abb5e38209a02ed246d7166729ef23f2171f493b95b127e85cb386be57f
|
data/CHANGELOG.md
CHANGED
@@ -5,7 +5,21 @@ 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.
|
8
|
+
## [1.1.3] - 2025-06-26
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
- Broken links to the github repo
|
12
|
+
- Standardized README
|
13
|
+
|
14
|
+
## [1.1.2] - 2025-06-25
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
- Fixed optional field handling in JSON payload to prevent validation errors
|
18
|
+
- Optional fields (`request_body`, `referrer`) are now omitted when nil instead of sending null
|
19
|
+
- Resolves TypeScript API validation issues with null vs undefined distinction
|
20
|
+
- Enhanced collector API compatibility for both bot and AI referrer events
|
21
|
+
|
22
|
+
## [1.1.0] - 2025-06-25
|
9
23
|
|
10
24
|
### Fixed
|
11
25
|
- **BREAKING**: Fixed API payload format to match TypeScript collector endpoint
|
@@ -20,7 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
20
34
|
- Enhanced middleware IP extraction with better fallback handling
|
21
35
|
- Improved request query string handling to ensure non-nil values
|
22
36
|
|
23
|
-
## [1.0.1] -
|
37
|
+
## [1.0.1] - 2025-06-24
|
24
38
|
|
25
39
|
### Added
|
26
40
|
- Comprehensive Ruby documentation in main docs site
|
@@ -32,7 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
32
46
|
- Documentation formatting and code examples
|
33
47
|
- Installation instructions for various Ruby frameworks
|
34
48
|
|
35
|
-
## [1.0.0] -
|
49
|
+
## [1.0.0] - 2025-06-24
|
36
50
|
|
37
51
|
### Added
|
38
52
|
- Initial release of Spyglasses Ruby gem
|
@@ -55,6 +69,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
55
69
|
- **Performance**: Pattern caching, background logging, minimal overhead
|
56
70
|
- **Framework Support**: Universal Rack middleware design
|
57
71
|
|
58
|
-
[Unreleased]: https://github.com/
|
59
|
-
[1.
|
60
|
-
[1.
|
72
|
+
[Unreleased]: https://github.com/orchestra-code/spyglasses-ruby/compare/v1.1.2...HEAD
|
73
|
+
[1.1.3]: https://github.com/orchestra-code/spyglasses-ruby/compare/v1.1.0...v1.1.3
|
74
|
+
[1.1.2]: https://github.com/orchestra-code/spyglasses-ruby/compare/v1.1.0...v1.1.2
|
75
|
+
[1.1.0]: https://github.com/orchestra-code/spyglasses-ruby/compare/v1.0.1...v1.1.0
|
76
|
+
[1.0.1]: https://github.com/orchestra-code/spyglasses-ruby/compare/v1.0.0...v1.0.1
|
77
|
+
[1.0.0]: https://github.com/orchestra-code/spyglasses-ruby/releases/tag/v1.0.0
|
data/DEVELOPMENT.md
CHANGED
@@ -24,7 +24,7 @@ The gem is structured into several key components:
|
|
24
24
|
## Development Setup
|
25
25
|
|
26
26
|
```bash
|
27
|
-
git clone https://github.com/
|
27
|
+
git clone https://github.com/orchestra-code/spyglasses-ruby.git
|
28
28
|
cd spyglasses-ruby
|
29
29
|
bin/setup
|
30
30
|
```
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Spyglasses Ruby Gem
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/spyglasses)
|
4
|
-
[](https://github.com/orchestra-code/spyglasses-ruby/actions/workflows/ruby.yml)
|
5
5
|
|
6
|
-
AI Agent
|
6
|
+
[AI SEO](https://www.spyglasses.io), AI Agent detection, AI model trainer blocking, and analytics for Ruby web applications. Spyglasses provides comprehensive AI agent detection and management capabilities for Ruby web applications, including Rails, Sinatra, and other Rack-based frameworks.
|
7
7
|
|
8
8
|
## Features
|
9
9
|
|
@@ -322,7 +322,7 @@ The Spyglasses middleware is designed for high-performance applications:
|
|
322
322
|
|
323
323
|
## Contributing
|
324
324
|
|
325
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
325
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/orchestra-code/spyglasses-ruby.
|
326
326
|
|
327
327
|
## License
|
328
328
|
|
@@ -332,4 +332,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
332
332
|
|
333
333
|
- 📧 Email: support@spyglasses.io
|
334
334
|
- 📖 Documentation: https://www.spyglasses.io/docs/platforms/ruby
|
335
|
-
- 🐛 Issues: https://github.com/
|
335
|
+
- 🐛 Issues: https://github.com/orchestra-code/spyglasses-ruby/issues
|
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
data/spyglasses.gemspec
CHANGED
@@ -13,9 +13,9 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.required_ruby_version = '>= 2.7.0'
|
14
14
|
|
15
15
|
spec.metadata['homepage_uri'] = spec.homepage
|
16
|
-
spec.metadata['source_code_uri'] = 'https://github.com/
|
16
|
+
spec.metadata['source_code_uri'] = 'https://github.com/orchestra-code/spyglasses-ruby'
|
17
17
|
spec.metadata['documentation_uri'] = 'https://www.spyglasses.io/docs/platforms/ruby'
|
18
|
-
spec.metadata['changelog_uri'] = 'https://github.com/
|
18
|
+
spec.metadata['changelog_uri'] = 'https://github.com/orchestra-code/spyglasses-ruby/blob/main/CHANGELOG.md'
|
19
19
|
|
20
20
|
# Specify which files should be added to the gem when it is released.
|
21
21
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spyglasses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Orchestra AI, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-06-
|
11
|
+
date: 2025-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -179,9 +179,9 @@ licenses:
|
|
179
179
|
- MIT
|
180
180
|
metadata:
|
181
181
|
homepage_uri: https://www.spyglasses.io
|
182
|
-
source_code_uri: https://github.com/
|
182
|
+
source_code_uri: https://github.com/orchestra-code/spyglasses-ruby
|
183
183
|
documentation_uri: https://www.spyglasses.io/docs/platforms/ruby
|
184
|
-
changelog_uri: https://github.com/
|
184
|
+
changelog_uri: https://github.com/orchestra-code/spyglasses-ruby/blob/main/CHANGELOG.md
|
185
185
|
post_install_message:
|
186
186
|
rdoc_options: []
|
187
187
|
require_paths:
|