evalgate-sdk 3.17.0
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 +7 -0
- data/LICENSE +21 -0
- data/README.md +84 -0
- data/generation.json +924 -0
- data/lib/evalgate/client.rb +229 -0
- data/lib/evalgate/models.rb +15464 -0
- data/lib/evalgate/operations.rb +6414 -0
- data/lib/evalgate.rb +7 -0
- data/sig/evalgate.rbs +41699 -0
- metadata +53 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 2228fc710e97f827a5fc0a84480fce289b691b4765e7ab0150ec4583eb61ca41
|
|
4
|
+
data.tar.gz: ea68b4cba43e3cc8d4f8b3d5617e44299bc8289dd79f5de8b41b0e7b9293398e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: ab4a973ab92d0585499fb14332e334b0740539281029b13c026d4b42bab93edffadb12f3cf1c686810a7569f43ca186a8337ef2a2b878db721e283a53f4ba2fd
|
|
7
|
+
data.tar.gz: 99138479dc8883fea4c8ade0370cc498e7c8aaa445cfb0c06ca049e784e254c74adb51c2ffcf3bb42ad7e56bd6904db34f3901fc0df4bd05b570f454c6958630
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 Paul Carpenter
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# EvalGate Ruby SDK
|
|
2
|
+
|
|
3
|
+
Official EvalGate REST client with generated operation methods, model validation,
|
|
4
|
+
and RBS signatures from EvalGate's verified public OpenAPI contract.
|
|
5
|
+
Product and package homepage: https://evalgate.com.
|
|
6
|
+
|
|
7
|
+
Requires Ruby 3.2 or newer. Only Ruby standard/default libraries are used.
|
|
8
|
+
|
|
9
|
+
Install from RubyGems:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
gem install evalgate-sdk --version 3.17.0
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require "evalgate"
|
|
17
|
+
|
|
18
|
+
client = EvalGate::Client.new(
|
|
19
|
+
api_key: ENV.fetch("EVALGATE_API_KEY"),
|
|
20
|
+
organization_id: ENV.fetch("EVALGATE_ORGANIZATION_ID")
|
|
21
|
+
)
|
|
22
|
+
response = client.get_evaluations(query: { limit: 10 })
|
|
23
|
+
puts response.headers["ratelimit"]
|
|
24
|
+
|
|
25
|
+
body = EvalGate::Models::PostApiEvaluationsRequest.new(name: "Release checks")
|
|
26
|
+
client.post_evaluations(body: body, idempotency_key: "release-checks-001")
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The read requires an `eval:read` scoped API key; the example mutation requires
|
|
30
|
+
`eval:write`. The service enforces scopes and organization authorization. Use
|
|
31
|
+
human-approved credentials and a disposable local EvalGate instance for writes
|
|
32
|
+
while testing. Configure `base_url:` for that instance.
|
|
33
|
+
|
|
34
|
+
Every operation in `EvalGate::OPERATIONS` has a generated snake_case method.
|
|
35
|
+
Pass `path:`, `query:`, and declared `headers:` maps; required and unknown
|
|
36
|
+
parameters are checked before sending a request. JSON bodies may be generated
|
|
37
|
+
models or hashes. Object models validate documented required fields and primitive
|
|
38
|
+
types, and support `model.name`, `model[:name]`, and `model.to_h`. Unions without
|
|
39
|
+
one concrete Ruby class retain ordinary JSON values. Access fields named after
|
|
40
|
+
inherited Ruby methods, such as `method`, `methods`, or `hash`, with `model[:method]`.
|
|
41
|
+
Their JSON fields remain available without replacing Ruby's built-in methods.
|
|
42
|
+
Models preserve nullable collections: pass `nil` for JSON `null`, `[]` or `{}`
|
|
43
|
+
for explicit empty collections, and leave out an optional keyword to omit it.
|
|
44
|
+
Nonnullable array/map fields reject `nil`; their RBS types follow the same schema.
|
|
45
|
+
The `sig/` directory contains RBS 3+ signatures; `generation.json` pins the
|
|
46
|
+
contract digest and operation inventory.
|
|
47
|
+
|
|
48
|
+
`response.data`, `response.status`, and `response.headers` preserve successful
|
|
49
|
+
responses. `EvalGate::APIError` exposes `status`, `code`, `request_id`, `headers`,
|
|
50
|
+
and `data`. On a 429, inspect `error.headers["retry-after"]` and the live
|
|
51
|
+
`ratelimit` / `ratelimit-policy` values before rescheduling. The client does not
|
|
52
|
+
retry requests automatically or follow redirects. A mutation's `idempotency_key:`
|
|
53
|
+
should identify the same logical operation across retries.
|
|
54
|
+
|
|
55
|
+
```ruby
|
|
56
|
+
client.paginate("get_evaluations", query: { limit: 50 }, max_pages: 100).each do |page|
|
|
57
|
+
puts page.data
|
|
58
|
+
end
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The paginator follows the generated cursor/offset/page contract, rejects repeated
|
|
62
|
+
cursors and no-progress pages, and raises when `max_pages` is exhausted rather
|
|
63
|
+
than silently truncating. Each HTTP operation defaults to a 30 second timeout;
|
|
64
|
+
set `timeout:` at client creation to change it.
|
|
65
|
+
|
|
66
|
+
To verify an independent checkout of this Ruby package:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
ruby -Ilib test/client_test.rb
|
|
70
|
+
gem build evalgate.gemspec
|
|
71
|
+
gem install --local --no-document evalgate-sdk-3.17.0.gem
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
From the platform source repository, check generated client freshness:
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
node scripts/generate-sdk-ecosystems.mjs --check
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The gem uses an explicit file allowlist: runtime Ruby, RBS, README, MIT license,
|
|
81
|
+
and the generated contract manifest. Private platform source, deployment files,
|
|
82
|
+
and credentials are excluded.
|
|
83
|
+
|
|
84
|
+
Documentation: https://www.evalgate.com/docs/sdk/ruby. Support: hello@evalgate.com.
|