Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: add support for Polling Endpoint Consumers #1833

Merged
merged 2 commits into from
Mar 24, 2025
Merged
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
2 changes: 1 addition & 1 deletion codegen.toml
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ extra_codegen_args = ["--include-mode=public-and-hidden"]
template_dir = "svix-cli/templates"
extra_mounts = { "svix-cli/.rustfmt.toml" = "/app/.rustfmt.toml" }
extra_shell_commands = [
"cargo fix --manifest-path svix-cli/Cargo.toml --allow-dirty --allow-staged",
"cargo fix --all-targets --all-features --manifest-path svix-cli/Cargo.toml --allow-dirty --allow-staged",
"cargo fmt --manifest-path svix-cli/Cargo.toml",
"rm svix-cli/src/cmds/api/{ingest,ingest_source,operational_webhook,background_task,health,operational_webhook_endpoint,statistics}.rs",
]
4 changes: 4 additions & 0 deletions svix-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -52,6 +52,10 @@ tokio-tungstenite = { version = "0.26.0", features = ["rustls-tls-native-roots"]
toml = "0.8.19"
url = "2.5.4"

[features]
default = []
svix_beta = ["svix/svix_beta"]

# The profile that 'dist' will build with
[profile.dist]
inherits = "release"
1 change: 0 additions & 1 deletion svix-cli/src/cmds/api/events_public.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use chrono::{DateTime, Utc};
use clap::{Args, Subcommand};
use svix::api::*;

2 changes: 2 additions & 0 deletions svix-cli/src/cmds/api/mod.rs
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ pub mod authentication;
pub mod endpoint;
pub mod environment;
pub mod event_type;
#[cfg(feature = "svix_beta")]
pub mod events_public;
pub mod integration;
pub mod message;
pub mod message_attempt;
10 changes: 10 additions & 0 deletions svix-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ use colored_json::{ColorMode, Output};
use concolor_clap::{Color, ColorChoice};
use svix::api::SvixOptions;

#[cfg(feature = "svix_beta")]
use crate::cmds::api::events_public::EventsPublicArgs;
use crate::{
cmds::{
api::{
@@ -65,6 +67,9 @@ enum RootCommands {
Endpoint(EndpointArgs),
/// Import or export environments
Environment(EnvironmentArgs),
#[cfg(feature = "svix_beta")]
/// Iterate over messages for a Polling Endpoint
EventsPublic(EventsPublicArgs),
/// List, create & modify event types
EventType(EventTypeArgs),
/// List integrations by app id
@@ -109,6 +114,11 @@ async fn main() -> Result<()> {
let client = get_client(&cfg)?;
args.command.exec(&client, color_mode).await?;
}
#[cfg(feature = "svix_beta")]
RootCommands::EventsPublic(args) => {
let client = get_client(&cfg?)?;
args.command.exec(&client, color_mode).await?;
}
RootCommands::EventType(args) => {
let client = get_client(&cfg?)?;
args.command.exec(&client, color_mode).await?;