Skip to content

Commit

Permalink
take two
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Aug 8, 2024
1 parent f5d93d2 commit 2159ecd
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 52 deletions.
32 changes: 16 additions & 16 deletions api.planx.uk/modules/webhooks/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,22 @@ components:
type: string
required:
- body
FlowStatusChange:
type: object
properties:
event:
type: object
properties:
data:
type: object
properties:
new:
type: object
properties:
id:
type: string;
status:
type: string;
FlowStatusChange:
type: object
properties:
event:
type: object
properties:
data:
type: object
properties:
new:
type: object
properties:
id:
type: string;
status:
type: string;
required:
- body
SendSlackNotification:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const getMessageForEventType = async (data: EventData, type: EventType) => {

if (type === "flow-status") {
const { id: flowId, status } = data as FlowStatusEventData;
// todo fetch extra data based on flowId
const emoji = status === "online" ? ":large_green_circle:" : ":no_entry:";
message = `${emoji} Flow is now *${status}* (${flowId})`;
}
Expand Down
72 changes: 36 additions & 36 deletions hasura.planx.uk/metadata/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
definition:
enable_manual: false
insert:
columns: '*'
columns: "*"
retry_conf:
interval_sec: 30
num_retries: 1
Expand All @@ -171,7 +171,7 @@
query_params:
type: bops-submission
template_engine: Kriti
url: '{{$base_url}}/webhooks/hasura/send-slack-notification'
url: "{{$base_url}}/webhooks/hasura/send-slack-notification"
version: 2
- table:
name: document_template
Expand Down Expand Up @@ -225,7 +225,7 @@
definition:
enable_manual: false
insert:
columns: '*'
columns: "*"
retry_conf:
interval_sec: 30
num_retries: 1
Expand All @@ -239,7 +239,7 @@
query_params:
type: email-submission
template_engine: Kriti
url: '{{$base_url}}/webhooks/hasura/send-slack-notification'
url: "{{$base_url}}/webhooks/hasura/send-slack-notification"
version: 2
- table:
name: feedback
Expand Down Expand Up @@ -451,9 +451,9 @@
forward_client_headers: false
headers:
- name: authorization
value: '{{HASURA_PLANX_API_KEY}}'
value: "{{HASURA_PLANX_API_KEY}}"
timeout: 10
url: '{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html'
url: "{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html"
type: http
- role: platformAdmin
permission:
Expand All @@ -475,9 +475,9 @@
forward_client_headers: false
headers:
- name: authorization
value: '{{HASURA_PLANX_API_KEY}}'
value: "{{HASURA_PLANX_API_KEY}}"
timeout: 10
url: '{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html'
url: "{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html"
type: http
- role: teamEditor
permission:
Expand Down Expand Up @@ -506,9 +506,9 @@
forward_client_headers: false
headers:
- name: authorization
value: '{{HASURA_PLANX_API_KEY}}'
value: "{{HASURA_PLANX_API_KEY}}"
timeout: 10
url: '{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html'
url: "{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html"
type: http
select_permissions:
- role: api
Expand Down Expand Up @@ -609,9 +609,9 @@
forward_client_headers: false
headers:
- name: authorization
value: '{{HASURA_PLANX_API_KEY}}'
value: "{{HASURA_PLANX_API_KEY}}"
timeout: 10
url: '{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html'
url: "{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html"
type: http
- role: platformAdmin
permission:
Expand All @@ -629,9 +629,9 @@
forward_client_headers: false
headers:
- name: authorization
value: '{{HASURA_PLANX_API_KEY}}'
value: "{{HASURA_PLANX_API_KEY}}"
timeout: 10
url: '{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html'
url: "{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html"
type: http
- role: teamEditor
permission:
Expand All @@ -656,9 +656,9 @@
forward_client_headers: false
headers:
- name: authorization
value: '{{HASURA_PLANX_API_KEY}}'
value: "{{HASURA_PLANX_API_KEY}}"
timeout: 10
url: '{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html'
url: "{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html"
type: http
delete_permissions:
- role: platformAdmin
Expand Down Expand Up @@ -701,7 +701,7 @@
query_params:
type: flow-status
template_engine: Kriti
url: '{{$base_url}}/webhooks/hasura/send-slack-notification'
url: "{{$base_url}}/webhooks/hasura/send-slack-notification"
version: 2
- table:
name: global_settings
Expand All @@ -718,9 +718,9 @@
forward_client_headers: false
headers:
- name: authorization
value: '{{HASURA_PLANX_API_KEY}}'
value: "{{HASURA_PLANX_API_KEY}}"
timeout: 10
url: '{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html'
url: "{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html"
type: http
select_permissions:
- role: platformAdmin
Expand Down Expand Up @@ -753,9 +753,9 @@
forward_client_headers: false
headers:
- name: authorization
value: '{{HASURA_PLANX_API_KEY}}'
value: "{{HASURA_PLANX_API_KEY}}"
timeout: 10
url: '{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html'
url: "{{HASURA_PLANX_API_URL}}/webhooks/hasura/validate-input/jsonb/clean-html"
type: http
- table:
name: lowcal_sessions
Expand Down Expand Up @@ -902,7 +902,7 @@
method: POST
query_params: {}
template_engine: Kriti
url: '{{$base_url}}/send-email/confirmation'
url: "{{$base_url}}/send-email/confirmation"
version: 2
- name: setup_lowcal_expiry_events
definition:
Expand Down Expand Up @@ -932,7 +932,7 @@
method: POST
query_params: {}
template_engine: Kriti
url: '{{$base_url}}/webhooks/hasura/create-expiry-event'
url: "{{$base_url}}/webhooks/hasura/create-expiry-event"
version: 2
- name: setup_lowcal_reminder_events
definition:
Expand Down Expand Up @@ -962,7 +962,7 @@
method: POST
query_params: {}
template_engine: Kriti
url: '{{$base_url}}/webhooks/hasura/create-reminder-event'
url: "{{$base_url}}/webhooks/hasura/create-reminder-event"
version: 2
- table:
name: operations
Expand Down Expand Up @@ -1139,7 +1139,7 @@
definition:
enable_manual: false
insert:
columns: '*'
columns: "*"
retry_conf:
interval_sec: 10
num_retries: 3
Expand All @@ -1161,13 +1161,13 @@
method: POST
query_params: {}
template_engine: Kriti
url: '{{$base_url}}/webhooks/hasura/create-payment-expiry-events'
url: "{{$base_url}}/webhooks/hasura/create-payment-expiry-events"
version: 2
- name: setup_payment_invitation_events
definition:
enable_manual: false
insert:
columns: '*'
columns: "*"
retry_conf:
interval_sec: 10
num_retries: 3
Expand All @@ -1189,13 +1189,13 @@
method: POST
query_params: {}
template_engine: Kriti
url: '{{$base_url}}/webhooks/hasura/create-payment-invitation-events'
url: "{{$base_url}}/webhooks/hasura/create-payment-invitation-events"
version: 2
- name: setup_payment_reminder_events
definition:
enable_manual: false
insert:
columns: '*'
columns: "*"
retry_conf:
interval_sec: 10
num_retries: 3
Expand All @@ -1217,7 +1217,7 @@
method: POST
query_params: {}
template_engine: Kriti
url: '{{$base_url}}/webhooks/hasura/create-payment-reminder-events'
url: "{{$base_url}}/webhooks/hasura/create-payment-reminder-events"
version: 2
- name: setup_payment_send_events
definition:
Expand Down Expand Up @@ -1246,7 +1246,7 @@
method: POST
query_params: {}
template_engine: Kriti
url: '{{$base_url}}/webhooks/hasura/create-payment-send-events'
url: "{{$base_url}}/webhooks/hasura/create-payment-send-events"
version: 2
- table:
name: payment_status
Expand Down Expand Up @@ -1478,12 +1478,12 @@
definition:
enable_manual: false
insert:
columns: '*'
columns: "*"
retry_conf:
interval_sec: 30
num_retries: 1
timeout_sec: 60
webhook: '{{HASURA_PLANX_API_URL}}'
webhook: "{{HASURA_PLANX_API_URL}}"
headers:
- name: authorization
value_from_env: HASURA_PLANX_API_KEY
Expand All @@ -1492,7 +1492,7 @@
query_params:
type: s3-submission
template_engine: Kriti
url: '{{$base_url}}/webhooks/hasura/send-slack-notification'
url: "{{$base_url}}/webhooks/hasura/send-slack-notification"
version: 2
- table:
name: sessions
Expand Down Expand Up @@ -2233,7 +2233,7 @@
definition:
enable_manual: false
insert:
columns: '*'
columns: "*"
retry_conf:
interval_sec: 30
num_retries: 1
Expand All @@ -2247,7 +2247,7 @@
query_params:
type: uniform-submission
template_engine: Kriti
url: '{{$base_url}}/webhooks/hasura/send-slack-notification'
url: "{{$base_url}}/webhooks/hasura/send-slack-notification"
version: 2
- table:
name: user_roles
Expand Down

0 comments on commit 2159ecd

Please sign in to comment.