diff --git a/.gitignore b/.gitignore index 64bb40d..bfa440d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # generated files +.edgee/ internal/ # output diff --git a/Makefile b/Makefile index 474761e..c221f5c 100644 --- a/Makefile +++ b/Makefile @@ -10,14 +10,15 @@ help: | awk 'BEGIN { FS = ":.*?## " }; { printf "\033[36m%-30s\033[0m %s\n", $$1, $$2 }' internal: mkdir -p internal - cd internal && wit-bindgen c ../wit && cd .. + ( cd internal && wit-bindgen c ../.edgee/wit ) setup: internal ## setup development environment build: edgee components build - + build-no-edgee: setup ## build component - $(CC) dc_component.c internal/data_collection.c internal/data_collection_component_type.o -o /dev/stdout -mexec-model=reactor -Os | wasm-tools component new -o dc_component.wasm + $(CC) dc_component.c internal/data_collection.c internal/data_collection_component_type.o -mexec-model=reactor -Os + wasm-tools component new -o dc_component.wasm a.out clean: ## clean build artifacts rm -rf dc_component.wasm diff --git a/edgee-component.toml b/edgee-component.toml index 45a88ac..5ca39f2 100644 --- a/edgee-component.toml +++ b/edgee-component.toml @@ -8,10 +8,11 @@ subcategory = "analytics" description = "Example C component for data collection" documentation = "https://github.com/edgee-cloud/example-c-component" repository = "https://github.com/edgee-cloud/example-c-component" -wit-world-version = "0.5.0" +language = "C" +wit-version = "0.5.0" [component.build] -command = "$(CC) dc_component.c internal/data_collection.c internal/data_collection_component_type.o -o /dev/stdout -mexec-model=reactor -Os | wasm-tools component new -o dc_component.wasm" +command = "$CC dc_component.c internal/data_collection.c internal/data_collection_component_type.o -mexec-model=reactor -Os && wasm-tools component new -o dc_component.wasm a.out" output_path = "./dc_component.wasm" [component.settings.example] diff --git a/wit/deps.lock b/wit/deps.lock deleted file mode 100644 index 6455ab3..0000000 --- a/wit/deps.lock +++ /dev/null @@ -1,4 +0,0 @@ -[edgee] -url = "https://github.com/edgee-cloud/edgee-wit/archive/refs/tags/v0.5.0.tar.gz" -sha256 = "f6e11c5cde39ec04b024b1181f45e896f154f7677ff5a904c99f6af5224dc371" -sha512 = "21b045d0fb82a793a6176f6d9e98dab868563ab7906e3762601e14f06a715e36c965e83e6f5c76cf016af03df48d219b86165a7c18d14284e967d0b837bf99e4" diff --git a/wit/deps.toml b/wit/deps.toml deleted file mode 100644 index 77ea76e..0000000 --- a/wit/deps.toml +++ /dev/null @@ -1 +0,0 @@ -edgee = "https://github.com/edgee-cloud/edgee-wit/archive/refs/tags/v0.5.0.tar.gz" diff --git a/wit/deps/edgee/consent-mapping.wit b/wit/deps/edgee/consent-mapping.wit deleted file mode 100644 index b284aa0..0000000 --- a/wit/deps/edgee/consent-mapping.wit +++ /dev/null @@ -1,13 +0,0 @@ -package edgee:components; - -interface consent-mapping { - type dict = list>; - - enum consent { - pending, - granted, - denied, - } - - map: func(cookie: string, settings: dict) -> option; -} \ No newline at end of file diff --git a/wit/deps/edgee/data-collection.wit b/wit/deps/edgee/data-collection.wit deleted file mode 100644 index 994c537..0000000 --- a/wit/deps/edgee/data-collection.wit +++ /dev/null @@ -1,114 +0,0 @@ -package edgee:components; - -interface data-collection { - type dict = list>; - - enum event-type { page, track, user } - enum consent { pending, granted, denied } - - record event { - uuid: string, - timestamp: s64, - timestamp-millis: s64, - timestamp-micros: s64, - event-type: event-type, - data: data, - context: context, - consent: option, - } - - variant data { - page(page-data), - track(track-data), - user(user-data), - } - - record page-data { - name: string, - category: string, - keywords: list, - title: string, - url: string, - path: string, - search: string, - referrer: string, - properties: dict, - } - - record user-data { - user-id: string, - anonymous-id: string, - edgee-id: string, - properties: dict, - } - - record track-data { - name: string, - properties: dict, - products: list, - } - - record context { - page: page-data, - user: user-data, - client: client, - campaign: campaign, - session: session, - } - - record client { - ip: string, - locale: string, - timezone: string, - user-agent: string, - user-agent-architecture: string, - user-agent-bitness: string, - user-agent-version-list: string, - user-agent-full-version-list: string, - user-agent-mobile: string, - user-agent-model: string, - os-name: string, - os-version: string, - screen-width: s32, - screen-height: s32, - screen-density: f32, - continent: string, - country-code: string, - country-name: string, - region: string, - city: string, - } - - record campaign { - name: string, - source: string, - medium: string, - term: string, - content: string, - creative-format: string, - marketing-tactic: string, - } - - record session { - session-id: string, - previous-session-id: string, - session-count: u32, - session-start: bool, - first-seen: s64, - last-seen: s64, - } - - record edgee-request { - method: http-method, - url: string, - headers: dict, - forward-client-headers: bool, - body: string, - } - - enum http-method { GET, PUT, POST, DELETE } - - page: func(e: event, settings: dict) -> result; - track: func(e: event, settings: dict) -> result; - user: func(e: event, settings:dict) -> result; -} \ No newline at end of file diff --git a/wit/world.wit b/wit/world.wit deleted file mode 100644 index d9e1f9f..0000000 --- a/wit/world.wit +++ /dev/null @@ -1,5 +0,0 @@ -package edgee:native; - -world data-collection { - export edgee:components/data-collection; -}