envoy-hooks 0.4.1 → 0.6.0

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: 7eec6ece188d98fdc51dacbe9b7fb34691ad5fb63d33ed3d524a4b88941ec098
4
- data.tar.gz: e5326622b5dcc9c05081eaced2e57a69b496e80b8b7c4a0a63db3de19d18080e
3
+ metadata.gz: 8de3f7e9c5174c2377dae06da7287b4378f278198eedf44894b9098ff9cae0f1
4
+ data.tar.gz: 23e93ecb2e8baf8246c28d4bfcc600fb2d993b131661a30f34055a9c8c28b2a6
5
5
  SHA512:
6
- metadata.gz: c79ea4991ac5def8717612f13b32c9bd8a81e3463987104fc387fca51e1c155610aa51929ae5f54955be338721d62bee2a431be8cfee6bd4a1d0e5a86ff7f738
7
- data.tar.gz: 546efa0cfcb06094ec802cb669b4c246a500eddad747e99da7f8701c819294e9469ec08afa6d66c03e7763a8c8f85d25086d48fd6a5275df7b19ae739e5e1b2b
6
+ metadata.gz: daa518f26235edc2861a62f674f39c3f6484a0989a1db9c51e5d353e16836276e366cc263b6684b924965ff515148454bb876a4afdeadcb0593d7234fab9a47b
7
+ data.tar.gz: 1b3e9bcd5608ca465ea104e7baa0a80d3b80e27f9202832feb2bf779b84eb0d4ba390cbdd8bed4d430cd9c8505d51d218c32a671607ae09009fced5a0f51cb52
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- envoy-hooks (0.4.1)
4
+ envoy-hooks (0.6.0)
5
5
  faraday (~> 0.15.4)
6
6
  faraday-net_http (~> 1.0)
7
7
  faraday_middleware (~> 0.12.2)
data/README.md CHANGED
@@ -159,7 +159,8 @@ This will act to fetch the custom UI, which we will receive in the response.
159
159
  hooksService.triggerUIHooks(
160
160
  # REQUIRED
161
161
  locationId: 3,
162
- triggerName: "welcome_email", # which "extension point" the UI will be showing up at.
162
+ triggerName: "welcome_email", # The UI Hook name to invoke (deprecated)
163
+ triggerNames: ["welcome_email"], # The list of UI Hook extension names to invoke (triggerName or triggerNames required)
163
164
  responseType: "JSON", # only other option is HTML. Determines whether you get Component JSON or prerendered HTML.
164
165
  resourceId: 341153, # the ID of the resource ( entry or invite ) we are working with, only required if previewMode = false
165
166
 
@@ -194,7 +195,7 @@ Here's an example Client Config object:
194
195
 
195
196
  eventHooks: [{
196
197
  id: "9896886",
197
- triggerName: "visitor_sign_in", # Must be a valid event hook name
198
+ triggerNames: ["visitor_sign_in"], # Must contain a valid event hook name
198
199
  invocationURL: "https://www.my-app.com/webhooks/envoy/visitor-sign-in", # The URL to invoke when this hook is triggered.
199
200
  invocationFormatVersion: "V2", # Currently only V1 and V2. Allows app developers to migrate from the old format to the new one, and help us introduce new formats in the future if needed.
200
201
 
@@ -202,7 +203,7 @@ Here's an example Client Config object:
202
203
  featureHooks: [], # 0 to N hooks allowed. Feature hooks format is exact same as event hooks format, except that the triggerName must be a valid feature hook instead of an event hook, so left it off to save room
203
204
  uiHooks: [{
204
205
  id: "198968",
205
- triggerName: "welcome_email", # which "extension point" the UI will be showing up at.
206
+ triggerNames: ["welcome_email"], # which "extension points" the UI will be showing up at.
206
207
  invocationType: "DYNAMIC_CONTENT", # Currently can be DYNAMIC_CONTENT or STATIC_CONTENT. List will be expanded in Q1 2022.
207
208
  invocationURL: "https://www.my-app.com/webhooks/envoy/visitor-invite-email-content", # The URL where we get
208
209
  invocationFormatVersion: "V2", # Currently only V1 and V2. Allows app developers to migrate from the old format to the new one, and help us introduce new formats in the future if needed.
@@ -239,14 +240,14 @@ hooksService.syncClientConfig(
239
240
 
240
241
  eventHooks: [{
241
242
  id: "9896886",
242
- triggerName: "visitor_sign_in",
243
+ triggerNames: ["visitor_sign_in"],
243
244
  invocationURL: "https://www.my-app.com/webhooks/envoy/visitor-sign-in",
244
245
  invocationFormatVersion: "V2",
245
246
  }],
246
247
  featureHooks: [],
247
248
  uiHooks: [{
248
249
  id: "198968",
249
- triggerName: "welcome_email",
250
+ triggerNames: ["welcome_email"],
250
251
  invocationType: "DYNAMIC_CONTENT",
251
252
  invocationURL: "https://www.my-app.com/webhooks/envoy/visitor-invite-email-content",
252
253
  invocationFormatVersion: "V2",
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Envoy
4
4
  class Hooks
5
- VERSION = '0.4.1'
5
+ VERSION = '0.6.0'
6
6
  end
7
7
  end
data/lib/envoy/hooks.rb CHANGED
@@ -50,32 +50,42 @@ module Envoy
50
50
  })
51
51
  end
52
52
 
53
- def triggerUIHooks(locationId:, triggerName:, responseType:, resourceId: nil, accentColor: nil, uiHooks: [], previewMode: false, uiHookIds: [])
53
+ def triggerUIHooks(locationId:, responseType:, triggerName: nil, triggerNames: [], resourceId: nil,
54
+ accentColor: nil, uiHooks: [], previewMode: false, uiHookIds: [], resourceType: nil)
55
+
54
56
  validateEnum('responseType', responseType, %w[HTML JSON])
57
+
58
+ unless resourceType.nil?
59
+ validateEnum('resourceType', resourceType, %w[INVITE ENTRY])
60
+ end
55
61
 
56
62
  faraday.post("/rest/v1/locations/#{locationId}/hooks/ui/trigger", {
57
63
  locationId: locationId,
58
64
  triggerName: triggerName,
65
+ triggerNames: triggerNames,
59
66
  responseType: responseType,
60
67
  resourceId: resourceId,
68
+ resourceType: resourceType,
61
69
  accentColor: accentColor,
62
70
  previewMode: previewMode,
63
71
  uiHookIds: uiHookIds || uiHooks
64
72
  })
65
73
  end
66
74
 
67
- def subscribedUIHooks(locationId:, triggerName: nil, includeHidden: false)
75
+ def subscribedUIHooks(locationId:, triggerName: nil, triggerNames: [], includeHidden: false)
68
76
  faraday.get("/rest/v1/locations/#{locationId}/hooks/ui", {
69
77
  locationId: locationId,
70
78
  triggerName: triggerName,
79
+ triggerNames: triggerNames,
71
80
  includeHidden: includeHidden
72
81
  })
73
82
  end
74
83
 
75
- def triggerEventHooks(locationId:, triggerName:, resourceId: nil, eventHookIds: [])
84
+ def triggerEventHooks(locationId:, triggerName: nil, triggerNames: [], resourceId: nil, eventHookIds: [])
76
85
  faraday.post("/rest/v1/locations/#{locationId}/hooks/event/trigger", {
77
86
  locationId: locationId,
78
87
  triggerName: triggerName,
88
+ triggerNames: triggerNames,
79
89
  resourceId: resourceId,
80
90
  eventHookIds: eventHookIds
81
91
  })
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: envoy-hooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey-Biles-Envoy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-25 00:00:00.000000000 Z
11
+ date: 2022-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday