knievel 0.1.5 → 0.1.16
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/Gemfile.lock +1 -1
- data/README.md +12 -6
- data/docs/AuthApi.md +72 -0
- data/docs/OrgResponse.md +30 -0
- data/docs/OrgsApi.md +144 -0
- data/docs/ProjectList.md +20 -0
- data/docs/SitesApi.md +1 -1
- data/docs/WhoamiResponse.md +28 -0
- data/knievel.gemspec +1 -1
- data/lib/knievel/api/ad_library_api.rb +1 -1
- data/lib/knievel/api/ads_api.rb +1 -1
- data/lib/knievel/api/advertisers_api.rb +1 -1
- data/lib/knievel/api/auth_api.rb +75 -0
- data/lib/knievel/api/campaigns_api.rb +1 -1
- data/lib/knievel/api/creative_templates_api.rb +1 -1
- data/lib/knievel/api/creatives_api.rb +1 -1
- data/lib/knievel/api/decisions_api.rb +1 -1
- data/lib/knievel/api/explain_api.rb +1 -1
- data/lib/knievel/api/flights_api.rb +1 -1
- data/lib/knievel/api/orgs_api.rb +132 -2
- data/lib/knievel/api/sites_api.rb +2 -2
- data/lib/knievel/api/system_api.rb +1 -1
- data/lib/knievel/api/taxonomy_api.rb +1 -1
- data/lib/knievel/api/tokens_api.rb +1 -1
- data/lib/knievel/api/zones_api.rb +1 -1
- data/lib/knievel/api_client.rb +1 -1
- data/lib/knievel/api_error.rb +1 -1
- data/lib/knievel/api_model_base.rb +1 -1
- data/lib/knievel/auth/jwt_file_token_source.rb +51 -0
- data/lib/knievel/configuration.rb +1 -1
- data/lib/knievel/configuration_ext.rb +60 -0
- data/lib/knievel/models/ad.rb +1 -1
- data/lib/knievel/models/ad_library_item.rb +1 -1
- data/lib/knievel/models/ad_library_item_list.rb +1 -1
- data/lib/knievel/models/ad_list.rb +1 -1
- data/lib/knievel/models/ad_type.rb +1 -1
- data/lib/knievel/models/ad_type_list.rb +1 -1
- data/lib/knievel/models/advertiser.rb +1 -1
- data/lib/knievel/models/advertiser_list.rb +1 -1
- data/lib/knievel/models/auth_block.rb +1 -1
- data/lib/knievel/models/batch_error_body.rb +1 -1
- data/lib/knievel/models/batch_error_detail.rb +1 -1
- data/lib/knievel/models/batch_error_envelope.rb +1 -1
- data/lib/knievel/models/batch_upsert_ad_row.rb +1 -1
- data/lib/knievel/models/batch_upsert_ads_request.rb +1 -1
- data/lib/knievel/models/batch_upsert_ads_result.rb +1 -1
- data/lib/knievel/models/batch_upsert_advertiser_row.rb +1 -1
- data/lib/knievel/models/batch_upsert_advertisers_request.rb +1 -1
- data/lib/knievel/models/batch_upsert_advertisers_result.rb +1 -1
- data/lib/knievel/models/batch_upsert_campaign_row.rb +1 -1
- data/lib/knievel/models/batch_upsert_campaigns_request.rb +1 -1
- data/lib/knievel/models/batch_upsert_campaigns_result.rb +1 -1
- data/lib/knievel/models/batch_upsert_flight_row.rb +1 -1
- data/lib/knievel/models/batch_upsert_flights_request.rb +1 -1
- data/lib/knievel/models/batch_upsert_flights_result.rb +1 -1
- data/lib/knievel/models/batch_upsert_site_row.rb +1 -1
- data/lib/knievel/models/batch_upsert_sites_request.rb +1 -1
- data/lib/knievel/models/batch_upsert_sites_result.rb +1 -1
- data/lib/knievel/models/batch_upsert_zone_row.rb +1 -1
- data/lib/knievel/models/batch_upsert_zones_request.rb +1 -1
- data/lib/knievel/models/batch_upsert_zones_result.rb +1 -1
- data/lib/knievel/models/campaign.rb +1 -1
- data/lib/knievel/models/campaign_list.rb +1 -1
- data/lib/knievel/models/channel.rb +1 -1
- data/lib/knievel/models/channel_list.rb +1 -1
- data/lib/knievel/models/create_ad_library_item_request.rb +1 -1
- data/lib/knievel/models/create_ad_request.rb +1 -1
- data/lib/knievel/models/create_advertiser_request.rb +1 -1
- data/lib/knievel/models/create_campaign_request.rb +1 -1
- data/lib/knievel/models/create_creative_request.rb +1 -1
- data/lib/knievel/models/create_creative_template_request.rb +1 -1
- data/lib/knievel/models/create_flight_request.rb +1 -1
- data/lib/knievel/models/create_project_request.rb +1 -1
- data/lib/knievel/models/create_site_request.rb +1 -1
- data/lib/knievel/models/create_token_request.rb +1 -1
- data/lib/knievel/models/create_token_response.rb +1 -1
- data/lib/knievel/models/create_zone_request.rb +1 -1
- data/lib/knievel/models/creative.rb +1 -1
- data/lib/knievel/models/creative_list.rb +1 -1
- data/lib/knievel/models/creative_template.rb +1 -1
- data/lib/knievel/models/creative_template_list.rb +1 -1
- data/lib/knievel/models/decision_ad.rb +1 -1
- data/lib/knievel/models/decision_block.rb +1 -1
- data/lib/knievel/models/decision_context.rb +1 -1
- data/lib/knievel/models/decision_placement.rb +1 -1
- data/lib/knievel/models/decisions_request.rb +1 -1
- data/lib/knievel/models/decisions_response.rb +1 -1
- data/lib/knievel/models/error_body.rb +1 -1
- data/lib/knievel/models/error_envelope.rb +1 -1
- data/lib/knievel/models/explain_candidate.rb +1 -1
- data/lib/knievel/models/explain_evaluation.rb +1 -1
- data/lib/knievel/models/explain_placement.rb +1 -1
- data/lib/knievel/models/explain_response.rb +1 -1
- data/lib/knievel/models/flight.rb +1 -1
- data/lib/knievel/models/flight_list.rb +1 -1
- data/lib/knievel/models/force_override.rb +1 -1
- data/lib/knievel/models/issuer_summary.rb +1 -1
- data/lib/knievel/models/org_response.rb +304 -0
- data/lib/knievel/models/priority.rb +1 -1
- data/lib/knievel/models/priority_list.rb +1 -1
- data/lib/knievel/models/project_list.rb +176 -0
- data/lib/knievel/models/project_response.rb +1 -1
- data/lib/knievel/models/site.rb +1 -1
- data/lib/knievel/models/site_list.rb +1 -1
- data/lib/knievel/models/token_list_response.rb +1 -1
- data/lib/knievel/models/token_summary.rb +1 -1
- data/lib/knievel/models/update_ad_library_item_request.rb +1 -1
- data/lib/knievel/models/update_ad_request.rb +1 -1
- data/lib/knievel/models/update_advertiser_request.rb +1 -1
- data/lib/knievel/models/update_campaign_request.rb +1 -1
- data/lib/knievel/models/update_creative_template_request.rb +1 -1
- data/lib/knievel/models/update_flight_request.rb +1 -1
- data/lib/knievel/models/update_site_request.rb +1 -1
- data/lib/knievel/models/update_zone_request.rb +1 -1
- data/lib/knievel/models/upsert_site_by_url_request.rb +1 -1
- data/lib/knievel/models/version_response.rb +1 -1
- data/lib/knievel/models/whoami_response.rb +282 -0
- data/lib/knievel/models/zone.rb +1 -1
- data/lib/knievel/models/zone_list.rb +1 -1
- data/lib/knievel/resources/advertisers.rb +15 -0
- data/lib/knievel/resources/upsertable.rb +36 -0
- data/lib/knievel/version.rb +2 -2
- data/lib/knievel.rb +5 -1
- data/spec/api/auth_api_spec.rb +44 -0
- data/spec/models/org_response_spec.rb +72 -0
- data/spec/models/project_list_spec.rb +42 -0
- data/spec/models/whoami_response_spec.rb +66 -0
- data/spec/spec_helper.rb +1 -1
- metadata +21 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b5e20d2437c7c20eed46f84821e680e18a1d43af461b1e6fb61c8c5bfe3d041
|
|
4
|
+
data.tar.gz: 50e284d67ed918e566eb4726ac688e037dadbdbc207c4bbd044304de064a5a4f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cb6958d73ea00e29b1dbb45c4ea9c4a57dccbb378eaa958feb0fb51d02c9043fda49668353071049a16eac3f2a66f8175e7401c4203a0bca6d3f577332cab872
|
|
7
|
+
data.tar.gz: c88873f9647f931f3d6135b0edfe586744490f20f86a92480ccfbd5d3e6307c565279a8f309f46695c7da9916759d5cff69f0ce60248bf1fe13240bfe8a91716
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -6,8 +6,8 @@ No description provided (generated by Openapi Generator https://github.com/opena
|
|
|
6
6
|
|
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
8
8
|
|
|
9
|
-
- API version: 0.1.
|
|
10
|
-
- Package version: 0.1.
|
|
9
|
+
- API version: 0.1.16
|
|
10
|
+
- Package version: 0.1.16
|
|
11
11
|
- Generator version: 7.23.0-SNAPSHOT
|
|
12
12
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
|
13
13
|
|
|
@@ -24,16 +24,16 @@ gem build knievel.gemspec
|
|
|
24
24
|
Then either install the gem locally:
|
|
25
25
|
|
|
26
26
|
```shell
|
|
27
|
-
gem install ./knievel-0.1.
|
|
27
|
+
gem install ./knievel-0.1.16.gem
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
(for development, run `gem install --dev ./knievel-0.1.
|
|
30
|
+
(for development, run `gem install --dev ./knievel-0.1.16.gem` to install the development dependencies)
|
|
31
31
|
|
|
32
32
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
|
33
33
|
|
|
34
34
|
Finally add this to the Gemfile:
|
|
35
35
|
|
|
36
|
-
gem 'knievel', '~> 0.1.
|
|
36
|
+
gem 'knievel', '~> 0.1.16'
|
|
37
37
|
|
|
38
38
|
### Install from Git
|
|
39
39
|
|
|
@@ -100,6 +100,7 @@ Class | Method | HTTP request | Description
|
|
|
100
100
|
*Knievel::AdvertisersApi* | [**get_advertiser**](docs/AdvertisersApi.md#get_advertiser) | **GET** /v1/projects/{project_id}/advertisers/{id} |
|
|
101
101
|
*Knievel::AdvertisersApi* | [**list_advertisers**](docs/AdvertisersApi.md#list_advertisers) | **GET** /v1/projects/{project_id}/advertisers |
|
|
102
102
|
*Knievel::AdvertisersApi* | [**update_advertiser**](docs/AdvertisersApi.md#update_advertiser) | **PATCH** /v1/projects/{project_id}/advertisers/{id} |
|
|
103
|
+
*Knievel::AuthApi* | [**whoami**](docs/AuthApi.md#whoami) | **GET** /v1/whoami |
|
|
103
104
|
*Knievel::CampaignsApi* | [**batch_upsert_campaigns**](docs/CampaignsApi.md#batch_upsert_campaigns) | **POST** /v1/projects/{project_id}/campaigns:batchUpsert |
|
|
104
105
|
*Knievel::CampaignsApi* | [**create_campaign**](docs/CampaignsApi.md#create_campaign) | **POST** /v1/projects/{project_id}/campaigns |
|
|
105
106
|
*Knievel::CampaignsApi* | [**get_campaign**](docs/CampaignsApi.md#get_campaign) | **GET** /v1/projects/{project_id}/campaigns/{id} |
|
|
@@ -121,13 +122,15 @@ Class | Method | HTTP request | Description
|
|
|
121
122
|
*Knievel::FlightsApi* | [**list_flights**](docs/FlightsApi.md#list_flights) | **GET** /v1/projects/{project_id}/flights |
|
|
122
123
|
*Knievel::FlightsApi* | [**update_flight**](docs/FlightsApi.md#update_flight) | **PATCH** /v1/projects/{project_id}/flights/{id} |
|
|
123
124
|
*Knievel::OrgsApi* | [**create_project**](docs/OrgsApi.md#create_project) | **POST** /v1/orgs/{org_id}/projects | Create a project under an org. Honors `Idempotency-Key` (24 h replay window per `API.md` \"Idempotency\"); `409 idempotency_conflict` if the same key is reused with a different body. Returns `409 external_id_conflict` if the `externalId` is already taken in this org.
|
|
125
|
+
*Knievel::OrgsApi* | [**get_org**](docs/OrgsApi.md#get_org) | **GET** /v1/orgs/{org_id} | Org metadata (Phase 7.5). Powers the admin SPA's org-dashboard breadcrumbs + project-list page header. Multi-org access isn't a real feature yet; the auth check rejects when the principal's `org_id` doesn't match the path, so this is effectively \"fetch my org.\"
|
|
124
126
|
*Knievel::OrgsApi* | [**get_project**](docs/OrgsApi.md#get_project) | **GET** /v1/orgs/{org_id}/projects/{project_id} | Read a single project by id (path).
|
|
127
|
+
*Knievel::OrgsApi* | [**list_projects**](docs/OrgsApi.md#list_projects) | **GET** /v1/orgs/{org_id}/projects | List projects under an org (Phase 7.5). The cursor envelope is wired so the SPA's pagination plumbing is real, but `next_cursor` is always `null` today — the `(created_at, id)` tuple-cursor that TEXT-id endpoints need is deferred to Phase 6.5 (per CLAUDE.md \"Open known gaps\"). For now an org's full project set comes back in one page; orgs typically host single-digit project counts, so this is fine.
|
|
125
128
|
*Knievel::SitesApi* | [**batch_upsert_sites**](docs/SitesApi.md#batch_upsert_sites) | **POST** /v1/projects/{project_id}/sites:batchUpsert |
|
|
126
129
|
*Knievel::SitesApi* | [**create_site**](docs/SitesApi.md#create_site) | **POST** /v1/projects/{project_id}/sites |
|
|
127
130
|
*Knievel::SitesApi* | [**get_site**](docs/SitesApi.md#get_site) | **GET** /v1/projects/{project_id}/sites/{id} |
|
|
128
131
|
*Knievel::SitesApi* | [**list_sites**](docs/SitesApi.md#list_sites) | **GET** /v1/projects/{project_id}/sites |
|
|
129
132
|
*Knievel::SitesApi* | [**update_site**](docs/SitesApi.md#update_site) | **PATCH** /v1/projects/{project_id}/sites/{id} |
|
|
130
|
-
*Knievel::SitesApi* | [**upsert_site_by_url**](docs/SitesApi.md#upsert_site_by_url) | **POST** /v1/projects/{project_id}/sites
|
|
133
|
+
*Knievel::SitesApi* | [**upsert_site_by_url**](docs/SitesApi.md#upsert_site_by_url) | **POST** /v1/projects/{project_id}/sites/upsert-by-url | Natural-key upsert. Returns the existing row (200) when a site with the same URL exists; otherwise creates (201). Per `API.md` § 3.7: `:upsertByUrl` is the canonical entry point for URL-driven flows.
|
|
131
134
|
*Knievel::SystemApi* | [**healthz**](docs/SystemApi.md#healthz) | **GET** /healthz | Liveness — k8s liveness probe key.
|
|
132
135
|
*Knievel::SystemApi* | [**readyz**](docs/SystemApi.md#readyz) | **GET** /readyz | Readiness — only 200 when knievel can serve. Per `REQUIREMENTS.md` § 10.6, the full check has four criteria; today only the DB-reachability one is real.
|
|
133
136
|
*Knievel::SystemApi* | [**version**](docs/SystemApi.md#version) | **GET** /version | Build metadata + effective auth policy.
|
|
@@ -215,8 +218,10 @@ Class | Method | HTTP request | Description
|
|
|
215
218
|
- [Knievel::FlightList](docs/FlightList.md)
|
|
216
219
|
- [Knievel::ForceOverride](docs/ForceOverride.md)
|
|
217
220
|
- [Knievel::IssuerSummary](docs/IssuerSummary.md)
|
|
221
|
+
- [Knievel::OrgResponse](docs/OrgResponse.md)
|
|
218
222
|
- [Knievel::Priority](docs/Priority.md)
|
|
219
223
|
- [Knievel::PriorityList](docs/PriorityList.md)
|
|
224
|
+
- [Knievel::ProjectList](docs/ProjectList.md)
|
|
220
225
|
- [Knievel::ProjectResponse](docs/ProjectResponse.md)
|
|
221
226
|
- [Knievel::Site](docs/Site.md)
|
|
222
227
|
- [Knievel::SiteList](docs/SiteList.md)
|
|
@@ -232,6 +237,7 @@ Class | Method | HTTP request | Description
|
|
|
232
237
|
- [Knievel::UpdateZoneRequest](docs/UpdateZoneRequest.md)
|
|
233
238
|
- [Knievel::UpsertSiteByUrlRequest](docs/UpsertSiteByUrlRequest.md)
|
|
234
239
|
- [Knievel::VersionResponse](docs/VersionResponse.md)
|
|
240
|
+
- [Knievel::WhoamiResponse](docs/WhoamiResponse.md)
|
|
235
241
|
- [Knievel::Zone](docs/Zone.md)
|
|
236
242
|
- [Knievel::ZoneList](docs/ZoneList.md)
|
|
237
243
|
|
data/docs/AuthApi.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Knievel::AuthApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost:8080*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**whoami**](AuthApi.md#whoami) | **GET** /v1/whoami | |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## whoami
|
|
11
|
+
|
|
12
|
+
> <WhoamiResponse> whoami
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Examples
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
require 'time'
|
|
20
|
+
require 'knievel'
|
|
21
|
+
# setup authorization
|
|
22
|
+
Knievel.configure do |config|
|
|
23
|
+
# Configure Bearer authorization: BearerAuth
|
|
24
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
api_instance = Knievel::AuthApi.new
|
|
28
|
+
|
|
29
|
+
begin
|
|
30
|
+
|
|
31
|
+
result = api_instance.whoami
|
|
32
|
+
p result
|
|
33
|
+
rescue Knievel::ApiError => e
|
|
34
|
+
puts "Error when calling AuthApi->whoami: #{e}"
|
|
35
|
+
end
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### Using the whoami_with_http_info variant
|
|
39
|
+
|
|
40
|
+
This returns an Array which contains the response data, status code and headers.
|
|
41
|
+
|
|
42
|
+
> <Array(<WhoamiResponse>, Integer, Hash)> whoami_with_http_info
|
|
43
|
+
|
|
44
|
+
```ruby
|
|
45
|
+
begin
|
|
46
|
+
|
|
47
|
+
data, status_code, headers = api_instance.whoami_with_http_info
|
|
48
|
+
p status_code # => 2xx
|
|
49
|
+
p headers # => { ... }
|
|
50
|
+
p data # => <WhoamiResponse>
|
|
51
|
+
rescue Knievel::ApiError => e
|
|
52
|
+
puts "Error when calling AuthApi->whoami_with_http_info: #{e}"
|
|
53
|
+
end
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Parameters
|
|
57
|
+
|
|
58
|
+
This endpoint does not need any parameter.
|
|
59
|
+
|
|
60
|
+
### Return type
|
|
61
|
+
|
|
62
|
+
[**WhoamiResponse**](WhoamiResponse.md)
|
|
63
|
+
|
|
64
|
+
### Authorization
|
|
65
|
+
|
|
66
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
67
|
+
|
|
68
|
+
### HTTP request headers
|
|
69
|
+
|
|
70
|
+
- **Content-Type**: Not defined
|
|
71
|
+
- **Accept**: application/json; charset=utf-8
|
|
72
|
+
|
data/docs/OrgResponse.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Knievel::OrgResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | | |
|
|
8
|
+
| **external_id** | **String** | | [optional] |
|
|
9
|
+
| **name** | **String** | | |
|
|
10
|
+
| **is_active** | **Boolean** | | |
|
|
11
|
+
| **etag** | **String** | | |
|
|
12
|
+
| **created_at** | **String** | | |
|
|
13
|
+
| **updated_at** | **String** | | |
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```ruby
|
|
18
|
+
require 'knievel'
|
|
19
|
+
|
|
20
|
+
instance = Knievel::OrgResponse.new(
|
|
21
|
+
id: null,
|
|
22
|
+
external_id: null,
|
|
23
|
+
name: null,
|
|
24
|
+
is_active: null,
|
|
25
|
+
etag: null,
|
|
26
|
+
created_at: null,
|
|
27
|
+
updated_at: null
|
|
28
|
+
)
|
|
29
|
+
```
|
|
30
|
+
|
data/docs/OrgsApi.md
CHANGED
|
@@ -5,7 +5,9 @@ All URIs are relative to *http://localhost:8080*
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
7
|
| [**create_project**](OrgsApi.md#create_project) | **POST** /v1/orgs/{org_id}/projects | Create a project under an org. Honors `Idempotency-Key` (24 h replay window per `API.md` \"Idempotency\"); `409 idempotency_conflict` if the same key is reused with a different body. Returns `409 external_id_conflict` if the `externalId` is already taken in this org. |
|
|
8
|
+
| [**get_org**](OrgsApi.md#get_org) | **GET** /v1/orgs/{org_id} | Org metadata (Phase 7.5). Powers the admin SPA's org-dashboard breadcrumbs + project-list page header. Multi-org access isn't a real feature yet; the auth check rejects when the principal's `org_id` doesn't match the path, so this is effectively \"fetch my org.\" |
|
|
8
9
|
| [**get_project**](OrgsApi.md#get_project) | **GET** /v1/orgs/{org_id}/projects/{project_id} | Read a single project by id (path). |
|
|
10
|
+
| [**list_projects**](OrgsApi.md#list_projects) | **GET** /v1/orgs/{org_id}/projects | List projects under an org (Phase 7.5). The cursor envelope is wired so the SPA's pagination plumbing is real, but `next_cursor` is always `null` today — the `(created_at, id)` tuple-cursor that TEXT-id endpoints need is deferred to Phase 6.5 (per CLAUDE.md \"Open known gaps\"). For now an org's full project set comes back in one page; orgs typically host single-digit project counts, so this is fine. |
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
## create_project
|
|
@@ -81,6 +83,73 @@ end
|
|
|
81
83
|
- **Accept**: application/json; charset=utf-8
|
|
82
84
|
|
|
83
85
|
|
|
86
|
+
## get_org
|
|
87
|
+
|
|
88
|
+
> <OrgResponse> get_org(org_id)
|
|
89
|
+
|
|
90
|
+
Org metadata (Phase 7.5). Powers the admin SPA's org-dashboard breadcrumbs + project-list page header. Multi-org access isn't a real feature yet; the auth check rejects when the principal's `org_id` doesn't match the path, so this is effectively \"fetch my org.\"
|
|
91
|
+
|
|
92
|
+
### Examples
|
|
93
|
+
|
|
94
|
+
```ruby
|
|
95
|
+
require 'time'
|
|
96
|
+
require 'knievel'
|
|
97
|
+
# setup authorization
|
|
98
|
+
Knievel.configure do |config|
|
|
99
|
+
# Configure Bearer authorization: BearerAuth
|
|
100
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
api_instance = Knievel::OrgsApi.new
|
|
104
|
+
org_id = 'org_id_example' # String |
|
|
105
|
+
|
|
106
|
+
begin
|
|
107
|
+
# Org metadata (Phase 7.5). Powers the admin SPA's org-dashboard breadcrumbs + project-list page header. Multi-org access isn't a real feature yet; the auth check rejects when the principal's `org_id` doesn't match the path, so this is effectively \"fetch my org.\"
|
|
108
|
+
result = api_instance.get_org(org_id)
|
|
109
|
+
p result
|
|
110
|
+
rescue Knievel::ApiError => e
|
|
111
|
+
puts "Error when calling OrgsApi->get_org: #{e}"
|
|
112
|
+
end
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### Using the get_org_with_http_info variant
|
|
116
|
+
|
|
117
|
+
This returns an Array which contains the response data, status code and headers.
|
|
118
|
+
|
|
119
|
+
> <Array(<OrgResponse>, Integer, Hash)> get_org_with_http_info(org_id)
|
|
120
|
+
|
|
121
|
+
```ruby
|
|
122
|
+
begin
|
|
123
|
+
# Org metadata (Phase 7.5). Powers the admin SPA's org-dashboard breadcrumbs + project-list page header. Multi-org access isn't a real feature yet; the auth check rejects when the principal's `org_id` doesn't match the path, so this is effectively \"fetch my org.\"
|
|
124
|
+
data, status_code, headers = api_instance.get_org_with_http_info(org_id)
|
|
125
|
+
p status_code # => 2xx
|
|
126
|
+
p headers # => { ... }
|
|
127
|
+
p data # => <OrgResponse>
|
|
128
|
+
rescue Knievel::ApiError => e
|
|
129
|
+
puts "Error when calling OrgsApi->get_org_with_http_info: #{e}"
|
|
130
|
+
end
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Parameters
|
|
134
|
+
|
|
135
|
+
| Name | Type | Description | Notes |
|
|
136
|
+
| ---- | ---- | ----------- | ----- |
|
|
137
|
+
| **org_id** | **String** | | |
|
|
138
|
+
|
|
139
|
+
### Return type
|
|
140
|
+
|
|
141
|
+
[**OrgResponse**](OrgResponse.md)
|
|
142
|
+
|
|
143
|
+
### Authorization
|
|
144
|
+
|
|
145
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
146
|
+
|
|
147
|
+
### HTTP request headers
|
|
148
|
+
|
|
149
|
+
- **Content-Type**: Not defined
|
|
150
|
+
- **Accept**: application/json; charset=utf-8
|
|
151
|
+
|
|
152
|
+
|
|
84
153
|
## get_project
|
|
85
154
|
|
|
86
155
|
> <ProjectResponse> get_project(org_id, project_id)
|
|
@@ -149,3 +218,78 @@ end
|
|
|
149
218
|
- **Content-Type**: Not defined
|
|
150
219
|
- **Accept**: application/json; charset=utf-8
|
|
151
220
|
|
|
221
|
+
|
|
222
|
+
## list_projects
|
|
223
|
+
|
|
224
|
+
> <ProjectList> list_projects(org_id, opts)
|
|
225
|
+
|
|
226
|
+
List projects under an org (Phase 7.5). The cursor envelope is wired so the SPA's pagination plumbing is real, but `next_cursor` is always `null` today — the `(created_at, id)` tuple-cursor that TEXT-id endpoints need is deferred to Phase 6.5 (per CLAUDE.md \"Open known gaps\"). For now an org's full project set comes back in one page; orgs typically host single-digit project counts, so this is fine.
|
|
227
|
+
|
|
228
|
+
The optional `external_id` query parameter resolves a caller-assigned external id back to the knievel project id (`UNIQUE (org_id, external_id)` makes this at-most-one row). Lets consumers like rx — which only persist the external id at write time — recover the internal id without listing the org's full project set. See `MIGRATION_RX.md` \"Project bootstrap\" and issue #2 § 5.
|
|
229
|
+
|
|
230
|
+
### Examples
|
|
231
|
+
|
|
232
|
+
```ruby
|
|
233
|
+
require 'time'
|
|
234
|
+
require 'knievel'
|
|
235
|
+
# setup authorization
|
|
236
|
+
Knievel.configure do |config|
|
|
237
|
+
# Configure Bearer authorization: BearerAuth
|
|
238
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
api_instance = Knievel::OrgsApi.new
|
|
242
|
+
org_id = 'org_id_example' # String |
|
|
243
|
+
opts = {
|
|
244
|
+
limit: 789, # Integer |
|
|
245
|
+
external_id: 'external_id_example' # String |
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
begin
|
|
249
|
+
# List projects under an org (Phase 7.5). The cursor envelope is wired so the SPA's pagination plumbing is real, but `next_cursor` is always `null` today — the `(created_at, id)` tuple-cursor that TEXT-id endpoints need is deferred to Phase 6.5 (per CLAUDE.md \"Open known gaps\"). For now an org's full project set comes back in one page; orgs typically host single-digit project counts, so this is fine.
|
|
250
|
+
result = api_instance.list_projects(org_id, opts)
|
|
251
|
+
p result
|
|
252
|
+
rescue Knievel::ApiError => e
|
|
253
|
+
puts "Error when calling OrgsApi->list_projects: #{e}"
|
|
254
|
+
end
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
#### Using the list_projects_with_http_info variant
|
|
258
|
+
|
|
259
|
+
This returns an Array which contains the response data, status code and headers.
|
|
260
|
+
|
|
261
|
+
> <Array(<ProjectList>, Integer, Hash)> list_projects_with_http_info(org_id, opts)
|
|
262
|
+
|
|
263
|
+
```ruby
|
|
264
|
+
begin
|
|
265
|
+
# List projects under an org (Phase 7.5). The cursor envelope is wired so the SPA's pagination plumbing is real, but `next_cursor` is always `null` today — the `(created_at, id)` tuple-cursor that TEXT-id endpoints need is deferred to Phase 6.5 (per CLAUDE.md \"Open known gaps\"). For now an org's full project set comes back in one page; orgs typically host single-digit project counts, so this is fine.
|
|
266
|
+
data, status_code, headers = api_instance.list_projects_with_http_info(org_id, opts)
|
|
267
|
+
p status_code # => 2xx
|
|
268
|
+
p headers # => { ... }
|
|
269
|
+
p data # => <ProjectList>
|
|
270
|
+
rescue Knievel::ApiError => e
|
|
271
|
+
puts "Error when calling OrgsApi->list_projects_with_http_info: #{e}"
|
|
272
|
+
end
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Parameters
|
|
276
|
+
|
|
277
|
+
| Name | Type | Description | Notes |
|
|
278
|
+
| ---- | ---- | ----------- | ----- |
|
|
279
|
+
| **org_id** | **String** | | |
|
|
280
|
+
| **limit** | **Integer** | | [optional] |
|
|
281
|
+
| **external_id** | **String** | | [optional] |
|
|
282
|
+
|
|
283
|
+
### Return type
|
|
284
|
+
|
|
285
|
+
[**ProjectList**](ProjectList.md)
|
|
286
|
+
|
|
287
|
+
### Authorization
|
|
288
|
+
|
|
289
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
290
|
+
|
|
291
|
+
### HTTP request headers
|
|
292
|
+
|
|
293
|
+
- **Content-Type**: Not defined
|
|
294
|
+
- **Accept**: application/json; charset=utf-8
|
|
295
|
+
|
data/docs/ProjectList.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Knievel::ProjectList
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **items** | [**Array<ProjectResponse>**](ProjectResponse.md) | | |
|
|
8
|
+
| **next_cursor** | **String** | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'knievel'
|
|
14
|
+
|
|
15
|
+
instance = Knievel::ProjectList.new(
|
|
16
|
+
items: null,
|
|
17
|
+
next_cursor: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
data/docs/SitesApi.md
CHANGED
|
@@ -9,7 +9,7 @@ All URIs are relative to *http://localhost:8080*
|
|
|
9
9
|
| [**get_site**](SitesApi.md#get_site) | **GET** /v1/projects/{project_id}/sites/{id} | |
|
|
10
10
|
| [**list_sites**](SitesApi.md#list_sites) | **GET** /v1/projects/{project_id}/sites | |
|
|
11
11
|
| [**update_site**](SitesApi.md#update_site) | **PATCH** /v1/projects/{project_id}/sites/{id} | |
|
|
12
|
-
| [**upsert_site_by_url**](SitesApi.md#upsert_site_by_url) | **POST** /v1/projects/{project_id}/sites
|
|
12
|
+
| [**upsert_site_by_url**](SitesApi.md#upsert_site_by_url) | **POST** /v1/projects/{project_id}/sites/upsert-by-url | Natural-key upsert. Returns the existing row (200) when a site with the same URL exists; otherwise creates (201). Per `API.md` § 3.7: `:upsertByUrl` is the canonical entry point for URL-driven flows. |
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
## batch_upsert_sites
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Knievel::WhoamiResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **scope** | **String** | `org` or `project`. | |
|
|
8
|
+
| **org_id** | **String** | | |
|
|
9
|
+
| **project_id** | **String** | Present only when `scope == \"project\"`. | [optional] |
|
|
10
|
+
| **role** | **String** | One of `org-owner`, `org-admin`, `admin`, `editor`, `reader`. | |
|
|
11
|
+
| **token_type** | **String** | `opaque` for `kvl_*` bearers; `jwt` for OIDC bearers. | |
|
|
12
|
+
| **actor_id** | **String** | Opaque actor identifier; matches `audit_log.actor`. | |
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```ruby
|
|
17
|
+
require 'knievel'
|
|
18
|
+
|
|
19
|
+
instance = Knievel::WhoamiResponse.new(
|
|
20
|
+
scope: null,
|
|
21
|
+
org_id: null,
|
|
22
|
+
project_id: null,
|
|
23
|
+
role: null,
|
|
24
|
+
token_type: null,
|
|
25
|
+
actor_id: null
|
|
26
|
+
)
|
|
27
|
+
```
|
|
28
|
+
|
data/knievel.gemspec
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
7
|
|
|
8
|
-
The version of the OpenAPI document: 0.1.
|
|
8
|
+
The version of the OpenAPI document: 0.1.16
|
|
9
9
|
|
|
10
10
|
Generated by: https://openapi-generator.tech
|
|
11
11
|
Generator version: 7.23.0-SNAPSHOT
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.1.
|
|
6
|
+
The version of the OpenAPI document: 0.1.16
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0-SNAPSHOT
|
data/lib/knievel/api/ads_api.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.1.
|
|
6
|
+
The version of the OpenAPI document: 0.1.16
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0-SNAPSHOT
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.1.
|
|
6
|
+
The version of the OpenAPI document: 0.1.16
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0-SNAPSHOT
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#knievel
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.16
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Knievel
|
|
16
|
+
class AuthApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# @param [Hash] opts the optional parameters
|
|
23
|
+
# @return [WhoamiResponse]
|
|
24
|
+
def whoami(opts = {})
|
|
25
|
+
data, _status_code, _headers = whoami_with_http_info(opts)
|
|
26
|
+
data
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# @param [Hash] opts the optional parameters
|
|
30
|
+
# @return [Array<(WhoamiResponse, Integer, Hash)>] WhoamiResponse data, response status code and response headers
|
|
31
|
+
def whoami_with_http_info(opts = {})
|
|
32
|
+
if @api_client.config.debugging
|
|
33
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.whoami ...'
|
|
34
|
+
end
|
|
35
|
+
# resource path
|
|
36
|
+
local_var_path = '/v1/whoami'
|
|
37
|
+
|
|
38
|
+
# query parameters
|
|
39
|
+
query_params = opts[:query_params] || {}
|
|
40
|
+
|
|
41
|
+
# header parameters
|
|
42
|
+
header_params = opts[:header_params] || {}
|
|
43
|
+
# HTTP header 'Accept' (if needed)
|
|
44
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8']) unless header_params['Accept']
|
|
45
|
+
|
|
46
|
+
# form parameters
|
|
47
|
+
form_params = opts[:form_params] || {}
|
|
48
|
+
|
|
49
|
+
# http body (model)
|
|
50
|
+
post_body = opts[:debug_body]
|
|
51
|
+
|
|
52
|
+
# return_type
|
|
53
|
+
return_type = opts[:debug_return_type] || 'WhoamiResponse'
|
|
54
|
+
|
|
55
|
+
# auth_names
|
|
56
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
|
57
|
+
|
|
58
|
+
new_options = opts.merge(
|
|
59
|
+
:operation => :"AuthApi.whoami",
|
|
60
|
+
:header_params => header_params,
|
|
61
|
+
:query_params => query_params,
|
|
62
|
+
:form_params => form_params,
|
|
63
|
+
:body => post_body,
|
|
64
|
+
:auth_names => auth_names,
|
|
65
|
+
:return_type => return_type
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
69
|
+
if @api_client.config.debugging
|
|
70
|
+
@api_client.config.logger.debug "API called: AuthApi#whoami\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
71
|
+
end
|
|
72
|
+
return data, status_code, headers
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.1.
|
|
6
|
+
The version of the OpenAPI document: 0.1.16
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0-SNAPSHOT
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.1.
|
|
6
|
+
The version of the OpenAPI document: 0.1.16
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0-SNAPSHOT
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.1.
|
|
6
|
+
The version of the OpenAPI document: 0.1.16
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0-SNAPSHOT
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.1.
|
|
6
|
+
The version of the OpenAPI document: 0.1.16
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0-SNAPSHOT
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.1.
|
|
6
|
+
The version of the OpenAPI document: 0.1.16
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0-SNAPSHOT
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.1.
|
|
6
|
+
The version of the OpenAPI document: 0.1.16
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.23.0-SNAPSHOT
|