envoy-hooks 0.5.1 → 0.6.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/Gemfile.lock +1 -1
- data/README.md +6 -5
- data/lib/envoy/hooks/version.rb +1 -1
- data/lib/envoy/hooks.rb +7 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8de3f7e9c5174c2377dae06da7287b4378f278198eedf44894b9098ff9cae0f1
|
4
|
+
data.tar.gz: 23e93ecb2e8baf8246c28d4bfcc600fb2d993b131661a30f34055a9c8c28b2a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daa518f26235edc2861a62f674f39c3f6484a0989a1db9c51e5d353e16836276e366cc263b6684b924965ff515148454bb876a4afdeadcb0593d7234fab9a47b
|
7
|
+
data.tar.gz: 1b3e9bcd5608ca465ea104e7baa0a80d3b80e27f9202832feb2bf779b84eb0d4ba390cbdd8bed4d430cd9c8505d51d218c32a671607ae09009fced5a0f51cb52
|
data/Gemfile.lock
CHANGED
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", #
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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",
|
data/lib/envoy/hooks/version.rb
CHANGED
data/lib/envoy/hooks.rb
CHANGED
@@ -50,8 +50,8 @@ module Envoy
|
|
50
50
|
})
|
51
51
|
end
|
52
52
|
|
53
|
-
def triggerUIHooks(locationId:,
|
54
|
-
uiHooks: [], previewMode: false, uiHookIds: [], resourceType: nil)
|
53
|
+
def triggerUIHooks(locationId:, responseType:, triggerName: nil, triggerNames: [], resourceId: nil,
|
54
|
+
accentColor: nil, uiHooks: [], previewMode: false, uiHookIds: [], resourceType: nil)
|
55
55
|
|
56
56
|
validateEnum('responseType', responseType, %w[HTML JSON])
|
57
57
|
|
@@ -62,6 +62,7 @@ module Envoy
|
|
62
62
|
faraday.post("/rest/v1/locations/#{locationId}/hooks/ui/trigger", {
|
63
63
|
locationId: locationId,
|
64
64
|
triggerName: triggerName,
|
65
|
+
triggerNames: triggerNames,
|
65
66
|
responseType: responseType,
|
66
67
|
resourceId: resourceId,
|
67
68
|
resourceType: resourceType,
|
@@ -71,18 +72,20 @@ module Envoy
|
|
71
72
|
})
|
72
73
|
end
|
73
74
|
|
74
|
-
def subscribedUIHooks(locationId:, triggerName: nil, includeHidden: false)
|
75
|
+
def subscribedUIHooks(locationId:, triggerName: nil, triggerNames: [], includeHidden: false)
|
75
76
|
faraday.get("/rest/v1/locations/#{locationId}/hooks/ui", {
|
76
77
|
locationId: locationId,
|
77
78
|
triggerName: triggerName,
|
79
|
+
triggerNames: triggerNames,
|
78
80
|
includeHidden: includeHidden
|
79
81
|
})
|
80
82
|
end
|
81
83
|
|
82
|
-
def triggerEventHooks(locationId:, triggerName
|
84
|
+
def triggerEventHooks(locationId:, triggerName: nil, triggerNames: [], resourceId: nil, eventHookIds: [])
|
83
85
|
faraday.post("/rest/v1/locations/#{locationId}/hooks/event/trigger", {
|
84
86
|
locationId: locationId,
|
85
87
|
triggerName: triggerName,
|
88
|
+
triggerNames: triggerNames,
|
86
89
|
resourceId: resourceId,
|
87
90
|
eventHookIds: eventHookIds
|
88
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
|
+
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-
|
11
|
+
date: 2022-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|