Skip to content

Commit

Permalink
chore: merge develop into main for 0.47.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaro00 authored Jul 23, 2024
2 parents 7910fc1 + 7ffa384 commit bae5fed
Show file tree
Hide file tree
Showing 53 changed files with 193 additions and 111 deletions.
4 changes: 2 additions & 2 deletions actix-web/clerk/backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ clerk-rs = "0.2.3"
openssl-sys = { version = "0.9.9", features = ["vendored"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
shuttle-actix-web = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-actix-web = "0.47.0"
shuttle-runtime = "0.47.0"
4 changes: 2 additions & 2 deletions actix-web/cookie-authentication/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ edition = "2021"
actix-identity = "0.7.1"
actix-session = { version = "0.9.0", features = ["cookie-session"] }
actix-web = "4.3.1"
shuttle-actix-web = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-actix-web = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.26.0"
4 changes: 2 additions & 2 deletions actix-web/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ edition = "2021"

[dependencies]
actix-web = "4.3.1"
shuttle-actix-web = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-actix-web = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.26.0"
6 changes: 3 additions & 3 deletions actix-web/postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ edition = "2021"

[dependencies]
actix-web = "4.3.1"
shuttle-actix-web = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-actix-web = "0.47.0"
shuttle-runtime = "0.47.0"
serde = "1.0.148"
shuttle-shared-db = { version = "0.46.0", features = ["postgres", "sqlx"] }
shuttle-shared-db = { version = "0.47.0", features = ["postgres", "sqlx"] }
sqlx = "0.7.1"
tokio = "1.26.0"
4 changes: 2 additions & 2 deletions actix-web/static-files/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ edition = "2021"
[dependencies]
actix-files = "0.6.2"
actix-web = "4.3.1"
shuttle-actix-web = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-actix-web = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.26.0"
4 changes: 2 additions & 2 deletions actix-web/websocket-actorless/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ futures = "0.3"
reqwest = "0.11"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
shuttle-actix-web = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-actix-web = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = { version = "1", features = ["rt-multi-thread", "sync"] }
tracing = "0.1"
4 changes: 2 additions & 2 deletions axum/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ edition = "2021"

[dependencies]
axum = "0.7.4"
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.28.2"
6 changes: 3 additions & 3 deletions axum/htmx-crud/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ askama_axum = "0.4.0"
axum = "0.7.4"
serde = { version = "1.0.189", features = ["derive"] }
serde_json = "1.0.107"
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-shared-db = { version = "0.46.0", features = ["postgres", "sqlx"] }
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"
shuttle-shared-db = { version = "0.47.0", features = ["postgres", "sqlx"] }
sqlx = "0.7.2"
tokio = "1.28.2"
tokio-stream = { version = "0.1.14", features = ["sync"] }
4 changes: 2 additions & 2 deletions axum/jwt-authentication/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jsonwebtoken = "8.3.0"
once_cell = "1.18.0"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.28.2"
tracing-subscriber = "0.3.17"
4 changes: 2 additions & 2 deletions axum/metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ edition = "2021"

[dependencies]
axum = "0.7.3"
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.28.2"
6 changes: 3 additions & 3 deletions axum/oauth2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ chrono = { version = "0.4.35", features = ["clock"] }
oauth2 = "4.4.1"
reqwest = { version = "0.11.18", features = ["json"] }
serde = { version = "1.0.183", features = ["derive"] }
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-shared-db = { version = "0.46.0", features = ["postgres", "sqlx"] }
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"
shuttle-shared-db = { version = "0.47.0", features = ["postgres", "sqlx"] }
sqlx = { version = "0.7.2", features = ["runtime-tokio-rustls", "macros", "chrono"] }
thiserror = "1.0.57"
time = "0.3.25"
Expand Down
13 changes: 13 additions & 0 deletions axum/openai/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "shuttle-axum-openai"
version = "0.1.0"
edition = "2021"

[dependencies]
async-openai = "0.23.0"
axum = "0.7.3"
serde_json = "1"
shuttle-axum = "0.47.0"
shuttle-openai = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.26.0"
7 changes: 7 additions & 0 deletions axum/openai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
A simple endpoint that sends a chat message to ChatGPT and returns the response.

Set your OpenAI API key in `Secrets.toml`, then try it on a local run with:

```sh
curl http://localhost:8000 -H 'content-type: application/json' --data '{"message":"What is shuttle.rs?"}'
```
1 change: 1 addition & 0 deletions axum/openai/Secrets.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OPENAI_API_KEY = 'your_api_key'
53 changes: 53 additions & 0 deletions axum/openai/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
use std::sync::Arc;

use async_openai::{
config::OpenAIConfig,
types::{
ChatCompletionRequestMessage, ChatCompletionRequestUserMessageArgs,
CreateChatCompletionRequestArgs,
},
Client,
};
use axum::{extract::State, routing::post, Json, Router};
use serde_json::{json, Value};

struct AppState {
openai: Client<OpenAIConfig>,
}

async fn chat(State(state): State<Arc<AppState>>, Json(v): Json<Value>) -> Result<Json<Value>, ()> {
let user_msg: ChatCompletionRequestMessage = ChatCompletionRequestUserMessageArgs::default()
.content(v["message"].as_str().unwrap())
.build()
.unwrap()
.into();
let req = CreateChatCompletionRequestArgs::default()
.model("gpt-4o-mini")
.messages(vec![user_msg])
.n(1)
.build()
.unwrap();
let res = state.openai.chat().create(req).await.unwrap();
let reply = res
.choices
.first()
.unwrap()
.message
.content
.as_ref()
.unwrap()
.to_owned();

Ok(Json(json!({ "response": reply })))
}

#[shuttle_runtime::main]
async fn main(
#[shuttle_openai::OpenAI(api_key = "{secrets.OPENAI_API_KEY}")] openai: Client<OpenAIConfig>,
) -> shuttle_axum::ShuttleAxum {
let state = Arc::new(AppState { openai });

let router = Router::new().route("/", post(chat)).with_state(state);

Ok(router.into())
}
6 changes: 3 additions & 3 deletions axum/postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2021"
[dependencies]
axum = "0.7.3"
serde = { version = "1.0.188", features = ["derive"] }
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-shared-db = { version = "0.46.0", features = ["postgres", "sqlx"] }
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"
shuttle-shared-db = { version = "0.47.0", features = ["postgres", "sqlx"] }
sqlx = "0.7.1"
tokio = "1.28.2"
8 changes: 4 additions & 4 deletions axum/qdrant/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ edition = "2021"

[dependencies]
axum = "0.7.3"
qdrant-client = "1.7.0"
shuttle-axum = "0.46.0"
shuttle-qdrant = "0.46.0"
shuttle-runtime = "0.46.0"
qdrant-client = "1.10.1"
shuttle-axum = "0.47.0"
shuttle-qdrant = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.26.0"
6 changes: 3 additions & 3 deletions axum/qdrant/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use axum::{extract::State, routing::get, Router};
use qdrant_client::prelude::*;
use qdrant_client::Qdrant;
use std::sync::Arc;

struct AppState {
qdrant: QdrantClient,
qdrant: Qdrant,
}

async fn list_collections(State(state): State<Arc<AppState>>) -> String {
Expand All @@ -13,7 +13,7 @@ async fn list_collections(State(state): State<Arc<AppState>>) -> String {
#[shuttle_runtime::main]
async fn main(
#[shuttle_qdrant::Qdrant(cloud_url = "{secrets.CLOUD_URL}", api_key = "{secrets.API_KEY}")]
qdrant: QdrantClient,
qdrant: Qdrant,
) -> shuttle_axum::ShuttleAxum {
let state = Arc::new(AppState { qdrant });

Expand Down
4 changes: 2 additions & 2 deletions axum/static-files/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish = false

[dependencies]
axum = "0.7.3"
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.28.2"
tower-http = { version = "0.5.0", features = ["fs"] }
6 changes: 3 additions & 3 deletions axum/turso/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ edition = "2021"

[dependencies]
axum = "0.7.3"
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-turso = "0.46.0"
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"
shuttle-turso = "0.47.0"
libsql = "0.3.1"
tokio = "1.26.0"
serde = { version = "1.0.164", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions axum/websocket/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ futures = "0.3.28"
reqwest = "0.11.23"
serde = { version = "1.0.163", features = ["derive"] }
serde_json = "1.0.96"
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.28.2"
tower-http = { version = "0.5.0", features = ["fs"] }
4 changes: 2 additions & 2 deletions bevy/hello-world/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
axum = "0.7.4"
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.28.2"
tower-http = { version = "0.5.0", features = ["fs"] }
6 changes: 3 additions & 3 deletions custom-resource/pdo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
async-trait = "0.1.56"
axum = "0.7.3"
serde = { version = "1", features = ["derive"] }
shuttle-service = "0.46.0"
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-service = "0.47.0"
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.28.2"
2 changes: 1 addition & 1 deletion custom-service/none/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ edition = "2021"
publish = false

[dependencies]
shuttle-runtime = "0.46.0"
shuttle-runtime = "0.47.0"
tokio = "1"
4 changes: 2 additions & 2 deletions custom-service/request-scheduler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ chrono = "0.4.24"
cron = "0.12.0"
reqwest = "0.11.17"
serde = "1.0.163"
shuttle-persist = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-persist = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.28.0"
tracing = "0.1.37"
6 changes: 3 additions & 3 deletions fullstack-templates/saas/backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ lettre = "0.11.4"
rand = "0.8.5"
reqwest = "0.11.16"
serde = { version = "1.0.160", features = ["derive"] }
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-shared-db = { version = "0.46.0", features = ["postgres", "sqlx"] }
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"
shuttle-shared-db = { version = "0.47.0", features = ["postgres", "sqlx"] }
sqlx = { version = "0.7.1", features = ["time"] }
time = { version = "0.3.20", features = ["serde"] }
tokio = "1.27.0"
Expand Down
4 changes: 2 additions & 2 deletions loco/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ async-trait = "0.1.74"
axum = "0.7.1"
eyre = "*"
loco-rs = { version = "0.3.1", default-features = false, features = ["cli"] }
shuttle-axum = "0.46.0"
shuttle-runtime = { version = "0.46.0", default-features = false }
shuttle-axum = "0.47.0"
shuttle-runtime = { version = "0.47.0", default-features = false }
serde = "*"
serde_json = "*"
tokio = "1.33.0"
Expand Down
4 changes: 2 additions & 2 deletions other/feature-flags/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ publish = false

[dependencies]
axum = "0.7.3"
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"

[features]
# Shuttle will disable default features and enable the feature "shuttle" if it exists.
Expand Down
4 changes: 2 additions & 2 deletions other/standalone-binary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ path = "src/bin/standalone.rs"
[dependencies]
axum = "0.7.3"
dotenvy = "0.15.7"
shuttle-axum = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-axum = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.28.2"
4 changes: 2 additions & 2 deletions poem/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ edition = "2021"

[dependencies]
poem = "3.0.0"
shuttle-poem = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-poem = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.26.0"
6 changes: 3 additions & 3 deletions poem/mongodb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
[dependencies]
mongodb = "2.4.0"
poem = "3.0.0"
shuttle-poem = "0.46.0"
shuttle-shared-db = { version = "0.46.0", features = ["mongodb"] }
shuttle-runtime = "0.46.0"
shuttle-poem = "0.47.0"
shuttle-shared-db = { version = "0.47.0", features = ["mongodb"] }
shuttle-runtime = "0.47.0"
serde = { version = "1.0.148", features = ["derive"] }
serde_json = "1.0.89"
tokio = "1.26.0"
4 changes: 2 additions & 2 deletions poise/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ publish = false
[dependencies]
anyhow = "1.0.68"
poise = "0.6.1"
shuttle-runtime = "0.46.0"
shuttle-runtime = "0.47.0"
# Since poise is a serenity command framework, it can run on Shuttle with shuttle-serenity
shuttle-serenity = "0.46.0"
shuttle-serenity = "0.47.0"
tracing = "0.1.37"
tokio = "1.26.0"
4 changes: 2 additions & 2 deletions rocket/dyn-templates/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ edition = "2021"
[dependencies]
rocket = "0.5.0"
rocket_dyn_templates = { version = "0.1.0", features = ["handlebars"] }
shuttle-rocket = "0.46.0"
shuttle-runtime = "0.46.0"
shuttle-rocket = "0.47.0"
shuttle-runtime = "0.47.0"
tokio = "1.26.0"
Loading

0 comments on commit bae5fed

Please sign in to comment.