zendesk_apps_tools 3.8.10 → 3.8.14

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: 7204157bba7ae7156bc4f4c63c73c28518f9fd339bd0c7eb6edcf2adf9d263df
4
- data.tar.gz: bab868e18f444e86a09a2f135ac7cf19e35bf352fd65a889df3ebe5eda33d2b9
3
+ metadata.gz: eae6401940c6ae89b9646d1ebae7466a2407e4a4b567670cc4d3282066a4d24b
4
+ data.tar.gz: 228251bef91f1101b00425c2bdbebf859ea8143b7b33b69666188662637238c4
5
5
  SHA512:
6
- metadata.gz: 1ce19511ce1ee90ccdc486c6007b5e8ed8012365fb26a9274de802c3bdbbb9453848161dd4f8b022227307730bd4920f357e7d0cd823abff45d70d5f82882423
7
- data.tar.gz: 2c54e0ff0d8b26a73117317356c390b53ee9239ea1e418b6e211115805b003fa870fcb2825d7f1ca8bb4ed6c95c249ec46c1d2159734c9c0d71b20b7512a9349
6
+ metadata.gz: 65cf71eff599c088b53cf60a45708a243cea378f38b0b95b9f7c0d219ad013534445215d4c6904a6b85c103ca9997d4fce2e34e9d8b360e6a600bfcaf4afce70
7
+ data.tar.gz: e47f7143202c46e2aea4ba1a271d4262f7d61ac89d8a1cf00eead6d44f2a1233bfdded0d1f977de50e649df088b5191498f3dbc4659595a770b5c8d5c03f6589
@@ -10,8 +10,8 @@ module ZendeskAppsTools
10
10
  include Thor::Actions
11
11
  include ZendeskAppsTools::Common
12
12
 
13
- LOCALE_BASE_ENDPOINT = 'https://support.zendesk.com/api/v2/locales'
14
- LOCALE_ENDPOINT = "#{LOCALE_BASE_ENDPOINT}/apps/admin.json"
13
+ LOCALE_BASE_ENDPOINT = 'https://static.zdassets.com/translations'
14
+ LOCALE_ENDPOINT = "#{LOCALE_BASE_ENDPOINT}/admin/manifest.json"
15
15
 
16
16
  desc 'to_yml', 'Create Zendesk translation file from en.json'
17
17
  shared_options(except: [:clean])
@@ -45,16 +45,17 @@ module ZendeskAppsTools
45
45
  setup_path(options[:path]) if options[:path]
46
46
  app_package = package_name_for_update
47
47
  locale_list
48
- .map { |locale| fetch_locale_async locale, app_package }
48
+ .map { |locale| fetch_locale_async locale }
49
49
  .each do |locale_thread|
50
50
  locale = locale_thread.value
51
51
  translations = locale['translations']
52
-
53
- locale_name = ZendeskAppsTools::LocaleIdentifier.new(locale['locale']).locale_id
54
- write_json(
55
- "translations/#{locale_name}.json",
56
- nest_translations_hash(translations, "txt.apps.#{app_package}.")
57
- )
52
+ locale_name = locale['locale']
53
+ if not locale_name.match(/-x-/)
54
+ write_json(
55
+ "translations/#{locale_name}.json",
56
+ nest_translations_hash(translations, "txt.apps.#{app_package}.")
57
+ )
58
+ end
58
59
  end
59
60
  say('Translations updated', :green)
60
61
  end
@@ -75,11 +76,11 @@ module ZendeskAppsTools
75
76
  end
76
77
 
77
78
  no_commands do
78
- def fetch_locale_async(locale, app_package)
79
+ def fetch_locale_async(locale)
79
80
  Thread.new do
80
- say("Fetching #{locale['locale']}")
81
- json = Faraday.get("#{locale['url']}?include=translations&packages=app_#{app_package}").body
82
- json_or_die(json)['locale']
81
+ say("Fetching #{locale['name']}")
82
+ json = Faraday.get("#{LOCALE_BASE_ENDPOINT}#{locale['path']}").body
83
+ json_or_die(json)
83
84
  end
84
85
  end
85
86
 
@@ -168,13 +169,12 @@ module ZendeskAppsTools
168
169
  content = read_file(options[:locales])
169
170
  locales = JSON.parse(content)
170
171
  return locales.map do |locale|
171
- { 'locale' => locale, 'url' => "#{LOCALE_BASE_ENDPOINT}/#{locale}.json" }
172
+ { 'name' => locale, 'path' => "/admin/#{locale}.json" }
172
173
  end
173
174
  end
174
175
 
175
176
  locale_response = Faraday.get(LOCALE_ENDPOINT)
176
-
177
- return json_or_die(locale_response.body)['locales'] if locale_response.status == 200
177
+ return json_or_die(locale_response.body)['json'] if locale_response.status == 200
178
178
  if locale_response.status == 401
179
179
  say_error_and_exit 'Authentication failed.'
180
180
  else
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ZendeskAppsTools
3
- VERSION = '3.8.10'
3
+ VERSION = '3.8.14'
4
4
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_apps_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.10
4
+ version: 3.8.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - James A. Rosen
8
8
  - Kenshiro Nakagawa
9
9
  - Shajith Chacko
10
10
  - Likun Liu
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2022-05-16 00:00:00.000000000 Z
14
+ date: 2022-08-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor
@@ -65,16 +65,22 @@ dependencies:
65
65
  name: sinatra
66
66
  requirement: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - "~>"
68
+ - - ">="
69
69
  - !ruby/object:Gem::Version
70
70
  version: 1.4.6
71
+ - - "<"
72
+ - !ruby/object:Gem::Version
73
+ version: 2.3.0
71
74
  type: :runtime
72
75
  prerelease: false
73
76
  version_requirements: !ruby/object:Gem::Requirement
74
77
  requirements:
75
- - - "~>"
78
+ - - ">="
76
79
  - !ruby/object:Gem::Version
77
80
  version: 1.4.6
81
+ - - "<"
82
+ - !ruby/object:Gem::Version
83
+ version: 2.3.0
78
84
  - !ruby/object:Gem::Dependency
79
85
  name: faraday
80
86
  requirement: !ruby/object:Gem::Requirement
@@ -343,9 +349,9 @@ files:
343
349
  - templates/translation.erb.tt
344
350
  homepage: http://github.com/zendesk/zendesk_apps_tools
345
351
  licenses:
346
- - Apache License Version 2.0
352
+ - Apache-2.0
347
353
  metadata: {}
348
- post_install_message:
354
+ post_install_message:
349
355
  rdoc_options: []
350
356
  require_paths:
351
357
  - lib
@@ -361,7 +367,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
361
367
  version: 1.3.6
362
368
  requirements: []
363
369
  rubygems_version: 3.0.3.1
364
- signing_key:
370
+ signing_key:
365
371
  specification_version: 4
366
372
  summary: Tools to help you develop Zendesk Apps.
367
373
  test_files: