envoy-hooks 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/envoy/hooks/version.rb +1 -1
- data/lib/envoy/hooks.rb +21 -5
- 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: 66d7d0496d7e1d5bf7020261774621e30aec5235e45f155f1eb0780398aecfa3
|
4
|
+
data.tar.gz: 4f51a5e4a32b0f47d48971ba811d32acbef8d46526c63dbb9795c541ed1b91ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d158b941cca204f6b9e39e383d9041981f577103cc85bc0e6f9f76cc14cb4f17331033d96cc756e184527ce419c3c30c69211c53a9d2b240b6b849023931901c
|
7
|
+
data.tar.gz: 2ea1373631ba0b615966d427517b4749ee089eae83ac605077b93992252c7ec91fc3463f49b30ef41d64d701d06b0c697f896aba16ee5460ff7b011b74b71151
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
envoy-hooks (0.
|
4
|
+
envoy-hooks (0.5.0)
|
5
5
|
faraday (~> 0.15.4)
|
6
6
|
faraday-net_http (~> 1.0)
|
7
7
|
faraday_middleware (~> 0.12.2)
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
faraday-net_http (1.0.1)
|
16
16
|
faraday_middleware (0.12.2)
|
17
17
|
faraday (>= 0.7.4, < 1.0)
|
18
|
-
multipart-post (2.
|
18
|
+
multipart-post (2.2.0)
|
19
19
|
rake (13.0.6)
|
20
20
|
rspec (3.10.0)
|
21
21
|
rspec-core (~> 3.10.0)
|
@@ -42,4 +42,4 @@ DEPENDENCIES
|
|
42
42
|
rspec (~> 3.0)
|
43
43
|
|
44
44
|
BUNDLED WITH
|
45
|
-
2.3.
|
45
|
+
2.3.15
|
data/lib/envoy/hooks/version.rb
CHANGED
data/lib/envoy/hooks.rb
CHANGED
@@ -35,8 +35,9 @@ module Envoy
|
|
35
35
|
if !subscriptionScope || !subscriptionScope[:type] || !subscriptionScope[:id]
|
36
36
|
raise(Error, 'Must fully define a subscriptionScope for `upsertSubscription`')
|
37
37
|
end
|
38
|
-
|
39
|
-
validateEnum(
|
38
|
+
|
39
|
+
validateEnum('subscriptionScope.type', subscriptionScope[:type], %w[LOCATION COMPANY USER])
|
40
|
+
validateEnum('status', status, %w[ENABLED DISABLED PENDING])
|
40
41
|
|
41
42
|
faraday.post('/rest/v1/subscriptions', {
|
42
43
|
subscriptionScope: subscriptionScope,
|
@@ -49,18 +50,24 @@ module Envoy
|
|
49
50
|
})
|
50
51
|
end
|
51
52
|
|
52
|
-
|
53
|
-
|
53
|
+
def triggerUIHooks(locationId:, triggerName:, responseType:, resourceId: nil, accentColor: nil,
|
54
|
+
uiHooks: [], previewMode: false, uiHookIds: [], resourceType: nil)
|
55
|
+
|
54
56
|
validateEnum('responseType', responseType, %w[HTML JSON])
|
57
|
+
|
58
|
+
unless resourceType.nil?
|
59
|
+
validateEnum('resourceType', responseType, %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,
|
59
65
|
responseType: responseType,
|
60
66
|
resourceId: resourceId,
|
67
|
+
resourceType: resourceType,
|
61
68
|
accentColor: accentColor,
|
62
69
|
previewMode: previewMode,
|
63
|
-
|
70
|
+
uiHookIds: uiHookIds || uiHooks
|
64
71
|
})
|
65
72
|
end
|
66
73
|
|
@@ -72,6 +79,15 @@ module Envoy
|
|
72
79
|
})
|
73
80
|
end
|
74
81
|
|
82
|
+
def triggerEventHooks(locationId:, triggerName:, resourceId: nil, eventHookIds: [])
|
83
|
+
faraday.post("/rest/v1/locations/#{locationId}/hooks/event/trigger", {
|
84
|
+
locationId: locationId,
|
85
|
+
triggerName: triggerName,
|
86
|
+
resourceId: resourceId,
|
87
|
+
eventHookIds: eventHookIds
|
88
|
+
})
|
89
|
+
end
|
90
|
+
|
75
91
|
def syncClientConfig(
|
76
92
|
clientId:,
|
77
93
|
clientSecret:,
|
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.5.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-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|