Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
250 changes: 202 additions & 48 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ resolver = "2"

[workspace.package]
edition = "2021"
version = "0.3.12"
version = "0.3.13"



description = "Tower is the best way to host Python data apps in production"
rust-version = "1.77"
Expand All @@ -31,7 +33,6 @@ glob = "0.3"
http = "1.1"
indicatif = "0.17"
log = "0.4"
open = "5"
pem = "3"
promptly = "0.3"
rand = "0.8"
Expand Down Expand Up @@ -61,6 +62,7 @@ tower-cmd = { path = "crates/tower-cmd" }
tower-package = { path = "crates/tower-package" }
tower-runtime = { path = "crates/tower-runtime" }
url = { version = "2", features = ["serde"] }
webbrowser = "1"

# The profile that 'dist' will build with
[profile.dist]
Expand Down
11 changes: 5 additions & 6 deletions crates/tower-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[package]
name = "tower-api"
version = "1.0.0"
authors = ["hello@tower.dev"]
description = "REST API to interact with Tower Services."
# Override this license by providing a License Object in the OpenAPI.
license = "Unlicense"
edition = "2021"
version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }

[dependencies]
log = { workspace = true }
Expand Down
12 changes: 9 additions & 3 deletions crates/tower-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ For more information, please visit [https://tower.dev](https://tower.dev)

This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client.

- API version: v0.5.9
- API version: v0.5.12
- Package version: 1.0.0
- Generator version: 7.13.0
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`
Expand Down Expand Up @@ -54,7 +54,8 @@ Class | Method | HTTP request | Description
*DefaultApi* | [**describe_run_logs**](docs/DefaultApi.md#describe_run_logs) | **GET** /apps/{slug}/runs/{seq}/logs | Describe run logs
*DefaultApi* | [**describe_secrets_key**](docs/DefaultApi.md#describe_secrets_key) | **GET** /secrets/key | Describe encryption key
*DefaultApi* | [**describe_session**](docs/DefaultApi.md#describe_session) | **GET** /session | Describe session
*DefaultApi* | [**export_secrets**](docs/DefaultApi.md#export_secrets) | **GET** /secrets/export | Export secrets
*DefaultApi* | [**export_catalogs**](docs/DefaultApi.md#export_catalogs) | **POST** /catalogs/export | Export catalogs
*DefaultApi* | [**export_secrets**](docs/DefaultApi.md#export_secrets) | **POST** /secrets/export | Export secrets
*DefaultApi* | [**generate_app_statistics**](docs/DefaultApi.md#generate_app_statistics) | **GET** /stats/apps | Generate app statistics
*DefaultApi* | [**generate_run_statistics**](docs/DefaultApi.md#generate_run_statistics) | **GET** /stats/runs | Generate run statistics
*DefaultApi* | [**invite_team_member**](docs/DefaultApi.md#invite_team_member) | **POST** /teams/{slug}/invites | Invite team member
Expand Down Expand Up @@ -124,6 +125,7 @@ Class | Method | HTTP request | Description
- [DeleteApiKeyResponse](docs/DeleteApiKeyResponse.md)
- [DeleteAppResponse](docs/DeleteAppResponse.md)
- [DeleteCatalogResponse](docs/DeleteCatalogResponse.md)
- [DeleteSecretResponse](docs/DeleteSecretResponse.md)
- [DeleteTeamInvitationParams](docs/DeleteTeamInvitationParams.md)
- [DeleteTeamInvitationResponse](docs/DeleteTeamInvitationResponse.md)
- [DeleteTeamParams](docs/DeleteTeamParams.md)
Expand All @@ -139,8 +141,12 @@ Class | Method | HTTP request | Description
- [EncryptedCatalogProperty](docs/EncryptedCatalogProperty.md)
- [ErrorDetail](docs/ErrorDetail.md)
- [ErrorModel](docs/ErrorModel.md)
- [ExportCatalogsParams](docs/ExportCatalogsParams.md)
- [ExportCatalogsResponse](docs/ExportCatalogsResponse.md)
- [ExportSecretsParams](docs/ExportSecretsParams.md)
- [ExportSecretsResponse](docs/ExportSecretsResponse.md)
- [ExportUserSecretsParams](docs/ExportUserSecretsParams.md)
- [ExportedCatalog](docs/ExportedCatalog.md)
- [ExportedCatalogProperty](docs/ExportedCatalogProperty.md)
- [ExportedSecret](docs/ExportedSecret.md)
- [GenerateAppStatisticsResponse](docs/GenerateAppStatisticsResponse.md)
- [GenerateRunStatisticsResponse](docs/GenerateRunStatisticsResponse.md)
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/apis/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
88 changes: 63 additions & 25 deletions crates/tower-api/src/apis/default_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down Expand Up @@ -195,18 +195,16 @@ pub struct DescribeSecretsKeyParams {
pub format: Option<String>
}

/// struct for passing parameters to the method [`export_catalogs`]
#[derive(Clone, Debug)]
pub struct ExportCatalogsParams {
pub export_catalogs_params: models::ExportCatalogsParams
}

/// struct for passing parameters to the method [`export_secrets`]
#[derive(Clone, Debug)]
pub struct ExportSecretsParams {
pub export_user_secrets_params: models::ExportUserSecretsParams,
/// The environment to filter by.
pub environment: Option<String>,
/// Whether to fetch all secrets or only the ones that are not marked as deleted.
pub all: Option<bool>,
/// The page number to fetch.
pub page: Option<i64>,
/// The number of records to fetch on each page.
pub page_size: Option<i64>
pub export_secrets_params: models::ExportSecretsParams
}

/// struct for passing parameters to the method [`generate_run_statistics`]
Expand Down Expand Up @@ -559,7 +557,7 @@ pub enum DeleteCatalogSuccess {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteSecretSuccess {
Status204(),
Status200(models::DeleteSecretResponse),
UnknownValue(serde_json::Value),
}

Expand Down Expand Up @@ -643,6 +641,14 @@ pub enum DescribeSessionSuccess {
UnknownValue(serde_json::Value),
}

/// struct for typed successes of method [`export_catalogs`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExportCatalogsSuccess {
Status200(models::ExportCatalogsResponse),
UnknownValue(serde_json::Value),
}

/// struct for typed successes of method [`export_secrets`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
Expand Down Expand Up @@ -1103,6 +1109,14 @@ pub enum DescribeSessionError {
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`export_catalogs`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExportCatalogsError {
DefaultResponse(models::ErrorModel),
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`export_secrets`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
Expand Down Expand Up @@ -2307,31 +2321,55 @@ pub async fn describe_session(configuration: &configuration::Configuration) -> R
}
}

/// Lists all the catalogs in your current account and re-encrypt them with the public key you supplied.
pub async fn export_catalogs(configuration: &configuration::Configuration, params: ExportCatalogsParams) -> Result<ResponseContent<ExportCatalogsSuccess>, Error<ExportCatalogsError>> {

let uri_str = format!("{}/catalogs/export", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);

if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&params.export_catalogs_params);

let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;

let status = resp.status();

let tower_trace_id = resp
.headers()
.get("x-tower-trace-id")
.and_then(|v| v.to_str().ok())
.map_or(String::from(DEFAULT_TOWER_TRACE_ID), String::from);

if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
let entity: Option<ExportCatalogsSuccess> = serde_json::from_str(&content).ok();
Ok(ResponseContent { tower_trace_id, status, content, entity })
} else {
let content = resp.text().await?;
let entity: Option<ExportCatalogsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { tower_trace_id, status, content, entity }))
}
}

/// Lists all the secrets in your current account and re-encrypt them with the public key you supplied.
pub async fn export_secrets(configuration: &configuration::Configuration, params: ExportSecretsParams) -> Result<ResponseContent<ExportSecretsSuccess>, Error<ExportSecretsError>> {

let uri_str = format!("{}/secrets/export", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);

if let Some(ref param_value) = params.environment {
req_builder = req_builder.query(&[("environment", &param_value.to_string())]);
}
if let Some(ref param_value) = params.all {
req_builder = req_builder.query(&[("all", &param_value.to_string())]);
}
if let Some(ref param_value) = params.page {
req_builder = req_builder.query(&[("page", &param_value.to_string())]);
}
if let Some(ref param_value) = params.page_size {
req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&params.export_user_secrets_params);
req_builder = req_builder.json(&params.export_secrets_params);

let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/accept_invitation_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/accept_invitation_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/acknowledge_alert_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/alert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/alert_detail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/api_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/app_statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/app_summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/app_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/cancel_run_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/catalog_property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/create_account_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.5.9
* The version of the OpenAPI document: v0.5.12
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
Loading
Loading