infrawrench-sdk 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b0e993bbb69d289818c3cece6e1135eb66595171d52e6841a7302d23e2ca9512
4
+ data.tar.gz: 420ed047adf860bd716e8a8b346e7d7feeeccf01fa2ecc8b3a12e6fd5c0a7fb6
5
+ SHA512:
6
+ metadata.gz: 9ac8970c9f2f702db8b7f6e90c8b2fec03411203a42476f71a5a25949eb8dcb0658e85d7f2eed9e4c93249da592ed0e54415f1c7d7010a1559e0ac4c5efe88fb
7
+ data.tar.gz: 2f6e378692c6e1c273163e08033c876a243f014fb611aebb9665b31c5c51b57ddec764de3fe977880f8b304c66ce5e352430649c4aa8d2eadcfadaf5ac434fc4
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Infrawrench LLC
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,94 @@
1
+ # infrawrench-sdk
2
+
3
+ Generated Ruby client for the Infrawrench API (API version `0.1.1`).
4
+
5
+ **Do not edit this gem by hand** — it is regenerated from `openapi.json` and is
6
+ not checked into the repository. Run
7
+ `pnpm --filter @infrawrench/web generate:sdk` to rebuild it; the generator lives
8
+ in [`app/packages/web/scripts/sdk`](https://github.com/Infrawrench/Infrawrench/tree/main/app/packages/web/scripts/sdk).
9
+
10
+ Requires Ruby 3.0+. No runtime dependencies — `net/http`, `uri` and `json`
11
+ from the standard library, nothing else.
12
+
13
+ ## Usage
14
+
15
+ ```ruby
16
+ require "infrawrench/sdk"
17
+
18
+ client = Infrawrench::APIV1Client.new(
19
+ api_key: ENV.fetch("INFRAWRENCH_API_KEY"),
20
+ org_id: ENV.fetch("INFRAWRENCH_ORG_ID")
21
+ )
22
+
23
+ begin
24
+ accounts = client.accounts.list
25
+ rescue Infrawrench::ApiError => e
26
+ warn "#{e.status} #{e.code}: #{e.body}"
27
+ end
28
+ ```
29
+
30
+ Calls are namespaced to mirror the URL structure, so
31
+ `POST /api/org/{orgId}/accounts/{id}/sync` is
32
+ `client.accounts.sync(id: id)`, and nesting goes as deep as the paths do —
33
+ `client.invitations.by_token.get`. Set `org_id:` once on the client and every org-scoped call can
34
+ omit it; pass `org_id:` on an individual call to override it.
35
+
36
+ Every method takes an optional trailing `request_options:` hash (`:headers`,
37
+ `:timeout`, `:open_timeout`).
38
+
39
+ ## Responses and errors
40
+
41
+ Responses are the plain `Hash`/`Array` that `JSON.parse` returns, with String
42
+ keys spelled exactly as the wire spells them. There are no model classes — see
43
+ [`sig/infrawrench/sdk.rbs`](./sig/infrawrench/sdk.rbs) for the shape of every one of the
44
+ 177 schemas, as RBS type aliases that steep and TypeProf can read.
45
+
46
+ Non-2xx responses raise `Infrawrench::ApiError`, which carries `#status`,
47
+ the parsed `#body`, and the machine-readable `#code` when the API sends one —
48
+ branch on `#code`, not on the message. A missing `org_id` raises
49
+ `Infrawrench::ConfigurationError` before anything is sent.
50
+
51
+ ## Uploads
52
+
53
+ File fields accept a String of bytes, any IO, or an `Infrawrench::Upload` when
54
+ you want to control the filename and content type:
55
+
56
+ ```ruby
57
+ client.storage.upload(
58
+ body: {
59
+ "accountId" => account_id,
60
+ "bucket" => bucket,
61
+ "key" => "logs/today.txt",
62
+ "file" => File.open("today.txt")
63
+ }
64
+ )
65
+ ```
66
+
67
+ ## Testing
68
+
69
+ `http_handler:` replaces the network call. It receives `(URI, Net::HTTPRequest)`
70
+ and returns anything that answers `code`, `body` and `[]`:
71
+
72
+ ```ruby
73
+ client = Infrawrench::APIV1Client.new(
74
+ api_key: "test",
75
+ org_id: "org_1",
76
+ http_handler: ->(uri, req) { recorded << [req.method, uri.to_s]; fake_response }
77
+ )
78
+ ```
79
+
80
+ ## Scope
81
+
82
+ This gem covers the published API surface only. Operations marked
83
+ `x-internal` in the spec — the admin surface, webhook receivers, desktop sync,
84
+ push registration, and the browser auth redirects — are not generated.
85
+
86
+ ## License
87
+
88
+ MIT — see [`LICENSE`](./LICENSE). Copyright (c) 2026 Infrawrench LLC.
89
+
90
+ Note that this client is more permissively licensed than the service it talks
91
+ to: the Infrawrench source is BUSL-1.1, but the generated clients are MIT so you
92
+ can link one into your own software without inheriting those terms.
93
+
94
+ Issues: <https://github.com/Infrawrench/Infrawrench/issues>
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ # infrawrench-sdk v0.1.1 | MIT | Copyright (c) 2026 Infrawrench LLC
4
+ # https://github.com/Infrawrench/Infrawrench
5
+ #
6
+ # Generated from the Infrawrench API OpenAPI 3.1 spec (API version 0.1.1).
7
+ #
8
+ # DO NOT EDIT. Regenerate with:
9
+ # pnpm --filter @infrawrench/web generate:sdk
10
+ #
11
+ # Internal routes are absent by construction: the generator consumes the same
12
+ # published spec that /openapi.json serves, which drops every operation
13
+ # marked x-internal.
14
+
15
+ require_relative "lib/infrawrench/version"
16
+
17
+ Gem::Specification.new do |spec|
18
+ spec.name = "infrawrench-sdk"
19
+ spec.version = Infrawrench::VERSION
20
+ spec.summary = "Generated Ruby client for the Infrawrench API (v0.1.1)."
21
+ spec.description = "Generated Ruby client for the Infrawrench API (v0.1.1). Covers the published API surface only — operations marked x-internal in the spec are not generated. No runtime dependencies."
22
+ spec.authors = ["Infrawrench LLC", "Astrid Gealer"]
23
+ spec.email = ["astrid@infrawrench.com"]
24
+ spec.homepage = "https://infrawrench.com/docs/team-and-billing/client-sdks"
25
+ spec.license = "MIT"
26
+ spec.required_ruby_version = ">= 3.0.0"
27
+
28
+ spec.metadata = {
29
+ "homepage_uri" => "https://infrawrench.com/docs/team-and-billing/client-sdks",
30
+ "source_code_uri" => "https://github.com/Infrawrench/Infrawrench",
31
+ "bug_tracker_uri" => "https://github.com/Infrawrench/Infrawrench/issues",
32
+ # No documentation_uri: it would repeat homepage_uri, and `gem build`
33
+ # warns when two metadata keys point at the same page.
34
+ # RubyGems has no first-class keywords field, so they ride in metadata
35
+ # rather than being dropped on the floor.
36
+ "keywords" => "infrawrench,sdk,api-client,openapi,infrastructure,cloud,devops",
37
+ "rubygems_mfa_required" => "true"
38
+ }
39
+
40
+ # Listed rather than globbed: this gem is build output, and a `git ls-files`
41
+ # shell-out would break the moment someone packaged it outside a checkout.
42
+ spec.files = [
43
+ "LICENSE",
44
+ "README.md",
45
+ "infrawrench-sdk.gemspec",
46
+ "lib/infrawrench-sdk.rb",
47
+ "lib/infrawrench/client.rb",
48
+ "lib/infrawrench/sdk.rb",
49
+ "lib/infrawrench/transport.rb",
50
+ "lib/infrawrench/version.rb",
51
+ "sig/infrawrench/sdk.rbs"
52
+ ]
53
+ spec.require_paths = ["lib"]
54
+ spec.extra_rdoc_files = ["README.md", "LICENSE"]
55
+
56
+ # Deliberately none: the client is net/http, uri and json from the standard
57
+ # library, so the gem can be dropped into any project without pulling a tree.
58
+ end