hooksniff 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +42 -13
  3. data/lib/hooksniff/api/alert.rb +34 -0
  4. data/lib/hooksniff/api/analytics.rb +21 -0
  5. data/lib/hooksniff/api/api_key.rb +26 -0
  6. data/lib/hooksniff/api/application.rb +30 -0
  7. data/lib/hooksniff/api/audit_log.rb +17 -0
  8. data/lib/hooksniff/api/background_task.rb +21 -0
  9. data/lib/hooksniff/api/billing.rb +34 -0
  10. data/lib/hooksniff/api/connector.rb +33 -0
  11. data/lib/hooksniff/api/custom_domain.rb +26 -0
  12. data/lib/hooksniff/api/environment.rb +47 -0
  13. data/lib/hooksniff/api/inbound.rb +30 -0
  14. data/lib/hooksniff/api/message_poller.rb +21 -0
  15. data/lib/hooksniff/api/notification.rb +30 -0
  16. data/lib/hooksniff/api/operational_webhook.rb +34 -0
  17. data/lib/hooksniff/api/playground.rb +17 -0
  18. data/lib/hooksniff/api/portal.rb +33 -0
  19. data/lib/hooksniff/api/rate_limit.rb +26 -0
  20. data/lib/hooksniff/api/routing.rb +21 -0
  21. data/lib/hooksniff/api/schema.rb +25 -0
  22. data/lib/hooksniff/api/search.rb +13 -0
  23. data/lib/hooksniff/api/service_token.rb +22 -0
  24. data/lib/hooksniff/api/sso.rb +26 -0
  25. data/lib/hooksniff/api/team.rb +42 -0
  26. data/lib/hooksniff/api/template.rb +21 -0
  27. data/lib/hooksniff/models/aggregate_event_types_out.rb +59 -0
  28. data/lib/hooksniff/models/message_attempt_recovered_event.rb +53 -0
  29. data/lib/hooksniff/models/message_attempt_recovered_event_data.rb +70 -0
  30. data/lib/hooksniff/models/message_in.rb +1 -0
  31. data/lib/hooksniff/version.rb +1 -1
  32. data/lib/hooksniff.rb +132 -66
  33. metadata +29 -8
  34. data/lib/hooksniff/background_task.rb +0 -21
  35. data/lib/hooksniff/connector.rb +0 -33
  36. data/lib/hooksniff/environment.rb +0 -53
  37. data/lib/hooksniff/inbound.rb +0 -25
  38. data/lib/hooksniff/message_poller.rb +0 -32
  39. data/lib/hooksniff/operational_webhook.rb +0 -12
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module HookSniff
4
- class Environment
5
- def initialize(api_client)
6
- @api_client = api_client
7
- end
8
-
9
- def list
10
- @api_client.execute(method: :get, path: "/api/v1/environments")
11
- end
12
-
13
- def create(environment_in)
14
- @api_client.execute(method: :post, path: "/api/v1/environments", body: environment_in)
15
- end
16
-
17
- def get(environment_id)
18
- @api_client.execute(method: :get, path: "/api/v1/environments/#{environment_id}")
19
- end
20
-
21
- def update(environment_id, environment_patch)
22
- @api_client.execute(method: :put, path: "/api/v1/environments/#{environment_id}", body: environment_patch)
23
- end
24
-
25
- def delete(environment_id)
26
- @api_client.execute(method: :delete, path: "/api/v1/environments/#{environment_id}")
27
- end
28
-
29
- def list_variables(environment_id)
30
- @api_client.execute(method: :get, path: "/api/v1/environments/#{environment_id}/variables")
31
- end
32
-
33
- def get_variable(environment_id, variable_id)
34
- @api_client.execute(method: :get, path: "/api/v1/environments/#{environment_id}/variables/#{variable_id}")
35
- end
36
-
37
- def create_variable(environment_id, variable_in)
38
- @api_client.execute(method: :post, path: "/api/v1/environments/#{environment_id}/variables", body: variable_in)
39
- end
40
-
41
- def update_variable(environment_id, variable_id, variable_in)
42
- @api_client.execute(method: :put, path: "/api/v1/environments/#{environment_id}/variables/#{variable_id}", body: variable_in)
43
- end
44
-
45
- def delete_variable(environment_id, variable_id)
46
- @api_client.execute(method: :delete, path: "/api/v1/environments/#{environment_id}/variables/#{variable_id}")
47
- end
48
-
49
- def bulk_upsert_variables(environment_id, bulk_in)
50
- @api_client.execute(method: :post, path: "/api/v1/environments/#{environment_id}/variables/bulk", body: bulk_in)
51
- end
52
- end
53
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module HookSniff
4
- class Inbound
5
- def initialize(client)
6
- @client = client
7
- end
8
-
9
- def list_configs
10
- @client.request(:get, "/api/v1/inbound/configs")
11
- end
12
-
13
- def create_config(body)
14
- @client.request(:post, "/api/v1/inbound/configs", body: body)
15
- end
16
-
17
- def update_config(id, body)
18
- @client.request(:put, "/api/v1/inbound/configs/#{id}", body: body)
19
- end
20
-
21
- def delete_config(id)
22
- @client.request(:delete, "/api/v1/inbound/configs/#{id}")
23
- end
24
- end
25
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module HookSniff
4
- class MessagePoller
5
- def initialize(client)
6
- @client = client
7
- end
8
-
9
- # Poll for new messages since the consumer's cursor.
10
- def poll(consumer_id, limit: nil, endpoint_id: nil, event_type: nil, include_payload: true)
11
- params = { consumer_id: consumer_id, include_payload: include_payload }
12
- params[:limit] = limit if limit
13
- params[:endpoint_id] = endpoint_id if endpoint_id
14
- params[:event_type] = event_type if event_type
15
- @client.request(:get, "/api/v1/message-poller/poll", params: params)
16
- end
17
-
18
- # Seek cursor to a specific message.
19
- def seek(consumer_id, message_id, endpoint_id: nil)
20
- body = { consumer_id: consumer_id, message_id: message_id }
21
- body[:endpoint_id] = endpoint_id if endpoint_id
22
- @client.request(:post, "/api/v1/message-poller/seek", body: body)
23
- end
24
-
25
- # Commit cursor — advance past a processed message.
26
- def commit(consumer_id, message_id, endpoint_id: nil)
27
- body = { consumer_id: consumer_id, message_id: message_id }
28
- body[:endpoint_id] = endpoint_id if endpoint_id
29
- @client.request(:post, "/api/v1/message-poller/commit", body: body)
30
- end
31
- end
32
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- module HookSniff
3
- class OperationalWebhook
4
- def initialize(api_client) = @api_client = api_client
5
- def list = @api_client.execute(method: :get, path: "/api/v1/operational-webhooks")
6
- def create(body) = @api_client.execute(method: :post, path: "/api/v1/operational-webhooks", body: body)
7
- def get(id) = @api_client.execute(method: :get, path: "/api/v1/operational-webhooks/#{id}")
8
- def update(id, body) = @api_client.execute(method: :put, path: "/api/v1/operational-webhooks/#{id}", body: body)
9
- def delete(id) = @api_client.execute(method: :delete, path: "/api/v1/operational-webhooks/#{id}")
10
- def list_deliveries(id) = @api_client.execute(method: :get, path: "/api/v1/operational-webhooks/#{id}/deliveries")
11
- end
12
- end