app_store_connect 0.27.0 → 0.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/default.yml +1 -1
- data/README.md +65 -7
- data/app_store_connect.gemspec +0 -1
- data/lib/app_store_connect/app_store_version_phased_release_create_request.rb +15 -0
- data/lib/app_store_connect/app_store_version_phased_release_update_request.rb +16 -0
- data/lib/app_store_connect/build_update_request.rb +17 -0
- data/lib/app_store_connect/client.rb +0 -3
- data/lib/app_store_connect/object/data.rb +1 -1
- data/lib/app_store_connect/version.rb +1 -1
- data/lib/app_store_connect.rb +3 -0
- data/lib/config/schema.json +35 -1
- metadata +5 -17
- data/lib/app_store_connect/client/usage.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ef9f9632eeaad4a816afb0d83fcaa7ff57e794246d596a5c915336574bfa99c
|
4
|
+
data.tar.gz: 0b428bdd0afd39c066a49bf43fc5471710c70db5e24dd2f65b54d00235db6ef7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b47b98cc719f0a1b94ea6feecd68f714a4078f24059e9619bc2ae1bfc92f8e3bbf79432f101e4fbdbf2f3e024501e9c9d9b44ad635074f00426c18007b7b5b1
|
7
|
+
data.tar.gz: 6f23cbefcc7dee9f6ca0d7b2f6795c8111b0b9acfbbfdfbef75d4ff0d9ef6d90fa007d30ac4305881e6b1d102c9bb0ccfe3c835918af5e68d0e23cba9f00c6c8
|
@@ -143,7 +143,7 @@ jobs:
|
|
143
143
|
- name: Upload Release Asset
|
144
144
|
uses: actions/upload-release-asset@v1
|
145
145
|
env:
|
146
|
-
GITHUB_TOKEN: ${{ secrets.
|
146
|
+
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
147
147
|
with:
|
148
148
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
149
149
|
asset_path: app_store_connect-${{ env.APP_STORE_CONNECT_VERSION }}.gem
|
data/README.md
CHANGED
@@ -7,25 +7,29 @@ A Ruby interface to the [App Store Connect API](https://developer.apple.com/app-
|
|
7
7
|
|
8
8
|
Add this line to your application's Gemfile:
|
9
9
|
|
10
|
-
```
|
10
|
+
```Ruby
|
11
11
|
gem 'app_store_connect'
|
12
12
|
```
|
13
13
|
|
14
14
|
And then execute:
|
15
15
|
|
16
|
-
|
16
|
+
```Bash
|
17
|
+
$ bundle
|
18
|
+
```
|
17
19
|
|
18
20
|
Or install it yourself as:
|
19
21
|
|
20
|
-
|
22
|
+
```Bash
|
23
|
+
$ gem install app_store_connect
|
24
|
+
```
|
21
25
|
|
22
26
|
## Usage
|
23
27
|
|
24
|
-
```ruby
|
28
|
+
```ruby
|
25
29
|
AppStoreConnect.config = {
|
26
|
-
issuer_id: issuer_id,
|
27
|
-
key_id: key_id,
|
28
|
-
private_key:
|
30
|
+
issuer_id: 'issuer_id',
|
31
|
+
key_id: 'key_id',
|
32
|
+
private_key: File.read(File.new("/Path/AuthKey.p8"))
|
29
33
|
}
|
30
34
|
|
31
35
|
app_store_connect = AppStoreConnect::Client.new
|
@@ -58,6 +62,60 @@ app_store_connect.sales_reports(
|
|
58
62
|
)
|
59
63
|
```
|
60
64
|
|
65
|
+
### Fetch All Devices
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
|
69
|
+
fetchAllDevices = app_store_connect.devices
|
70
|
+
puts JSON.pretty_generate(fetchAllDevice)
|
71
|
+
|
72
|
+
```
|
73
|
+
|
74
|
+
### Register a New Device
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
result = app_store_connect.create_device(
|
78
|
+
name: 'name',
|
79
|
+
platform: 'IOS',
|
80
|
+
udid: 'udid'
|
81
|
+
)
|
82
|
+
|
83
|
+
puts JSON.pretty_generate(result)
|
84
|
+
```
|
85
|
+
|
86
|
+
### Update an App Store Version
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
app_store_connect.update_app_store_version id: '<app-store-version-id>', version_string: '1.0'
|
90
|
+
```
|
91
|
+
|
92
|
+
### Link a Build to an App Store Version
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
app_store_connect.update_app_store_version_build id: '<app-store-version-id>', build_id: '<build-id>'
|
96
|
+
```
|
97
|
+
|
98
|
+
### Create a Review Submission Item
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
app_store_connect.create_review_submission_item relationships: {reviewSubmission: {data: {id: '<review-submission-id>', type: 'reviewSubmissions'}},
|
102
|
+
appStoreVersion: {data: {id: '<app-store-version-id>', type: 'appStoreVersions'}}}
|
103
|
+
```
|
104
|
+
|
105
|
+
## Q&A
|
106
|
+
|
107
|
+
### How to understand the `devices, sales_reports, create_bundle_id` keyword seen in the demo?
|
108
|
+
|
109
|
+
It's function key from `schema.json` file.
|
110
|
+
|
111
|
+
### How to understand `()` in the demo, and when should use it? eg: `create_bundle_id()`, `sales_reports()`
|
112
|
+
|
113
|
+
`()` is mean: you have mapped to `http_body_type` in file `schema.json`
|
114
|
+
|
115
|
+
### How to set this content in `()`
|
116
|
+
|
117
|
+
`http_body_type` have a value type. Based on this value, we can find the definition of the relevant configuration in the source code of ruby.
|
118
|
+
|
61
119
|
## Development
|
62
120
|
|
63
121
|
After checking out the repo, run `bundle install` to install dependencies. Then, run `rake spec` to run the tests. You can also run `rake console` for an interactive prompt that will allow you to experiment.
|
data/app_store_connect.gemspec
CHANGED
@@ -25,7 +25,6 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_runtime_dependency 'activesupport', '>= 6.0.0'
|
27
27
|
spec.add_runtime_dependency 'jwt', '>= 1.4', '<= 2.5.0'
|
28
|
-
spec.add_runtime_dependency 'mixpanel-ruby', '<= 2.2.0'
|
29
28
|
|
30
29
|
spec.add_development_dependency 'bundler'
|
31
30
|
spec.add_development_dependency 'factory_bot', '~> 6.2.1'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'app_store_connect/create_request'
|
4
|
+
|
5
|
+
module AppStoreConnect
|
6
|
+
class AppStoreVersionPhasedReleaseCreateRequest < CreateRequest
|
7
|
+
data do
|
8
|
+
type 'appStoreVersionPhasedReleases'
|
9
|
+
|
10
|
+
attributes do
|
11
|
+
property :phased_release_state
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'app_store_connect/create_request'
|
4
|
+
|
5
|
+
module AppStoreConnect
|
6
|
+
class AppStoreVersionPhasedReleaseUpdateRequest < CreateRequest
|
7
|
+
data do
|
8
|
+
id
|
9
|
+
type 'appStoreVersionPhasedReleases'
|
10
|
+
|
11
|
+
attributes do
|
12
|
+
property :phased_release_state
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'app_store_connect/create_request'
|
4
|
+
|
5
|
+
module AppStoreConnect
|
6
|
+
class BuildUpdateRequest < CreateRequest
|
7
|
+
data do
|
8
|
+
id
|
9
|
+
type 'builds'
|
10
|
+
|
11
|
+
attributes do
|
12
|
+
property :expired
|
13
|
+
property :uses_non_exempt_encryption
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -6,7 +6,6 @@ require 'app_store_connect/request'
|
|
6
6
|
require 'app_store_connect/schema'
|
7
7
|
require 'app_store_connect/client/authorization'
|
8
8
|
require 'app_store_connect/client/options'
|
9
|
-
require 'app_store_connect/client/usage'
|
10
9
|
require 'app_store_connect/client/registry'
|
11
10
|
require 'app_store_connect/client/utils'
|
12
11
|
|
@@ -14,7 +13,6 @@ module AppStoreConnect
|
|
14
13
|
class Client
|
15
14
|
def initialize(**kwargs)
|
16
15
|
@options = Options.new(kwargs)
|
17
|
-
@usage = Usage.new(@options.slice(*Usage::OPTIONS))
|
18
16
|
@authorization = Authorization.new(@options.slice(*Authorization::OPTIONS))
|
19
17
|
@registry = Registry.new(@options.slice(*Registry::OPTIONS))
|
20
18
|
end
|
@@ -48,7 +46,6 @@ module AppStoreConnect
|
|
48
46
|
|
49
47
|
request = build_request(web_service_endpoint, **kwargs)
|
50
48
|
|
51
|
-
@usage.track
|
52
49
|
response = request.execute
|
53
50
|
|
54
51
|
Utils.decode(response.body, response.content_type) if response.body
|
data/lib/app_store_connect.rb
CHANGED
@@ -10,7 +10,10 @@ require 'app_store_connect/version'
|
|
10
10
|
|
11
11
|
require 'app_store_connect/app_store_version_build_linkage_request'
|
12
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'
|
13
15
|
require 'app_store_connect/app_store_version_update_request'
|
16
|
+
require 'app_store_connect/build_update_request'
|
14
17
|
require 'app_store_connect/bundle_id_capability_create_request'
|
15
18
|
require 'app_store_connect/bundle_id_create_request'
|
16
19
|
require 'app_store_connect/certificate_create_request'
|
data/lib/config/schema.json
CHANGED
@@ -673,6 +673,13 @@
|
|
673
673
|
"alias": "beta_app_review_submission_build"
|
674
674
|
},
|
675
675
|
|
676
|
+
{
|
677
|
+
"http_method": "patch",
|
678
|
+
"url": "https://api.appstoreconnect.apple.com/v1/builds/{id}",
|
679
|
+
"http_body_type": "BuildUpdateRequest",
|
680
|
+
"alias": "update_build"
|
681
|
+
},
|
682
|
+
|
676
683
|
{
|
677
684
|
"url": "https://api.appstoreconnect.apple.com/v1/appStoreVersions",
|
678
685
|
"http_body_type": "AppStoreVersionCreateRequest",
|
@@ -707,6 +714,24 @@
|
|
707
714
|
"alias": "app_store_version"
|
708
715
|
},
|
709
716
|
|
717
|
+
{
|
718
|
+
"url": "https://api.appstoreconnect.apple.com/v1/appStoreVersionPhasedReleases",
|
719
|
+
"http_body_type": "AppStoreVersionPhasedReleaseCreateRequest",
|
720
|
+
"http_method": "post",
|
721
|
+
"alias": "create_app_store_version_phased_release"
|
722
|
+
},
|
723
|
+
{
|
724
|
+
"http_method": "patch",
|
725
|
+
"url": "https://api.appstoreconnect.apple.com/v1/appStoreVersionPhasedReleases/{id}",
|
726
|
+
"http_body_type": "AppStoreVersionPhasedReleaseUpdateRequest",
|
727
|
+
"alias": "update_app_store_version_phased_release"
|
728
|
+
},
|
729
|
+
{
|
730
|
+
"http_method": "delete",
|
731
|
+
"url": "https://api.appstoreconnect.apple.com/v1/appStoreVersionPhasedReleases/{id}",
|
732
|
+
"alias": "delete_app_store_version_phased_release"
|
733
|
+
},
|
734
|
+
|
710
735
|
{
|
711
736
|
"url": "https://api.appstoreconnect.apple.com/v1/reviewSubmissions",
|
712
737
|
"http_body_type": "ReviewSubmissionCreateRequest",
|
@@ -736,7 +761,7 @@
|
|
736
761
|
},
|
737
762
|
|
738
763
|
{
|
739
|
-
"url": "https://api.appstoreconnect.apple.com/v1/
|
764
|
+
"url": "https://api.appstoreconnect.apple.com/v1/reviewSubmissionItems",
|
740
765
|
"http_body_type": "ReviewSubmissionItemCreateRequest",
|
741
766
|
"http_method": "post",
|
742
767
|
"alias": "create_review_submission_item"
|
@@ -803,6 +828,15 @@
|
|
803
828
|
"TV_OS"
|
804
829
|
]
|
805
830
|
},
|
831
|
+
{
|
832
|
+
"type": "PhasedReleaseState",
|
833
|
+
"values": [
|
834
|
+
"INACTIVE",
|
835
|
+
"ACTIVE",
|
836
|
+
"PAUSED",
|
837
|
+
"COMPLETE"
|
838
|
+
]
|
839
|
+
},
|
806
840
|
{
|
807
841
|
"type": "UserRole",
|
808
842
|
"values": [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app_store_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Decot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -44,20 +44,6 @@ dependencies:
|
|
44
44
|
- - "<="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 2.5.0
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: mixpanel-ruby
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - "<="
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: 2.2.0
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - "<="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 2.2.0
|
61
47
|
- !ruby/object:Gem::Dependency
|
62
48
|
name: bundler
|
63
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -236,7 +222,10 @@ files:
|
|
236
222
|
- lib/app_store_connect.rb
|
237
223
|
- lib/app_store_connect/app_store_version_build_linkage_request.rb
|
238
224
|
- lib/app_store_connect/app_store_version_create_request.rb
|
225
|
+
- lib/app_store_connect/app_store_version_phased_release_create_request.rb
|
226
|
+
- lib/app_store_connect/app_store_version_phased_release_update_request.rb
|
239
227
|
- lib/app_store_connect/app_store_version_update_request.rb
|
228
|
+
- lib/app_store_connect/build_update_request.rb
|
240
229
|
- lib/app_store_connect/bundle_id_capability_create_request.rb
|
241
230
|
- lib/app_store_connect/bundle_id_create_request.rb
|
242
231
|
- lib/app_store_connect/certificate_create_request.rb
|
@@ -244,7 +233,6 @@ files:
|
|
244
233
|
- lib/app_store_connect/client/authorization.rb
|
245
234
|
- lib/app_store_connect/client/options.rb
|
246
235
|
- lib/app_store_connect/client/registry.rb
|
247
|
-
- lib/app_store_connect/client/usage.rb
|
248
236
|
- lib/app_store_connect/client/utils.rb
|
249
237
|
- lib/app_store_connect/create_request.rb
|
250
238
|
- lib/app_store_connect/device_create_request.rb
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'mixpanel-ruby'
|
4
|
-
require 'securerandom'
|
5
|
-
require 'app_store_connect/version'
|
6
|
-
|
7
|
-
module AppStoreConnect
|
8
|
-
class Client
|
9
|
-
class Usage
|
10
|
-
OPTIONS = %i[analytics_enabled].freeze
|
11
|
-
|
12
|
-
MIXPANEL_PROJECT_TOKEN = '1213f2b88b9b10b13d321f4c67a55ca8'
|
13
|
-
private_constant :MIXPANEL_PROJECT_TOKEN
|
14
|
-
|
15
|
-
def initialize(options = {})
|
16
|
-
@enabled = options[:analytics_enabled].to_s == 'true'
|
17
|
-
@distinct_id = SecureRandom.uuid
|
18
|
-
@tracker = Mixpanel::Tracker.new(MIXPANEL_PROJECT_TOKEN)
|
19
|
-
end
|
20
|
-
|
21
|
-
def track
|
22
|
-
return false unless @enabled
|
23
|
-
|
24
|
-
@tracker.track(@distinct_id, 'usage', version: VERSION)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|