Skip to content

Commit

Permalink
Merge pull request #6 from edgee-cloud/feat/wit-0-1-2
Browse files Browse the repository at this point in the history
feat: bump wit to v0.1.2
  • Loading branch information
SachaMorard authored Oct 8, 2024
2 parents 171d585 + 69ab651 commit 333c1bf
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "amplitude-component"
version = "0.2.1"
version = "0.2.2"
edition = "2021"

[lib]
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
[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
```
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ impl Guest for AmplitudeComponent {

fn identify(edgee_payload: Payload, cred_map: Dict) -> Result<EdgeeRequest, String> {
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())?;
Expand Down
7 changes: 3 additions & 4 deletions wit/protocols.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edgee:protocols@0.1.1;
package edgee:protocols@0.1.2;

world data-collection {
export provider: interface {
Expand All @@ -18,7 +18,6 @@ world data-collection {
campaign: campaign,
client: client,
session: session,
destinations: list<tuple<string, bool>>,
}

record page-event {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 333c1bf

Please sign in to comment.