fastlane 2.126.0.beta.20190623200100 → 2.126.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +76 -76
- data/fastlane/lib/fastlane/actions/.slack.rb.swp +0 -0
- data/fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp +0 -0
- data/fastlane/lib/fastlane/actions/app_store_build_number.rb +1 -2
- data/fastlane/lib/fastlane/actions/oclint.rb +9 -2
- data/fastlane/lib/fastlane/actions/reset_simulator_contents.rb +34 -27
- data/fastlane/lib/fastlane/lane_manager_base.rb +4 -1
- data/fastlane/lib/fastlane/version.rb +1 -1
- data/fastlane/swift/Deliverfile.swift +1 -1
- data/fastlane/swift/DeliverfileProtocol.swift +3 -1
- data/fastlane/swift/Fastlane.swift +19 -5
- data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/fastlane/swift/Gymfile.swift +1 -1
- data/fastlane/swift/Matchfile.swift +1 -1
- data/fastlane/swift/Precheckfile.swift +1 -1
- data/fastlane/swift/Scanfile.swift +1 -1
- data/fastlane/swift/ScanfileProtocol.swift +3 -1
- data/fastlane/swift/Screengrabfile.swift +1 -1
- data/fastlane/swift/Snapshotfile.swift +1 -1
- data/fastlane_core/lib/fastlane_core/.build_watcher.rb.swp +0 -0
- data/fastlane_core/lib/fastlane_core/build_watcher.rb +2 -2
- data/pilot/lib/pilot/.build_manager.rb.swp +0 -0
- data/pilot/lib/pilot/.manager.rb.swp +0 -0
- data/pilot/lib/pilot/.tester_manager.rb.swp +0 -0
- data/pilot/lib/pilot/build_manager.rb +9 -14
- data/pilot/lib/pilot/manager.rb +2 -2
- data/pilot/lib/pilot/tester_exporter.rb +3 -3
- data/pilot/lib/pilot/tester_manager.rb +2 -2
- data/scan/lib/scan/options.rb +7 -1
- data/scan/lib/scan/test_command_generator.rb +1 -1
- data/snapshot/lib/assets/SnapshotHelper.swift +10 -4
- data/spaceship/lib/spaceship/connect_api.rb +42 -0
- data/spaceship/lib/spaceship/connect_api/.DS_Store +0 -0
- data/spaceship/lib/spaceship/connect_api/client.rb +178 -0
- data/spaceship/lib/spaceship/connect_api/model.rb +1 -15
- data/spaceship/lib/spaceship/connect_api/models/app.rb +97 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_app_localization.rb +28 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_app_review_detail.rb +32 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_app_review_submission.rb +26 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_build_localization.rb +20 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_build_metric.rb +24 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +41 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +56 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_tester_metric.rb +43 -0
- data/spaceship/lib/spaceship/connect_api/models/build.rb +144 -0
- data/spaceship/lib/spaceship/connect_api/models/build_beta_detail.rb +56 -0
- data/spaceship/lib/spaceship/connect_api/models/build_delivery.rb +36 -0
- data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +46 -0
- data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +37 -0
- data/spaceship/lib/spaceship/connect_api/models/certificate.rb +48 -0
- data/spaceship/lib/spaceship/connect_api/models/device.rb +53 -0
- data/spaceship/lib/spaceship/connect_api/models/pre_release_version.rb +20 -0
- data/spaceship/lib/spaceship/connect_api/models/profile.rb +60 -0
- data/spaceship/lib/spaceship/connect_api/models/user.rb +50 -0
- data/spaceship/lib/spaceship/connect_api/provisioning/client.rb +59 -0
- data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +48 -0
- data/spaceship/lib/spaceship/connect_api/response.rb +1 -1
- data/spaceship/lib/spaceship/connect_api/testflight/client.rb +18 -538
- data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +314 -19
- data/spaceship/lib/spaceship/connect_api/token.rb +13 -1
- data/spaceship/lib/spaceship/connect_api/users/client.rb +33 -0
- data/spaceship/lib/spaceship/connect_api/users/users.rb +16 -0
- data/spaceship/lib/spaceship/test_flight/build.rb +2 -2
- data/spaceship/lib/spaceship/test_flight/build_trains.rb +5 -56
- metadata +64 -48
- data/spaceship/lib/spaceship/connect_api/testflight/base.rb +0 -41
- data/spaceship/lib/spaceship/connect_api/testflight/models/app.rb +0 -99
- data/spaceship/lib/spaceship/connect_api/testflight/models/beta_app_localization.rb +0 -30
- data/spaceship/lib/spaceship/connect_api/testflight/models/beta_app_review_detail.rb +0 -34
- data/spaceship/lib/spaceship/connect_api/testflight/models/beta_app_review_submission.rb +0 -28
- data/spaceship/lib/spaceship/connect_api/testflight/models/beta_build_localization.rb +0 -22
- data/spaceship/lib/spaceship/connect_api/testflight/models/beta_build_metric.rb +0 -26
- data/spaceship/lib/spaceship/connect_api/testflight/models/beta_group.rb +0 -43
- data/spaceship/lib/spaceship/connect_api/testflight/models/beta_tester.rb +0 -58
- data/spaceship/lib/spaceship/connect_api/testflight/models/beta_tester_metric.rb +0 -45
- data/spaceship/lib/spaceship/connect_api/testflight/models/build.rb +0 -146
- data/spaceship/lib/spaceship/connect_api/testflight/models/build_beta_detail.rb +0 -58
- data/spaceship/lib/spaceship/connect_api/testflight/models/build_delivery.rb +0 -38
- data/spaceship/lib/spaceship/connect_api/testflight/models/pre_release_version.rb +0 -22
- data/spaceship/lib/spaceship/connect_api/testflight/models/user.rb +0 -52
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spaceship/connect_api/provisioning/client'
|
2
|
+
|
3
|
+
module Spaceship
|
4
|
+
class ConnectAPI
|
5
|
+
module Provisioning
|
6
|
+
#
|
7
|
+
# bundleIds
|
8
|
+
#
|
9
|
+
|
10
|
+
def get_bundle_ids(filter: {}, includes: nil, limit: nil, sort: nil)
|
11
|
+
params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
12
|
+
Client.instance.get("bundleIds", params)
|
13
|
+
end
|
14
|
+
|
15
|
+
def get_bundle_id(bundle_id_id: {}, includes: nil)
|
16
|
+
params = Client.instance.build_params(filter: nil, includes: includes, limit: nil, sort: nil)
|
17
|
+
Client.instance.get("bundleIds/#{bundle_id_id}", params)
|
18
|
+
end
|
19
|
+
|
20
|
+
#
|
21
|
+
# certificates
|
22
|
+
#
|
23
|
+
|
24
|
+
def get_certificates(filter: {}, includes: nil, limit: nil, sort: nil)
|
25
|
+
params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
26
|
+
Client.instance.get("certificates", params)
|
27
|
+
end
|
28
|
+
|
29
|
+
#
|
30
|
+
# devices
|
31
|
+
#
|
32
|
+
|
33
|
+
def get_devices(filter: {}, includes: nil, limit: nil, sort: nil)
|
34
|
+
params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
35
|
+
Client.instance.get("devices", params)
|
36
|
+
end
|
37
|
+
|
38
|
+
#
|
39
|
+
# profiles
|
40
|
+
#
|
41
|
+
|
42
|
+
def get_profiles(filter: {}, includes: nil, limit: nil, sort: nil)
|
43
|
+
params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
44
|
+
Client.instance.get("profiles", params)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -1,553 +1,33 @@
|
|
1
|
-
require_relative '
|
2
|
-
require_relative '
|
1
|
+
require_relative '../client'
|
2
|
+
require_relative '../../tunes/tunes_client'
|
3
3
|
|
4
4
|
module Spaceship
|
5
|
-
|
6
|
-
module ConnectAPI
|
5
|
+
class ConnectAPI
|
7
6
|
module TestFlight
|
8
|
-
class Client < Spaceship::Client
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
# for large request data bodies, pass in anything that can resond to
|
15
|
-
# `to_json`.
|
16
|
-
#
|
17
|
-
# Each request method should validate the required parameters. A required parameter is one that would result in 400-range response if it is not supplied.
|
18
|
-
# Each request method should make only one request. For more high-level logic, put code in the data models.
|
19
|
-
|
20
|
-
def self.hostname
|
21
|
-
'https://appstoreconnect.apple.com/iris/v1/'
|
22
|
-
end
|
23
|
-
|
24
|
-
#
|
25
|
-
# Helpers
|
26
|
-
#
|
27
|
-
|
28
|
-
def build_params(filter: nil, includes: nil, limit: nil, sort: nil, cursor: nil)
|
29
|
-
params = {}
|
30
|
-
|
31
|
-
filter = filter.delete_if { |k, v| v.nil? } if filter
|
32
|
-
|
33
|
-
params[:filter] = filter if filter && !filter.empty?
|
34
|
-
params[:include] = includes if includes
|
35
|
-
params[:limit] = limit if limit
|
36
|
-
params[:sort] = sort if sort
|
37
|
-
params[:cursor] = cursor if cursor
|
38
|
-
|
39
|
-
return params
|
40
|
-
end
|
41
|
-
|
42
|
-
def get(url_or_path, params = nil)
|
43
|
-
response = request(:get) do |req|
|
44
|
-
req.url(url_or_path)
|
45
|
-
req.options.params_encoder = Faraday::NestedParamsEncoder
|
46
|
-
req.params = params if params
|
47
|
-
end
|
48
|
-
handle_response(response)
|
49
|
-
end
|
50
|
-
|
51
|
-
def post(url_or_path, body)
|
52
|
-
response = request(:post) do |req|
|
53
|
-
req.url(url_or_path)
|
54
|
-
req.body = body.to_json
|
55
|
-
req.headers['Content-Type'] = 'application/json'
|
56
|
-
end
|
57
|
-
handle_response(response)
|
58
|
-
end
|
59
|
-
|
60
|
-
def patch(url_or_path, body)
|
61
|
-
response = request(:patch) do |req|
|
62
|
-
req.url(url_or_path)
|
63
|
-
req.body = body.to_json
|
64
|
-
req.headers['Content-Type'] = 'application/json'
|
65
|
-
end
|
66
|
-
handle_response(response)
|
67
|
-
end
|
68
|
-
|
69
|
-
def delete(url_or_path, params = nil, body = nil)
|
70
|
-
response = request(:delete) do |req|
|
71
|
-
req.url(url_or_path)
|
72
|
-
req.options.params_encoder = Faraday::NestedParamsEncoder if params
|
73
|
-
req.params = params if params
|
74
|
-
req.body = body.to_json if body
|
75
|
-
req.headers['Content-Type'] = 'application/json' if body
|
76
|
-
end
|
77
|
-
handle_response(response)
|
78
|
-
end
|
79
|
-
|
80
|
-
#
|
81
|
-
# apps
|
82
|
-
#
|
83
|
-
|
84
|
-
def get_apps(filter: {}, includes: nil, limit: nil, sort: nil)
|
85
|
-
# GET
|
86
|
-
# https://appstoreconnect.apple.com/iris/v1/apps
|
87
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
88
|
-
get("apps", params)
|
89
|
-
end
|
90
|
-
|
91
|
-
def get_app(app_id: nil, includes: nil)
|
92
|
-
# GET
|
93
|
-
# https://appstoreconnect.apple.com/iris/v1/apps/<app_id>
|
94
|
-
params = build_params(filter: nil, includes: includes, limit: nil, sort: nil)
|
95
|
-
get("apps/#{app_id}", params)
|
96
|
-
end
|
97
|
-
|
98
|
-
#
|
99
|
-
# betaAppLocalizations
|
100
|
-
#
|
101
|
-
|
102
|
-
def get_beta_app_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
|
103
|
-
# GET
|
104
|
-
# https://appstoreconnect.apple.com/iris/v1/betaAppLocalizations?filter[app]=<app_id>
|
105
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
106
|
-
get("betaAppLocalizations", params)
|
107
|
-
end
|
108
|
-
|
109
|
-
def post_beta_app_localizations(app_id: nil, attributes: {})
|
110
|
-
# POST
|
111
|
-
# https://appstoreconnect.apple.com/iris/v1/betaAppLocalizations
|
112
|
-
path = "betaAppLocalizations"
|
113
|
-
|
114
|
-
body = {
|
115
|
-
data: {
|
116
|
-
attributes: attributes,
|
117
|
-
type: "betaAppLocalizations",
|
118
|
-
relationships: {
|
119
|
-
app: {
|
120
|
-
data: {
|
121
|
-
type: "apps",
|
122
|
-
id: app_id
|
123
|
-
}
|
124
|
-
}
|
125
|
-
}
|
126
|
-
}
|
127
|
-
}
|
128
|
-
|
129
|
-
post(path, body)
|
130
|
-
end
|
131
|
-
|
132
|
-
def patch_beta_app_localizations(localization_id: nil, attributes: {})
|
133
|
-
# PATCH
|
134
|
-
# https://appstoreconnect.apple.com/iris/v1/apps/<app_id>/betaAppLocalizations/<localization_id>
|
135
|
-
path = "betaAppLocalizations/#{localization_id}"
|
136
|
-
|
137
|
-
body = {
|
138
|
-
data: {
|
139
|
-
attributes: attributes,
|
140
|
-
id: localization_id,
|
141
|
-
type: "betaAppLocalizations"
|
142
|
-
}
|
143
|
-
}
|
144
|
-
|
145
|
-
patch(path, body)
|
146
|
-
end
|
147
|
-
|
148
|
-
#
|
149
|
-
# betaAppReviewDetails
|
150
|
-
#
|
151
|
-
|
152
|
-
def get_beta_app_review_detail(filter: {}, includes: nil, limit: nil, sort: nil)
|
153
|
-
# GET
|
154
|
-
# https://appstoreconnect.apple.com/iris/v1/betaAppReviewDetails?filter[app]=<app_id>
|
155
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
156
|
-
get("betaAppReviewDetails", params)
|
157
|
-
end
|
158
|
-
|
159
|
-
def patch_beta_app_review_detail(app_id: nil, attributes: {})
|
160
|
-
# PATCH
|
161
|
-
# https://appstoreconnect.apple.com/iris/v1/apps/<app_id>/betaAppReviewDetails
|
162
|
-
path = "betaAppReviewDetails/#{app_id}"
|
163
|
-
|
164
|
-
body = {
|
165
|
-
data: {
|
166
|
-
attributes: attributes,
|
167
|
-
id: app_id,
|
168
|
-
type: "betaAppReviewDetails"
|
169
|
-
}
|
170
|
-
}
|
171
|
-
|
172
|
-
patch(path, body)
|
173
|
-
end
|
174
|
-
|
175
|
-
#
|
176
|
-
# betaAppReviewSubmissions
|
177
|
-
#
|
178
|
-
|
179
|
-
def get_beta_app_review_submissions(filter: {}, includes: nil, limit: nil, sort: nil, cursor: nil)
|
180
|
-
# GET
|
181
|
-
# https://appstoreconnect.apple.com/iris/v1/betaAppReviewSubmissions
|
182
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort, cursor: cursor)
|
183
|
-
get("betaAppReviewSubmissions", params)
|
184
|
-
end
|
185
|
-
|
186
|
-
def post_beta_app_review_submissions(build_id: nil)
|
187
|
-
# POST
|
188
|
-
# https://appstoreconnect.apple.com/iris/v1/betaAppReviewSubmissions
|
189
|
-
path = "betaAppReviewSubmissions"
|
190
|
-
body = {
|
191
|
-
data: {
|
192
|
-
type: "betaAppReviewSubmissions",
|
193
|
-
relationships: {
|
194
|
-
build: {
|
195
|
-
data: {
|
196
|
-
type: "builds",
|
197
|
-
id: build_id
|
198
|
-
}
|
199
|
-
}
|
200
|
-
}
|
201
|
-
}
|
202
|
-
}
|
203
|
-
|
204
|
-
post(path, body)
|
205
|
-
end
|
206
|
-
|
207
|
-
def delete_beta_app_review_submission(beta_app_review_submission_id: nil)
|
208
|
-
# DELETE
|
209
|
-
# https://appstoreconnect.apple.com/iris/v1/betaAppReviewSubmissions/<beta_app_review_submission_id>
|
210
|
-
params = build_params(filter: nil, includes: nil, limit: nil, sort: nil, cursor: nil)
|
211
|
-
delete("betaAppReviewSubmissions/#{beta_app_review_submission_id}", params)
|
212
|
-
end
|
213
|
-
|
214
|
-
#
|
215
|
-
# betaBuildLocalizations
|
216
|
-
#
|
217
|
-
|
218
|
-
def get_beta_build_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
|
219
|
-
# GET
|
220
|
-
# https://appstoreconnect.apple.com/iris/v1/betaBuildLocalizations
|
221
|
-
path = "betaBuildLocalizations"
|
222
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
223
|
-
get(path, params)
|
224
|
-
end
|
225
|
-
|
226
|
-
def post_beta_build_localizations(build_id: nil, attributes: {})
|
227
|
-
# POST
|
228
|
-
# https://appstoreconnect.apple.com/iris/v1/betaBuildLocalizations
|
229
|
-
path = "betaBuildLocalizations"
|
230
|
-
|
231
|
-
body = {
|
232
|
-
data: {
|
233
|
-
attributes: attributes,
|
234
|
-
type: "betaBuildLocalizations",
|
235
|
-
relationships: {
|
236
|
-
build: {
|
237
|
-
data: {
|
238
|
-
type: "builds",
|
239
|
-
id: build_id
|
240
|
-
}
|
241
|
-
}
|
242
|
-
}
|
243
|
-
}
|
244
|
-
}
|
245
|
-
|
246
|
-
post(path, body)
|
247
|
-
end
|
248
|
-
|
249
|
-
def patch_beta_build_localizations(localization_id: nil, feedbackEmail: nil, attributes: {})
|
250
|
-
# PATCH
|
251
|
-
# https://appstoreconnect.apple.com/iris/v1/apps/<app_id>/betaBuildLocalizations
|
252
|
-
path = "betaBuildLocalizations/#{localization_id}"
|
253
|
-
|
254
|
-
body = {
|
255
|
-
data: {
|
256
|
-
attributes: attributes,
|
257
|
-
id: localization_id,
|
258
|
-
type: "betaBuildLocalizations"
|
259
|
-
}
|
260
|
-
}
|
261
|
-
|
262
|
-
patch(path, body)
|
263
|
-
end
|
264
|
-
|
265
|
-
#
|
266
|
-
# betaBuildMetrics
|
267
|
-
#
|
268
|
-
|
269
|
-
def get_beta_build_metrics(filter: {}, includes: nil, limit: nil, sort: nil)
|
270
|
-
# GET
|
271
|
-
# https://appstoreconnect.apple.com/iris/v1/betaBuildMetrics
|
272
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
273
|
-
get("betaBuildMetrics", params)
|
274
|
-
end
|
275
|
-
|
276
|
-
#
|
277
|
-
# betaGroups
|
278
|
-
#
|
279
|
-
|
280
|
-
def get_beta_groups(filter: {}, includes: nil, limit: nil, sort: nil)
|
281
|
-
# GET
|
282
|
-
# https://appstoreconnect.apple.com/iris/v1/betaGroups
|
283
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
284
|
-
get("betaGroups", params)
|
285
|
-
end
|
286
|
-
|
287
|
-
def add_beta_groups_to_build(build_id: nil, beta_group_ids: [])
|
288
|
-
# POST
|
289
|
-
# https://appstoreconnect.apple.com/iris/v1/builds/<build_id>/relationships/betaGroups
|
290
|
-
path = "builds/#{build_id}/relationships/betaGroups"
|
291
|
-
body = {
|
292
|
-
data: beta_group_ids.map do |id|
|
293
|
-
{
|
294
|
-
type: "betaGroups",
|
295
|
-
id: id
|
296
|
-
}
|
7
|
+
class Client < Spaceship::ConnectAPI::Client
|
8
|
+
def self.instance
|
9
|
+
# Verify there is a token or a client that can be used
|
10
|
+
if Spaceship::ConnectAPI.token
|
11
|
+
if @client.nil? || @client.token != Spaceship::ConnectAPI.token
|
12
|
+
@client = Client.new(token: Spaceship::ConnectAPI.token)
|
297
13
|
end
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
#
|
304
|
-
# betaTesters
|
305
|
-
#
|
306
|
-
|
307
|
-
def get_beta_testers(filter: {}, includes: nil, limit: nil, sort: nil)
|
308
|
-
# GET
|
309
|
-
# https://appstoreconnect.apple.com/iris/v1/betaTesters
|
310
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
311
|
-
get("betaTesters", params)
|
312
|
-
end
|
313
|
-
|
314
|
-
# beta_testers - [{email: "", firstName: "", lastName: ""}]
|
315
|
-
def post_bulk_beta_tester_assignments(beta_group_id: nil, beta_testers: nil)
|
316
|
-
# POST
|
317
|
-
# https://appstoreconnect.apple.com/iris/v1/bulkBetaTesterAssignments
|
318
|
-
beta_testers || []
|
319
|
-
|
320
|
-
beta_testers.map do |tester|
|
321
|
-
tester[:errors] = []
|
322
|
-
end
|
323
|
-
|
324
|
-
body = {
|
325
|
-
data: {
|
326
|
-
attributes: {
|
327
|
-
betaTesters: beta_testers
|
328
|
-
},
|
329
|
-
relationships: {
|
330
|
-
betaGroup: {
|
331
|
-
data: {
|
332
|
-
type: "betaGroups",
|
333
|
-
id: beta_group_id
|
334
|
-
}
|
335
|
-
}
|
336
|
-
},
|
337
|
-
type: "bulkBetaTesterAssignments"
|
338
|
-
}
|
339
|
-
}
|
340
|
-
|
341
|
-
post("bulkBetaTesterAssignments", body)
|
342
|
-
end
|
343
|
-
|
344
|
-
def delete_beta_tester_from_apps(beta_tester_id: nil, app_ids: [])
|
345
|
-
# DELETE
|
346
|
-
# https://appstoreconnect.apple.com/iris/v1/betaTesters/<beta_tester_id>/relationships/apps
|
347
|
-
path = "betaTesters/#{beta_tester_id}/relationships/apps"
|
348
|
-
body = {
|
349
|
-
data: app_ids.map do |id|
|
350
|
-
{
|
351
|
-
type: "apps",
|
352
|
-
id: id
|
353
|
-
}
|
354
|
-
end
|
355
|
-
}
|
356
|
-
|
357
|
-
delete(path, nil, body)
|
358
|
-
end
|
359
|
-
|
360
|
-
def delete_beta_tester_from_beta_groups(beta_tester_id: nil, beta_group_ids: [])
|
361
|
-
# DELETE
|
362
|
-
# https://appstoreconnect.apple.com/iris/v1/betaTesters/<beta_tester_id>/relationships/betaGroups
|
363
|
-
path = "betaTesters/#{beta_tester_id}/relationships/betaGroups"
|
364
|
-
body = {
|
365
|
-
data: beta_group_ids.map do |id|
|
366
|
-
{
|
367
|
-
type: "betaGroups",
|
368
|
-
id: id
|
369
|
-
}
|
14
|
+
elsif Spaceship::Tunes.client
|
15
|
+
# Initialize new client if new or if team changed
|
16
|
+
if @client.nil? || @client.team_id != Spaceship::Tunes.client.team_id
|
17
|
+
@client = Client.client_with_authorization_from(Spaceship::Tunes.client)
|
370
18
|
end
|
371
|
-
}
|
372
|
-
|
373
|
-
delete(path, nil, body)
|
374
|
-
end
|
375
|
-
|
376
|
-
#
|
377
|
-
# betaTesterMetrics
|
378
|
-
#
|
379
|
-
|
380
|
-
def get_beta_tester_metrics(filter: {}, includes: nil, limit: nil, sort: nil)
|
381
|
-
# GET
|
382
|
-
# https://appstoreconnect.apple.com/iris/v1/betaTesterMetrics
|
383
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
384
|
-
get("betaTesterMetrics", params)
|
385
|
-
end
|
386
|
-
|
387
|
-
#
|
388
|
-
# builds
|
389
|
-
#
|
390
|
-
|
391
|
-
def get_builds(filter: {}, includes: "buildBetaDetail,betaBuildMetrics", limit: 10, sort: "uploadedDate", cursor: nil)
|
392
|
-
# GET
|
393
|
-
# https://appstoreconnect.apple.com/iris/v1/builds
|
394
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort, cursor: cursor)
|
395
|
-
get("builds", params)
|
396
|
-
end
|
397
|
-
|
398
|
-
def get_build(build_id: nil, includes: nil)
|
399
|
-
# GET
|
400
|
-
# https://appstoreconnect.apple.com/iris/v1/builds/<build_id>?
|
401
|
-
params = build_params(filter: nil, includes: includes, limit: nil, sort: nil, cursor: nil)
|
402
|
-
get("builds/#{build_id}", params)
|
403
|
-
end
|
404
|
-
|
405
|
-
def patch_builds(build_id: nil, attributes: {})
|
406
|
-
# PATCH
|
407
|
-
# https://appstoreconnect.apple.com/iris/v1/builds/<build_id>
|
408
|
-
path = "builds/#{build_id}"
|
409
|
-
|
410
|
-
body = {
|
411
|
-
data: {
|
412
|
-
attributes: attributes,
|
413
|
-
id: build_id,
|
414
|
-
type: "builds"
|
415
|
-
}
|
416
|
-
}
|
417
|
-
|
418
|
-
patch(path, body)
|
419
|
-
end
|
420
|
-
|
421
|
-
#
|
422
|
-
# buildBetaDetails
|
423
|
-
#
|
424
|
-
|
425
|
-
def get_build_beta_details(filter: {}, includes: nil, limit: nil, sort: nil)
|
426
|
-
# GET
|
427
|
-
# https://appstoreconnect.apple.com/iris/v1/buildBetaDetails
|
428
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
429
|
-
get("buildBetaDetails", params)
|
430
|
-
end
|
431
|
-
|
432
|
-
def patch_build_beta_details(build_beta_details_id: nil, attributes: {})
|
433
|
-
# PATCH
|
434
|
-
# https://appstoreconnect.apple.com/iris/v1/buildBetaDetails/<build_beta_details_id>
|
435
|
-
path = "buildBetaDetails/#{build_beta_details_id}"
|
436
|
-
|
437
|
-
body = {
|
438
|
-
data: {
|
439
|
-
attributes: attributes,
|
440
|
-
id: build_beta_details_id,
|
441
|
-
type: "buildBetaDetails"
|
442
|
-
}
|
443
|
-
}
|
444
|
-
|
445
|
-
patch(path, body)
|
446
|
-
end
|
447
|
-
|
448
|
-
#
|
449
|
-
# buildDeliveries
|
450
|
-
#
|
451
|
-
|
452
|
-
def get_build_deliveries(filter: {}, includes: nil, limit: nil, sort: nil)
|
453
|
-
# GET
|
454
|
-
# https://appstoreconnect.apple.com/iris/v1/buildDeliveries
|
455
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
456
|
-
get("buildDeliveries", params)
|
457
|
-
end
|
458
|
-
|
459
|
-
#
|
460
|
-
# preReleaseVersions
|
461
|
-
#
|
462
|
-
|
463
|
-
def get_pre_release_versions(filter: {}, includes: nil, limit: nil, sort: nil)
|
464
|
-
# GET
|
465
|
-
# https://appstoreconnect.apple.com/iris/v1/preReleaseVersions
|
466
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
467
|
-
get("preReleaseVersions", params)
|
468
|
-
end
|
469
|
-
|
470
|
-
#
|
471
|
-
# users
|
472
|
-
#
|
473
|
-
|
474
|
-
def get_users(filter: {}, includes: nil, limit: nil, sort: nil)
|
475
|
-
# GET
|
476
|
-
# https://appstoreconnect.apple.com/iris/v1/users
|
477
|
-
params = build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
478
|
-
get("users", params)
|
479
|
-
end
|
480
|
-
|
481
|
-
protected
|
482
|
-
|
483
|
-
def handle_response(response)
|
484
|
-
if (200...300).cover?(response.status) && (response.body.nil? || response.body.empty?)
|
485
|
-
return
|
486
|
-
end
|
487
|
-
|
488
|
-
raise InternalServerError, "Server error got #{response.status}" if (500...600).cover?(response.status)
|
489
|
-
|
490
|
-
unless response.body.kind_of?(Hash)
|
491
|
-
raise UnexpectedResponse, response.body
|
492
19
|
end
|
493
20
|
|
494
|
-
|
495
|
-
|
496
|
-
raise UnexpectedResponse, handle_errors(response) if response.body['errors']
|
21
|
+
# Need to handle not having a client but this shouldn't ever happen
|
22
|
+
raise "Please login using `Spaceship::Tunes.login('user', 'password')`" unless @client
|
497
23
|
|
498
|
-
|
499
|
-
|
500
|
-
return Spaceship::ConnectAPI::Response.new(body: response.body, status: response.status, client: self)
|
24
|
+
@client
|
501
25
|
end
|
502
26
|
|
503
|
-
def
|
504
|
-
|
505
|
-
# {
|
506
|
-
# "errors" : [ {
|
507
|
-
# "id" : "ce8c391e-f858-411b-a14b-5aa26e0915f2",
|
508
|
-
# "status" : "400",
|
509
|
-
# "code" : "PARAMETER_ERROR.INVALID",
|
510
|
-
# "title" : "A parameter has an invalid value",
|
511
|
-
# "detail" : "'uploadedDate3' is not a valid field name",
|
512
|
-
# "source" : {
|
513
|
-
# "parameter" : "sort"
|
514
|
-
# }
|
515
|
-
# } ]
|
516
|
-
# }
|
517
|
-
|
518
|
-
return response.body['errors'].map do |error|
|
519
|
-
"#{error['title']} - #{error['detail']}"
|
520
|
-
end.join(" ")
|
521
|
-
end
|
522
|
-
|
523
|
-
private
|
524
|
-
|
525
|
-
# used to assert all of the named parameters are supplied values
|
526
|
-
#
|
527
|
-
# @raises NameError if the values are nil
|
528
|
-
def assert_required_params(method_name, binding)
|
529
|
-
parameter_names = method(method_name).parameters.map { |_, v| v }
|
530
|
-
parameter_names.each do |name|
|
531
|
-
if local_variable_get(binding, name).nil?
|
532
|
-
raise NameError, "`#{name}' is a required parameter"
|
533
|
-
end
|
534
|
-
end
|
535
|
-
end
|
536
|
-
|
537
|
-
def local_variable_get(binding, name)
|
538
|
-
if binding.respond_to?(:local_variable_get)
|
539
|
-
binding.local_variable_get(name)
|
540
|
-
else
|
541
|
-
binding.eval(name.to_s)
|
542
|
-
end
|
543
|
-
end
|
544
|
-
|
545
|
-
def provider_id
|
546
|
-
return team_id if self.provider.nil?
|
547
|
-
self.provider.provider_id
|
27
|
+
def self.hostname
|
28
|
+
'https://appstoreconnect.apple.com/iris/v1/'
|
548
29
|
end
|
549
30
|
end
|
550
31
|
end
|
551
32
|
end
|
552
|
-
# rubocop:enable Metrics/ClassLength
|
553
33
|
end
|