From 0247b2c53a4024e467fee9bb8db7adc66993888f Mon Sep 17 00:00:00 2001 From: Sacha Morard <2254275+SachaMorard@users.noreply.github.com> Date: Tue, 8 Oct 2024 06:48:05 +0200 Subject: [PATCH 1/2] feat: bump wit to v0.1.2 --- README.md | 20 +++++++++++++++++++- src/lib.rs | 4 ++-- wit/protocols.wit | 7 +++---- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2c595b8..2765fe3 100644 --- a/README.md +++ b/README.md @@ -44,4 +44,22 @@ If you're interested in contributing to Edgee, read our [contribution guidelines ## Reporting Security Vulnerabilities If you've found a vulnerability or potential vulnerability in our code, please let us know at -[edgee-security](mailto:security@edgee.cloud). \ No newline at end of file +[edgee-security](mailto:security@edgee.cloud). + +## Building from source + +To build the wasm file from source, you need to have installed +- [Rust](https://www.rust-lang.org/tools/install) +- `wasm32-wasip1` target: run `rustup target add wasm32-wasip1` +- `wasm-tools`: run `cargo install --locked wasm-tools` + +Then you can run the following commands: + +```bash + +Then you can run the following commands: + +```bash +make install +make build +``` \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index f6810fd..f244613 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -192,9 +192,9 @@ impl Guest for AmplitudeComponent { fn identify(edgee_payload: Payload, cred_map: Dict) -> Result { if edgee_payload.identify.user_id.is_empty() - || edgee_payload.identify.anonymous_id.is_empty() + && edgee_payload.identify.anonymous_id.is_empty() { - return Err("Missing user id".to_string()); + return Err("userId or anonymousId is not set".to_string()); } let mut amplitude_payload = AmplitudePayload::new(cred_map).map_err(|e| e.to_string())?; diff --git a/wit/protocols.wit b/wit/protocols.wit index 8b1e233..a210b17 100644 --- a/wit/protocols.wit +++ b/wit/protocols.wit @@ -1,4 +1,4 @@ -package edgee:protocols@0.1.1; +package edgee:protocols@0.1.2; world data-collection { export provider: interface { @@ -18,7 +18,6 @@ world data-collection { campaign: campaign, client: client, session: session, - destinations: list>, } record page-event { @@ -82,8 +81,8 @@ world data-collection { previous-session-id: string, session-count: u32, session-start: bool, - first-seen: string, - last-seen: string, + first-seen: s64, + last-seen: s64, } record edgee-request { From 69ab651cef0777152345aee46c47d6bf278e70aa Mon Sep 17 00:00:00 2001 From: Sacha Morard <2254275+SachaMorard@users.noreply.github.com> Date: Tue, 8 Oct 2024 07:11:30 +0200 Subject: [PATCH 2/2] chore: bump cargo version --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fec6155..d72207f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,7 +16,7 @@ dependencies = [ [[package]] name = "amplitude-component" -version = "0.2.1" +version = "0.2.2" dependencies = [ "anyhow", "serde", diff --git a/Cargo.toml b/Cargo.toml index d7a49b8..8891dbf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "amplitude-component" -version = "0.2.1" +version = "0.2.2" edition = "2021" [lib]