fastlane-plugin-taiwan_number_one 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f021f730281d3fb9f0494a897ed7d2150954a9dd671c1d3f334389ce3b22ec37
4
- data.tar.gz: 27bb6277be25f03f4d1a0ec2c35377be6ea262e33ef6857a0df1142806de5bcf
3
+ metadata.gz: d96498468a5871d8e612adb663a7f446ce026e9dfb1ba3ee6a6df3689d2ac786
4
+ data.tar.gz: 285b7cb87df61d33b387690f9d06c06e9834e078d6948ee46c7a1388eea342b9
5
5
  SHA512:
6
- metadata.gz: 50dedbd50733a4ae7c209dc2e2b5724a167a1d70c41ad8f5c702f0620d2d2aecb2b87d5f66ebc4e6a68d5d23e6b43a763c2b586e1312299421d11d4506794988
7
- data.tar.gz: 53120452faa6d1d9d6c6601cc865ffaeb4b1e2b35b870c2524969ccde60b807dba892fece311467927648db69dc9cf79f0b3a31a414bfaa26649c3770390cb4e
6
+ metadata.gz: 12ce29515257361ae7f814ca0fc93dd026a456c211457085071b353bf241ef10631b28ce1569bc3d20307e583e7f0b7dffb09da73a4e5619dfba6669d6c0b812
7
+ data.tar.gz: 8558a7f279b12c8e4efe192700cccd08ba2867903c71c60ecd346487e93143dfa2b032a9a8d775bb0a5fedd5efb3d9966a57db22ad2ceecefd85c6edf29e4ffc
@@ -53,19 +53,14 @@ module Fastlane
53
53
  ].join(","),
54
54
  platform: platform
55
55
  }
56
-
56
+
57
57
  decision ||= fetch_decision(params)
58
58
  if params[:force] && decision == DecisionType::REJECT
59
59
  UI.message("decision is reject")
60
60
  app_store_version = app.get_app_store_versions(client: client, includes: "appStoreVersionSubmission")
61
- .sort_by { |v| Gem::Version.new(v.version_string) }
62
- .last
63
- if app_store_version.app_store_state == Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::DEVELOPER_REJECTED
64
- UI.message("app_store_state is already #{app_store_version.app_store_state}")
65
- UI.message("🇹🇼 Taiwan helps you do nothing!")
66
- return ActionResult::DO_NOTHING
67
- end
68
- return reject_version_if_possible(app: app, app_store_version: app_store_version)
61
+ .sort_by { |v| Gem::Version.new(v.version_string) }
62
+ .last
63
+ return reject_version_if_possible(client: client, app_store_version: app_store_version)
69
64
  end
70
65
 
71
66
  app_store_version = app.get_app_store_versions(client: client, filter: filter, includes: "appStoreVersionSubmission")
@@ -85,10 +80,10 @@ module Fastlane
85
80
  case decision
86
81
  when DecisionType::RELEASE
87
82
  UI.message("decision is release")
88
- result = release_version_if_possible(app: app, app_store_version: app_store_version, token: token)
83
+ result = release_version_if_possible(client: client, app_store_version: app_store_version, token: token)
89
84
  when DecisionType::REJECT
90
85
  UI.message("decision is reject")
91
- result = reject_version_if_possible(app: app, app_store_version: app_store_version)
86
+ result = reject_version_if_possible(client: client, app_store_version: app_store_version)
92
87
  else
93
88
  UI.user_error!("App's decision must be release or reject")
94
89
  result = ActionResult::DO_NOTHING
@@ -132,13 +127,13 @@ module Fastlane
132
127
  end
133
128
 
134
129
  begin
135
- if token
130
+ if token
136
131
  now = Time.now
137
132
  release_date_string = now.strftime("%Y-%m-%dT%H:00%:z")
138
133
  app_store_version.update(attributes: {
139
- earliest_release_date: release_date_string,
140
- release_type: Spaceship::ConnectAPI::AppStoreVersion::ReleaseType::SCHEDULED
141
- })
134
+ earliest_release_date: release_date_string,
135
+ release_type: Spaceship::ConnectAPI::AppStoreVersion::ReleaseType::SCHEDULED
136
+ })
142
137
  return ActionResult::SUCCESS
143
138
  else
144
139
  app_store_version.create_app_store_version_release_request
@@ -151,19 +146,19 @@ module Fastlane
151
146
  end
152
147
  end
153
148
 
154
- def self.reject_version_if_possible(app: nil, app_store_version: Spaceship::ConnectAPI::AppStoreVersion)
155
- unless app
156
- UI.user_error!("Could not find app with bundle identifier '#{params[:app_identifier]}' on account #{params[:username]}")
149
+ # For example https://appstoreconnect.apple.com/iris/v1/appStoreVersionSubmissions/575ee084-a3a6-4664-8ba5-49dd77a00927
150
+ # Request Method: DELETE
151
+ def self.reject_version_if_possible(client: Spaceship::ConnectAPI, app_store_version: Spaceship::ConnectAPI::AppStoreVersion)
152
+ if app_store_version.app_store_state == Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::DEVELOPER_REJECTED
153
+ UI.message("app_store_state is already #{app_store_version.app_store_state}")
154
+ UI.message("🇹🇼 Taiwan helps you do nothing!")
157
155
  return ActionResult::DO_NOTHING
158
156
  end
159
157
 
160
- if app_store_version.reject!
161
- UI.success("rejected version #{app_store_version.version_string} Successfully!")
162
- return ActionResult::SUCCESS
163
- else
164
- UI.user_error!("An error occurred while rejected version #{app_store_version}")
165
- return ActionResult::DO_NOTHING
166
- end
158
+ client.delete_app_store_version_submission(app_store_version_submission_id: app_store_version.id)
159
+ UI.success("Rejected version #{app_store_version.version_string} Successfully!")
160
+ UI.message("🇹🇼 Taiwan can help!")
161
+ return ActionResult::SUCCESS
167
162
  end
168
163
 
169
164
  def self.api_token(params)
@@ -191,8 +186,8 @@ module Fastlane
191
186
 
192
187
  def self.output
193
188
  [
194
- [ActionResult::SUCCESS, 'Successfully release or reject.'],
195
- [ActionResult::DO_NOTHING, 'Do nothing.']
189
+ [ActionResult::SUCCESS, "Successfully release or reject."],
190
+ [ActionResult::DO_NOTHING, "Do nothing."]
196
191
  ]
197
192
  end
198
193
 
@@ -263,7 +258,7 @@ module Fastlane
263
258
  env_name: "FL_DECISION_FORCE",
264
259
  description: "Skip verifying of current version state for reject reviewed version or cancel waiting review version",
265
260
  is_string: false,
266
- default_value: false),
261
+ default_value: false)
267
262
  ]
268
263
  end
269
264
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module TaiwanNumberOne
3
- VERSION = "1.1.1"
3
+ VERSION = "1.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-taiwan_number_one
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - andrew54068
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-06 00:00:00.000000000 Z
11
+ date: 2022-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry