fastlane 2.147.0 → 2.150.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +82 -82
  3. data/cert/lib/cert/commands_generator.rb +1 -0
  4. data/credentials_manager/lib/credentials_manager/cli.rb +2 -0
  5. data/deliver/lib/deliver.rb +0 -1
  6. data/deliver/lib/deliver/app_screenshot.rb +28 -27
  7. data/deliver/lib/deliver/commands_generator.rb +1 -0
  8. data/deliver/lib/deliver/html_generator.rb +2 -2
  9. data/deliver/lib/deliver/options.rb +6 -11
  10. data/deliver/lib/deliver/runner.rb +7 -4
  11. data/deliver/lib/deliver/setup.rb +5 -30
  12. data/deliver/lib/deliver/submit_for_review.rb +124 -83
  13. data/deliver/lib/deliver/upload_metadata.rb +284 -143
  14. data/deliver/lib/deliver/upload_price_tier.rb +15 -8
  15. data/deliver/lib/deliver/upload_screenshots.rb +86 -37
  16. data/fastlane/lib/assets/s3_html_template.erb +1 -1
  17. data/fastlane/lib/fastlane/actions/crashlytics.rb +0 -4
  18. data/fastlane/lib/fastlane/actions/docs/build_app.md +1 -1
  19. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +42 -2
  20. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  21. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +2 -2
  22. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +3 -11
  23. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +15 -2
  24. data/fastlane/lib/fastlane/actions/download_dsyms.rb +7 -1
  25. data/fastlane/lib/fastlane/actions/get_managed_play_store_publishing_rights.rb +1 -1
  26. data/fastlane/lib/fastlane/actions/google_play_track_release_names.rb +74 -0
  27. data/fastlane/lib/fastlane/actions/hipchat.rb +1 -1
  28. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +1 -1
  29. data/fastlane/lib/fastlane/actions/slack.rb +2 -2
  30. data/fastlane/lib/fastlane/actions/slather.rb +8 -1
  31. data/fastlane/lib/fastlane/actions/spm.rb +7 -0
  32. data/fastlane/lib/fastlane/actions/swiftlint.rb +14 -0
  33. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +1 -1
  34. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +3 -34
  35. data/fastlane/lib/fastlane/actions/xcodebuild.rb +4 -4
  36. data/fastlane/lib/fastlane/cli_tools_distributor.rb +28 -6
  37. data/fastlane/lib/fastlane/commands_generator.rb +1 -1
  38. data/fastlane/lib/fastlane/documentation/actions_list.rb +1 -1
  39. data/fastlane/lib/fastlane/lane.rb +3 -3
  40. data/fastlane/lib/fastlane/lane_manager.rb +0 -10
  41. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +3 -3
  42. data/fastlane/lib/fastlane/plugins/template/.github/workflows/test.yml +29 -0
  43. data/fastlane/lib/fastlane/swift_fastlane_function.rb +22 -5
  44. data/fastlane/lib/fastlane/swift_lane_manager.rb +0 -8
  45. data/fastlane/lib/fastlane/version.rb +1 -1
  46. data/fastlane/swift/ControlCommand.swift +1 -0
  47. data/fastlane/swift/Deliverfile.swift +1 -1
  48. data/fastlane/swift/Fastlane.swift +140 -30
  49. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +3 -9
  50. data/fastlane/swift/Gymfile.swift +1 -1
  51. data/fastlane/swift/GymfileProtocol.swift +1 -1
  52. data/fastlane/swift/Matchfile.swift +1 -1
  53. data/fastlane/swift/MatchfileProtocol.swift +5 -1
  54. data/fastlane/swift/Precheckfile.swift +1 -1
  55. data/fastlane/swift/RubyCommand.swift +29 -6
  56. data/fastlane/swift/RubyCommandable.swift +1 -0
  57. data/fastlane/swift/Runner.swift +85 -13
  58. data/fastlane/swift/Scanfile.swift +1 -1
  59. data/fastlane/swift/ScanfileProtocol.swift +10 -2
  60. data/fastlane/swift/Screengrabfile.swift +1 -1
  61. data/fastlane/swift/Snapshotfile.swift +1 -1
  62. data/fastlane/swift/SnapshotfileProtocol.swift +17 -1
  63. data/fastlane/swift/SocketClient.swift +76 -45
  64. data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
  65. data/fastlane/swift/SocketResponse.swift +1 -0
  66. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +1 -3
  67. data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +7 -0
  68. data/frameit/lib/frameit/commands_generator.rb +1 -0
  69. data/frameit/lib/frameit/device_types.rb +100 -100
  70. data/gym/lib/gym/generators/package_command_generator.rb +4 -0
  71. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +4 -0
  72. data/gym/lib/gym/options.rb +1 -1
  73. data/gym/lib/gym/runner.rb +14 -0
  74. data/match/lib/match/commands_generator.rb +1 -0
  75. data/match/lib/match/generator.rb +2 -1
  76. data/match/lib/match/nuke.rb +21 -16
  77. data/match/lib/match/options.rb +18 -1
  78. data/match/lib/match/storage/git_storage.rb +4 -0
  79. data/match/lib/match/storage/google_cloud_storage.rb +4 -0
  80. data/match/lib/match/storage/interface.rb +4 -0
  81. data/match/lib/match/storage/s3_storage.rb +4 -0
  82. data/pem/lib/pem/commands_generator.rb +1 -0
  83. data/pilot/lib/pilot/build_manager.rb +23 -7
  84. data/pilot/lib/pilot/options.rb +5 -0
  85. data/produce/lib/produce/commands_generator.rb +1 -0
  86. data/produce/lib/produce/itunes_connect.rb +20 -20
  87. data/produce/lib/produce/options.rb +3 -3
  88. data/scan/lib/scan/detect_values.rb +3 -0
  89. data/scan/lib/scan/options.rb +20 -2
  90. data/scan/lib/scan/test_command_generator.rb +6 -1
  91. data/scan/lib/scan/test_result_parser.rb +9 -2
  92. data/screengrab/lib/screengrab/runner.rb +10 -9
  93. data/sigh/lib/assets/resign.sh +7 -7
  94. data/sigh/lib/sigh/commands_generator.rb +1 -0
  95. data/sigh/lib/sigh/options.rb +7 -1
  96. data/sigh/lib/sigh/runner.rb +2 -1
  97. data/snapshot/lib/assets/SnapshotHelper.swift +16 -37
  98. data/snapshot/lib/assets/SnapshotHelperXcode8.swift +3 -3
  99. data/snapshot/lib/snapshot/detect_values.rb +15 -0
  100. data/snapshot/lib/snapshot/options.rb +31 -0
  101. data/snapshot/lib/snapshot/reports_generator.rb +8 -1
  102. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +3 -1
  103. data/snapshot/lib/snapshot/test_command_generator.rb +8 -3
  104. data/snapshot/lib/snapshot/test_command_generator_base.rb +7 -1
  105. data/spaceship/lib/spaceship/.DS_Store +0 -0
  106. data/spaceship/lib/spaceship/client.rb +9 -1
  107. data/spaceship/lib/spaceship/commands_generator.rb +1 -0
  108. data/spaceship/lib/spaceship/connect_api.rb +21 -2
  109. data/spaceship/lib/spaceship/connect_api/client.rb +47 -11
  110. data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
  111. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +109 -0
  112. data/spaceship/lib/spaceship/connect_api/models/app.rb +113 -3
  113. data/spaceship/lib/spaceship/connect_api/models/app_category.rb +94 -0
  114. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +74 -0
  115. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +38 -0
  116. data/spaceship/lib/spaceship/connect_api/models/app_price.rb +22 -0
  117. data/spaceship/lib/spaceship/connect_api/models/app_price_tier.rb +12 -0
  118. data/spaceship/lib/spaceship/connect_api/models/app_review_attachment.rb +81 -0
  119. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +117 -0
  120. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +101 -0
  121. data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +51 -0
  122. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +182 -0
  123. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +70 -0
  124. data/spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb +36 -0
  125. data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +26 -0
  126. data/spaceship/lib/spaceship/connect_api/models/build.rb +8 -0
  127. data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +40 -0
  128. data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +26 -0
  129. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +10 -3
  130. data/spaceship/lib/spaceship/connect_api/tunes/client.rb +33 -0
  131. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +703 -0
  132. data/spaceship/lib/spaceship/errors.rb +3 -0
  133. data/spaceship/lib/spaceship/spaceauth_runner.rb +2 -2
  134. data/supply/lib/supply/client.rb +19 -0
  135. data/supply/lib/supply/commands_generator.rb +1 -0
  136. data/supply/lib/supply/options.rb +9 -0
  137. data/supply/lib/supply/reader.rb +16 -0
  138. data/supply/lib/supply/uploader.rb +4 -0
  139. metadata +52 -47
  140. data/deliver/lib/deliver/upload_assets.rb +0 -27
  141. data/supply/lib/supply/.client.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,109 @@
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
+ return LEGACY_BOOLEAN_VALUE_ITC_MAP[value]
95
+ else
96
+ return LEGACY_RATING_VALUE_ITC_MAP[value]
97
+ end
98
+ end
99
+
100
+ #
101
+ # API
102
+ #
103
+
104
+ def update(attributes: nil)
105
+ Spaceship::ConnectAPI.patch_age_rating_declaration(age_rating_declaration_id: id, attributes: attributes)
106
+ end
107
+ end
108
+ end
109
+ 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,109 @@ 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(name: name, version_string: version_string, sku: sku, primary_locale: primary_locale, bundle_id: bundle_id, platforms: platforms)
59
+ end
60
+
61
+ def self.get(app_id: nil, includes: "appStoreVersions")
45
62
  return Spaceship::ConnectAPI.get_app(app_id: app_id, includes: includes).first
46
63
  end
47
64
 
65
+ def update(attributes: nil)
66
+ return Spaceship::ConnectAPI.patch_app(app_id: id, attributes: attributes)
67
+ end
68
+
69
+ #
70
+ # App Info
71
+ #
72
+
73
+ def fetch_edit_app_info
74
+ states = [
75
+ Spaceship::ConnectAPI::AppInfo::AppStoreState::PREPARE_FOR_SUBMISSION,
76
+ Spaceship::ConnectAPI::AppInfo::AppStoreState::DEVELOPER_REJECTED,
77
+ Spaceship::ConnectAPI::AppInfo::AppStoreState::REJECTED,
78
+ Spaceship::ConnectAPI::AppInfo::AppStoreState::METADATA_REJECTED
79
+ ]
80
+
81
+ resp = Spaceship::ConnectAPI.get_app_infos(app_id: id)
82
+ return resp.to_models.select do |model|
83
+ states.include?(model.app_store_state)
84
+ end.first
85
+ end
86
+
87
+ #
88
+ # App Pricing
89
+ #
90
+
91
+ def fetch_app_prices(filter: {}, includes: "priceTier", limit: nil, sort: nil)
92
+ filter ||= {}
93
+ filter[:app] = id
94
+ resp = Spaceship::ConnectAPI.get_app_prices(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
95
+ return resp.to_models
96
+ end
97
+
98
+ def update_app_price_tier(app_price_tier_id: nil)
99
+ resp = Spaceship::ConnectAPI.patch_app_app_prices(app_id: id, app_price_tier_id: app_price_tier_id)
100
+ return resp.first
101
+ end
102
+
103
+ #
104
+ # App Store Versions
105
+ #
106
+
107
+ # Will make sure the current edit_version matches the given version number
108
+ # This will either create a new version or change the version number
109
+ # from an existing version
110
+ # @return (Bool) Was something changed?
111
+ def ensure_version!(version_string, platform: nil)
112
+ app_store_version = get_edit_app_store_version(platform: platform)
113
+
114
+ if app_store_version
115
+ if version_string != app_store_version.version_string
116
+ attributes = { versionString: version_string }
117
+ app_store_version.update(attributes: attributes)
118
+ return true
119
+ end
120
+ return false
121
+ else
122
+ attributes = { versionString: version_string, platform: platform }
123
+ Spaceship::ConnectAPI.post_app_store_version(app_id: id, attributes: attributes)
124
+
125
+ return true
126
+ end
127
+ end
128
+
129
+ def get_live_app_store_version(platform: nil, includes: nil)
130
+ platform ||= Spaceship::ConnectAPI::Platform::IOS
131
+ filter = {
132
+ appStoreState: [Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::READY_FOR_SALE].join(","),
133
+ platform: platform
134
+ }
135
+ return get_app_store_versions(filter: filter, includes: includes).first
136
+ end
137
+
138
+ def get_edit_app_store_version(platform: nil, includes: nil)
139
+ platform ||= Spaceship::ConnectAPI::Platform::IOS
140
+ filter = {
141
+ appStoreState: [
142
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PREPARE_FOR_SUBMISSION,
143
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::DEVELOPER_REJECTED,
144
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::REJECTED,
145
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::METADATA_REJECTED
146
+ ].join(","),
147
+ platform: platform
148
+ }
149
+ return get_app_store_versions(filter: filter, includes: includes).first
150
+ end
151
+
152
+ def get_app_store_versions(filter: {}, includes: nil, limit: nil, sort: nil)
153
+ resps = Spaceship::ConnectAPI.get_app_store_versions(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
154
+ return resps.flat_map(&:to_models)
155
+ end
156
+
48
157
  #
49
158
  # Beta Feedback
159
+ #
50
160
 
51
161
  def get_beta_feedback(filter: {}, includes: "tester,build,screenshots", limit: nil, sort: nil)
52
162
  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,74 @@
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)
42
+ end
43
+
44
+ def update_categories(primary_category_id: nil, secondary_category_id: nil, primary_subcategory_one_id: nil, primary_subcategory_two_id: nil, secondary_subcategory_one_id: nil, secondary_subcategory_two_id: nil)
45
+ Spaceship::ConnectAPI.patch_app_info_categories(
46
+ app_info_id: id,
47
+ primary_category_id: primary_category_id,
48
+ secondary_category_id: secondary_category_id,
49
+ primary_subcategory_one_id: primary_subcategory_one_id,
50
+ primary_subcategory_two_id: primary_subcategory_two_id,
51
+ secondary_subcategory_one_id: secondary_subcategory_one_id,
52
+ secondary_subcategory_two_id: secondary_subcategory_two_id
53
+ )
54
+ end
55
+
56
+ def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
57
+ Spaceship::ConnectAPI.delete_app_info(app_info_id: id)
58
+ end
59
+
60
+ #
61
+ # App Info Localizations
62
+ #
63
+
64
+ def create_app_info_localization(attributes: nil)
65
+ resp = Spaceship::ConnectAPI.post_app_info_localization(app_info_id: id, attributes: attributes)
66
+ return resp.to_models.first
67
+ end
68
+
69
+ def get_app_info_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
70
+ return Spaceship::ConnectAPI.get_app_info_localizations(app_info_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
71
+ end
72
+ end
73
+ end
74
+ 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