app_store_connect_api_client 0.35.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +41 -0
  4. data/CHANGELOG.md +9 -0
  5. data/CODE_OF_CONDUCT.md +84 -0
  6. data/Gemfile +5 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +94 -0
  9. data/Rakefile +10 -0
  10. data/app_store_connect_api.gemspec +41 -0
  11. data/lib/app_store_connect_api/authorization.rb +36 -0
  12. data/lib/app_store_connect_api/client.rb +92 -0
  13. data/lib/app_store_connect_api/domain/age_rating_declarations.rb +14 -0
  14. data/lib/app_store_connect_api/domain/app_availabilities.rb +24 -0
  15. data/lib/app_store_connect_api/domain/app_categories.rb +27 -0
  16. data/lib/app_store_connect_api/domain/app_info_localizations.rb +31 -0
  17. data/lib/app_store_connect_api/domain/app_infos.rb +59 -0
  18. data/lib/app_store_connect_api/domain/app_price_points.rb +17 -0
  19. data/lib/app_store_connect_api/domain/app_price_schedules.rb +35 -0
  20. data/lib/app_store_connect_api/domain/app_store_version_localizations.rb +31 -0
  21. data/lib/app_store_connect_api/domain/app_store_version_phased_releases.rb +26 -0
  22. data/lib/app_store_connect_api/domain/app_store_version_release_requests.rb +13 -0
  23. data/lib/app_store_connect_api/domain/app_store_versions.rb +77 -0
  24. data/lib/app_store_connect_api/domain/apps.rb +125 -0
  25. data/lib/app_store_connect_api/domain/beta_app_localizations.rb +41 -0
  26. data/lib/app_store_connect_api/domain/beta_app_review_details.rb +29 -0
  27. data/lib/app_store_connect_api/domain/beta_app_review_submissions.rb +28 -0
  28. data/lib/app_store_connect_api/domain/beta_build_localizations.rb +41 -0
  29. data/lib/app_store_connect_api/domain/beta_groups.rb +81 -0
  30. data/lib/app_store_connect_api/domain/beta_license_agreements.rb +29 -0
  31. data/lib/app_store_connect_api/domain/beta_tester_invitations.rb +14 -0
  32. data/lib/app_store_connect_api/domain/beta_testers.rb +84 -0
  33. data/lib/app_store_connect_api/domain/build_beta_details.rb +29 -0
  34. data/lib/app_store_connect_api/domain/build_beta_notifications.rb +13 -0
  35. data/lib/app_store_connect_api/domain/builds.rb +105 -0
  36. data/lib/app_store_connect_api/domain/bundle_id_capabilities.rb +28 -0
  37. data/lib/app_store_connect_api/domain/bundle_ids.rb +50 -0
  38. data/lib/app_store_connect_api/domain/certificates.rb +29 -0
  39. data/lib/app_store_connect_api/domain/customer_reviews.rb +12 -0
  40. data/lib/app_store_connect_api/domain/devices.rb +31 -0
  41. data/lib/app_store_connect_api/domain/prerelease_versions.rb +27 -0
  42. data/lib/app_store_connect_api/domain/profiles.rb +44 -0
  43. data/lib/app_store_connect_api/domain/review_submission_items.rb +25 -0
  44. data/lib/app_store_connect_api/domain/review_submissions.rb +36 -0
  45. data/lib/app_store_connect_api/domain/sandbox_testers.rb +25 -0
  46. data/lib/app_store_connect_api/domain/user_invitations.rb +36 -0
  47. data/lib/app_store_connect_api/domain/users.rb +55 -0
  48. data/lib/app_store_connect_api/domain.rb +77 -0
  49. data/lib/app_store_connect_api/utils/hash_utils.rb +22 -0
  50. data/lib/app_store_connect_api/utils/relationship_mapper.rb +47 -0
  51. data/lib/app_store_connect_api/utils/string_utils.rb +31 -0
  52. data/lib/app_store_connect_api/version.rb +5 -0
  53. data/lib/app_store_connect_api.rb +28 -0
  54. metadata +198 -0
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'domain/age_rating_declarations'
4
+ require_relative 'domain/app_availabilities'
5
+ require_relative 'domain/app_categories'
6
+ require_relative 'domain/app_info_localizations'
7
+ require_relative 'domain/app_infos'
8
+ require_relative 'domain/app_price_points'
9
+ require_relative 'domain/app_price_schedules'
10
+ require_relative 'domain/app_store_version_localizations'
11
+ require_relative 'domain/app_store_version_phased_releases'
12
+ require_relative 'domain/app_store_version_release_requests'
13
+ require_relative 'domain/app_store_versions'
14
+ require_relative 'domain/apps'
15
+ require_relative 'domain/beta_app_localizations'
16
+ require_relative 'domain/beta_app_review_details'
17
+ require_relative 'domain/beta_app_review_submissions'
18
+ require_relative 'domain/beta_build_localizations'
19
+ require_relative 'domain/beta_groups'
20
+ require_relative 'domain/beta_license_agreements'
21
+ require_relative 'domain/beta_tester_invitations'
22
+ require_relative 'domain/beta_testers'
23
+ require_relative 'domain/build_beta_details'
24
+ require_relative 'domain/build_beta_notifications'
25
+ require_relative 'domain/builds'
26
+ require_relative 'domain/bundle_id_capabilities'
27
+ require_relative 'domain/bundle_ids'
28
+ require_relative 'domain/certificates'
29
+ require_relative 'domain/customer_reviews'
30
+ require_relative 'domain/devices'
31
+ require_relative 'domain/prerelease_versions'
32
+ require_relative 'domain/profiles'
33
+ require_relative 'domain/review_submission_items'
34
+ require_relative 'domain/review_submissions'
35
+ require_relative 'domain/sandbox_testers'
36
+ require_relative 'domain/users'
37
+ require_relative 'domain/user_invitations'
38
+
39
+ module AppStoreConnectApi
40
+ module Domain
41
+ include AgeRatingDeclarations
42
+ include AppAvailabilities
43
+ include AppCategories
44
+ include AppInfoLocalizations
45
+ include AppInfos
46
+ include AppPricePoints
47
+ include AppPriceSchedules
48
+ include AppStoreVersionLocalizations
49
+ include AppStoreVersionPhasedReleases
50
+ include AppStoreVersionReleaseRequests
51
+ include AppStoreVersions
52
+ include Apps
53
+ include BetaAppLocalizations
54
+ include BetaAppReviewDetails
55
+ include BetaAppReviewSubmissions
56
+ include BetaBuildLocalizations
57
+ include BetaGroups
58
+ include BetaLicenseAgreements
59
+ include BetaTesterInvitations
60
+ include BetaTesters
61
+ include BuildBetaDetails
62
+ include BuildBetaNotifications
63
+ include Builds
64
+ include BundleIdCapabilities
65
+ include BundleIds
66
+ include Certificates
67
+ include CustomerReviews
68
+ include Devices
69
+ include PrereleaseVersions
70
+ include Profiles
71
+ include ReviewSubmissionItems
72
+ include ReviewSubmissions
73
+ include SandboxTesters
74
+ include UserInvitations
75
+ include Users
76
+ end
77
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Utils
5
+ module HashUtils
6
+ class << self
7
+ def deep_transform_keys(object, &block)
8
+ case object
9
+ when Hash
10
+ object.each_with_object({}) do |(key, value), result|
11
+ result[yield(key)] = deep_transform_keys value, &block
12
+ end
13
+ when Array
14
+ object.map { |item| deep_transform_keys item, &block }
15
+ else
16
+ object
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Utils
5
+ module RelationshipMapper
6
+ class << self
7
+ def expand(relationships, type_translations = {})
8
+ relationships.each_with_object({}) do |(relationship_type, resource_id), result|
9
+ result[relationship_type] = { data: expand_relationship(resource_id, relationship_type, type_translations) }
10
+ end
11
+ end
12
+
13
+ def resource_keys(ids, resource_type, type_translations = {})
14
+ ids.map { |id| resource_key id, resource_type, type_translations }
15
+ end
16
+
17
+ private
18
+
19
+ def expand_relationship(resource_id, relationship_type, type_translations)
20
+ return resource_id[:data] if full_format_resource_identifier? resource_id
21
+
22
+ if resource_id.is_a? Array
23
+ resource_keys resource_id, to_resource_type(relationship_type, already_plural: true), type_translations
24
+ else
25
+ resource_key resource_id, to_resource_type(relationship_type, already_plural: false), type_translations
26
+ end
27
+ end
28
+
29
+ def full_format_resource_identifier?(resource_id)
30
+ resource_id.is_a?(Hash) && resource_id.key?(:data)
31
+ end
32
+
33
+ def resource_key(id, resource_type, type_translations = {})
34
+ return id unless id.is_a? String
35
+
36
+ { id: id, type: type_translations[resource_type] || type_translations['*'] || resource_type }
37
+ end
38
+
39
+ def to_resource_type(relationship_type, already_plural:)
40
+ result = relationship_type.to_s
41
+ result = StringUtils.pluralize(result) unless already_plural
42
+ StringUtils.camelize result
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Utils
5
+ module StringUtils
6
+ class << self
7
+ def camelize(snake_cased_word)
8
+ snake_cased_word.split('_')
9
+ .map(&:capitalize)
10
+ .join
11
+ .tap { |w| w[0] = w[0].downcase }
12
+ end
13
+
14
+ def underscore(camel_cased_word)
15
+ camel_cased_word.gsub(/([a-z])([A-Z])/, '\1_\2')
16
+ .downcase
17
+ end
18
+
19
+ def pluralize(word)
20
+ if word.end_with? 's'
21
+ word + 'es'
22
+ elsif word.end_with? 'y'
23
+ word[...-1] + 'ies'
24
+ else
25
+ word + 's'
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ VERSION = "0.35.0"
5
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'openssl'
4
+ require 'jwt'
5
+ require 'faraday'
6
+ require_relative "app_store_connect_api/client"
7
+ require_relative "app_store_connect_api/version"
8
+
9
+ module AppStoreConnectApi
10
+ class Error < StandardError; end
11
+
12
+ class ApiError < Error
13
+ attr_reader :errors
14
+
15
+ def initialize(errors)
16
+ @errors = errors
17
+ super 'App Store Connect API request failed'
18
+ end
19
+
20
+ def code
21
+ errors.first[:code]
22
+ end
23
+
24
+ def status
25
+ errors.first[:status].to_i
26
+ end
27
+ end
28
+ end
metadata ADDED
@@ -0,0 +1,198 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: app_store_connect_api_client
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.35.0
5
+ platform: ruby
6
+ authors:
7
+ - Zoltan Ormandi
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-06-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: jwt
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '13.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '13.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.50'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.50'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop-rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.22'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2.22'
97
+ - !ruby/object:Gem::Dependency
98
+ name: webmock
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.0'
111
+ description: A thin Ruby wrapper around the App Store Connect API to provide a more
112
+ convenient way of accessing App Store Connect.
113
+ email:
114
+ - zoltan.ormandi@gmail.com
115
+ executables: []
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - ".rspec"
120
+ - ".rubocop.yml"
121
+ - CHANGELOG.md
122
+ - CODE_OF_CONDUCT.md
123
+ - Gemfile
124
+ - LICENSE.txt
125
+ - README.md
126
+ - Rakefile
127
+ - app_store_connect_api.gemspec
128
+ - lib/app_store_connect_api.rb
129
+ - lib/app_store_connect_api/authorization.rb
130
+ - lib/app_store_connect_api/client.rb
131
+ - lib/app_store_connect_api/domain.rb
132
+ - lib/app_store_connect_api/domain/age_rating_declarations.rb
133
+ - lib/app_store_connect_api/domain/app_availabilities.rb
134
+ - lib/app_store_connect_api/domain/app_categories.rb
135
+ - lib/app_store_connect_api/domain/app_info_localizations.rb
136
+ - lib/app_store_connect_api/domain/app_infos.rb
137
+ - lib/app_store_connect_api/domain/app_price_points.rb
138
+ - lib/app_store_connect_api/domain/app_price_schedules.rb
139
+ - lib/app_store_connect_api/domain/app_store_version_localizations.rb
140
+ - lib/app_store_connect_api/domain/app_store_version_phased_releases.rb
141
+ - lib/app_store_connect_api/domain/app_store_version_release_requests.rb
142
+ - lib/app_store_connect_api/domain/app_store_versions.rb
143
+ - lib/app_store_connect_api/domain/apps.rb
144
+ - lib/app_store_connect_api/domain/beta_app_localizations.rb
145
+ - lib/app_store_connect_api/domain/beta_app_review_details.rb
146
+ - lib/app_store_connect_api/domain/beta_app_review_submissions.rb
147
+ - lib/app_store_connect_api/domain/beta_build_localizations.rb
148
+ - lib/app_store_connect_api/domain/beta_groups.rb
149
+ - lib/app_store_connect_api/domain/beta_license_agreements.rb
150
+ - lib/app_store_connect_api/domain/beta_tester_invitations.rb
151
+ - lib/app_store_connect_api/domain/beta_testers.rb
152
+ - lib/app_store_connect_api/domain/build_beta_details.rb
153
+ - lib/app_store_connect_api/domain/build_beta_notifications.rb
154
+ - lib/app_store_connect_api/domain/builds.rb
155
+ - lib/app_store_connect_api/domain/bundle_id_capabilities.rb
156
+ - lib/app_store_connect_api/domain/bundle_ids.rb
157
+ - lib/app_store_connect_api/domain/certificates.rb
158
+ - lib/app_store_connect_api/domain/customer_reviews.rb
159
+ - lib/app_store_connect_api/domain/devices.rb
160
+ - lib/app_store_connect_api/domain/prerelease_versions.rb
161
+ - lib/app_store_connect_api/domain/profiles.rb
162
+ - lib/app_store_connect_api/domain/review_submission_items.rb
163
+ - lib/app_store_connect_api/domain/review_submissions.rb
164
+ - lib/app_store_connect_api/domain/sandbox_testers.rb
165
+ - lib/app_store_connect_api/domain/user_invitations.rb
166
+ - lib/app_store_connect_api/domain/users.rb
167
+ - lib/app_store_connect_api/utils/hash_utils.rb
168
+ - lib/app_store_connect_api/utils/relationship_mapper.rb
169
+ - lib/app_store_connect_api/utils/string_utils.rb
170
+ - lib/app_store_connect_api/version.rb
171
+ homepage: https://github.com/zormandi/app_store_connect_api.rb
172
+ licenses:
173
+ - MIT
174
+ metadata:
175
+ homepage_uri: https://github.com/zormandi/app_store_connect_api.rb
176
+ source_code_uri: https://github.com/zormandi/app_store_connect_api.rb
177
+ changelog_uri: https://github.com/zormandi/app_store_connect_api.rb/blob/main/CHANGELOG.md
178
+ rubygems_mfa_required: 'true'
179
+ post_install_message:
180
+ rdoc_options: []
181
+ require_paths:
182
+ - lib
183
+ required_ruby_version: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: 2.7.0
188
+ required_rubygems_version: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - ">="
191
+ - !ruby/object:Gem::Version
192
+ version: '0'
193
+ requirements: []
194
+ rubygems_version: 3.3.7
195
+ signing_key:
196
+ specification_version: 4
197
+ summary: A Ruby client for the App Store Connect API
198
+ test_files: []