hooksniff 1.1.0 → 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.
- checksums.yaml +4 -4
- data/README.md +42 -13
- data/lib/hooksniff/api/alert.rb +34 -0
- data/lib/hooksniff/api/analytics.rb +21 -0
- data/lib/hooksniff/api/api_key.rb +26 -0
- data/lib/hooksniff/api/application.rb +30 -0
- data/lib/hooksniff/api/audit_log.rb +17 -0
- data/lib/hooksniff/api/background_task.rb +21 -0
- data/lib/hooksniff/api/billing.rb +34 -0
- data/lib/hooksniff/api/connector.rb +33 -0
- data/lib/hooksniff/api/custom_domain.rb +26 -0
- data/lib/hooksniff/api/environment.rb +47 -0
- data/lib/hooksniff/api/inbound.rb +30 -0
- data/lib/hooksniff/api/message_poller.rb +21 -0
- data/lib/hooksniff/api/notification.rb +30 -0
- data/lib/hooksniff/api/operational_webhook.rb +34 -0
- data/lib/hooksniff/api/playground.rb +17 -0
- data/lib/hooksniff/api/portal.rb +33 -0
- data/lib/hooksniff/api/rate_limit.rb +26 -0
- data/lib/hooksniff/api/routing.rb +21 -0
- data/lib/hooksniff/api/schema.rb +25 -0
- data/lib/hooksniff/api/search.rb +13 -0
- data/lib/hooksniff/api/service_token.rb +22 -0
- data/lib/hooksniff/api/sso.rb +26 -0
- data/lib/hooksniff/api/team.rb +42 -0
- data/lib/hooksniff/api/template.rb +21 -0
- data/lib/hooksniff/models/aggregate_event_types_out.rb +59 -0
- data/lib/hooksniff/models/message_attempt_recovered_event.rb +53 -0
- data/lib/hooksniff/models/message_attempt_recovered_event_data.rb +70 -0
- data/lib/hooksniff/models/message_in.rb +1 -0
- data/lib/hooksniff/version.rb +1 -1
- data/lib/hooksniff.rb +132 -66
- metadata +30 -9
- data/lib/hooksniff/background_task.rb +0 -21
- data/lib/hooksniff/connector.rb +0 -33
- data/lib/hooksniff/environment.rb +0 -53
- data/lib/hooksniff/inbound.rb +0 -25
- data/lib/hooksniff/message_poller.rb +0 -32
- data/lib/hooksniff/operational_webhook.rb +0 -12
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module HookSniff
|
|
4
|
+
class Sso
|
|
5
|
+
def initialize(client)
|
|
6
|
+
@client = client
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get_config
|
|
10
|
+
@client.execute_request("GET", "/v1/sso/config")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def upsert_config(attrs)
|
|
14
|
+
@client.execute_request("POST", "/v1/sso/config", body: attrs)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def delete_config
|
|
18
|
+
@client.execute_request("DELETE", "/v1/sso/config")
|
|
19
|
+
nil
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def test
|
|
23
|
+
@client.execute_request("POST", "/v1/sso/test")
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module HookSniff
|
|
4
|
+
class Team
|
|
5
|
+
def initialize(client)
|
|
6
|
+
@client = client
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def list
|
|
10
|
+
@client.execute_request("GET", "/v1/teams")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def get(id)
|
|
14
|
+
@client.execute_request("GET", "/v1/teams/#{id}")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def create(attrs)
|
|
18
|
+
@client.execute_request("POST", "/v1/teams", body: attrs)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def accept_invite(attrs)
|
|
22
|
+
@client.execute_request("POST", "/v1/teams/accept-invite", body: attrs)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def invite(team_id, attrs)
|
|
26
|
+
@client.execute_request("POST", "/v1/teams/#{team_id}/invite", body: attrs)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def list_members(team_id)
|
|
30
|
+
@client.execute_request("GET", "/v1/teams/#{team_id}/members")
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def remove_member(team_id, user_id)
|
|
34
|
+
@client.execute_request("DELETE", "/v1/teams/#{team_id}/members/#{user_id}")
|
|
35
|
+
nil
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def change_role(team_id, user_id, attrs)
|
|
39
|
+
@client.execute_request("PUT", "/v1/teams/#{team_id}/members/#{user_id}/role", body: attrs)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module HookSniff
|
|
4
|
+
class Template
|
|
5
|
+
def initialize(client)
|
|
6
|
+
@client = client
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def list
|
|
10
|
+
@client.execute_request("GET", "/v1/templates")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def get(id)
|
|
14
|
+
@client.execute_request("GET", "/v1/templates/#{id}")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def apply(id, attrs)
|
|
18
|
+
@client.execute_request("POST", "/v1/templates/#{id}/apply", body: attrs)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module HookSniff
|
|
6
|
+
class AggregateEventTypesOut
|
|
7
|
+
# The QueueBackgroundTask's ID.
|
|
8
|
+
attr_accessor :id
|
|
9
|
+
attr_accessor :status
|
|
10
|
+
attr_accessor :task
|
|
11
|
+
attr_accessor :updated_at
|
|
12
|
+
|
|
13
|
+
ALL_FIELD ||= ["id", "status", "task", "updated_at"].freeze
|
|
14
|
+
private_constant :ALL_FIELD
|
|
15
|
+
|
|
16
|
+
def initialize(attributes = {})
|
|
17
|
+
unless attributes.is_a?(Hash)
|
|
18
|
+
fail(
|
|
19
|
+
ArgumentError,
|
|
20
|
+
"The input argument (attributes) must be a hash in `HookSniff::AggregateEventTypesOut` new method"
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
attributes.each do |k, v|
|
|
25
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
26
|
+
fail(ArgumentError, "The field #{k} is not part of HookSniff::AggregateEventTypesOut")
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
instance_variable_set("@#{k}", v)
|
|
30
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.deserialize(attributes = {})
|
|
35
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
36
|
+
attrs = Hash.new
|
|
37
|
+
attrs["id"] = attributes["id"]
|
|
38
|
+
attrs["status"] = HookSniff::BackgroundTaskStatus.deserialize(attributes["status"])
|
|
39
|
+
attrs["task"] = HookSniff::BackgroundTaskType.deserialize(attributes["task"])
|
|
40
|
+
attrs["updated_at"] = DateTime.rfc3339(attributes["updatedAt"]).to_time
|
|
41
|
+
new(attrs)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def serialize
|
|
45
|
+
out = Hash.new
|
|
46
|
+
out["id"] = HookSniff::serialize_primitive(@id) if @id
|
|
47
|
+
out["status"] = HookSniff::serialize_schema_ref(@status) if @status
|
|
48
|
+
out["task"] = HookSniff::serialize_schema_ref(@task) if @task
|
|
49
|
+
out["updatedAt"] = HookSniff::serialize_primitive(@updated_at) if @updated_at
|
|
50
|
+
out
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Serializes the object to a json string
|
|
54
|
+
# @return String
|
|
55
|
+
def to_json
|
|
56
|
+
JSON.dump(serialize)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module HookSniff
|
|
6
|
+
# Sent on a successful dispatch after an earlier failure op webhook has already been sent.
|
|
7
|
+
class MessageAttemptRecoveredEvent
|
|
8
|
+
attr_accessor :data
|
|
9
|
+
attr_accessor :type
|
|
10
|
+
|
|
11
|
+
ALL_FIELD ||= ["data", "type"].freeze
|
|
12
|
+
private_constant :ALL_FIELD
|
|
13
|
+
|
|
14
|
+
def initialize(attributes = {})
|
|
15
|
+
unless attributes.is_a?(Hash)
|
|
16
|
+
fail(
|
|
17
|
+
ArgumentError,
|
|
18
|
+
"The input argument (attributes) must be a hash in `HookSniff::MessageAttemptRecoveredEvent` new method"
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
attributes.each do |k, v|
|
|
23
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
24
|
+
fail(ArgumentError, "The field #{k} is not part of HookSniff::MessageAttemptRecoveredEvent")
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
instance_variable_set("@#{k}", v)
|
|
28
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def self.deserialize(attributes = {})
|
|
33
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
34
|
+
attrs = Hash.new
|
|
35
|
+
attrs["data"] = HookSniff::MessageAttemptRecoveredEventData.deserialize(attributes["data"])
|
|
36
|
+
attrs["type"] = attributes["type"]
|
|
37
|
+
new(attrs)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def serialize
|
|
41
|
+
out = Hash.new
|
|
42
|
+
out["data"] = HookSniff::serialize_schema_ref(@data) if @data
|
|
43
|
+
out["type"] = HookSniff::serialize_primitive(@type) if @type
|
|
44
|
+
out
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Serializes the object to a json string
|
|
48
|
+
# @return String
|
|
49
|
+
def to_json
|
|
50
|
+
JSON.dump(serialize)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module HookSniff
|
|
6
|
+
# Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a "message.attempt.exhausted" type or after it's failed four times as a "message.attempt.failing" event.
|
|
7
|
+
class MessageAttemptRecoveredEventData
|
|
8
|
+
# The Application's ID.
|
|
9
|
+
attr_accessor :app_id
|
|
10
|
+
# The Application's UID.
|
|
11
|
+
attr_accessor :app_uid
|
|
12
|
+
# The Endpoint's ID.
|
|
13
|
+
attr_accessor :endpoint_id
|
|
14
|
+
attr_accessor :last_attempt
|
|
15
|
+
# The Message's UID.
|
|
16
|
+
attr_accessor :msg_event_id
|
|
17
|
+
# The Message's ID.
|
|
18
|
+
attr_accessor :msg_id
|
|
19
|
+
|
|
20
|
+
ALL_FIELD ||= ["app_id", "app_uid", "endpoint_id", "last_attempt", "msg_event_id", "msg_id"].freeze
|
|
21
|
+
private_constant :ALL_FIELD
|
|
22
|
+
|
|
23
|
+
def initialize(attributes = {})
|
|
24
|
+
unless attributes.is_a?(Hash)
|
|
25
|
+
fail(
|
|
26
|
+
ArgumentError,
|
|
27
|
+
"The input argument (attributes) must be a hash in `HookSniff::MessageAttemptRecoveredEventData` new method"
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
attributes.each do |k, v|
|
|
32
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
33
|
+
fail(ArgumentError, "The field #{k} is not part of HookSniff::MessageAttemptRecoveredEventData")
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
instance_variable_set("@#{k}", v)
|
|
37
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def self.deserialize(attributes = {})
|
|
42
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
43
|
+
attrs = Hash.new
|
|
44
|
+
attrs["app_id"] = attributes["appId"]
|
|
45
|
+
attrs["app_uid"] = attributes["appUid"]
|
|
46
|
+
attrs["endpoint_id"] = attributes["endpointId"]
|
|
47
|
+
attrs["last_attempt"] = HookSniff::MessageAttemptFailedData.deserialize(attributes["lastAttempt"])
|
|
48
|
+
attrs["msg_event_id"] = attributes["msgEventId"]
|
|
49
|
+
attrs["msg_id"] = attributes["msgId"]
|
|
50
|
+
new(attrs)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def serialize
|
|
54
|
+
out = Hash.new
|
|
55
|
+
out["appId"] = HookSniff::serialize_primitive(@app_id) if @app_id
|
|
56
|
+
out["appUid"] = HookSniff::serialize_primitive(@app_uid) if @app_uid
|
|
57
|
+
out["endpointId"] = HookSniff::serialize_primitive(@endpoint_id) if @endpoint_id
|
|
58
|
+
out["lastAttempt"] = HookSniff::serialize_schema_ref(@last_attempt) if @last_attempt
|
|
59
|
+
out["msgEventId"] = HookSniff::serialize_primitive(@msg_event_id) if @msg_event_id
|
|
60
|
+
out["msgId"] = HookSniff::serialize_primitive(@msg_id) if @msg_id
|
|
61
|
+
out
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Serializes the object to a json string
|
|
65
|
+
# @return String
|
|
66
|
+
def to_json
|
|
67
|
+
JSON.dump(serialize)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -63,6 +63,7 @@ module HookSniff
|
|
|
63
63
|
def self.deserialize(attributes = {})
|
|
64
64
|
attributes = attributes.transform_keys(&:to_s)
|
|
65
65
|
attrs = Hash.new
|
|
66
|
+
attrs["application"] = HookSniff::ApplicationIn.deserialize(attributes["application"]) if attributes["application"]
|
|
66
67
|
attrs["channels"] = attributes["channels"]
|
|
67
68
|
attrs["deliver_at"] = DateTime.rfc3339(attributes["deliverAt"]).to_time if attributes["deliverAt"]
|
|
68
69
|
attrs["event_id"] = attributes["eventId"]
|
data/lib/hooksniff/version.rb
CHANGED
data/lib/hooksniff.rb
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "
|
|
4
|
-
require "
|
|
5
|
-
require "
|
|
6
|
-
require "
|
|
7
|
-
require "
|
|
3
|
+
require "hooksniff/version"
|
|
4
|
+
require "hooksniff/hooksniff_http_client"
|
|
5
|
+
require "hooksniff/api_error"
|
|
6
|
+
require "hooksniff/errors"
|
|
7
|
+
require "hooksniff/util"
|
|
8
|
+
require "hooksniff/webhook"
|
|
8
9
|
|
|
9
|
-
#
|
|
10
|
+
# Original resources
|
|
10
11
|
require "hooksniff/api/authentication"
|
|
11
12
|
require "hooksniff/api/endpoint"
|
|
12
13
|
require "hooksniff/api/event_type"
|
|
@@ -15,64 +16,129 @@ require "hooksniff/api/message"
|
|
|
15
16
|
require "hooksniff/api/message_attempt"
|
|
16
17
|
require "hooksniff/api/statistics"
|
|
17
18
|
|
|
18
|
-
#
|
|
19
|
-
require "hooksniff/
|
|
20
|
-
require "hooksniff/
|
|
21
|
-
require "hooksniff/
|
|
22
|
-
require "hooksniff/
|
|
23
|
-
require "hooksniff/
|
|
24
|
-
require "hooksniff/
|
|
25
|
-
require "hooksniff/
|
|
26
|
-
require "hooksniff/
|
|
27
|
-
require "hooksniff/models/endpoint_enabled_event_data"
|
|
28
|
-
require "hooksniff/models/endpoint_headers_in"
|
|
29
|
-
require "hooksniff/models/endpoint_headers_out"
|
|
30
|
-
require "hooksniff/models/endpoint_headers_patch_in"
|
|
31
|
-
require "hooksniff/models/endpoint_in"
|
|
32
|
-
require "hooksniff/models/endpoint_out"
|
|
33
|
-
require "hooksniff/models/endpoint_patch"
|
|
34
|
-
require "hooksniff/models/endpoint_secret_out"
|
|
35
|
-
require "hooksniff/models/endpoint_secret_rotate_in"
|
|
36
|
-
require "hooksniff/models/endpoint_update"
|
|
37
|
-
require "hooksniff/models/endpoint_updated_event"
|
|
38
|
-
require "hooksniff/models/endpoint_updated_event_data"
|
|
39
|
-
require "hooksniff/models/event_in"
|
|
40
|
-
require "hooksniff/models/event_out"
|
|
41
|
-
require "hooksniff/models/event_type_in"
|
|
42
|
-
require "hooksniff/models/event_type_out"
|
|
43
|
-
require "hooksniff/models/event_type_patch"
|
|
44
|
-
require "hooksniff/models/event_type_update"
|
|
45
|
-
require "hooksniff/models/list_response_endpoint_out"
|
|
46
|
-
require "hooksniff/models/list_response_event_type_out"
|
|
47
|
-
require "hooksniff/models/list_response_message_attempt_out"
|
|
48
|
-
require "hooksniff/models/list_response_message_out"
|
|
49
|
-
require "hooksniff/models/message_attempt_exhausted_event"
|
|
50
|
-
require "hooksniff/models/message_attempt_exhausted_event_data"
|
|
51
|
-
require "hooksniff/models/message_attempt_failed_data"
|
|
52
|
-
require "hooksniff/models/message_attempt_failing_event"
|
|
53
|
-
require "hooksniff/models/message_attempt_failing_event_data"
|
|
54
|
-
require "hooksniff/models/message_attempt_log"
|
|
55
|
-
require "hooksniff/models/message_attempt_log_event"
|
|
56
|
-
require "hooksniff/models/message_attempt_out"
|
|
57
|
-
require "hooksniff/models/message_attempt_recovered_event"
|
|
58
|
-
require "hooksniff/models/message_attempt_recovered_event_data"
|
|
59
|
-
require "hooksniff/models/message_attempt_trigger_type"
|
|
60
|
-
require "hooksniff/models/message_in"
|
|
61
|
-
require "hooksniff/models/message_out"
|
|
62
|
-
require "hooksniff/models/message_status"
|
|
63
|
-
require "hooksniff/models/message_status_text"
|
|
64
|
-
require "hooksniff/models/ordering"
|
|
65
|
-
require "hooksniff/models/status_code_class"
|
|
19
|
+
# Faz 8-15 resources
|
|
20
|
+
require "hooksniff/api/environment"
|
|
21
|
+
require "hooksniff/api/background_task"
|
|
22
|
+
require "hooksniff/api/operational_webhook"
|
|
23
|
+
require "hooksniff/api/message_poller"
|
|
24
|
+
require "hooksniff/api/inbound"
|
|
25
|
+
require "hooksniff/api/connector"
|
|
26
|
+
require "hooksniff/api/integration"
|
|
27
|
+
require "hooksniff/api/stream"
|
|
66
28
|
|
|
67
|
-
#
|
|
68
|
-
require "hooksniff/
|
|
69
|
-
require "hooksniff/
|
|
70
|
-
require "hooksniff/
|
|
71
|
-
require "hooksniff/
|
|
72
|
-
require "hooksniff/
|
|
73
|
-
require "hooksniff/
|
|
74
|
-
require "hooksniff/
|
|
75
|
-
require "hooksniff/
|
|
76
|
-
require "hooksniff/
|
|
77
|
-
require "hooksniff/
|
|
78
|
-
require "hooksniff/
|
|
29
|
+
# Additional resources
|
|
30
|
+
require "hooksniff/api/application"
|
|
31
|
+
require "hooksniff/api/api_key"
|
|
32
|
+
require "hooksniff/api/search"
|
|
33
|
+
require "hooksniff/api/alert"
|
|
34
|
+
require "hooksniff/api/analytics"
|
|
35
|
+
require "hooksniff/api/billing"
|
|
36
|
+
require "hooksniff/api/portal"
|
|
37
|
+
require "hooksniff/api/team"
|
|
38
|
+
require "hooksniff/api/notification"
|
|
39
|
+
require "hooksniff/api/sso"
|
|
40
|
+
require "hooksniff/api/audit_log"
|
|
41
|
+
require "hooksniff/api/custom_domain"
|
|
42
|
+
require "hooksniff/api/rate_limit"
|
|
43
|
+
require "hooksniff/api/routing"
|
|
44
|
+
require "hooksniff/api/template"
|
|
45
|
+
require "hooksniff/api/schema"
|
|
46
|
+
require "hooksniff/api/playground"
|
|
47
|
+
require "hooksniff/api/service_token"
|
|
48
|
+
|
|
49
|
+
module HookSniff
|
|
50
|
+
class HookSniffOptions
|
|
51
|
+
attr_accessor :debug
|
|
52
|
+
attr_accessor :server_url
|
|
53
|
+
|
|
54
|
+
def initialize(debug = false, server_url = nil)
|
|
55
|
+
@debug = debug
|
|
56
|
+
@server_url = server_url
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
class Client
|
|
61
|
+
# Original resources
|
|
62
|
+
attr_accessor :authentication
|
|
63
|
+
attr_accessor :endpoint
|
|
64
|
+
attr_accessor :event_type
|
|
65
|
+
attr_accessor :health
|
|
66
|
+
attr_accessor :message
|
|
67
|
+
attr_accessor :message_attempt
|
|
68
|
+
attr_accessor :statistics
|
|
69
|
+
|
|
70
|
+
# Faz 8-15 resources
|
|
71
|
+
attr_accessor :environment
|
|
72
|
+
attr_accessor :background_task
|
|
73
|
+
attr_accessor :operational_webhook
|
|
74
|
+
attr_accessor :message_poller
|
|
75
|
+
attr_accessor :inbound
|
|
76
|
+
attr_accessor :connector
|
|
77
|
+
attr_accessor :integration
|
|
78
|
+
attr_accessor :stream
|
|
79
|
+
|
|
80
|
+
# Additional resources
|
|
81
|
+
attr_accessor :application
|
|
82
|
+
attr_accessor :api_key
|
|
83
|
+
attr_accessor :search
|
|
84
|
+
attr_accessor :alert
|
|
85
|
+
attr_accessor :analytics
|
|
86
|
+
attr_accessor :billing
|
|
87
|
+
attr_accessor :portal
|
|
88
|
+
attr_accessor :team
|
|
89
|
+
attr_accessor :notification
|
|
90
|
+
attr_accessor :sso
|
|
91
|
+
attr_accessor :audit_log
|
|
92
|
+
attr_accessor :custom_domain
|
|
93
|
+
attr_accessor :rate_limit
|
|
94
|
+
attr_accessor :routing
|
|
95
|
+
attr_accessor :template
|
|
96
|
+
attr_accessor :schema
|
|
97
|
+
attr_accessor :playground
|
|
98
|
+
attr_accessor :service_token
|
|
99
|
+
|
|
100
|
+
def initialize(auth_token, options = HookSniffOptions.new)
|
|
101
|
+
uri = URI(options.server_url || "https://hooksniff-api-1046140057667.europe-west1.run.app")
|
|
102
|
+
api_client = HookSniffHttpClient.new(auth_token, uri)
|
|
103
|
+
|
|
104
|
+
# Original
|
|
105
|
+
@authentication = Authentication.new(api_client)
|
|
106
|
+
@endpoint = Endpoint.new(api_client)
|
|
107
|
+
@event_type = EventType.new(api_client)
|
|
108
|
+
@health = Health.new(api_client)
|
|
109
|
+
@message = Message.new(api_client)
|
|
110
|
+
@message_attempt = MessageAttempt.new(api_client)
|
|
111
|
+
@statistics = Statistics.new(api_client)
|
|
112
|
+
|
|
113
|
+
# Faz 8-15
|
|
114
|
+
@environment = Environment.new(api_client)
|
|
115
|
+
@background_task = BackgroundTask.new(api_client)
|
|
116
|
+
@operational_webhook = OperationalWebhook.new(api_client)
|
|
117
|
+
@message_poller = MessagePoller.new(api_client)
|
|
118
|
+
@inbound = Inbound.new(api_client)
|
|
119
|
+
@connector = Connector.new(api_client)
|
|
120
|
+
@integration = IntegrationApi.new(api_client)
|
|
121
|
+
@stream = StreamApi.new(api_client)
|
|
122
|
+
|
|
123
|
+
# Additional
|
|
124
|
+
@application = Application.new(api_client)
|
|
125
|
+
@api_key = ApiKey.new(api_client)
|
|
126
|
+
@search = Search.new(api_client)
|
|
127
|
+
@alert = Alert.new(api_client)
|
|
128
|
+
@analytics = Analytics.new(api_client)
|
|
129
|
+
@billing = Billing.new(api_client)
|
|
130
|
+
@portal = Portal.new(api_client)
|
|
131
|
+
@team = Team.new(api_client)
|
|
132
|
+
@notification = Notification.new(api_client)
|
|
133
|
+
@sso = Sso.new(api_client)
|
|
134
|
+
@audit_log = AuditLog.new(api_client)
|
|
135
|
+
@custom_domain = CustomDomain.new(api_client)
|
|
136
|
+
@rate_limit = RateLimit.new(api_client)
|
|
137
|
+
@routing = Routing.new(api_client)
|
|
138
|
+
@template = Template.new(api_client)
|
|
139
|
+
@schema = Schema.new(api_client)
|
|
140
|
+
@playground = Playground.new(api_client)
|
|
141
|
+
@service_token = ServiceToken.new(api_client)
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hooksniff
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- HookSniff
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|
|
@@ -93,27 +93,47 @@ files:
|
|
|
93
93
|
- Rakefile
|
|
94
94
|
- hooksniff.gemspec
|
|
95
95
|
- lib/hooksniff.rb
|
|
96
|
+
- lib/hooksniff/api/alert.rb
|
|
97
|
+
- lib/hooksniff/api/analytics.rb
|
|
98
|
+
- lib/hooksniff/api/api_key.rb
|
|
99
|
+
- lib/hooksniff/api/application.rb
|
|
100
|
+
- lib/hooksniff/api/audit_log.rb
|
|
96
101
|
- lib/hooksniff/api/authentication.rb
|
|
102
|
+
- lib/hooksniff/api/background_task.rb
|
|
103
|
+
- lib/hooksniff/api/billing.rb
|
|
104
|
+
- lib/hooksniff/api/connector.rb
|
|
105
|
+
- lib/hooksniff/api/custom_domain.rb
|
|
97
106
|
- lib/hooksniff/api/endpoint.rb
|
|
107
|
+
- lib/hooksniff/api/environment.rb
|
|
98
108
|
- lib/hooksniff/api/event_type.rb
|
|
99
109
|
- lib/hooksniff/api/health.rb
|
|
110
|
+
- lib/hooksniff/api/inbound.rb
|
|
100
111
|
- lib/hooksniff/api/integration.rb
|
|
101
112
|
- lib/hooksniff/api/message.rb
|
|
102
113
|
- lib/hooksniff/api/message_attempt.rb
|
|
114
|
+
- lib/hooksniff/api/message_poller.rb
|
|
115
|
+
- lib/hooksniff/api/notification.rb
|
|
116
|
+
- lib/hooksniff/api/operational_webhook.rb
|
|
117
|
+
- lib/hooksniff/api/playground.rb
|
|
118
|
+
- lib/hooksniff/api/portal.rb
|
|
119
|
+
- lib/hooksniff/api/rate_limit.rb
|
|
120
|
+
- lib/hooksniff/api/routing.rb
|
|
121
|
+
- lib/hooksniff/api/schema.rb
|
|
122
|
+
- lib/hooksniff/api/search.rb
|
|
123
|
+
- lib/hooksniff/api/service_token.rb
|
|
124
|
+
- lib/hooksniff/api/sso.rb
|
|
103
125
|
- lib/hooksniff/api/statistics.rb
|
|
104
126
|
- lib/hooksniff/api/stream.rb
|
|
127
|
+
- lib/hooksniff/api/team.rb
|
|
128
|
+
- lib/hooksniff/api/template.rb
|
|
105
129
|
- lib/hooksniff/api_error.rb
|
|
106
|
-
- lib/hooksniff/background_task.rb
|
|
107
|
-
- lib/hooksniff/connector.rb
|
|
108
|
-
- lib/hooksniff/environment.rb
|
|
109
130
|
- lib/hooksniff/errors.rb
|
|
110
131
|
- lib/hooksniff/hooksniff.rb
|
|
111
132
|
- lib/hooksniff/hooksniff_http_client.rb
|
|
112
133
|
- lib/hooksniff/http_error_out.rb
|
|
113
134
|
- lib/hooksniff/http_validation_error.rb
|
|
114
|
-
- lib/hooksniff/inbound.rb
|
|
115
135
|
- lib/hooksniff/internal.rb
|
|
116
|
-
- lib/hooksniff/
|
|
136
|
+
- lib/hooksniff/models/aggregate_event_types_out.rb
|
|
117
137
|
- lib/hooksniff/models/endpoint_created_event.rb
|
|
118
138
|
- lib/hooksniff/models/endpoint_created_event_data.rb
|
|
119
139
|
- lib/hooksniff/models/endpoint_deleted_event.rb
|
|
@@ -151,6 +171,8 @@ files:
|
|
|
151
171
|
- lib/hooksniff/models/message_attempt_log.rb
|
|
152
172
|
- lib/hooksniff/models/message_attempt_log_event.rb
|
|
153
173
|
- lib/hooksniff/models/message_attempt_out.rb
|
|
174
|
+
- lib/hooksniff/models/message_attempt_recovered_event.rb
|
|
175
|
+
- lib/hooksniff/models/message_attempt_recovered_event_data.rb
|
|
154
176
|
- lib/hooksniff/models/message_attempt_trigger_type.rb
|
|
155
177
|
- lib/hooksniff/models/message_endpoint_out.rb
|
|
156
178
|
- lib/hooksniff/models/message_in.rb
|
|
@@ -159,7 +181,6 @@ files:
|
|
|
159
181
|
- lib/hooksniff/models/message_status_text.rb
|
|
160
182
|
- lib/hooksniff/models/ordering.rb
|
|
161
183
|
- lib/hooksniff/models/status_code_class.rb
|
|
162
|
-
- lib/hooksniff/operational_webhook.rb
|
|
163
184
|
- lib/hooksniff/util.rb
|
|
164
185
|
- lib/hooksniff/validation_error.rb
|
|
165
186
|
- lib/hooksniff/version.rb
|
|
@@ -187,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
187
208
|
- !ruby/object:Gem::Version
|
|
188
209
|
version: '0'
|
|
189
210
|
requirements: []
|
|
190
|
-
rubygems_version: 3.4.
|
|
211
|
+
rubygems_version: 3.4.19
|
|
191
212
|
signing_key:
|
|
192
213
|
specification_version: 4
|
|
193
214
|
summary: HookSniff webhooks API client and webhook verification library
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module HookSniff
|
|
4
|
-
class BackgroundTask
|
|
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/background-tasks")
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def get(task_id)
|
|
14
|
-
@api_client.execute(method: :get, path: "/api/v1/background-tasks/#{task_id}")
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def cancel(task_id)
|
|
18
|
-
@api_client.execute(method: :put, path: "/api/v1/background-tasks/#{task_id}")
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
data/lib/hooksniff/connector.rb
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module HookSniff
|
|
4
|
-
class Connector
|
|
5
|
-
def initialize(client)
|
|
6
|
-
@client = client
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def list
|
|
10
|
-
@client.request(:get, "/api/v1/connectors")
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def get(id)
|
|
14
|
-
@client.request(:get, "/api/v1/connectors/#{id}")
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def list_configs
|
|
18
|
-
@client.request(:get, "/api/v1/connectors/configs")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def create_config(body)
|
|
22
|
-
@client.request(:post, "/api/v1/connectors/configs", body: body)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def update_config(id, body)
|
|
26
|
-
@client.request(:put, "/api/v1/connectors/configs/#{id}", body: body)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def delete_config(id)
|
|
30
|
-
@client.request(:delete, "/api/v1/connectors/configs/#{id}")
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|