scalar_api_ruby 0.2.0 → 0.3.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 +4 -4
- data/CHANGELOG.md +71 -0
- data/README.md +5 -3
- data/SKILL.md +3 -1
- data/api.md +20 -181
- data/lib/scalar_api_ruby/client.rb +14 -5
- data/lib/scalar_api_ruby/errors.rb +22 -0
- data/lib/scalar_api_ruby/file_part.rb +13 -1
- data/lib/scalar_api_ruby/internal/transport/base_client.rb +187 -42
- data/lib/scalar_api_ruby/internal/transport/connection_pool.rb +160 -0
- data/lib/scalar_api_ruby/internal/transport/pooled_net_requester.rb +77 -10
- data/lib/scalar_api_ruby/internal/type/base_model.rb +70 -18
- data/lib/scalar_api_ruby/internal/type/boolean.rb +3 -1
- data/lib/scalar_api_ruby/internal/type/converter.rb +13 -3
- data/lib/scalar_api_ruby/internal/type/enum.rb +9 -4
- data/lib/scalar_api_ruby/internal/type/file_input.rb +8 -2
- data/lib/scalar_api_ruby/internal/type/hash_of.rb +3 -1
- data/lib/scalar_api_ruby/internal/type/union.rb +21 -7
- data/lib/scalar_api_ruby/internal/type/unknown.rb +3 -1
- data/lib/scalar_api_ruby/internal/util.rb +277 -17
- data/lib/scalar_api_ruby/internal.rb +5 -1
- data/lib/scalar_api_ruby/models/access_group_create_params.rb +3 -3
- data/lib/scalar_api_ruby/models/access_group_create_response.rb +6 -6
- data/lib/scalar_api_ruby/models/access_group_retrieve_response.rb +6 -6
- data/lib/scalar_api_ruby/models/api_document.rb +3 -3
- data/lib/scalar_api_ruby/models/docs_project.rb +3 -3
- data/lib/scalar_api_ruby/models/github_project.rb +16 -4
- data/lib/scalar_api_ruby/models/mcp/mcp_server.rb +23 -18
- data/lib/scalar_api_ruby/models/mcp/server_create_response.rb +1 -7
- data/lib/scalar_api_ruby/models/mcp/server_list_response.rb +72 -1
- data/lib/scalar_api_ruby/models/sdk.rb +13 -7
- data/lib/scalar_api_ruby/models/sdk_build_params.rb +7 -1
- data/lib/scalar_api_ruby/models/sdk_create_params.rb +14 -7
- data/lib/scalar_api_ruby/models/sdk_update_params.rb +13 -3
- data/lib/scalar_api_ruby/models/sdk_version.rb +5 -34
- data/lib/scalar_api_ruby/models/sdks/repository_link_params.rb +33 -2
- data/lib/scalar_api_ruby/models/sdks/repository_update_publishing_params.rb +31 -1
- data/lib/scalar_api_ruby/models/sdks/version_create_params.rb +13 -7
- data/lib/scalar_api_ruby/models.rb +28 -31
- data/lib/scalar_api_ruby/request_options.rb +13 -5
- data/lib/scalar_api_ruby/resources/access_groups.rb +1 -1
- data/lib/scalar_api_ruby/resources/mcp/servers.rb +7 -74
- data/lib/scalar_api_ruby/resources/registry.rb +44 -16
- data/lib/scalar_api_ruby/resources/rules.rb +16 -8
- data/lib/scalar_api_ruby/resources/schemas/access_group.rb +6 -2
- data/lib/scalar_api_ruby/resources/schemas/version.rb +18 -8
- data/lib/scalar_api_ruby/resources/schemas.rb +6 -2
- data/lib/scalar_api_ruby/resources/sdks/repositories.rb +38 -6
- data/lib/scalar_api_ruby/resources/sdks/versions.rb +22 -5
- data/lib/scalar_api_ruby/resources/sdks.rb +45 -10
- data/lib/scalar_api_ruby/resources/themes.rb +1 -3
- data/lib/scalar_api_ruby/version.rb +1 -1
- data/lib/scalar_api_ruby.rb +4 -19
- data/rbi/scalar_api_ruby/client.rbi +5 -0
- data/rbi/scalar_api_ruby/errors.rbi +15 -27
- data/rbi/scalar_api_ruby/internal/transport/base_client.rbi +45 -54
- data/rbi/scalar_api_ruby/internal/transport/connection_pool.rbi +44 -0
- data/rbi/scalar_api_ruby/internal/transport/pooled_net_requester.rbi +14 -14
- data/rbi/scalar_api_ruby/internal/type/base_model.rbi +28 -35
- data/rbi/scalar_api_ruby/internal/type/converter.rbi +9 -30
- data/rbi/scalar_api_ruby/internal/type/enum.rbi +1 -5
- data/rbi/scalar_api_ruby/internal/type/request_parameters.rbi +1 -3
- data/rbi/scalar_api_ruby/internal/type/union.rbi +2 -9
- data/rbi/scalar_api_ruby/internal/util.rbi +101 -112
- data/rbi/scalar_api_ruby/internal.rbi +1 -2
- data/rbi/scalar_api_ruby/models/access_group_create_params.rbi +4 -4
- data/rbi/scalar_api_ruby/models/access_group_create_response.rbi +6 -6
- data/rbi/scalar_api_ruby/models/access_group_retrieve_response.rbi +6 -6
- data/rbi/scalar_api_ruby/models/api_document.rbi +3 -3
- data/rbi/scalar_api_ruby/models/docs_project.rbi +3 -3
- data/rbi/scalar_api_ruby/models/github_project.rbi +18 -6
- data/rbi/scalar_api_ruby/models/mcp/mcp_server.rbi +22 -16
- data/rbi/scalar_api_ruby/models/mcp/server_create_response.rbi +5 -19
- data/rbi/scalar_api_ruby/models/mcp/server_list_response.rbi +116 -1
- data/rbi/scalar_api_ruby/models/sdk.rbi +15 -9
- data/rbi/scalar_api_ruby/models/sdk_build_params.rbi +15 -1
- data/rbi/scalar_api_ruby/models/sdk_create_params.rbi +19 -6
- data/rbi/scalar_api_ruby/models/sdk_update_params.rbi +9 -4
- data/rbi/scalar_api_ruby/models/sdk_version.rbi +7 -52
- data/rbi/scalar_api_ruby/models/sdks/repository_link_params.rbi +59 -0
- data/rbi/scalar_api_ruby/models/sdks/repository_update_publishing_params.rbi +45 -0
- data/rbi/scalar_api_ruby/models/sdks/version_create_params.rbi +16 -6
- data/rbi/scalar_api_ruby/request_options.rbi +6 -8
- data/rbi/scalar_api_ruby/resources/access_groups.rbi +1 -1
- data/rbi/scalar_api_ruby/resources/mcp/servers.rbi +6 -51
- data/rbi/scalar_api_ruby/resources/sdks/repositories.rbi +28 -1
- data/rbi/scalar_api_ruby/resources/sdks/versions.rbi +21 -4
- data/rbi/scalar_api_ruby/resources/sdks.rbi +40 -10
- data/sig/scalar_api_ruby/client.rbs +2 -0
- data/sig/scalar_api_ruby/errors.rbs +6 -0
- data/sig/scalar_api_ruby/internal/transport/base_client.rbs +19 -1
- data/sig/scalar_api_ruby/internal/transport/connection_pool.rbs +19 -0
- data/sig/scalar_api_ruby/internal/transport/pooled_net_requester.rbs +11 -1
- data/sig/scalar_api_ruby/internal/type/base_model.rbs +4 -0
- data/sig/scalar_api_ruby/internal/util.rbs +29 -1
- data/sig/scalar_api_ruby/models/access_group_create_params.rbs +5 -5
- data/sig/scalar_api_ruby/models/access_group_create_response.rbs +8 -8
- data/sig/scalar_api_ruby/models/access_group_retrieve_response.rbs +8 -8
- data/sig/scalar_api_ruby/models/api_document.rbs +4 -4
- data/sig/scalar_api_ruby/models/docs_project.rbs +4 -4
- data/sig/scalar_api_ruby/models/github_project.rbs +17 -7
- data/sig/scalar_api_ruby/models/mcp/mcp_server.rbs +22 -17
- data/sig/scalar_api_ruby/models/mcp/server_create_response.rbs +3 -15
- data/sig/scalar_api_ruby/models/mcp/server_list_response.rbs +66 -1
- data/sig/scalar_api_ruby/models/sdk.rbs +13 -8
- data/sig/scalar_api_ruby/models/sdk_build_params.rbs +7 -0
- data/sig/scalar_api_ruby/models/sdk_create_params.rbs +9 -5
- data/sig/scalar_api_ruby/models/sdk_update_params.rbs +6 -4
- data/sig/scalar_api_ruby/models/sdk_version.rbs +7 -37
- data/sig/scalar_api_ruby/models/sdks/repository_link_params.rbs +21 -1
- data/sig/scalar_api_ruby/models/sdks/repository_update_publishing_params.rbs +36 -1
- data/sig/scalar_api_ruby/models/sdks/version_create_params.rbs +7 -5
- data/sig/scalar_api_ruby/resources/access_groups.rbs +1 -1
- data/sig/scalar_api_ruby/resources/mcp/servers.rbs +1 -20
- data/sig/scalar_api_ruby/resources/sdks/repositories.rbs +6 -0
- data/sig/scalar_api_ruby/resources/sdks/versions.rbs +1 -1
- data/sig/scalar_api_ruby/resources/sdks.rbs +3 -2
- metadata +8 -73
- data/lib/scalar_api_ruby/models/mcp/mcp_installation.rb +0 -75
- data/lib/scalar_api_ruby/models/mcp/server_delete_params.rb +0 -22
- data/lib/scalar_api_ruby/models/mcp/server_retrieve_params.rb +0 -22
- data/lib/scalar_api_ruby/models/mcp/server_update_params.rb +0 -52
- data/lib/scalar_api_ruby/models/mcp/servers/installation_create_access_group_params.rb +0 -36
- data/lib/scalar_api_ruby/models/mcp/servers/installation_create_params.rb +0 -44
- data/lib/scalar_api_ruby/models/mcp/servers/installation_delete_access_group_params.rb +0 -36
- data/lib/scalar_api_ruby/models/mcp/servers/installation_delete_params.rb +0 -30
- data/lib/scalar_api_ruby/models/mcp/servers/installation_list_params.rb +0 -24
- data/lib/scalar_api_ruby/models/mcp/servers/installation_list_response.rb +0 -13
- data/lib/scalar_api_ruby/models/mcp/servers/installation_retrieve_params.rb +0 -30
- data/lib/scalar_api_ruby/models/mcp/servers/installation_update_params.rb +0 -68
- data/lib/scalar_api_ruby/models/mcp/servers/mcp_installation_list_item.rb +0 -43
- data/lib/scalar_api_ruby/resources/mcp/servers/installations.rb +0 -200
- data/rbi/scalar_api_ruby/models/mcp/mcp_installation.rbi +0 -93
- data/rbi/scalar_api_ruby/models/mcp/server_delete_params.rbi +0 -37
- data/rbi/scalar_api_ruby/models/mcp/server_retrieve_params.rbi +0 -37
- data/rbi/scalar_api_ruby/models/mcp/server_update_params.rbi +0 -88
- data/rbi/scalar_api_ruby/models/mcp/servers/installation_create_access_group_params.rbi +0 -60
- data/rbi/scalar_api_ruby/models/mcp/servers/installation_create_params.rbi +0 -69
- data/rbi/scalar_api_ruby/models/mcp/servers/installation_delete_access_group_params.rbi +0 -60
- data/rbi/scalar_api_ruby/models/mcp/servers/installation_delete_params.rbi +0 -50
- data/rbi/scalar_api_ruby/models/mcp/servers/installation_list_params.rbi +0 -42
- data/rbi/scalar_api_ruby/models/mcp/servers/installation_list_response.rbi +0 -17
- data/rbi/scalar_api_ruby/models/mcp/servers/installation_retrieve_params.rbi +0 -50
- data/rbi/scalar_api_ruby/models/mcp/servers/installation_update_params.rbi +0 -102
- data/rbi/scalar_api_ruby/models/mcp/servers/mcp_installation_list_item.rbi +0 -60
- data/rbi/scalar_api_ruby/resources/mcp/servers/installations.rbi +0 -140
- data/sig/scalar_api_ruby/models/mcp/mcp_installation.rbs +0 -69
- data/sig/scalar_api_ruby/models/mcp/server_delete_params.rbs +0 -22
- data/sig/scalar_api_ruby/models/mcp/server_retrieve_params.rbs +0 -22
- data/sig/scalar_api_ruby/models/mcp/server_update_params.rbs +0 -63
- data/sig/scalar_api_ruby/models/mcp/servers/installation_create_access_group_params.rbs +0 -36
- data/sig/scalar_api_ruby/models/mcp/servers/installation_create_params.rbs +0 -47
- data/sig/scalar_api_ruby/models/mcp/servers/installation_delete_access_group_params.rbs +0 -36
- data/sig/scalar_api_ruby/models/mcp/servers/installation_delete_params.rbs +0 -32
- data/sig/scalar_api_ruby/models/mcp/servers/installation_list_params.rbs +0 -27
- data/sig/scalar_api_ruby/models/mcp/servers/installation_list_response.rbs +0 -12
- data/sig/scalar_api_ruby/models/mcp/servers/installation_retrieve_params.rbs +0 -32
- data/sig/scalar_api_ruby/models/mcp/servers/installation_update_params.rbs +0 -73
- data/sig/scalar_api_ruby/models/mcp/servers/mcp_installation_list_item.rbs +0 -44
- data/sig/scalar_api_ruby/resources/mcp/servers/installations.rbs +0 -62
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 01b5564034ac23e6e3acdfcee6756bd477803ee8d1d16aae1c01c6081739421a
|
|
4
|
+
data.tar.gz: 8e50ff960d4ba614d8aa9bec5543815d4f9886abff7f5a1ecc208b774dc0519a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd48203908350f9af51ea0f2fdc2b8545caae65a4dbc2e8d7e416f96d4132d799b0bd783ced2828c6d7bde535277e209a8f45355a680472431f9a44d24776416
|
|
7
|
+
data.tar.gz: dc7bf9db3cf02f274f2e97a0b2a59c3fdbad21d4f9d27f4f7d7f59cec1db4014467ef951c43dfbf0b89ec1ea806218a69a3801b537acef85c4c59bda9041bc67
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.0](https://github.com/scalar/scalar-ruby/compare/v0.2.0...v0.3.0) (2026-11-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* **api:** request-shape POST v1/sdks.languages — required in before only (review: direction-dependent; read the hunk)
|
|
9
|
+
* **api:** 18 breaking changes to the SDK surface.
|
|
10
|
+
- operation-coverage DELETE v1/mcp/servers/{p} — operation only in before (breaking: the new snapshot no longer has it)
|
|
11
|
+
- operation-coverage DELETE v1/mcp/servers/{p}/installations/{p} — operation only in before (breaking: the new snapshot no longer has it)
|
|
12
|
+
- operation-coverage DELETE v1/mcp/servers/{p}/installations/{p}/access-group — operation only in before (breaking: the new snapshot no longer has it)
|
|
13
|
+
- operation-coverage GET v1/mcp/servers/{p} — operation only in before (breaking: the new snapshot no longer has it)
|
|
14
|
+
- operation-coverage GET v1/mcp/servers/{p}/installations — operation only in before (breaking: the new snapshot no longer has it)
|
|
15
|
+
- operation-coverage GET v1/mcp/servers/{p}/installations/{p} — operation only in before (breaking: the new snapshot no longer has it)
|
|
16
|
+
- operation-coverage PATCH v1/mcp/servers/{p} — operation only in before (breaking: the new snapshot no longer has it)
|
|
17
|
+
- operation-coverage PATCH v1/mcp/servers/{p}/installations/{p} — operation only in before (breaking: the new snapshot no longer has it)
|
|
18
|
+
- operation-coverage POST v1/mcp/servers/{p}/installations/{p}/access-group — operation only in before (breaking: the new snapshot no longer has it)
|
|
19
|
+
- response-shape POST v1/mcp/servers→.server.id — field only in before (breaking: removed; uid, domain, namespace appeared in its place, likely a rename)
|
|
20
|
+
- response-shape POST v1/mcp/servers→.installation — field only in before (breaking: the new snapshot no longer has it)
|
|
21
|
+
- types-files Mcp::Servers — type file only in before (8 members: 0 matched by name and kind elsewhere in after, 8 not found) (breaking: removed; ServerListResponseItem appeared in its place, likely a rename)
|
|
22
|
+
- types-classes (top-level):McpInstallation — alias only in before (breaking: the new snapshot no longer has it)
|
|
23
|
+
- types-classes Mcp:McpInstallation — class only in before (breaking: removed; ServerListResponseItem appeared in its place, likely a rename)
|
|
24
|
+
- types-classes Mcp:ServerDeleteParams — class only in before (breaking: removed; ServerListResponseItem appeared in its place, likely a rename)
|
|
25
|
+
- types-classes Mcp:ServerRetrieveParams — class only in before (breaking: removed; ServerListResponseItem appeared in its place, likely a rename)
|
|
26
|
+
- types-classes Mcp:ServerUpdateParams — class only in before (breaking: removed; ServerListResponseItem appeared in its place, likely a rename)
|
|
27
|
+
- types-classes Mcp:Servers — module only in before (breaking: removed; ServerListResponseItem appeared in its place, likely a rename)
|
|
28
|
+
* **api:** 9 breaking changes to the SDK surface.
|
|
29
|
+
- Added required property `sdk.current`.
|
|
30
|
+
- Property `sdk.currentVersion` type changed from `version` to `string`.
|
|
31
|
+
- Added required property `sdk.latestVersion`.
|
|
32
|
+
- Removed optional property `sdk.apiVersion`.
|
|
33
|
+
- Property `sdk_version.version` type changed from `version` to `string`.
|
|
34
|
+
- Property `sdk_version.createdAt` is now required.
|
|
35
|
+
- Removed required property `sdk_version.apiVersion`.
|
|
36
|
+
- Removed required property `sdk_version.status`.
|
|
37
|
+
- Removed optional property `sdk_version.publishedAt`.
|
|
38
|
+
* **api:** Added required property `github_project.chatInsightsEnabled`.
|
|
39
|
+
* **api:** 3 breaking changes to the SDK surface.
|
|
40
|
+
- Property `api_document.tags` type changed from `string` to `unknown`.
|
|
41
|
+
- Property `github_project.accessGroups` type changed from `string` to `unknown`.
|
|
42
|
+
- Property `docs_project.accessGroups` type changed from `string` to `unknown`.
|
|
43
|
+
* **api:** 8 breaking changes to the SDK surface.
|
|
44
|
+
- Removed body field `autoAddOperations` from `mcp.servers.update`.
|
|
45
|
+
- Removed body field `isPrivate` from `mcp.servers.installations.update`.
|
|
46
|
+
- Removed body field `loginPortalUid` from `mcp.servers.installations.update`.
|
|
47
|
+
- Removed body field `documentAuth` from `mcp.servers.installations.update`.
|
|
48
|
+
- Removed operation `mcp.servers.installations.create` (`POST /v1/mcp/servers/{id}/installations`).
|
|
49
|
+
- Removed required property `mcp_server.autoAddOperations`.
|
|
50
|
+
- Removed required property `mcp_installation.isPrivate`.
|
|
51
|
+
- Removed required property `mcp_installation_list_item.isPrivate`.
|
|
52
|
+
|
|
53
|
+
### Features
|
|
54
|
+
|
|
55
|
+
* **api:** add property github_project.chatInsightsEnabled ([1acf1ad](https://github.com/scalar/scalar-ruby/commit/1acf1adc46ed34f558192d2f390a91c65e81b002))
|
|
56
|
+
* **api:** add property sdk.current (+9 more changes) ([08ed34e](https://github.com/scalar/scalar-ruby/commit/08ed34e0346e39f3c974c0e397f20571c2731830))
|
|
57
|
+
* **api:** update property api_document.tags (+3 more changes) ([cc500dd](https://github.com/scalar/scalar-ruby/commit/cc500dd9100311ce4fc7c9bc3324b376660b0dd2))
|
|
58
|
+
* **api:** update SDK surface (14 changes) ([637c4b1](https://github.com/scalar/scalar-ruby/commit/637c4b1ec12d07468051b91ce9d3e2f2a7a65cd9))
|
|
59
|
+
* **api:** update SDK surface (23 changes) ([b6bf4a4](https://github.com/scalar/scalar-ruby/commit/b6bf4a4f27d8588e61e7039527051317486c8356))
|
|
60
|
+
* **api:** update SDK surface (3 changes) ([5959802](https://github.com/scalar/scalar-ruby/commit/59598020add7766641907d6d9e55c240b8224b2f))
|
|
61
|
+
* **api:** update SDK surface (3 changes) ([b55255e](https://github.com/scalar/scalar-ruby/commit/b55255e63fc83b1c04db02d958734e018c5fcd46))
|
|
62
|
+
* **api:** update SDK surface (4 changes) ([3d717a5](https://github.com/scalar/scalar-ruby/commit/3d717a527d015d58902aa90c23acf4b9a2ef676c))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### Chores
|
|
66
|
+
|
|
67
|
+
* **api:** regenerate SDK ([10173ff](https://github.com/scalar/scalar-ruby/commit/10173ffe92ca9e057ea40860775b8532d8bef22a))
|
|
68
|
+
* **api:** regenerate SDK ([32b876c](https://github.com/scalar/scalar-ruby/commit/32b876c3d61a1931678d3b30de1a5608d324ebfe))
|
|
69
|
+
* **api:** regenerate SDK ([5834062](https://github.com/scalar/scalar-ruby/commit/58340624e19ec64e59b11426a79d5ff2eedf96fc))
|
|
70
|
+
* **api:** regenerate SDK ([ef2020a](https://github.com/scalar/scalar-ruby/commit/ef2020a155d2a459c1d5681803fb7ae27e32d6ab))
|
|
71
|
+
* **api:** update generated SDK content ([447bdd1](https://github.com/scalar/scalar-ruby/commit/447bdd11d61070d4bbb4a34a250240e4291cdd74))
|
|
72
|
+
* **api:** update generated SDK content ([c0790e6](https://github.com/scalar/scalar-ruby/commit/c0790e6e73dcebdfe0b1e74fbe618e19a610dfc7))
|
|
73
|
+
|
|
3
74
|
## [0.2.0](https://github.com/scalar/scalar-ruby/compare/v0.1.1...v0.2.0) (2026-10-09)
|
|
4
75
|
|
|
5
76
|
|
data/README.md
CHANGED
|
@@ -26,7 +26,7 @@ The full API of this library can be found in [api.md](./api.md).
|
|
|
26
26
|
Add the gem to your application's `Gemfile`:
|
|
27
27
|
|
|
28
28
|
```ruby
|
|
29
|
-
gem "scalar_api_ruby", "~> 0.
|
|
29
|
+
gem "scalar_api_ruby", "~> 0.3.0" # x-release-please-version
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Or install it directly:
|
|
@@ -84,6 +84,8 @@ begin
|
|
|
84
84
|
puts response.inspect
|
|
85
85
|
rescue Scalar::Errors::APIError => error
|
|
86
86
|
puts "#{error.status}: #{error.message}"
|
|
87
|
+
puts error.request_id if error.request_id
|
|
88
|
+
puts error.problem_details if error.problem_details
|
|
87
89
|
raise
|
|
88
90
|
end
|
|
89
91
|
```
|
|
@@ -112,7 +114,7 @@ client = Scalar::Client.new(
|
|
|
112
114
|
| `base_url` | `String \| nil` | `ENV["SCALAR_BASE_URL"]` | Override the default API base URL. |
|
|
113
115
|
| `max_retries` | `Integer` | `2` | Max number of retries to attempt after a failed retryable request. |
|
|
114
116
|
| `timeout` | `Float` | `60.0` | Seconds to wait for a response before timing out. |
|
|
115
|
-
| `initial_retry_delay` | `Float` | `0.5` |
|
|
117
|
+
| `initial_retry_delay` | `Float` | `0.5` | Base delay, in seconds, for retry backoff: the wait grows with the square of the retry count, so the first retry is sent right away. |
|
|
116
118
|
| `max_retry_delay` | `Float` | `8.0` | Upper bound, in seconds, on the delay between retries. |
|
|
117
119
|
|
|
118
120
|
<br />
|
|
@@ -121,7 +123,7 @@ client = Scalar::Client.new(
|
|
|
121
123
|
|
|
122
124
|
| Option | Type | Default | Description |
|
|
123
125
|
| --- | --- | --- | --- |
|
|
124
|
-
| `idempotency_key` | `String` | - | Idempotency key for one request
|
|
126
|
+
| `idempotency_key` | `String` | - | Idempotency key for one request. This SDK configures no idempotency header, so it is not sent. |
|
|
125
127
|
| `extra_query` | `Hash` | - | Additional query parameters for one request. |
|
|
126
128
|
| `extra_headers` | `Hash` | - | Additional headers for one request. |
|
|
127
129
|
| `extra_body` | `Hash` | - | Additional body fields for one request. |
|
data/SKILL.md
CHANGED
|
@@ -12,7 +12,7 @@ Generated Ruby client for Scalar API, published as `scalar_api_ruby`. Use the ge
|
|
|
12
12
|
Add the gem to your application's `Gemfile`:
|
|
13
13
|
|
|
14
14
|
```ruby
|
|
15
|
-
gem "scalar_api_ruby", "~> 0.
|
|
15
|
+
gem "scalar_api_ruby", "~> 0.3.0" # x-release-please-version
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
Or install it directly:
|
|
@@ -63,6 +63,8 @@ begin
|
|
|
63
63
|
puts response.inspect
|
|
64
64
|
rescue Scalar::Errors::APIError => error
|
|
65
65
|
puts "#{error.status}: #{error.message}"
|
|
66
|
+
puts error.request_id if error.request_id
|
|
67
|
+
puts error.problem_details if error.problem_details
|
|
66
68
|
raise
|
|
67
69
|
end
|
|
68
70
|
```
|
data/api.md
CHANGED
|
@@ -105,17 +105,6 @@ Complete reference of every operation, grouped by resource. See [the README](./R
|
|
|
105
105
|
- [`Mcp Servers`](#mcp-servers)
|
|
106
106
|
- [List all MCP servers](#list-all-mcp-servers)
|
|
107
107
|
- [Create an MCP server](#create-an-mcp-server)
|
|
108
|
-
- [Get an MCP server](#get-an-mcp-server)
|
|
109
|
-
- [Update an MCP server](#update-an-mcp-server)
|
|
110
|
-
- [Delete an MCP server](#delete-an-mcp-server)
|
|
111
|
-
- [`Mcp Servers Installations`](#mcp-servers-installations)
|
|
112
|
-
- [List installations](#list-installations)
|
|
113
|
-
- [Create an installation](#create-an-installation)
|
|
114
|
-
- [Get an installation](#get-an-installation)
|
|
115
|
-
- [Update an installation](#update-an-installation)
|
|
116
|
-
- [Delete an installation](#delete-an-installation)
|
|
117
|
-
- [Add an access group](#add-an-access-group)
|
|
118
|
-
- [Remove an access group](#remove-an-access-group)
|
|
119
108
|
|
|
120
109
|
## Setup
|
|
121
110
|
|
|
@@ -503,7 +492,7 @@ Create a login portal for the current team.
|
|
|
503
492
|
| Response | [`UID`](././lib/scalar_api_ruby/models/uid.rb) |
|
|
504
493
|
|
|
505
494
|
```ruby
|
|
506
|
-
response = client.login_portals.create({ email: { "logo" => "", "logoSize" => "100", "buttonText" => "Login", "message" => "Click to access private documentation hosted by scalar.com", "title" => "Private Docs", "mainColor" => "
|
|
495
|
+
response = client.login_portals.create({ email: { "logo" => "", "logoSize" => "100", "buttonText" => "Login", "message" => "Click to access private documentation hosted by scalar.com", "title" => "Private Docs", "mainColor" => "#2a2f45", "mainBackground" => "#f6f6f6", "cardColor" => "#2a2f45", "cardBackground" => "#fff", "buttonColor" => "#fff", "buttonBackground" => "#0f0f0f" }, page: { "title" => "Scalar Private Docs", "description" => "Login to access your documentation", "head" => "", "script" => "", "theme" => "", "companyName" => "", "logo" => "", "logoURL" => "", "favicon" => "", "termsLink" => "", "privacyLink" => "", "formTitle" => "Scalar Private Docs", "formDescription" => "Login to access your documentation", "formImage" => "" }, slug: "acme-login", title: "Acme Private Documentation" })
|
|
507
496
|
|
|
508
497
|
puts response.inspect
|
|
509
498
|
```
|
|
@@ -750,7 +739,7 @@ Create a team theme.
|
|
|
750
739
|
| Response | [`UID`](././lib/scalar_api_ruby/models/uid.rb) |
|
|
751
740
|
|
|
752
741
|
```ruby
|
|
753
|
-
response = client.themes.create({ document: ":root { --scalar-color-1:
|
|
742
|
+
response = client.themes.create({ document: ":root { --scalar-color-1: #1f2937; }", name: "Acme Theme", slug: "acme-theme", description: "API for managing Acme products and orders." })
|
|
754
743
|
|
|
755
744
|
puts response.inspect
|
|
756
745
|
```
|
|
@@ -778,7 +767,7 @@ Replace the theme document.
|
|
|
778
767
|
| Request | [`ThemeReplaceDocumentParams`](././lib/scalar_api_ruby/models/theme_replace_document_params.rb) |
|
|
779
768
|
|
|
780
769
|
```ruby
|
|
781
|
-
response = client.themes.replace_document("acme-theme", { document: ":root { --scalar-color-1:
|
|
770
|
+
response = client.themes.replace_document("acme-theme", { document: ":root { --scalar-color-1: #1f2937; }" })
|
|
782
771
|
|
|
783
772
|
puts response.inspect
|
|
784
773
|
```
|
|
@@ -1178,7 +1167,7 @@ SDKs
|
|
|
1178
1167
|
|
|
1179
1168
|
### List all SDKs
|
|
1180
1169
|
|
|
1181
|
-
List every SDK on the team.
|
|
1170
|
+
List every SDK on the team. `targets` are the languages its config declares, which the next build builds. `current` (the version label per language a request without a version serves) and each version label’s `languages`, highest label first, are what is served, and can include a language a later config dropped: a version keeps the languages its builds produced. Also returns the `currentVersion` and `latestVersion` tags.
|
|
1182
1171
|
|
|
1183
1172
|
| Direction | Type |
|
|
1184
1173
|
| --- | --- |
|
|
@@ -1193,7 +1182,7 @@ puts response.inspect
|
|
|
1193
1182
|
|
|
1194
1183
|
### Create an SDK
|
|
1195
1184
|
|
|
1196
|
-
Create an SDK from an API document
|
|
1185
|
+
Create an SDK from an existing API document on the team. Its current version must have content. Send languages or a config declaring targets; omit languages to derive them from config. SDK and target counts must fit the team plan. Config is a JSON string.
|
|
1197
1186
|
|
|
1198
1187
|
| Direction | Type |
|
|
1199
1188
|
| --- | --- |
|
|
@@ -1201,14 +1190,14 @@ Create an SDK from an API document, targeting one or more languages.
|
|
|
1201
1190
|
| Response | [`UID`](././lib/scalar_api_ruby/models/uid.rb) |
|
|
1202
1191
|
|
|
1203
1192
|
```ruby
|
|
1204
|
-
response = client.sdks.create({ api_uid: "UakgbKJ5m9gl0JDMbcJqL",
|
|
1193
|
+
response = client.sdks.create({ api_uid: "UakgbKJ5m9gl0JDMbcJqL", class_name: "Acme", config: "{\"targets\":{\"typescript\":{\"packageName\":\"@acme/sdk\"}}}", languages: ["typescript"], slug: "acme-api", title: "Acme SDK" })
|
|
1205
1194
|
|
|
1206
1195
|
puts response.inspect
|
|
1207
1196
|
```
|
|
1208
1197
|
|
|
1209
1198
|
### Get an SDK
|
|
1210
1199
|
|
|
1211
|
-
Get a single SDK by its uid.
|
|
1200
|
+
Get a single SDK by its uid. `targets` are the languages its config declares, which the next build builds. `current` (the version label per language a request without a version serves) and each version label’s `languages`, highest label first, are what is served, and can include a language a later config dropped: a version keeps the languages its builds produced. Also returns the `currentVersion` and `latestVersion` tags.
|
|
1212
1201
|
|
|
1213
1202
|
| Direction | Type |
|
|
1214
1203
|
| --- | --- |
|
|
@@ -1223,14 +1212,14 @@ puts response.inspect
|
|
|
1223
1212
|
|
|
1224
1213
|
### Update an SDK
|
|
1225
1214
|
|
|
1226
|
-
Update SDK metadata, its linked API, or its config.
|
|
1215
|
+
Update SDK metadata, its linked API, or its JSON-string config. Targets using native GitHub delivery need separate repositories; delivery writes each package at the repository root. Sharing a repository across language targets in this SDK and using reserved promote branches are rejected before config saves.
|
|
1227
1216
|
|
|
1228
1217
|
| Direction | Type |
|
|
1229
1218
|
| --- | --- |
|
|
1230
1219
|
| Request | [`SdkUpdateParams`](././lib/scalar_api_ruby/models/sdk_update_params.rb) |
|
|
1231
1220
|
|
|
1232
1221
|
```ruby
|
|
1233
|
-
response = client.sdks.update("UakgbKJ5m9gl0JDMbcJqL", { api_uid: "UakgbKJ5m9gl0JDMbcJqL", api_version:
|
|
1222
|
+
response = client.sdks.update("UakgbKJ5m9gl0JDMbcJqL", { api_uid: "UakgbKJ5m9gl0JDMbcJqL", api_version: { }, config: "{\"targets\":{\"typescript\":{\"packageName\":\"@acme/sdk\"}}}", is_private: false, slug: "acme-api", title: "Acme SDK" })
|
|
1234
1223
|
|
|
1235
1224
|
puts response.inspect
|
|
1236
1225
|
```
|
|
@@ -1251,7 +1240,7 @@ puts response.inspect
|
|
|
1251
1240
|
|
|
1252
1241
|
### Build an SDK
|
|
1253
1242
|
|
|
1254
|
-
Start a build.
|
|
1243
|
+
Start a build with the SDK's saved config. Every input is optional: `version` is the version of the linked API description to build (default: its latest version), `customCodeRef` the branch, tag or commit each language merges as custom code (default: each language's `scalar-next` branch), and `languages` the languages to build (default: every language the config declares). The response names the version built. A 503 means the custom code could not be read from GitHub and nothing was built; try again.
|
|
1255
1244
|
|
|
1256
1245
|
| Direction | Type |
|
|
1257
1246
|
| --- | --- |
|
|
@@ -1259,7 +1248,7 @@ Start a build. Omit `version` to build the current work — the open draft, else
|
|
|
1259
1248
|
| Response | [`SdkBuildResponse`](././lib/scalar_api_ruby/models/sdk_build_response.rb) |
|
|
1260
1249
|
|
|
1261
1250
|
```ruby
|
|
1262
|
-
response = client.sdks.build("UakgbKJ5m9gl0JDMbcJqL", { languages: ["typescript"], version: "1.2.0" })
|
|
1251
|
+
response = client.sdks.build("UakgbKJ5m9gl0JDMbcJqL", { custom_code_ref: "scalar-next", languages: ["typescript"], version: "1.2.0" })
|
|
1263
1252
|
|
|
1264
1253
|
puts response.inspect
|
|
1265
1254
|
```
|
|
@@ -1270,21 +1259,21 @@ SDKs
|
|
|
1270
1259
|
|
|
1271
1260
|
#### Create an SDK version
|
|
1272
1261
|
|
|
1273
|
-
Create a
|
|
1262
|
+
Create a version label from a version of the SDK's API document and start its build. The label is the document version, and it becomes `latestVersion` when it is the highest.
|
|
1274
1263
|
|
|
1275
1264
|
| Direction | Type |
|
|
1276
1265
|
| --- | --- |
|
|
1277
1266
|
| Request | [`VersionCreateParams`](././lib/scalar_api_ruby/models/sdks/version_create_params.rb) |
|
|
1278
1267
|
|
|
1279
1268
|
```ruby
|
|
1280
|
-
response = client.sdks.versions.create("UakgbKJ5m9gl0JDMbcJqL", {
|
|
1269
|
+
response = client.sdks.versions.create("UakgbKJ5m9gl0JDMbcJqL", { version: "1.2.0", api_version: { } })
|
|
1281
1270
|
|
|
1282
1271
|
puts response.inspect
|
|
1283
1272
|
```
|
|
1284
1273
|
|
|
1285
1274
|
#### Delete an SDK version
|
|
1286
1275
|
|
|
1287
|
-
Permanently delete one version of an SDK.
|
|
1276
|
+
Permanently delete one version label of an SDK and its builds. A label that is the current build of any language promoting manually is refused with 409 and nothing is deleted; promote or roll back to another build for that language first. Each other language whose current build was of that label moves to the active build of the highest remaining label that has one for the language, and has no current build when none has; `currentVersion` shows the result. Each language that moved to another build syncs it to its linked repository unless the repository already holds it. When it was `latestVersion`, that tag moves to the highest remaining label holding an active build. An SDK's last version cannot be deleted.
|
|
1288
1277
|
|
|
1289
1278
|
| Direction | Type |
|
|
1290
1279
|
| --- | --- |
|
|
@@ -1302,7 +1291,7 @@ SDKs
|
|
|
1302
1291
|
|
|
1303
1292
|
#### Link a repository
|
|
1304
1293
|
|
|
1305
|
-
Link
|
|
1294
|
+
Link an existing language target to a GitHub repository accessible through the Scalar GitHub App. Requires team edit permission and a paid SDK automation plan. Native delivery writes at the repository root; use a separate repository for each target. Directory fields are unsupported. Linking can immediately sync the current build under automatic promotion; pass promotion: manual to hold it back. If GitHub access is missing, connect GitHub and grant the App access in Scalar Dashboard before retrying.
|
|
1306
1295
|
|
|
1307
1296
|
| Direction | Type |
|
|
1308
1297
|
| --- | --- |
|
|
@@ -1310,7 +1299,7 @@ Link one language target to a GitHub repository, so builds sync there.
|
|
|
1310
1299
|
| Response | [`Sdks::RepositoryLinkResponse`](././lib/scalar_api_ruby/models/sdks/repository_link_response.rb) |
|
|
1311
1300
|
|
|
1312
1301
|
```ruby
|
|
1313
|
-
response = client.sdks.repositories.link("UakgbKJ5m9gl0JDMbcJqL", { base_branch: "main", language: "typescript", repository_id: 123456789, prerelease_type: "beta" })
|
|
1302
|
+
response = client.sdks.repositories.link("UakgbKJ5m9gl0JDMbcJqL", { base_branch: "main", language: "typescript", repository_id: 123456789, prerelease_type: "beta", promotion: "automatic" })
|
|
1314
1303
|
|
|
1315
1304
|
puts response.inspect
|
|
1316
1305
|
```
|
|
@@ -1338,7 +1327,7 @@ Toggle publish-on-merge and the release settings for a linked target.
|
|
|
1338
1327
|
| Request | [`RepositoryUpdatePublishingParams`](././lib/scalar_api_ruby/models/sdks/repository_update_publishing_params.rb) |
|
|
1339
1328
|
|
|
1340
1329
|
```ruby
|
|
1341
|
-
response = client.sdks.repositories.update_publishing("typescript", { uid: "UakgbKJ5m9gl0JDMbcJqL", publish_on_merge: true, access: "public", auth_method: "oidc", tag: "latest" })
|
|
1330
|
+
response = client.sdks.repositories.update_publishing("typescript", { uid: "UakgbKJ5m9gl0JDMbcJqL", publish_on_merge: true, access: "public", artifact_id: "scalar-galaxy", auth_method: "oidc", cask: true, registry: "npm", replace_formula: false, tag: "latest", tap_repo: "scalar/homebrew-tap" })
|
|
1342
1331
|
|
|
1343
1332
|
puts response.inspect
|
|
1344
1333
|
```
|
|
@@ -1351,12 +1340,12 @@ MCP
|
|
|
1351
1340
|
|
|
1352
1341
|
#### List all MCP servers
|
|
1353
1342
|
|
|
1354
|
-
List every MCP server on the team.
|
|
1343
|
+
List every MCP server on the team, each with its environments and the version tag a request that names no version gets there.
|
|
1355
1344
|
|
|
1356
1345
|
| Direction | Type |
|
|
1357
1346
|
| --- | --- |
|
|
1358
1347
|
| Request | [`ServerListParams`](././lib/scalar_api_ruby/models/mcp/server_list_params.rb) |
|
|
1359
|
-
| Response | [`Mcp::
|
|
1348
|
+
| Response | [`Mcp::ServerListResponseItem`](././lib/scalar_api_ruby/models/mcp/server_list_response.rb) |
|
|
1360
1349
|
|
|
1361
1350
|
```ruby
|
|
1362
1351
|
response = client.mcp.servers.list
|
|
@@ -1366,7 +1355,7 @@ puts response.inspect
|
|
|
1366
1355
|
|
|
1367
1356
|
#### Create an MCP server
|
|
1368
1357
|
|
|
1369
|
-
Create an MCP server
|
|
1358
|
+
Create an MCP server linking the API documents of the named versions and the named docs projects. The server builds from each linked document’s versions, not only the version named.
|
|
1370
1359
|
|
|
1371
1360
|
| Direction | Type |
|
|
1372
1361
|
| --- | --- |
|
|
@@ -1378,153 +1367,3 @@ response = client.mcp.servers.create({ name: "Acme MCP", project_uids: [""], slu
|
|
|
1378
1367
|
|
|
1379
1368
|
puts response.inspect
|
|
1380
1369
|
```
|
|
1381
|
-
|
|
1382
|
-
#### Get an MCP server
|
|
1383
|
-
|
|
1384
|
-
Get a single MCP server by its id.
|
|
1385
|
-
|
|
1386
|
-
| Direction | Type |
|
|
1387
|
-
| --- | --- |
|
|
1388
|
-
| Request | [`ServerRetrieveParams`](././lib/scalar_api_ruby/models/mcp/server_retrieve_params.rb) |
|
|
1389
|
-
| Response | [`Mcp::McpServer`](././lib/scalar_api_ruby/models/mcp/mcp_server.rb) |
|
|
1390
|
-
|
|
1391
|
-
```ruby
|
|
1392
|
-
response = client.mcp.servers.retrieve("42")
|
|
1393
|
-
|
|
1394
|
-
puts response.inspect
|
|
1395
|
-
```
|
|
1396
|
-
|
|
1397
|
-
#### Update an MCP server
|
|
1398
|
-
|
|
1399
|
-
Update MCP server metadata and which tools it exposes.
|
|
1400
|
-
|
|
1401
|
-
| Direction | Type |
|
|
1402
|
-
| --- | --- |
|
|
1403
|
-
| Request | [`ServerUpdateParams`](././lib/scalar_api_ruby/models/mcp/server_update_params.rb) |
|
|
1404
|
-
| Response | [`Mcp::McpServer`](././lib/scalar_api_ruby/models/mcp/mcp_server.rb) |
|
|
1405
|
-
|
|
1406
|
-
```ruby
|
|
1407
|
-
response = client.mcp.servers.update("42", { auto_add_operations: true, docs_pages: [""], name: "Acme MCP", operations: [""], slug: "acme-api" })
|
|
1408
|
-
|
|
1409
|
-
puts response.inspect
|
|
1410
|
-
```
|
|
1411
|
-
|
|
1412
|
-
#### Delete an MCP server
|
|
1413
|
-
|
|
1414
|
-
Delete an MCP server and every installation it serves.
|
|
1415
|
-
|
|
1416
|
-
| Direction | Type |
|
|
1417
|
-
| --- | --- |
|
|
1418
|
-
| Request | [`ServerDeleteParams`](././lib/scalar_api_ruby/models/mcp/server_delete_params.rb) |
|
|
1419
|
-
|
|
1420
|
-
```ruby
|
|
1421
|
-
response = client.mcp.servers.delete("42")
|
|
1422
|
-
|
|
1423
|
-
puts response.inspect
|
|
1424
|
-
```
|
|
1425
|
-
|
|
1426
|
-
#### `Mcp Servers Installations`
|
|
1427
|
-
|
|
1428
|
-
MCP
|
|
1429
|
-
|
|
1430
|
-
##### List installations
|
|
1431
|
-
|
|
1432
|
-
List the installations of an MCP server. An installation is what an MCP client connects to.
|
|
1433
|
-
|
|
1434
|
-
| Direction | Type |
|
|
1435
|
-
| --- | --- |
|
|
1436
|
-
| Request | [`InstallationListParams`](././lib/scalar_api_ruby/models/mcp/servers/installation_list_params.rb) |
|
|
1437
|
-
| Response | [`Mcp::Servers::McpInstallationListItem`](././lib/scalar_api_ruby/models/mcp/servers/mcp_installation_list_item.rb) |
|
|
1438
|
-
|
|
1439
|
-
```ruby
|
|
1440
|
-
response = client.mcp.servers.installations.list("42")
|
|
1441
|
-
|
|
1442
|
-
puts response.inspect
|
|
1443
|
-
```
|
|
1444
|
-
|
|
1445
|
-
##### Create an installation
|
|
1446
|
-
|
|
1447
|
-
Create an installation of an MCP server. `documentAuth` holds the credentials the server presents to the upstream API and is never returned.
|
|
1448
|
-
|
|
1449
|
-
| Direction | Type |
|
|
1450
|
-
| --- | --- |
|
|
1451
|
-
| Request | [`InstallationCreateParams`](././lib/scalar_api_ruby/models/mcp/servers/installation_create_params.rb) |
|
|
1452
|
-
| Response | [`Mcp::McpInstallation`](././lib/scalar_api_ruby/models/mcp/mcp_installation.rb) |
|
|
1453
|
-
|
|
1454
|
-
```ruby
|
|
1455
|
-
response = client.mcp.servers.installations.create("42", { document_auth: { }, name: "Acme MCP", slug: "acme-api" })
|
|
1456
|
-
|
|
1457
|
-
puts response.inspect
|
|
1458
|
-
```
|
|
1459
|
-
|
|
1460
|
-
##### Get an installation
|
|
1461
|
-
|
|
1462
|
-
Get a single installation of an MCP server.
|
|
1463
|
-
|
|
1464
|
-
| Direction | Type |
|
|
1465
|
-
| --- | --- |
|
|
1466
|
-
| Request | [`InstallationRetrieveParams`](././lib/scalar_api_ruby/models/mcp/servers/installation_retrieve_params.rb) |
|
|
1467
|
-
| Response | [`Mcp::McpInstallation`](././lib/scalar_api_ruby/models/mcp/mcp_installation.rb) |
|
|
1468
|
-
|
|
1469
|
-
```ruby
|
|
1470
|
-
response = client.mcp.servers.installations.retrieve("84", { id: "42" })
|
|
1471
|
-
|
|
1472
|
-
puts response.inspect
|
|
1473
|
-
```
|
|
1474
|
-
|
|
1475
|
-
##### Update an installation
|
|
1476
|
-
|
|
1477
|
-
Update an installation. Set `isPrivate` and add access groups to put it behind a login.
|
|
1478
|
-
|
|
1479
|
-
| Direction | Type |
|
|
1480
|
-
| --- | --- |
|
|
1481
|
-
| Request | [`InstallationUpdateParams`](././lib/scalar_api_ruby/models/mcp/servers/installation_update_params.rb) |
|
|
1482
|
-
| Response | [`Mcp::McpInstallation`](././lib/scalar_api_ruby/models/mcp/mcp_installation.rb) |
|
|
1483
|
-
|
|
1484
|
-
```ruby
|
|
1485
|
-
response = client.mcp.servers.installations.update("84", { id: "42", document_auth: { }, is_private: false, login_portal_uid: "", mcp_version: "", name: "Acme MCP", slug: "acme-api" })
|
|
1486
|
-
|
|
1487
|
-
puts response.inspect
|
|
1488
|
-
```
|
|
1489
|
-
|
|
1490
|
-
##### Delete an installation
|
|
1491
|
-
|
|
1492
|
-
Delete an installation of an MCP server.
|
|
1493
|
-
|
|
1494
|
-
| Direction | Type |
|
|
1495
|
-
| --- | --- |
|
|
1496
|
-
| Request | [`InstallationDeleteParams`](././lib/scalar_api_ruby/models/mcp/servers/installation_delete_params.rb) |
|
|
1497
|
-
|
|
1498
|
-
```ruby
|
|
1499
|
-
response = client.mcp.servers.installations.delete("84", { id: "42" })
|
|
1500
|
-
|
|
1501
|
-
puts response.inspect
|
|
1502
|
-
```
|
|
1503
|
-
|
|
1504
|
-
##### Add an access group
|
|
1505
|
-
|
|
1506
|
-
Let an access group reach a private installation.
|
|
1507
|
-
|
|
1508
|
-
| Direction | Type |
|
|
1509
|
-
| --- | --- |
|
|
1510
|
-
| Request | [`InstallationCreateAccessGroupParams`](././lib/scalar_api_ruby/models/mcp/servers/installation_create_access_group_params.rb) |
|
|
1511
|
-
|
|
1512
|
-
```ruby
|
|
1513
|
-
response = client.mcp.servers.installations.create_access_group("84", { id: "42", access_group_uid: "UakgbKJ5m9gl0JDMbcJqL" })
|
|
1514
|
-
|
|
1515
|
-
puts response.inspect
|
|
1516
|
-
```
|
|
1517
|
-
|
|
1518
|
-
##### Remove an access group
|
|
1519
|
-
|
|
1520
|
-
Stop an access group reaching a private installation.
|
|
1521
|
-
|
|
1522
|
-
| Direction | Type |
|
|
1523
|
-
| --- | --- |
|
|
1524
|
-
| Request | [`InstallationDeleteAccessGroupParams`](././lib/scalar_api_ruby/models/mcp/servers/installation_delete_access_group_params.rb) |
|
|
1525
|
-
|
|
1526
|
-
```ruby
|
|
1527
|
-
response = client.mcp.servers.installations.delete_access_group("84", { id: "42", access_group_uid: "UakgbKJ5m9gl0JDMbcJqL" })
|
|
1528
|
-
|
|
1529
|
-
puts response.inspect
|
|
1530
|
-
```
|
|
@@ -79,6 +79,8 @@ module Scalar
|
|
|
79
79
|
#
|
|
80
80
|
# @return [Hash{String=>String}]
|
|
81
81
|
private def auth_bearer_auth
|
|
82
|
+
return {} if @bearer_auth.to_s.empty?
|
|
83
|
+
|
|
82
84
|
{"authorization" => "Bearer #{@bearer_auth}"}
|
|
83
85
|
end
|
|
84
86
|
|
|
@@ -86,9 +88,16 @@ module Scalar
|
|
|
86
88
|
#
|
|
87
89
|
# @return [Hash{String=>String}]
|
|
88
90
|
private def auth_o_auth2
|
|
91
|
+
return {} if @o_auth2.to_s.empty?
|
|
92
|
+
|
|
89
93
|
{"authorization" => "Bearer #{@o_auth2}"}
|
|
90
94
|
end
|
|
91
95
|
|
|
96
|
+
# @api private
|
|
97
|
+
#
|
|
98
|
+
# @return [Array<String>]
|
|
99
|
+
private def auth_header_keys = ["authorization"]
|
|
100
|
+
|
|
92
101
|
# Creates and returns a new client for interacting with the API.
|
|
93
102
|
#
|
|
94
103
|
# @param bearer_auth [String, nil] Defaults to `ENV["BEARER_AUTH"]`
|
|
@@ -120,12 +129,12 @@ module Scalar
|
|
|
120
129
|
custom_headers_env = ENV["SCALAR_CUSTOM_HEADERS"]
|
|
121
130
|
unless custom_headers_env.nil?
|
|
122
131
|
parsed = {}
|
|
123
|
-
custom_headers_env
|
|
124
|
-
.
|
|
125
|
-
.
|
|
126
|
-
colon = line
|
|
127
|
-
parsed[line[0...colon].strip] = line[(colon + 1)..].strip unless colon.nil?
|
|
132
|
+
custom_headers_env.split("\n").each do |line|
|
|
133
|
+
colon = line.index(":")
|
|
134
|
+
unless colon.nil?
|
|
135
|
+
parsed[line[0...colon].strip] = line[(colon + 1)..].strip
|
|
128
136
|
end
|
|
137
|
+
end
|
|
129
138
|
headers = parsed.merge(headers)
|
|
130
139
|
end
|
|
131
140
|
|
|
@@ -46,6 +46,28 @@ module Scalar
|
|
|
46
46
|
# @return [Object, nil]
|
|
47
47
|
attr_accessor :body
|
|
48
48
|
|
|
49
|
+
# Request identifier exposed by common API response headers, matched case-insensitively.
|
|
50
|
+
# @return [String, nil]
|
|
51
|
+
def request_id
|
|
52
|
+
response_header("x-request-id") || response_header("request-id") ||
|
|
53
|
+
response_header("x-correlation-id")
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Parsed RFC 7807 body for application/problem+json responses, preserving extension fields.
|
|
57
|
+
# Non-object bodies and other media types are not treated as Problem Details.
|
|
58
|
+
# @return [Hash{String, Symbol=>Object}, nil]
|
|
59
|
+
def problem_details
|
|
60
|
+
media_type = response_header("content-type").to_s.split(";", 2).first.to_s.strip.downcase
|
|
61
|
+
@body if media_type == "application/problem+json" && @body.is_a?(Hash)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Header maps supplied directly by callers need not use the transport's lowercase spelling.
|
|
65
|
+
# @param name [String]
|
|
66
|
+
# @return [String, nil]
|
|
67
|
+
private def response_header(name)
|
|
68
|
+
@headers&.find { |key, _| key.to_s.downcase == name }&.last
|
|
69
|
+
end
|
|
70
|
+
|
|
49
71
|
# @api private
|
|
50
72
|
#
|
|
51
73
|
# @param url [URI::Generic]
|
|
@@ -37,10 +37,22 @@ module Scalar
|
|
|
37
37
|
# @return [String]
|
|
38
38
|
def to_yaml(*a) = read.to_yaml(*a)
|
|
39
39
|
|
|
40
|
+
# The filename sent for a part is only ever a basename: an open `File` knows the full local path
|
|
41
|
+
# it was opened from, which is the caller's business and not the server's.
|
|
42
|
+
#
|
|
43
|
+
# The content type is written into the part's headers as given, so one carrying a control
|
|
44
|
+
# character (a CR or LF would start a header line of its own) is refused here, before any request.
|
|
45
|
+
#
|
|
40
46
|
# @param content [Pathname, StringIO, IO, String]
|
|
41
47
|
# @param filename [Pathname, String, nil]
|
|
42
48
|
# @param content_type [String, nil]
|
|
49
|
+
#
|
|
50
|
+
# @raise [ArgumentError] when `content_type` contains a control character
|
|
43
51
|
def initialize(content, filename: nil, content_type: nil)
|
|
52
|
+
if content_type&.to_s&.match?(/[\x00-\x1F\x7F]/)
|
|
53
|
+
raise ArgumentError.new("The content type #{content_type.inspect} contains a control character.")
|
|
54
|
+
end
|
|
55
|
+
|
|
44
56
|
@content_type = content_type
|
|
45
57
|
@filename =
|
|
46
58
|
case [filename, (@content = content)]
|
|
@@ -49,7 +61,7 @@ module Scalar
|
|
|
49
61
|
in [nil, Pathname]
|
|
50
62
|
content.basename.to_path
|
|
51
63
|
in [nil, IO]
|
|
52
|
-
content.to_path
|
|
64
|
+
content.respond_to?(:to_path) ? ::File.basename(content.to_path) : nil
|
|
53
65
|
else
|
|
54
66
|
filename
|
|
55
67
|
end
|