Skip to content

Commit 3335022

Browse files
committed
CLI: add support for Polling Endpoint Consumers
Adds support for using `v1.events-public.consumer` and `v1.events-public.consumer-seek`, but gated behind a `svix_beta` cargo feature.
1 parent 0308086 commit 3335022

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

svix-cli/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ tokio-tungstenite = { version = "0.26.0", features = ["rustls-tls-native-roots"]
5252
toml = "0.8.19"
5353
url = "2.5.4"
5454

55+
[features]
56+
default = []
57+
svix_beta = ["svix/svix_beta"]
58+
5559
# The profile that 'dist' will build with
5660
[profile.dist]
5761
inherits = "release"

svix-cli/src/cmds/api/events_public.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use chrono::{DateTime, Utc};
21
use clap::{Args, Subcommand};
32
use svix::api::*;
43

svix-cli/src/cmds/api/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ pub mod authentication;
33
pub mod endpoint;
44
pub mod environment;
55
pub mod event_type;
6+
#[cfg(feature = "svix_beta")]
7+
pub mod events_public;
68
pub mod integration;
79
pub mod message;
810
pub mod message_attempt;

svix-cli/src/main.rs

+10
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use colored_json::{ColorMode, Output};
55
use concolor_clap::{Color, ColorChoice};
66
use svix::api::SvixOptions;
77

8+
#[cfg(feature = "svix_beta")]
9+
use crate::cmds::api::events_public::EventsPublicArgs;
810
use crate::{
911
cmds::{
1012
api::{
@@ -65,6 +67,9 @@ enum RootCommands {
6567
Endpoint(EndpointArgs),
6668
/// Import or export environments
6769
Environment(EnvironmentArgs),
70+
#[cfg(feature = "svix_beta")]
71+
/// Iterate over messages for a Polling Endpoint
72+
EventsPublic(EventsPublicArgs),
6873
/// List, create & modify event types
6974
EventType(EventTypeArgs),
7075
/// List integrations by app id
@@ -109,6 +114,11 @@ async fn main() -> Result<()> {
109114
let client = get_client(&cfg)?;
110115
args.command.exec(&client, color_mode).await?;
111116
}
117+
#[cfg(feature = "svix_beta")]
118+
RootCommands::EventsPublic(args) => {
119+
let client = get_client(&cfg?)?;
120+
args.command.exec(&client, color_mode).await?;
121+
}
112122
RootCommands::EventType(args) => {
113123
let client = get_client(&cfg?)?;
114124
args.command.exec(&client, color_mode).await?;

0 commit comments

Comments
 (0)