fastlane 2.149.0 → 2.150.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +82 -82
  3. data/deliver/lib/deliver.rb +0 -1
  4. data/deliver/lib/deliver/app_screenshot.rb +26 -25
  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 +134 -39
  12. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  13. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +77 -96
  14. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +3 -2
  15. data/fastlane/lib/fastlane/actions/download_dsyms.rb +7 -1
  16. data/fastlane/lib/fastlane/actions/google_play_track_release_names.rb +74 -0
  17. data/fastlane/lib/fastlane/actions/set_changelog.rb +23 -20
  18. data/fastlane/lib/fastlane/actions/slack.rb +1 -1
  19. data/fastlane/lib/fastlane/actions/spm.rb +7 -0
  20. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +1 -32
  21. data/fastlane/lib/fastlane/lane.rb +3 -3
  22. data/fastlane/lib/fastlane/swift_fastlane_function.rb +8 -4
  23. data/fastlane/lib/fastlane/version.rb +1 -1
  24. data/fastlane/swift/ControlCommand.swift +1 -0
  25. data/fastlane/swift/Deliverfile.swift +1 -1
  26. data/fastlane/swift/Fastlane.swift +48 -12
  27. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +3 -9
  28. data/fastlane/swift/Gymfile.swift +1 -1
  29. data/fastlane/swift/LaneFileProtocol.swift +2 -5
  30. data/fastlane/swift/Matchfile.swift +1 -1
  31. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  32. data/fastlane/swift/Precheckfile.swift +1 -1
  33. data/fastlane/swift/RubyCommand.swift +29 -6
  34. data/fastlane/swift/RubyCommandable.swift +1 -0
  35. data/fastlane/swift/Runner.swift +85 -13
  36. data/fastlane/swift/Scanfile.swift +1 -1
  37. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  38. data/fastlane/swift/Screengrabfile.swift +1 -1
  39. data/fastlane/swift/Snapshotfile.swift +1 -1
  40. data/fastlane/swift/SnapshotfileProtocol.swift +3 -3
  41. data/fastlane/swift/SocketClient.swift +76 -45
  42. data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
  43. data/fastlane/swift/SocketResponse.swift +1 -0
  44. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +1 -3
  45. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +89 -52
  46. data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +7 -0
  47. data/fastlane_core/lib/fastlane_core/project.rb +0 -1
  48. data/frameit/lib/frameit/device_types.rb +100 -100
  49. data/produce/lib/produce/itunes_connect.rb +32 -21
  50. data/produce/lib/produce/options.rb +3 -3
  51. data/sigh/lib/assets/resign.sh +7 -7
  52. data/snapshot/lib/assets/SnapshotHelper.swift +5 -5
  53. data/snapshot/lib/assets/SnapshotHelperXcode8.swift +3 -3
  54. data/snapshot/lib/snapshot/options.rb +0 -1
  55. data/snapshot/lib/snapshot/reports_generator.rb +8 -1
  56. data/spaceship/lib/spaceship/.DS_Store +0 -0
  57. data/spaceship/lib/spaceship/client.rb +4 -3
  58. data/spaceship/lib/spaceship/connect_api.rb +25 -2
  59. data/spaceship/lib/spaceship/connect_api/client.rb +97 -31
  60. data/spaceship/lib/spaceship/connect_api/file_uploader.rb +98 -0
  61. data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
  62. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +113 -0
  63. data/spaceship/lib/spaceship/connect_api/models/app.rb +120 -3
  64. data/spaceship/lib/spaceship/connect_api/models/app_category.rb +94 -0
  65. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +67 -0
  66. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +38 -0
  67. data/spaceship/lib/spaceship/connect_api/models/app_preview.rb +129 -0
  68. data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +71 -0
  69. data/spaceship/lib/spaceship/connect_api/models/app_price.rb +22 -0
  70. data/spaceship/lib/spaceship/connect_api/models/app_price_tier.rb +12 -0
  71. data/spaceship/lib/spaceship/connect_api/models/app_review_attachment.rb +71 -0
  72. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +93 -0
  73. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +101 -0
  74. data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +51 -0
  75. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +183 -0
  76. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +86 -0
  77. data/spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb +36 -0
  78. data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +26 -0
  79. data/spaceship/lib/spaceship/connect_api/models/build.rb +4 -0
  80. data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +40 -0
  81. data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +26 -0
  82. data/spaceship/lib/spaceship/connect_api/models/territory.rb +27 -0
  83. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +10 -3
  84. data/spaceship/lib/spaceship/connect_api/tunes/client.rb +33 -0
  85. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +841 -0
  86. data/spaceship/lib/spaceship/spaceauth_runner.rb +2 -2
  87. data/supply/lib/supply/client.rb +19 -0
  88. data/supply/lib/supply/reader.rb +16 -0
  89. metadata +44 -39
  90. data/deliver/lib/deliver/upload_assets.rb +0 -27
  91. data/fastlane/lib/assets/.s3_html_template.erb.swp +0 -0
  92. data/fastlane/lib/fastlane/actions/.hipchat.rb.swp +0 -0
  93. data/fastlane/lib/fastlane/actions/.slack.rb.swp +0 -0
  94. data/scan/lib/scan/.options.rb.swp +0 -0
@@ -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] || 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,116 @@ 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
+ Spaceship::ConnectAPI::AppInfo::AppStoreState::WAITING_FOR_REVIEW,
87
+ Spaceship::ConnectAPI::AppInfo::AppStoreState::INVALID_BINARY
88
+ ]
89
+
90
+ filter = { app: id }
91
+ resp = Spaceship::ConnectAPI.get_app_infos(filter: filter)
92
+ return resp.to_models.select do |model|
93
+ states.include?(model.app_store_state)
94
+ end.first
95
+ end
96
+
97
+ #
98
+ # App Pricing
99
+ #
100
+
101
+ def fetch_app_prices(filter: {}, includes: "priceTier", limit: nil, sort: nil)
102
+ filter ||= {}
103
+ filter[:app] = id
104
+ resp = Spaceship::ConnectAPI.get_app_prices(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
105
+ return resp.to_models
106
+ end
107
+
108
+ #
109
+ # App Store Versions
110
+ #
111
+
112
+ # Will make sure the current edit_version matches the given version number
113
+ # This will either create a new version or change the version number
114
+ # from an existing version
115
+ # @return (Bool) Was something changed?
116
+ def ensure_version!(version_string, platform: nil)
117
+ app_store_version = get_edit_app_store_version(platform: platform)
118
+
119
+ if app_store_version
120
+ if version_string != app_store_version.version_string
121
+ attributes = { versionString: version_string }
122
+ app_store_version.update(attributes: attributes)
123
+ return true
124
+ end
125
+ return false
126
+ else
127
+ attributes = { versionString: version_string, platform: platform }
128
+ Spaceship::ConnectAPI.post_app_store_version(app_id: id, attributes: attributes)
129
+
130
+ return true
131
+ end
132
+ end
133
+
134
+ def get_live_app_store_version(platform: nil, includes: nil)
135
+ platform ||= Spaceship::ConnectAPI::Platform::IOS
136
+ filter = {
137
+ appStoreState: [Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::READY_FOR_SALE].join(","),
138
+ platform: platform
139
+ }
140
+ return get_app_store_versions(filter: filter, includes: includes).first
141
+ end
142
+
143
+ def get_edit_app_store_version(platform: nil, includes: nil)
144
+ platform ||= Spaceship::ConnectAPI::Platform::IOS
145
+ filter = {
146
+ appStoreState: [
147
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PREPARE_FOR_SUBMISSION,
148
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::DEVELOPER_REJECTED,
149
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::REJECTED,
150
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::METADATA_REJECTED,
151
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::WAITING_FOR_REVIEW,
152
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::INVALID_BINARY
153
+ ].join(","),
154
+ platform: platform
155
+ }
156
+ return get_app_store_versions(filter: filter, includes: includes).first
157
+ end
158
+
159
+ def get_app_store_versions(filter: {}, includes: nil, limit: nil, sort: nil)
160
+ resps = Spaceship::ConnectAPI.get_app_store_versions(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
161
+ return resps.flat_map(&:to_models)
162
+ end
163
+
48
164
  #
49
165
  # Beta Feedback
166
+ #
50
167
 
51
168
  def get_beta_feedback(filter: {}, includes: "tester,build,screenshots", limit: nil, sort: nil)
52
169
  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,67 @@
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
+ INVALID_BINARY = "INVALID_BINARY"
20
+ end
21
+
22
+ module AppStoreAgeRating
23
+ FOUR_PLUS = "FOUR_PLUS"
24
+ end
25
+
26
+ attr_mapping({
27
+ "appStoreState" => "app_store_state",
28
+ "appStoreAgeRating" => "app_store_age_rating",
29
+ "brazilAgeRating" => "brazil_age_rating",
30
+ "kidsAgeBand" => "kids_age_band"
31
+ })
32
+
33
+ def self.type
34
+ return "appInfos"
35
+ end
36
+
37
+ #
38
+ # API
39
+ #
40
+
41
+ def update(filter: {}, includes: nil, limit: nil, sort: nil)
42
+ Spaceship::ConnectAPI.patch_app_info(app_info_id: id).first
43
+ end
44
+
45
+ def update_categories(category_id_map: nil)
46
+ Spaceship::ConnectAPI.patch_app_info_categories(app_info_id: id, category_id_map: category_id_map).first
47
+ end
48
+
49
+ def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
50
+ Spaceship::ConnectAPI.delete_app_info(app_info_id: id)
51
+ end
52
+
53
+ #
54
+ # App Info Localizations
55
+ #
56
+
57
+ def create_app_info_localization(attributes: nil)
58
+ resp = Spaceship::ConnectAPI.post_app_info_localization(app_info_id: id, attributes: attributes)
59
+ return resp.to_models.first
60
+ end
61
+
62
+ def get_app_info_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
63
+ return Spaceship::ConnectAPI.get_app_info_localizations(app_info_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,38 @@
1
+ require_relative '../model'
2
+ module Spaceship
3
+ class ConnectAPI
4
+ class AppInfoLocalization
5
+ include Spaceship::ConnectAPI::Model
6
+
7
+ attr_accessor :locale
8
+ attr_accessor :name
9
+ attr_accessor :subtitle
10
+ attr_accessor :privacy_policy_url
11
+ attr_accessor :privacy_policy_text
12
+
13
+ attr_mapping({
14
+ "locale" => "locale",
15
+ "name" => "name",
16
+ "subtitle" => "subtitle",
17
+ "privacyPolicyUrl" => "privacy_policy_url",
18
+ "privacyPolicyText" => "privacy_policy_text"
19
+ })
20
+
21
+ def self.type
22
+ return "appInfoLocalizations"
23
+ end
24
+
25
+ #
26
+ # API
27
+ #
28
+
29
+ def update(attributes: nil)
30
+ Spaceship::ConnectAPI.patch_app_info_localization(app_info_localization_id: id, attributes: attributes)
31
+ end
32
+
33
+ def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
34
+ Spaceship::ConnectAPI.delete_app_info_localization(app_info_localization_id: id)
35
+ end
36
+ end
37
+ end
38
+ end