From 8e42cbf4b0e6e0e98c312feff67f7ea73a529ce2 Mon Sep 17 00:00:00 2001 From: siddhantCodes Date: Tue, 19 Aug 2025 11:25:29 +0530 Subject: [PATCH 1/5] Remove examples that don't compile --- examples/003-migration/README.md | 2 + examples/auth-provider/Cargo.lock | 683 ------------------ examples/auth-provider/Cargo.toml | 12 - examples/auth-provider/src/lib.rs | 69 -- examples/hello-world-diesel/Cargo.toml | 21 - examples/hello-world-diesel/FASTN.ftd | 7 - examples/hello-world-diesel/README.md | 42 -- examples/hello-world-diesel/build.sh | 2 - examples/hello-world-diesel/index.ftd | 12 - .../migrations/0001-create-todo-iterm.sql | 6 - examples/hello-world-diesel/src/lib.rs | 108 --- examples/sample-pg/Cargo.lock | 244 +++++-- examples/sample-pg/src/lib.rs | 4 - examples/sample-sqlite/Cargo.lock | 245 +++++-- 14 files changed, 375 insertions(+), 1082 deletions(-) delete mode 100644 examples/auth-provider/Cargo.lock delete mode 100644 examples/auth-provider/Cargo.toml delete mode 100644 examples/auth-provider/src/lib.rs delete mode 100644 examples/hello-world-diesel/Cargo.toml delete mode 100644 examples/hello-world-diesel/FASTN.ftd delete mode 100644 examples/hello-world-diesel/README.md delete mode 100644 examples/hello-world-diesel/build.sh delete mode 100644 examples/hello-world-diesel/index.ftd delete mode 100644 examples/hello-world-diesel/migrations/0001-create-todo-iterm.sql delete mode 100644 examples/hello-world-diesel/src/lib.rs diff --git a/examples/003-migration/README.md b/examples/003-migration/README.md index 6c89269..5855da7 100644 --- a/examples/003-migration/README.md +++ b/examples/003-migration/README.md @@ -1,3 +1,5 @@ # Migrations - fastn + wasm This example demonstrates how to do database migrations in a fastn powered app. + +The migration is written in [./FASTN.ftd](./FASTN.ftd) file. diff --git a/examples/auth-provider/Cargo.lock b/examples/auth-provider/Cargo.lock deleted file mode 100644 index d397323..0000000 --- a/examples/auth-provider/Cargo.lock +++ /dev/null @@ -1,683 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" - -[[package]] -name = "auth-provider" -version = "0.1.0" -dependencies = [ - "bytes", - "diesel", - "ft-sdk", - "http", - "serde_json", - "thiserror", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" - -[[package]] -name = "cc" -version = "1.0.97" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets", -] - -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "diesel" -version = "2.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04001f23ba8843dc315804fa324000376084dfb1c30794ff68dd279e6e5696d5" -dependencies = [ - "bitflags 2.5.0", - "byteorder", - "chrono", - "diesel_derives", - "itoa", - "serde_json", -] - -[[package]] -name = "diesel_derives" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f2c3de51e2ba6bf2a648285696137aaf0f5f487bcbea93972fe8a364e131a4" -dependencies = [ - "diesel_table_macro_syntax", - "dsl_auto_type", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "diesel_table_macro_syntax" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" -dependencies = [ - "syn", -] - -[[package]] -name = "dsl_auto_type" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139ae9aca7527f85f26dd76483eb38533fd84bd571065da1739656ef71c5ff5b" -dependencies = [ - "darling", - "either", - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "ft-derive" -version = "0.2.1" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "ft-sdk" -version = "0.6.3" -dependencies = [ - "anyhow", - "bytes", - "chrono", - "diesel", - "ft-derive", - "ft-sys", - "ft-sys-shared", - "http", - "rand", - "rand_core 0.6.4", - "serde", - "serde_json", - "serde_urlencoded", - "thiserror", - "uuid", -] - -[[package]] -name = "ft-sys" -version = "0.3.0" -dependencies = [ - "bytes", - "chrono", - "diesel", - "diesel_derives", - "ft-sys-shared", - "http", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "ft-sys-shared" -version = "0.2.1" -dependencies = [ - "bytes", - "chrono", - "http", - "serde", - "serde_json", - "smallvec", - "thiserror", -] - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "libc" -version = "0.2.154" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" - -[[package]] -name = "log" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "proc-macro2" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "winapi", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "serde" -version = "1.0.202" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.202" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "2.0.0-alpha.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d44cfb396c3caf6fbfd0ab422af02631b69ddd96d2eff0b0f0724f9024051b" -dependencies = [ - "serde", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "2.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "uuid" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/examples/auth-provider/Cargo.toml b/examples/auth-provider/Cargo.toml deleted file mode 100644 index ee2cd74..0000000 --- a/examples/auth-provider/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "auth-provider" -version = "0.1.0" -edition = "2021" - -[dependencies] -ft-sdk = { path = "../../ft-sdk", features = ["auth-provider"] } -http = "1" -bytes = "1" -serde_json = "1" -thiserror = "2" -diesel = "2" diff --git a/examples/auth-provider/src/lib.rs b/examples/auth-provider/src/lib.rs deleted file mode 100644 index 960d9d3..0000000 --- a/examples/auth-provider/src/lib.rs +++ /dev/null @@ -1,69 +0,0 @@ -const PROVIDER_ID: &str = "sample"; -const HASHED_PASSWORD: &str = "hashed-password"; - -#[ft_sdk::handle_http] -fn handle(in_: ft_sdk::In, mut conn: ft_sdk::Connection) -> ft_sdk::chr::Result { - match in_.req.uri().path() { - "/create-account/" => create_account(in_, &mut conn), - t => Err(ft_sdk::not_found!("unhandled path: {t}")), - } -} - -fn create_account(in_: ft_sdk::In, conn: &mut ft_sdk::Connection) -> ft_sdk::chr::Result { - use ft_sdk::JsonBodyExt; - let (email, password): (String, String) = in_.req.required2("email", "password")?; - - let mut errors = std::collections::HashMap::new(); - - validate_email(conn, email.as_str(), &mut errors); - validate_strong_password(password.as_str(), &mut errors); - - if !errors.is_empty() { - return Err(ft_sdk::chr::Error::Form(errors)); - } - - let user_id = ft_sdk::auth::provider::create_user( - conn, - PROVIDER_ID, - email.as_str(), - to_provider_data(email.as_str(), password.as_str()), - )?; - - // TODO: not fond of create_user not logging user in. There is no use case yet for - // create user which is not followed right after by logging in, so create_user - // should also log user in. - ft_sdk::auth::provider::login(conn, in_.clone(), &user_id, PROVIDER_ID, &email)?; - - // TODO: get next argument - ft_sdk::chr::redirect("/") -} - -fn validate_strong_password( - password: &str, - errors: &mut std::collections::HashMap, -) { - if password == "weak" { - errors.insert("password".to_string(), "password is too weak".to_string()); - } -} - -fn validate_email( - conn: &mut ft_sdk::Connection, - email: &str, - errors: &mut std::collections::HashMap, -) { - if ft_sdk::auth::provider::user_data_by_email(conn, "provider", email).is_ok() { - errors.insert("email".to_string(), "email already exists".to_string()); - } -} - -fn to_provider_data(email: &str, password: &str) -> Vec { - vec![ - ft_sdk::auth::UserData::Email(email.to_string()), - ft_sdk::auth::UserData::Identity(email.to_string()), - ft_sdk::auth::UserData::Custom { - key: HASHED_PASSWORD.to_string(), - value: password.into(), - }, - ] -} diff --git a/examples/hello-world-diesel/Cargo.toml b/examples/hello-world-diesel/Cargo.toml deleted file mode 100644 index b1c32a6..0000000 --- a/examples/hello-world-diesel/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "hello-world-diesel" -version = "0.1.0" -authors.workspace = true -edition.workspace = true -description.workspace = true -license.workspace = true -repository.workspace = true -homepage.workspace = true - -[lib] -crate-type = ["cdylib"] - -[dependencies] -ft-sdk = { path = "../../ft-sdk" } -http = "1" -bytes = "1" -serde = { version = "1", features = ["derive"] } -serde_json = "1" -include_dir = "0.7" -diesel = { version = "2", default-features = false } diff --git a/examples/hello-world-diesel/FASTN.ftd b/examples/hello-world-diesel/FASTN.ftd deleted file mode 100644 index 07b7ee1..0000000 --- a/examples/hello-world-diesel/FASTN.ftd +++ /dev/null @@ -1,7 +0,0 @@ --- import: fastn - --- fastn.package: hello-world - --- fastn.url-mappings: - -/wasm/* -> wasm+proxy://hello_world.wasm/* \ No newline at end of file diff --git a/examples/hello-world-diesel/README.md b/examples/hello-world-diesel/README.md deleted file mode 100644 index bf0f5f6..0000000 --- a/examples/hello-world-diesel/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# hello world - fastn + wasm - -This is a simple example of how to use fastn with wasm. To run this example, you need -to have fastn installed. You can start the server using: - -```shell -# make sure you are in hello-world directory -fastn serve --port 8001 -### Server Started ### -Go to: http://127.0.0.1:8001 -``` - -This runs fastn server on port 8001. You can also omit the port number to run it on the -first free port starting 8000. - -# Building WebAssembly - -```shell -cargo build --target wasm32-unknown-unknown --release - -# you may have to run `rustup target add wasm32-unknown-unknown` to add the target -``` - -The above command will build the wasm file in `../../target/wasm32-unknown-unknown/release/hello_world.wasm`. -The target folder in `../../` because this example is part of a cargo workspace, if you are -following along, the target folder will be in the current folder. - -Let's copy the wasm file to current folder: - -```shell -cp ../../target/wasm32-unknown-unknown/release/hello_world.wasm . -``` - -You can use the `build.sh` script to build the wasm file and copy it to the current folder: - -```shell -sh build.sh -``` - -# Restart the server - -Every time you rebuild the wasm file, you need to restart the server to see the changes. \ No newline at end of file diff --git a/examples/hello-world-diesel/build.sh b/examples/hello-world-diesel/build.sh deleted file mode 100644 index 88d56f6..0000000 --- a/examples/hello-world-diesel/build.sh +++ /dev/null @@ -1,2 +0,0 @@ -cargo build --target wasm32-unknown-unknown --release -cp ../../target/wasm32-unknown-unknown/release/hello_world.wasm . \ No newline at end of file diff --git a/examples/hello-world-diesel/index.ftd b/examples/hello-world-diesel/index.ftd deleted file mode 100644 index 46bc863..0000000 --- a/examples/hello-world-diesel/index.ftd +++ /dev/null @@ -1,12 +0,0 @@ --- import: fastn/processors as pr - --- ftd.text: hello world - --- record todo: -integer id: -string text: -boolean done: - --- todo list todos: -$processor$: pr.http -url: /wasm/list/ diff --git a/examples/hello-world-diesel/migrations/0001-create-todo-iterm.sql b/examples/hello-world-diesel/migrations/0001-create-todo-iterm.sql deleted file mode 100644 index 67bd762..0000000 --- a/examples/hello-world-diesel/migrations/0001-create-todo-iterm.sql +++ /dev/null @@ -1,6 +0,0 @@ -CREATE TABLE "todo_item" -( - "id" INTEGER PRIMARY KEY, - "text" TEXT NOT NULL, - "is_done" INTEGER NOT NULL DEFAULT 0 -); \ No newline at end of file diff --git a/examples/hello-world-diesel/src/lib.rs b/examples/hello-world-diesel/src/lib.rs deleted file mode 100644 index 448f1b0..0000000 --- a/examples/hello-world-diesel/src/lib.rs +++ /dev/null @@ -1,108 +0,0 @@ -use diesel::prelude::*; - -#[derive(ft_sdk::Migration)] -// by default only returns migrations in migrations folder, to change migration -// folder also add #[migration_folder = "path/to/migrations"]. -// if you want to also pass functions, then manually implement the trait instead -// of using the derive macro -struct Migration { - pub conn: ft_sdk::Connection, -} - -#[ft_sdk::migration] -fn migration() -> ft_sdk::Migration { - ft_sdk::Migration { - app_name: "hello-world", - migration_sqls: include_dir::include_dir!("migrations"), - migration_functions: vec![], - } -} - -#[ft_sdk::handle_http] -fn handle(in_: ft_sdk::In, mut conn: ft_sdk::Connection) -> ft_sdk::http::Result { - ft_sdk::migrate_simple!("hello-world", &in_, &mut conn)?; - - match in_.req.uri().path() { - "/list/" => list(&mut conn), - "/add/" => add(&in_, &mut conn), - "/mark-done/" => mark_done(&in_, &mut conn), - "/delete/" => delete(&in_, &mut conn), - t => Err(ft_sdk::not_found!("unhandled path: {t}")), - } -} - -table! { - todo_item { - id -> Integer, - text -> Text, - is_done -> Bool, - } -} - -#[derive(diesel::Queryable, diesel::Selectable, Debug, serde::Serialize)] -#[diesel(table_name = todo_item)] -struct TodoItem { - id: i32, - text: String, - is_done: bool, -} - -/// list() returns list of todos. -/// -/// this view should be called from ftd file using http processor -fn list(conn: &mut ft_sdk::Connection) -> ft_sdk::http::Result { - let items: Vec = todo_item::table - .select(TodoItem::as_select()) - .get_results(conn) - .unwrap(); - - ft_sdk::http::json(items) -} - -/// add a new item -/// -/// this should be called from ftd.http() method from frontend. it tells ftd.js -/// to reload the page after adding the item -fn add(in_: &ft_sdk::In, conn: &mut ft_sdk::Connection) -> ft_sdk::http::Result { - use ft_sdk::JsonBodyExt; - - let text: String = in_.req.required("text")?; - - diesel::insert_into(todo_item::table) - .values((todo_item::text.eq(text), todo_item::is_done.eq(false))) - .execute(conn)?; - - ft_sdk::http::reload() -} - -/// mark an item as done -/// -/// this should be called from ftd.http() method from frontend. it tells ftd.js -/// to reload the page after updating the item -fn mark_done(in_: &ft_sdk::In, conn: &mut ft_sdk::Connection) -> ft_sdk::http::Result { - use ft_sdk::JsonBodyExt; - - let (id, done): (i32, bool) = in_.req.required2("id", "done").unwrap(); - - diesel::update(todo_item::table.find(id)) - .set(todo_item::is_done.eq(done)) - .execute(conn) - .unwrap(); - - ft_sdk::http::reload() -} - -/// delete an item -/// -/// this should be called from ftd.http() method from frontend. it tells ftd.js -/// to reload the page after deleting the item -fn delete(in_: &ft_sdk::In, conn: &mut ft_sdk::Connection) -> ft_sdk::http::Result { - use ft_sdk::JsonBodyExt; - - let id: i32 = in_.req.required("id").unwrap(); - diesel::delete(todo_item::table.find(id)) - .execute(conn) - .unwrap(); - - ft_sdk::http::reload() -} diff --git a/examples/sample-pg/Cargo.lock b/examples/sample-pg/Cargo.lock index 789aba1..5cf9fed 100644 --- a/examples/sample-pg/Cargo.lock +++ b/examples/sample-pg/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "android-tzdata" @@ -17,12 +17,24 @@ dependencies = [ "libc", ] +[[package]] +name = "anyhow" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" + [[package]] name = "autocfg" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "bitflags" version = "2.5.0" @@ -72,19 +84,63 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "core-foundation-sys" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "diesel" -version = "2.1.5" +version = "2.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03fc05c17098f21b89bc7d98fe1dd3cce2c11c2ad8e145f2a44fe08ed28eb559" +checksum = "229850a212cd9b84d4f0290ad9d294afc0ae70fccaa8949dbe8b43ffafa1e20c" dependencies = [ - "bitflags", + "bitflags 2.5.0", "byteorder", "chrono", "diesel_derives", @@ -94,11 +150,12 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.1.3" +version = "2.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d02eecb814ae714ffe61ddc2db2dd03e6c49a42e269b5001355500d431cce0c" +checksum = "1b96984c469425cb577bf6f17121ecb3e4fe1e81de5d8f780dd372802858d756" dependencies = [ "diesel_table_macro_syntax", + "dsl_auto_type", "proc-macro2", "quote", "syn", @@ -106,13 +163,33 @@ dependencies = [ [[package]] name = "diesel_table_macro_syntax" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" +checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" dependencies = [ "syn", ] +[[package]] +name = "dsl_auto_type" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139ae9aca7527f85f26dd76483eb38533fd84bd571065da1739656ef71c5ff5b" +dependencies = [ + "darling", + "either", + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + [[package]] name = "fnv" version = "1.0.7" @@ -120,34 +197,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +name = "ft-derive" +version = "0.2.1" dependencies = [ - "percent-encoding", + "quote", + "syn", ] [[package]] name = "ft-sdk" -version = "0.1.2" +version = "0.6.3" dependencies = [ + "anyhow", "bytes", "chrono", "diesel", + "ft-derive", "ft-sys", + "ft-sys-shared", "http", - "include_dir", - "rand_core", + "rand", + "rand_core 0.6.4", "serde", "serde_json", - "serde_urlencoded", "thiserror", + "uuid", ] [[package]] name = "ft-sys" -version = "0.1.2" +version = "0.3.0" dependencies = [ "bytes", "chrono", @@ -157,19 +236,34 @@ dependencies = [ "http", "serde", "serde_json", + "thiserror", ] [[package]] name = "ft-sys-shared" -version = "0.1.1-alpha.2" +version = "0.2.1" dependencies = [ "bytes", "chrono", "http", "serde", + "serde_json", + "smallvec", "thiserror", ] +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "http" version = "1.1.0" @@ -205,23 +299,10 @@ dependencies = [ ] [[package]] -name = "include_dir" -version = "0.7.3" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" -dependencies = [ - "include_dir_macros", -] - -[[package]] -name = "include_dir_macros" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" -dependencies = [ - "proc-macro2", - "quote", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "itoa" @@ -265,17 +346,11 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] @@ -289,6 +364,34 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "winapi", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + [[package]] name = "rand_core" version = "0.6.4" @@ -344,22 +447,25 @@ dependencies = [ ] [[package]] -name = "serde_urlencoded" -version = "0.7.1" +name = "smallvec" +version = "2.0.0-alpha.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +checksum = "87b96efa4bd6bdd2ff0c6615cc36fc4970cbae63cfd46ddff5cee35a1b4df570" dependencies = [ - "form_urlencoded", - "itoa", - "ryu", "serde", ] +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" -version = "2.0.60" +version = "2.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ "proc-macro2", "quote", @@ -368,18 +474,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "80d76d3f064b981389ecb4b6b7f45a0bf9fdac1d5b9204c7bd6714fecc302850" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "44d29feb33e986b6ea906bd9c3559a856983f92371b3eaa5e83782a351623de0" dependencies = [ "proc-macro2", "quote", @@ -392,6 +498,12 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "uuid" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f33196643e165781c20a5ead5582283a7dacbb87855d867fbc2df3f81eddc1be" + [[package]] name = "wasm-bindgen" version = "0.2.92" @@ -446,6 +558,28 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows-core" version = "0.52.0" diff --git a/examples/sample-pg/src/lib.rs b/examples/sample-pg/src/lib.rs index 26c8b83..d9fba09 100644 --- a/examples/sample-pg/src/lib.rs +++ b/examples/sample-pg/src/lib.rs @@ -9,7 +9,3 @@ pub extern "C" fn main_ft() { ft_sdk::http::send_response(http::Response::new(diesel::t().into())); ft_sdk::println!("helloa asd wasm: {}", req.uri().path()); } - - - - diff --git a/examples/sample-sqlite/Cargo.lock b/examples/sample-sqlite/Cargo.lock index 4a46182..c4ffa9d 100644 --- a/examples/sample-sqlite/Cargo.lock +++ b/examples/sample-sqlite/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "android-tzdata" @@ -17,12 +17,24 @@ dependencies = [ "libc", ] +[[package]] +name = "anyhow" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" + [[package]] name = "autocfg" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "bitflags" version = "2.5.0" @@ -72,19 +84,63 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "core-foundation-sys" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "diesel" -version = "2.1.5" +version = "2.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03fc05c17098f21b89bc7d98fe1dd3cce2c11c2ad8e145f2a44fe08ed28eb559" +checksum = "229850a212cd9b84d4f0290ad9d294afc0ae70fccaa8949dbe8b43ffafa1e20c" dependencies = [ - "bitflags", + "bitflags 2.5.0", "byteorder", "chrono", "diesel_derives", @@ -94,11 +150,12 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.1.3" +version = "2.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d02eecb814ae714ffe61ddc2db2dd03e6c49a42e269b5001355500d431cce0c" +checksum = "1b96984c469425cb577bf6f17121ecb3e4fe1e81de5d8f780dd372802858d756" dependencies = [ "diesel_table_macro_syntax", + "dsl_auto_type", "proc-macro2", "quote", "syn", @@ -106,23 +163,33 @@ dependencies = [ [[package]] name = "diesel_table_macro_syntax" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" +checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" dependencies = [ "syn", ] [[package]] -name = "fifthtry-serde_sqlite_jsonb" -version = "0.1.0" +name = "dsl_auto_type" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da69e00a6abe54a103acd8edf2f500f14a60a2923a63625de345ac473bedb00f" +checksum = "139ae9aca7527f85f26dd76483eb38533fd84bd571065da1739656ef71c5ff5b" dependencies = [ - "serde", - "serde_json", + "darling", + "either", + "heck", + "proc-macro2", + "quote", + "syn", ] +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + [[package]] name = "fnv" version = "1.0.7" @@ -130,57 +197,73 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +name = "ft-derive" +version = "0.2.1" dependencies = [ - "percent-encoding", + "quote", + "syn", ] [[package]] name = "ft-sdk" -version = "0.1.2" +version = "0.6.3" dependencies = [ + "anyhow", "bytes", "chrono", "diesel", + "ft-derive", "ft-sys", + "ft-sys-shared", "http", - "include_dir", - "rand_core", + "rand", + "rand_core 0.6.4", "serde", "serde_json", - "serde_urlencoded", "thiserror", + "uuid", ] [[package]] name = "ft-sys" -version = "0.1.2" +version = "0.3.0" dependencies = [ "bytes", "chrono", "diesel", "diesel_derives", - "fifthtry-serde_sqlite_jsonb", "ft-sys-shared", "http", "serde", "serde_json", + "thiserror", ] [[package]] name = "ft-sys-shared" -version = "0.1.1-alpha.2" +version = "0.2.1" dependencies = [ "bytes", "chrono", "http", "serde", + "serde_json", + "smallvec", "thiserror", ] +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "http" version = "1.1.0" @@ -216,23 +299,10 @@ dependencies = [ ] [[package]] -name = "include_dir" -version = "0.7.3" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" -dependencies = [ - "include_dir_macros", -] - -[[package]] -name = "include_dir_macros" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" -dependencies = [ - "proc-macro2", - "quote", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "itoa" @@ -276,17 +346,11 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] @@ -300,6 +364,34 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "winapi", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + [[package]] name = "rand_core" version = "0.6.4" @@ -357,22 +449,25 @@ dependencies = [ ] [[package]] -name = "serde_urlencoded" -version = "0.7.1" +name = "smallvec" +version = "2.0.0-alpha.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +checksum = "87b96efa4bd6bdd2ff0c6615cc36fc4970cbae63cfd46ddff5cee35a1b4df570" dependencies = [ - "form_urlencoded", - "itoa", - "ryu", "serde", ] +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" -version = "2.0.60" +version = "2.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ "proc-macro2", "quote", @@ -381,18 +476,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "80d76d3f064b981389ecb4b6b7f45a0bf9fdac1d5b9204c7bd6714fecc302850" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "44d29feb33e986b6ea906bd9c3559a856983f92371b3eaa5e83782a351623de0" dependencies = [ "proc-macro2", "quote", @@ -405,6 +500,12 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "uuid" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f33196643e165781c20a5ead5582283a7dacbb87855d867fbc2df3f81eddc1be" + [[package]] name = "wasm-bindgen" version = "0.2.92" @@ -459,6 +560,28 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows-core" version = "0.52.0" From 8f37c9fc0ba3bdfe76f4ef08f6a81a14c7a860a9 Mon Sep 17 00:00:00 2001 From: siddhantCodes Date: Tue, 19 Aug 2025 11:37:00 +0530 Subject: [PATCH 2/5] Show some code in README Mentions the ./examples/ directory in this repo and documents a basic hello world .wasm module source code. --- README.md | 58 +++++++++++++++++++++++++++--- examples/001-hello-world/build.sh | 0 examples/001-hello-world/index.ftd | 1 - 3 files changed, 54 insertions(+), 5 deletions(-) mode change 100644 => 100755 examples/001-hello-world/build.sh diff --git a/README.md b/README.md index d09059d..994d241 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,61 @@ # ft-sdk +Rust SDK for extending backend functionality of +[fastn](https://github.com/fastn-stack/fastn/) using WASM modules. [docs.rs/ft-sdk](https://docs.rs/ft-sdk) -This crate can only be used when compiled to wasm, and wasm is run by -[www.fifthtry.com](https://www.fifthtry.com), or by `clift`, the command -line tool to use help developers build FifthTry Apps or when self-hosting -FifthTry Apps. +> [!NOTE] +> This crate should only be used when compiled to wasm. +--- + +## Example + +```rust +// lib.rs + +// An http handler available at //hello-world/ +#[ft_sdk::processor] +fn hello_world(path: ft_sdk::Path) -> ft_sdk::processor::Result { + ft_sdk::println!("params: {path}"); + // Return a JSON string as response. Complex json with `serde_json::json!` + // or any Serializable struct is supported. + ft_sdk::processor::json("and this is coming from wasm!") +} +``` + +Compile the rust project with target `wasm32-unknown-unknown` and copy the +`.wasm` file into your fastn package. + +You can then mount this module by adding the following to your `FASTN.ftd` +file: + +```ftd +-- import: fastn + +-- fastn.package: hello-world + +-- fastn.url-mappings: + +/wasm/* -> wasm+proxy://hello_world.wasm/* +``` + +Now any `.ftd` file can make request to `/wasm/hello-world/` and it will be +handled by the `hello_world` function in the wasm module: + +```ftd +-- import: fastn/processors as pr + +-- ftd.text: this is in ftd file +-- ftd.text: $message + +-- string message: +$processor$: pr.http +url: /wasm/hello-world/ +``` + +See [./examples/](./examples/) for more examples including form handling and +interacting with database using the +[diesel](https://github.com/diesel-rs/diesel) crate. ## Maintenance Note diff --git a/examples/001-hello-world/build.sh b/examples/001-hello-world/build.sh old mode 100644 new mode 100755 diff --git a/examples/001-hello-world/index.ftd b/examples/001-hello-world/index.ftd index 5887516..8791b03 100644 --- a/examples/001-hello-world/index.ftd +++ b/examples/001-hello-world/index.ftd @@ -6,4 +6,3 @@ -- string message: $processor$: pr.http url: /wasm/hello-world/ - From e15ad82060b7c9446838a78df9e5b564a2c1e56a Mon Sep 17 00:00:00 2001 From: siddhantCodes Date: Tue, 19 Aug 2025 11:40:25 +0530 Subject: [PATCH 3/5] add Open Collective --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..ec004e5 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +open_collective: fastn From 0dd4269026e92d90bab3286441136e5a19c83d1b Mon Sep 17 00:00:00 2001 From: siddhantCodes Date: Tue, 19 Aug 2025 11:42:10 +0530 Subject: [PATCH 4/5] cargo fmt --- ft-sdk/src/auth/mod.rs | 2 +- ft-sdk/src/auth/utils.rs | 2 +- ft-sys/src/diesel_sqlite/bind_collector.rs | 2 +- ft-sys/src/diesel_sqlite/query_builder/insertable.rs | 2 +- ft-sys/src/diesel_sqlite/query_builder/returning.rs | 2 +- ft-sys/src/diesel_sqlite/types/mod.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ft-sdk/src/auth/mod.rs b/ft-sdk/src/auth/mod.rs index af45fae..efd5d73 100644 --- a/ft-sdk/src/auth/mod.rs +++ b/ft-sdk/src/auth/mod.rs @@ -5,7 +5,7 @@ mod utils; pub use ft_sys_shared::SESSION_KEY; pub use schema::fastn_user; -pub use utils::{user_data_by_query, Counter}; +pub use utils::{Counter, user_data_by_query}; #[derive(Clone, Debug)] pub struct UserId(pub i64); diff --git a/ft-sdk/src/auth/utils.rs b/ft-sdk/src/auth/utils.rs index 691eaef..c3f5cba 100644 --- a/ft-sdk/src/auth/utils.rs +++ b/ft-sdk/src/auth/utils.rs @@ -28,7 +28,7 @@ pub fn user_data_by_query( Ok(v) if v.len() > 1 => return Err(ft_sdk::auth::UserDataError::MultipleRowsFound), Ok(mut v) => v.pop().unwrap(), Err(diesel::result::Error::NotFound) => { - return Err(ft_sdk::auth::UserDataError::NoDataFound) + return Err(ft_sdk::auth::UserDataError::NoDataFound); } Err(e) => return Err(ft_sdk::auth::UserDataError::DatabaseError(e)), }; diff --git a/ft-sys/src/diesel_sqlite/bind_collector.rs b/ft-sys/src/diesel_sqlite/bind_collector.rs index dec030b..cfd1a81 100644 --- a/ft-sys/src/diesel_sqlite/bind_collector.rs +++ b/ft-sys/src/diesel_sqlite/bind_collector.rs @@ -1,7 +1,7 @@ +use diesel::QueryResult; use diesel::query_builder::BindCollector; use diesel::serialize::{IsNull, Output}; use diesel::sql_types::HasSqlType; -use diesel::QueryResult; use ft_sys::diesel_sqlite::backend::Sqlite; #[derive(Debug, Default, serde::Serialize)] diff --git a/ft-sys/src/diesel_sqlite/query_builder/insertable.rs b/ft-sys/src/diesel_sqlite/query_builder/insertable.rs index 11ea614..91a1cff 100644 --- a/ft-sys/src/diesel_sqlite/query_builder/insertable.rs +++ b/ft-sys/src/diesel_sqlite/query_builder/insertable.rs @@ -7,8 +7,8 @@ use diesel::query_builder::{AstPass, QueryId, ValuesClause}; use diesel::query_builder::{BatchInsert, InsertStatement}; use diesel::query_dsl::methods::ExecuteDsl; use diesel::{QueryResult, Table}; -use ft_sys::diesel_sqlite::Sqlite; use ft_sys::SqliteConnection; +use ft_sys::diesel_sqlite::Sqlite; // Todo: Add debug and display traits. // Checkout `diesel::query_builder::insert_statement::insert_with_default_for_sqlite` module diff --git a/ft-sys/src/diesel_sqlite/query_builder/returning.rs b/ft-sys/src/diesel_sqlite/query_builder/returning.rs index 871bee0..a101499 100644 --- a/ft-sys/src/diesel_sqlite/query_builder/returning.rs +++ b/ft-sys/src/diesel_sqlite/query_builder/returning.rs @@ -1,7 +1,7 @@ use diesel::query_builder::{AstPass, QueryFragment, ReturningClause}; use diesel::result::QueryResult; -use ft_sys::diesel_sqlite::backend::SqliteReturningClause; use ft_sys::diesel_sqlite::Sqlite; +use ft_sys::diesel_sqlite::backend::SqliteReturningClause; impl QueryFragment for ReturningClause where diff --git a/ft-sys/src/diesel_sqlite/types/mod.rs b/ft-sys/src/diesel_sqlite/types/mod.rs index 29d7907..082f1cb 100644 --- a/ft-sys/src/diesel_sqlite/types/mod.rs +++ b/ft-sys/src/diesel_sqlite/types/mod.rs @@ -5,7 +5,7 @@ mod jsonb; use super::{Sqlite, SqliteValue}; use diesel::deserialize::FromSql; use diesel::serialize::{IsNull, Output, ToSql}; -use diesel::{deserialize, serialize, sql_types, Queryable}; +use diesel::{Queryable, deserialize, serialize, sql_types}; impl FromSql for i32 { fn from_sql(value: SqliteValue) -> deserialize::Result { From e60743a04c3006f6e138b7b2b059fa60022eb94d Mon Sep 17 00:00:00 2001 From: siddhantCodes Date: Tue, 19 Aug 2025 11:47:27 +0530 Subject: [PATCH 5/5] fix tests --- Cargo.lock | 63 +++++++++++++++++++++++++++++++++++++++++++++++ ft-sdk/Cargo.toml | 3 +++ 2 files changed, 66 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 667b398..d90974a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -108,6 +108,16 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "time", + "version_check", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -149,6 +159,15 @@ dependencies = [ "syn", ] +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + [[package]] name = "diesel" version = "2.2.8" @@ -247,6 +266,7 @@ dependencies = [ "anyhow", "bytes", "chrono", + "cookie", "diesel", "ft-derive", "ft-sys", @@ -426,6 +446,12 @@ dependencies = [ "ft-sdk", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-traits" version = "0.2.19" @@ -453,6 +479,12 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "proc-macro2" version = "1.0.94" @@ -633,6 +665,37 @@ dependencies = [ "syn", ] +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + [[package]] name = "unicode-ident" version = "1.0.18" diff --git a/ft-sdk/Cargo.toml b/ft-sdk/Cargo.toml index 902e229..4902f30 100644 --- a/ft-sdk/Cargo.toml +++ b/ft-sdk/Cargo.toml @@ -36,3 +36,6 @@ serde_json.workspace = true serde_urlencoded = { workspace = true, optional = true } thiserror.workspace = true uuid.workspace = true + +[dev-dependencies] +cookie = "0.18"