ruby-anvil 0.0.1.pre.rc.1
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/CHANGELOG.md +61 -0
- data/LICENSE.txt +21 -0
- data/README.md +802 -0
- data/lib/anvil/auth.rb +66 -0
- data/lib/anvil/client.rb +624 -0
- data/lib/anvil/errors.rb +230 -0
- data/lib/anvil/graphql.rb +270 -0
- data/lib/anvil/multipart.rb +104 -0
- data/lib/anvil/payloads/base.rb +92 -0
- data/lib/anvil/payloads/create_etch_packet.rb +13 -0
- data/lib/anvil/payloads/etch_file.rb +21 -0
- data/lib/anvil/payloads/etch_signer.rb +22 -0
- data/lib/anvil/payloads/fill_pdf.rb +13 -0
- data/lib/anvil/payloads/forge_submit.rb +16 -0
- data/lib/anvil/payloads/generate_pdf.rb +26 -0
- data/lib/anvil/rate_limiter.rb +236 -0
- data/lib/anvil/response.rb +84 -0
- data/lib/anvil/types/base.rb +147 -0
- data/lib/anvil/types/etch_packet.rb +15 -0
- data/lib/anvil/types/generated/graphql.rb +1713 -0
- data/lib/anvil/types/generated/operations.rb +1342 -0
- data/lib/anvil/types/generated/rest.rb +496 -0
- data/lib/anvil/upload_with_options.rb +113 -0
- data/lib/anvil/uploads.rb +119 -0
- data/lib/anvil/version.rb +5 -0
- data/lib/anvil.rb +98 -0
- data/lib/ruby-anvil.rb +5 -0
- metadata +73 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 47e51416fe2aac9e5cf194f3aa35724f4e543386f82de0e9ebd10ae09e34e2c1
|
|
4
|
+
data.tar.gz: de300c03b21576969190446ea4d9653a94799e710649e68c9642d677c7bf65ab
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 23b41f74211516166576ecb0e3c6dc6aa45cef9904dc53da95851094eb9350a5c4573629f59c74b1d89d201bc315d350c6ae5f71c2fdf282c9d86d55e7e7d268
|
|
7
|
+
data.tar.gz: 87b903e53ce8f2f1b67cf0cf1a673893e1073430d8ef8576f7e6d766a776dd8a92962049bcc70d07db3b1e2cda1dd44bff6d794dafac16b066c382db0c7e39b9
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this gem are recorded here. It follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the gem follows
|
|
5
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
Releases are cut from [package-ops](https://github.com/anvilco/package-ops),
|
|
8
|
+
which renames `[Unreleased]` to the version it is releasing. Note changes here
|
|
9
|
+
as they land.
|
|
10
|
+
|
|
11
|
+
## [Unreleased]
|
|
12
|
+
|
|
13
|
+
The first release: the Anvil API in Ruby, with the same coverage as the
|
|
14
|
+
[Node client](https://github.com/anvilco/node-anvil).
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- `Anvil::Client` with `fill_pdf`, `generate_pdf`, `create_etch_packet`,
|
|
19
|
+
`get_etch_packet`, `generate_etch_sign_url`, `download_documents`,
|
|
20
|
+
`forge_submit` and `remove_weld_data`, plus the `request_graphql` and
|
|
21
|
+
`request_rest` escape hatches for everything else the API can do.
|
|
22
|
+
- API key (Basic) and OAuth access token (Bearer) authentication.
|
|
23
|
+
- A configurable `base_url` that every endpoint is derived from, so one setting
|
|
24
|
+
points the whole client at staging.
|
|
25
|
+
- Automatic rate limiting, sized from your organization's own
|
|
26
|
+
`x-ratelimit-limit` and `x-ratelimit-interval-ms` headers on the first
|
|
27
|
+
response, and a retry on a 429 after the delay the API asks for.
|
|
28
|
+
- Structured errors: an exception class per failure kind, carrying the status
|
|
29
|
+
code, the normalized messages and any field-level details.
|
|
30
|
+
- Typed request payloads under `Anvil::Payloads` and typed responses under
|
|
31
|
+
`Anvil::Types`, both of which pass through anything they do not know about.
|
|
32
|
+
- GraphQL file uploads over the multipart request spec, prepared with
|
|
33
|
+
`Anvil.prepare_graphql_file`.
|
|
34
|
+
- `:string`, `:io`, `:stream` and `:json` response types, so a large PDF or zip
|
|
35
|
+
never has to be held in memory whole.
|
|
36
|
+
- `get_current_user`, reading whoever the credentials belong to.
|
|
37
|
+
- An `ANVIL_API_KEY` environment variable fallback, so a client built with no
|
|
38
|
+
arguments works.
|
|
39
|
+
- Retries for the responses the API could not give: 500, 502, 503 and 504, and
|
|
40
|
+
connection errors, backing off 100ms and doubling, or honoring a `Retry-After`.
|
|
41
|
+
A timeout is not retried, since the request may already have been acted on.
|
|
42
|
+
- `examples/`, and a `CONTRIBUTING.md` covering developing, the test client, the
|
|
43
|
+
types, versioning and publishing.
|
|
44
|
+
- Every type in the API's specs, generated from `@anvilco/types`: the GraphQL
|
|
45
|
+
object, input and enum types, the arguments of every query and mutation under
|
|
46
|
+
`Anvil::Operations`, and the REST request bodies. A sync workflow keeps them
|
|
47
|
+
in step with production, and CI fails on a stale or hand-edited generated file.
|
|
48
|
+
|
|
49
|
+
### Notes
|
|
50
|
+
|
|
51
|
+
The client follows the SDK conventions the other Anvil clients are held to, so a
|
|
52
|
+
few behaviors match python-anvil and dotnet-anvil rather than node-anvil:
|
|
53
|
+
|
|
54
|
+
- An OAuth access token that is a JWT is sent verbatim, as the API wants. Only
|
|
55
|
+
a non-JWT token is base64 encoded.
|
|
56
|
+
- The rate limiter is a sliding window shared per process, keyed by the
|
|
57
|
+
environment and the credentials, counting requests in flight as well as
|
|
58
|
+
finished. A 429 is retried for as long as the API keeps asking, waiting the
|
|
59
|
+
`Retry-After` it named capped at a minute.
|
|
60
|
+
- A 2xx whose body carries only a `name` or a `message` is not an error.
|
|
61
|
+
node-anvil treats it as one; that is a known divergence.
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Anvil Foundry Inc.
|
|
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
|
|
13
|
+
all 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
|
|
21
|
+
THE SOFTWARE.
|