prepare crate for publishing
This commit is contained in:
parent
11b92d78a0
commit
b5a961d7cc
4 changed files with 54 additions and 38 deletions
38
ferrtable/Cargo.lock
generated
38
ferrtable/Cargo.lock
generated
|
@ -233,7 +233,7 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ferrtable"
|
name = "ferrtable"
|
||||||
version = "0.1.0"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"derive_builder",
|
"derive_builder",
|
||||||
|
@ -546,9 +546,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iana-time-zone"
|
name = "iana-time-zone"
|
||||||
version = "0.1.63"
|
version = "0.1.64"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8"
|
checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android_system_properties",
|
"android_system_properties",
|
||||||
"core-foundation-sys",
|
"core-foundation-sys",
|
||||||
|
@ -1540,15 +1540,15 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-core"
|
name = "windows-core"
|
||||||
version = "0.61.2"
|
version = "0.62.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
|
checksum = "57fe7168f7de578d2d8a05b07fd61870d2e73b4020e9f49aa00da8471723497c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-implement",
|
"windows-implement",
|
||||||
"windows-interface",
|
"windows-interface",
|
||||||
"windows-link 0.1.3",
|
"windows-link 0.2.0",
|
||||||
"windows-result",
|
"windows-result 0.4.0",
|
||||||
"windows-strings",
|
"windows-strings 0.5.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1592,8 +1592,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e"
|
checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-link 0.1.3",
|
"windows-link 0.1.3",
|
||||||
"windows-result",
|
"windows-result 0.3.4",
|
||||||
"windows-strings",
|
"windows-strings 0.4.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1605,6 +1605,15 @@ dependencies = [
|
||||||
"windows-link 0.1.3",
|
"windows-link 0.1.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-result"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7084dcc306f89883455a206237404d3eaf961e5bd7e0f312f7c91f57eb44167f"
|
||||||
|
dependencies = [
|
||||||
|
"windows-link 0.2.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-strings"
|
name = "windows-strings"
|
||||||
version = "0.4.2"
|
version = "0.4.2"
|
||||||
|
@ -1614,6 +1623,15 @@ dependencies = [
|
||||||
"windows-link 0.1.3",
|
"windows-link 0.1.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-strings"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7218c655a553b0bed4426cf54b20d7ba363ef543b52d515b3e48d7fd55318dda"
|
||||||
|
dependencies = [
|
||||||
|
"windows-link 0.2.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-sys"
|
name = "windows-sys"
|
||||||
version = "0.52.0"
|
version = "0.52.0"
|
||||||
|
|
|
@ -1,17 +1,24 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ferrtable"
|
name = "ferrtable"
|
||||||
version = "0.1.0"
|
version = "0.0.1"
|
||||||
|
categories = ["api-bindings"]
|
||||||
|
description = "Ferris the crab's favorite Airtable library"
|
||||||
|
homepage = "https://forge.secondsystemtech.com/brent/ferrtable"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
keywords = ["api", "client"]
|
||||||
|
license = "MIT"
|
||||||
|
readme = "README.md"
|
||||||
|
repository = "https://forge.secondsystemtech.com/brent/ferrtable"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
derive_builder = { version = "0.20.2", features = ["clippy"] }
|
|
||||||
futures = "0.3.31"
|
|
||||||
percent-encoding = "2.3.2"
|
|
||||||
reqwest = { version = "0.12.23", features = ["json"] }
|
|
||||||
serde = { version = "1.0.219", features = ["derive"] }
|
|
||||||
serde_json = "1.0.143"
|
|
||||||
thiserror = "2.0.16"
|
|
||||||
chrono = { version = "0.4.42", features = ["serde"], optional = true }
|
chrono = { version = "0.4.42", features = ["serde"], optional = true }
|
||||||
|
derive_builder = { version = "0.20.2" }
|
||||||
|
futures = "0.3"
|
||||||
|
percent-encoding = "2.3"
|
||||||
|
reqwest = { version = "0.12", features = ["json"] }
|
||||||
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
serde_json = "1.0"
|
||||||
|
thiserror = "2.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
chrono = ["dep:chrono"]
|
chrono = ["dep:chrono"]
|
||||||
|
|
|
@ -55,7 +55,7 @@ enum Status {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
let client = ferrtable::Client::new_from_access_token("******").unwrap();
|
let client = ferrtable::Client::new_from_access_token("******").unwrap();
|
||||||
|
|
||||||
client
|
client
|
||||||
|
@ -68,24 +68,20 @@ async fn main() {
|
||||||
}])
|
}])
|
||||||
.with_base_id("***".to_owned())
|
.with_base_id("***".to_owned())
|
||||||
.with_table_id("***".to_owned())
|
.with_table_id("***".to_owned())
|
||||||
.build()
|
.build()?
|
||||||
.unwrap()
|
|
||||||
.execute()
|
.execute()
|
||||||
.await
|
.await?;
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let mut rec_stream = client
|
let mut rec_stream = client
|
||||||
.list_records()
|
.list_records()
|
||||||
.with_base_id("***".to_owned())
|
.with_base_id("***".to_owned())
|
||||||
.with_table_id("***".to_owned())
|
.with_table_id("***".to_owned())
|
||||||
.with_filter("{status} = 'Todo' || {status} = 'In Progress'".to_owned())
|
.with_filter("{status} = 'Todo' || {status} = 'In Progress'".to_owned())
|
||||||
.build()
|
.build()?
|
||||||
.unwrap()
|
|
||||||
.stream_items::<MyRecord>();
|
.stream_items::<MyRecord>();
|
||||||
|
|
||||||
while let Some(result) = rec_stream.next().await {
|
while let Some(result) = rec_stream.next().await {
|
||||||
let rec = result.unwrap();
|
dbg!(result?.fields);
|
||||||
dbg!(rec.fields);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -52,11 +52,9 @@ impl Client {
|
||||||
/// ])
|
/// ])
|
||||||
/// .with_base_id("***".to_owned())
|
/// .with_base_id("***".to_owned())
|
||||||
/// .with_table_id("***".to_owned())
|
/// .with_table_id("***".to_owned())
|
||||||
/// .build()
|
/// .build()?
|
||||||
/// .unwrap()
|
|
||||||
/// .execute()
|
/// .execute()
|
||||||
/// .await
|
/// .await?;
|
||||||
/// .unwrap();
|
|
||||||
/// ```
|
/// ```
|
||||||
pub fn create_records<I, T>(&self, records: I) -> CreateRecordsQueryBuilder<T>
|
pub fn create_records<I, T>(&self, records: I) -> CreateRecordsQueryBuilder<T>
|
||||||
where
|
where
|
||||||
|
@ -79,12 +77,11 @@ impl Client {
|
||||||
///
|
///
|
||||||
/// let mut base_stream = client
|
/// let mut base_stream = client
|
||||||
/// .list_bases()
|
/// .list_bases()
|
||||||
/// .build()
|
/// .build()?
|
||||||
/// .unwrap()
|
|
||||||
/// .stream_items();
|
/// .stream_items();
|
||||||
///
|
///
|
||||||
/// while let Some(result) = base_stream.next().await {
|
/// while let Some(result) = base_stream.next().await {
|
||||||
/// dbg!(result.unwrap());
|
/// dbg!(result?);
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub fn list_bases(&self) -> ListBasesQueryBuilder {
|
pub fn list_bases(&self) -> ListBasesQueryBuilder {
|
||||||
|
@ -104,13 +101,11 @@ impl Client {
|
||||||
/// .list_records()
|
/// .list_records()
|
||||||
/// .with_base_id("***")
|
/// .with_base_id("***")
|
||||||
/// .with_table_id("***")
|
/// .with_table_id("***")
|
||||||
/// .build()
|
/// .build()?
|
||||||
/// .unwrap()
|
|
||||||
/// .stream_items::<HashMap<String, serde_json::Value>>();
|
/// .stream_items::<HashMap<String, serde_json::Value>>();
|
||||||
///
|
///
|
||||||
/// while let Some(result) = rec_stream.next().await {
|
/// while let Some(result) = rec_stream.next().await {
|
||||||
/// let rec = result.unwrap();
|
/// dbg!(rec?.fields);
|
||||||
/// dbg!(rec.fields);
|
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub fn list_records(&self) -> ListRecordsQueryBuilder {
|
pub fn list_records(&self) -> ListRecordsQueryBuilder {
|
||||||
|
|
Loading…
Add table
Reference in a new issue