1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//! Official Rust SDK for the Verne Nautilus platform.
//!
//! Provides two services behind a single unified client:
//!
//! - **[Relay]** — Webhooks-as-a-Service: deliver events to subscribed HTTP endpoints.
//! - **[Gate]** — Auth-as-a-Service: manage identities, issue short-lived access tokens,
//! and enforce authorization policies.
//! - **[Passepartout]** — Telegram Auth-as-a-Service: sign users in with Telegram and
//! introspect the access tokens it issues.
//! - **[Clockwork]** — Cron-as-a-Service: schedule recurring cron jobs and one-off delayed
//! jobs that invoke your HTTP endpoints, and inspect their execution history.
//!
//! # Quick start
//!
//! Add the crate to your `Cargo.toml`:
//!
//! ```toml
//! [dependencies]
//! nautilus-rs = "1.2"
//! tokio = { version = "1", features = ["full"] }
//! ```
//!
//! ## Using both services together
//!
//! ```no_run
//! use nautilus_rs::{Verne, SendMessageParams};
//! use serde_json::json;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), nautilus_rs::Error> {
//! let verne = Verne::builder()
//! .relay("vrn_relay_live_sk_…")
//! .gate("vrn_gate_live_sk_…")
//! .build()?;
//!
//! // Send a webhook event
//! let msg = verne.relay()?.messages().send(SendMessageParams {
//! event_type: "order.placed".into(),
//! payload: json!({ "order_id": "ord_123" }),
//! ..Default::default()
//! }).await?;
//! println!("sent: {}", msg.id);
//!
//! Ok(())
//! }
//! ```
//!
//! ## Using a single service
//!
//! You can also instantiate [`Relay`] or [`Gate`] on their own:
//!
//! ```no_run
//! use nautilus_rs::Relay;
//!
//! let relay = Relay::new("vrn_relay_live_sk_…");
//! ```
//!
//! # Error handling
//!
//! Every fallible call returns `Result<T, `[`Error`]`>`. Match on the variants to
//! handle specific failure modes:
//!
//! ```no_run
//! use nautilus_rs::{Error, Relay, SendMessageParams};
//! use serde_json::json;
//!
//! # async fn run() {
//! let relay = Relay::new("vrn_relay_live_sk_…");
//! match relay.messages().send(SendMessageParams {
//! event_type: "ping".into(),
//! payload: json!({}),
//! ..Default::default()
//! }).await {
//! Ok(msg) => println!("delivered: {}", msg.id),
//! Err(Error::Api(e)) => eprintln!("API {}: {}", e.status, e.message),
//! Err(e) => eprintln!("unexpected: {e}"),
//! }
//! # }
//! ```
//!
//! # API key format
//!
//! Keys follow the pattern `vrn_<service>_<env>_sk_…`, for example:
//! - `vrn_relay_live_sk_…`
//! - `vrn_gate_test_sk_…`
pub use ;
pub use ;
pub use Paginated;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;