zendesk_apps_tools 1.35.6 → 1.35.7
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: 5ba8180c50299cbb9a0a0962b5daff06397e1af3
|
4
|
+
data.tar.gz: ae6b706f7df25ce52d1a8c0fedde3797d7aa6f58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33c85b0dbddc5c5f9f6add771f0944b81b4200fa732b7c5d43fdd8befda4558f510fff0d4169f6ef1abd1d1c375e9fb57496d93912be54698bb2a8d84e172ff6
|
7
|
+
data.tar.gz: c9749875486bbf63c2182e4802720a72f840b914f4733531ace48c2a22ad1ecbe89b8ba376fe7e6f463d8c737994b3a4fb3f1e3b3accbe8a30c3e1c8b4d434a7
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<script type="text/javascript" src="https://assets.zendesk.com/apps/sdk/2.0/zaf_sdk.js"></script>
|
6
6
|
<script>
|
7
7
|
// Initialise the Zendesk JavaScript API client
|
8
|
-
// https://developer.zendesk.com/apps/docs/
|
8
|
+
// https://developer.zendesk.com/apps/docs/apps-v2
|
9
9
|
var client = ZAFClient.init();
|
10
10
|
client.invoke('resize', { width: '100%', height: '400px' });
|
11
11
|
</script>
|
@@ -30,9 +30,9 @@ module ZendeskAppsTools
|
|
30
30
|
payload = { uploaded_data: Faraday::UploadIO.new(package_path, 'application/zip') }
|
31
31
|
|
32
32
|
response = connection.post('/api/v2/apps/uploads.json', payload)
|
33
|
-
|
33
|
+
json_or_die(response.body)['id']
|
34
34
|
|
35
|
-
rescue Faraday::Error::ClientError
|
35
|
+
rescue Faraday::Error::ClientError => e
|
36
36
|
say_error_and_exit e.message
|
37
37
|
end
|
38
38
|
|
@@ -44,7 +44,7 @@ module ZendeskAppsTools
|
|
44
44
|
|
45
45
|
all_apps = connection.get('/api/v2/apps.json').body
|
46
46
|
|
47
|
-
app_json =
|
47
|
+
app_json = json_or_die(all_apps)['apps'].find { |app| app['name'] == name }
|
48
48
|
say_error_and_exit('The app was not found. Please verify your credentials, subdomain, and app name are correct.') unless app_json
|
49
49
|
app_id = app_json['id']
|
50
50
|
|
@@ -56,7 +56,7 @@ module ZendeskAppsTools
|
|
56
56
|
|
57
57
|
def check_status(response)
|
58
58
|
job = response.body
|
59
|
-
job_response =
|
59
|
+
job_response = json_or_die(job)
|
60
60
|
say_error_and_exit job_response['error'] if job_response['error']
|
61
61
|
|
62
62
|
job_id = job_response['job_id']
|
@@ -68,7 +68,7 @@ module ZendeskAppsTools
|
|
68
68
|
|
69
69
|
loop do
|
70
70
|
response = connection.get("/api/v2/apps/job_statuses/#{job_id}")
|
71
|
-
info =
|
71
|
+
info = json_or_die(response.body)
|
72
72
|
status = info['status']
|
73
73
|
message = info['message']
|
74
74
|
app_id = info['app_id']
|
@@ -84,7 +84,7 @@ module ZendeskAppsTools
|
|
84
84
|
Thread.new do
|
85
85
|
say("Fetching #{locale['locale']}")
|
86
86
|
json = Faraday.get("#{locale['url']}?include=translations&packages=app_#{app_package}").body
|
87
|
-
|
87
|
+
json_or_die(json)['locale']
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
@@ -170,7 +170,7 @@ module ZendeskAppsTools
|
|
170
170
|
require 'faraday'
|
171
171
|
locale_response = Faraday.get(LOCALE_ENDPOINT)
|
172
172
|
|
173
|
-
return
|
173
|
+
return json_or_die(locale_response.body)['locales'] if locale_response.status == 200
|
174
174
|
if locale_response.status == 401
|
175
175
|
say_error_and_exit 'Authentication failed'
|
176
176
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_apps_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.35.
|
4
|
+
version: 1.35.7
|
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: 2016-10-
|
14
|
+
date: 2016-10-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: thor
|