zendesk_apps_support 4.23.0 → 4.25.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b29599afad604e6a6adae9e02073bd95466b9e33
|
4
|
+
data.tar.gz: ee73401ed11aab0e76f126532e95f535d6c07305
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d0a284d1868be7d4af01943e2db275291d3505585df2ca322cf5e97d2776137e1c224e4220d215cc96da6312e424ebb0e266c553e6793c7b4c304d301608ca7
|
7
|
+
data.tar.gz: b556b25327365c6066954be876a3966bbc9b9ec972754aa8afac61c4aba096dddd6f0776bb291cbd37d55439ed1b0025a4f3ae521883c251f3ad9d33e8550e35
|
data/config/locales/en.yml
CHANGED
@@ -46,6 +46,9 @@ en:
|
|
46
46
|
requirements_not_json: requirements.json is not proper JSON. %{errors}
|
47
47
|
excessive_requirements: The requirements.json file contains too many requirements.
|
48
48
|
The current limit is %{max} requirements. This app has %{count} requirements.
|
49
|
+
excessive_custom_objects_requirements: The requirements.json file contains
|
50
|
+
too many custom objects requirements. The current limit is %{max} requirements.
|
51
|
+
This app has %{count} requirements.
|
49
52
|
missing_required_fields: 'Missing required fields in requirements.json:
|
50
53
|
"%{field}" is required in "%{identifier}"'
|
51
54
|
duplicate_requirements:
|
@@ -62,6 +65,9 @@ en:
|
|
62
65
|
invalid_cr_schema_keys:
|
63
66
|
one: 'Custom resources schema contains an invalid key: %{invalid_keys}'
|
64
67
|
other: 'Custom resources schema contains invalid keys: %{invalid_keys}'
|
68
|
+
invalid_custom_objects_schema_keys:
|
69
|
+
one: 'Custom objects schema contains an invalid key: %{invalid_keys}'
|
70
|
+
other: 'Custom objects schema contains invalid keys: %{invalid_keys}'
|
65
71
|
banner:
|
66
72
|
invalid_format: Banner image must be a PNG file.
|
67
73
|
invalid_size: Invalid banner image dimensions. Must be %{required_banner_width}x%{required_banner_height}px.
|
@@ -101,6 +101,11 @@ parts:
|
|
101
101
|
key: "txt.apps.admin.error.app_build.excessive_requirements"
|
102
102
|
title: "App builder job: requirements file contains too many requirements"
|
103
103
|
value: "The requirements.json file contains too many requirements. The current limit is %{max} requirements. This app has %{count} requirements."
|
104
|
+
- translation:
|
105
|
+
key: "txt.apps.admin.error.app_build.excessive_custom_objects_requirements"
|
106
|
+
title: "App builder job: requirements file contains too many custom objects requirements. Leave requirements.json as is (do not localize)"
|
107
|
+
value: "The requirements.json file contains too many custom objects requirements. The current limit is %{max} requirements. This app has %{count} requirements."
|
108
|
+
screenshot: "https://drive.google.com/open?id=18yac8rV7kMe5qm49ERVFVCA7WOZl8vcP"
|
104
109
|
- translation:
|
105
110
|
key: "txt.apps.admin.error.app_build.missing_required_fields"
|
106
111
|
title: "App builder job: required key missing in requirements, e.g. \"title\" is required in \"my_custom_email_target\""
|
@@ -140,11 +145,23 @@ parts:
|
|
140
145
|
title: "App builder job: custom resources schema contains invalid key error"
|
141
146
|
value: "Custom resources schema contains an invalid key: %{invalid_keys}"
|
142
147
|
screenshot: "https://drive.google.com/open?id=1-CHVDcmr5mf1DKKeWqiOuGWrW25gDY4y"
|
148
|
+
obsolete: "2020-01-01"
|
143
149
|
- translation:
|
144
150
|
key: "txt.apps.admin.error.app_build.invalid_cr_schema_keys.other"
|
145
151
|
title: "App builder job: custom resources schema contains invalid keys error"
|
146
152
|
value: "Custom resources schema contains invalid keys: %{invalid_keys}"
|
147
153
|
screenshot: "https://drive.google.com/open?id=1iEx7f7PYnum_qDQESD3Gz2PwLDza3zI0"
|
154
|
+
obsolete: "2020-01-01"
|
155
|
+
- translation:
|
156
|
+
key: "txt.apps.admin.error.app_build.invalid_custom_objects_schema_keys.one"
|
157
|
+
title: "App builder job: custom objects schema contains invalid key error"
|
158
|
+
value: "Custom objects schema contains an invalid key: %{invalid_keys}"
|
159
|
+
screenshot: "https://drive.google.com/open?id=1-CHVDcmr5mf1DKKeWqiOuGWrW25gDY4y"
|
160
|
+
- translation:
|
161
|
+
key: "txt.apps.admin.error.app_build.invalid_custom_objects_schema_keys.other"
|
162
|
+
title: "App builder job: custom objects schema contains invalid keys error"
|
163
|
+
value: "Custom objects schema contains invalid keys: %{invalid_keys}"
|
164
|
+
screenshot: "https://drive.google.com/open?id=1iEx7f7PYnum_qDQESD3Gz2PwLDza3zI0"
|
148
165
|
- translation:
|
149
166
|
key: "txt.apps.admin.error.app_build.banner.invalid_format"
|
150
167
|
title: "App builder job: Banner image invalid format error"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module ZendeskAppsSupport
|
4
4
|
class AppRequirement
|
5
|
-
TYPES = %w[automations channel_integrations
|
5
|
+
TYPES = %w[automations channel_integrations custom_objects macros targets views ticket_fields
|
6
6
|
triggers user_fields organization_fields].freeze
|
7
7
|
end
|
8
8
|
end
|
@@ -4,6 +4,7 @@ module ZendeskAppsSupport
|
|
4
4
|
module Validations
|
5
5
|
module Requirements
|
6
6
|
MAX_REQUIREMENTS = 5000
|
7
|
+
MAX_CUSTOM_OBJECTS_REQUIREMENTS = 50
|
7
8
|
|
8
9
|
class << self
|
9
10
|
def call(package)
|
@@ -24,9 +25,10 @@ module ZendeskAppsSupport
|
|
24
25
|
[].tap do |errors|
|
25
26
|
errors << invalid_requirements_types(requirements)
|
26
27
|
errors << excessive_requirements(requirements)
|
28
|
+
errors << excessive_custom_objects_requirements(requirements)
|
27
29
|
errors << invalid_channel_integrations(requirements)
|
28
30
|
errors << invalid_custom_fields(requirements)
|
29
|
-
errors <<
|
31
|
+
errors << invalid_custom_objects(requirements)
|
30
32
|
errors << missing_required_fields(requirements)
|
31
33
|
errors.flatten!
|
32
34
|
errors.compact!
|
@@ -44,9 +46,9 @@ module ZendeskAppsSupport
|
|
44
46
|
def missing_required_fields(requirements)
|
45
47
|
[].tap do |errors|
|
46
48
|
requirements.each do |requirement_type, requirement|
|
47
|
-
next if %w[channel_integrations
|
49
|
+
next if %w[channel_integrations custom_objects].include? requirement_type
|
48
50
|
requirement.each do |identifier, fields|
|
49
|
-
next if fields.include?
|
51
|
+
next if fields.nil? || fields.include?('title')
|
50
52
|
errors << ValidationError.new(:missing_required_fields,
|
51
53
|
field: 'title',
|
52
54
|
identifier: identifier)
|
@@ -56,10 +58,23 @@ module ZendeskAppsSupport
|
|
56
58
|
end
|
57
59
|
|
58
60
|
def excessive_requirements(requirements)
|
59
|
-
count = requirements.values.map
|
61
|
+
count = requirements.values.map do |req|
|
62
|
+
req.is_a?(Hash) ? req.values : req
|
63
|
+
end.flatten.size
|
60
64
|
ValidationError.new(:excessive_requirements, max: MAX_REQUIREMENTS, count: count) if count > MAX_REQUIREMENTS
|
61
65
|
end
|
62
66
|
|
67
|
+
def excessive_custom_objects_requirements(requirements)
|
68
|
+
custom_objects = requirements['custom_objects']
|
69
|
+
return unless custom_objects
|
70
|
+
|
71
|
+
count = custom_objects.values.flatten.size
|
72
|
+
if count > MAX_CUSTOM_OBJECTS_REQUIREMENTS
|
73
|
+
ValidationError.new(:excessive_custom_objects_requirements, max: MAX_CUSTOM_OBJECTS_REQUIREMENTS,
|
74
|
+
count: count)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
63
78
|
def invalid_custom_fields(requirements)
|
64
79
|
user_fields = requirements['user_fields']
|
65
80
|
organization_fields = requirements['organization_fields']
|
@@ -92,23 +107,26 @@ module ZendeskAppsSupport
|
|
92
107
|
end
|
93
108
|
end
|
94
109
|
|
95
|
-
def
|
96
|
-
|
97
|
-
return
|
98
|
-
|
110
|
+
def invalid_custom_objects(requirements)
|
111
|
+
custom_objects = requirements['custom_objects']
|
112
|
+
return if custom_objects.nil?
|
113
|
+
|
99
114
|
[].tap do |errors|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
count: invalid_keys.length)
|
115
|
+
unless custom_objects.key?('custom_object_types')
|
116
|
+
errors << ValidationError.new(:missing_required_fields,
|
117
|
+
field: 'custom_object_types',
|
118
|
+
identifier: 'custom_objects')
|
105
119
|
end
|
106
120
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
121
|
+
valid_schema = {
|
122
|
+
'custom_object_types' => %w[key schema],
|
123
|
+
'custom_object_relationship_types' => %w[key source target]
|
124
|
+
}
|
125
|
+
|
126
|
+
valid_schema.keys.each do |requirement_type|
|
127
|
+
(custom_objects[requirement_type] || []).each do |requirement|
|
128
|
+
validate_custom_objects_keys(requirement.keys, valid_schema[requirement_type], requirement_type, errors)
|
129
|
+
end
|
112
130
|
end
|
113
131
|
end
|
114
132
|
end
|
@@ -121,6 +139,15 @@ module ZendeskAppsSupport
|
|
121
139
|
count: invalid_types.length)
|
122
140
|
end
|
123
141
|
end
|
142
|
+
|
143
|
+
def validate_custom_objects_keys(keys, expected_keys, identifier, errors = [])
|
144
|
+
missing_keys = expected_keys - keys
|
145
|
+
missing_keys.each do |key|
|
146
|
+
errors << ValidationError.new(:missing_required_fields,
|
147
|
+
field: key,
|
148
|
+
identifier: identifier)
|
149
|
+
end
|
150
|
+
end
|
124
151
|
end
|
125
152
|
end
|
126
153
|
end
|
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.25.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: 2019-
|
14
|
+
date: 2019-11-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: i18n
|