zendesk_apps_support 4.11.2 → 4.12.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b15fb4519e8970b7d758ba52fb983894d0453f763d10949c24881298997aaf80
|
4
|
+
data.tar.gz: 67bc5ddfa7ecbd027a953c89272bdce33d2265cf956a793212f946519bd2c956
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b3b5456c6c059dc6b196115746930319066327074eadbad36f38e92173acae0ef76650cdc827f99e67d9de1059f093e5a166ac147cf02958a06ee2639d80494
|
7
|
+
data.tar.gz: 8d789571704c1164d949cd4eb9395b42301f5919b9547f58f45226b235abf771f9b4576ec4094b8a2d5e4e394d7fe34a2b6cd4d7bb234f3ce711bc985f5c5cdb
|
data/config/locales/en.yml
CHANGED
@@ -54,6 +54,9 @@ en:
|
|
54
54
|
other: 'requirements.json contains invalid types: %{invalid_types}'
|
55
55
|
multiple_channel_integrations: Specifying multiple channel integrations
|
56
56
|
in requirements.json is not supported.
|
57
|
+
invalid_cr_schema_keys:
|
58
|
+
one: 'Custom resources schema contains an invalid key: %{invalid_keys}'
|
59
|
+
other: 'Custom resources schema contains invalid keys: %{invalid_keys}'
|
57
60
|
banner:
|
58
61
|
invalid_format: Banner image must be a PNG file.
|
59
62
|
invalid_size: Invalid banner image dimensions. Must be %{required_banner_width}x%{required_banner_height}px.
|
@@ -8,7 +8,7 @@ packages:
|
|
8
8
|
|
9
9
|
parts:
|
10
10
|
- translation:
|
11
|
-
key: "txt.apps.admin.error.app_build.jshint.one"
|
11
|
+
key: "txt.apps.admin.error.app_build.jshint.one"
|
12
12
|
title: "App builder job: JSHint error message"
|
13
13
|
value: "JSHint error in %{file}: %{errors}"
|
14
14
|
- translation:
|
@@ -119,6 +119,16 @@ parts:
|
|
119
119
|
key: "txt.apps.admin.error.app_build.multiple_channel_integrations"
|
120
120
|
title: "App builder job: requirements file contains multiple channel integrations, leave requirements.json as is (file name)"
|
121
121
|
value: "Specifying multiple channel integrations in requirements.json is not supported."
|
122
|
+
- translation:
|
123
|
+
key: "txt.apps.admin.error.app_build.invalid_cr_schema_keys.one"
|
124
|
+
title: "App builder job: custom resources schema contains invalid key error"
|
125
|
+
value: "Custom resources schema contains an invalid key: %{invalid_keys}"
|
126
|
+
screenshot: "https://drive.google.com/open?id=1-CHVDcmr5mf1DKKeWqiOuGWrW25gDY4y"
|
127
|
+
- translation:
|
128
|
+
key: "txt.apps.admin.error.app_build.invalid_cr_schema_keys.other"
|
129
|
+
title: "App builder job: custom resources schema contains invalid keys error"
|
130
|
+
value: "Custom resources schema contains invalid keys: %{invalid_keys}"
|
131
|
+
screenshot: "https://drive.google.com/open?id=1iEx7f7PYnum_qDQESD3Gz2PwLDza3zI0"
|
122
132
|
- translation:
|
123
133
|
key: "txt.apps.admin.error.app_build.banner.invalid_format"
|
124
134
|
title: "App builder job: Banner image invalid format error"
|
@@ -2,8 +2,7 @@
|
|
2
2
|
|
3
3
|
module ZendeskAppsSupport
|
4
4
|
class AppRequirement
|
5
|
-
TYPES = %w[automations channel_integrations
|
6
|
-
|
7
|
-
user_fields organization_fields].freeze
|
5
|
+
TYPES = %w[automations channel_integrations custom_resources_schema macros targets views ticket_fields
|
6
|
+
triggers user_fields organization_fields].freeze
|
8
7
|
end
|
9
8
|
end
|
@@ -5,7 +5,7 @@ module ZendeskAppsSupport
|
|
5
5
|
module Requirements
|
6
6
|
MAX_REQUIREMENTS = 5000
|
7
7
|
|
8
|
-
class <<self
|
8
|
+
class << self
|
9
9
|
def call(package)
|
10
10
|
if package.manifest.requirements_only? && !package.has_requirements?
|
11
11
|
return [ValidationError.new(:missing_requirements)]
|
@@ -26,6 +26,7 @@ module ZendeskAppsSupport
|
|
26
26
|
errors << excessive_requirements(requirements)
|
27
27
|
errors << invalid_channel_integrations(requirements)
|
28
28
|
errors << invalid_custom_fields(requirements)
|
29
|
+
errors << invalid_custom_resources_schema(requirements)
|
29
30
|
errors << missing_required_fields(requirements)
|
30
31
|
errors.flatten!
|
31
32
|
errors.compact!
|
@@ -43,10 +44,12 @@ module ZendeskAppsSupport
|
|
43
44
|
def missing_required_fields(requirements)
|
44
45
|
[].tap do |errors|
|
45
46
|
requirements.each do |requirement_type, requirement|
|
46
|
-
next if
|
47
|
+
next if %w[channel_integrations custom_resources_schema].include? requirement_type
|
47
48
|
requirement.each do |identifier, fields|
|
48
49
|
next if fields.include? 'title'
|
49
|
-
errors << ValidationError.new(:missing_required_fields,
|
50
|
+
errors << ValidationError.new(:missing_required_fields,
|
51
|
+
field: 'title',
|
52
|
+
identifier: identifier)
|
50
53
|
end
|
51
54
|
end
|
52
55
|
end
|
@@ -65,7 +68,9 @@ module ZendeskAppsSupport
|
|
65
68
|
[user_fields, organization_fields].compact.each do |field_group|
|
66
69
|
field_group.each do |identifier, fields|
|
67
70
|
next if fields.include? 'key'
|
68
|
-
errors << ValidationError.new(:missing_required_fields,
|
71
|
+
errors << ValidationError.new(:missing_required_fields,
|
72
|
+
field: 'key',
|
73
|
+
identifier: identifier)
|
69
74
|
end
|
70
75
|
end
|
71
76
|
end
|
@@ -76,19 +81,40 @@ module ZendeskAppsSupport
|
|
76
81
|
return unless channel_integrations
|
77
82
|
[].tap do |errors|
|
78
83
|
if channel_integrations.size > 1
|
79
|
-
errors << ValidationError.new(:multiple_channel_integrations
|
84
|
+
errors << ValidationError.new(:multiple_channel_integrations)
|
80
85
|
end
|
81
86
|
channel_integrations.each do |identifier, fields|
|
82
|
-
|
83
|
-
|
84
|
-
|
87
|
+
next if fields.include? 'manifest_url'
|
88
|
+
errors << ValidationError.new(:missing_required_fields,
|
89
|
+
field: 'manifest_url',
|
90
|
+
identifier: identifier)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def invalid_custom_resources_schema(requirements)
|
96
|
+
custom_resources_schema = requirements['custom_resources_schema']
|
97
|
+
return unless custom_resources_schema
|
98
|
+
valid_schema_keys = %w[resource_types relationship_types]
|
99
|
+
[].tap do |errors|
|
100
|
+
invalid_keys = custom_resources_schema.keys - valid_schema_keys
|
101
|
+
unless invalid_keys.empty?
|
102
|
+
errors << ValidationError.new(:invalid_cr_schema_keys,
|
103
|
+
invalid_keys: invalid_keys.join(', '),
|
104
|
+
count: invalid_keys.length)
|
105
|
+
end
|
106
|
+
|
107
|
+
valid_schema_keys.each do |required_key|
|
108
|
+
next if custom_resources_schema.keys.include? required_key
|
109
|
+
errors << ValidationError.new(:missing_required_fields,
|
110
|
+
field: required_key,
|
111
|
+
identifier: 'custom_resources_schema')
|
85
112
|
end
|
86
113
|
end
|
87
114
|
end
|
88
115
|
|
89
116
|
def invalid_requirements_types(requirements)
|
90
117
|
invalid_types = requirements.keys - ZendeskAppsSupport::AppRequirement::TYPES
|
91
|
-
|
92
118
|
unless invalid_types.empty?
|
93
119
|
ValidationError.new(:invalid_requirements_types,
|
94
120
|
invalid_types: invalid_types.join(', '),
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_apps_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James A. Rosen
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-
|
14
|
+
date: 2018-07-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: i18n
|
@@ -274,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
274
274
|
version: 1.3.6
|
275
275
|
requirements: []
|
276
276
|
rubyforge_project:
|
277
|
-
rubygems_version: 2.7.
|
277
|
+
rubygems_version: 2.7.6
|
278
278
|
signing_key:
|
279
279
|
specification_version: 4
|
280
280
|
summary: Support to help you develop Zendesk Apps.
|