diff --git a/crates/core/examples/streams_e2e.rs b/crates/core/examples/streams_e2e.rs index 83902cf..cc1ac40 100644 --- a/crates/core/examples/streams_e2e.rs +++ b/crates/core/examples/streams_e2e.rs @@ -56,7 +56,7 @@ async fn main() { .include_stream_metadata(StreamMetadataLocation::Body) .destination_attributes(DestinationAttributes::Webhook(WebhookAttributes { url: "https://webhook.site/ae19071a-2dcc-4035-9cdf-406dcb4719ef".to_string(), - compression: "none".to_string(), + compression: Some("none".to_string()), max_retry: 3, retry_interval_sec: 1, post_timeout_sec: 10, @@ -64,7 +64,7 @@ async fn main() { })) .extra_destinations(vec![DestinationAttributes::Webhook(WebhookAttributes { url: "https://webhook.site/ae19071a-2dcc-4035-9cdf-406dcb4719ef".to_string(), - compression: "none".to_string(), + compression: Some("none".to_string()), max_retry: 3, retry_interval_sec: 1, post_timeout_sec: 10, diff --git a/crates/core/src/admin/bulk.rs b/crates/core/src/admin/bulk.rs index 071c360..70813a6 100644 --- a/crates/core/src/admin/bulk.rs +++ b/crates/core/src/admin/bulk.rs @@ -71,7 +71,7 @@ pub struct BulkUpdateEndpointStatusResponse { pub struct BulkAddTagRequest { /// Endpoint ids to tag. pub ids: Vec, - /// Label of the tag to apply (created if it doesn't exist). + /// Label of the tag to apply (created if it doesn't exist). Maximum 25 characters. pub label: String, } diff --git a/crates/core/src/admin/endpoints.rs b/crates/core/src/admin/endpoints.rs index a308fe3..9a058ea 100644 --- a/crates/core/src/admin/endpoints.rs +++ b/crates/core/src/admin/endpoints.rs @@ -412,7 +412,7 @@ pub struct UpdateEndpointStatusResponse { #[cfg_attr(feature = "rust", derive(Builder))] #[derive(Debug, Clone, Default, Serialize)] pub struct CreateTagRequest { - /// Label for the new tag. + /// Label for the new tag. Maximum 25 characters. #[serde(skip_serializing_if = "Option::is_none")] pub label: Option, } diff --git a/crates/core/src/kvstore/mod.rs b/crates/core/src/kvstore/mod.rs index 3c63095..965bdbc 100644 --- a/crates/core/src/kvstore/mod.rs +++ b/crates/core/src/kvstore/mod.rs @@ -8,10 +8,20 @@ use napi_derive::napi; use pyo3::{pyclass, pymethods}; #[cfg(feature = "python")] use pyo3_stub_gen::derive::{gen_stub_pyclass, gen_stub_pymethods}; -use serde::{Deserialize, Serialize}; +use serde::{Deserialize, Deserializer, Serialize}; use crate::{config::KvStoreConfig, errors::SdkError, SdkConfig}; +// The KV index endpoints return `data: null` when the store has no entries. +// Map that to the default value so consumers get `[]` (or an empty struct) instead of a decode error. +fn null_as_default<'de, D, T>(deserializer: D) -> Result +where + D: Deserializer<'de>, + T: Deserialize<'de> + Default, +{ + Option::::deserialize(deserializer).map(Option::unwrap_or_default) +} + const KV_STORE_BASE_URL: &str = "https://api.quicknode.com/kv/rest/v1/"; // ── Resolved config ──────────────────────────────────────────────────────── @@ -172,6 +182,7 @@ impl KvSetEntry { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct GetSetsResponse { /// Key/value entries on the current page. + #[serde(default, deserialize_with = "null_as_default")] pub data: Vec, /// Cursor for the next page; empty string when there are no more pages. pub cursor: String, @@ -213,7 +224,7 @@ impl GetSetResponse { #[cfg_attr(feature = "python", gen_stub_pyclass)] #[cfg_attr(feature = "python", pyclass(get_all, set_all))] #[cfg_attr(feature = "node", napi(object))] -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct GetListsData { /// List keys on the current page. pub keys: Vec, @@ -237,6 +248,7 @@ impl GetListsData { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct GetListsResponse { /// List keys on the current page. + #[serde(default, deserialize_with = "null_as_default")] pub data: GetListsData, /// Cursor for the next page; empty string when there are no more pages. pub cursor: String, @@ -767,6 +779,26 @@ mod tests { assert_eq!(resp.data[0].key, "k1"); } + #[tokio::test] + async fn get_sets_null_data_empty_store() { + let server = MockServer::start().await; + Mock::given(method("GET")) + .and(path("/sets")) + .respond_with(ResponseTemplate::new(200).set_body_json( + serde_json::json!({"code": 200, "msg": "", "data": null, "cursor": ""}), + )) + .mount(&server) + .await; + let sdk = make_sdk(format!("{}/", server.uri())); + let resp = sdk + .kvstore + .get_sets(&GetSetsParams::default()) + .await + .unwrap(); + assert!(resp.data.is_empty()); + assert_eq!(resp.cursor, ""); + } + #[tokio::test] async fn get_sets_api_error() { let server = MockServer::start().await; @@ -1029,6 +1061,26 @@ mod tests { assert_eq!(resp.data.keys, vec!["list1", "list2"]); } + #[tokio::test] + async fn get_lists_null_data_empty_store() { + let server = MockServer::start().await; + Mock::given(method("GET")) + .and(path("/lists")) + .respond_with(ResponseTemplate::new(200).set_body_json( + serde_json::json!({"code": 200, "msg": "", "data": null, "cursor": ""}), + )) + .mount(&server) + .await; + let sdk = make_sdk(format!("{}/", server.uri())); + let resp = sdk + .kvstore + .get_lists(&GetListsParams::default()) + .await + .unwrap(); + assert!(resp.data.keys.is_empty()); + assert_eq!(resp.cursor, ""); + } + #[tokio::test] async fn get_lists_api_error() { let server = MockServer::start().await; diff --git a/crates/core/src/streams/mod.rs b/crates/core/src/streams/mod.rs index ee24d53..edb83be 100644 --- a/crates/core/src/streams/mod.rs +++ b/crates/core/src/streams/mod.rs @@ -1,12 +1,11 @@ pub mod stream; pub use stream::{ - AddressBookConfig, AzureAttributes, ClickhouseAttributes, CreateStreamParams, - DestinationAttributes, EnabledCountResponse, FilterLanguage, KafkaAttributes, - ListStreamsParams, ListStreamsResponse, MongoAttributes, MysqlAttributes, PageInfo, - PostgresAttributes, ProductType, RedisAttributes, S3Attributes, SnowflakeAttributes, Stream, - StreamDataset, StreamDestination, StreamMetadataLocation, StreamRegion, StreamStatus, - TestFilterParams, TestFilterResponse, UpdateStreamParams, WebhookAttributes, + AddressBookConfig, AzureAttributes, CreateStreamParams, DestinationAttributes, + EnabledCountResponse, FilterLanguage, KafkaAttributes, ListStreamsParams, ListStreamsResponse, + PageInfo, PostgresAttributes, ProductType, S3Attributes, Stream, StreamDataset, + StreamDestination, StreamMetadataLocation, StreamRegion, StreamStatus, TestFilterParams, + TestFilterResponse, UpdateStreamParams, WebhookAttributes, }; use crate::{config::StreamsConfig, errors::SdkError, SdkConfig}; @@ -345,12 +344,12 @@ mod tests { max_retry: 3, retry_interval_sec: 1, post_timeout_sec: 10, - compression: "none".to_string(), + compression: Some("none".to_string()), security_token: None, }), - plan: "growth_plan".to_string(), - threshold_fetch_buffer: 1000, - dataset_batch_size: None, + plan: Some("growth_plan".to_string()), + threshold_fetch_buffer: Some(1000), + dataset_batch_size: 1, max_batch_size: None, max_buffer_range_size: None, max_buffer_processing_workers: None, @@ -364,7 +363,7 @@ mod tests { notification_email: None, charge_min_cap: None, fix_block_reorgs: None, - elastic_batch_enabled: None, + elastic_batch_enabled: true, extra_destinations: None, } } @@ -451,7 +450,7 @@ mod tests { max_retry: 3, retry_interval_sec: 1, post_timeout_sec: 10, - compression: "none".to_string(), + compression: Some("none".to_string()), security_token: None, }), ..webhook_params() @@ -506,7 +505,7 @@ mod tests { max_retry: 5, retry_interval_sec: 2, post_timeout_sec: 15, - compression: "none".to_string(), + compression: Some("none".to_string()), security_token: None, }), DestinationAttributes::S3(S3Attributes { @@ -559,7 +558,7 @@ mod tests { max_retry: 1, retry_interval_sec: 1, post_timeout_sec: 5, - compression: "none".to_string(), + compression: Some("none".to_string()), security_token: None, })]), ..Default::default() diff --git a/crates/core/src/streams/stream.rs b/crates/core/src/streams/stream.rs index 88e1b57..156c923 100644 --- a/crates/core/src/streams/stream.rs +++ b/crates/core/src/streams/stream.rs @@ -65,12 +65,7 @@ pub enum StreamDestination { S3, Azure, Postgres, - Clickhouse, - Snowflake, - Mysql, - Mongo, Kafka, - Redis, } /// Language a stream's filter function is written in. @@ -131,17 +126,18 @@ pub enum StreamStatus { pub struct WebhookAttributes { /// Destination URL that receives batched stream payloads. pub url: String, - /// Maximum number of retry attempts for a failed delivery. + /// Maximum number of retry attempts for a failed delivery. Must be in the range 1–10. pub max_retry: i32, /// Seconds to wait between retry attempts. pub retry_interval_sec: i32, /// Timeout in seconds for each POST request. pub post_timeout_sec: i32, - /// Optional token included with each request so the receiver can verify authenticity. + /// Optional token included with each request so the receiver can verify authenticity. When supplied, must be at least 32 bytes (256 bits). #[serde(skip_serializing_if = "Option::is_none")] pub security_token: Option, - /// Compression applied to the payload (e.g. `none`, `gzip`). - pub compression: String, + /// Compression applied to the payload (e.g. `none`, `gzip`). When omitted the server defaults to no compression. + #[serde(skip_serializing_if = "Option::is_none")] + pub compression: Option, } #[cfg(feature = "python")] @@ -149,13 +145,13 @@ pub struct WebhookAttributes { #[pymethods] impl WebhookAttributes { #[new] - #[pyo3(signature = (url, max_retry, retry_interval_sec, post_timeout_sec, compression, security_token=None))] + #[pyo3(signature = (url, max_retry, retry_interval_sec, post_timeout_sec, compression=None, security_token=None))] pub fn new( url: String, max_retry: i32, retry_interval_sec: i32, post_timeout_sec: i32, - compression: String, + compression: Option, security_token: Option, ) -> Self { Self { @@ -305,7 +301,7 @@ pub struct PostgresAttributes { pub password: String, /// Destination table for inserted rows. pub table_name: String, - /// Postgres SSL mode (e.g. `disable`, `require`, `verify-full`). + /// Postgres SSL mode. The Quicknode API accepts only `disable` or `require`. pub sslmode: String, /// Maximum number of retry attempts for a failed write. pub max_retry: i32, @@ -344,264 +340,6 @@ impl PostgresAttributes { } } -/// Configuration for delivering stream batches to a MySQL database. -#[cfg_attr(feature = "python", gen_stub_pyclass)] -#[cfg_attr(feature = "python", pyclass(get_all, set_all))] -#[cfg_attr(feature = "node", napi(object))] -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct MysqlAttributes { - /// Database host. - pub host: String, - /// Database port. - pub port: i32, - /// Database name. - pub database: String, - /// Username used to authenticate. - pub username: String, - /// Password used to authenticate. - pub password: String, - /// Destination table for inserted rows. - pub table_name: String, - /// Maximum number of retry attempts for a failed write. - pub max_retry: i32, - /// Seconds to wait between retry attempts. - pub retry_interval_sec: i32, -} - -#[cfg(feature = "python")] -#[gen_stub_pymethods] -#[pymethods] -impl MysqlAttributes { - #[new] - #[allow(clippy::too_many_arguments)] - pub fn new( - host: String, - port: i32, - database: String, - username: String, - password: String, - table_name: String, - max_retry: i32, - retry_interval_sec: i32, - ) -> Self { - Self { - host, - port, - database, - username, - password, - table_name, - max_retry, - retry_interval_sec, - } - } -} - -/// Configuration for delivering stream batches to a MongoDB database. -#[cfg_attr(feature = "python", gen_stub_pyclass)] -#[cfg_attr(feature = "python", pyclass(get_all, set_all))] -#[cfg_attr(feature = "node", napi(object))] -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct MongoAttributes { - /// Database host (connection string or hostname). - pub host: String, - /// Database name. - pub database: String, - /// Username used to authenticate. - pub username: String, - /// Password used to authenticate. - pub password: String, - /// Destination collection for inserted documents. - pub collection_name: String, - /// Maximum number of retry attempts for a failed write. - pub max_retry: i32, - /// Seconds to wait between retry attempts. - pub retry_interval_sec: i32, -} - -#[cfg(feature = "python")] -#[gen_stub_pymethods] -#[pymethods] -impl MongoAttributes { - #[new] - pub fn new( - host: String, - database: String, - username: String, - password: String, - collection_name: String, - max_retry: i32, - retry_interval_sec: i32, - ) -> Self { - Self { - host, - database, - username, - password, - collection_name, - max_retry, - retry_interval_sec, - } - } -} - -/// Configuration for delivering stream batches to a ClickHouse cluster. -#[cfg_attr(feature = "python", gen_stub_pyclass)] -#[cfg_attr(feature = "python", pyclass(get_all, set_all))] -#[cfg_attr(feature = "node", napi(object))] -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct ClickhouseAttributes { - /// Comma-separated list of ClickHouse hosts. - pub hosts: String, - /// Database name. - pub database: String, - /// Username used to authenticate. - pub username: String, - /// Password used to authenticate. - pub password: String, - /// Destination table for inserted rows. - pub table_name: String, - /// Default table engine options applied when a table is created. - pub default_table_engine_opts: String, - /// Default index granularity for created tables. - pub default_granularity: i32, - /// Default compression codec for created tables. - pub default_compression: String, - /// Default secondary index type for created tables. - pub default_index_type: String, - /// Maximum number of retry attempts for a failed write. - pub max_retry: i32, - /// Seconds to wait between retry attempts. - pub retry_interval_sec: i32, - /// Disable datetime precision for older ClickHouse versions that don't support it. - #[serde(skip_serializing_if = "Option::is_none")] - pub disable_datetime_precision: Option, - /// Enable when the target ClickHouse server does not support `RENAME COLUMN`. - #[serde(skip_serializing_if = "Option::is_none")] - pub dont_support_rename_column: Option, - /// Enable when the target ClickHouse server does not support empty default values. - #[serde(skip_serializing_if = "Option::is_none")] - pub dont_support_empty_default_value: Option, - /// Skip writing version metadata during initialization. - #[serde(skip_serializing_if = "Option::is_none")] - pub skip_initialize_with_version: Option, -} - -#[cfg(feature = "python")] -#[gen_stub_pymethods] -#[pymethods] -impl ClickhouseAttributes { - #[new] - #[pyo3(signature = (hosts, database, username, password, table_name, default_table_engine_opts, default_granularity, default_compression, default_index_type, max_retry, retry_interval_sec, disable_datetime_precision=None, dont_support_rename_column=None, dont_support_empty_default_value=None, skip_initialize_with_version=None))] - #[allow(clippy::too_many_arguments)] - pub fn new( - hosts: String, - database: String, - username: String, - password: String, - table_name: String, - default_table_engine_opts: String, - default_granularity: i32, - default_compression: String, - default_index_type: String, - max_retry: i32, - retry_interval_sec: i32, - disable_datetime_precision: Option, - dont_support_rename_column: Option, - dont_support_empty_default_value: Option, - skip_initialize_with_version: Option, - ) -> Self { - Self { - hosts, - database, - username, - password, - table_name, - default_table_engine_opts, - default_granularity, - default_compression, - default_index_type, - max_retry, - retry_interval_sec, - disable_datetime_precision, - dont_support_rename_column, - dont_support_empty_default_value, - skip_initialize_with_version, - } - } -} - -/// Configuration for delivering stream batches to a Snowflake data warehouse. -#[cfg_attr(feature = "python", gen_stub_pyclass)] -#[cfg_attr(feature = "python", pyclass(get_all, set_all))] -#[cfg_attr(feature = "node", napi(object))] -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct SnowflakeAttributes { - /// Snowflake account identifier. - pub account: String, - /// Snowflake host. - pub host: String, - /// Snowflake port. - pub port: i32, - /// Connection protocol (e.g. `https`). - pub protocol: String, - /// Database name. - pub database: String, - /// Schema within the database. - pub schema: String, - /// Warehouse used to run inserts. - pub warehouse: String, - /// Username used to authenticate. - pub username: String, - /// Password used to authenticate. - pub password: String, - /// Maximum number of retry attempts for a failed write. - pub max_retry: i32, - /// Seconds to wait between retry attempts. - pub retry_interval_sec: i32, - /// Optional destination table for inserted rows. - #[serde(skip_serializing_if = "Option::is_none")] - pub table_name: Option, -} - -#[cfg(feature = "python")] -#[gen_stub_pymethods] -#[pymethods] -impl SnowflakeAttributes { - #[new] - #[pyo3(signature = (account, host, port, protocol, database, schema, warehouse, username, password, max_retry, retry_interval_sec, table_name=None))] - #[allow(clippy::too_many_arguments)] - pub fn new( - account: String, - host: String, - port: i32, - protocol: String, - database: String, - schema: String, - warehouse: String, - username: String, - password: String, - max_retry: i32, - retry_interval_sec: i32, - table_name: Option, - ) -> Self { - Self { - account, - host, - port, - protocol, - database, - schema, - warehouse, - username, - password, - max_retry, - retry_interval_sec, - table_name, - } - } -} - /// Configuration for delivering stream batches to a Kafka topic. #[cfg_attr(feature = "python", gen_stub_pyclass)] #[cfg_attr(feature = "python", pyclass(get_all, set_all))] @@ -618,8 +356,8 @@ pub struct KafkaAttributes { pub batch_size: i32, /// Milliseconds the producer waits to batch additional messages. pub linger_ms: i32, - /// Maximum request size in bytes. - pub max_request_size: i32, + /// Maximum size in bytes of a single Kafka message (`max_message_bytes`). + pub max_message_bytes: i32, /// Request timeout in seconds. pub timeout_sec: i32, /// Maximum number of retry attempts for a failed produce. @@ -645,7 +383,7 @@ pub struct KafkaAttributes { #[pymethods] impl KafkaAttributes { #[new] - #[pyo3(signature = (bootstrap_servers, topic_name, compression_type, batch_size, linger_ms, max_request_size, timeout_sec, max_retry, retry_interval_sec, username=None, password=None, protocol=None, mechanisms=None))] + #[pyo3(signature = (bootstrap_servers, topic_name, compression_type, batch_size, linger_ms, max_message_bytes, timeout_sec, max_retry, retry_interval_sec, username=None, password=None, protocol=None, mechanisms=None))] #[allow(clippy::too_many_arguments)] pub fn new( bootstrap_servers: String, @@ -653,7 +391,7 @@ impl KafkaAttributes { compression_type: String, batch_size: i32, linger_ms: i32, - max_request_size: i32, + max_message_bytes: i32, timeout_sec: i32, max_retry: i32, retry_interval_sec: i32, @@ -668,7 +406,7 @@ impl KafkaAttributes { compression_type, batch_size, linger_ms, - max_request_size, + max_message_bytes, timeout_sec, max_retry, retry_interval_sec, @@ -680,65 +418,6 @@ impl KafkaAttributes { } } -/// Configuration for delivering stream batches to a Redis instance. -#[cfg_attr(feature = "python", gen_stub_pyclass)] -#[cfg_attr(feature = "python", pyclass(get_all, set_all))] -#[cfg_attr(feature = "node", napi(object))] -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct RedisAttributes { - /// Redis host. - pub host: String, - /// Redis port. - pub port: i32, - /// Redis logical database index. - pub database: i32, - /// Username used to authenticate. - pub username: String, - /// Password used to authenticate. - pub password: String, - /// Redis key that receives written payloads. - pub key_name: String, - /// Maximum number of retry attempts for a failed write. - pub max_retry: i32, - /// Seconds to wait between retry attempts. - pub retry_interval_sec: i32, - /// Whether to connect over TLS. - #[serde(skip_serializing_if = "Option::is_none")] - pub tls: Option, -} - -#[cfg(feature = "python")] -#[gen_stub_pymethods] -#[pymethods] -impl RedisAttributes { - #[new] - #[pyo3(signature = (host, port, database, username, password, key_name, max_retry, retry_interval_sec, tls=None))] - #[allow(clippy::too_many_arguments)] - pub fn new( - host: String, - port: i32, - database: i32, - username: String, - password: String, - key_name: String, - max_retry: i32, - retry_interval_sec: i32, - tls: Option, - ) -> Self { - Self { - host, - port, - database, - username, - password, - key_name, - max_retry, - retry_interval_sec, - tls, - } - } -} - // ── Address Book Config ──────────────────────────────────────────────────── /// Links a stream's filter to an address book so JSON paths resolve against its @@ -800,18 +479,8 @@ pub enum DestinationAttributes { Azure(AzureAttributes), /// PostgreSQL database destination. Postgres(PostgresAttributes), - /// MySQL database destination. - Mysql(MysqlAttributes), - /// MongoDB database destination. - Mongo(MongoAttributes), - /// ClickHouse analytics database destination. - Clickhouse(ClickhouseAttributes), - /// Snowflake data warehouse destination. - Snowflake(SnowflakeAttributes), /// Kafka topic destination. Kafka(KafkaAttributes), - /// Redis in-memory data store destination. - Redis(RedisAttributes), } impl DestinationAttributes { @@ -821,12 +490,7 @@ impl DestinationAttributes { Self::S3(_) => StreamDestination::S3, Self::Azure(_) => StreamDestination::Azure, Self::Postgres(_) => StreamDestination::Postgres, - Self::Mysql(_) => StreamDestination::Mysql, - Self::Mongo(_) => StreamDestination::Mongo, - Self::Clickhouse(_) => StreamDestination::Clickhouse, - Self::Snowflake(_) => StreamDestination::Snowflake, Self::Kafka(_) => StreamDestination::Kafka, - Self::Redis(_) => StreamDestination::Redis, } } } @@ -853,13 +517,14 @@ pub struct CreateStreamParams { // Flattening the enum's tag/content produces { destination, destination_attributes }. #[serde(flatten)] pub destination_attributes: DestinationAttributes, - /// Billing plan associated with the stream. - pub plan: String, - /// Buffer size used by the stream fetcher before delivery. - pub threshold_fetch_buffer: i64, - /// Number of blocks grouped together per delivered batch. + /// Billing plan associated with the stream. Optional; the server applies the account default when omitted. #[serde(skip_serializing_if = "Option::is_none")] - pub dataset_batch_size: Option, + pub plan: Option, + /// Buffer size used by the stream fetcher before delivery. Optional; the server applies its default when omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold_fetch_buffer: Option, + /// Number of blocks grouped together per delivered batch. Required by the API. + pub dataset_batch_size: i64, /// Upper bound on batch size when elastic batching is enabled. #[serde(skip_serializing_if = "Option::is_none")] pub max_batch_size: Option, @@ -899,9 +564,8 @@ pub struct CreateStreamParams { /// Flag (0 or 1) enabling automatic re-streaming of blocks affected by chain reorganizations. #[serde(skip_serializing_if = "Option::is_none")] pub fix_block_reorgs: Option, - /// When enabled, batch size is reduced toward 1 as the stream catches up to the chain tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub elastic_batch_enabled: Option, + /// When enabled, batch size is reduced toward 1 as the stream catches up to the chain tip. Required by the API. + pub elastic_batch_enabled: bool, /// Additional destinations that receive the same batches alongside the primary. // Not flattened: each element serializes as its own {destination, destination_attributes} pair. #[serde(skip_serializing_if = "Option::is_none")] @@ -1188,7 +852,7 @@ mod destination_attributes_tests { max_retry: 3, retry_interval_sec: 5, post_timeout_sec: 10, - compression: "none".to_string(), + compression: Some("none".to_string()), security_token: None, }); let json = serde_json::to_string(&attrs).unwrap(); @@ -1256,88 +920,6 @@ mod destination_attributes_tests { assert!(matches!(parsed, DestinationAttributes::Postgres(_))); } - #[test] - fn mysql_roundtrip() { - let attrs = DestinationAttributes::Mysql(MysqlAttributes { - host: "h".to_string(), - port: 3306, - database: "db".to_string(), - username: "u".to_string(), - password: "p".to_string(), - table_name: "t".to_string(), - max_retry: 3, - retry_interval_sec: 5, - }); - let json = serde_json::to_string(&attrs).unwrap(); - assert!(json.contains(r#""destination":"mysql""#)); - let parsed: DestinationAttributes = serde_json::from_str(&json).unwrap(); - assert!(matches!(parsed, DestinationAttributes::Mysql(_))); - } - - #[test] - fn mongo_roundtrip() { - let attrs = DestinationAttributes::Mongo(MongoAttributes { - host: "h".to_string(), - database: "db".to_string(), - username: "u".to_string(), - password: "p".to_string(), - collection_name: "c".to_string(), - max_retry: 3, - retry_interval_sec: 5, - }); - let json = serde_json::to_string(&attrs).unwrap(); - assert!(json.contains(r#""destination":"mongo""#)); - let parsed: DestinationAttributes = serde_json::from_str(&json).unwrap(); - assert!(matches!(parsed, DestinationAttributes::Mongo(_))); - } - - #[test] - fn clickhouse_roundtrip() { - let attrs = DestinationAttributes::Clickhouse(ClickhouseAttributes { - hosts: "h".to_string(), - database: "db".to_string(), - username: "u".to_string(), - password: "p".to_string(), - table_name: "t".to_string(), - default_table_engine_opts: "()".to_string(), - default_granularity: 8192, - default_compression: "lz4".to_string(), - default_index_type: "minmax".to_string(), - max_retry: 3, - retry_interval_sec: 5, - disable_datetime_precision: None, - dont_support_rename_column: None, - dont_support_empty_default_value: None, - skip_initialize_with_version: None, - }); - let json = serde_json::to_string(&attrs).unwrap(); - assert!(json.contains(r#""destination":"clickhouse""#)); - let parsed: DestinationAttributes = serde_json::from_str(&json).unwrap(); - assert!(matches!(parsed, DestinationAttributes::Clickhouse(_))); - } - - #[test] - fn snowflake_roundtrip() { - let attrs = DestinationAttributes::Snowflake(SnowflakeAttributes { - account: "acct".to_string(), - host: "h".to_string(), - port: 443, - protocol: "https".to_string(), - database: "db".to_string(), - schema: "s".to_string(), - warehouse: "w".to_string(), - username: "u".to_string(), - password: "p".to_string(), - max_retry: 3, - retry_interval_sec: 5, - table_name: Some("t".to_string()), - }); - let json = serde_json::to_string(&attrs).unwrap(); - assert!(json.contains(r#""destination":"snowflake""#)); - let parsed: DestinationAttributes = serde_json::from_str(&json).unwrap(); - assert!(matches!(parsed, DestinationAttributes::Snowflake(_))); - } - #[test] fn kafka_roundtrip() { let attrs = DestinationAttributes::Kafka(KafkaAttributes { @@ -1346,7 +928,7 @@ mod destination_attributes_tests { compression_type: "gzip".to_string(), batch_size: 100, linger_ms: 10, - max_request_size: 1024, + max_message_bytes: 1024, timeout_sec: 30, max_retry: 3, retry_interval_sec: 5, @@ -1360,23 +942,4 @@ mod destination_attributes_tests { let parsed: DestinationAttributes = serde_json::from_str(&json).unwrap(); assert!(matches!(parsed, DestinationAttributes::Kafka(_))); } - - #[test] - fn redis_roundtrip() { - let attrs = DestinationAttributes::Redis(RedisAttributes { - host: "h".to_string(), - port: 6379, - database: 0, - username: "u".to_string(), - password: "p".to_string(), - key_name: "k".to_string(), - max_retry: 3, - retry_interval_sec: 5, - tls: Some(false), - }); - let json = serde_json::to_string(&attrs).unwrap(); - assert!(json.contains(r#""destination":"redis""#)); - let parsed: DestinationAttributes = serde_json::from_str(&json).unwrap(); - assert!(matches!(parsed, DestinationAttributes::Redis(_))); - } } diff --git a/crates/node/src/streams_destination.rs b/crates/node/src/streams_destination.rs index 82c243d..1dc6fb1 100644 --- a/crates/node/src/streams_destination.rs +++ b/crates/node/src/streams_destination.rs @@ -87,9 +87,9 @@ pub struct CreateStreamParamsNode { pub start_range: i64, pub end_range: i64, pub destination_attributes: serde_json::Value, - pub plan: String, - pub threshold_fetch_buffer: i64, - pub dataset_batch_size: Option, + pub plan: Option, + pub threshold_fetch_buffer: Option, + pub dataset_batch_size: i64, pub max_batch_size: Option, pub max_buffer_range_size: Option, pub max_buffer_processing_workers: Option, @@ -103,7 +103,7 @@ pub struct CreateStreamParamsNode { pub notification_email: Option, pub charge_min_cap: Option, pub fix_block_reorgs: Option, - pub elastic_batch_enabled: Option, + pub elastic_batch_enabled: bool, // Each element carries the same { destination, attributes } shape as the // primary destination; we rewrite to core's wire format in node_da_to_core. pub extra_destinations: Option>, diff --git a/crates/python/src/lib.rs b/crates/python/src/lib.rs index 43738f1..8d792f5 100644 --- a/crates/python/src/lib.rs +++ b/crates/python/src/lib.rs @@ -1368,9 +1368,10 @@ impl StreamsApiClient { start_range, end_range, destination_attributes, - plan, - threshold_fetch_buffer, - dataset_batch_size=None, + dataset_batch_size, + elastic_batch_enabled, + plan=None, + threshold_fetch_buffer=None, max_batch_size=None, max_buffer_range_size=None, max_buffer_processing_workers=None, @@ -1383,7 +1384,6 @@ impl StreamsApiClient { notification_email=None, charge_min_cap=None, fix_block_reorgs=None, - elastic_batch_enabled=None, extra_destinations=None ))] #[gen_stub(override_return_type( @@ -1399,9 +1399,10 @@ impl StreamsApiClient { start_range: i64, end_range: i64, destination_attributes: &Bound<'py, PyAny>, - plan: String, - threshold_fetch_buffer: i64, - dataset_batch_size: Option, + dataset_batch_size: i64, + elastic_batch_enabled: bool, + plan: Option, + threshold_fetch_buffer: Option, max_batch_size: Option, max_buffer_range_size: Option, max_buffer_processing_workers: Option, @@ -1414,7 +1415,6 @@ impl StreamsApiClient { notification_email: Option, charge_min_cap: Option, fix_block_reorgs: Option, - elastic_batch_enabled: Option, extra_destinations: Option>, ) -> PyResult> { let client = self.inner.clone(); @@ -2422,23 +2422,13 @@ fn _core(m: &Bound<'_, PyModule>) -> PyResult<()> { m.add_class::()?; m.add_class::()?; m.add_class::()?; - m.add_class::()?; - m.add_class::()?; - m.add_class::()?; - m.add_class::()?; m.add_class::()?; - m.add_class::()?; m.add_class::()?; m.add_class::()?; m.add_class::()?; m.add_class::()?; m.add_class::()?; - m.add_class::()?; - m.add_class::()?; - m.add_class::()?; - m.add_class::()?; m.add_class::()?; - m.add_class::()?; m.add_class::()?; m.add_class::()?; m.add_class::()?; diff --git a/crates/python/src/streams_destination.rs b/crates/python/src/streams_destination.rs index 34a14dc..fcfcc67 100644 --- a/crates/python/src/streams_destination.rs +++ b/crates/python/src/streams_destination.rs @@ -1,10 +1,8 @@ use pyo3::prelude::*; use pyo3_stub_gen::derive::{gen_stub_pyclass, gen_stub_pymethods}; use quicknode_sdk::streams::{ - AddressBookConfig, AzureAttributes, ClickhouseAttributes, DestinationAttributes, - KafkaAttributes, ListStreamsResponse, MongoAttributes, MysqlAttributes, PageInfo, - PostgresAttributes, RedisAttributes, S3Attributes, SnowflakeAttributes, Stream, - WebhookAttributes, + AddressBookConfig, AzureAttributes, DestinationAttributes, KafkaAttributes, + ListStreamsResponse, PageInfo, PostgresAttributes, S3Attributes, Stream, WebhookAttributes, }; // Per-destination typed wrappers. PyO3 cannot represent a Rust enum-with-data, @@ -51,16 +49,7 @@ destination_wrapper!(StreamWebhookDestination, WebhookAttributes, Webhook); destination_wrapper!(StreamS3Destination, S3Attributes, S3); destination_wrapper!(StreamAzureDestination, AzureAttributes, Azure); destination_wrapper!(StreamPostgresDestination, PostgresAttributes, Postgres); -destination_wrapper!(StreamMysqlDestination, MysqlAttributes, Mysql); -destination_wrapper!(StreamMongoDestination, MongoAttributes, Mongo); -destination_wrapper!( - StreamClickhouseDestination, - ClickhouseAttributes, - Clickhouse -); -destination_wrapper!(StreamSnowflakeDestination, SnowflakeAttributes, Snowflake); destination_wrapper!(StreamKafkaDestination, KafkaAttributes, Kafka); -destination_wrapper!(StreamRedisDestination, RedisAttributes, Redis); // ── Conversion helpers ───────────────────────────────────────────────────── @@ -77,24 +66,9 @@ pub fn extract_destination_attributes(obj: &Bound<'_, PyAny>) -> PyResult() { return Ok(v.to_core()); } - if let Ok(v) = obj.extract::() { - return Ok(v.to_core()); - } - if let Ok(v) = obj.extract::() { - return Ok(v.to_core()); - } - if let Ok(v) = obj.extract::() { - return Ok(v.to_core()); - } - if let Ok(v) = obj.extract::() { - return Ok(v.to_core()); - } if let Ok(v) = obj.extract::() { return Ok(v.to_core()); } - if let Ok(v) = obj.extract::() { - return Ok(v.to_core()); - } let received = obj .get_type() .name() @@ -102,9 +76,7 @@ pub fn extract_destination_attributes(obj: &Bound<'_, PyAny>) -> PyResult(format!( "destination_attributes must be one of StreamWebhookDestination, \ StreamS3Destination, StreamAzureDestination, StreamPostgresDestination, \ - StreamMysqlDestination, StreamMongoDestination, StreamClickhouseDestination, \ - StreamSnowflakeDestination, StreamKafkaDestination, StreamRedisDestination — \ - got {received}" + StreamKafkaDestination — got {received}" ))) } @@ -152,24 +124,9 @@ pub fn destination_attributes_to_py( DestinationAttributes::Postgres(a) => StreamPostgresDestination::from_core(a) .into_pyobject(py)? .into(), - DestinationAttributes::Mysql(a) => StreamMysqlDestination::from_core(a) - .into_pyobject(py)? - .into(), - DestinationAttributes::Mongo(a) => StreamMongoDestination::from_core(a) - .into_pyobject(py)? - .into(), - DestinationAttributes::Clickhouse(a) => StreamClickhouseDestination::from_core(a) - .into_pyobject(py)? - .into(), - DestinationAttributes::Snowflake(a) => StreamSnowflakeDestination::from_core(a) - .into_pyobject(py)? - .into(), DestinationAttributes::Kafka(a) => StreamKafkaDestination::from_core(a) .into_pyobject(py)? .into(), - DestinationAttributes::Redis(a) => StreamRedisDestination::from_core(a) - .into_pyobject(py)? - .into(), }) } @@ -298,10 +255,10 @@ impl PyStream { impl PyStream { // Exposed as a getter so pyo3_stub_gen can override the stub to a typed // Union. Without the override, the stub would be `Optional[Any]` and IDEs - // couldn't surface the 10 destination classes. + // couldn't surface the destination classes. #[getter] #[gen_stub(override_return_type( - type_repr = "typing.Optional[typing.Union[StreamWebhookDestination, StreamS3Destination, StreamAzureDestination, StreamPostgresDestination, StreamMysqlDestination, StreamMongoDestination, StreamClickhouseDestination, StreamSnowflakeDestination, StreamKafkaDestination, StreamRedisDestination]]" + type_repr = "typing.Optional[typing.Union[StreamWebhookDestination, StreamS3Destination, StreamAzureDestination, StreamPostgresDestination, StreamKafkaDestination]]" ))] fn destination_attributes<'py>(&self, py: Python<'py>) -> Option> { self.destination_attributes @@ -309,11 +266,11 @@ impl PyStream { .map(|v| v.clone_ref(py)) } - // Typed Union list so IDEs can see the 10 destination classes inside the + // Typed Union list so IDEs can see the destination classes inside the // list, rather than `Optional[List[Any]]`. #[getter] #[gen_stub(override_return_type( - type_repr = "typing.Optional[typing.List[typing.Union[StreamWebhookDestination, StreamS3Destination, StreamAzureDestination, StreamPostgresDestination, StreamMysqlDestination, StreamMongoDestination, StreamClickhouseDestination, StreamSnowflakeDestination, StreamKafkaDestination, StreamRedisDestination]]]" + type_repr = "typing.Optional[typing.List[typing.Union[StreamWebhookDestination, StreamS3Destination, StreamAzureDestination, StreamPostgresDestination, StreamKafkaDestination]]]" ))] fn extra_destinations<'py>(&self, py: Python<'py>) -> Option>> { self.extra_destinations diff --git a/crates/ruby/src/lib.rs b/crates/ruby/src/lib.rs index ccf7fa0..75e5aca 100644 --- a/crates/ruby/src/lib.rs +++ b/crates/ruby/src/lib.rs @@ -107,6 +107,15 @@ fn hash_get_bool(h: &RHash, key: &str) -> Result, Error> { } } +fn hash_require_bool(h: &RHash, key: &str) -> Result { + hash_get_bool(h, key)?.ok_or_else(|| { + Error::new( + ruby().exception_arg_error(), + format!("missing required key: {key}"), + ) + }) +} + fn hash_require_i32(h: &RHash, key: &str) -> Result { hash_get_i32(h, key)?.ok_or_else(|| { Error::new( @@ -1058,7 +1067,7 @@ impl DestinationAttributes { retry_interval_sec: hash_get_i32(&opts, "retry_interval_sec")?.unwrap_or(0), post_timeout_sec: hash_get_i32(&opts, "post_timeout_sec")?.unwrap_or(0), security_token: hash_get_string(&opts, "security_token")?, - compression: hash_require_string(&opts, "compression")?, + compression: hash_get_string(&opts, "compression")?, }; Ok(Self { inner: core::streams::DestinationAttributes::Webhook(attrs), @@ -1116,83 +1125,6 @@ impl DestinationAttributes { }) } - fn mysql(opts: RHash) -> Result { - let attrs = core::streams::MysqlAttributes { - host: hash_require_string(&opts, "host")?, - port: hash_get_i32(&opts, "port")?.unwrap_or(3306), - database: hash_require_string(&opts, "database")?, - username: hash_require_string(&opts, "username")?, - password: hash_require_string(&opts, "password")?, - table_name: hash_require_string(&opts, "table_name")?, - max_retry: hash_get_i32(&opts, "max_retry")?.unwrap_or(0), - retry_interval_sec: hash_get_i32(&opts, "retry_interval_sec")?.unwrap_or(0), - }; - Ok(Self { - inner: core::streams::DestinationAttributes::Mysql(attrs), - }) - } - - fn mongo(opts: RHash) -> Result { - let attrs = core::streams::MongoAttributes { - host: hash_require_string(&opts, "host")?, - database: hash_require_string(&opts, "database")?, - username: hash_require_string(&opts, "username")?, - password: hash_require_string(&opts, "password")?, - collection_name: hash_require_string(&opts, "collection_name")?, - max_retry: hash_get_i32(&opts, "max_retry")?.unwrap_or(0), - retry_interval_sec: hash_get_i32(&opts, "retry_interval_sec")?.unwrap_or(0), - }; - Ok(Self { - inner: core::streams::DestinationAttributes::Mongo(attrs), - }) - } - - fn clickhouse(opts: RHash) -> Result { - let attrs = core::streams::ClickhouseAttributes { - hosts: hash_require_string(&opts, "hosts")?, - database: hash_require_string(&opts, "database")?, - username: hash_require_string(&opts, "username")?, - password: hash_require_string(&opts, "password")?, - table_name: hash_require_string(&opts, "table_name")?, - default_table_engine_opts: hash_require_string(&opts, "default_table_engine_opts")?, - default_granularity: hash_get_i32(&opts, "default_granularity")?.unwrap_or(0), - default_compression: hash_require_string(&opts, "default_compression")?, - default_index_type: hash_require_string(&opts, "default_index_type")?, - max_retry: hash_get_i32(&opts, "max_retry")?.unwrap_or(0), - retry_interval_sec: hash_get_i32(&opts, "retry_interval_sec")?.unwrap_or(0), - disable_datetime_precision: hash_get_bool(&opts, "disable_datetime_precision")?, - dont_support_rename_column: hash_get_bool(&opts, "dont_support_rename_column")?, - dont_support_empty_default_value: hash_get_bool( - &opts, - "dont_support_empty_default_value", - )?, - skip_initialize_with_version: hash_get_bool(&opts, "skip_initialize_with_version")?, - }; - Ok(Self { - inner: core::streams::DestinationAttributes::Clickhouse(attrs), - }) - } - - fn snowflake(opts: RHash) -> Result { - let attrs = core::streams::SnowflakeAttributes { - account: hash_require_string(&opts, "account")?, - host: hash_require_string(&opts, "host")?, - port: hash_get_i32(&opts, "port")?.unwrap_or(443), - protocol: hash_require_string(&opts, "protocol")?, - database: hash_require_string(&opts, "database")?, - schema: hash_require_string(&opts, "schema")?, - warehouse: hash_require_string(&opts, "warehouse")?, - username: hash_require_string(&opts, "username")?, - password: hash_require_string(&opts, "password")?, - max_retry: hash_get_i32(&opts, "max_retry")?.unwrap_or(0), - retry_interval_sec: hash_get_i32(&opts, "retry_interval_sec")?.unwrap_or(0), - table_name: hash_get_string(&opts, "table_name")?, - }; - Ok(Self { - inner: core::streams::DestinationAttributes::Snowflake(attrs), - }) - } - fn kafka(opts: RHash) -> Result { let attrs = core::streams::KafkaAttributes { bootstrap_servers: hash_require_string(&opts, "bootstrap_servers")?, @@ -1200,7 +1132,7 @@ impl DestinationAttributes { compression_type: hash_require_string(&opts, "compression_type")?, batch_size: hash_get_i32(&opts, "batch_size")?.unwrap_or(0), linger_ms: hash_get_i32(&opts, "linger_ms")?.unwrap_or(0), - max_request_size: hash_get_i32(&opts, "max_request_size")?.unwrap_or(0), + max_message_bytes: hash_get_i32(&opts, "max_message_bytes")?.unwrap_or(0), timeout_sec: hash_get_i32(&opts, "timeout_sec")?.unwrap_or(0), max_retry: hash_get_i32(&opts, "max_retry")?.unwrap_or(0), retry_interval_sec: hash_get_i32(&opts, "retry_interval_sec")?.unwrap_or(0), @@ -1213,23 +1145,6 @@ impl DestinationAttributes { inner: core::streams::DestinationAttributes::Kafka(attrs), }) } - - fn redis(opts: RHash) -> Result { - let attrs = core::streams::RedisAttributes { - host: hash_require_string(&opts, "host")?, - port: hash_get_i32(&opts, "port")?.unwrap_or(6379), - database: hash_get_i32(&opts, "database")?.unwrap_or(0), - username: hash_require_string(&opts, "username")?, - password: hash_require_string(&opts, "password")?, - key_name: hash_require_string(&opts, "key_name")?, - max_retry: hash_get_i32(&opts, "max_retry")?.unwrap_or(0), - retry_interval_sec: hash_get_i32(&opts, "retry_interval_sec")?.unwrap_or(0), - tls: hash_get_bool(&opts, "tls")?, - }; - Ok(Self { - inner: core::streams::DestinationAttributes::Redis(attrs), - }) - } } // ── StreamsApiClient ──────────────────────────────────────────────────────── @@ -1260,8 +1175,10 @@ impl StreamsApiClient { "missing required key: destination_attributes", ) })?; - let plan = hash_require_string(&opts, "plan")?; - let threshold_fetch_buffer = hash_require_i64(&opts, "threshold_fetch_buffer")?; + let plan = hash_get_string(&opts, "plan")?; + let threshold_fetch_buffer = hash_get_i64(&opts, "threshold_fetch_buffer")?; + let dataset_batch_size = hash_require_i64(&opts, "dataset_batch_size")?; + let elastic_batch_enabled = hash_require_bool(&opts, "elastic_batch_enabled")?; let dataset = parse_enum::(dataset_s)?; let region = parse_enum::(region_s)?; let filter_language = parse_enum_opt::(hash_get_string( @@ -1285,7 +1202,7 @@ impl StreamsApiClient { destination_attributes, plan, threshold_fetch_buffer, - dataset_batch_size: hash_get_i64(&opts, "dataset_batch_size")?, + dataset_batch_size, max_batch_size: hash_get_i64(&opts, "max_batch_size")?, max_buffer_range_size: hash_get_i64(&opts, "max_buffer_range_size")?, max_buffer_processing_workers: hash_get_i64(&opts, "max_buffer_processing_workers")?, @@ -1299,7 +1216,7 @@ impl StreamsApiClient { notification_email: hash_get_string(&opts, "notification_email")?, charge_min_cap: hash_get_i32(&opts, "charge_min_cap")?, fix_block_reorgs: hash_get_i32(&opts, "fix_block_reorgs")?, - elastic_batch_enabled: hash_get_bool(&opts, "elastic_batch_enabled")?, + elastic_batch_enabled, extra_destinations: hash_get_extra_destinations(&opts, "extra_destinations")?, }; runtime() @@ -2008,16 +1925,7 @@ fn init(ruby: &Ruby) -> Result<(), Error> { dest_attrs.define_singleton_method("azure", function!(DestinationAttributes::azure, 1))?; dest_attrs .define_singleton_method("postgres", function!(DestinationAttributes::postgres, 1))?; - dest_attrs.define_singleton_method("mysql", function!(DestinationAttributes::mysql, 1))?; - dest_attrs.define_singleton_method("mongo", function!(DestinationAttributes::mongo, 1))?; - dest_attrs.define_singleton_method( - "clickhouse", - function!(DestinationAttributes::clickhouse, 1), - )?; - dest_attrs - .define_singleton_method("snowflake", function!(DestinationAttributes::snowflake, 1))?; dest_attrs.define_singleton_method("kafka", function!(DestinationAttributes::kafka, 1))?; - dest_attrs.define_singleton_method("redis", function!(DestinationAttributes::redis, 1))?; // ── Streams ─────────────────────────────────────────────── let streams = native.define_class("Streams", ruby.class_object())?; diff --git a/npm/index.d.ts b/npm/index.d.ts index 0bd4e72..c4ebbbe 100644 --- a/npm/index.d.ts +++ b/npm/index.d.ts @@ -108,7 +108,7 @@ export interface BulkUpdateEndpointStatusResponse { export interface BulkAddTagRequest { /** Endpoint ids to tag. */ ids: Array - /** Label of the tag to apply (created if it doesn't exist). */ + /** Label of the tag to apply (created if it doesn't exist). Maximum 25 characters. */ label: string } /** Tag reference returned on bulk tag operations. */ @@ -662,7 +662,7 @@ export interface UpdateEndpointStatusResponse { } /** Parameters for `create_tag` (on a specific endpoint). */ export interface CreateTagRequest { - /** Label for the new tag. */ + /** Label for the new tag. Maximum 25 characters. */ label?: string } /** Response from `get_endpoint_security`. */ @@ -1244,12 +1244,7 @@ export const enum StreamDestination { S3 = 'S3', Azure = 'Azure', Postgres = 'Postgres', - Clickhouse = 'Clickhouse', - Snowflake = 'Snowflake', - Mysql = 'Mysql', - Mongo = 'Mongo', - Kafka = 'Kafka', - Redis = 'Redis' + Kafka = 'Kafka' } /** Language a stream's filter function is written in. */ export const enum FilterLanguage { @@ -1280,16 +1275,16 @@ export const enum StreamStatus { export interface WebhookAttributes { /** Destination URL that receives batched stream payloads. */ url: string - /** Maximum number of retry attempts for a failed delivery. */ + /** Maximum number of retry attempts for a failed delivery. Must be in the range 1–10. */ maxRetry: number /** Seconds to wait between retry attempts. */ retryIntervalSec: number /** Timeout in seconds for each POST request. */ postTimeoutSec: number - /** Optional token included with each request so the receiver can verify authenticity. */ + /** Optional token included with each request so the receiver can verify authenticity. When supplied, must be at least 32 bytes (256 bits). */ securityToken?: string - /** Compression applied to the payload (e.g. `none`, `gzip`). */ - compression: string + /** Compression applied to the payload (e.g. `none`, `gzip`). When omitted the server defaults to no compression. */ + compression?: string } /** Configuration for delivering stream batches to an S3-compatible object store. */ export interface S3Attributes { @@ -1347,109 +1342,13 @@ export interface PostgresAttributes { password: string /** Destination table for inserted rows. */ tableName: string - /** Postgres SSL mode (e.g. `disable`, `require`, `verify-full`). */ + /** Postgres SSL mode. The Quicknode API accepts only `disable` or `require`. */ sslmode: string /** Maximum number of retry attempts for a failed write. */ maxRetry: number /** Seconds to wait between retry attempts. */ retryIntervalSec: number } -/** Configuration for delivering stream batches to a MySQL database. */ -export interface MysqlAttributes { - /** Database host. */ - host: string - /** Database port. */ - port: number - /** Database name. */ - database: string - /** Username used to authenticate. */ - username: string - /** Password used to authenticate. */ - password: string - /** Destination table for inserted rows. */ - tableName: string - /** Maximum number of retry attempts for a failed write. */ - maxRetry: number - /** Seconds to wait between retry attempts. */ - retryIntervalSec: number -} -/** Configuration for delivering stream batches to a MongoDB database. */ -export interface MongoAttributes { - /** Database host (connection string or hostname). */ - host: string - /** Database name. */ - database: string - /** Username used to authenticate. */ - username: string - /** Password used to authenticate. */ - password: string - /** Destination collection for inserted documents. */ - collectionName: string - /** Maximum number of retry attempts for a failed write. */ - maxRetry: number - /** Seconds to wait between retry attempts. */ - retryIntervalSec: number -} -/** Configuration for delivering stream batches to a ClickHouse cluster. */ -export interface ClickhouseAttributes { - /** Comma-separated list of ClickHouse hosts. */ - hosts: string - /** Database name. */ - database: string - /** Username used to authenticate. */ - username: string - /** Password used to authenticate. */ - password: string - /** Destination table for inserted rows. */ - tableName: string - /** Default table engine options applied when a table is created. */ - defaultTableEngineOpts: string - /** Default index granularity for created tables. */ - defaultGranularity: number - /** Default compression codec for created tables. */ - defaultCompression: string - /** Default secondary index type for created tables. */ - defaultIndexType: string - /** Maximum number of retry attempts for a failed write. */ - maxRetry: number - /** Seconds to wait between retry attempts. */ - retryIntervalSec: number - /** Disable datetime precision for older ClickHouse versions that don't support it. */ - disableDatetimePrecision?: boolean - /** Enable when the target ClickHouse server does not support `RENAME COLUMN`. */ - dontSupportRenameColumn?: boolean - /** Enable when the target ClickHouse server does not support empty default values. */ - dontSupportEmptyDefaultValue?: boolean - /** Skip writing version metadata during initialization. */ - skipInitializeWithVersion?: boolean -} -/** Configuration for delivering stream batches to a Snowflake data warehouse. */ -export interface SnowflakeAttributes { - /** Snowflake account identifier. */ - account: string - /** Snowflake host. */ - host: string - /** Snowflake port. */ - port: number - /** Connection protocol (e.g. `https`). */ - protocol: string - /** Database name. */ - database: string - /** Schema within the database. */ - schema: string - /** Warehouse used to run inserts. */ - warehouse: string - /** Username used to authenticate. */ - username: string - /** Password used to authenticate. */ - password: string - /** Maximum number of retry attempts for a failed write. */ - maxRetry: number - /** Seconds to wait between retry attempts. */ - retryIntervalSec: number - /** Optional destination table for inserted rows. */ - tableName?: string -} /** Configuration for delivering stream batches to a Kafka topic. */ export interface KafkaAttributes { /** Comma-separated list of Kafka broker addresses (host:port). */ @@ -1462,8 +1361,8 @@ export interface KafkaAttributes { batchSize: number /** Milliseconds the producer waits to batch additional messages. */ lingerMs: number - /** Maximum request size in bytes. */ - maxRequestSize: number + /** Maximum size in bytes of a single Kafka message (`max_message_bytes`). */ + maxMessageBytes: number /** Request timeout in seconds. */ timeoutSec: number /** Maximum number of retry attempts for a failed produce. */ @@ -1479,27 +1378,6 @@ export interface KafkaAttributes { /** Optional SASL mechanism (e.g. `PLAIN`, `SCRAM-SHA-256`). */ mechanisms?: string } -/** Configuration for delivering stream batches to a Redis instance. */ -export interface RedisAttributes { - /** Redis host. */ - host: string - /** Redis port. */ - port: number - /** Redis logical database index. */ - database: number - /** Username used to authenticate. */ - username: string - /** Password used to authenticate. */ - password: string - /** Redis key that receives written payloads. */ - keyName: string - /** Maximum number of retry attempts for a failed write. */ - maxRetry: number - /** Seconds to wait between retry attempts. */ - retryIntervalSec: number - /** Whether to connect over TLS. */ - tls?: boolean -} /** * Links a stream's filter to an address book so JSON paths resolve against its * managed address set. @@ -1721,9 +1599,9 @@ export interface CreateStreamParamsNode { startRange: number endRange: number destinationAttributes: any - plan: string - thresholdFetchBuffer: number - datasetBatchSize?: number + plan?: string + thresholdFetchBuffer?: number + datasetBatchSize: number maxBatchSize?: number maxBufferRangeSize?: number maxBufferProcessingWorkers?: number @@ -1737,7 +1615,7 @@ export interface CreateStreamParamsNode { notificationEmail?: string chargeMinCap?: number fixBlockReorgs?: number - elasticBatchEnabled?: boolean + elasticBatchEnabled: boolean extraDestinations?: Array } export interface UpdateStreamParamsNode { diff --git a/npm/sdk.d.ts b/npm/sdk.d.ts index a43e35d..b62a321 100644 --- a/npm/sdk.d.ts +++ b/npm/sdk.d.ts @@ -6,12 +6,7 @@ import { S3Attributes, AzureAttributes, PostgresAttributes, - MysqlAttributes, - MongoAttributes, - ClickhouseAttributes, - SnowflakeAttributes, KafkaAttributes, - RedisAttributes, WebhookTemplateId, EvmWalletFilterTemplate, EvmContractEventsTemplate, @@ -32,12 +27,7 @@ export type StreamDestinationAttributesInput = | { destination: "s3"; attributes: S3Attributes } | { destination: "azure"; attributes: AzureAttributes } | { destination: "postgres"; attributes: PostgresAttributes } - | { destination: "mysql"; attributes: MysqlAttributes } - | { destination: "mongo"; attributes: MongoAttributes } - | { destination: "clickhouse"; attributes: ClickhouseAttributes } - | { destination: "snowflake"; attributes: SnowflakeAttributes } - | { destination: "kafka"; attributes: KafkaAttributes } - | { destination: "redis"; attributes: RedisAttributes }; + | { destination: "kafka"; attributes: KafkaAttributes }; // Stream destination attributes (response). Mirrors the input shape so a // response can be round-tripped back into an update call without renaming. @@ -117,12 +107,7 @@ export type { S3Attributes, AzureAttributes, PostgresAttributes, - MysqlAttributes, - MongoAttributes, - ClickhouseAttributes, - SnowflakeAttributes, KafkaAttributes, - RedisAttributes, AddressBookConfig, StreamsApiClient, // billing diff --git a/python/sdk/__init__.pyi b/python/sdk/__init__.pyi index b0adb7f..c0a3745 100644 --- a/python/sdk/__init__.pyi +++ b/python/sdk/__init__.pyi @@ -14,22 +14,12 @@ from sdk._core import ( S3Attributes, AzureAttributes, PostgresAttributes, - MysqlAttributes, - MongoAttributes, - ClickhouseAttributes, - SnowflakeAttributes, KafkaAttributes, - RedisAttributes, StreamWebhookDestination, StreamS3Destination, StreamAzureDestination, StreamPostgresDestination, - StreamMysqlDestination, - StreamMongoDestination, - StreamClickhouseDestination, - StreamSnowflakeDestination, StreamKafkaDestination, - StreamRedisDestination, AddressBookConfig, Endpoint, EndpointTag, @@ -216,22 +206,12 @@ __all__ = [ "S3Attributes", "AzureAttributes", "PostgresAttributes", - "MysqlAttributes", - "MongoAttributes", - "ClickhouseAttributes", - "SnowflakeAttributes", "KafkaAttributes", - "RedisAttributes", "StreamWebhookDestination", "StreamS3Destination", "StreamAzureDestination", "StreamPostgresDestination", - "StreamMysqlDestination", - "StreamMongoDestination", - "StreamClickhouseDestination", - "StreamSnowflakeDestination", "StreamKafkaDestination", - "StreamRedisDestination", "AddressBookConfig", "StreamsConfig", "Endpoint", diff --git a/python/sdk/_core/__init__.pyi b/python/sdk/_core/__init__.pyi index dd5fb20..eb0dc58 100644 --- a/python/sdk/_core/__init__.pyi +++ b/python/sdk/_core/__init__.pyi @@ -25,7 +25,6 @@ __all__ = [ "Chain", "ChainNetwork", "ChainUsage", - "ClickhouseAttributes", "CreateDomainMaskRequest", "CreateEndpointRequest", "CreateEndpointResponse", @@ -124,15 +123,12 @@ __all__ = [ "LogDetails", "MethodRateLimiter", "MethodUsage", - "MongoAttributes", - "MysqlAttributes", "PageInfo", "Pagination", "Payment", "PostgresAttributes", "QuicknodeSdk", "RateLimitSettings", - "RedisAttributes", "RemoveTeamMemberRequest", "RemoveTeamMemberResponse", "RenameTagRequest", @@ -144,21 +140,15 @@ __all__ = [ "SecurityOptionsUpdate", "ShowEndpointResponse", "SingleEndpoint", - "SnowflakeAttributes", "SolanaWalletFilterArgs", "SolanaWalletFilterTemplate", "StellarWalletTransactionsFilterArgs", "StellarWalletTransactionsFilterTemplate", "Stream", "StreamAzureDestination", - "StreamClickhouseDestination", "StreamKafkaDestination", - "StreamMongoDestination", - "StreamMysqlDestination", "StreamPostgresDestination", - "StreamRedisDestination", "StreamS3Destination", - "StreamSnowflakeDestination", "StreamWebhookDestination", "StreamsApiClient", "StreamsConfig", @@ -784,12 +774,12 @@ class BulkAddTagRequest: @property def label(self) -> builtins.str: r""" - Label of the tag to apply (created if it doesn't exist). + Label of the tag to apply (created if it doesn't exist). Maximum 25 characters. """ @label.setter def label(self, value: builtins.str) -> None: r""" - Label of the tag to apply (created if it doesn't exist). + Label of the tag to apply (created if it doesn't exist). Maximum 25 characters. """ @typing.final @@ -1164,163 +1154,6 @@ class ChainUsage: Credits consumed on the chain. """ -@typing.final -class ClickhouseAttributes: - r""" - Configuration for delivering stream batches to a ClickHouse cluster. - """ - @property - def hosts(self) -> builtins.str: - r""" - Comma-separated list of ClickHouse hosts. - """ - @hosts.setter - def hosts(self, value: builtins.str) -> None: - r""" - Comma-separated list of ClickHouse hosts. - """ - @property - def database(self) -> builtins.str: - r""" - Database name. - """ - @database.setter - def database(self, value: builtins.str) -> None: - r""" - Database name. - """ - @property - def username(self) -> builtins.str: - r""" - Username used to authenticate. - """ - @username.setter - def username(self, value: builtins.str) -> None: - r""" - Username used to authenticate. - """ - @property - def password(self) -> builtins.str: - r""" - Password used to authenticate. - """ - @password.setter - def password(self, value: builtins.str) -> None: - r""" - Password used to authenticate. - """ - @property - def table_name(self) -> builtins.str: - r""" - Destination table for inserted rows. - """ - @table_name.setter - def table_name(self, value: builtins.str) -> None: - r""" - Destination table for inserted rows. - """ - @property - def default_table_engine_opts(self) -> builtins.str: - r""" - Default table engine options applied when a table is created. - """ - @default_table_engine_opts.setter - def default_table_engine_opts(self, value: builtins.str) -> None: - r""" - Default table engine options applied when a table is created. - """ - @property - def default_granularity(self) -> builtins.int: - r""" - Default index granularity for created tables. - """ - @default_granularity.setter - def default_granularity(self, value: builtins.int) -> None: - r""" - Default index granularity for created tables. - """ - @property - def default_compression(self) -> builtins.str: - r""" - Default compression codec for created tables. - """ - @default_compression.setter - def default_compression(self, value: builtins.str) -> None: - r""" - Default compression codec for created tables. - """ - @property - def default_index_type(self) -> builtins.str: - r""" - Default secondary index type for created tables. - """ - @default_index_type.setter - def default_index_type(self, value: builtins.str) -> None: - r""" - Default secondary index type for created tables. - """ - @property - def max_retry(self) -> builtins.int: - r""" - Maximum number of retry attempts for a failed write. - """ - @max_retry.setter - def max_retry(self, value: builtins.int) -> None: - r""" - Maximum number of retry attempts for a failed write. - """ - @property - def retry_interval_sec(self) -> builtins.int: - r""" - Seconds to wait between retry attempts. - """ - @retry_interval_sec.setter - def retry_interval_sec(self, value: builtins.int) -> None: - r""" - Seconds to wait between retry attempts. - """ - @property - def disable_datetime_precision(self) -> typing.Optional[builtins.bool]: - r""" - Disable datetime precision for older ClickHouse versions that don't support it. - """ - @disable_datetime_precision.setter - def disable_datetime_precision(self, value: typing.Optional[builtins.bool]) -> None: - r""" - Disable datetime precision for older ClickHouse versions that don't support it. - """ - @property - def dont_support_rename_column(self) -> typing.Optional[builtins.bool]: - r""" - Enable when the target ClickHouse server does not support `RENAME COLUMN`. - """ - @dont_support_rename_column.setter - def dont_support_rename_column(self, value: typing.Optional[builtins.bool]) -> None: - r""" - Enable when the target ClickHouse server does not support `RENAME COLUMN`. - """ - @property - def dont_support_empty_default_value(self) -> typing.Optional[builtins.bool]: - r""" - Enable when the target ClickHouse server does not support empty default values. - """ - @dont_support_empty_default_value.setter - def dont_support_empty_default_value(self, value: typing.Optional[builtins.bool]) -> None: - r""" - Enable when the target ClickHouse server does not support empty default values. - """ - @property - def skip_initialize_with_version(self) -> typing.Optional[builtins.bool]: - r""" - Skip writing version metadata during initialization. - """ - @skip_initialize_with_version.setter - def skip_initialize_with_version(self, value: typing.Optional[builtins.bool]) -> None: - r""" - Skip writing version metadata during initialization. - """ - def __new__(cls, hosts: builtins.str, database: builtins.str, username: builtins.str, password: builtins.str, table_name: builtins.str, default_table_engine_opts: builtins.str, default_granularity: builtins.int, default_compression: builtins.str, default_index_type: builtins.str, max_retry: builtins.int, retry_interval_sec: builtins.int, disable_datetime_precision: typing.Optional[builtins.bool] = None, dont_support_rename_column: typing.Optional[builtins.bool] = None, dont_support_empty_default_value: typing.Optional[builtins.bool] = None, skip_initialize_with_version: typing.Optional[builtins.bool] = None) -> ClickhouseAttributes: ... - @typing.final class CreateDomainMaskRequest: r""" @@ -1627,12 +1460,12 @@ class CreateTagRequest: @property def label(self) -> typing.Optional[builtins.str]: r""" - Label for the new tag. + Label for the new tag. Maximum 25 characters. """ @label.setter def label(self, value: typing.Optional[builtins.str]) -> None: r""" - Label for the new tag. + Label for the new tag. Maximum 25 characters. """ @typing.final @@ -3804,14 +3637,14 @@ class KafkaAttributes: Milliseconds the producer waits to batch additional messages. """ @property - def max_request_size(self) -> builtins.int: + def max_message_bytes(self) -> builtins.int: r""" - Maximum request size in bytes. + Maximum size in bytes of a single Kafka message (`max_message_bytes`). """ - @max_request_size.setter - def max_request_size(self, value: builtins.int) -> None: + @max_message_bytes.setter + def max_message_bytes(self, value: builtins.int) -> None: r""" - Maximum request size in bytes. + Maximum size in bytes of a single Kafka message (`max_message_bytes`). """ @property def timeout_sec(self) -> builtins.int: @@ -3883,7 +3716,7 @@ class KafkaAttributes: r""" Optional SASL mechanism (e.g. `PLAIN`, `SCRAM-SHA-256`). """ - def __new__(cls, bootstrap_servers: builtins.str, topic_name: builtins.str, compression_type: builtins.str, batch_size: builtins.int, linger_ms: builtins.int, max_request_size: builtins.int, timeout_sec: builtins.int, max_retry: builtins.int, retry_interval_sec: builtins.int, username: typing.Optional[builtins.str] = None, password: typing.Optional[builtins.str] = None, protocol: typing.Optional[builtins.str] = None, mechanisms: typing.Optional[builtins.str] = None) -> KafkaAttributes: ... + def __new__(cls, bootstrap_servers: builtins.str, topic_name: builtins.str, compression_type: builtins.str, batch_size: builtins.int, linger_ms: builtins.int, max_message_bytes: builtins.int, timeout_sec: builtins.int, max_retry: builtins.int, retry_interval_sec: builtins.int, username: typing.Optional[builtins.str] = None, password: typing.Optional[builtins.str] = None, protocol: typing.Optional[builtins.str] = None, mechanisms: typing.Optional[builtins.str] = None) -> KafkaAttributes: ... @typing.final class KvSetEntry: @@ -4382,170 +4215,6 @@ class MethodUsage: Chain the calls targeted. """ -@typing.final -class MongoAttributes: - r""" - Configuration for delivering stream batches to a MongoDB database. - """ - @property - def host(self) -> builtins.str: - r""" - Database host (connection string or hostname). - """ - @host.setter - def host(self, value: builtins.str) -> None: - r""" - Database host (connection string or hostname). - """ - @property - def database(self) -> builtins.str: - r""" - Database name. - """ - @database.setter - def database(self, value: builtins.str) -> None: - r""" - Database name. - """ - @property - def username(self) -> builtins.str: - r""" - Username used to authenticate. - """ - @username.setter - def username(self, value: builtins.str) -> None: - r""" - Username used to authenticate. - """ - @property - def password(self) -> builtins.str: - r""" - Password used to authenticate. - """ - @password.setter - def password(self, value: builtins.str) -> None: - r""" - Password used to authenticate. - """ - @property - def collection_name(self) -> builtins.str: - r""" - Destination collection for inserted documents. - """ - @collection_name.setter - def collection_name(self, value: builtins.str) -> None: - r""" - Destination collection for inserted documents. - """ - @property - def max_retry(self) -> builtins.int: - r""" - Maximum number of retry attempts for a failed write. - """ - @max_retry.setter - def max_retry(self, value: builtins.int) -> None: - r""" - Maximum number of retry attempts for a failed write. - """ - @property - def retry_interval_sec(self) -> builtins.int: - r""" - Seconds to wait between retry attempts. - """ - @retry_interval_sec.setter - def retry_interval_sec(self, value: builtins.int) -> None: - r""" - Seconds to wait between retry attempts. - """ - def __new__(cls, host: builtins.str, database: builtins.str, username: builtins.str, password: builtins.str, collection_name: builtins.str, max_retry: builtins.int, retry_interval_sec: builtins.int) -> MongoAttributes: ... - -@typing.final -class MysqlAttributes: - r""" - Configuration for delivering stream batches to a MySQL database. - """ - @property - def host(self) -> builtins.str: - r""" - Database host. - """ - @host.setter - def host(self, value: builtins.str) -> None: - r""" - Database host. - """ - @property - def port(self) -> builtins.int: - r""" - Database port. - """ - @port.setter - def port(self, value: builtins.int) -> None: - r""" - Database port. - """ - @property - def database(self) -> builtins.str: - r""" - Database name. - """ - @database.setter - def database(self, value: builtins.str) -> None: - r""" - Database name. - """ - @property - def username(self) -> builtins.str: - r""" - Username used to authenticate. - """ - @username.setter - def username(self, value: builtins.str) -> None: - r""" - Username used to authenticate. - """ - @property - def password(self) -> builtins.str: - r""" - Password used to authenticate. - """ - @password.setter - def password(self, value: builtins.str) -> None: - r""" - Password used to authenticate. - """ - @property - def table_name(self) -> builtins.str: - r""" - Destination table for inserted rows. - """ - @table_name.setter - def table_name(self, value: builtins.str) -> None: - r""" - Destination table for inserted rows. - """ - @property - def max_retry(self) -> builtins.int: - r""" - Maximum number of retry attempts for a failed write. - """ - @max_retry.setter - def max_retry(self, value: builtins.int) -> None: - r""" - Maximum number of retry attempts for a failed write. - """ - @property - def retry_interval_sec(self) -> builtins.int: - r""" - Seconds to wait between retry attempts. - """ - @retry_interval_sec.setter - def retry_interval_sec(self, value: builtins.int) -> None: - r""" - Seconds to wait between retry attempts. - """ - def __new__(cls, host: builtins.str, port: builtins.int, database: builtins.str, username: builtins.str, password: builtins.str, table_name: builtins.str, max_retry: builtins.int, retry_interval_sec: builtins.int) -> MysqlAttributes: ... - @typing.final class PageInfo: r""" @@ -4752,12 +4421,12 @@ class PostgresAttributes: @property def sslmode(self) -> builtins.str: r""" - Postgres SSL mode (e.g. `disable`, `require`, `verify-full`). + Postgres SSL mode. The Quicknode API accepts only `disable` or `require`. """ @sslmode.setter def sslmode(self, value: builtins.str) -> None: r""" - Postgres SSL mode (e.g. `disable`, `require`, `verify-full`). + Postgres SSL mode. The Quicknode API accepts only `disable` or `require`. """ @property def max_retry(self) -> builtins.int: @@ -4837,103 +4506,6 @@ class RateLimitSettings: Requests per day. """ -@typing.final -class RedisAttributes: - r""" - Configuration for delivering stream batches to a Redis instance. - """ - @property - def host(self) -> builtins.str: - r""" - Redis host. - """ - @host.setter - def host(self, value: builtins.str) -> None: - r""" - Redis host. - """ - @property - def port(self) -> builtins.int: - r""" - Redis port. - """ - @port.setter - def port(self, value: builtins.int) -> None: - r""" - Redis port. - """ - @property - def database(self) -> builtins.int: - r""" - Redis logical database index. - """ - @database.setter - def database(self, value: builtins.int) -> None: - r""" - Redis logical database index. - """ - @property - def username(self) -> builtins.str: - r""" - Username used to authenticate. - """ - @username.setter - def username(self, value: builtins.str) -> None: - r""" - Username used to authenticate. - """ - @property - def password(self) -> builtins.str: - r""" - Password used to authenticate. - """ - @password.setter - def password(self, value: builtins.str) -> None: - r""" - Password used to authenticate. - """ - @property - def key_name(self) -> builtins.str: - r""" - Redis key that receives written payloads. - """ - @key_name.setter - def key_name(self, value: builtins.str) -> None: - r""" - Redis key that receives written payloads. - """ - @property - def max_retry(self) -> builtins.int: - r""" - Maximum number of retry attempts for a failed write. - """ - @max_retry.setter - def max_retry(self, value: builtins.int) -> None: - r""" - Maximum number of retry attempts for a failed write. - """ - @property - def retry_interval_sec(self) -> builtins.int: - r""" - Seconds to wait between retry attempts. - """ - @retry_interval_sec.setter - def retry_interval_sec(self, value: builtins.int) -> None: - r""" - Seconds to wait between retry attempts. - """ - @property - def tls(self) -> typing.Optional[builtins.bool]: - r""" - Whether to connect over TLS. - """ - @tls.setter - def tls(self, value: typing.Optional[builtins.bool]) -> None: - r""" - Whether to connect over TLS. - """ - def __new__(cls, host: builtins.str, port: builtins.int, database: builtins.int, username: builtins.str, password: builtins.str, key_name: builtins.str, max_retry: builtins.int, retry_interval_sec: builtins.int, tls: typing.Optional[builtins.bool] = None) -> RedisAttributes: ... - @typing.final class RemoveTeamMemberRequest: r""" @@ -5444,133 +5016,6 @@ class SingleEndpoint: Tags applied to the endpoint. """ -@typing.final -class SnowflakeAttributes: - r""" - Configuration for delivering stream batches to a Snowflake data warehouse. - """ - @property - def account(self) -> builtins.str: - r""" - Snowflake account identifier. - """ - @account.setter - def account(self, value: builtins.str) -> None: - r""" - Snowflake account identifier. - """ - @property - def host(self) -> builtins.str: - r""" - Snowflake host. - """ - @host.setter - def host(self, value: builtins.str) -> None: - r""" - Snowflake host. - """ - @property - def port(self) -> builtins.int: - r""" - Snowflake port. - """ - @port.setter - def port(self, value: builtins.int) -> None: - r""" - Snowflake port. - """ - @property - def protocol(self) -> builtins.str: - r""" - Connection protocol (e.g. `https`). - """ - @protocol.setter - def protocol(self, value: builtins.str) -> None: - r""" - Connection protocol (e.g. `https`). - """ - @property - def database(self) -> builtins.str: - r""" - Database name. - """ - @database.setter - def database(self, value: builtins.str) -> None: - r""" - Database name. - """ - @property - def schema(self) -> builtins.str: - r""" - Schema within the database. - """ - @schema.setter - def schema(self, value: builtins.str) -> None: - r""" - Schema within the database. - """ - @property - def warehouse(self) -> builtins.str: - r""" - Warehouse used to run inserts. - """ - @warehouse.setter - def warehouse(self, value: builtins.str) -> None: - r""" - Warehouse used to run inserts. - """ - @property - def username(self) -> builtins.str: - r""" - Username used to authenticate. - """ - @username.setter - def username(self, value: builtins.str) -> None: - r""" - Username used to authenticate. - """ - @property - def password(self) -> builtins.str: - r""" - Password used to authenticate. - """ - @password.setter - def password(self, value: builtins.str) -> None: - r""" - Password used to authenticate. - """ - @property - def max_retry(self) -> builtins.int: - r""" - Maximum number of retry attempts for a failed write. - """ - @max_retry.setter - def max_retry(self, value: builtins.int) -> None: - r""" - Maximum number of retry attempts for a failed write. - """ - @property - def retry_interval_sec(self) -> builtins.int: - r""" - Seconds to wait between retry attempts. - """ - @retry_interval_sec.setter - def retry_interval_sec(self, value: builtins.int) -> None: - r""" - Seconds to wait between retry attempts. - """ - @property - def table_name(self) -> typing.Optional[builtins.str]: - r""" - Optional destination table for inserted rows. - """ - @table_name.setter - def table_name(self, value: typing.Optional[builtins.str]) -> None: - r""" - Optional destination table for inserted rows. - """ - def __new__(cls, account: builtins.str, host: builtins.str, port: builtins.int, protocol: builtins.str, database: builtins.str, schema: builtins.str, warehouse: builtins.str, username: builtins.str, password: builtins.str, max_retry: builtins.int, retry_interval_sec: builtins.int, table_name: typing.Optional[builtins.str] = None) -> SnowflakeAttributes: ... - @typing.final class SolanaWalletFilterArgs: @property @@ -5682,9 +5127,9 @@ class Stream: @property def address_book_config(self) -> typing.Optional[AddressBookConfig]: ... @property - def destination_attributes(self) -> typing.Optional[typing.Union[StreamWebhookDestination, StreamS3Destination, StreamAzureDestination, StreamPostgresDestination, StreamMysqlDestination, StreamMongoDestination, StreamClickhouseDestination, StreamSnowflakeDestination, StreamKafkaDestination, StreamRedisDestination]]: ... + def destination_attributes(self) -> typing.Optional[typing.Union[StreamWebhookDestination, StreamS3Destination, StreamAzureDestination, StreamPostgresDestination, StreamKafkaDestination]]: ... @property - def extra_destinations(self) -> typing.Optional[typing.List[typing.Union[StreamWebhookDestination, StreamS3Destination, StreamAzureDestination, StreamPostgresDestination, StreamMysqlDestination, StreamMongoDestination, StreamClickhouseDestination, StreamSnowflakeDestination, StreamKafkaDestination, StreamRedisDestination]]]: ... + def extra_destinations(self) -> typing.Optional[typing.List[typing.Union[StreamWebhookDestination, StreamS3Destination, StreamAzureDestination, StreamPostgresDestination, StreamKafkaDestination]]]: ... @typing.final class StreamAzureDestination: @@ -5692,54 +5137,24 @@ class StreamAzureDestination: def attributes(self) -> AzureAttributes: ... def __new__(cls, attrs: AzureAttributes) -> StreamAzureDestination: ... -@typing.final -class StreamClickhouseDestination: - @property - def attributes(self) -> ClickhouseAttributes: ... - def __new__(cls, attrs: ClickhouseAttributes) -> StreamClickhouseDestination: ... - @typing.final class StreamKafkaDestination: @property def attributes(self) -> KafkaAttributes: ... def __new__(cls, attrs: KafkaAttributes) -> StreamKafkaDestination: ... -@typing.final -class StreamMongoDestination: - @property - def attributes(self) -> MongoAttributes: ... - def __new__(cls, attrs: MongoAttributes) -> StreamMongoDestination: ... - -@typing.final -class StreamMysqlDestination: - @property - def attributes(self) -> MysqlAttributes: ... - def __new__(cls, attrs: MysqlAttributes) -> StreamMysqlDestination: ... - @typing.final class StreamPostgresDestination: @property def attributes(self) -> PostgresAttributes: ... def __new__(cls, attrs: PostgresAttributes) -> StreamPostgresDestination: ... -@typing.final -class StreamRedisDestination: - @property - def attributes(self) -> RedisAttributes: ... - def __new__(cls, attrs: RedisAttributes) -> StreamRedisDestination: ... - @typing.final class StreamS3Destination: @property def attributes(self) -> S3Attributes: ... def __new__(cls, attrs: S3Attributes) -> StreamS3Destination: ... -@typing.final -class StreamSnowflakeDestination: - @property - def attributes(self) -> SnowflakeAttributes: ... - def __new__(cls, attrs: SnowflakeAttributes) -> StreamSnowflakeDestination: ... - @typing.final class StreamWebhookDestination: @property @@ -5748,7 +5163,7 @@ class StreamWebhookDestination: @typing.final class StreamsApiClient: - def create_stream(self, name: builtins.str, network: builtins.str, dataset: builtins.str, region: builtins.str, start_range: builtins.int, end_range: builtins.int, destination_attributes: typing.Any, plan: builtins.str, threshold_fetch_buffer: builtins.int, dataset_batch_size: typing.Optional[builtins.int] = None, max_batch_size: typing.Optional[builtins.int] = None, max_buffer_range_size: typing.Optional[builtins.int] = None, max_buffer_processing_workers: typing.Optional[builtins.int] = None, keep_distance_from_tip: typing.Optional[builtins.int] = None, filter_function: typing.Optional[builtins.str] = None, filter_language: typing.Optional[builtins.str] = None, include_stream_metadata: typing.Optional[builtins.str] = None, product_type: typing.Optional[builtins.str] = None, status: typing.Optional[builtins.str] = None, notification_email: typing.Optional[builtins.str] = None, charge_min_cap: typing.Optional[builtins.int] = None, fix_block_reorgs: typing.Optional[builtins.int] = None, elastic_batch_enabled: typing.Optional[builtins.bool] = None, extra_destinations: typing.Optional[typing.Any] = None) -> typing.Coroutine[typing.Any, typing.Any, Stream]: + def create_stream(self, name: builtins.str, network: builtins.str, dataset: builtins.str, region: builtins.str, start_range: builtins.int, end_range: builtins.int, destination_attributes: typing.Any, dataset_batch_size: builtins.int, elastic_batch_enabled: builtins.bool, plan: typing.Optional[builtins.str] = None, threshold_fetch_buffer: typing.Optional[builtins.int] = None, max_batch_size: typing.Optional[builtins.int] = None, max_buffer_range_size: typing.Optional[builtins.int] = None, max_buffer_processing_workers: typing.Optional[builtins.int] = None, keep_distance_from_tip: typing.Optional[builtins.int] = None, filter_function: typing.Optional[builtins.str] = None, filter_language: typing.Optional[builtins.str] = None, include_stream_metadata: typing.Optional[builtins.str] = None, product_type: typing.Optional[builtins.str] = None, status: typing.Optional[builtins.str] = None, notification_email: typing.Optional[builtins.str] = None, charge_min_cap: typing.Optional[builtins.int] = None, fix_block_reorgs: typing.Optional[builtins.int] = None, extra_destinations: typing.Optional[typing.Any] = None) -> typing.Coroutine[typing.Any, typing.Any, Stream]: r""" Creates a new Stream on a given blockchain network and dataset, delivering batches to the configured destination. Start from a specific block for @@ -6762,12 +6177,12 @@ class WebhookAttributes: @property def max_retry(self) -> builtins.int: r""" - Maximum number of retry attempts for a failed delivery. + Maximum number of retry attempts for a failed delivery. Must be in the range 1–10. """ @max_retry.setter def max_retry(self, value: builtins.int) -> None: r""" - Maximum number of retry attempts for a failed delivery. + Maximum number of retry attempts for a failed delivery. Must be in the range 1–10. """ @property def retry_interval_sec(self) -> builtins.int: @@ -6792,24 +6207,24 @@ class WebhookAttributes: @property def security_token(self) -> typing.Optional[builtins.str]: r""" - Optional token included with each request so the receiver can verify authenticity. + Optional token included with each request so the receiver can verify authenticity. When supplied, must be at least 32 bytes (256 bits). """ @security_token.setter def security_token(self, value: typing.Optional[builtins.str]) -> None: r""" - Optional token included with each request so the receiver can verify authenticity. + Optional token included with each request so the receiver can verify authenticity. When supplied, must be at least 32 bytes (256 bits). """ @property - def compression(self) -> builtins.str: + def compression(self) -> typing.Optional[builtins.str]: r""" - Compression applied to the payload (e.g. `none`, `gzip`). + Compression applied to the payload (e.g. `none`, `gzip`). When omitted the server defaults to no compression. """ @compression.setter - def compression(self, value: builtins.str) -> None: + def compression(self, value: typing.Optional[builtins.str]) -> None: r""" - Compression applied to the payload (e.g. `none`, `gzip`). + Compression applied to the payload (e.g. `none`, `gzip`). When omitted the server defaults to no compression. """ - def __new__(cls, url: builtins.str, max_retry: builtins.int, retry_interval_sec: builtins.int, post_timeout_sec: builtins.int, compression: builtins.str, security_token: typing.Optional[builtins.str] = None) -> WebhookAttributes: ... + def __new__(cls, url: builtins.str, max_retry: builtins.int, retry_interval_sec: builtins.int, post_timeout_sec: builtins.int, compression: typing.Optional[builtins.str] = None, security_token: typing.Optional[builtins.str] = None) -> WebhookAttributes: ... @typing.final class WebhookDestinationAttributes: diff --git a/python/sdk/init_manual_override.pyi b/python/sdk/init_manual_override.pyi index b0adb7f..c0a3745 100644 --- a/python/sdk/init_manual_override.pyi +++ b/python/sdk/init_manual_override.pyi @@ -14,22 +14,12 @@ from sdk._core import ( S3Attributes, AzureAttributes, PostgresAttributes, - MysqlAttributes, - MongoAttributes, - ClickhouseAttributes, - SnowflakeAttributes, KafkaAttributes, - RedisAttributes, StreamWebhookDestination, StreamS3Destination, StreamAzureDestination, StreamPostgresDestination, - StreamMysqlDestination, - StreamMongoDestination, - StreamClickhouseDestination, - StreamSnowflakeDestination, StreamKafkaDestination, - StreamRedisDestination, AddressBookConfig, Endpoint, EndpointTag, @@ -216,22 +206,12 @@ __all__ = [ "S3Attributes", "AzureAttributes", "PostgresAttributes", - "MysqlAttributes", - "MongoAttributes", - "ClickhouseAttributes", - "SnowflakeAttributes", "KafkaAttributes", - "RedisAttributes", "StreamWebhookDestination", "StreamS3Destination", "StreamAzureDestination", "StreamPostgresDestination", - "StreamMysqlDestination", - "StreamMongoDestination", - "StreamClickhouseDestination", - "StreamSnowflakeDestination", "StreamKafkaDestination", - "StreamRedisDestination", "AddressBookConfig", "StreamsConfig", "Endpoint", diff --git a/ruby/sig/quicknode_sdk.rbs b/ruby/sig/quicknode_sdk.rbs index b562352..0ef4ab4 100644 --- a/ruby/sig/quicknode_sdk.rbs +++ b/ruby/sig/quicknode_sdk.rbs @@ -35,16 +35,11 @@ module QuicknodeSdk end class DestinationAttributes - def self.webhook: (url: String, ?max_retry: Integer, ?retry_interval_sec: Integer, ?post_timeout_sec: Integer, ?security_token: String, compression: String) -> DestinationAttributes + def self.webhook: (url: String, ?max_retry: Integer, ?retry_interval_sec: Integer, ?post_timeout_sec: Integer, ?security_token: String, ?compression: String) -> DestinationAttributes def self.s3: (endpoint: String, access_key: String, secret_key: String, bucket: String, object_prefix: String, compression: String, file_type: String, ?max_retry: Integer, ?retry_interval_sec: Integer, ?use_ssl: bool) -> DestinationAttributes def self.azure: (storage_account: String, sas_token: String, container: String, compression: String, file_type: String, ?max_retry: Integer, ?retry_interval_sec: Integer, ?blob_prefix: String) -> DestinationAttributes def self.postgres: (host: String, ?port: Integer, database: String, username: String, password: String, table_name: String, sslmode: String, ?max_retry: Integer, ?retry_interval_sec: Integer) -> DestinationAttributes - def self.mysql: (host: String, ?port: Integer, database: String, username: String, password: String, table_name: String, ?max_retry: Integer, ?retry_interval_sec: Integer) -> DestinationAttributes - def self.mongo: (host: String, database: String, username: String, password: String, collection_name: String, ?max_retry: Integer, ?retry_interval_sec: Integer) -> DestinationAttributes - def self.clickhouse: (hosts: String, database: String, username: String, password: String, table_name: String, default_table_engine_opts: String, ?default_granularity: Integer, default_compression: String, default_index_type: String, ?max_retry: Integer, ?retry_interval_sec: Integer, ?disable_datetime_precision: bool, ?dont_support_rename_column: bool, ?dont_support_empty_default_value: bool, ?skip_initialize_with_version: bool) -> DestinationAttributes - def self.snowflake: (account: String, host: String, ?port: Integer, protocol: String, database: String, schema: String, warehouse: String, username: String, password: String, ?max_retry: Integer, ?retry_interval_sec: Integer, ?table_name: String) -> DestinationAttributes - def self.kafka: (bootstrap_servers: String, topic_name: String, compression_type: String, ?batch_size: Integer, ?linger_ms: Integer, ?max_request_size: Integer, ?timeout_sec: Integer, ?max_retry: Integer, ?retry_interval_sec: Integer, ?username: String, ?password: String, ?protocol: String, ?mechanisms: String) -> DestinationAttributes - def self.redis: (host: String, ?port: Integer, ?database: Integer, username: String, password: String, key_name: String, ?max_retry: Integer, ?retry_interval_sec: Integer, ?tls: bool) -> DestinationAttributes + def self.kafka: (bootstrap_servers: String, topic_name: String, compression_type: String, ?batch_size: Integer, ?linger_ms: Integer, ?max_message_bytes: Integer, ?timeout_sec: Integer, ?max_retry: Integer, ?retry_interval_sec: Integer, ?username: String, ?password: String, ?protocol: String, ?mechanisms: String) -> DestinationAttributes end class Admin @@ -115,7 +110,7 @@ module QuicknodeSdk class Streams def initialize: (untyped native) -> void - def create_stream: (name: String, network: String, dataset: String, region: String, start_range: Integer, end_range: Integer, destination_attributes: DestinationAttributes, plan: String, threshold_fetch_buffer: Integer, ?dataset_batch_size: Integer, ?max_batch_size: Integer, ?max_buffer_range_size: Integer, ?max_buffer_processing_workers: Integer, ?keep_distance_from_tip: Integer, ?filter_function: String, ?filter_language: String, ?include_stream_metadata: String, ?product_type: String, ?status: String, ?notification_email: String, ?charge_min_cap: Integer, ?fix_block_reorgs: Integer, ?elastic_batch_enabled: bool, ?extra_destinations: Array[DestinationAttributes]) -> untyped + def create_stream: (name: String, network: String, dataset: String, region: String, start_range: Integer, end_range: Integer, destination_attributes: DestinationAttributes, dataset_batch_size: Integer, elastic_batch_enabled: bool, ?plan: String, ?threshold_fetch_buffer: Integer, ?max_batch_size: Integer, ?max_buffer_range_size: Integer, ?max_buffer_processing_workers: Integer, ?keep_distance_from_tip: Integer, ?filter_function: String, ?filter_language: String, ?include_stream_metadata: String, ?product_type: String, ?status: String, ?notification_email: String, ?charge_min_cap: Integer, ?fix_block_reorgs: Integer, ?extra_destinations: Array[DestinationAttributes]) -> untyped def list_streams: (?stream_type: String, ?offset: Integer, ?limit: Integer, ?order_by: String, ?order_direction: String) -> untyped def delete_all_streams: () -> void def get_stream: (id: String) -> untyped