feat: support webhook and sse

This commit is contained in:
guarzo
2025-07-01 01:58:33 -04:00
parent 6a543bf644
commit 4d75b256c4
18 changed files with 1084 additions and 453 deletions

View File

@@ -22,6 +22,7 @@ defmodule WandererApp.Api.Map do
define(:assign_owner, action: :assign_owner)
define(:mark_as_deleted, action: :mark_as_deleted)
define(:update_api_key, action: :update_api_key)
define(:toggle_webhooks, action: :toggle_webhooks)
define(:by_id,
get_by: [:id],
@@ -127,6 +128,10 @@ defmodule WandererApp.Api.Map do
update :update_api_key do
accept [:public_api_key]
end
update :toggle_webhooks do
accept [:webhooks_enabled]
end
end
attributes do
@@ -185,6 +190,12 @@ defmodule WandererApp.Api.Map do
allow_nil? true
end
attribute :webhooks_enabled, :boolean do
default(false)
allow_nil?(false)
public?(true)
end
create_timestamp(:inserted_at)
update_timestamp(:updated_at)
end