Skip to content

Commit

Permalink
add activity log REST api data trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
chiaberry committed Sep 20, 2024
1 parent e151cf3 commit f3ba40d
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions moped-database/metadata/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,51 @@
set:
updated_by_user_id: x-hasura-user-db-id
comment: ""
event_triggers:
- name: activity_log_feature_school_beacons
definition:
enable_manual: false
insert:
columns: '*'
update:
columns: '*'
retry_conf:
interval_sec: 10
num_retries: 0
timeout_sec: 60
webhook_from_env: HASURA_ENDPOINT
headers:
- name: x-hasura-admin-secret
value_from_env: ACTIVITY_LOG_API_SECRET
request_transform:
body:
action: transform
template: |-
{
"query": "mutation InsertActivity($object: moped_activity_log_insert_input!) { insert_moped_activity_log_one(object: $object) { activity_id } }",
"variables": {
"object": {
"record_id": {{ $body.event.data.new.id }},
"record_type": {{ $body.table.name }},
"activity_id": {{ $body.id }},
"record_data": {"event": {{ $body.event }}},
"description": [{"newSchema": "true"}],
"operation_type": {{ $body.event.op }},
"updated_by_user_id": {{ $session_variables?['x-hasura-user-db-id'] ?? 1}}
}
}
}
method: POST
query_params: {}
template_engine: Kriti
version: 2
cleanup_config:
batch_size: 10000
clean_invocation_logs: false
clear_older_than: 168
paused: true
schedule: 0 0 * * *
timeout: 60
- table:
name: feature_signals
schema: public
Expand Down

0 comments on commit f3ba40d

Please sign in to comment.