app_store_connect 0.29.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +12 -0
  3. data/.github/workflows/default.yml +34 -25
  4. data/.gitignore +0 -1
  5. data/.rubocop.yml +6 -2
  6. data/CHANGELOG.md +443 -0
  7. data/Gemfile.lock +201 -0
  8. data/README.md +113 -11
  9. data/app_store_connect.gemspec +8 -4
  10. data/assets/banner.png +0 -0
  11. data/bin/console +10 -0
  12. data/lib/app_store_connect/app_store_version_build_linkage_request.rb +1 -3
  13. data/lib/app_store_connect/app_store_version_create_request.rb +1 -3
  14. data/lib/app_store_connect/app_store_version_phased_release_create_request.rb +1 -3
  15. data/lib/app_store_connect/app_store_version_phased_release_update_request.rb +1 -3
  16. data/lib/app_store_connect/app_store_version_release_request_create_request.rb +1 -3
  17. data/lib/app_store_connect/app_store_version_update_request.rb +1 -3
  18. data/lib/app_store_connect/base.rb +83 -0
  19. data/lib/app_store_connect/beta_build_localization_create_request.rb +14 -0
  20. data/lib/app_store_connect/beta_build_localization_modify_request.rb +14 -0
  21. data/lib/app_store_connect/build_update_request.rb +1 -3
  22. data/lib/app_store_connect/bundle_id_capability_create_request.rb +1 -3
  23. data/lib/app_store_connect/bundle_id_create_request.rb +1 -3
  24. data/lib/app_store_connect/certificate_create_request.rb +1 -3
  25. data/lib/app_store_connect/client/builder.rb +91 -0
  26. data/lib/app_store_connect/client.rb +45 -71
  27. data/lib/app_store_connect/device_create_request.rb +1 -3
  28. data/lib/app_store_connect/object/data.rb +19 -7
  29. data/lib/app_store_connect/object/data_type.rb +23 -0
  30. data/lib/app_store_connect/object/included.rb +27 -0
  31. data/lib/app_store_connect/profile_create_request.rb +1 -3
  32. data/lib/app_store_connect/request/body.rb +26 -0
  33. data/lib/app_store_connect/request/builder/create.rb +69 -0
  34. data/lib/app_store_connect/request.rb +2 -2
  35. data/lib/app_store_connect/requests/delete_with_body.rb +11 -0
  36. data/lib/app_store_connect/requests/v1/app_store_version_localization/create.rb +25 -0
  37. data/lib/app_store_connect/requests/v1/app_store_version_localization/update.rb +25 -0
  38. data/lib/app_store_connect/requests/v1/beta_app_review_submission/create.rb +15 -0
  39. data/lib/app_store_connect/requests/v1/build_beta_detail/update.rb +20 -0
  40. data/lib/app_store_connect/requests/v1/build_beta_groups/create.rb +16 -0
  41. data/lib/app_store_connect/requests/v1/build_beta_groups/delete.rb +16 -0
  42. data/lib/app_store_connect/requests/v1/in_app_purchase_localization/create.rb +21 -0
  43. data/lib/app_store_connect/requests/v1/in_app_purchase_localization/update.rb +21 -0
  44. data/lib/app_store_connect/requests/v1/in_app_purchase_price_schedule/create.rb +15 -0
  45. data/lib/app_store_connect/requests/v1/in_app_purchase_review_screenshot/create.rb +20 -0
  46. data/lib/app_store_connect/requests/v1/in_app_purchase_review_screenshot/update.rb +21 -0
  47. data/lib/app_store_connect/requests/v1/in_app_purchase_submission/create.rb +15 -0
  48. data/lib/app_store_connect/requests/v2/in_app_purchase/create.rb +24 -0
  49. data/lib/app_store_connect/requests/v2/in_app_purchase/update.rb +23 -0
  50. data/lib/app_store_connect/review_submission_create_request.rb +1 -3
  51. data/lib/app_store_connect/review_submission_item_create_request.rb +1 -3
  52. data/lib/app_store_connect/review_submission_update_request.rb +1 -3
  53. data/lib/app_store_connect/specification/component/schema.rb +25 -0
  54. data/lib/app_store_connect/specification.rb +54 -0
  55. data/lib/app_store_connect/user_invitation_create_request.rb +1 -3
  56. data/lib/app_store_connect/version.rb +1 -1
  57. data/lib/app_store_connect.rb +4 -22
  58. data/lib/config/schema.json +175 -22
  59. data/lib/tasks/bundle.rake +7 -0
  60. data/lib/tasks/changelog.rake +17 -0
  61. data/lib/tasks/git.rake +19 -0
  62. data/lib/tasks/push.rake +18 -0
  63. data/lib/tasks/release.rake +11 -12
  64. data/lib/tasks/version.rake +4 -1
  65. metadata +98 -15
  66. data/lib/app_store_connect/create_request.rb +0 -14
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnect
4
+ module Requests
5
+ module V1
6
+ module InAppPurchaseReviewScreenshot
7
+ class Create < Request::Body
8
+ data do
9
+ type 'inAppPurchaseAppStoreReviewScreenshots'
10
+
11
+ attributes do
12
+ property :file_name, required: true
13
+ property :file_size, required: true
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnect
4
+ module Requests
5
+ module V1
6
+ module InAppPurchaseReviewScreenshot
7
+ class Update < Request::Body
8
+ data do
9
+ id
10
+ type 'inAppPurchaseAppStoreReviewScreenshots'
11
+
12
+ attributes do
13
+ property :uploaded
14
+ property :source_file_checksum
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnect
4
+ module Requests
5
+ module V1
6
+ module InAppPurchaseSubmission
7
+ class Create < Request::Body
8
+ data do
9
+ type 'inAppPurchaseSubmissions'
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnect
4
+ module Requests
5
+ module V2
6
+ module InAppPurchase
7
+ class Create < Request::Body
8
+ data do
9
+ type 'inAppPurchases'
10
+
11
+ attributes do
12
+ property :name, required: true
13
+ property :product_id, required: true
14
+ property :in_app_purchase_type, required: true
15
+ property :available_in_all_territories
16
+ property :family_sharable
17
+ property :review_note
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnect
4
+ module Requests
5
+ module V2
6
+ module InAppPurchase
7
+ class Update < Request::Body
8
+ data do
9
+ id
10
+ type 'inAppPurchases'
11
+
12
+ attributes do
13
+ property :name
14
+ property :available_in_all_territories
15
+ property :family_sharable
16
+ property :review_note
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,9 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'app_store_connect/create_request'
4
-
5
3
  module AppStoreConnect
6
- class ReviewSubmissionCreateRequest < CreateRequest
4
+ class ReviewSubmissionCreateRequest < Request::Body
7
5
  data do
8
6
  type 'reviewSubmissions'
9
7
 
@@ -1,9 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'app_store_connect/create_request'
4
-
5
3
  module AppStoreConnect
6
- class ReviewSubmissionItemCreateRequest < CreateRequest
4
+ class ReviewSubmissionItemCreateRequest < Request::Body
7
5
  data do
8
6
  type 'reviewSubmissionItems'
9
7
  end
@@ -1,9 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'app_store_connect/create_request'
4
-
5
3
  module AppStoreConnect
6
- class ReviewSubmissionUpdateRequest < CreateRequest
4
+ class ReviewSubmissionUpdateRequest < Request::Body
7
5
  data do
8
6
  id
9
7
  type 'reviewSubmissions'
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnect
4
+ class Specification
5
+ module Component
6
+ class Schema
7
+ def initialize(declaration)
8
+ @declaration = declaration
9
+ end
10
+
11
+ def properties
12
+ @declaration['properties']
13
+ end
14
+
15
+ def required
16
+ @declaration['required']
17
+ end
18
+
19
+ def title
20
+ @declaration['title']
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'net/http'
4
+ require 'app_store_connect/specification/component/schema'
5
+
6
+ module AppStoreConnect
7
+ class Specification
8
+ def initialize(hash)
9
+ @hash = hash
10
+ end
11
+
12
+ def find(version, type)
13
+ @hash['paths'].find do |path, _declaration|
14
+ path == "/#{version}/#{type}"
15
+ end&.[](-1)
16
+ end
17
+
18
+ def component_schema(ref)
19
+ Component::Schema.new(traverse(ref))
20
+ end
21
+
22
+ def traverse(ref)
23
+ _, *parts = ref.split('/')
24
+
25
+ @hash.dig(*parts)
26
+ end
27
+
28
+ def create_request_schema_ref(version, type)
29
+ declarations = find(version, type)
30
+ declarations['post']['requestBody']['content']['application/json']['schema']['$ref']
31
+ end
32
+
33
+ def self.read(path)
34
+ require 'zip'
35
+
36
+ Zip::File.open(path) do |zip_file|
37
+ entry, = zip_file.entries
38
+ content = entry.get_input_stream(&:read)
39
+
40
+ JSON.parse(content)
41
+ end
42
+ end
43
+
44
+ def self.download(path)
45
+ uri = URI('https://developer.apple.com/sample-code/app-store-connect/app-store-connect-openapi-specification.zip')
46
+
47
+ Net::HTTP.start(uri.host, uri.port, { use_ssl: true }) do |http|
48
+ response = http.get(uri.path)
49
+
50
+ File.write(path, response.body)
51
+ end
52
+ end
53
+ end
54
+ end
@@ -1,9 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'app_store_connect/create_request'
4
-
5
3
  module AppStoreConnect
6
- class UserInvitationCreateRequest < CreateRequest
4
+ class UserInvitationCreateRequest < Request::Body
7
5
  data do
8
6
  type 'userInvitations'
9
7
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppStoreConnect
4
- VERSION = '0.29.0'
4
+ VERSION = '0.38.0'
5
5
  end
@@ -1,28 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'app_store_connect/client'
4
- require 'app_store_connect/object/type'
5
- require 'app_store_connect/object/id'
6
- require 'app_store_connect/object/attributes'
7
- require 'app_store_connect/object/properties'
8
- require 'app_store_connect/object/data'
9
- require 'app_store_connect/version'
3
+ require 'zeitwerk'
4
+ require 'active_support/all'
10
5
 
11
- require 'app_store_connect/app_store_version_build_linkage_request'
12
- require 'app_store_connect/app_store_version_create_request'
13
- require 'app_store_connect/app_store_version_phased_release_create_request'
14
- require 'app_store_connect/app_store_version_phased_release_update_request'
15
- require 'app_store_connect/app_store_version_update_request'
16
- require 'app_store_connect/build_update_request'
17
- require 'app_store_connect/bundle_id_capability_create_request'
18
- require 'app_store_connect/bundle_id_create_request'
19
- require 'app_store_connect/certificate_create_request'
20
- require 'app_store_connect/device_create_request'
21
- require 'app_store_connect/profile_create_request'
22
- require 'app_store_connect/review_submission_create_request'
23
- require 'app_store_connect/review_submission_item_create_request'
24
- require 'app_store_connect/review_submission_update_request'
25
- require 'app_store_connect/user_invitation_create_request'
6
+ APP_STORE_CONNECT_LOADER = Zeitwerk::Loader.for_gem
7
+ APP_STORE_CONNECT_LOADER.setup
26
8
 
27
9
  module AppStoreConnect
28
10
  @config = {}
@@ -6,11 +6,7 @@
6
6
  "url": "https://api.appstoreconnect.apple.com/v1/users/{id}",
7
7
  "alias": "delete_user"
8
8
  },
9
- {
10
- "http_method": "delete",
11
- "url": "https://api.appstoreconnect.apple.com/v1/users/{id}/relationships/visibleApps",
12
- "alias": "delete_visible_app"
13
- },
9
+
14
10
  {
15
11
  "http_method": "delete",
16
12
  "url": "https://api.appstoreconnect.apple.com/v1/bundleIdCapabilities/{id}",
@@ -84,7 +80,8 @@
84
80
  {
85
81
  "http_method": "delete",
86
82
  "url": "https://api.appstoreconnect.apple.com/v1/builds/{id}/relationships/betaGroups",
87
- "alias": "delete_build_beta_group"
83
+ "http_body_type": "Requests::V1::BuildBetaGroups::Delete",
84
+ "alias": "delete_build_beta_groups"
88
85
  },
89
86
  {
90
87
  "http_method": "delete",
@@ -96,12 +93,6 @@
96
93
  "url": "https://api.appstoreconnect.apple.com/v1/betaBuildLocalizations/{id}",
97
94
  "alias": "delete_beta_build_localizations"
98
95
  },
99
- {
100
- "alias": "create_certificate",
101
- "http_method": "post",
102
- "url": "https://api.appstoreconnect.apple.com/v1/certificates",
103
- "http_body_type": "CertificateCreateRequest"
104
- },
105
96
  {
106
97
  "alias": "create_profile",
107
98
  "http_method": "post",
@@ -121,17 +112,23 @@
121
112
  "http_method": "post"
122
113
  },
123
114
  {
124
- "alias": "create_bundle_id",
125
- "url": "https://api.appstoreconnect.apple.com/v1/bundleIds",
126
- "http_body_type": "BundleIdCreateRequest",
127
- "http_method": "post"
115
+ "http_method": "post",
116
+ "url": "https://api.appstoreconnect.apple.com/v1/builds/{id}/relationships/betaGroups",
117
+ "http_body_type": "Requests::V1::BuildBetaGroups::Create",
118
+ "alias": "add_build_beta_groups"
128
119
  },
129
120
  {
130
- "alias": "create_bundle_id_capability",
131
- "url": "https://api.appstoreconnect.apple.com/v1/bundleIdCapabilities",
132
- "http_body_type": "BundleIdCapabilityCreateRequest",
121
+ "alias": "create_beta_build_localization",
122
+ "url": "https://api.appstoreconnect.apple.com/v1/betaBuildLocalizations",
123
+ "http_body_type": "BetaBuildLocalizationCreateRequest",
133
124
  "http_method": "post"
134
125
  },
126
+ {
127
+ "alias": "modify_beta_build_localization",
128
+ "url": "https://api.appstoreconnect.apple.com/v1/betaBuildLocalizations/{id}",
129
+ "http_body_type": "BetaBuildLocalizationModifyRequest",
130
+ "http_method": "patch"
131
+ },
135
132
  {
136
133
  "http_method": "get",
137
134
  "url": "https://api.appstoreconnect.apple.com/v1/users",
@@ -322,6 +319,114 @@
322
319
  "url": "https://api.appstoreconnect.apple.com/v1/apps/{id}",
323
320
  "alias": "app"
324
321
  },
322
+ {
323
+ "http_method": "get",
324
+ "url": "https://api.appstoreconnect.apple.com/v1/apps/{id}/appPricePoints",
325
+ "alias": "app_price_points"
326
+ },
327
+ {
328
+ "http_method": "get",
329
+ "url": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}",
330
+ "alias": "in_app_purchase"
331
+ },
332
+ {
333
+ "alias": "create_in_app_purchase",
334
+ "http_body_type": "Requests::V2::InAppPurchase::Create",
335
+ "http_method": "post",
336
+ "url": "https://api.appstoreconnect.apple.com/v2/inAppPurchases"
337
+ },
338
+ {
339
+ "alias": "update_in_app_purchase",
340
+ "http_body_type": "Requests::V2::InAppPurchase::Update",
341
+ "http_method": "patch",
342
+ "url": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}"
343
+ },
344
+ {
345
+ "alias": "delete_in_app_purchase",
346
+ "http_method": "delete",
347
+ "url": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}"
348
+ },
349
+ {
350
+ "alias": "create_in_app_purchase_submission",
351
+ "http_body_type": "Requests::V1::InAppPurchaseSubmission::Create",
352
+ "http_method": "post",
353
+ "url": "https://api.appstoreconnect.apple.com/v1/inAppPurchaseSubmissions"
354
+ },
355
+ {
356
+ "alias": "review_screenshot_for_in_app_purchase",
357
+ "http_method": "get",
358
+ "url": "https://api.appstoreconnect.apple.com/v1/inAppPurchaseAppStoreReviewScreenshots/{id}"
359
+ },
360
+ {
361
+ "alias": "in_app_purchase_review_screenshot",
362
+ "http_method": "get",
363
+ "url": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}/appStoreReviewScreenshot"
364
+ },
365
+ {
366
+ "alias": "create_in_app_purchase_review_screenshot",
367
+ "http_body_type": "Requests::V1::InAppPurchaseReviewScreenshot::Create",
368
+ "http_method": "post",
369
+ "url": "https://api.appstoreconnect.apple.com/v1/inAppPurchaseAppStoreReviewScreenshots"
370
+ },
371
+ {
372
+ "alias": "update_in_app_purchase_app_store_review_screenshot",
373
+ "http_body_type": "Requests::V1::InAppPurchaseReviewScreenshot::Update",
374
+ "http_method": "patch",
375
+ "url": "https://api.appstoreconnect.apple.com/v1/inAppPurchaseAppStoreReviewScreenshots/{id}"
376
+ },
377
+ {
378
+ "http_method": "get",
379
+ "url": "https://api.appstoreconnect.apple.com/v1/apps/{id}/inAppPurchasesV2",
380
+ "alias": "app_in_app_purchases"
381
+ },
382
+ {
383
+ "http_method": "get",
384
+ "url": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}/pricePoints",
385
+ "alias": "in_app_purchase_price_points"
386
+ },
387
+ {
388
+ "alias": "create_in_app_purchase_price_schedule",
389
+ "http_body_type": "Requests::V1::InAppPurchasePriceSchedule::Create",
390
+ "http_method": "post",
391
+ "url": "https://api.appstoreconnect.apple.com/v1/inAppPurchasePriceSchedules"
392
+ },
393
+ {
394
+ "alias": "in_app_purchase_price_schedule",
395
+ "http_method": "get",
396
+ "url": "https://api.appstoreconnect.apple.com/v1/inAppPurchasePriceSchedules/{id}"
397
+ },
398
+ {
399
+ "alias": "in_app_purchase_current_price_point",
400
+ "http_method": "get",
401
+ "url": "https://api.appstoreconnect.apple.com/v1/inAppPurchasePriceSchedules/{id}/manualPrices"
402
+ },
403
+ {
404
+ "alias": "in_app_purchase_localizations",
405
+ "http_method": "get",
406
+ "url": "https://api.appstoreconnect.apple.com/v2/inAppPurchases/{id}/inAppPurchaseLocalizations"
407
+ },
408
+ {
409
+ "alias": "in_app_purchase_localization",
410
+ "http_method": "get",
411
+ "url": "https://api.appstoreconnect.apple.com/v1/inAppPurchaseLocalizations/{id}"
412
+ },
413
+ {
414
+ "alias": "create_in_app_purchase_localization",
415
+ "http_body_type": "Requests::V1::InAppPurchaseLocalization::Create",
416
+ "http_method": "post",
417
+ "url": "https://api.appstoreconnect.apple.com/v1/inAppPurchaseLocalizations"
418
+ },
419
+ {
420
+ "alias": "update_in_app_purchase_localization",
421
+ "http_body_type": "Requests::V1::InAppPurchaseLocalization::Update",
422
+ "http_method": "patch",
423
+ "url": "https://api.appstoreconnect.apple.com/v1/inAppPurchaseLocalizations/{id}"
424
+ },
425
+ {
426
+ "alias": "delete_in_app_purchase_localization",
427
+ "http_method": "delete",
428
+ "url": "https://api.appstoreconnect.apple.com/v1/inAppPurchaseLocalizations/{id}"
429
+ },
325
430
  {
326
431
  "http_method": "get",
327
432
  "url": "https://api.appstoreconnect.apple.com/v1/apps/{id}/betaGroups",
@@ -562,6 +667,12 @@
562
667
  "url": "https://api.appstoreconnect.apple.com/v1/buildBetaDetails/{id}",
563
668
  "alias": "build_beta_detail"
564
669
  },
670
+ {
671
+ "http_method": "patch",
672
+ "url": "https://api.appstoreconnect.apple.com/v1/buildBetaDetails/{id}",
673
+ "http_body_type": "Requests::V1::BuildBetaDetail::Update",
674
+ "alias": "update_build_beta_detail"
675
+ },
565
676
  {
566
677
  "http_method": "get",
567
678
  "url": "https://api.appstoreconnect.apple.com/v1/buildBetaDetails/{id}/build",
@@ -657,6 +768,12 @@
657
768
  "url": "https://api.appstoreconnect.apple.com/v1/betaAppReviewSubmissions",
658
769
  "alias": "beta_app_review_submissions"
659
770
  },
771
+ {
772
+ "url": "https://api.appstoreconnect.apple.com/v1/betaAppReviewSubmissions",
773
+ "http_body_type": "Requests::V1::BetaAppReviewSubmission::Create",
774
+ "http_method": "post",
775
+ "alias": "create_beta_app_review_submission"
776
+ },
660
777
  {
661
778
  "http_method": "get",
662
779
  "url": "https://api.appstoreconnect.apple.com/v1/betaAppReviewSubmissions/{id}",
@@ -714,6 +831,34 @@
714
831
  "alias": "app_store_version"
715
832
  },
716
833
 
834
+ {
835
+ "url": "https://api.appstoreconnect.apple.com/v1/appStoreVersionLocalizations",
836
+ "http_body_type": "Requests::V1::AppStoreVersionLocalization::Create",
837
+ "http_method": "post",
838
+ "alias": "create_app_store_version_localization"
839
+ },
840
+ {
841
+ "http_method": "patch",
842
+ "url": "https://api.appstoreconnect.apple.com/v1/appStoreVersionLocalizations/{id}",
843
+ "http_body_type": "Requests::V1::AppStoreVersionLocalization::Update",
844
+ "alias": "update_app_store_version_localization"
845
+ },
846
+ {
847
+ "http_method": "delete",
848
+ "url": "https://api.appstoreconnect.apple.com/v1/appStoreVersionLocalizations/{id}",
849
+ "alias": "delete_app_store_version_localization"
850
+ },
851
+ {
852
+ "http_method": "get",
853
+ "url": "https://api.appstoreconnect.apple.com/v1/appStoreVersionLocalizations/{id}",
854
+ "alias": "app_store_version_localization"
855
+ },
856
+ {
857
+ "http_method": "get",
858
+ "url": "https://api.appstoreconnect.apple.com/v1/appStoreVersions/{id}/appStoreVersionLocalizations",
859
+ "alias": "app_store_version_app_store_version_localizations"
860
+ },
861
+
717
862
  {
718
863
  "url": "https://api.appstoreconnect.apple.com/v1/appStoreVersionReleaseRequests",
719
864
  "http_body_type": "AppStoreVersionReleaseRequestCreateRequest",
@@ -780,6 +925,13 @@
780
925
  }
781
926
  ],
782
927
  "types": [
928
+ {
929
+ "type": "BundleIdPlatform",
930
+ "values": [
931
+ "IOS",
932
+ "MAC_OS"
933
+ ]
934
+ },
783
935
  {
784
936
  "type": "CapabilityType",
785
937
  "values": [
@@ -821,10 +973,11 @@
821
973
  ]
822
974
  },
823
975
  {
824
- "type": "BundleIdPlatform",
976
+ "type": "InAppPurchaseType",
825
977
  "values": [
826
- "IOS",
827
- "MAC_OS"
978
+ "CONSUMABLE",
979
+ "NON_CONSUMABLE",
980
+ "NON_RENEWING_SUBSCRIPTION"
828
981
  ]
829
982
  },
830
983
  {
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :bundle do
4
+ task :install do
5
+ `bundle install`
6
+ end
7
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'github_changelog_generator'
4
+
5
+ task :changelog, [:release] do |_task, args|
6
+ options = GitHubChangelogGenerator::Parser.default_options
7
+ options[:user] = 'kyledecot'
8
+ options[:project] = 'app_store_connect'
9
+ options[:future_release] = args[:release]
10
+
11
+ generator = GitHubChangelogGenerator::Generator.new(options)
12
+
13
+ log = generator.compound_changelog
14
+
15
+ output_filename = 'CHANGELOG.md'
16
+ File.open(output_filename, 'w') { |file| file.write(log) }
17
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :git do
4
+ task :add, [:extra] do |_task, args|
5
+ `git add #{args[:extra]}`
6
+ end
7
+
8
+ task :commit, [:message] do |_task, args|
9
+ `git commit -m "#{args[:message]}"`
10
+ end
11
+
12
+ task :tag, [:tag] do |_task, args|
13
+ `git tag #{args[:tag]}`
14
+ end
15
+
16
+ task :push, [:extra] do |_task, args|
17
+ `git push #{args[:extra]}`
18
+ end
19
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'app_store_connect/version'
4
+
5
+ version = AppStoreConnect::VERSION
6
+
7
+ desc "Push app_store_connect-#{version}.gem"
8
+ task :push, [:key] do |_task, args|
9
+ args.with_defaults(key: 'rubygems')
10
+
11
+ key = args.key.to_sym
12
+ host = {
13
+ rubygems: 'https://rubygems.org',
14
+ github: 'https://rubygems.pkg.github.com/kyledecot'
15
+ }.fetch(key)
16
+
17
+ sh %(gem push --key=#{key} --host=#{host} app_store_connect-#{version}.gem)
18
+ end
@@ -2,17 +2,16 @@
2
2
 
3
3
  require 'app_store_connect/version'
4
4
 
5
- version = AppStoreConnect::VERSION
5
+ desc 'Release'
6
+ task :release do
7
+ version_increment, = Rake::Task['version:increment'].invoke
8
+ version = version_increment.call
6
9
 
7
- desc "Release app_store_connect-#{version}.gem"
8
- task :release, [:key] do |_task, args|
9
- args.with_defaults(key: 'rubygems')
10
-
11
- key = args.key.to_sym
12
- host = {
13
- rubygems: 'https://rubygems.org',
14
- github: 'https://rubygems.pkg.github.com/kyledecot'
15
- }.fetch(key)
16
-
17
- sh %(gem push --key=#{key} --host=#{host} app_store_connect-#{version}.gem)
10
+ Rake::Task['bundle:install'].invoke
11
+ Rake::Task['changelog'].invoke("v#{version}")
12
+ Rake::Task['git:add'].invoke('-A')
13
+ Rake::Task['git:commit'].invoke("v#{version}")
14
+ Rake::Task['git:tag'].invoke("v#{version}")
15
+ Rake::Task['git:push'].invoke('origin main')
16
+ Rake::Task['git:push'].invoke("origin v#{version}")
18
17
  end
@@ -13,13 +13,16 @@ namespace :version do
13
13
  task :increment do
14
14
  version = Semantic::Version.new(AppStoreConnect::VERSION)
15
15
  path = File.expand_path(File.join('..', 'app_store_connect', 'version.rb'), __dir__)
16
+ new_version = version.increment!(:minor).to_s
16
17
 
17
18
  File.open(path, 'r+') do |file|
18
19
  contents = file.read
19
- contents.gsub!(AppStoreConnect::VERSION, version.increment!(:minor).to_s)
20
+ contents.gsub!(AppStoreConnect::VERSION, new_version)
20
21
 
21
22
  file.rewind
22
23
  file.write(contents)
24
+
25
+ new_version
23
26
  end
24
27
  end
25
28
  end