fastlane 2.148.1 → 2.150.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +84 -84
  3. data/deliver/lib/deliver.rb +0 -1
  4. data/deliver/lib/deliver/app_screenshot.rb +28 -27
  5. data/deliver/lib/deliver/options.rb +6 -11
  6. data/deliver/lib/deliver/runner.rb +7 -21
  7. data/deliver/lib/deliver/setup.rb +5 -30
  8. data/deliver/lib/deliver/submit_for_review.rb +155 -90
  9. data/deliver/lib/deliver/upload_metadata.rb +355 -143
  10. data/deliver/lib/deliver/upload_price_tier.rb +22 -8
  11. data/deliver/lib/deliver/upload_screenshots.rb +112 -37
  12. data/fastlane/lib/assets/s3_html_template.erb +1 -1
  13. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +42 -2
  14. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  15. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +77 -96
  16. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +3 -2
  17. data/fastlane/lib/fastlane/actions/download_dsyms.rb +7 -1
  18. data/fastlane/lib/fastlane/actions/google_play_track_release_names.rb +74 -0
  19. data/fastlane/lib/fastlane/actions/hipchat.rb +1 -1
  20. data/fastlane/lib/fastlane/actions/set_changelog.rb +23 -20
  21. data/fastlane/lib/fastlane/actions/slack.rb +2 -2
  22. data/fastlane/lib/fastlane/actions/slather.rb +8 -1
  23. data/fastlane/lib/fastlane/actions/spm.rb +7 -0
  24. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +2 -33
  25. data/fastlane/lib/fastlane/lane.rb +3 -3
  26. data/fastlane/lib/fastlane/swift_fastlane_function.rb +22 -5
  27. data/fastlane/lib/fastlane/version.rb +1 -1
  28. data/fastlane/swift/ControlCommand.swift +1 -0
  29. data/fastlane/swift/Deliverfile.swift +1 -1
  30. data/fastlane/swift/Fastlane.swift +79 -22
  31. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +3 -9
  32. data/fastlane/swift/Gymfile.swift +1 -1
  33. data/fastlane/swift/GymfileProtocol.swift +1 -1
  34. data/fastlane/swift/LaneFileProtocol.swift +2 -5
  35. data/fastlane/swift/Matchfile.swift +1 -1
  36. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  37. data/fastlane/swift/Precheckfile.swift +1 -1
  38. data/fastlane/swift/RubyCommand.swift +29 -6
  39. data/fastlane/swift/RubyCommandable.swift +1 -0
  40. data/fastlane/swift/Runner.swift +85 -13
  41. data/fastlane/swift/Scanfile.swift +1 -1
  42. data/fastlane/swift/ScanfileProtocol.swift +2 -2
  43. data/fastlane/swift/Screengrabfile.swift +1 -1
  44. data/fastlane/swift/Snapshotfile.swift +1 -1
  45. data/fastlane/swift/SnapshotfileProtocol.swift +9 -1
  46. data/fastlane/swift/SocketClient.swift +76 -45
  47. data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
  48. data/fastlane/swift/SocketResponse.swift +1 -0
  49. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +1 -3
  50. data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +7 -0
  51. data/frameit/lib/frameit/device_types.rb +100 -100
  52. data/gym/lib/gym/options.rb +1 -1
  53. data/match/lib/match/nuke.rb +21 -16
  54. data/match/lib/match/storage/git_storage.rb +4 -0
  55. data/match/lib/match/storage/google_cloud_storage.rb +4 -0
  56. data/match/lib/match/storage/interface.rb +4 -0
  57. data/match/lib/match/storage/s3_storage.rb +4 -0
  58. data/produce/lib/produce/itunes_connect.rb +32 -21
  59. data/produce/lib/produce/options.rb +3 -3
  60. data/scan/lib/scan/options.rb +1 -1
  61. data/scan/lib/scan/test_result_parser.rb +9 -2
  62. data/sigh/lib/assets/resign.sh +7 -7
  63. data/snapshot/lib/assets/SnapshotHelper.swift +5 -5
  64. data/snapshot/lib/assets/SnapshotHelperXcode8.swift +3 -3
  65. data/snapshot/lib/snapshot/options.rb +11 -1
  66. data/snapshot/lib/snapshot/reports_generator.rb +8 -1
  67. data/snapshot/lib/snapshot/test_command_generator.rb +8 -3
  68. data/spaceship/lib/spaceship/.DS_Store +0 -0
  69. data/spaceship/lib/spaceship/client.rb +13 -4
  70. data/spaceship/lib/spaceship/connect_api.rb +25 -2
  71. data/spaceship/lib/spaceship/connect_api/client.rb +97 -31
  72. data/spaceship/lib/spaceship/connect_api/file_uploader.rb +66 -0
  73. data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
  74. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +113 -0
  75. data/spaceship/lib/spaceship/connect_api/models/app.rb +115 -3
  76. data/spaceship/lib/spaceship/connect_api/models/app_category.rb +94 -0
  77. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +66 -0
  78. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +38 -0
  79. data/spaceship/lib/spaceship/connect_api/models/app_preview.rb +77 -0
  80. data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +71 -0
  81. data/spaceship/lib/spaceship/connect_api/models/app_price.rb +22 -0
  82. data/spaceship/lib/spaceship/connect_api/models/app_price_tier.rb +12 -0
  83. data/spaceship/lib/spaceship/connect_api/models/app_review_attachment.rb +81 -0
  84. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +97 -0
  85. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +101 -0
  86. data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +51 -0
  87. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +182 -0
  88. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +86 -0
  89. data/spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb +36 -0
  90. data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +26 -0
  91. data/spaceship/lib/spaceship/connect_api/models/build.rb +4 -0
  92. data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +40 -0
  93. data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +26 -0
  94. data/spaceship/lib/spaceship/connect_api/models/territory.rb +27 -0
  95. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +10 -3
  96. data/spaceship/lib/spaceship/connect_api/tunes/client.rb +33 -0
  97. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +831 -0
  98. data/spaceship/lib/spaceship/errors.rb +3 -0
  99. data/spaceship/lib/spaceship/spaceauth_runner.rb +2 -2
  100. data/supply/lib/supply/client.rb +19 -0
  101. data/supply/lib/supply/reader.rb +16 -0
  102. metadata +51 -42
  103. data/deliver/lib/deliver/upload_assets.rb +0 -27
@@ -0,0 +1,66 @@
1
+ require 'faraday' # HTTP Client
2
+ require 'faraday-cookie_jar'
3
+ require 'faraday_middleware'
4
+
5
+ module Spaceship
6
+ class ConnectAPI
7
+ module FileUploader
8
+ def self.upload(upload_operation, payload)
9
+ # {
10
+ # "method": "PUT",
11
+ # "url": "https://some-url-apple-gives-us",
12
+ # "length": 57365,
13
+ # "offset": 0,
14
+ # "requestHeaders": [
15
+ # {
16
+ # "name": "Content-Type",
17
+ # "value": "image/png"
18
+ # }
19
+ # ]
20
+ # }
21
+
22
+ headers = {}
23
+ upload_operation["requestHeaders"].each do |hash|
24
+ headers[hash["name"]] = hash["value"]
25
+ end
26
+
27
+ client.send(
28
+ upload_operation["method"].downcase,
29
+ upload_operation["url"],
30
+ payload,
31
+ headers
32
+ )
33
+ end
34
+
35
+ def self.client
36
+ options = {
37
+ request: {
38
+ timeout: (ENV["SPACESHIP_TIMEOUT"] || 300).to_i,
39
+ open_timeout: (ENV["SPACESHIP_TIMEOUT"] || 300).to_i
40
+ }
41
+ }
42
+
43
+ @client ||= Faraday.new(options) do |c|
44
+ c.response(:json, content_type: /\bjson$/)
45
+ c.response(:xml, content_type: /\bxml$/)
46
+ c.response(:plist, content_type: /\bplist$/)
47
+ c.adapter(Faraday.default_adapter)
48
+
49
+ if ENV['SPACESHIP_DEBUG']
50
+ # for debugging only
51
+ # This enables tracking of networking requests using Charles Web Proxy
52
+ c.proxy = "https://127.0.0.1:8888"
53
+ c.ssl[:verify_mode] = OpenSSL::SSL::VERIFY_NONE
54
+ elsif ENV["SPACESHIP_PROXY"]
55
+ c.proxy = ENV["SPACESHIP_PROXY"]
56
+ c.ssl[:verify_mode] = OpenSSL::SSL::VERIFY_NONE if ENV["SPACESHIP_PROXY_SSL_VERIFY_NONE"]
57
+ end
58
+
59
+ if ENV["DEBUG"]
60
+ puts("To run spaceship through a local proxy, use SPACESHIP_DEBUG")
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -15,7 +15,7 @@ module Spaceship
15
15
  end
16
16
 
17
17
  def update_attributes(attributes)
18
- attributes.each do |key, value|
18
+ (attributes || []).each do |key, value|
19
19
  method = "#{key}=".to_sym
20
20
  self.send(method, value) if self.respond_to?(method)
21
21
  end
@@ -0,0 +1,113 @@
1
+ require_relative '../model'
2
+ module Spaceship
3
+ class ConnectAPI
4
+ class AgeRatingDeclaration
5
+ include Spaceship::ConnectAPI::Model
6
+
7
+ # Rating
8
+ attr_accessor :alcohol_tobacco_or_drug_use_or_references
9
+ attr_accessor :gambling_simulated
10
+ attr_accessor :medical_or_treatment_information
11
+ attr_accessor :profanity_or_crude_humor
12
+ attr_accessor :sexual_content_graphic_and_nudity
13
+ attr_accessor :horror_or_fear_themes
14
+ attr_accessor :mature_or_suggestive_themes
15
+ attr_accessor :violence_cartoon_or_fantasy
16
+ attr_accessor :violence_realistic_prolonged_graphic_or_sadistic
17
+ attr_accessor :violence_realistic
18
+
19
+ # boolean
20
+ attr_accessor :gambling_and_contests
21
+ attr_accessor :unrestricted_web_access
22
+
23
+ # KidsAge
24
+ attr_accessor :kids_age_band
25
+
26
+ module Rating
27
+ NONE = "NONE"
28
+ INFREQUENT_OR_MILD = "INFREQUENT_OR_MILD"
29
+ FREQUENT_OR_INTENSE = "FREQUENT_OR_INTENSE"
30
+ end
31
+
32
+ module KidsAge
33
+ FIVE_AND_UNDER = "FIVE_AND_UNDER"
34
+ SIX_TO_EIGHT = "SIX_TO_EIGHT"
35
+ NINE_TO_ELEVEN = "NINE_TO_ELEVEN"
36
+ end
37
+
38
+ attr_mapping({
39
+ "alcoholTobaccoOrDrugUseOrReferences" => "alcohol_tobacco_or_drug_use_or_references",
40
+ "gamblingAndContests" => "gambling_and_contests",
41
+ "gamblingSimulated" => "gambling_simulated",
42
+ "medicalOrTreatmentInformation" => "medical_or_treatment_information",
43
+ "profanityOrCrudeHumor" => "profanity_or_crude_humor",
44
+ "sexualContentGraphicAndNudity" => "sexual_content_graphic_and_nudity",
45
+ "sexualContentOrNudity" => "sexual_content_or_nudity",
46
+ "horrorOrFearThemes" => "horror_or_fear_themes",
47
+ "matureOrSuggestiveThemes" => "mature_or_suggestive_themes",
48
+ "unrestrictedWebAccess" => "unrestricted_web_access",
49
+ "violenceCartoonOrFantasy" => "violence_cartoon_or_fantasy",
50
+ "violenceRealisticProlongedGraphicOrSadistic" => "violence_realistic_prolonged_graphic_or_sadistic",
51
+ "violenceRealistic" => "violence_realistic",
52
+ "kidsAgeBand" => "kids_age_band"
53
+ })
54
+
55
+ def self.type
56
+ return "ageRatingDeclarations"
57
+ end
58
+
59
+ LEGACY_AGE_RATING_ITC_MAP = {
60
+ "CARTOON_FANTASY_VIOLENCE" => "violenceCartoonOrFantasy",
61
+ "REALISTIC_VIOLENCE" => "violenceRealistic",
62
+ "PROLONGED_GRAPHIC_SADISTIC_REALISTIC_VIOLENCE" => "violenceRealisticProlongedGraphicOrSadistic",
63
+ "PROFANITY_CRUDE_HUMOR" => "profanityOrCrudeHumor",
64
+ "MATURE_SUGGESTIVE" => "matureOrSuggestiveThemes",
65
+ "HORROR" => "horrorOrFearThemes",
66
+ "MEDICAL_TREATMENT_INFO" => "medicalOrTreatmentInformation",
67
+ "ALCOHOL_TOBACCO_DRUGS" => "alcoholTobaccoOrDrugUseOrReferences",
68
+ "GAMBLING" => "gamblingSimulated",
69
+ "SEXUAL_CONTENT_NUDITY" => "sexualContentOrNudity",
70
+ "GRAPHIC_SEXUAL_CONTENT_NUDITY" => "sexualContentGraphicAndNudity",
71
+ "UNRESTRICTED_WEB_ACCESS" => "unrestrictedWebAccess",
72
+ "GAMBLING_CONTESTS" => "gamblingAndContests"
73
+ }
74
+
75
+ LEGACY_RATING_VALUE_ITC_MAP = {
76
+ 0 => Rating::NONE,
77
+ 1 => Rating::INFREQUENT_OR_MILD,
78
+ 2 => Rating::FREQUENT_OR_INTENSE
79
+ }
80
+
81
+ LEGACY_BOOLEAN_VALUE_ITC_MAP = {
82
+ 0 => false,
83
+ 1 => true
84
+ }
85
+
86
+ def self.map_key_from_itc(key)
87
+ key = key.gsub("MZGenre.", "")
88
+ return nil if key.empty?
89
+ LEGACY_AGE_RATING_ITC_MAP[key] || key
90
+ end
91
+
92
+ def self.map_value_from_itc(key, value)
93
+ if ["gamblingAndContests", "unrestrictedWebAccess"].include?(key)
94
+ new_value = LEGACY_BOOLEAN_VALUE_ITC_MAP[value]
95
+ return value if new_value.nil?
96
+ return new_value
97
+ else
98
+ return LEGACY_RATING_VALUE_ITC_MAP[value]
99
+ end
100
+
101
+ return value
102
+ end
103
+
104
+ #
105
+ # API
106
+ #
107
+
108
+ def update(attributes: nil)
109
+ Spaceship::ConnectAPI.patch_age_rating_declaration(age_rating_declaration_id: id, attributes: attributes)
110
+ end
111
+ end
112
+ end
113
+ end
@@ -13,13 +13,26 @@ module Spaceship
13
13
  attr_accessor :removed
14
14
  attr_accessor :is_aag
15
15
 
16
+ attr_accessor :content_rights_declaration
17
+
18
+ attr_accessor :app_store_versions
19
+
20
+ module ContentRightsDeclaration
21
+ USES_THIRD_PARTY_CONTENT = "USES_THIRD_PARTY_CONTENT"
22
+ DOES_NOT_USE_THIRD_PARTY_CONTENT = "DOES_NOT_USE_THIRD_PARTY_CONTENT"
23
+ end
24
+
16
25
  self.attr_mapping({
17
26
  "name" => "name",
18
27
  "bundleId" => "bundle_id",
19
28
  "sku" => "sku",
20
29
  "primaryLocale" => "primary_locale",
21
30
  "removed" => "removed",
22
- "isAAG" => "is_aag"
31
+ "isAAG" => "is_aag",
32
+
33
+ "contentRightsDeclaration" => "content_rights_declaration",
34
+
35
+ "appStoreVersions" => "app_store_versions"
23
36
  })
24
37
 
25
38
  def self.type
@@ -30,7 +43,7 @@ module Spaceship
30
43
  # Apps
31
44
  #
32
45
 
33
- def self.all(filter: {}, includes: nil, limit: nil, sort: nil)
46
+ def self.all(filter: {}, includes: "appStoreVersions", limit: nil, sort: nil)
34
47
  resps = Spaceship::ConnectAPI.get_apps(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
35
48
  return resps.flat_map(&:to_models)
36
49
  end
@@ -41,12 +54,111 @@ module Spaceship
41
54
  end
42
55
  end
43
56
 
44
- def self.get(app_id: nil, includes: nil)
57
+ def self.create(name: nil, version_string: nil, sku: nil, primary_locale: nil, bundle_id: nil, platforms: nil)
58
+ Spaceship::ConnectAPI.post_app(
59
+ name: name,
60
+ version_string: version_string,
61
+ sku: sku,
62
+ primary_locale: primary_locale,
63
+ bundle_id: bundle_id,
64
+ platforms: platforms
65
+ )
66
+ end
67
+
68
+ def self.get(app_id: nil, includes: "appStoreVersions")
45
69
  return Spaceship::ConnectAPI.get_app(app_id: app_id, includes: includes).first
46
70
  end
47
71
 
72
+ def update(attributes: nil, app_price_tier_id: nil, territory_ids: nil)
73
+ return Spaceship::ConnectAPI.patch_app(app_id: id, attributes: attributes, app_price_tier_id: app_price_tier_id, territory_ids: territory_ids)
74
+ end
75
+
76
+ #
77
+ # App Info
78
+ #
79
+
80
+ def fetch_edit_app_info
81
+ states = [
82
+ Spaceship::ConnectAPI::AppInfo::AppStoreState::PREPARE_FOR_SUBMISSION,
83
+ Spaceship::ConnectAPI::AppInfo::AppStoreState::DEVELOPER_REJECTED,
84
+ Spaceship::ConnectAPI::AppInfo::AppStoreState::REJECTED,
85
+ Spaceship::ConnectAPI::AppInfo::AppStoreState::METADATA_REJECTED
86
+ ]
87
+
88
+ resp = Spaceship::ConnectAPI.get_app_infos(app_id: id)
89
+ return resp.to_models.select do |model|
90
+ states.include?(model.app_store_state)
91
+ end.first
92
+ end
93
+
94
+ #
95
+ # App Pricing
96
+ #
97
+
98
+ def fetch_app_prices(filter: {}, includes: "priceTier", limit: nil, sort: nil)
99
+ filter ||= {}
100
+ filter[:app] = id
101
+ resp = Spaceship::ConnectAPI.get_app_prices(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
102
+ return resp.to_models
103
+ end
104
+
105
+ #
106
+ # App Store Versions
107
+ #
108
+
109
+ # Will make sure the current edit_version matches the given version number
110
+ # This will either create a new version or change the version number
111
+ # from an existing version
112
+ # @return (Bool) Was something changed?
113
+ def ensure_version!(version_string, platform: nil)
114
+ app_store_version = get_edit_app_store_version(platform: platform)
115
+
116
+ if app_store_version
117
+ if version_string != app_store_version.version_string
118
+ attributes = { versionString: version_string }
119
+ app_store_version.update(attributes: attributes)
120
+ return true
121
+ end
122
+ return false
123
+ else
124
+ attributes = { versionString: version_string, platform: platform }
125
+ Spaceship::ConnectAPI.post_app_store_version(app_id: id, attributes: attributes)
126
+
127
+ return true
128
+ end
129
+ end
130
+
131
+ def get_live_app_store_version(platform: nil, includes: nil)
132
+ platform ||= Spaceship::ConnectAPI::Platform::IOS
133
+ filter = {
134
+ appStoreState: [Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::READY_FOR_SALE].join(","),
135
+ platform: platform
136
+ }
137
+ return get_app_store_versions(filter: filter, includes: includes).first
138
+ end
139
+
140
+ def get_edit_app_store_version(platform: nil, includes: nil)
141
+ platform ||= Spaceship::ConnectAPI::Platform::IOS
142
+ filter = {
143
+ appStoreState: [
144
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PREPARE_FOR_SUBMISSION,
145
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::DEVELOPER_REJECTED,
146
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::REJECTED,
147
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::METADATA_REJECTED
148
+ ].join(","),
149
+ platform: platform
150
+ }
151
+ return get_app_store_versions(filter: filter, includes: includes).first
152
+ end
153
+
154
+ def get_app_store_versions(filter: {}, includes: nil, limit: nil, sort: nil)
155
+ resps = Spaceship::ConnectAPI.get_app_store_versions(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
156
+ return resps.flat_map(&:to_models)
157
+ end
158
+
48
159
  #
49
160
  # Beta Feedback
161
+ #
50
162
 
51
163
  def get_beta_feedback(filter: {}, includes: "tester,build,screenshots", limit: nil, sort: nil)
52
164
  filter ||= {}
@@ -0,0 +1,94 @@
1
+ require_relative '../model'
2
+ module Spaceship
3
+ class ConnectAPI
4
+ class AppCategory
5
+ include Spaceship::ConnectAPI::Model
6
+
7
+ attr_accessor :platforms
8
+
9
+ attr_mapping({
10
+ "platforms" => "platforms"
11
+ })
12
+
13
+ def self.type
14
+ return "appCategories"
15
+ end
16
+
17
+ LEGACY_CATEGORY_ITC_MAP = {
18
+ "Apps.Food_Drink" => "FOOD_AND_DRINK",
19
+ "Business" => "BUSINESS",
20
+ "Education" => "EDUCATION",
21
+ "SocialNetworking" => "SOCIAL_NETWORKING",
22
+ "Book" => "BOOKS",
23
+ "Sports" => "SPORTS",
24
+ "Finance" => "FINANCE",
25
+ "Reference" => "REFERENCE",
26
+ "Apps.GraphicsDesign" => "GRAPHICS_AND_DESIGN",
27
+ "Apps.DeveloperTools" => "DEVELOPER_TOOLS",
28
+ "Healthcare_Fitness" => "HEALTH_AND_FITNESS",
29
+ "Music" => "MUSIC",
30
+ "Weather" => "WEATHER",
31
+ "Travel" => "TRAVEL",
32
+ "Entertainment" => "ENTERTAINMENT",
33
+ "Stickers" => "STICKERS",
34
+ "Games" => "GAMES",
35
+ "Lifestyle" => "LIFESTYLE",
36
+ "Medical" => "MEDICAL",
37
+ "Apps.Newsstand" => "MAGAZINES_AND_NEWSPAPERS",
38
+ "Utilities" => "UTILITIES",
39
+ "Apps.Shopping" => "SHOPPING",
40
+ "Productivity" => "PRODUCTIVITY",
41
+ "News" => "NEWS",
42
+ "Photography" => "PHOTO_AND_VIDEO",
43
+ "Navigation" => "NAVIGATION"
44
+ }
45
+
46
+ LEGACY_SUBCATEGORY_ITC_MAP = {
47
+ "Apps.Stickers.Places" => "STICKERS_PLACES_AND_OBJECTS",
48
+ "Apps.Stickers.Emotions" => "STICKERS_EMOJI_AND_EXPRESSIONS",
49
+ "Apps.Stickers.BirthdaysAndCelebrations" => "STICKERS_CELEBRATIONS",
50
+ "Apps.Stickers.Celebrities" => "STICKERS_CELEBRITIES",
51
+ "Apps.Stickers.MoviesAndTV" => "STICKERS_MOVIES_AND_TV",
52
+ "Apps.Stickers.Sports" => "STICKERS_SPORTS_AND_ACTIVITIES",
53
+ "Apps.Stickers.FoodAndDrink" => "STICKERS_EATING_AND_DRINKING",
54
+ "Apps.Stickers.Characters" => "STICKERS_CHARACTERS",
55
+ "Apps.Stickers.Animals" => "STICKERS_ANIMALS",
56
+ "Apps.Stickers.Fashion" => "STICKERS_FASHION",
57
+ "Apps.Stickers.Art" => "STICKERS_ART",
58
+ "Apps.Stickers.Games" => "STICKERS_GAMING",
59
+ "Apps.Stickers.KidsAndFamily" => "STICKERS_KIDS_AND_FAMILY",
60
+ "Apps.Stickers.People" => "STICKERS_PEOPLE",
61
+ "Apps.Stickers.Music" => "STICKERS_MUSIC",
62
+
63
+ "Sports" => "GAMES_SPORTS",
64
+ "Word" => "GAMES_WORD",
65
+ "Music" => "GAMES_MUSIC",
66
+ "Adventure" => "GAMES_ADVENTURE",
67
+ "Action" => "GAMES_ACTION",
68
+ "RolePlaying" => "GAMES_ROLE_PLAYING",
69
+ "Arcade" => "GAMES_CASUAL",
70
+ "Board" => "GAMES_BOARD",
71
+ "Trivia" => "GAMES_TRIVIA",
72
+ "Card" => "GAMES_CARD",
73
+ "Puzzle" => "GAMES_PUZZLE",
74
+ "Casino" => "GAMES_CASINO",
75
+ "Strategy" => "GAMES_STRATEGY",
76
+ "Simulation" => "GAMES_SIMULATION",
77
+ "Racing" => "GAMES_RACING",
78
+ "Family" => "GAMES_FAMILY"
79
+ }
80
+
81
+ def self.map_category_from_itc(category)
82
+ category = category.gsub("MZGenre.", "")
83
+ return nil if category.empty?
84
+ LEGACY_CATEGORY_ITC_MAP[category] || category
85
+ end
86
+
87
+ def self.map_subcategory_from_itc(category)
88
+ category = category.gsub("MZGenre.", "")
89
+ return nil if category.empty?
90
+ LEGACY_SUBCATEGORY_ITC_MAP[category] || category
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,66 @@
1
+ require_relative '../model'
2
+ module Spaceship
3
+ class ConnectAPI
4
+ class AppInfo
5
+ include Spaceship::ConnectAPI::Model
6
+
7
+ attr_accessor :app_store_state
8
+ attr_accessor :app_store_age_rating
9
+ attr_accessor :brazil_age_rating
10
+ attr_accessor :kids_age_band
11
+
12
+ module AppStoreState
13
+ READY_FOR_SALE = "READY_FOR_SALE"
14
+ WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
15
+ DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
16
+ REJECTED = "REJECTED"
17
+ PREPARE_FOR_SUBMISSION = "PREPARE_FOR_SUBMISSION"
18
+ METADATA_REJECTED = "METADATA_REJECTED"
19
+ end
20
+
21
+ module AppStoreAgeRating
22
+ FOUR_PLUS = "FOUR_PLUS"
23
+ end
24
+
25
+ attr_mapping({
26
+ "appStoreState" => "app_store_state",
27
+ "appStoreAgeRating" => "app_store_age_rating",
28
+ "brazilAgeRating" => "brazil_age_rating",
29
+ "kidsAgeBand" => "kids_age_band"
30
+ })
31
+
32
+ def self.type
33
+ return "appInfos"
34
+ end
35
+
36
+ #
37
+ # API
38
+ #
39
+
40
+ def update(filter: {}, includes: nil, limit: nil, sort: nil)
41
+ Spaceship::ConnectAPI.patch_app_info(app_info_id: id).first
42
+ end
43
+
44
+ def update_categories(category_id_map: nil)
45
+ Spaceship::ConnectAPI.patch_app_info_categories(app_info_id: id, category_id_map: category_id_map).first
46
+ end
47
+
48
+ def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
49
+ Spaceship::ConnectAPI.delete_app_info(app_info_id: id)
50
+ end
51
+
52
+ #
53
+ # App Info Localizations
54
+ #
55
+
56
+ def create_app_info_localization(attributes: nil)
57
+ resp = Spaceship::ConnectAPI.post_app_info_localization(app_info_id: id, attributes: attributes)
58
+ return resp.to_models.first
59
+ end
60
+
61
+ def get_app_info_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
62
+ return Spaceship::ConnectAPI.get_app_info_localizations(app_info_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
63
+ end
64
+ end
65
+ end
66
+ end