fastlane_pricing_fix 2.212.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (910) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +1 -0
  3. data/LICENSE +21 -0
  4. data/README.md +235 -0
  5. data/bin/bin-proxy +19 -0
  6. data/bin/fastlane +23 -0
  7. data/cert/README.md +17 -0
  8. data/cert/lib/cert/commands_generator.rb +61 -0
  9. data/cert/lib/cert/module.rb +16 -0
  10. data/cert/lib/cert/options.rb +133 -0
  11. data/cert/lib/cert/runner.rb +250 -0
  12. data/cert/lib/cert.rb +4 -0
  13. data/credentials_manager/README.md +64 -0
  14. data/credentials_manager/lib/credentials_manager/account_manager.rb +157 -0
  15. data/credentials_manager/lib/credentials_manager/appfile_config.rb +196 -0
  16. data/credentials_manager/lib/credentials_manager/cli.rb +69 -0
  17. data/credentials_manager/lib/credentials_manager.rb +7 -0
  18. data/deliver/README.md +17 -0
  19. data/deliver/lib/assets/DeliverfileDefault +3 -0
  20. data/deliver/lib/assets/DeliverfileDefault.swift +13 -0
  21. data/deliver/lib/assets/ScreenshotsHelp +30 -0
  22. data/deliver/lib/assets/summary.html.erb +299 -0
  23. data/deliver/lib/deliver/app_screenshot.rb +387 -0
  24. data/deliver/lib/deliver/app_screenshot_iterator.rb +95 -0
  25. data/deliver/lib/deliver/app_screenshot_validator.rb +108 -0
  26. data/deliver/lib/deliver/commands_generator.rb +191 -0
  27. data/deliver/lib/deliver/detect_values.rb +104 -0
  28. data/deliver/lib/deliver/download_screenshots.rb +75 -0
  29. data/deliver/lib/deliver/generate_summary.rb +13 -0
  30. data/deliver/lib/deliver/html_generator.rb +78 -0
  31. data/deliver/lib/deliver/languages.rb +7 -0
  32. data/deliver/lib/deliver/loader.rb +157 -0
  33. data/deliver/lib/deliver/module.rb +24 -0
  34. data/deliver/lib/deliver/options.rb +461 -0
  35. data/deliver/lib/deliver/runner.rb +310 -0
  36. data/deliver/lib/deliver/screenshot_comparable.rb +62 -0
  37. data/deliver/lib/deliver/setup.rb +203 -0
  38. data/deliver/lib/deliver/submit_for_review.rb +236 -0
  39. data/deliver/lib/deliver/sync_screenshots.rb +200 -0
  40. data/deliver/lib/deliver/upload_metadata.rb +699 -0
  41. data/deliver/lib/deliver/upload_price_tier.rb +42 -0
  42. data/deliver/lib/deliver/upload_screenshots.rb +271 -0
  43. data/deliver/lib/deliver.rb +15 -0
  44. data/fastlane/README.md +11 -0
  45. data/fastlane/lib/assets/ActionDetails.md.erb +106 -0
  46. data/fastlane/lib/assets/Actions.md.erb +43 -0
  47. data/fastlane/lib/assets/AppfileTemplate +6 -0
  48. data/fastlane/lib/assets/AppfileTemplate.swift +7 -0
  49. data/fastlane/lib/assets/AppfileTemplateAndroid +2 -0
  50. data/fastlane/lib/assets/DefaultFastfileTemplate +20 -0
  51. data/fastlane/lib/assets/DefaultFastfileTemplate.swift +13 -0
  52. data/fastlane/lib/assets/completions/completion.bash +26 -0
  53. data/fastlane/lib/assets/completions/completion.fish +39 -0
  54. data/fastlane/lib/assets/completions/completion.sh +12 -0
  55. data/fastlane/lib/assets/completions/completion.zsh +24 -0
  56. data/fastlane/lib/assets/custom_action_template.rb +82 -0
  57. data/fastlane/lib/assets/mailgun_html_template.erb +142 -0
  58. data/fastlane/lib/assets/report_template.xml.erb +15 -0
  59. data/fastlane/lib/assets/s3_html_template.erb +105 -0
  60. data/fastlane/lib/assets/s3_plist_template.erb +31 -0
  61. data/fastlane/lib/assets/s3_version_template.erb +4 -0
  62. data/fastlane/lib/fastlane/action.rb +198 -0
  63. data/fastlane/lib/fastlane/action_collector.rb +35 -0
  64. data/fastlane/lib/fastlane/actions/README.md +5 -0
  65. data/fastlane/lib/fastlane/actions/actions_helper.rb +185 -0
  66. data/fastlane/lib/fastlane/actions/adb.rb +75 -0
  67. data/fastlane/lib/fastlane/actions/adb_devices.rb +70 -0
  68. data/fastlane/lib/fastlane/actions/add_extra_platforms.rb +45 -0
  69. data/fastlane/lib/fastlane/actions/add_git_tag.rb +138 -0
  70. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +255 -0
  71. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +148 -0
  72. data/fastlane/lib/fastlane/actions/appaloosa.rb +271 -0
  73. data/fastlane/lib/fastlane/actions/appetize.rb +193 -0
  74. data/fastlane/lib/fastlane/actions/appetize_viewing_url_generator.rb +135 -0
  75. data/fastlane/lib/fastlane/actions/appium.rb +181 -0
  76. data/fastlane/lib/fastlane/actions/appledoc.rb +226 -0
  77. data/fastlane/lib/fastlane/actions/appstore.rb +14 -0
  78. data/fastlane/lib/fastlane/actions/apteligent.rb +106 -0
  79. data/fastlane/lib/fastlane/actions/artifactory.rb +189 -0
  80. data/fastlane/lib/fastlane/actions/automatic_code_signing.rb +220 -0
  81. data/fastlane/lib/fastlane/actions/backup_file.rb +41 -0
  82. data/fastlane/lib/fastlane/actions/backup_xcarchive.rb +135 -0
  83. data/fastlane/lib/fastlane/actions/badge.rb +151 -0
  84. data/fastlane/lib/fastlane/actions/build_and_upload_to_appetize.rb +113 -0
  85. data/fastlane/lib/fastlane/actions/build_android_app.rb +14 -0
  86. data/fastlane/lib/fastlane/actions/build_app.rb +171 -0
  87. data/fastlane/lib/fastlane/actions/build_ios_app.rb +47 -0
  88. data/fastlane/lib/fastlane/actions/build_mac_app.rb +46 -0
  89. data/fastlane/lib/fastlane/actions/bundle_install.rb +166 -0
  90. data/fastlane/lib/fastlane/actions/capture_android_screenshots.rb +63 -0
  91. data/fastlane/lib/fastlane/actions/capture_ios_screenshots.rb +61 -0
  92. data/fastlane/lib/fastlane/actions/capture_screenshots.rb +14 -0
  93. data/fastlane/lib/fastlane/actions/carthage.rb +238 -0
  94. data/fastlane/lib/fastlane/actions/cert.rb +14 -0
  95. data/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb +188 -0
  96. data/fastlane/lib/fastlane/actions/chatwork.rb +95 -0
  97. data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +62 -0
  98. data/fastlane/lib/fastlane/actions/clean_build_artifacts.rb +71 -0
  99. data/fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb +75 -0
  100. data/fastlane/lib/fastlane/actions/clear_derived_data.rb +70 -0
  101. data/fastlane/lib/fastlane/actions/clipboard.rb +49 -0
  102. data/fastlane/lib/fastlane/actions/cloc.rb +85 -0
  103. data/fastlane/lib/fastlane/actions/cocoapods.rb +178 -0
  104. data/fastlane/lib/fastlane/actions/commit_github_file.rb +194 -0
  105. data/fastlane/lib/fastlane/actions/commit_version_bump.rb +300 -0
  106. data/fastlane/lib/fastlane/actions/copy_artifacts.rb +113 -0
  107. data/fastlane/lib/fastlane/actions/create_app_on_managed_play_store.rb +168 -0
  108. data/fastlane/lib/fastlane/actions/create_app_online.rb +75 -0
  109. data/fastlane/lib/fastlane/actions/create_keychain.rb +179 -0
  110. data/fastlane/lib/fastlane/actions/create_pull_request.rb +271 -0
  111. data/fastlane/lib/fastlane/actions/create_xcframework.rb +203 -0
  112. data/fastlane/lib/fastlane/actions/danger.rb +146 -0
  113. data/fastlane/lib/fastlane/actions/debug.rb +32 -0
  114. data/fastlane/lib/fastlane/actions/default_platform.rb +47 -0
  115. data/fastlane/lib/fastlane/actions/delete_keychain.rb +68 -0
  116. data/fastlane/lib/fastlane/actions/deliver.rb +14 -0
  117. data/fastlane/lib/fastlane/actions/deploygate.rb +209 -0
  118. data/fastlane/lib/fastlane/actions/device_grid/README.md +157 -0
  119. data/fastlane/lib/fastlane/actions/docs/build_app.md +245 -0
  120. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +349 -0
  121. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +375 -0
  122. data/fastlane/lib/fastlane/actions/docs/check_app_store_metadata.md +103 -0
  123. data/fastlane/lib/fastlane/actions/docs/create_app_online.md +386 -0
  124. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +366 -0
  125. data/fastlane/lib/fastlane/actions/docs/get_certificates.md +86 -0
  126. data/fastlane/lib/fastlane/actions/docs/get_provisioning_profile.md +223 -0
  127. data/fastlane/lib/fastlane/actions/docs/get_push_certificate.md +134 -0
  128. data/fastlane/lib/fastlane/actions/docs/run_tests.md +151 -0
  129. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +579 -0
  130. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +748 -0
  131. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +204 -0
  132. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +260 -0
  133. data/fastlane/lib/fastlane/actions/dotgpg_environment.rb +57 -0
  134. data/fastlane/lib/fastlane/actions/download.rb +76 -0
  135. data/fastlane/lib/fastlane/actions/download_app_privacy_details_from_app_store.rb +142 -0
  136. data/fastlane/lib/fastlane/actions/download_dsyms.rb +373 -0
  137. data/fastlane/lib/fastlane/actions/download_from_play_store.rb +61 -0
  138. data/fastlane/lib/fastlane/actions/dsym_zip.rb +93 -0
  139. data/fastlane/lib/fastlane/actions/echo.rb +14 -0
  140. data/fastlane/lib/fastlane/actions/ensure_bundle_exec.rb +59 -0
  141. data/fastlane/lib/fastlane/actions/ensure_env_vars.rb +54 -0
  142. data/fastlane/lib/fastlane/actions/ensure_git_branch.rb +68 -0
  143. data/fastlane/lib/fastlane/actions/ensure_git_status_clean.rb +102 -0
  144. data/fastlane/lib/fastlane/actions/ensure_no_debug_code.rb +133 -0
  145. data/fastlane/lib/fastlane/actions/ensure_xcode_version.rb +124 -0
  146. data/fastlane/lib/fastlane/actions/environment_variable.rb +69 -0
  147. data/fastlane/lib/fastlane/actions/erb.rb +93 -0
  148. data/fastlane/lib/fastlane/actions/fastlane_version.rb +15 -0
  149. data/fastlane/lib/fastlane/actions/flock.rb +82 -0
  150. data/fastlane/lib/fastlane/actions/frame_screenshots.rb +64 -0
  151. data/fastlane/lib/fastlane/actions/frameit.rb +14 -0
  152. data/fastlane/lib/fastlane/actions/gcovr.rb +163 -0
  153. data/fastlane/lib/fastlane/actions/get_build_number.rb +106 -0
  154. data/fastlane/lib/fastlane/actions/get_build_number_repository.rb +120 -0
  155. data/fastlane/lib/fastlane/actions/get_certificates.rb +81 -0
  156. data/fastlane/lib/fastlane/actions/get_github_release.rb +176 -0
  157. data/fastlane/lib/fastlane/actions/get_info_plist_value.rb +78 -0
  158. data/fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb +81 -0
  159. data/fastlane/lib/fastlane/actions/get_managed_play_store_publishing_rights.rb +117 -0
  160. data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +109 -0
  161. data/fastlane/lib/fastlane/actions/get_push_certificate.rb +87 -0
  162. data/fastlane/lib/fastlane/actions/get_version_number.rb +212 -0
  163. data/fastlane/lib/fastlane/actions/git_add.rb +88 -0
  164. data/fastlane/lib/fastlane/actions/git_branch.rb +55 -0
  165. data/fastlane/lib/fastlane/actions/git_commit.rb +80 -0
  166. data/fastlane/lib/fastlane/actions/git_pull.rb +58 -0
  167. data/fastlane/lib/fastlane/actions/git_remote_branch.rb +57 -0
  168. data/fastlane/lib/fastlane/actions/git_submodule_update.rb +60 -0
  169. data/fastlane/lib/fastlane/actions/git_tag_exists.rb +78 -0
  170. data/fastlane/lib/fastlane/actions/github_api.rb +271 -0
  171. data/fastlane/lib/fastlane/actions/google_play_track_release_names.rb +74 -0
  172. data/fastlane/lib/fastlane/actions/google_play_track_version_codes.rb +77 -0
  173. data/fastlane/lib/fastlane/actions/gradle.rb +334 -0
  174. data/fastlane/lib/fastlane/actions/gym.rb +10 -0
  175. data/fastlane/lib/fastlane/actions/hg_add_tag.rb +48 -0
  176. data/fastlane/lib/fastlane/actions/hg_commit_version_bump.rb +183 -0
  177. data/fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb +53 -0
  178. data/fastlane/lib/fastlane/actions/hg_push.rb +64 -0
  179. data/fastlane/lib/fastlane/actions/hipchat.rb +200 -0
  180. data/fastlane/lib/fastlane/actions/hockey.rb +399 -0
  181. data/fastlane/lib/fastlane/actions/ifttt.rb +93 -0
  182. data/fastlane/lib/fastlane/actions/import.rb +49 -0
  183. data/fastlane/lib/fastlane/actions/import_certificate.rb +77 -0
  184. data/fastlane/lib/fastlane/actions/import_from_git.rb +81 -0
  185. data/fastlane/lib/fastlane/actions/increment_build_number.rb +123 -0
  186. data/fastlane/lib/fastlane/actions/increment_version_number.rb +180 -0
  187. data/fastlane/lib/fastlane/actions/install_on_device.rb +92 -0
  188. data/fastlane/lib/fastlane/actions/install_provisioning_profile.rb +62 -0
  189. data/fastlane/lib/fastlane/actions/install_xcode_plugin.rb +91 -0
  190. data/fastlane/lib/fastlane/actions/installr.rb +129 -0
  191. data/fastlane/lib/fastlane/actions/ipa.rb +246 -0
  192. data/fastlane/lib/fastlane/actions/is_ci.rb +51 -0
  193. data/fastlane/lib/fastlane/actions/jazzy.rb +59 -0
  194. data/fastlane/lib/fastlane/actions/jira.rb +162 -0
  195. data/fastlane/lib/fastlane/actions/lane_context.rb +60 -0
  196. data/fastlane/lib/fastlane/actions/last_git_commit.rb +58 -0
  197. data/fastlane/lib/fastlane/actions/last_git_tag.rb +60 -0
  198. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +154 -0
  199. data/fastlane/lib/fastlane/actions/lcov.rb +98 -0
  200. data/fastlane/lib/fastlane/actions/mailgun.rb +191 -0
  201. data/fastlane/lib/fastlane/actions/make_changelog_from_jenkins.rb +81 -0
  202. data/fastlane/lib/fastlane/actions/match.rb +14 -0
  203. data/fastlane/lib/fastlane/actions/match_nuke.rb +59 -0
  204. data/fastlane/lib/fastlane/actions/min_fastlane_version.rb +57 -0
  205. data/fastlane/lib/fastlane/actions/modify_services.rb +208 -0
  206. data/fastlane/lib/fastlane/actions/nexus_upload.rb +231 -0
  207. data/fastlane/lib/fastlane/actions/notarize.rb +340 -0
  208. data/fastlane/lib/fastlane/actions/notification.rb +75 -0
  209. data/fastlane/lib/fastlane/actions/notify.rb +40 -0
  210. data/fastlane/lib/fastlane/actions/number_of_commits.rb +75 -0
  211. data/fastlane/lib/fastlane/actions/oclint.rb +270 -0
  212. data/fastlane/lib/fastlane/actions/onesignal.rb +196 -0
  213. data/fastlane/lib/fastlane/actions/opt_out_crash_reporting.rb +33 -0
  214. data/fastlane/lib/fastlane/actions/opt_out_usage.rb +40 -0
  215. data/fastlane/lib/fastlane/actions/pem.rb +14 -0
  216. data/fastlane/lib/fastlane/actions/pilot.rb +14 -0
  217. data/fastlane/lib/fastlane/actions/pod_lib_lint.rb +189 -0
  218. data/fastlane/lib/fastlane/actions/pod_push.rb +198 -0
  219. data/fastlane/lib/fastlane/actions/podio_item.rb +210 -0
  220. data/fastlane/lib/fastlane/actions/precheck.rb +14 -0
  221. data/fastlane/lib/fastlane/actions/println.rb +14 -0
  222. data/fastlane/lib/fastlane/actions/produce.rb +14 -0
  223. data/fastlane/lib/fastlane/actions/prompt.rb +118 -0
  224. data/fastlane/lib/fastlane/actions/push_git_tags.rb +76 -0
  225. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +138 -0
  226. data/fastlane/lib/fastlane/actions/puts.rb +67 -0
  227. data/fastlane/lib/fastlane/actions/read_podspec.rb +90 -0
  228. data/fastlane/lib/fastlane/actions/recreate_schemes.rb +46 -0
  229. data/fastlane/lib/fastlane/actions/register_device.rb +148 -0
  230. data/fastlane/lib/fastlane/actions/register_devices.rb +211 -0
  231. data/fastlane/lib/fastlane/actions/reset_git_repo.rb +118 -0
  232. data/fastlane/lib/fastlane/actions/reset_simulator_contents.rb +90 -0
  233. data/fastlane/lib/fastlane/actions/resign.rb +125 -0
  234. data/fastlane/lib/fastlane/actions/restore_file.rb +44 -0
  235. data/fastlane/lib/fastlane/actions/rocket.rb +83 -0
  236. data/fastlane/lib/fastlane/actions/rsync.rb +71 -0
  237. data/fastlane/lib/fastlane/actions/ruby_version.rb +56 -0
  238. data/fastlane/lib/fastlane/actions/run_tests.rb +124 -0
  239. data/fastlane/lib/fastlane/actions/s3.rb +174 -0
  240. data/fastlane/lib/fastlane/actions/say.rb +55 -0
  241. data/fastlane/lib/fastlane/actions/scan.rb +14 -0
  242. data/fastlane/lib/fastlane/actions/scp.rb +108 -0
  243. data/fastlane/lib/fastlane/actions/screengrab.rb +14 -0
  244. data/fastlane/lib/fastlane/actions/set_build_number_repository.rb +76 -0
  245. data/fastlane/lib/fastlane/actions/set_changelog.rb +201 -0
  246. data/fastlane/lib/fastlane/actions/set_github_release.rb +287 -0
  247. data/fastlane/lib/fastlane/actions/set_info_plist_value.rb +92 -0
  248. data/fastlane/lib/fastlane/actions/set_pod_key.rb +77 -0
  249. data/fastlane/lib/fastlane/actions/setup_ci.rb +140 -0
  250. data/fastlane/lib/fastlane/actions/setup_circle_ci.rb +58 -0
  251. data/fastlane/lib/fastlane/actions/setup_jenkins.rb +197 -0
  252. data/fastlane/lib/fastlane/actions/setup_travis.rb +57 -0
  253. data/fastlane/lib/fastlane/actions/sh.rb +69 -0
  254. data/fastlane/lib/fastlane/actions/sigh.rb +14 -0
  255. data/fastlane/lib/fastlane/actions/skip_docs.rb +52 -0
  256. data/fastlane/lib/fastlane/actions/slack.rb +307 -0
  257. data/fastlane/lib/fastlane/actions/slather.rb +319 -0
  258. data/fastlane/lib/fastlane/actions/snapshot.rb +14 -0
  259. data/fastlane/lib/fastlane/actions/sonar.rb +170 -0
  260. data/fastlane/lib/fastlane/actions/sourcedocs.rb +128 -0
  261. data/fastlane/lib/fastlane/actions/spaceship_logs.rb +135 -0
  262. data/fastlane/lib/fastlane/actions/spaceship_stats.rb +73 -0
  263. data/fastlane/lib/fastlane/actions/splunkmint.rb +156 -0
  264. data/fastlane/lib/fastlane/actions/spm.rb +144 -0
  265. data/fastlane/lib/fastlane/actions/ssh.rb +157 -0
  266. data/fastlane/lib/fastlane/actions/supply.rb +14 -0
  267. data/fastlane/lib/fastlane/actions/swiftlint.rb +242 -0
  268. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +114 -0
  269. data/fastlane/lib/fastlane/actions/team_id.rb +42 -0
  270. data/fastlane/lib/fastlane/actions/team_name.rb +42 -0
  271. data/fastlane/lib/fastlane/actions/testfairy.rb +284 -0
  272. data/fastlane/lib/fastlane/actions/testflight.rb +14 -0
  273. data/fastlane/lib/fastlane/actions/trainer.rb +49 -0
  274. data/fastlane/lib/fastlane/actions/tryouts.rb +148 -0
  275. data/fastlane/lib/fastlane/actions/twitter.rb +84 -0
  276. data/fastlane/lib/fastlane/actions/typetalk.rb +93 -0
  277. data/fastlane/lib/fastlane/actions/unlock_keychain.rb +132 -0
  278. data/fastlane/lib/fastlane/actions/update_app_group_identifiers.rb +88 -0
  279. data/fastlane/lib/fastlane/actions/update_app_identifier.rb +124 -0
  280. data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +223 -0
  281. data/fastlane/lib/fastlane/actions/update_fastlane.rb +158 -0
  282. data/fastlane/lib/fastlane/actions/update_icloud_container_identifiers.rb +96 -0
  283. data/fastlane/lib/fastlane/actions/update_info_plist.rb +143 -0
  284. data/fastlane/lib/fastlane/actions/update_keychain_access_groups.rb +91 -0
  285. data/fastlane/lib/fastlane/actions/update_plist.rb +115 -0
  286. data/fastlane/lib/fastlane/actions/update_project_code_signing.rb +76 -0
  287. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +181 -0
  288. data/fastlane/lib/fastlane/actions/update_project_team.rb +95 -0
  289. data/fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb +90 -0
  290. data/fastlane/lib/fastlane/actions/update_url_schemes.rb +112 -0
  291. data/fastlane/lib/fastlane/actions/upload_app_privacy_details_to_app_store.rb +290 -0
  292. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +232 -0
  293. data/fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb +158 -0
  294. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +71 -0
  295. data/fastlane/lib/fastlane/actions/upload_to_play_store.rb +80 -0
  296. data/fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb +78 -0
  297. data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +126 -0
  298. data/fastlane/lib/fastlane/actions/validate_play_store_json_key.rb +100 -0
  299. data/fastlane/lib/fastlane/actions/verify_build.rb +199 -0
  300. data/fastlane/lib/fastlane/actions/verify_pod_keys.rb +67 -0
  301. data/fastlane/lib/fastlane/actions/verify_xcode.rb +159 -0
  302. data/fastlane/lib/fastlane/actions/version_bump_podspec.rb +105 -0
  303. data/fastlane/lib/fastlane/actions/version_get_podspec.rb +70 -0
  304. data/fastlane/lib/fastlane/actions/xcode_install.rb +112 -0
  305. data/fastlane/lib/fastlane/actions/xcode_select.rb +68 -0
  306. data/fastlane/lib/fastlane/actions/xcode_server_get_assets.rb +312 -0
  307. data/fastlane/lib/fastlane/actions/xcodebuild.rb +647 -0
  308. data/fastlane/lib/fastlane/actions/xcodes.rb +152 -0
  309. data/fastlane/lib/fastlane/actions/xcov.rb +71 -0
  310. data/fastlane/lib/fastlane/actions/xctool.rb +55 -0
  311. data/fastlane/lib/fastlane/actions/xcversion.rb +65 -0
  312. data/fastlane/lib/fastlane/actions/zip.rb +185 -0
  313. data/fastlane/lib/fastlane/auto_complete.rb +82 -0
  314. data/fastlane/lib/fastlane/boolean.rb +5 -0
  315. data/fastlane/lib/fastlane/cli_tools_distributor.rb +215 -0
  316. data/fastlane/lib/fastlane/command_line_handler.rb +49 -0
  317. data/fastlane/lib/fastlane/commands_generator.rb +371 -0
  318. data/fastlane/lib/fastlane/configuration_helper.rb +26 -0
  319. data/fastlane/lib/fastlane/core_ext/bundler_monkey_patch.rb +14 -0
  320. data/fastlane/lib/fastlane/documentation/actions_list.rb +214 -0
  321. data/fastlane/lib/fastlane/documentation/docs_generator.rb +94 -0
  322. data/fastlane/lib/fastlane/documentation/markdown_docs_generator.rb +234 -0
  323. data/fastlane/lib/fastlane/environment_printer.rb +304 -0
  324. data/fastlane/lib/fastlane/erb_template_helper.rb +36 -0
  325. data/fastlane/lib/fastlane/fast_file.rb +464 -0
  326. data/fastlane/lib/fastlane/fastlane_require.rb +81 -0
  327. data/fastlane/lib/fastlane/features.rb +10 -0
  328. data/fastlane/lib/fastlane/helper/README.md +29 -0
  329. data/fastlane/lib/fastlane/helper/adb_helper.rb +66 -0
  330. data/fastlane/lib/fastlane/helper/dotenv_helper.rb +50 -0
  331. data/fastlane/lib/fastlane/helper/gem_helper.rb +26 -0
  332. data/fastlane/lib/fastlane/helper/git_helper.rb +166 -0
  333. data/fastlane/lib/fastlane/helper/gradle_helper.rb +62 -0
  334. data/fastlane/lib/fastlane/helper/lane_helper.rb +13 -0
  335. data/fastlane/lib/fastlane/helper/podspec_helper.rb +75 -0
  336. data/fastlane/lib/fastlane/helper/s3_client_helper.rb +78 -0
  337. data/fastlane/lib/fastlane/helper/sh_helper.rb +134 -0
  338. data/fastlane/lib/fastlane/helper/xcodebuild_formatter_helper.rb +9 -0
  339. data/fastlane/lib/fastlane/helper/xcodeproj_helper.rb +12 -0
  340. data/fastlane/lib/fastlane/helper/xcodes_helper.rb +28 -0
  341. data/fastlane/lib/fastlane/helper/xcversion_helper.rb +16 -0
  342. data/fastlane/lib/fastlane/junit_generator.rb +27 -0
  343. data/fastlane/lib/fastlane/lane.rb +97 -0
  344. data/fastlane/lib/fastlane/lane_list.rb +137 -0
  345. data/fastlane/lib/fastlane/lane_manager.rb +131 -0
  346. data/fastlane/lib/fastlane/lane_manager_base.rb +92 -0
  347. data/fastlane/lib/fastlane/markdown_table_formatter.rb +62 -0
  348. data/fastlane/lib/fastlane/new_action.rb +47 -0
  349. data/fastlane/lib/fastlane/notification/slack.rb +56 -0
  350. data/fastlane/lib/fastlane/one_off.rb +45 -0
  351. data/fastlane/lib/fastlane/other_action.rb +29 -0
  352. data/fastlane/lib/fastlane/plugins/plugin_fetcher.rb +54 -0
  353. data/fastlane/lib/fastlane/plugins/plugin_generator.rb +86 -0
  354. data/fastlane/lib/fastlane/plugins/plugin_generator_ui.rb +19 -0
  355. data/fastlane/lib/fastlane/plugins/plugin_info.rb +49 -0
  356. data/fastlane/lib/fastlane/plugins/plugin_info_collector.rb +158 -0
  357. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +398 -0
  358. data/fastlane/lib/fastlane/plugins/plugin_search.rb +46 -0
  359. data/fastlane/lib/fastlane/plugins/plugin_update_manager.rb +70 -0
  360. data/fastlane/lib/fastlane/plugins/plugins.rb +12 -0
  361. data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +36 -0
  362. data/fastlane/lib/fastlane/plugins/template/.circleci/config.yml +43 -0
  363. data/fastlane/lib/fastlane/plugins/template/.github/workflows/test.yml +29 -0
  364. data/fastlane/lib/fastlane/plugins/template/.gitignore +12 -0
  365. data/fastlane/lib/fastlane/plugins/template/.rspec +5 -0
  366. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +188 -0
  367. data/fastlane/lib/fastlane/plugins/template/.travis.yml +4 -0
  368. data/fastlane/lib/fastlane/plugins/template/Gemfile +6 -0
  369. data/fastlane/lib/fastlane/plugins/template/LICENSE.erb +21 -0
  370. data/fastlane/lib/fastlane/plugins/template/README.md.erb +52 -0
  371. data/fastlane/lib/fastlane/plugins/template/Rakefile +9 -0
  372. data/fastlane/lib/fastlane/plugins/template/fastlane/Fastfile.erb +3 -0
  373. data/fastlane/lib/fastlane/plugins/template/fastlane/Pluginfile.erb +1 -0
  374. data/fastlane/lib/fastlane/plugins/template/lib/fastlane/plugin/%plugin_name%/actions/%plugin_name%_action.rb.erb +47 -0
  375. data/fastlane/lib/fastlane/plugins/template/lib/fastlane/plugin/%plugin_name%/helper/%plugin_name%_helper.rb.erb +16 -0
  376. data/fastlane/lib/fastlane/plugins/template/lib/fastlane/plugin/%plugin_name%/version.rb.erb +5 -0
  377. data/fastlane/lib/fastlane/plugins/template/lib/fastlane/plugin/%plugin_name%.rb.erb +16 -0
  378. data/fastlane/lib/fastlane/plugins/template/spec/%plugin_name%_action_spec.rb.erb +9 -0
  379. data/fastlane/lib/fastlane/plugins/template/spec/spec_helper.rb.erb +15 -0
  380. data/fastlane/lib/fastlane/runner.rb +378 -0
  381. data/fastlane/lib/fastlane/server/action_command.rb +61 -0
  382. data/fastlane/lib/fastlane/server/action_command_return.rb +14 -0
  383. data/fastlane/lib/fastlane/server/command_executor.rb +7 -0
  384. data/fastlane/lib/fastlane/server/command_parser.rb +44 -0
  385. data/fastlane/lib/fastlane/server/control_command.rb +23 -0
  386. data/fastlane/lib/fastlane/server/json_return_value_processor.rb +72 -0
  387. data/fastlane/lib/fastlane/server/socket_server.rb +238 -0
  388. data/fastlane/lib/fastlane/server/socket_server_action_command_executor.rb +101 -0
  389. data/fastlane/lib/fastlane/setup/setup.rb +368 -0
  390. data/fastlane/lib/fastlane/setup/setup_android.rb +97 -0
  391. data/fastlane/lib/fastlane/setup/setup_ios.rb +504 -0
  392. data/fastlane/lib/fastlane/shells.rb +6 -0
  393. data/fastlane/lib/fastlane/supported_platforms.rb +28 -0
  394. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +480 -0
  395. data/fastlane/lib/fastlane/swift_fastlane_function.rb +447 -0
  396. data/fastlane/lib/fastlane/swift_lane_manager.rb +304 -0
  397. data/fastlane/lib/fastlane/swift_runner_upgrader.rb +265 -0
  398. data/fastlane/lib/fastlane/tools.rb +50 -0
  399. data/fastlane/lib/fastlane/version.rb +6 -0
  400. data/fastlane/lib/fastlane.rb +53 -0
  401. data/fastlane/swift/Actions.swift +16 -0
  402. data/fastlane/swift/Appfile.swift +15 -0
  403. data/fastlane/swift/ArgumentProcessor.swift +89 -0
  404. data/fastlane/swift/Atomic.swift +150 -0
  405. data/fastlane/swift/ControlCommand.swift +74 -0
  406. data/fastlane/swift/Deliverfile.swift +20 -0
  407. data/fastlane/swift/DeliverfileProtocol.swift +267 -0
  408. data/fastlane/swift/Fastfile.swift +16 -0
  409. data/fastlane/swift/Fastlane.swift +13576 -0
  410. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +448 -0
  411. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  412. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  413. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +97 -0
  414. data/fastlane/swift/FastlaneSwiftRunner/README.txt +10 -0
  415. data/fastlane/swift/Gymfile.swift +20 -0
  416. data/fastlane/swift/GymfileProtocol.swift +211 -0
  417. data/fastlane/swift/LaneFileProtocol.swift +155 -0
  418. data/fastlane/swift/MainProcess.swift +79 -0
  419. data/fastlane/swift/Matchfile.swift +20 -0
  420. data/fastlane/swift/MatchfileProtocol.swift +211 -0
  421. data/fastlane/swift/OptionalConfigValue.swift +101 -0
  422. data/fastlane/swift/Plugins.swift +16 -0
  423. data/fastlane/swift/Precheckfile.swift +20 -0
  424. data/fastlane/swift/PrecheckfileProtocol.swift +55 -0
  425. data/fastlane/swift/RubyCommand.swift +157 -0
  426. data/fastlane/swift/RubyCommandable.swift +43 -0
  427. data/fastlane/swift/Runner.swift +279 -0
  428. data/fastlane/swift/RunnerArgument.swift +20 -0
  429. data/fastlane/swift/Scanfile.swift +20 -0
  430. data/fastlane/swift/ScanfileProtocol.swift +319 -0
  431. data/fastlane/swift/Screengrabfile.swift +20 -0
  432. data/fastlane/swift/ScreengrabfileProtocol.swift +99 -0
  433. data/fastlane/swift/Snapshotfile.swift +20 -0
  434. data/fastlane/swift/SnapshotfileProtocol.swift +207 -0
  435. data/fastlane/swift/SocketClient.swift +332 -0
  436. data/fastlane/swift/SocketClientDelegateProtocol.swift +21 -0
  437. data/fastlane/swift/SocketResponse.swift +84 -0
  438. data/fastlane/swift/formatting/Brewfile +1 -0
  439. data/fastlane/swift/formatting/Brewfile.lock.json +86 -0
  440. data/fastlane/swift/formatting/Rakefile +18 -0
  441. data/fastlane/swift/main.swift +47 -0
  442. data/fastlane/swift/upgrade_manifest.json +1 -0
  443. data/fastlane_core/README.md +80 -0
  444. data/fastlane_core/lib/assets/XMLTemplate.xml.erb +12 -0
  445. data/fastlane_core/lib/fastlane_core/analytics/action_completion_context.rb +34 -0
  446. data/fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb +38 -0
  447. data/fastlane_core/lib/fastlane_core/analytics/analytics_event_builder.rb +23 -0
  448. data/fastlane_core/lib/fastlane_core/analytics/analytics_ingester_client.rb +54 -0
  449. data/fastlane_core/lib/fastlane_core/analytics/analytics_session.rb +70 -0
  450. data/fastlane_core/lib/fastlane_core/analytics/app_identifier_guesser.rb +64 -0
  451. data/fastlane_core/lib/fastlane_core/android_package_name_guesser.rb +79 -0
  452. data/fastlane_core/lib/fastlane_core/build_watcher.rb +192 -0
  453. data/fastlane_core/lib/fastlane_core/cert_checker.rb +211 -0
  454. data/fastlane_core/lib/fastlane_core/clipboard.rb +20 -0
  455. data/fastlane_core/lib/fastlane_core/command_executor.rb +94 -0
  456. data/fastlane_core/lib/fastlane_core/configuration/commander_generator.rb +108 -0
  457. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +359 -0
  458. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +338 -0
  459. data/fastlane_core/lib/fastlane_core/configuration/configuration_file.rb +182 -0
  460. data/fastlane_core/lib/fastlane_core/core_ext/cfpropertylist.rb +23 -0
  461. data/fastlane_core/lib/fastlane_core/core_ext/shellwords.rb +63 -0
  462. data/fastlane_core/lib/fastlane_core/core_ext/string.rb +17 -0
  463. data/fastlane_core/lib/fastlane_core/device_manager.rb +378 -0
  464. data/fastlane_core/lib/fastlane_core/env.rb +9 -0
  465. data/fastlane_core/lib/fastlane_core/fastlane_folder.rb +72 -0
  466. data/fastlane_core/lib/fastlane_core/fastlane_pty.rb +57 -0
  467. data/fastlane_core/lib/fastlane_core/feature/feature.rb +51 -0
  468. data/fastlane_core/lib/fastlane_core/features.rb +4 -0
  469. data/fastlane_core/lib/fastlane_core/globals.rb +27 -0
  470. data/fastlane_core/lib/fastlane_core/helper.rb +501 -0
  471. data/fastlane_core/lib/fastlane_core/ios_app_identifier_guesser.rb +112 -0
  472. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +93 -0
  473. data/fastlane_core/lib/fastlane_core/ipa_upload_package_builder.rb +53 -0
  474. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +983 -0
  475. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +128 -0
  476. data/fastlane_core/lib/fastlane_core/languages.rb +16 -0
  477. data/fastlane_core/lib/fastlane_core/module.rb +31 -0
  478. data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +56 -0
  479. data/fastlane_core/lib/fastlane_core/pkg_upload_package_builder.rb +49 -0
  480. data/fastlane_core/lib/fastlane_core/print_table.rb +133 -0
  481. data/fastlane_core/lib/fastlane_core/project.rb +546 -0
  482. data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +126 -0
  483. data/fastlane_core/lib/fastlane_core/queue_worker.rb +49 -0
  484. data/fastlane_core/lib/fastlane_core/string_filters.rb +51 -0
  485. data/fastlane_core/lib/fastlane_core/swag.rb +85 -0
  486. data/fastlane_core/lib/fastlane_core/tag_version.rb +31 -0
  487. data/fastlane_core/lib/fastlane_core/test_parser.rb +107 -0
  488. data/fastlane_core/lib/fastlane_core/ui/disable_colors.rb +26 -0
  489. data/fastlane_core/lib/fastlane_core/ui/errors/fastlane_common_error.rb +19 -0
  490. data/fastlane_core/lib/fastlane_core/ui/errors/fastlane_crash.rb +11 -0
  491. data/fastlane_core/lib/fastlane_core/ui/errors/fastlane_error.rb +25 -0
  492. data/fastlane_core/lib/fastlane_core/ui/errors/fastlane_exception.rb +19 -0
  493. data/fastlane_core/lib/fastlane_core/ui/errors/fastlane_shell_error.rb +11 -0
  494. data/fastlane_core/lib/fastlane_core/ui/errors.rb +1 -0
  495. data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +342 -0
  496. data/fastlane_core/lib/fastlane_core/ui/github_issue_inspector_reporter.rb +62 -0
  497. data/fastlane_core/lib/fastlane_core/ui/help.erb +35 -0
  498. data/fastlane_core/lib/fastlane_core/ui/help_formatter.rb +16 -0
  499. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +175 -0
  500. data/fastlane_core/lib/fastlane_core/ui/interface.rb +205 -0
  501. data/fastlane_core/lib/fastlane_core/ui/ui.rb +26 -0
  502. data/fastlane_core/lib/fastlane_core/update_checker/changelog.rb +37 -0
  503. data/fastlane_core/lib/fastlane_core/update_checker/update_checker.rb +109 -0
  504. data/fastlane_core/lib/fastlane_core.rb +48 -0
  505. data/frameit/README.md +17 -0
  506. data/frameit/lib/assets/empty.png +0 -0
  507. data/frameit/lib/frameit/commands_generator.rb +141 -0
  508. data/frameit/lib/frameit/config_parser.rb +136 -0
  509. data/frameit/lib/frameit/dependency_checker.rb +22 -0
  510. data/frameit/lib/frameit/device.rb +90 -0
  511. data/frameit/lib/frameit/device_types.rb +159 -0
  512. data/frameit/lib/frameit/editor.rb +558 -0
  513. data/frameit/lib/frameit/frame_downloader.rb +86 -0
  514. data/frameit/lib/frameit/mac_editor.rb +35 -0
  515. data/frameit/lib/frameit/module.rb +42 -0
  516. data/frameit/lib/frameit/offsets.rb +28 -0
  517. data/frameit/lib/frameit/options.rb +112 -0
  518. data/frameit/lib/frameit/runner.rb +97 -0
  519. data/frameit/lib/frameit/screenshot.rb +134 -0
  520. data/frameit/lib/frameit/strings_parser.rb +46 -0
  521. data/frameit/lib/frameit/template_finder.rb +45 -0
  522. data/frameit/lib/frameit/trim_box.rb +41 -0
  523. data/frameit/lib/frameit.rb +13 -0
  524. data/gym/README.md +17 -0
  525. data/gym/lib/assets/GymfileTemplate +13 -0
  526. data/gym/lib/assets/GymfileTemplate.swift +13 -0
  527. data/gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh +61 -0
  528. data/gym/lib/gym/code_signing_mapping.rb +210 -0
  529. data/gym/lib/gym/commands_generator.rb +79 -0
  530. data/gym/lib/gym/detect_values.rb +206 -0
  531. data/gym/lib/gym/error_handler.rb +314 -0
  532. data/gym/lib/gym/generators/README.md +1 -0
  533. data/gym/lib/gym/generators/build_command_generator.rb +197 -0
  534. data/gym/lib/gym/generators/package_command_generator.rb +72 -0
  535. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +238 -0
  536. data/gym/lib/gym/manager.rb +22 -0
  537. data/gym/lib/gym/module.rb +74 -0
  538. data/gym/lib/gym/options.rb +327 -0
  539. data/gym/lib/gym/runner.rb +376 -0
  540. data/gym/lib/gym/xcode.rb +27 -0
  541. data/gym/lib/gym/xcodebuild_fixes/README.md +9 -0
  542. data/gym/lib/gym/xcodebuild_fixes/generic_archive_fix.rb +35 -0
  543. data/gym/lib/gym.rb +9 -0
  544. data/match/README.md +17 -0
  545. data/match/lib/assets/MatchfileTemplate +11 -0
  546. data/match/lib/assets/MatchfileTemplate.swift +9 -0
  547. data/match/lib/assets/READMETemplate.md +59 -0
  548. data/match/lib/match/change_password.rb +55 -0
  549. data/match/lib/match/commands_generator.rb +192 -0
  550. data/match/lib/match/encryption/interface.rb +17 -0
  551. data/match/lib/match/encryption/openssl.rb +163 -0
  552. data/match/lib/match/encryption.rb +52 -0
  553. data/match/lib/match/generator.rb +124 -0
  554. data/match/lib/match/importer.rb +165 -0
  555. data/match/lib/match/migrate.rb +109 -0
  556. data/match/lib/match/module.rb +85 -0
  557. data/match/lib/match/nuke.rb +421 -0
  558. data/match/lib/match/options.rb +347 -0
  559. data/match/lib/match/runner.rb +472 -0
  560. data/match/lib/match/setup.rb +40 -0
  561. data/match/lib/match/spaceship_ensure.rb +103 -0
  562. data/match/lib/match/storage/git_storage.rb +254 -0
  563. data/match/lib/match/storage/gitlab/client.rb +102 -0
  564. data/match/lib/match/storage/gitlab/secure_file.rb +65 -0
  565. data/match/lib/match/storage/gitlab_secure_files.rb +182 -0
  566. data/match/lib/match/storage/google_cloud_storage.rb +383 -0
  567. data/match/lib/match/storage/interface.rb +119 -0
  568. data/match/lib/match/storage/s3_storage.rb +205 -0
  569. data/match/lib/match/storage.rb +50 -0
  570. data/match/lib/match/table_printer.rb +52 -0
  571. data/match/lib/match/utils.rb +88 -0
  572. data/match/lib/match.rb +14 -0
  573. data/pem/README.md +17 -0
  574. data/pem/lib/pem/commands_generator.rb +48 -0
  575. data/pem/lib/pem/manager.rb +136 -0
  576. data/pem/lib/pem/module.rb +19 -0
  577. data/pem/lib/pem/options.rb +112 -0
  578. data/pem/lib/pem.rb +4 -0
  579. data/pilot/README.md +17 -0
  580. data/pilot/lib/pilot/build_manager.rb +602 -0
  581. data/pilot/lib/pilot/commands_generator.rb +175 -0
  582. data/pilot/lib/pilot/manager.rb +95 -0
  583. data/pilot/lib/pilot/module.rb +11 -0
  584. data/pilot/lib/pilot/options.rb +336 -0
  585. data/pilot/lib/pilot/tester_exporter.rb +57 -0
  586. data/pilot/lib/pilot/tester_importer.rb +53 -0
  587. data/pilot/lib/pilot/tester_manager.rb +167 -0
  588. data/pilot/lib/pilot.rb +8 -0
  589. data/precheck/README.md +17 -0
  590. data/precheck/lib/assets/PrecheckfileTemplate +27 -0
  591. data/precheck/lib/assets/PrecheckfileTemplate.swift +19 -0
  592. data/precheck/lib/precheck/commands_generator.rb +75 -0
  593. data/precheck/lib/precheck/item_to_check.rb +58 -0
  594. data/precheck/lib/precheck/module.rb +23 -0
  595. data/precheck/lib/precheck/options.rb +110 -0
  596. data/precheck/lib/precheck/rule.rb +171 -0
  597. data/precheck/lib/precheck/rule_check_result.rb +19 -0
  598. data/precheck/lib/precheck/rule_processor.rb +265 -0
  599. data/precheck/lib/precheck/rules/abstract_text_match_rule.rb +80 -0
  600. data/precheck/lib/precheck/rules/all.rb +1 -0
  601. data/precheck/lib/precheck/rules/copyright_date_rule.rb +37 -0
  602. data/precheck/lib/precheck/rules/curse_words_rule.rb +62 -0
  603. data/precheck/lib/precheck/rules/custom_text_rule.rb +35 -0
  604. data/precheck/lib/precheck/rules/free_stuff_iap_rule.rb +31 -0
  605. data/precheck/lib/precheck/rules/future_functionality_rule.rb +33 -0
  606. data/precheck/lib/precheck/rules/negative_apple_sentiment_rule.rb +37 -0
  607. data/precheck/lib/precheck/rules/other_platforms_rule.rb +43 -0
  608. data/precheck/lib/precheck/rules/placeholder_words_rule.rb +31 -0
  609. data/precheck/lib/precheck/rules/rules_data/curse_word_hashes/en_us.txt +349 -0
  610. data/precheck/lib/precheck/rules/test_words_rule.rb +30 -0
  611. data/precheck/lib/precheck/rules/unreachable_urls_rule.rb +47 -0
  612. data/precheck/lib/precheck/runner.rb +202 -0
  613. data/precheck/lib/precheck.rb +3 -0
  614. data/produce/README.md +17 -0
  615. data/produce/lib/produce/available_default_languages.rb +51 -0
  616. data/produce/lib/produce/cloud_container.rb +82 -0
  617. data/produce/lib/produce/commands_generator.rb +337 -0
  618. data/produce/lib/produce/developer_center.rb +181 -0
  619. data/produce/lib/produce/group.rb +90 -0
  620. data/produce/lib/produce/itunes_connect.rb +139 -0
  621. data/produce/lib/produce/manager.rb +15 -0
  622. data/produce/lib/produce/merchant.rb +121 -0
  623. data/produce/lib/produce/module.rb +14 -0
  624. data/produce/lib/produce/options.rb +184 -0
  625. data/produce/lib/produce/service.rb +425 -0
  626. data/produce/lib/produce.rb +6 -0
  627. data/scan/README.md +17 -0
  628. data/scan/lib/assets/ScanfileTemplate +16 -0
  629. data/scan/lib/assets/ScanfileTemplate.swift +13 -0
  630. data/scan/lib/scan/commands_generator.rb +79 -0
  631. data/scan/lib/scan/detect_values.rb +244 -0
  632. data/scan/lib/scan/error_handler.rb +66 -0
  633. data/scan/lib/scan/manager.rb +38 -0
  634. data/scan/lib/scan/module.rb +37 -0
  635. data/scan/lib/scan/options.rb +541 -0
  636. data/scan/lib/scan/runner.rb +428 -0
  637. data/scan/lib/scan/slack_poster.rb +63 -0
  638. data/scan/lib/scan/test_command_generator.rb +262 -0
  639. data/scan/lib/scan/test_result_parser.rb +33 -0
  640. data/scan/lib/scan/xcpretty_reporter_options_generator.rb +85 -0
  641. data/scan/lib/scan.rb +10 -0
  642. data/screengrab/README.md +17 -0
  643. data/screengrab/lib/assets/ScreengrabfileTemplate +15 -0
  644. data/screengrab/lib/assets/ScreengrabfileTemplate.swift +15 -0
  645. data/screengrab/lib/screengrab/android_environment.rb +43 -0
  646. data/screengrab/lib/screengrab/commands_generator.rb +71 -0
  647. data/screengrab/lib/screengrab/dependency_checker.rb +38 -0
  648. data/screengrab/lib/screengrab/detect_values.rb +16 -0
  649. data/screengrab/lib/screengrab/module.rb +26 -0
  650. data/screengrab/lib/screengrab/options.rb +151 -0
  651. data/screengrab/lib/screengrab/page.html.erb +190 -0
  652. data/screengrab/lib/screengrab/reports_generator.rb +36 -0
  653. data/screengrab/lib/screengrab/runner.rb +452 -0
  654. data/screengrab/lib/screengrab/setup.rb +24 -0
  655. data/screengrab/lib/screengrab.rb +7 -0
  656. data/sigh/README.md +17 -0
  657. data/sigh/lib/assets/resign.sh +932 -0
  658. data/sigh/lib/sigh/commands_generator.rb +155 -0
  659. data/sigh/lib/sigh/download_all.rb +120 -0
  660. data/sigh/lib/sigh/local_manage.rb +145 -0
  661. data/sigh/lib/sigh/manager.rb +47 -0
  662. data/sigh/lib/sigh/module.rb +44 -0
  663. data/sigh/lib/sigh/options.rb +199 -0
  664. data/sigh/lib/sigh/repair.rb +34 -0
  665. data/sigh/lib/sigh/resign.rb +220 -0
  666. data/sigh/lib/sigh/runner.rb +412 -0
  667. data/sigh/lib/sigh.rb +4 -0
  668. data/snapshot/README.md +17 -0
  669. data/snapshot/lib/assets/SnapfileTemplate +38 -0
  670. data/snapshot/lib/assets/SnapfileTemplate.swift +42 -0
  671. data/snapshot/lib/assets/SnapshotHelper.swift +309 -0
  672. data/snapshot/lib/assets/SnapshotHelperXcode8.swift +172 -0
  673. data/snapshot/lib/snapshot/collector.rb +140 -0
  674. data/snapshot/lib/snapshot/commands_generator.rb +117 -0
  675. data/snapshot/lib/snapshot/dependency_checker.rb +69 -0
  676. data/snapshot/lib/snapshot/detect_values.rb +86 -0
  677. data/snapshot/lib/snapshot/error_handler.rb +24 -0
  678. data/snapshot/lib/snapshot/fixes/README.md +5 -0
  679. data/snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb +27 -0
  680. data/snapshot/lib/snapshot/fixes/simulator_shared_pasteboard.rb +16 -0
  681. data/snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb +27 -0
  682. data/snapshot/lib/snapshot/latest_os_version.rb +34 -0
  683. data/snapshot/lib/snapshot/module.rb +44 -0
  684. data/snapshot/lib/snapshot/options.rb +326 -0
  685. data/snapshot/lib/snapshot/page.html.erb +285 -0
  686. data/snapshot/lib/snapshot/reports_generator.rb +154 -0
  687. data/snapshot/lib/snapshot/reset_simulators.rb +122 -0
  688. data/snapshot/lib/snapshot/runner.rb +146 -0
  689. data/snapshot/lib/snapshot/screenshot_flatten.rb +20 -0
  690. data/snapshot/lib/snapshot/screenshot_rotate.rb +36 -0
  691. data/snapshot/lib/snapshot/setup.rb +58 -0
  692. data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +64 -0
  693. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb +219 -0
  694. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +220 -0
  695. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_xcode_8.rb +113 -0
  696. data/snapshot/lib/snapshot/test_command_generator.rb +157 -0
  697. data/snapshot/lib/snapshot/test_command_generator_base.rb +130 -0
  698. data/snapshot/lib/snapshot/test_command_generator_xcode_8.rb +70 -0
  699. data/snapshot/lib/snapshot/update.rb +38 -0
  700. data/snapshot/lib/snapshot.rb +19 -0
  701. data/spaceship/README.md +173 -0
  702. data/spaceship/lib/assets/displayFamilies.json +181 -0
  703. data/spaceship/lib/assets/languageMapping.json +306 -0
  704. data/spaceship/lib/assets/languageMappingReadable.json +30 -0
  705. data/spaceship/lib/spaceship/base.rb +310 -0
  706. data/spaceship/lib/spaceship/client.rb +988 -0
  707. data/spaceship/lib/spaceship/commands_generator.rb +55 -0
  708. data/spaceship/lib/spaceship/connect_api/api_client.rb +356 -0
  709. data/spaceship/lib/spaceship/connect_api/client.rb +216 -0
  710. data/spaceship/lib/spaceship/connect_api/file_uploader.rb +99 -0
  711. data/spaceship/lib/spaceship/connect_api/model.rb +172 -0
  712. data/spaceship/lib/spaceship/connect_api/models/actor.rb +26 -0
  713. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +147 -0
  714. data/spaceship/lib/spaceship/connect_api/models/app.rb +482 -0
  715. data/spaceship/lib/spaceship/connect_api/models/app_category.rb +94 -0
  716. data/spaceship/lib/spaceship/connect_api/models/app_data_usage.rb +59 -0
  717. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_category.rb +65 -0
  718. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_data_protection.rb +27 -0
  719. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_grouping.rb +18 -0
  720. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_purposes.rb +37 -0
  721. data/spaceship/lib/spaceship/connect_api/models/app_data_usages_publish_state.rb +36 -0
  722. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +112 -0
  723. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +48 -0
  724. data/spaceship/lib/spaceship/connect_api/models/app_preview.rb +135 -0
  725. data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +109 -0
  726. data/spaceship/lib/spaceship/connect_api/models/app_price.rb +22 -0
  727. data/spaceship/lib/spaceship/connect_api/models/app_price_point.rb +26 -0
  728. data/spaceship/lib/spaceship/connect_api/models/app_price_tier.rb +12 -0
  729. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +189 -0
  730. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +169 -0
  731. data/spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb +73 -0
  732. data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +53 -0
  733. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +241 -0
  734. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +115 -0
  735. data/spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb +57 -0
  736. data/spaceship/lib/spaceship/connect_api/models/app_store_version_release_request.rb +12 -0
  737. data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +27 -0
  738. data/spaceship/lib/spaceship/connect_api/models/beta_app_localization.rb +28 -0
  739. data/spaceship/lib/spaceship/connect_api/models/beta_app_review_detail.rb +32 -0
  740. data/spaceship/lib/spaceship/connect_api/models/beta_app_review_submission.rb +27 -0
  741. data/spaceship/lib/spaceship/connect_api/models/beta_build_localization.rb +20 -0
  742. data/spaceship/lib/spaceship/connect_api/models/beta_build_metric.rb +24 -0
  743. data/spaceship/lib/spaceship/connect_api/models/beta_feedback.rb +77 -0
  744. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +67 -0
  745. data/spaceship/lib/spaceship/connect_api/models/beta_screenshot.rb +18 -0
  746. data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +63 -0
  747. data/spaceship/lib/spaceship/connect_api/models/beta_tester_metric.rb +44 -0
  748. data/spaceship/lib/spaceship/connect_api/models/build.rb +195 -0
  749. data/spaceship/lib/spaceship/connect_api/models/build_beta_detail.rb +69 -0
  750. data/spaceship/lib/spaceship/connect_api/models/build_bundle.rb +68 -0
  751. data/spaceship/lib/spaceship/connect_api/models/build_bundle_file_sizes.rb +34 -0
  752. data/spaceship/lib/spaceship/connect_api/models/build_delivery.rb +38 -0
  753. data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +93 -0
  754. data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +136 -0
  755. data/spaceship/lib/spaceship/connect_api/models/capabilities.rb +27 -0
  756. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +110 -0
  757. data/spaceship/lib/spaceship/connect_api/models/custom_app_organization.rb +43 -0
  758. data/spaceship/lib/spaceship/connect_api/models/custom_app_user.rb +41 -0
  759. data/spaceship/lib/spaceship/connect_api/models/device.rb +133 -0
  760. data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +43 -0
  761. data/spaceship/lib/spaceship/connect_api/models/pre_release_version.rb +20 -0
  762. data/spaceship/lib/spaceship/connect_api/models/profile.rb +111 -0
  763. data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +27 -0
  764. data/spaceship/lib/spaceship/connect_api/models/resolution_center_message.rb +29 -0
  765. data/spaceship/lib/spaceship/connect_api/models/resolution_center_thread.rb +67 -0
  766. data/spaceship/lib/spaceship/connect_api/models/review_rejection.rb +19 -0
  767. data/spaceship/lib/spaceship/connect_api/models/review_submission.rb +86 -0
  768. data/spaceship/lib/spaceship/connect_api/models/review_submission_item.rb +40 -0
  769. data/spaceship/lib/spaceship/connect_api/models/sandbox_tester.rb +67 -0
  770. data/spaceship/lib/spaceship/connect_api/models/territory.rb +28 -0
  771. data/spaceship/lib/spaceship/connect_api/models/user.rb +72 -0
  772. data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +96 -0
  773. data/spaceship/lib/spaceship/connect_api/provisioning/client.rb +92 -0
  774. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +264 -0
  775. data/spaceship/lib/spaceship/connect_api/response.rb +86 -0
  776. data/spaceship/lib/spaceship/connect_api/spaceship.rb +102 -0
  777. data/spaceship/lib/spaceship/connect_api/testflight/client.rb +27 -0
  778. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +513 -0
  779. data/spaceship/lib/spaceship/connect_api/token.rb +120 -0
  780. data/spaceship/lib/spaceship/connect_api/token_refresh_middleware.rb +24 -0
  781. data/spaceship/lib/spaceship/connect_api/tunes/client.rb +27 -0
  782. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +1281 -0
  783. data/spaceship/lib/spaceship/connect_api/users/client.rb +27 -0
  784. data/spaceship/lib/spaceship/connect_api/users/users.rb +135 -0
  785. data/spaceship/lib/spaceship/connect_api.rb +132 -0
  786. data/spaceship/lib/spaceship/du/du_client.rb +138 -0
  787. data/spaceship/lib/spaceship/du/upload_file.rb +58 -0
  788. data/spaceship/lib/spaceship/du/utilities.rb +99 -0
  789. data/spaceship/lib/spaceship/errors.rb +135 -0
  790. data/spaceship/lib/spaceship/globals.rb +21 -0
  791. data/spaceship/lib/spaceship/hashcash.rb +52 -0
  792. data/spaceship/lib/spaceship/helper/net_http_generic_request.rb +20 -0
  793. data/spaceship/lib/spaceship/helper/plist_middleware.rb +16 -0
  794. data/spaceship/lib/spaceship/helper/rels_middleware.rb +28 -0
  795. data/spaceship/lib/spaceship/launcher.rb +99 -0
  796. data/spaceship/lib/spaceship/module.rb +8 -0
  797. data/spaceship/lib/spaceship/playground.rb +75 -0
  798. data/spaceship/lib/spaceship/portal/app.rb +201 -0
  799. data/spaceship/lib/spaceship/portal/app_group.rb +73 -0
  800. data/spaceship/lib/spaceship/portal/app_service.rb +87 -0
  801. data/spaceship/lib/spaceship/portal/certificate.rb +366 -0
  802. data/spaceship/lib/spaceship/portal/cloud_container.rb +74 -0
  803. data/spaceship/lib/spaceship/portal/device.rb +191 -0
  804. data/spaceship/lib/spaceship/portal/invite.rb +53 -0
  805. data/spaceship/lib/spaceship/portal/key.rb +101 -0
  806. data/spaceship/lib/spaceship/portal/legacy_wrapper.rb +21 -0
  807. data/spaceship/lib/spaceship/portal/merchant.rb +86 -0
  808. data/spaceship/lib/spaceship/portal/passbook.rb +78 -0
  809. data/spaceship/lib/spaceship/portal/person.rb +62 -0
  810. data/spaceship/lib/spaceship/portal/persons.rb +67 -0
  811. data/spaceship/lib/spaceship/portal/portal.rb +17 -0
  812. data/spaceship/lib/spaceship/portal/portal_base.rb +16 -0
  813. data/spaceship/lib/spaceship/portal/portal_client.rb +862 -0
  814. data/spaceship/lib/spaceship/portal/provisioning_profile.rb +559 -0
  815. data/spaceship/lib/spaceship/portal/provisioning_profile_template.rb +52 -0
  816. data/spaceship/lib/spaceship/portal/spaceship.rb +154 -0
  817. data/spaceship/lib/spaceship/portal/ui/select_team.rb +116 -0
  818. data/spaceship/lib/spaceship/portal/website_push.rb +88 -0
  819. data/spaceship/lib/spaceship/provider.rb +13 -0
  820. data/spaceship/lib/spaceship/spaceauth_runner.rb +97 -0
  821. data/spaceship/lib/spaceship/stats_middleware.rb +65 -0
  822. data/spaceship/lib/spaceship/test_flight/app_test_info.rb +40 -0
  823. data/spaceship/lib/spaceship/test_flight/base.rb +39 -0
  824. data/spaceship/lib/spaceship/test_flight/beta_review_info.rb +19 -0
  825. data/spaceship/lib/spaceship/test_flight/build.rb +242 -0
  826. data/spaceship/lib/spaceship/test_flight/build_trains.rb +50 -0
  827. data/spaceship/lib/spaceship/test_flight/client.rb +361 -0
  828. data/spaceship/lib/spaceship/test_flight/export_compliance.rb +12 -0
  829. data/spaceship/lib/spaceship/test_flight/group.rb +131 -0
  830. data/spaceship/lib/spaceship/test_flight/test_info.rb +56 -0
  831. data/spaceship/lib/spaceship/test_flight/tester.rb +136 -0
  832. data/spaceship/lib/spaceship/test_flight.rb +10 -0
  833. data/spaceship/lib/spaceship/tunes/app_analytics.rb +168 -0
  834. data/spaceship/lib/spaceship/tunes/app_details.rb +147 -0
  835. data/spaceship/lib/spaceship/tunes/app_image.rb +51 -0
  836. data/spaceship/lib/spaceship/tunes/app_ratings.rb +58 -0
  837. data/spaceship/lib/spaceship/tunes/app_review.rb +55 -0
  838. data/spaceship/lib/spaceship/tunes/app_review_attachment.rb +49 -0
  839. data/spaceship/lib/spaceship/tunes/app_screenshot.rb +12 -0
  840. data/spaceship/lib/spaceship/tunes/app_status.rb +63 -0
  841. data/spaceship/lib/spaceship/tunes/app_submission.rb +161 -0
  842. data/spaceship/lib/spaceship/tunes/app_trailer.rb +64 -0
  843. data/spaceship/lib/spaceship/tunes/app_version.rb +970 -0
  844. data/spaceship/lib/spaceship/tunes/app_version_common.rb +35 -0
  845. data/spaceship/lib/spaceship/tunes/app_version_generated_promocodes.rb +28 -0
  846. data/spaceship/lib/spaceship/tunes/app_version_history.rb +52 -0
  847. data/spaceship/lib/spaceship/tunes/app_version_promocodes.rb +27 -0
  848. data/spaceship/lib/spaceship/tunes/app_version_ref.rb +15 -0
  849. data/spaceship/lib/spaceship/tunes/app_version_states_history.rb +27 -0
  850. data/spaceship/lib/spaceship/tunes/application.rb +453 -0
  851. data/spaceship/lib/spaceship/tunes/availability.rb +164 -0
  852. data/spaceship/lib/spaceship/tunes/b2b_organization.rb +50 -0
  853. data/spaceship/lib/spaceship/tunes/b2b_user.rb +30 -0
  854. data/spaceship/lib/spaceship/tunes/build.rb +263 -0
  855. data/spaceship/lib/spaceship/tunes/build_details.rb +184 -0
  856. data/spaceship/lib/spaceship/tunes/build_train.rb +181 -0
  857. data/spaceship/lib/spaceship/tunes/developer_response.rb +23 -0
  858. data/spaceship/lib/spaceship/tunes/device_type.rb +17 -0
  859. data/spaceship/lib/spaceship/tunes/display_family.rb +84 -0
  860. data/spaceship/lib/spaceship/tunes/errors.rb +17 -0
  861. data/spaceship/lib/spaceship/tunes/iap.rb +168 -0
  862. data/spaceship/lib/spaceship/tunes/iap_detail.rb +264 -0
  863. data/spaceship/lib/spaceship/tunes/iap_families.rb +68 -0
  864. data/spaceship/lib/spaceship/tunes/iap_family_details.rb +90 -0
  865. data/spaceship/lib/spaceship/tunes/iap_family_list.rb +28 -0
  866. data/spaceship/lib/spaceship/tunes/iap_list.rb +76 -0
  867. data/spaceship/lib/spaceship/tunes/iap_status.rb +56 -0
  868. data/spaceship/lib/spaceship/tunes/iap_subscription_pricing_info.rb +46 -0
  869. data/spaceship/lib/spaceship/tunes/iap_subscription_pricing_tier.rb +25 -0
  870. data/spaceship/lib/spaceship/tunes/iap_type.rb +45 -0
  871. data/spaceship/lib/spaceship/tunes/language_converter.rb +65 -0
  872. data/spaceship/lib/spaceship/tunes/language_item.rb +61 -0
  873. data/spaceship/lib/spaceship/tunes/legacy_wrapper.rb +13 -0
  874. data/spaceship/lib/spaceship/tunes/member.rb +84 -0
  875. data/spaceship/lib/spaceship/tunes/members.rb +35 -0
  876. data/spaceship/lib/spaceship/tunes/pricing_info.rb +42 -0
  877. data/spaceship/lib/spaceship/tunes/pricing_tier.rb +25 -0
  878. data/spaceship/lib/spaceship/tunes/sandbox_tester.rb +74 -0
  879. data/spaceship/lib/spaceship/tunes/spaceship.rb +39 -0
  880. data/spaceship/lib/spaceship/tunes/territory.rb +39 -0
  881. data/spaceship/lib/spaceship/tunes/transit_app_file.rb +23 -0
  882. data/spaceship/lib/spaceship/tunes/tunes.rb +34 -0
  883. data/spaceship/lib/spaceship/tunes/tunes_base.rb +17 -0
  884. data/spaceship/lib/spaceship/tunes/tunes_client.rb +1705 -0
  885. data/spaceship/lib/spaceship/tunes/version_set.rb +26 -0
  886. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +380 -0
  887. data/spaceship/lib/spaceship/ui.rb +27 -0
  888. data/spaceship/lib/spaceship/upgrade_2fa_later_client.rb +91 -0
  889. data/spaceship/lib/spaceship.rb +31 -0
  890. data/supply/README.md +17 -0
  891. data/supply/lib/supply/apk_listing.rb +14 -0
  892. data/supply/lib/supply/client.rb +587 -0
  893. data/supply/lib/supply/commands_generator.rb +68 -0
  894. data/supply/lib/supply/languages.rb +88 -0
  895. data/supply/lib/supply/listing.rb +32 -0
  896. data/supply/lib/supply/options.rb +344 -0
  897. data/supply/lib/supply/reader.rb +41 -0
  898. data/supply/lib/supply/release_listing.rb +18 -0
  899. data/supply/lib/supply/setup.rb +122 -0
  900. data/supply/lib/supply/uploader.rb +489 -0
  901. data/supply/lib/supply.rb +53 -0
  902. data/trainer/lib/assets/junit.xml.erb +28 -0
  903. data/trainer/lib/trainer/commands_generator.rb +51 -0
  904. data/trainer/lib/trainer/junit_generator.rb +31 -0
  905. data/trainer/lib/trainer/module.rb +10 -0
  906. data/trainer/lib/trainer/options.rb +66 -0
  907. data/trainer/lib/trainer/test_parser.rb +398 -0
  908. data/trainer/lib/trainer/xcresult.rb +403 -0
  909. data/trainer/lib/trainer.rb +7 -0
  910. metadata +1909 -0
@@ -0,0 +1,1705 @@
1
+ require "securerandom"
2
+ require_relative '../client'
3
+ require_relative '../du/du_client'
4
+ require_relative '../du/upload_file'
5
+ require_relative 'app_version_common'
6
+ require_relative 'app_version_ref'
7
+ require_relative 'availability'
8
+ require_relative 'errors'
9
+ require_relative 'iap_subscription_pricing_tier'
10
+ require_relative 'pricing_tier'
11
+ require_relative 'territory'
12
+ require_relative '../connect_api/response'
13
+ module Spaceship
14
+ # rubocop:disable Metrics/ClassLength
15
+ class TunesClient < Spaceship::Client
16
+ # Legacy support
17
+ ITunesConnectError = Tunes::Error
18
+ ITunesConnectTemporaryError = Tunes::TemporaryError
19
+ ITunesConnectPotentialServerError = Tunes::PotentialServerError
20
+
21
+ attr_reader :du_client
22
+
23
+ def initialize
24
+ super
25
+
26
+ @du_client = DUClient.new
27
+
28
+ # Used by most WebObjects requests starting in July 2021
29
+ @additional_headers = { 'x-csrf-itc': 'itc' }
30
+ end
31
+
32
+ class << self
33
+ # trailer preview screenshots are required to have a specific size
34
+ def video_preview_resolution_for(device, is_portrait)
35
+ resolutions = {
36
+ 'iphone4' => [1136, 640],
37
+ 'iphone6' => [1334, 750],
38
+ 'iphone6Plus' => [2208, 1242],
39
+ 'iphone58' => [2436, 1125],
40
+ 'iphone65' => [2688, 1242],
41
+ 'ipad' => [1024, 768],
42
+ 'ipad105' => [2224, 1668],
43
+ 'ipadPro' => [2732, 2048],
44
+ 'ipadPro11' => [2388, 1668],
45
+ 'ipadPro129' => [2732, 2048]
46
+ }
47
+
48
+ r = resolutions[device]
49
+ r = [r[1], r[0]] if is_portrait
50
+ r
51
+ end
52
+ end
53
+
54
+ #####################################################
55
+ # @!group Init and Login
56
+ #####################################################
57
+
58
+ def self.hostname
59
+ "https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/"
60
+ end
61
+
62
+ # Shows a team selection for the user in the terminal. This should not be
63
+ # called on CI systems
64
+ #
65
+ # @param team_id (String) (optional): The ID of an App Store Connect team
66
+ # @param team_name (String) (optional): The name of an App Store Connect team
67
+ def select_team(team_id: nil, team_name: nil)
68
+ t_id = (team_id || ENV['FASTLANE_ITC_TEAM_ID'] || '').strip
69
+ t_name = (team_name || ENV['FASTLANE_ITC_TEAM_NAME'] || '').strip
70
+
71
+ if t_name.length > 0 && t_id.length.zero? # we prefer IDs over names, they are unique
72
+ puts("Looking for App Store Connect Team with name #{t_name}") if Spaceship::Globals.verbose?
73
+
74
+ teams.each do |t|
75
+ t_id = t['providerId'].to_s if t['name'].casecmp(t_name).zero?
76
+ end
77
+
78
+ puts("Could not find team with name '#{t_name}', trying to fallback to default team") if t_id.length.zero?
79
+ end
80
+
81
+ t_id = teams.first['providerId'].to_s if teams.count == 1
82
+
83
+ if t_id.length > 0
84
+ puts("Looking for App Store Connect Team with ID #{t_id}") if Spaceship::Globals.verbose?
85
+
86
+ # actually set the team id here
87
+ self.team_id = t_id
88
+ return self.team_id
89
+ end
90
+
91
+ # user didn't specify a team... #thisiswhywecanthavenicethings
92
+ loop do
93
+ puts("Multiple #{'App Store Connect teams'.yellow} found, please enter the number of the team you want to use: ")
94
+ if ENV["FASTLANE_HIDE_TEAM_INFORMATION"].to_s.length == 0
95
+ first_team = teams.first
96
+ puts("Note: to automatically choose the team, provide either the App Store Connect Team ID, or the Team Name in your fastlane/Appfile:")
97
+ puts("Alternatively you can pass the team name or team ID using the `FASTLANE_ITC_TEAM_ID` or `FASTLANE_ITC_TEAM_NAME` environment variable")
98
+ puts("")
99
+ puts(" itc_team_id \"#{first_team['providerId']}\"")
100
+ puts("")
101
+ puts("or")
102
+ puts("")
103
+ puts(" itc_team_name \"#{first_team['name']}\"")
104
+ puts("")
105
+ end
106
+
107
+ # We're not using highline here, as spaceship doesn't have a dependency to fastlane_core or highline
108
+ teams.each_with_index do |team, i|
109
+ puts("#{i + 1}) \"#{team['name']}\" (#{team['providerId']})")
110
+ end
111
+
112
+ unless Spaceship::Client::UserInterface.interactive?
113
+ puts("Multiple teams found on App Store Connect, Your Terminal is running in non-interactive mode! Cannot continue from here.")
114
+ puts("Please check that you set FASTLANE_ITC_TEAM_ID or FASTLANE_ITC_TEAM_NAME to the right value.")
115
+ raise "Multiple App Store Connect Teams found; unable to choose, terminal not interactive!"
116
+ end
117
+
118
+ selected = ($stdin.gets || '').strip.to_i - 1
119
+ team_to_use = teams[selected] if selected >= 0
120
+
121
+ if team_to_use
122
+ self.team_id = team_to_use['providerId'].to_s # actually set the team id here
123
+ return self.team_id
124
+ end
125
+ end
126
+ end
127
+
128
+ def send_login_request(user, password)
129
+ clear_user_cached_data
130
+ result = send_shared_login_request(user, password)
131
+
132
+ store_cookie
133
+
134
+ return result
135
+ end
136
+
137
+ # Sometimes we get errors or info nested in our data
138
+ # This method allows you to pass in a set of keys to check for
139
+ # along with the name of the sub_section of your original data
140
+ # where we should check
141
+ # Returns a mapping of keys to data array if we find anything, otherwise, empty map
142
+ def fetch_errors_in_data(data_section: nil, sub_section_name: nil, keys: nil)
143
+ if data_section && sub_section_name
144
+ sub_section = data_section[sub_section_name]
145
+ else
146
+ sub_section = data_section
147
+ end
148
+
149
+ unless sub_section
150
+ return {}
151
+ end
152
+
153
+ error_map = {}
154
+ keys.each do |key|
155
+ errors = sub_section.fetch(key, [])
156
+ error_map[key] = errors if errors.count > 0
157
+ end
158
+ return error_map
159
+ end
160
+
161
+ # rubocop:disable Metrics/PerceivedComplexity
162
+ # If the response is coming from a flaky api, set flaky_api_call to true so we retry a little.
163
+ # Patience is a virtue.
164
+ def handle_itc_response(raw, flaky_api_call: false)
165
+ return unless raw
166
+ return unless raw.kind_of?(Hash)
167
+
168
+ data = raw['data'] || raw # sometimes it's with data, sometimes it isn't
169
+
170
+ error_keys = ["sectionErrorKeys", "validationErrors", "serviceErrors"]
171
+ info_keys = ["sectionInfoKeys", "sectionWarningKeys"]
172
+ error_and_info_keys_to_check = error_keys + info_keys
173
+
174
+ errors_in_data = fetch_errors_in_data(data_section: data, keys: error_and_info_keys_to_check)
175
+ errors_in_version_info = fetch_errors_in_data(data_section: data, sub_section_name: "versionInfo", keys: error_and_info_keys_to_check)
176
+
177
+ # If we have any errors or "info" we need to treat them as warnings or errors
178
+ if errors_in_data.count == 0 && errors_in_version_info.count == 0
179
+ logger.debug("Request was successful")
180
+ end
181
+
182
+ # We pass on the `current_language` so that the error message tells the user
183
+ # what language the error was caused in
184
+ handle_response_hash = lambda do |hash, current_language = nil|
185
+ errors = []
186
+ if hash.kind_of?(Hash)
187
+ current_language ||= hash["language"]
188
+
189
+ hash.each do |key, value|
190
+ errors += handle_response_hash.call(value, current_language)
191
+
192
+ next unless key == 'errorKeys' && value.kind_of?(Array) && value.count > 0
193
+ # Prepend the error with the language so it's easier to understand for the user
194
+ errors += value.collect do |current_error_message|
195
+ current_language ? "[#{current_language}]: #{current_error_message}" : current_error_message
196
+ end
197
+ end
198
+ elsif hash.kind_of?(Array)
199
+ hash.each do |value|
200
+ errors += handle_response_hash.call(value)
201
+ end
202
+ # else: We don't care about simple values
203
+ end
204
+ return errors
205
+ end
206
+
207
+ errors = handle_response_hash.call(data)
208
+
209
+ # Search at data level, as well as "versionInfo" level for errors
210
+ errors_in_data = fetch_errors_in_data(data_section: data, keys: error_keys)
211
+ errors_in_version_info = fetch_errors_in_data(data_section: data, sub_section_name: "versionInfo", keys: error_keys)
212
+
213
+ errors += errors_in_data.values if errors_in_data.values
214
+ errors += errors_in_version_info.values if errors_in_version_info.values
215
+ errors = errors.flat_map { |value| value }
216
+
217
+ # Sometimes there is a different kind of error in the JSON response
218
+ # e.g. {"warn"=>nil, "error"=>["operation_failed"], "info"=>nil}
219
+ different_error = raw.fetch('messages', {}).fetch('error', nil)
220
+ errors << different_error if different_error
221
+
222
+ if errors.count > 0 # they are separated by `.` by default
223
+ # Sample `error` content: [["Forbidden"]]
224
+ if errors.count == 1 && errors.first == "You haven't made any changes."
225
+ # This is a special error which we really don't care about
226
+ elsif errors.count == 1 && errors.first.include?("try again later")
227
+ raise ITunesConnectTemporaryError.new, errors.first
228
+ elsif errors.count == 1 && errors.first.include?("Forbidden")
229
+ raise_insufficient_permission_error!
230
+ elsif flaky_api_call
231
+ raise ITunesConnectPotentialServerError.new, errors.join(' ')
232
+ else
233
+ raise ITunesConnectError.new, errors.join(' ')
234
+ end
235
+ end
236
+
237
+ # Search at data level, as well as "versionInfo" level for info and warnings
238
+ info_in_data = fetch_errors_in_data(data_section: data, keys: info_keys)
239
+ info_in_version_info = fetch_errors_in_data(data_section: data, sub_section_name: "versionInfo", keys: info_keys)
240
+
241
+ info_in_data.each do |info_key, info_value|
242
+ puts(info_value)
243
+ end
244
+
245
+ info_in_version_info.each do |info_key, info_value|
246
+ puts(info_value)
247
+ end
248
+
249
+ return data
250
+ end
251
+ # rubocop:enable Metrics/PerceivedComplexity
252
+
253
+ #####################################################
254
+ # @!group Applications
255
+ #####################################################
256
+
257
+ def applications
258
+ # Doing this real bad puts for now until a more formal deprecation logic can get made
259
+ puts("Spaceship::Tunes::Application.all is deprecated")
260
+ puts(" It's using a temporary patch to keep it from raising an error but things may not work correctly")
261
+ puts(" Please consider switching to Spaceship::ConnectAPI if you can")
262
+ puts(" For more details - https://github.com/fastlane/fastlane/pull/20480")
263
+
264
+ # This legacy endpoint went offline around July 7th, 2022. This is a rough attempt
265
+ # at retrofitting using the newer App Store Connect API endpoints
266
+ #
267
+ # This could all be done easily with Spaceship::ConnectAPI::App.find but there were a lot of
268
+ # circular dependency issues that were very difficult to solve because. Spaceship::Tunes would be
269
+ # using Spaceship::ConnectAPI which uses Spaceship::Tunes
270
+ #
271
+ # However, using Spaceship::ConnectAPI::Response works. This will fetch multiple pages of app
272
+ # if it needs to
273
+ #
274
+ # https://github.com/fastlane/fastlane/pull/20480
275
+ r = request(:get, "https://appstoreconnect.apple.com/iris/v1/apps?include=appStoreVersions,prices")
276
+ response = Spaceship::ConnectAPI::Response.new(
277
+ body: r.body,
278
+ status: r.status,
279
+ headers: r.headers,
280
+ client: nil
281
+ )
282
+
283
+ apps = response.all_pages do |url|
284
+ r = request(:get, url)
285
+ Spaceship::ConnectAPI::Response.new(
286
+ body: r.body,
287
+ status: r.status,
288
+ headers: r.headers,
289
+ client: nil
290
+ )
291
+ end.flat_map(&:to_models)
292
+
293
+ apps.map do |asc_app|
294
+ platforms = (asc_app.app_store_versions || []).map(&:platform).uniq.map do |asc_platform|
295
+ case asc_platform
296
+ when "TV_OS"
297
+ "appletvos"
298
+ when "MAC_OS"
299
+ "osx"
300
+ when "IOS"
301
+ "ios"
302
+ else
303
+ raise "Cannot find a matching platform for '#{asc_platform}'}"
304
+ end
305
+ end
306
+
307
+ {
308
+ 'adamId' => asc_app.id,
309
+ 'name' => asc_app.name,
310
+ 'vendorId' => "",
311
+ 'bundleId' => asc_app.bundle_id,
312
+ 'lastModifiedDate' => nil,
313
+ 'issuesCount' => nil,
314
+ 'iconUrl' => nil,
315
+ 'versionSets' => platforms.map do |platform|
316
+ { 'type' => 'app', 'platformString' => platform }
317
+ end
318
+ }
319
+ end
320
+ end
321
+
322
+ def app_details(app_id)
323
+ r = request(:get, "ra/apps/#{app_id}/details")
324
+ parse_response(r, 'data')
325
+ end
326
+
327
+ def bundle_details(app_id)
328
+ r = request(:get, "ra/appbundles/metadetail/#{app_id}")
329
+ parse_response(r, 'data')
330
+ end
331
+
332
+ def update_app_details!(app_id, data)
333
+ r = request(:post) do |req|
334
+ req.url("ra/apps/#{app_id}/details")
335
+ req.body = data.to_json
336
+ req.headers['Content-Type'] = 'application/json'
337
+ end
338
+
339
+ handle_itc_response(r.body)
340
+ end
341
+
342
+ # Creates a new application on App Store Connect
343
+ # @param name (String): The name of your app as it will appear on the App Store.
344
+ # This can't be longer than 255 characters.
345
+ # @param primary_language (String): If localized app information isn't available in an
346
+ # App Store territory, the information from your primary language will be used instead.
347
+ # @param version *DEPRECATED: Use `Spaceship::Tunes::Application.ensure_version!` method instead*
348
+ # (String): The version number is shown on the App Store and should match the one you used in Xcode.
349
+ # @param sku (String): A unique ID for your app that is not visible on the App Store.
350
+ # @param bundle_id (String): The bundle ID must match the one you used in Xcode. It
351
+ # can't be changed after you submit your first build.
352
+ def create_application!(name: nil, primary_language: nil, version: nil, sku: nil, bundle_id: nil, bundle_id_suffix: nil, company_name: nil, platform: nil, platforms: nil, itunes_connect_users: nil)
353
+ puts("The `version` parameter is deprecated. Use `Spaceship::Tunes::Application.ensure_version!` method instead") if version
354
+
355
+ # First, we need to fetch the data from Apple, which we then modify with the user's values
356
+ primary_language ||= "English"
357
+ platform ||= "ios"
358
+ r = request(:get, "ra/apps/create/v2/?platformString=#{platform}")
359
+ data = parse_response(r, 'data')
360
+
361
+ # Now fill in the values we have
362
+ # some values are nil, that's why there is a hash
363
+ data['name'] = { value: name }
364
+ data['bundleId'] = { value: bundle_id }
365
+ data['primaryLanguage'] = { value: primary_language }
366
+ data['primaryLocaleCode'] = { value: primary_language.to_itc_locale }
367
+ data['vendorId'] = { value: sku }
368
+ data['bundleIdSuffix'] = { value: bundle_id_suffix }
369
+ data['companyName'] = { value: company_name } if company_name
370
+ data['enabledPlatformsForCreation'] = { value: [platform] }
371
+
372
+ data['initialPlatform'] = platform
373
+ data['enabledPlatformsForCreation'] = { value: platforms || [platform] }
374
+
375
+ unless itunes_connect_users.nil?
376
+ data['iTunesConnectUsers']['grantedAllUsers'] = false
377
+ data['iTunesConnectUsers']['grantedUsers'] = data['iTunesConnectUsers']['availableUsers'].select { |user| itunes_connect_users.include?(user['username']) }
378
+ end
379
+
380
+ # Now send back the modified hash
381
+ r = request(:post) do |req|
382
+ req.url('ra/apps/create/v2')
383
+ req.body = data.to_json
384
+ req.headers['Content-Type'] = 'application/json'
385
+ end
386
+
387
+ data = parse_response(r, 'data')
388
+ handle_itc_response(data)
389
+ end
390
+
391
+ def create_version!(app_id, version_number, platform = 'ios')
392
+ r = request(:post) do |req|
393
+ req.url("ra/apps/#{app_id}/platforms/#{platform}/versions/create/")
394
+ req.body = {
395
+ version: {
396
+ value: version_number.to_s
397
+ }
398
+ }.to_json
399
+ req.headers['Content-Type'] = 'application/json'
400
+ end
401
+
402
+ data = parse_response(r, 'data')
403
+ handle_itc_response(data)
404
+ end
405
+
406
+ def get_available_bundle_ids(platform: nil)
407
+ platform ||= "ios"
408
+ r = request(:get, "ra/apps/create/v2/?platformString=#{platform}")
409
+ data = parse_response(r, 'data')
410
+ return data['bundleIds'].keys
411
+ end
412
+
413
+ def get_resolution_center(app_id, platform)
414
+ r = request(:get, "ra/apps/#{app_id}/platforms/#{platform}/resolutionCenter?v=latest")
415
+ parse_response(r, 'data')
416
+ end
417
+
418
+ def post_resolution_center(app_id, platform, thread_id, version_id, version_number, from, message_body)
419
+ r = request(:post) do |req|
420
+ req.url("ra/apps/#{app_id}/platforms/#{platform}/resolutionCenter")
421
+ req.body = {
422
+ appNotes: {
423
+ threads: [{
424
+ id: thread_id,
425
+ versionId: version_id,
426
+ version: version_number,
427
+ messages: [{
428
+ from: from,
429
+ date: DateTime.now.strftime('%Q'),
430
+ body: message_body,
431
+ tokens: []
432
+ }]
433
+ }]
434
+ }
435
+ }.to_json
436
+ req.headers['Content-Type'] = 'application/json'
437
+ end
438
+
439
+ data = parse_response(r, 'data')
440
+ handle_itc_response(data)
441
+ end
442
+
443
+ def get_ratings(app_id, platform, version_id = '', storefront = '')
444
+ # if storefront or version_id is empty api fails
445
+ rating_url = "ra/apps/#{app_id}/platforms/#{platform}/reviews/summary"
446
+ params = {}
447
+ params['storefront'] = storefront unless storefront.empty?
448
+ params['version_id'] = version_id unless version_id.empty?
449
+
450
+ r = request(:get, rating_url, params)
451
+ parse_response(r, 'data')
452
+ end
453
+
454
+ def get_reviews(app_id, platform, storefront, version_id, upto_date = nil)
455
+ index = 0
456
+ per_page = 100 # apple default
457
+ all_reviews = []
458
+
459
+ upto_date = Time.parse(upto_date) unless upto_date.nil?
460
+
461
+ loop do
462
+ rating_url = "ra/apps/#{app_id}/platforms/#{platform}/reviews?"
463
+ rating_url << "sort=REVIEW_SORT_ORDER_MOST_RECENT"
464
+ rating_url << "&index=#{index}"
465
+ rating_url << "&storefront=#{storefront}" unless storefront.empty?
466
+ rating_url << "&versionId=#{version_id}" unless version_id.empty?
467
+
468
+ r = request(:get, rating_url)
469
+ all_reviews.concat(parse_response(r, 'data')['reviews'])
470
+
471
+ # The following lines throw errors when there are no reviews so exit out of the loop before them if the app has no reviews
472
+ break if all_reviews.count == 0
473
+
474
+ last_review_date = Time.at(all_reviews[-1]['value']['lastModified'] / 1000)
475
+
476
+ if upto_date && last_review_date < upto_date
477
+ all_reviews = all_reviews.select { |review| Time.at(review['value']['lastModified'] / 1000) > upto_date }
478
+ break
479
+ end
480
+
481
+ if all_reviews.count < parse_response(r, 'data')['reviewCount']
482
+ index += per_page
483
+ else
484
+ break
485
+ end
486
+ end
487
+
488
+ all_reviews
489
+ end
490
+
491
+ #####################################################
492
+ # @!group AppVersions
493
+ #####################################################
494
+
495
+ def app_version(app_id, is_live, platform: nil)
496
+ raise "app_id is required" unless app_id
497
+
498
+ # First we need to fetch the IDs for the edit / live version
499
+ r = request(:get, "ra/apps/#{app_id}/overview")
500
+ platforms = parse_response(r, 'data')['platforms']
501
+
502
+ platform = Spaceship::Tunes::AppVersionCommon.find_platform(platforms, search_platform: platform)
503
+ return nil unless platform
504
+
505
+ version_id = Spaceship::Tunes::AppVersionCommon.find_version_id(platform, is_live)
506
+ return nil unless version_id
507
+
508
+ version_platform = platform['platformString']
509
+
510
+ app_version_data(app_id, version_platform: version_platform, version_id: version_id)
511
+ end
512
+
513
+ def app_version_data(app_id, version_platform: nil, version_id: nil)
514
+ raise "app_id is required" unless app_id
515
+ raise "version_platform is required" unless version_platform
516
+ raise "version_id is required" unless version_id
517
+
518
+ r = request(:get, "ra/apps/#{app_id}/platforms/#{version_platform}/versions/#{version_id}")
519
+ parse_response(r, 'data')
520
+ end
521
+
522
+ def update_app_version!(app_id, version_id, data)
523
+ raise "app_id is required" unless app_id
524
+ raise "version_id is required" unless version_id.to_i > 0
525
+
526
+ with_tunes_retry do
527
+ r = request(:post) do |req|
528
+ req.url("ra/apps/#{app_id}/platforms/ios/versions/#{version_id}")
529
+ req.body = data.to_json
530
+ req.headers['Content-Type'] = 'application/json'
531
+ end
532
+
533
+ handle_itc_response(r.body, flaky_api_call: true)
534
+ end
535
+ end
536
+
537
+ #####################################################
538
+ # @!group Members
539
+ #####################################################
540
+
541
+ def members
542
+ r = request(:get, "ra/users/itc")
543
+ parse_response(r, 'data')["users"]
544
+ end
545
+
546
+ def reinvite_member(email)
547
+ request(:post, "ra/users/itc/#{email}/resendInvitation")
548
+ end
549
+
550
+ def delete_member!(user_id, email)
551
+ payload = []
552
+ payload << {
553
+ dsId: user_id,
554
+ email: email
555
+ }
556
+ request(:post) do |req|
557
+ req.url("ra/users/itc/delete")
558
+ req.body = payload.to_json
559
+ req.headers['Content-Type'] = 'application/json'
560
+ end
561
+ end
562
+
563
+ def create_member!(firstname: nil, lastname: nil, email_address: nil, roles: [], apps: [])
564
+ r = request(:get, "ra/users/itc/create")
565
+ data = parse_response(r, 'data')
566
+
567
+ data["user"]["firstName"] = { value: firstname }
568
+ data["user"]["lastName"] = { value: lastname }
569
+ data["user"]["emailAddress"] = { value: email_address }
570
+
571
+ roles << "admin" if roles.length == 0
572
+
573
+ data["user"]["roles"] = []
574
+ roles.each do |role|
575
+ # find role from template
576
+ data["roles"].each do |template_role|
577
+ if template_role["value"]["name"] == role
578
+ data["user"]["roles"] << template_role
579
+ end
580
+ end
581
+ end
582
+
583
+ if apps.length == 0
584
+ data["user"]["userSoftwares"] = { value: { grantAllSoftware: true, grantedSoftwareAdamIds: [] } }
585
+ else
586
+ data["user"]["userSoftwares"] = { value: { grantAllSoftware: false, grantedSoftwareAdamIds: apps } }
587
+ end
588
+
589
+ # send the changes back to Apple
590
+ r = request(:post) do |req|
591
+ req.url("ra/users/itc/create")
592
+ req.body = data.to_json
593
+ req.headers['Content-Type'] = 'application/json'
594
+ end
595
+ handle_itc_response(r.body)
596
+ end
597
+
598
+ def update_member_roles!(member, roles: [], apps: [])
599
+ r = request(:get, "ra/users/itc/#{member.user_id}/roles")
600
+ data = parse_response(r, 'data')
601
+
602
+ roles << "admin" if roles.length == 0
603
+
604
+ data["user"]["roles"] = []
605
+ roles.each do |role|
606
+ # find role from template
607
+ data["roles"].each do |template_role|
608
+ if template_role["value"]["name"] == role
609
+ data["user"]["roles"] << template_role
610
+ end
611
+ end
612
+ end
613
+
614
+ if apps.length == 0
615
+ data["user"]["userSoftwares"] = { value: { grantAllSoftware: true, grantedSoftwareAdamIds: [] } }
616
+ else
617
+ data["user"]["userSoftwares"] = { value: { grantAllSoftware: false, grantedSoftwareAdamIds: apps } }
618
+ end
619
+
620
+ # send the changes back to Apple
621
+ r = request(:post) do |req|
622
+ req.url("ra/users/itc/#{member.user_id}/roles")
623
+ req.body = data.to_json
624
+ req.headers['Content-Type'] = 'application/json'
625
+ end
626
+ handle_itc_response(r.body)
627
+ end
628
+
629
+ #####################################################
630
+ # @!group AppAnalytics
631
+ #####################################################
632
+
633
+ def time_series_analytics(app_ids, measures, start_time, end_time, frequency, view_by)
634
+ data = {
635
+ adamId: app_ids,
636
+ dimensionFilters: [],
637
+ endTime: end_time,
638
+ frequency: frequency,
639
+ group: group_for_view_by(view_by, measures),
640
+ measures: measures,
641
+ startTime: start_time
642
+ }
643
+
644
+ r = request(:post) do |req|
645
+ req.url("https://appstoreconnect.apple.com/analytics/api/v1/data/time-series")
646
+ req.body = data.to_json
647
+ req.headers['Content-Type'] = 'application/json'
648
+ req.headers['X-Requested-By'] = 'appstoreconnect.apple.com'
649
+ end
650
+
651
+ data = parse_response(r)
652
+ end
653
+
654
+ #####################################################
655
+ # @!group Pricing
656
+ #####################################################
657
+
658
+ def update_price_tier!(app_id, price_tier)
659
+ r = request(:get, "ra/apps/#{app_id}/pricing/intervals")
660
+ data = parse_response(r, 'data')
661
+
662
+ # preOrder isn't needed for for the request and has some
663
+ # values that can cause a failure (invalid dates) so we are removing it
664
+ data.delete('preOrder')
665
+
666
+ first_price = (data["pricingIntervalsFieldTO"]["value"] || []).count == 0 # first price
667
+ data["pricingIntervalsFieldTO"]["value"] ||= []
668
+ data["pricingIntervalsFieldTO"]["value"] << {} if data["pricingIntervalsFieldTO"]["value"].count == 0
669
+ data["pricingIntervalsFieldTO"]["value"].first["tierStem"] = price_tier.to_s
670
+
671
+ effective_date = (first_price ? nil : Time.now.to_i * 1000)
672
+ data["pricingIntervalsFieldTO"]["value"].first["priceTierEffectiveDate"] = effective_date
673
+ data["pricingIntervalsFieldTO"]["value"].first["priceTierEndDate"] = nil
674
+ data["countriesChanged"] = first_price
675
+ data["theWorld"] = true
676
+
677
+ if first_price # first price, need to set all countries
678
+ data["countries"] = supported_countries.collect do |c|
679
+ c.delete('region') # we don't care about le region
680
+ c
681
+ end
682
+ end
683
+
684
+ # send the changes back to Apple
685
+ r = request(:post) do |req|
686
+ req.url("ra/apps/#{app_id}/pricing/intervals")
687
+ req.body = data.to_json
688
+ req.headers['Content-Type'] = 'application/json'
689
+ end
690
+ handle_itc_response(r.body)
691
+ end
692
+
693
+ def transform_to_raw_pricing_intervals(app_id = nil, purchase_id = nil, pricing_intervals = 5, subscription_price_target = nil)
694
+ intervals_array = []
695
+ if pricing_intervals
696
+ intervals_array = pricing_intervals.map do |interval|
697
+ {
698
+ "value" => {
699
+ "tierStem" => interval[:tier],
700
+ "priceTierEffectiveDate" => interval[:begin_date],
701
+ "priceTierEndDate" => interval[:end_date],
702
+ "country" => interval[:country] || "WW",
703
+ "grandfathered" => interval[:grandfathered]
704
+ }
705
+ }
706
+ end
707
+ end
708
+
709
+ if subscription_price_target
710
+ pricing_calculator = iap_subscription_pricing_target(app_id: app_id, purchase_id: purchase_id, currency: subscription_price_target[:currency], tier: subscription_price_target[:tier])
711
+ intervals_array = pricing_calculator.map do |language_code, value|
712
+ existing_interval =
713
+ if pricing_intervals
714
+ pricing_intervals.find { |interval| interval[:country] == language_code }
715
+ end
716
+ grandfathered =
717
+ if existing_interval
718
+ existing_interval[:grandfathered].clone
719
+ else
720
+ { "value" => "FUTURE_NONE" }
721
+ end
722
+
723
+ {
724
+ "value" => {
725
+ "tierStem" => value["tierStem"],
726
+ "priceTierEffectiveDate" => value["priceTierEffectiveDate"],
727
+ "priceTierEndDate" => value["priceTierEndDate"],
728
+ "country" => language_code,
729
+ "grandfathered" => grandfathered
730
+ }
731
+ }
732
+ end
733
+ end
734
+
735
+ intervals_array
736
+ end
737
+
738
+ def price_tier(app_id)
739
+ r = request(:get, "ra/apps/#{app_id}/pricing/intervals")
740
+ data = parse_response(r, 'data')
741
+
742
+ begin
743
+ data["pricingIntervalsFieldTO"]["value"].first["tierStem"]
744
+ rescue
745
+ nil
746
+ end
747
+ end
748
+
749
+ # Returns an array of all available pricing tiers
750
+ #
751
+ # @note Although this information is publicly available, the current spaceship implementation requires you to have a logged in client to access it
752
+ #
753
+ # @return [Array] the PricingTier objects (Spaceship::Tunes::PricingTier)
754
+ # [{
755
+ # "tierStem": "0",
756
+ # "tierName": "Free",
757
+ # "pricingInfo": [{
758
+ # "country": "United States",
759
+ # "countryCode": "US",
760
+ # "currencySymbol": "$",
761
+ # "currencyCode": "USD",
762
+ # "wholesalePrice": 0.0,
763
+ # "retailPrice": 0.0,
764
+ # "fRetailPrice": "$0.00",
765
+ # "fWholesalePrice": "$0.00"
766
+ # }, {
767
+ # ...
768
+ # }, {
769
+ # ...
770
+ def pricing_tiers(app_id)
771
+ @pricing_tiers ||= begin
772
+ r = request(:get, "ra/apps/#{app_id}/iaps/pricing/matrix")
773
+ data = parse_response(r, 'data')['pricingTiers']
774
+ data.map { |tier| Spaceship::Tunes::PricingTier.factory(tier) }
775
+ end
776
+ end
777
+
778
+ #####################################################
779
+ # @!group Availability
780
+ #####################################################
781
+ # Updates the availability
782
+ #
783
+ # @note Although this information is publicly available, the current spaceship implementation requires you to have a logged in client to access it
784
+ # @param app_id (String): The id of your app
785
+ # @param availability (Availability): The availability update
786
+ #
787
+ # @return [Spaceship::Tunes::Availability] the new Availability
788
+ def update_availability!(app_id, availability)
789
+ r = request(:get, "ra/apps/#{app_id}/pricing/intervals")
790
+ data = parse_response(r, 'data')
791
+
792
+ data["countriesChanged"] = true
793
+ data["countries"] = availability.territories.map { |territory| { 'code' => territory.code } }
794
+ data["theWorld"] = availability.include_future_territories.nil? ? true : availability.include_future_territories
795
+
796
+ # InitializespreOrder (if needed)
797
+ data["preOrder"] ||= {}
798
+
799
+ # Sets app_available_date to nil if cleared_for_preorder if false
800
+ # This is need for apps that have never set either of these before
801
+ # API will error out if cleared_for_preorder is false and app_available_date has a date
802
+ cleared_for_preorder = availability.cleared_for_preorder
803
+ app_available_date = cleared_for_preorder ? availability.app_available_date : nil
804
+ data["b2bAppEnabled"] = availability.b2b_app_enabled
805
+ data["educationalDiscount"] = availability.educational_discount
806
+ data["preOrder"]["clearedForPreOrder"] = { "value" => cleared_for_preorder, "isEditable" => true, "isRequired" => true, "errorKeys" => nil }
807
+ data["preOrder"]["appAvailableDate"] = { "value" => app_available_date, "isEditable" => true, "isRequired" => true, "errorKeys" => nil }
808
+ data["b2bUsers"] = availability.b2b_app_enabled ? availability.b2b_users.map { |user| { "value" => { "add" => user.add, "delete" => user.delete, "dsUsername" => user.ds_username } } } : []
809
+ data["b2bOrganizations"] = availability.b2b_app_enabled ? availability.b2b_organizations.map { |org| { "value" => { "type" => org.type, "depCustomerId" => org.dep_customer_id, "organizationId" => org.dep_organization_id, "name" => org.name } } } : []
810
+ # send the changes back to Apple
811
+ r = request(:post) do |req|
812
+ req.url("ra/apps/#{app_id}/pricing/intervals")
813
+ req.body = data.to_json
814
+ req.headers['Content-Type'] = 'application/json'
815
+ end
816
+ handle_itc_response(r.body)
817
+ data = parse_response(r, 'data')
818
+ Spaceship::Tunes::Availability.factory(data)
819
+ end
820
+
821
+ def availability(app_id)
822
+ r = request(:get, "ra/apps/#{app_id}/pricing/intervals")
823
+ data = parse_response(r, 'data')
824
+ Spaceship::Tunes::Availability.factory(data)
825
+ end
826
+
827
+ # Returns an array of all supported territories
828
+ #
829
+ # @note Although this information is publicly available, the current spaceship implementation requires you to have a logged in client to access it
830
+ #
831
+ # @return [Array] the Territory objects (Spaceship::Tunes::Territory)
832
+ def supported_territories
833
+ data = supported_countries
834
+ data.map { |country| Spaceship::Tunes::Territory.factory(country) }
835
+ end
836
+
837
+ # An array of supported countries
838
+ # [{
839
+ # "code": "AL",
840
+ # "name": "Albania",
841
+ # "region": "Europe"
842
+ # }, {
843
+ # ...
844
+ def supported_countries
845
+ r = request(:get, "ra/apps/pricing/supportedCountries")
846
+ parse_response(r, 'data')
847
+ end
848
+
849
+ def available_languages
850
+ r = request(:get, "ra/ref")
851
+ parse_response(r, 'data')['detailLocales']
852
+ end
853
+
854
+ #####################################################
855
+ # @!group App Icons
856
+ #####################################################
857
+ # Uploads a large icon
858
+ # @param app_version (AppVersion): The version of your app
859
+ # @param upload_image (UploadFile): The icon to upload
860
+ # @return [JSON] the response
861
+ def upload_large_icon(app_version, upload_image)
862
+ raise "app_version is required" unless app_version
863
+ raise "upload_image is required" unless upload_image
864
+
865
+ du_client.upload_large_icon(app_version, upload_image, content_provider_id, sso_token_for_image)
866
+ end
867
+
868
+ # Uploads a watch icon
869
+ # @param app_version (AppVersion): The version of your app
870
+ # @param upload_image (UploadFile): The icon to upload
871
+ # @return [JSON] the response
872
+ def upload_watch_icon(app_version, upload_image)
873
+ raise "app_version is required" unless app_version
874
+ raise "upload_image is required" unless upload_image
875
+
876
+ du_client.upload_watch_icon(app_version, upload_image, content_provider_id, sso_token_for_image)
877
+ end
878
+
879
+ # Uploads an In-App-Purchase Promotional image
880
+ # @param upload_image (UploadFile): The icon to upload
881
+ # @return [JSON] the image data, ready to be added to an In-App-Purchase
882
+ def upload_purchase_merch_screenshot(app_id, upload_image)
883
+ data = du_client.upload_purchase_merch_screenshot(app_id, upload_image, content_provider_id, sso_token_for_image)
884
+ {
885
+ "images" => [
886
+ {
887
+ "id" => nil,
888
+ "image" => {
889
+ "value" => {
890
+ "assetToken" => data["token"],
891
+ "originalFileName" => upload_image.file_name,
892
+ "height" => data["height"],
893
+ "width" => data["width"],
894
+ "checksum" => data["md5"]
895
+ },
896
+ "isEditable" => true,
897
+ "isREquired" => false,
898
+ "errorKeys" => nil
899
+ },
900
+ "status" => "proposed"
901
+ }
902
+ ],
903
+ "showByDefault" => true,
904
+ "isActive" => false
905
+ }
906
+ end
907
+
908
+ # Uploads an In-App-Purchase Review screenshot
909
+ # @param app_id (AppId): The id of the app
910
+ # @param upload_image (UploadFile): The icon to upload
911
+ # @return [JSON] the screenshot data, ready to be added to an In-App-Purchase
912
+ def upload_purchase_review_screenshot(app_id, upload_image)
913
+ data = du_client.upload_purchase_review_screenshot(app_id, upload_image, content_provider_id, sso_token_for_image)
914
+ {
915
+ "value" => {
916
+ "assetToken" => data["token"],
917
+ "sortOrder" => 0,
918
+ "type" => du_client.get_picture_type(upload_image),
919
+ "originalFileName" => upload_image.file_name,
920
+ "size" => data["length"],
921
+ "height" => data["height"],
922
+ "width" => data["width"],
923
+ "checksum" => data["md5"]
924
+ }
925
+ }
926
+ end
927
+
928
+ # Uploads a screenshot
929
+ # @param app_version (AppVersion): The version of your app
930
+ # @param upload_image (UploadFile): The image to upload
931
+ # @param device (string): The target device
932
+ # @param is_messages (Bool): True if the screenshot is for iMessage
933
+ # @return [JSON] the response
934
+ def upload_screenshot(app_version, upload_image, device, is_messages)
935
+ raise "app_version is required" unless app_version
936
+ raise "upload_image is required" unless upload_image
937
+ raise "device is required" unless device
938
+
939
+ du_client.upload_screenshot(app_version, upload_image, content_provider_id, sso_token_for_image, device, is_messages)
940
+ end
941
+
942
+ # Uploads an iMessage screenshot
943
+ # @param app_version (AppVersion): The version of your app
944
+ # @param upload_image (UploadFile): The image to upload
945
+ # @param device (string): The target device
946
+ # @return [JSON] the response
947
+ def upload_messages_screenshot(app_version, upload_image, device)
948
+ raise "app_version is required" unless app_version
949
+ raise "upload_image is required" unless upload_image
950
+ raise "device is required" unless device
951
+
952
+ du_client.upload_messages_screenshot(app_version, upload_image, content_provider_id, sso_token_for_image, device)
953
+ end
954
+
955
+ # Uploads the transit app file
956
+ # @param app_version (AppVersion): The version of your app
957
+ # @param upload_file (UploadFile): The image to upload
958
+ # @return [JSON] the response
959
+ def upload_geojson(app_version, upload_file)
960
+ raise "app_version is required" unless app_version
961
+ raise "upload_file is required" unless upload_file
962
+
963
+ du_client.upload_geojson(app_version, upload_file, content_provider_id, sso_token_for_image)
964
+ end
965
+
966
+ # Uploads the transit app file
967
+ # @param app_version (AppVersion): The version of your app
968
+ # @param upload_trailer (UploadFile): The trailer to upload
969
+ # @return [JSON] the response
970
+ def upload_trailer(app_version, upload_trailer)
971
+ raise "app_version is required" unless app_version
972
+ raise "upload_trailer is required" unless upload_trailer
973
+
974
+ du_client.upload_trailer(app_version, upload_trailer, content_provider_id, sso_token_for_video)
975
+ end
976
+
977
+ # Uploads the trailer preview
978
+ # @param app_version (AppVersion): The version of your app
979
+ # @param upload_trailer_preview (UploadFile): The trailer preview to upload
980
+ # @param device (string): The target device
981
+ # @return [JSON] the response
982
+ def upload_trailer_preview(app_version, upload_trailer_preview, device)
983
+ raise "app_version is required" unless app_version
984
+ raise "upload_trailer_preview is required" unless upload_trailer_preview
985
+ raise "device is required" unless device
986
+
987
+ du_client.upload_trailer_preview(app_version, upload_trailer_preview, content_provider_id, sso_token_for_image, device)
988
+ end
989
+
990
+ #####################################################
991
+ # @!review attachment file
992
+ #####################################################
993
+ # Uploads a attachment file
994
+ # @param app_version (AppVersion): The version of your app(must be edit version)
995
+ # @param upload_attachment_file (file): File to upload
996
+ # @return [JSON] the response
997
+ def upload_app_review_attachment(app_version, upload_attachment_file)
998
+ raise "app_version is required" unless app_version
999
+ raise "app_version must be live version" if app_version.is_live?
1000
+ raise "upload_attachment_file is required" unless upload_attachment_file
1001
+
1002
+ du_client.upload_app_review_attachment(app_version, upload_attachment_file, content_provider_id, sso_token_for_image)
1003
+ end
1004
+
1005
+ # Fetches the App Version Reference information from ITC
1006
+ # @return [AppVersionRef] the response
1007
+ def ref_data
1008
+ r = request(:get, '/WebObjects/iTunesConnect.woa/ra/apps/version/ref')
1009
+ data = parse_response(r, 'data')
1010
+ Spaceship::Tunes::AppVersionRef.factory(data)
1011
+ end
1012
+
1013
+ #####################################################
1014
+ # @!group CandiateBuilds
1015
+ #####################################################
1016
+
1017
+ def candidate_builds(app_id, version_id)
1018
+ r = request(:get, "ra/apps/#{app_id}/versions/#{version_id}/candidateBuilds")
1019
+ parse_response(r, 'data')['builds']
1020
+ end
1021
+
1022
+ #####################################################
1023
+ # @!group Build Trains
1024
+ #####################################################
1025
+
1026
+ # rubocop:disable Metrics/BlockNesting
1027
+ # @param (testing_type) internal or external
1028
+ def build_trains(app_id, testing_type, tries = 5, platform: nil)
1029
+ raise "app_id is required" unless app_id
1030
+ url = "ra/apps/#{app_id}/trains/?testingType=#{testing_type}"
1031
+ url += "&platform=#{platform}" unless platform.nil?
1032
+ r = request(:get, url)
1033
+ return parse_response(r, 'data')
1034
+ rescue Spaceship::Client::UnexpectedResponse => ex
1035
+ # Build trains fail randomly very often
1036
+ # we need to catch those errors and retry
1037
+ # https://github.com/fastlane/fastlane/issues/6419
1038
+ retry_error_messages = [
1039
+ "ITC.response.error.OPERATION_FAILED",
1040
+ "Internal Server Error",
1041
+ "Service Unavailable"
1042
+ ].freeze
1043
+
1044
+ if retry_error_messages.any? { |message| ex.to_s.include?(message) }
1045
+ tries -= 1
1046
+ if tries > 0
1047
+ logger.warn("Received temporary server error from App Store Connect. Retrying the request...")
1048
+ sleep(3) unless Object.const_defined?(:SpecHelper)
1049
+ retry
1050
+ end
1051
+ end
1052
+
1053
+ raise Spaceship::Client::UnexpectedResponse, "Temporary App Store Connect error: #{ex}"
1054
+ end
1055
+ # rubocop:enable Metrics/BlockNesting
1056
+
1057
+ def update_build_trains!(app_id, testing_type, data)
1058
+ raise "app_id is required" unless app_id
1059
+
1060
+ # The request fails if this key is present in the data
1061
+ data.delete("dailySubmissionCountByPlatform")
1062
+
1063
+ r = request(:post) do |req|
1064
+ req.url("ra/apps/#{app_id}/testingTypes/#{testing_type}/trains/")
1065
+ req.body = data.to_json
1066
+ req.headers['Content-Type'] = 'application/json'
1067
+ end
1068
+
1069
+ handle_itc_response(r.body)
1070
+ end
1071
+
1072
+ def remove_testflight_build_from_review!(app_id: nil, train: nil, build_number: nil, platform: 'ios')
1073
+ r = request(:post) do |req|
1074
+ req.url("ra/apps/#{app_id}/platforms/#{platform}/trains/#{train}/builds/#{build_number}/reject")
1075
+ req.body = {}.to_json
1076
+ req.headers['Content-Type'] = 'application/json'
1077
+ end
1078
+ handle_itc_response(r.body)
1079
+ end
1080
+
1081
+ # All build trains, even if there is no TestFlight
1082
+ def all_build_trains(app_id: nil, platform: 'ios')
1083
+ platform = 'ios' if platform.nil?
1084
+ r = request(:get, "ra/apps/#{app_id}/buildHistory?platform=#{platform}")
1085
+ handle_itc_response(r.body)
1086
+ end
1087
+
1088
+ def all_builds_for_train(app_id: nil, train: nil, platform: 'ios')
1089
+ platform = 'ios' if platform.nil?
1090
+ r = request(:get, "ra/apps/#{app_id}/trains/#{train}/buildHistory?platform=#{platform}")
1091
+ handle_itc_response(r.body)
1092
+ end
1093
+
1094
+ def build_details(app_id: nil, train: nil, build_number: nil, platform: nil)
1095
+ r = request(:get, "ra/apps/#{app_id}/platforms/#{platform || 'ios'}/trains/#{train}/builds/#{build_number}/details")
1096
+ handle_itc_response(r.body)
1097
+ end
1098
+
1099
+ def update_build_information!(app_id: nil,
1100
+ train: nil,
1101
+ build_number: nil,
1102
+
1103
+ # optional:
1104
+ whats_new: nil,
1105
+ description: nil,
1106
+ feedback_email: nil,
1107
+ platform: 'ios')
1108
+ url = "ra/apps/#{app_id}/platforms/#{platform}/trains/#{train}/builds/#{build_number}/testInformation"
1109
+
1110
+ build_info = get_build_info_for_review(app_id: app_id, train: train, build_number: build_number, platform: platform)
1111
+ build_info["details"].each do |current|
1112
+ current["whatsNew"]["value"] = whats_new if whats_new
1113
+ current["description"]["value"] = description if description
1114
+ current["feedbackEmail"]["value"] = feedback_email if feedback_email
1115
+ end
1116
+
1117
+ review_user_name = build_info['reviewUserName']['value']
1118
+ review_password = build_info['reviewPassword']['value']
1119
+ build_info['reviewAccountRequired']['value'] = (review_user_name.to_s + review_password.to_s).length > 0
1120
+
1121
+ # Now send everything back to iTC
1122
+ r = request(:post) do |req| # same URL, but a POST request
1123
+ req.url(url)
1124
+ req.body = build_info.to_json
1125
+ req.headers['Content-Type'] = 'application/json'
1126
+ end
1127
+ handle_itc_response(r.body)
1128
+ end
1129
+
1130
+ # rubocop:disable Metrics/ParameterLists
1131
+ def submit_testflight_build_for_review!(app_id: nil, train: nil, build_number: nil, platform: 'ios',
1132
+ # Required Metadata:
1133
+ changelog: nil,
1134
+ description: nil,
1135
+ feedback_email: nil,
1136
+ marketing_url: nil,
1137
+ first_name: nil,
1138
+ last_name: nil,
1139
+ review_email: nil,
1140
+ phone_number: nil,
1141
+ significant_change: false,
1142
+
1143
+ # Optional Metadata:
1144
+ privacy_policy_url: nil,
1145
+ review_user_name: nil,
1146
+ review_password: nil,
1147
+ review_notes: nil,
1148
+ encryption: false,
1149
+ encryption_updated: false,
1150
+ is_exempt: false,
1151
+ proprietary: false,
1152
+ third_party: false)
1153
+
1154
+ build_info = get_build_info_for_review(app_id: app_id, train: train, build_number: build_number, platform: platform)
1155
+ # Now fill in the values provided by the user
1156
+
1157
+ # First the localized values:
1158
+ build_info['details'].each do |current|
1159
+ current['whatsNew']['value'] = changelog if changelog
1160
+ current['description']['value'] = description if description
1161
+ current['feedbackEmail']['value'] = feedback_email if feedback_email
1162
+ current['marketingUrl']['value'] = marketing_url if marketing_url
1163
+ current['privacyPolicyUrl']['value'] = privacy_policy_url if privacy_policy_url
1164
+ current['pageLanguageValue'] = current['language'] # There is no valid reason why we need this, only iTC being iTC
1165
+ end
1166
+
1167
+ review_info = {
1168
+ "significantChange" => {
1169
+ "value" => significant_change
1170
+ },
1171
+ "buildTestInformationTO" => build_info,
1172
+ "exportComplianceTO" => {
1173
+ "usesEncryption" => {
1174
+ "value" => encryption
1175
+ },
1176
+ "encryptionUpdated" => {
1177
+ "value" => encryption_updated
1178
+ },
1179
+ "isExempt" => {
1180
+ "value" => is_exempt
1181
+ },
1182
+ "containsProprietaryCryptography" => {
1183
+ "value" => proprietary
1184
+ },
1185
+ "containsThirdPartyCryptography" => {
1186
+ "value" => third_party
1187
+ }
1188
+ }
1189
+ }
1190
+
1191
+ r = request(:post) do |req| # same URL, but a POST request
1192
+ req.url("ra/apps/#{app_id}/platforms/#{platform}/trains/#{train}/builds/#{build_number}/review/submit")
1193
+
1194
+ req.body = review_info.to_json
1195
+ req.headers['Content-Type'] = 'application/json'
1196
+ end
1197
+ handle_itc_response(r.body)
1198
+ end
1199
+ # rubocop:enable Metrics/ParameterLists
1200
+
1201
+ def get_build_info_for_review(app_id: nil, train: nil, build_number: nil, platform: 'ios')
1202
+ url = "ra/apps/#{app_id}/platforms/#{platform}/trains/#{train}/builds/#{build_number}/testInformation"
1203
+ r = request(:get) do |req|
1204
+ req.url(url)
1205
+ req.headers['Content-Type'] = 'application/json'
1206
+ end
1207
+ handle_itc_response(r.body)
1208
+
1209
+ r.body['data']
1210
+ end
1211
+
1212
+ #####################################################
1213
+ # @!group Submit for Review
1214
+ #####################################################
1215
+
1216
+ def prepare_app_submissions(app_id, version)
1217
+ raise "app_id is required" unless app_id
1218
+ raise "version is required" unless version
1219
+
1220
+ r = request(:get) do |req|
1221
+ req.url("ra/apps/#{app_id}/versions/#{version}/submit/summary")
1222
+ req.headers['Content-Type'] = 'application/json'
1223
+ end
1224
+
1225
+ handle_itc_response(r.body)
1226
+ parse_response(r, 'data')
1227
+ end
1228
+
1229
+ def send_app_submission(app_id, version, data)
1230
+ raise "app_id is required" unless app_id
1231
+
1232
+ # ra/apps/1039164429/version/submit/complete
1233
+ r = request(:post) do |req|
1234
+ req.url("ra/apps/#{app_id}/versions/#{version}/submit/complete")
1235
+ req.body = data.to_json
1236
+ req.headers['Content-Type'] = 'application/json'
1237
+ end
1238
+
1239
+ handle_itc_response(r.body)
1240
+
1241
+ # App Store Connect still returns a success status code even the submission
1242
+ # was failed because of Ad ID Info / Export Compliance. This checks for any section error
1243
+ # keys in returned adIdInfo / exportCompliance and prints them out.
1244
+ ad_id_error_keys = r.body.fetch('data').fetch('adIdInfo').fetch('sectionErrorKeys')
1245
+ export_error_keys = r.body.fetch('data').fetch('exportCompliance').fetch('sectionErrorKeys')
1246
+ if ad_id_error_keys.any?
1247
+ raise "Something wrong with your Ad ID information: #{ad_id_error_keys}."
1248
+ elsif export_error_keys.any?
1249
+ raise "Something wrong with your Export Compliance: #{export_error_keys}"
1250
+ elsif r.body.fetch('messages').fetch('info').last == "Successful POST"
1251
+ # success
1252
+ else
1253
+ raise "Something went wrong when submitting the app for review. Make sure to pass valid options to submit your app for review"
1254
+ end
1255
+
1256
+ parse_response(r, 'data')
1257
+ end
1258
+
1259
+ #####################################################
1260
+ # @!group release
1261
+ #####################################################
1262
+
1263
+ def release!(app_id, version)
1264
+ raise "app_id is required" unless app_id
1265
+ raise "version is required" unless version
1266
+
1267
+ r = request(:post) do |req|
1268
+ req.url("ra/apps/#{app_id}/versions/#{version}/releaseToStore")
1269
+ req.headers['Content-Type'] = 'application/json'
1270
+ req.body = app_id.to_s
1271
+ end
1272
+
1273
+ handle_itc_response(r.body)
1274
+ parse_response(r, 'data')
1275
+ end
1276
+
1277
+ #####################################################
1278
+ # @!group release to all users
1279
+ #####################################################
1280
+
1281
+ def release_to_all_users!(app_id, version)
1282
+ raise "app_id is required" unless app_id
1283
+ raise "version is required" unless version
1284
+
1285
+ r = request(:post) do |req|
1286
+ req.url("ra/apps/#{app_id}/versions/#{version}/phasedRelease/state/COMPLETE")
1287
+ req.headers['Content-Type'] = 'application/json'
1288
+ req.body = app_id.to_s
1289
+ end
1290
+
1291
+ handle_itc_response(r.body)
1292
+ parse_response(r, 'data')
1293
+ end
1294
+
1295
+ #####################################################
1296
+ # @!group in-app-purchases
1297
+ #####################################################
1298
+
1299
+ # Returns list of all available In-App-Purchases
1300
+ def iaps(app_id: nil)
1301
+ r = request(:get, "ra/apps/#{app_id}/iaps")
1302
+ return r.body["data"]
1303
+ end
1304
+
1305
+ # Returns list of all available Families
1306
+ def iap_families(app_id: nil)
1307
+ r = request(:get, "ra/apps/#{app_id}/iaps/families")
1308
+ return r.body["data"]
1309
+ end
1310
+
1311
+ # Deletes a In-App-Purchases
1312
+ def delete_iap!(app_id: nil, purchase_id: nil)
1313
+ r = request(:delete, "ra/apps/#{app_id}/iaps/#{purchase_id}")
1314
+ handle_itc_response(r)
1315
+ end
1316
+
1317
+ # Loads the full In-App-Purchases
1318
+ def load_iap(app_id: nil, purchase_id: nil)
1319
+ r = request(:get, "ra/apps/#{app_id}/iaps/#{purchase_id}")
1320
+ parse_response(r, 'data')
1321
+ end
1322
+
1323
+ # Submit the In-App-Purchase for review
1324
+ def submit_iap!(app_id: nil, purchase_id: nil)
1325
+ r = request(:post, "ra/apps/#{app_id}/iaps/#{purchase_id}/submission")
1326
+ handle_itc_response(r)
1327
+ end
1328
+
1329
+ # Loads the full In-App-Purchases-Family
1330
+ def load_iap_family(app_id: nil, family_id: nil)
1331
+ r = request(:get, "ra/apps/#{app_id}/iaps/family/#{family_id}")
1332
+ parse_response(r, 'data')
1333
+ end
1334
+
1335
+ # Loads the full In-App-Purchases-Pricing-Matrix
1336
+ # note: the matrix is the same for any app_id
1337
+ #
1338
+ # @param app_id (String) The Apple ID of any app
1339
+ # @return ([Spaceship::Tunes::IAPSubscriptionPricingTier]) An array of pricing tiers
1340
+ def subscription_pricing_tiers(app_id)
1341
+ @subscription_pricing_tiers ||= begin
1342
+ r = request(:get, "ra/apps/#{app_id}/iaps/pricing/matrix/recurring")
1343
+ data = parse_response(r, "data")["pricingTiers"]
1344
+ data.map { |tier| Spaceship::Tunes::IAPSubscriptionPricingTier.factory(tier) }
1345
+ end
1346
+ end
1347
+
1348
+ # updates an In-App-Purchases-Family
1349
+ def update_iap_family!(app_id: nil, family_id: nil, data: nil)
1350
+ with_tunes_retry do
1351
+ r = request(:put) do |req|
1352
+ req.url("ra/apps/#{app_id}/iaps/family/#{family_id}/")
1353
+ req.body = data.to_json
1354
+ req.headers['Content-Type'] = 'application/json'
1355
+ end
1356
+ handle_itc_response(r.body)
1357
+ end
1358
+ end
1359
+
1360
+ # updates an In-App-Purchases
1361
+ def update_iap!(app_id: nil, purchase_id: nil, data: nil)
1362
+ with_tunes_retry do
1363
+ r = request(:put) do |req|
1364
+ req.url("ra/apps/#{app_id}/iaps/#{purchase_id}")
1365
+ req.body = data.to_json
1366
+ req.headers['Content-Type'] = 'application/json'
1367
+ end
1368
+ handle_itc_response(r.body)
1369
+ end
1370
+ end
1371
+
1372
+ def update_recurring_iap_pricing!(app_id: nil, purchase_id: nil, pricing_intervals: nil)
1373
+ with_tunes_retry do
1374
+ r = request(:post) do |req|
1375
+ pricing_data = {}
1376
+ req.url("ra/apps/#{app_id}/iaps/#{purchase_id}/pricing/subscriptions")
1377
+ pricing_data["subscriptions"] = pricing_intervals
1378
+ req.body = pricing_data.to_json
1379
+ req.headers['Content-Type'] = 'application/json'
1380
+ end
1381
+ handle_itc_response(r.body)
1382
+ end
1383
+ end
1384
+
1385
+ def load_recurring_iap_pricing(app_id: nil, purchase_id: nil)
1386
+ r = request(:get, "ra/apps/#{app_id}/iaps/#{purchase_id}/pricing")
1387
+ parse_response(r, 'data')
1388
+ end
1389
+
1390
+ def create_iap_family(app_id: nil, name: nil, product_id: nil, reference_name: nil, versions: [])
1391
+ r = request(:get, "ra/apps/#{app_id}/iaps/family/template")
1392
+ data = parse_response(r, 'data')
1393
+
1394
+ data['activeAddOns'][0]['productId'] = { value: product_id }
1395
+ data['activeAddOns'][0]['referenceName'] = { value: reference_name }
1396
+ data['name'] = { value: name }
1397
+ data["details"]["value"] = versions
1398
+
1399
+ r = request(:post) do |req|
1400
+ req.url("ra/apps/#{app_id}/iaps/family/")
1401
+ req.body = data.to_json
1402
+ req.headers['Content-Type'] = 'application/json'
1403
+ end
1404
+ handle_itc_response(r.body)
1405
+ end
1406
+
1407
+ # returns pricing goal array
1408
+ def iap_subscription_pricing_target(app_id: nil, purchase_id: nil, currency: nil, tier: nil)
1409
+ r = request(:get, "ra/apps/#{app_id}/iaps/#{purchase_id}/pricing/equalize/#{currency}/#{tier}")
1410
+ parse_response(r, 'data')
1411
+ end
1412
+
1413
+ # Creates an In-App-Purchases
1414
+ def create_iap!(app_id: nil, type: nil, versions: nil, reference_name: nil, product_id: nil, cleared_for_sale: true, merch_screenshot: nil, review_notes: nil, review_screenshot: nil, pricing_intervals: nil, family_id: nil, subscription_duration: nil, subscription_free_trial: nil)
1415
+ # Load IAP Template based on Type
1416
+ type ||= "consumable"
1417
+ r = request(:get, "ra/apps/#{app_id}/iaps/#{type}/template")
1418
+ data = parse_response(r, 'data')
1419
+
1420
+ # Now fill in the values we have
1421
+ # some values are nil, that's why there is a hash
1422
+ data['familyId'] = family_id.to_s if family_id
1423
+ data['productId'] = { value: product_id }
1424
+ data['referenceName'] = { value: reference_name }
1425
+ data['clearedForSale'] = { value: cleared_for_sale }
1426
+
1427
+ data['pricingDurationType'] = { value: subscription_duration } if subscription_duration
1428
+ data['freeTrialDurationType'] = { value: subscription_free_trial } if subscription_free_trial
1429
+
1430
+ # pricing tier
1431
+ if pricing_intervals
1432
+ data['pricingIntervals'] = []
1433
+ pricing_intervals.each do |interval|
1434
+ data['pricingIntervals'] << {
1435
+ value: {
1436
+ country: interval[:country] || "WW",
1437
+ tierStem: interval[:tier].to_s,
1438
+ priceTierEndDate: interval[:end_date],
1439
+ priceTierEffectiveDate: interval[:begin_date]
1440
+ }
1441
+ }
1442
+ end
1443
+ end
1444
+
1445
+ versions_array = []
1446
+ versions.each do |k, v|
1447
+ versions_array << {
1448
+ value: {
1449
+ description: { value: v[:description] },
1450
+ name: { value: v[:name] },
1451
+ localeCode: k.to_s
1452
+ }
1453
+ }
1454
+ end
1455
+ data["versions"][0]["details"]["value"] = versions_array
1456
+ data['versions'][0]["reviewNotes"] = { value: review_notes }
1457
+
1458
+ if merch_screenshot
1459
+ # Upload App Store Promotional image (Optional)
1460
+ upload_file = UploadFile.from_path(merch_screenshot)
1461
+ merch_data = upload_purchase_merch_screenshot(app_id, upload_file)
1462
+ data["versions"][0]["merch"] = merch_data
1463
+ end
1464
+
1465
+ if review_screenshot
1466
+ # Upload Screenshot:
1467
+ upload_file = UploadFile.from_path(review_screenshot)
1468
+ screenshot_data = upload_purchase_review_screenshot(app_id, upload_file)
1469
+ data["versions"][0]["reviewScreenshot"] = screenshot_data
1470
+ end
1471
+
1472
+ # Now send back the modified hash
1473
+ r = request(:post) do |req|
1474
+ req.url("ra/apps/#{app_id}/iaps")
1475
+ req.body = data.to_json
1476
+ req.headers['Content-Type'] = 'application/json'
1477
+ end
1478
+ handle_itc_response(r.body)
1479
+ end
1480
+
1481
+ # Retrieves app-specific shared secret key
1482
+ def get_shared_secret(app_id: nil)
1483
+ r = request(:get, "ra/apps/#{app_id}/iaps/appSharedSecret")
1484
+ data = parse_response(r, 'data')
1485
+ data['sharedSecret']
1486
+ end
1487
+
1488
+ # Generates app-specific shared secret key
1489
+ def generate_shared_secret(app_id: nil)
1490
+ r = request(:post, "ra/apps/#{app_id}/iaps/appSharedSecret")
1491
+ data = parse_response(r, 'data')
1492
+ data['sharedSecret']
1493
+ end
1494
+
1495
+ #####################################################
1496
+ # @!group Sandbox Testers
1497
+ #####################################################
1498
+ def sandbox_testers(tester_class)
1499
+ url = tester_class.url[:index]
1500
+ r = request(:get, url)
1501
+ parse_response(r, 'data')
1502
+ end
1503
+
1504
+ def create_sandbox_tester!(tester_class: nil, email: nil, password: nil, first_name: nil, last_name: nil, country: nil)
1505
+ url = tester_class.url[:create]
1506
+ r = request(:post) do |req|
1507
+ req.url(url)
1508
+ req.body = {
1509
+ user: {
1510
+ emailAddress: { value: email },
1511
+ password: { value: password },
1512
+ confirmPassword: { value: password },
1513
+ firstName: { value: first_name },
1514
+ lastName: { value: last_name },
1515
+ storeFront: { value: country },
1516
+ birthDay: { value: 1 },
1517
+ birthMonth: { value: 1 },
1518
+ secretQuestion: { value: SecureRandom.hex },
1519
+ secretAnswer: { value: SecureRandom.hex },
1520
+ sandboxAccount: nil
1521
+ }
1522
+ }.to_json
1523
+ req.headers['Content-Type'] = 'application/json'
1524
+ end
1525
+ response_object = parse_response(r, 'data')
1526
+ errors = response_object['sectionErrorKeys']
1527
+ raise ITunesConnectError, errors.join(' ') unless errors.empty?
1528
+ response_object['user']
1529
+ end
1530
+
1531
+ def delete_sandbox_testers!(tester_class, emails)
1532
+ url = tester_class.url[:delete]
1533
+ request(:post) do |req|
1534
+ req.url(url)
1535
+ req.body = emails.map do |email|
1536
+ {
1537
+ emailAddress: {
1538
+ value: email
1539
+ }
1540
+ }
1541
+ end.to_json
1542
+ req.headers['Content-Type'] = 'application/json'
1543
+ end
1544
+ true
1545
+ end
1546
+
1547
+ #####################################################
1548
+ # @!group State History
1549
+ #####################################################
1550
+ def versions_history(app_id, platform)
1551
+ r = request(:get, "ra/apps/#{app_id}/stateHistory?platform=#{platform}")
1552
+ parse_response(r, 'data')['versions']
1553
+ end
1554
+
1555
+ def version_states_history(app_id, platform, version_id)
1556
+ r = request(:get, "ra/apps/#{app_id}/versions/#{version_id}/stateHistory?platform=#{platform}")
1557
+ parse_response(r, 'data')
1558
+ end
1559
+
1560
+ #####################################################
1561
+ # @!group Promo codes
1562
+ #####################################################
1563
+ def app_promocodes(app_id: nil)
1564
+ r = request(:get, "ra/apps/#{app_id}/promocodes/versions")
1565
+ parse_response(r, 'data')['versions']
1566
+ end
1567
+
1568
+ def generate_app_version_promocodes!(app_id: nil, version_id: nil, quantity: nil)
1569
+ data = [{
1570
+ numberOfCodes: quantity,
1571
+ agreedToContract: true,
1572
+ versionId: version_id
1573
+ }]
1574
+ url = "ra/apps/#{app_id}/promocodes/versions"
1575
+ r = request(:post) do |req|
1576
+ req.url(url)
1577
+ req.body = data.to_json
1578
+ req.headers['Content-Type'] = 'application/json'
1579
+ end
1580
+ parse_response(r, 'data')
1581
+ end
1582
+
1583
+ def app_promocodes_history(app_id: nil)
1584
+ r = request(:get, "ra/apps/#{app_id}/promocodes/history")
1585
+ parse_response(r, 'data')['requests']
1586
+ end
1587
+
1588
+ #####################################################
1589
+ # @!group reject
1590
+ #####################################################
1591
+
1592
+ def reject!(app_id, version)
1593
+ raise "app_id is required" unless app_id
1594
+ raise "version is required" unless version
1595
+
1596
+ r = request(:post) do |req|
1597
+ req.url("ra/apps/#{app_id}/versions/#{version}/reject")
1598
+ req.headers['Content-Type'] = 'application/json'
1599
+ req.body = app_id.to_s
1600
+ end
1601
+
1602
+ handle_itc_response(r.body)
1603
+ parse_response(r, 'data')
1604
+ end
1605
+
1606
+ private
1607
+
1608
+ def with_tunes_retry(tries = 5, potential_server_error_tries = 3, &_block)
1609
+ return yield
1610
+ rescue Spaceship::TunesClient::ITunesConnectTemporaryError => ex
1611
+ seconds_to_sleep = 60
1612
+ unless (tries -= 1).zero?
1613
+ msg = "App Store Connect temporary error received: '#{ex.message}'. Retrying after #{seconds_to_sleep} seconds (remaining: #{tries})..."
1614
+ puts(msg)
1615
+ logger.warn(msg)
1616
+ sleep(seconds_to_sleep) unless Object.const_defined?(:SpecHelper)
1617
+ retry
1618
+ end
1619
+ raise ex # re-raise the exception
1620
+ rescue Spaceship::TunesClient::ITunesConnectPotentialServerError => ex
1621
+ seconds_to_sleep = 10
1622
+ unless (potential_server_error_tries -= 1).zero?
1623
+ msg = "Potential server error received: '#{ex.message}'. Retrying after 10 seconds (remaining: #{potential_server_error_tries})..."
1624
+ puts(msg)
1625
+ logger.warn(msg)
1626
+ sleep(seconds_to_sleep) unless Object.const_defined?(:SpecHelper)
1627
+ retry
1628
+ end
1629
+ raise ex
1630
+ end
1631
+
1632
+ def clear_user_cached_data
1633
+ @content_provider_id = nil
1634
+ @sso_token_for_image = nil
1635
+ @sso_token_for_video = nil
1636
+ end
1637
+
1638
+ # the contentProviderId found in the user details data
1639
+ def content_provider_id
1640
+ return @content_provider_id if @content_provider_id
1641
+
1642
+ provider = user_details_data["provider"]["providerId"]
1643
+ @content_provider_id ||= provider.to_s if provider
1644
+
1645
+ return @content_provider_id
1646
+ end
1647
+
1648
+ # the ssoTokenForImage found in the AppVersionRef instance
1649
+ def sso_token_for_image
1650
+ @sso_token_for_image ||= ref_data.sso_token_for_image
1651
+ end
1652
+
1653
+ # the ssoTokenForVideo found in the AppVersionRef instance
1654
+ def sso_token_for_video
1655
+ @sso_token_for_video ||= ref_data.sso_token_for_video
1656
+ end
1657
+
1658
+ # generates group hash used in the analytics time_series API.
1659
+ # Using rank=DESCENDING and limit=3 as this is what the App Store Connect analytics dashboard uses.
1660
+ def group_for_view_by(view_by, measures)
1661
+ if view_by.nil? || measures.nil?
1662
+ return nil
1663
+ else
1664
+ return {
1665
+ metric: measures.first,
1666
+ dimension: view_by,
1667
+ rank: "DESCENDING",
1668
+ limit: 3
1669
+ }
1670
+ end
1671
+ end
1672
+
1673
+ def update_tester_from_app!(tester, app_id, testing)
1674
+ url = tester.class.url(app_id)[:update_by_app]
1675
+ data = {
1676
+ users: [
1677
+ {
1678
+ emailAddress: {
1679
+ value: tester.email
1680
+ },
1681
+ firstName: {
1682
+ value: tester.first_name
1683
+ },
1684
+ lastName: {
1685
+ value: tester.last_name
1686
+ },
1687
+ testing: {
1688
+ value: testing
1689
+ }
1690
+ }
1691
+ ]
1692
+ }
1693
+
1694
+ r = request(:post) do |req|
1695
+ req.url(url)
1696
+ req.body = data.to_json
1697
+ req.headers['Content-Type'] = 'application/json'
1698
+ end
1699
+
1700
+ data = parse_response(r, 'data')
1701
+ handle_itc_response(data)
1702
+ end
1703
+ end
1704
+ # rubocop:enable Metrics/ClassLength
1705
+ end