fuik 0.12.0 → 0.14.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 +155 -29
- data/app/assets/stylesheets/fuik/application.css +152 -88
- data/app/controllers/concerns/fuik/event_type.rb +32 -7
- data/app/controllers/fuik/downloads_controller.rb +1 -1
- data/app/controllers/fuik/events_controller.rb +6 -1
- data/app/controllers/fuik/retries_controller.rb +12 -0
- data/app/controllers/fuik/webhooks_controller.rb +19 -15
- data/app/jobs/fuik/webhook_processing_job.rb +14 -0
- data/app/models/fuik/event.rb +36 -0
- data/app/models/fuik/webhook_event/filterable.rb +3 -4
- data/app/models/fuik/webhook_event.rb +32 -1
- data/app/views/fuik/events/index.html.erb +5 -1
- data/app/views/fuik/events/show.html.erb +43 -20
- data/app/views/layouts/fuik/application.html.erb +11 -1
- data/config/routes.rb +8 -3
- data/lib/fuik/configuration.rb +36 -0
- data/lib/fuik/dot_access.rb +19 -3
- data/lib/fuik/engine.rb +1 -4
- data/lib/fuik/errors.rb +5 -0
- data/lib/fuik/notifications.rb +48 -0
- data/lib/fuik/routing/dashboard_constraint.rb +9 -0
- data/lib/fuik/routing/provider_constraint.rb +5 -15
- data/lib/fuik/test_helpers.rb +33 -0
- data/lib/fuik/version.rb +1 -1
- data/lib/fuik.rb +9 -0
- data/lib/generators/fuik/provider/templates/base.rb.tt +11 -2
- data/lib/generators/fuik/provider/templates/github/base.rb.tt +3 -0
- data/lib/generators/fuik/provider/templates/loops/base.rb.tt +2 -0
- data/lib/generators/fuik/provider/templates/postmark/base.rb.tt +1 -0
- data/lib/generators/fuik/provider/templates/spinal/base.rb.tt +16 -0
- data/lib/generators/fuik/provider/templates/spinal/collection_synced.rb.tt +14 -0
- data/lib/generators/fuik/provider/templates/spinal/resource_created.rb.tt +14 -0
- data/lib/generators/fuik/provider/templates/spinal/resource_pushed.rb.tt +13 -0
- data/lib/generators/fuik/provider/templates/spinal/resource_scheduled.rb.tt +13 -0
- data/lib/generators/fuik/provider/templates/spinal/resource_unscheduled.rb.tt +12 -0
- metadata +16 -4
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
module <%= provider_module_name %>
|
|
2
2
|
class Base < Fuik::Event
|
|
3
|
+
event_type header: "X-Github-Event"
|
|
4
|
+
event_id header: "X-GitHub-Delivery"
|
|
5
|
+
|
|
3
6
|
def self.verify!(request)
|
|
4
7
|
secret = Rails.application.credentials.dig(:github, :secret)
|
|
5
8
|
signature = request.headers["X-Hub-Signature-256"]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module <%= provider_module_name %>
|
|
2
|
+
class Base < Fuik::Event
|
|
3
|
+
event_type payload: "type"
|
|
4
|
+
event_id payload: "data.id"
|
|
5
|
+
|
|
6
|
+
# def self.verify!(request)
|
|
7
|
+
# secret = Rails.application.credentials.dig(:spinal, :webhook_secret)
|
|
8
|
+
# signature = request.headers["webhook-signature"]
|
|
9
|
+
# id = request.headers["webhook-id"]
|
|
10
|
+
# timestamp = request.headers["webhook-timestamp"]
|
|
11
|
+
|
|
12
|
+
# expected = OpenSSL::HMAC.base64digest("SHA256", secret, "#{id}.#{timestamp}.#{request.raw_post}")
|
|
13
|
+
# raise Fuik::InvalidSignature unless Rack::Utils.secure_compare(signature, "v1,#{expected}")
|
|
14
|
+
# end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module <%= provider_module_name %>
|
|
2
|
+
class CollectionSynced < Base
|
|
3
|
+
def process!
|
|
4
|
+
# payload["data"]["id"] # collection id
|
|
5
|
+
# payload["data"]["stats"]["added"] # resources added during sync
|
|
6
|
+
# payload["data"]["stats"]["updated"] # resources updated during sync
|
|
7
|
+
# payload["data"]["stats"]["removed"] # resources removed during sync
|
|
8
|
+
|
|
9
|
+
# TODO: Add business logic
|
|
10
|
+
|
|
11
|
+
@webhook_event.processed!
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module <%= provider_module_name %>
|
|
2
|
+
class ResourceCreated < Base
|
|
3
|
+
def process!
|
|
4
|
+
# payload["data"]["id"] # resource id
|
|
5
|
+
# payload["data"]["filename"] # e.g., "posts/hello-world.md"
|
|
6
|
+
# payload["data"]["relative_path"] # e.g., "posts/hello-world"
|
|
7
|
+
# payload["data"]["status"] # "draft" | "published"
|
|
8
|
+
|
|
9
|
+
# TODO: Add business logic
|
|
10
|
+
|
|
11
|
+
@webhook_event.processed!
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module <%= provider_module_name %>
|
|
2
|
+
class ResourcePushed < Base
|
|
3
|
+
def process!
|
|
4
|
+
# payload["data"]["id"] # resource id
|
|
5
|
+
# payload["data"]["filename"] # e.g., "posts/hello-world.md"
|
|
6
|
+
# payload["data"]["status"] # "draft" | "published"
|
|
7
|
+
|
|
8
|
+
# TODO: Add business logic
|
|
9
|
+
|
|
10
|
+
@webhook_event.processed!
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module <%= provider_module_name %>
|
|
2
|
+
class ResourceScheduled < Base
|
|
3
|
+
def process!
|
|
4
|
+
# payload["data"]["id"] # resource id
|
|
5
|
+
# payload["data"]["filename"] # e.g., "posts/hello-world.md"
|
|
6
|
+
# payload["data"]["published_at"] # ISO8601 scheduled publish time
|
|
7
|
+
|
|
8
|
+
# TODO: Add business logic
|
|
9
|
+
|
|
10
|
+
@webhook_event.processed!
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module <%= provider_module_name %>
|
|
2
|
+
class ResourceUnscheduled < Base
|
|
3
|
+
def process!
|
|
4
|
+
# payload["data"]["id"] # resource id
|
|
5
|
+
# payload["data"]["filename"] # e.g., "posts/hello-world.md"
|
|
6
|
+
|
|
7
|
+
# TODO: Add business logic
|
|
8
|
+
|
|
9
|
+
@webhook_event.processed!
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fuik
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rails Designer
|
|
@@ -73,6 +73,7 @@ files:
|
|
|
73
73
|
- app/controllers/fuik/application_controller.rb
|
|
74
74
|
- app/controllers/fuik/downloads_controller.rb
|
|
75
75
|
- app/controllers/fuik/events_controller.rb
|
|
76
|
+
- app/controllers/fuik/retries_controller.rb
|
|
76
77
|
- app/controllers/fuik/webhooks_controller.rb
|
|
77
78
|
- app/helpers/fuik/highlight_helper.rb
|
|
78
79
|
- app/helpers/fuik/icon_helper.rb
|
|
@@ -90,9 +91,14 @@ files:
|
|
|
90
91
|
- config/routes.rb
|
|
91
92
|
- db/migrate/20250101000000_create_webhook_events.rb
|
|
92
93
|
- lib/fuik.rb
|
|
94
|
+
- lib/fuik/configuration.rb
|
|
93
95
|
- lib/fuik/dot_access.rb
|
|
94
96
|
- lib/fuik/engine.rb
|
|
97
|
+
- lib/fuik/errors.rb
|
|
98
|
+
- lib/fuik/notifications.rb
|
|
99
|
+
- lib/fuik/routing/dashboard_constraint.rb
|
|
95
100
|
- lib/fuik/routing/provider_constraint.rb
|
|
101
|
+
- lib/fuik/test_helpers.rb
|
|
96
102
|
- lib/fuik/version.rb
|
|
97
103
|
- lib/generators/fuik/install/install_generator.rb
|
|
98
104
|
- lib/generators/fuik/provider/provider_generator.rb
|
|
@@ -127,6 +133,12 @@ files:
|
|
|
127
133
|
- lib/generators/fuik/provider/templates/smtp2go/reject.rb.tt
|
|
128
134
|
- lib/generators/fuik/provider/templates/smtp2go/spam.rb.tt
|
|
129
135
|
- lib/generators/fuik/provider/templates/smtp2go/unsubscribe.rb.tt
|
|
136
|
+
- lib/generators/fuik/provider/templates/spinal/base.rb.tt
|
|
137
|
+
- lib/generators/fuik/provider/templates/spinal/collection_synced.rb.tt
|
|
138
|
+
- lib/generators/fuik/provider/templates/spinal/resource_created.rb.tt
|
|
139
|
+
- lib/generators/fuik/provider/templates/spinal/resource_pushed.rb.tt
|
|
140
|
+
- lib/generators/fuik/provider/templates/spinal/resource_scheduled.rb.tt
|
|
141
|
+
- lib/generators/fuik/provider/templates/spinal/resource_unscheduled.rb.tt
|
|
130
142
|
- lib/generators/fuik/provider/templates/stripe/base.rb.tt
|
|
131
143
|
- lib/generators/fuik/provider/templates/stripe/checkout_session_completed.rb.tt
|
|
132
144
|
- lib/generators/fuik/provider/templates/stripe/customer_subscription_deleted.rb.tt
|
|
@@ -134,11 +146,11 @@ files:
|
|
|
134
146
|
- lib/generators/fuik/provider/templates/stripe/payment_intent_succeeded.rb.tt
|
|
135
147
|
- lib/generators/fuik/provider/templates/userlist/base.rb.tt
|
|
136
148
|
- lib/generators/fuik/provider/templates/userlist/user_unsubscribed.rb.tt
|
|
137
|
-
homepage: https://railsdesigner.com/fuik/
|
|
149
|
+
homepage: https://railsdesigner.com/open-source/fuik/
|
|
138
150
|
licenses:
|
|
139
151
|
- MIT
|
|
140
152
|
metadata:
|
|
141
|
-
homepage_uri: https://railsdesigner.com/fuik/
|
|
153
|
+
homepage_uri: https://railsdesigner.com/open-source/fuik/
|
|
142
154
|
source_code_uri: https://github.com/Rails-Designer/fuik/
|
|
143
155
|
rdoc_options: []
|
|
144
156
|
require_paths:
|
|
@@ -154,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
154
166
|
- !ruby/object:Gem::Version
|
|
155
167
|
version: '0'
|
|
156
168
|
requirements: []
|
|
157
|
-
rubygems_version: 4.0.
|
|
169
|
+
rubygems_version: 4.0.24
|
|
158
170
|
specification_version: 4
|
|
159
171
|
summary: A fish trap for webhooks
|
|
160
172
|
test_files: []
|