bullet_train-outgoing_webhooks 1.6.26 → 1.6.27

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25a5d250a4d831c3e9f53af0c4843423442b0278ea6a4df2a0d85e3cda45a174
4
- data.tar.gz: 8e7715ad062d2eed90fafc014449424523825e37c550c6857e84fe13fe64a436
3
+ metadata.gz: f8f079be27c5633d3a789ab4a6c001394548dae38dbe6bc6dca08ca9776174b6
4
+ data.tar.gz: 64e489f7fb7262a99b6513cef9f09e50b089ebe114d53b996f9571b378459c28
5
5
  SHA512:
6
- metadata.gz: e6178315c57dabecb1bfc3c177761d34851b92efca11ed4168d002a037fe23a63265d4b94d7f3770049ce5cf37498979262459af9d376f7f480e52222e9e4e4b
7
- data.tar.gz: faa8ca526546d364d38fe8fb9fb65c25e38f0546c2c0dbd62ffa63990d4681ab680e2b50a4e302358d02e43002eca447160cfb884f66d4f10d691df3bc77b6cd
6
+ metadata.gz: 6509e1a134d258a3c61ee038041019d8fa99220b457875f4d88e8b46c2c50d373ae6a581b1ec803e98f01531d3eccc72009225bb352a1269281a4a7abdb3d693
7
+ data.tar.gz: cde8cfa17d9bebaffef0e4b2a3379ed8847f52d0cdfabf99829dd2eaab70288e873916ff9dd0b88c489729f67b5262657828060e815930488aa13405bb1d7aa3
@@ -9,7 +9,7 @@ module Webhooks::Outgoing::DeliveryAttemptSupport
9
9
  has_one :team, through: :delivery unless BulletTrain::OutgoingWebhooks.parent_class_specified?
10
10
  scope :successful, -> { where(response_code: SUCCESS_RESPONSE_CODES) }
11
11
 
12
- before_create do
12
+ after_initialize do
13
13
  self.attempt_number = delivery.attempt_count + 1
14
14
  end
15
15
 
@@ -35,6 +35,7 @@ module Webhooks::Outgoing::DeliveryAttemptSupport
35
35
  unless allowed_uri?(uri)
36
36
  self.response_code = 0
37
37
  self.error_message = "URI is not allowed: " + uri
38
+ save
38
39
  return false
39
40
  end
40
41
  end
@@ -34,7 +34,7 @@ module Webhooks::Outgoing::DeliverySupport
34
34
  def deliver
35
35
  # TODO If we ever do away with the `async: true` default for webhook generation, then I believe this needs to
36
36
  # change otherwise we'd be attempting the first delivery of webhooks inline.
37
- if delivery_attempts.create.attempt
37
+ if delivery_attempts.new.attempt
38
38
  touch(:delivered_at)
39
39
  else
40
40
  deliver_async
@@ -1,5 +1,5 @@
1
1
  class Webhooks::Outgoing::EventType < ApplicationHash
2
- self.data = YAML.load_file("config/models/webhooks/outgoing/event_types.yml").map do |topic, events|
2
+ self.data = YAML.load_file("#{Rails.root}/config/models/webhooks/outgoing/event_types.yml").map do |topic, events|
3
3
  events.map { |event| (event == "crud") ? ["created", "updated", "deleted"] : event }.flatten.map { |event| {id: "#{topic}.#{event}"} }
4
4
  end.flatten
5
5
 
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module OutgoingWebhooks
3
- VERSION = "1.6.26"
3
+ VERSION = "1.6.27"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-outgoing_webhooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.26
4
+ version: 1.6.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-18 00:00:00.000000000 Z
11
+ date: 2024-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -138,7 +138,6 @@ files:
138
138
  - config/locales/en/webhooks/outgoing/delivery_attempts.en.yml
139
139
  - config/locales/en/webhooks/outgoing/endpoints.en.yml
140
140
  - config/locales/en/webhooks/outgoing/events.en.yml
141
- - config/models/webhooks/outgoing/event_types.yml
142
141
  - config/routes.rb
143
142
  - db/migrate/20180420013127_create_webhooks_outgoing_endpoints.rb
144
143
  - db/migrate/20180420013505_create_webhooks_outgoing_endpoint_event_types.rb
@@ -191,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
190
  - !ruby/object:Gem::Version
192
191
  version: '0'
193
192
  requirements: []
194
- rubygems_version: 3.4.10
193
+ rubygems_version: 3.5.3
195
194
  signing_key:
196
195
  specification_version: 4
197
196
  summary: Allow users of your Rails application to subscribe and receive webhooks when
@@ -1,16 +0,0 @@
1
- # This is a default implementation of this file that we supply to help with gem tests.
2
- # The version from the starter repo will take precedence when running the full app.
3
- # You can think of the file in the starter repo as having been ejected from this gem.
4
-
5
- # This file is here just to allow tests to pass when run from inside this gem directory.
6
- # It wasn't found if I put the file in test/dummy/config/models/webhooks/outgoing, so
7
- # maybe we need a better resolution method?
8
- scaffolding/absolutely_abstract/creative_concept:
9
- # This automatically generates `created`, `updated`, and `deleted` webhook events.
10
- - crud
11
- scaffolding/completely_concrete/tangible_thing:
12
- - crud
13
- invitation:
14
- - crud
15
- membership:
16
- - crud