zendesk_apps_support 4.29.10 → 4.31.1

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: aa1ee6d9fc91ee5d6cb804b1ba66546f46c2c3c4bf387bebc2116b08dc410903
4
- data.tar.gz: a64aba109da369c8f6e7a49ee58cc0672dda29707b1a3b99daeaef1ef340076d
3
+ metadata.gz: '01083332c185deb236fcc2f4fb3e66b65a695085790b448c8451f4c8c1b21aac'
4
+ data.tar.gz: 1580841170ebef45a0d9a9c27a65e567683e353d6c4ba6293be06a60d2da64de
5
5
  SHA512:
6
- metadata.gz: 627216d9ed25f72ebd97434d6375bd4b217c5df2f95551dd3a626ce735992b8b9730077cfc39f99ee144ad908e08aeff17df5179cbd97da24446f4fa08a98722
7
- data.tar.gz: 60cd0e5d10b3ba3e3368c6b9fbcff8bd58d28ba442d9dcd8377121e4a50b600cb13564bd2a980ecce1458d0f1afaeca6acf9ac02eb42567c69b524bf33533d24
6
+ metadata.gz: f06ed79968e27181e17530785e21e678aaf45a2ff1e3776f29d0f8de3ecde20b125f01b5698196292e57e5ee431a1ac5e2359da6dddec417c8323308d97ee746
7
+ data.tar.gz: a63fb2623abbe41fb40475358793c2ec47c75562e3fd0ede58ea4e6630e4e2d48adacd498a77c3c4dfc8add50a41f83ab26309f5ee69daeb7fbe69b5e65edc43
data/README.md CHANGED
@@ -9,12 +9,6 @@ This repo is owned and maintained by the Zendesk Apps team. You can reach us on
9
9
  ## Getting Started
10
10
  When you want to help **develop** this tool, you will need to clone this repo.
11
11
 
12
- Since ZAS is used in ZAT, which supports Ruby 2.1, the Bundler Gem Version 1.17.3 is required for bundling dependencies. If you are working with a version that is higher than `1.17.3`, you will need to downgrade it.
13
- ```
14
- $ gem install bundler --version 1.17.3
15
- $ bundle install
16
- ```
17
-
18
12
  Very likely you want to try out your changes with the use of ZAT. See [ZAT](https://github.com/zendesk/zendesk_apps_tools/) for how to get ZAT/ZAS in development.
19
13
 
20
14
  ## Testing
@@ -2,10 +2,11 @@
2
2
 
3
3
  module ZendeskAppsSupport
4
4
  class AppRequirement
5
+ WEBHOOKS_KEY = 'webhooks'
5
6
  CUSTOM_OBJECTS_KEY = 'custom_objects'
6
7
  CUSTOM_OBJECTS_TYPE_KEY = 'custom_object_types'
7
8
  CUSTOM_OBJECTS_RELATIONSHIP_TYPE_KEY = 'custom_object_relationship_types'
8
9
  TYPES = %w[automations channel_integrations custom_objects macros targets views ticket_fields
9
- triggers user_fields organization_fields].freeze
10
+ triggers user_fields organization_fields webhooks].freeze
10
11
  end
11
12
  end
@@ -29,6 +29,7 @@ module ZendeskAppsSupport
29
29
  errors << invalid_channel_integrations(requirements)
30
30
  errors << invalid_custom_fields(requirements)
31
31
  errors << invalid_custom_objects(requirements)
32
+ errors << invalid_webhooks(requirements)
32
33
  errors << missing_required_fields(requirements)
33
34
  errors.flatten!
34
35
  errors.compact!
@@ -46,7 +47,7 @@ module ZendeskAppsSupport
46
47
  def missing_required_fields(requirements)
47
48
  [].tap do |errors|
48
49
  requirements.each do |requirement_type, requirement|
49
- next if %w[channel_integrations custom_objects].include? requirement_type
50
+ next if %w[channel_integrations custom_objects webhooks].include? requirement_type
50
51
  requirement.each do |identifier, fields|
51
52
  next if fields.nil? || fields.include?('title')
52
53
  errors << ValidationError.new(:missing_required_fields,
@@ -107,6 +108,28 @@ module ZendeskAppsSupport
107
108
  end
108
109
  end
109
110
 
111
+ def invalid_webhooks(requirements)
112
+ webhook_requirements = requirements[AppRequirement::WEBHOOKS_KEY]
113
+
114
+ return if webhook_requirements.nil?
115
+
116
+ webhook_requirements.map do |identifier, requirement|
117
+ validate_webhook_keys(identifier, requirement)
118
+ end.flatten
119
+ end
120
+
121
+ def validate_webhook_keys(identifier, requirement)
122
+ required_keys = %w[name status endpoint http_method request_format]
123
+
124
+ missing_keys = required_keys - requirement.keys
125
+
126
+ missing_keys.map do |key|
127
+ ValidationError.new(:missing_required_fields,
128
+ field: key,
129
+ identifier: identifier)
130
+ end
131
+ end
132
+
110
133
  def invalid_custom_objects(requirements)
111
134
  custom_objects = requirements[AppRequirement::CUSTOM_OBJECTS_KEY]
112
135
  return if custom_objects.nil?
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_apps_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.29.10
4
+ version: 4.31.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James A. Rosen
8
8
  - Likun Liu
9
9
  - Sean Caffery
10
10
  - Daniel Ribeiro
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-08-30 00:00:00.000000000 Z
14
+ date: 2022-02-09 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: i18n
@@ -332,7 +332,7 @@ homepage: http://github.com/zendesk/zendesk_apps_support
332
332
  licenses:
333
333
  - Apache License Version 2.0
334
334
  metadata: {}
335
- post_install_message:
335
+ post_install_message:
336
336
  rdoc_options: []
337
337
  require_paths:
338
338
  - lib
@@ -347,8 +347,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
347
347
  - !ruby/object:Gem::Version
348
348
  version: 1.3.6
349
349
  requirements: []
350
- rubygems_version: 3.0.8
351
- signing_key:
350
+ rubygems_version: 3.0.1
351
+ signing_key:
352
352
  specification_version: 4
353
353
  summary: Support to help you develop Zendesk Apps.
354
354
  test_files: []