app_store_connect 0.26.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_build_linkage_request.rb +12 -0
- data/lib/app_store_connect/app_store_version_create_request.rb +19 -0
- 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/app_store_version_update_request.rb +20 -0
- data/lib/app_store_connect/build_update_request.rb +17 -0
- data/lib/app_store_connect/client.rb +2 -5
- data/lib/app_store_connect/object/data.rb +5 -1
- data/lib/app_store_connect/object/id.rb +28 -0
- data/lib/app_store_connect/review_submission_create_request.rb +15 -0
- data/lib/app_store_connect/review_submission_item_create_request.rb +11 -0
- data/lib/app_store_connect/review_submission_update_request.rb +17 -0
- data/lib/app_store_connect/version.rb +1 -1
- data/lib/app_store_connect.rb +12 -2
- data/lib/config/schema.json +817 -701
- metadata +12 -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,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'app_store_connect/create_request'
|
4
|
+
|
5
|
+
module AppStoreConnect
|
6
|
+
class AppStoreVersionCreateRequest < CreateRequest
|
7
|
+
data do
|
8
|
+
type 'appStoreVersions'
|
9
|
+
|
10
|
+
attributes do
|
11
|
+
property :copyright
|
12
|
+
property :earliest_release_date
|
13
|
+
property :platform, required: true
|
14
|
+
property :release_type
|
15
|
+
property :version_string, required: true
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -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,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'app_store_connect/create_request'
|
4
|
+
|
5
|
+
module AppStoreConnect
|
6
|
+
class AppStoreVersionUpdateRequest < CreateRequest
|
7
|
+
data do
|
8
|
+
id
|
9
|
+
type 'appStoreVersions'
|
10
|
+
|
11
|
+
attributes do
|
12
|
+
property :copyright
|
13
|
+
property :earliest_release_date
|
14
|
+
property :release_type
|
15
|
+
property :version_string
|
16
|
+
property :downloadable
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
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
|
@@ -44,11 +42,10 @@ module AppStoreConnect
|
|
44
42
|
private
|
45
43
|
|
46
44
|
def call(web_service_endpoint, **kwargs)
|
47
|
-
raise "invalid http method: #{web_service_endpoint.http_method}" unless %i[get delete post].include?(web_service_endpoint.http_method)
|
45
|
+
raise "invalid http method: #{web_service_endpoint.http_method}" unless %i[get delete post patch].include?(web_service_endpoint.http_method)
|
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
|
@@ -80,7 +77,7 @@ module AppStoreConnect
|
|
80
77
|
headers: headers
|
81
78
|
}
|
82
79
|
|
83
|
-
options[:http_body] = http_body(web_service_endpoint, **kwargs) if web_service_endpoint.http_method
|
80
|
+
options[:http_body] = http_body(web_service_endpoint, **kwargs) if %i[post patch].include?(web_service_endpoint.http_method)
|
84
81
|
|
85
82
|
Request.new(**options)
|
86
83
|
end
|
@@ -13,18 +13,22 @@ module AppStoreConnect
|
|
13
13
|
klass = Class.new do |data|
|
14
14
|
include Object::Attributes
|
15
15
|
include Object::Type
|
16
|
+
include Object::Id
|
16
17
|
|
17
18
|
data.send(:define_method, :initialize) do |**kwargs|
|
18
19
|
instance_variable_set('@relationships', kwargs.delete(:relationships).to_h)
|
19
20
|
instance_variable_set('@attributes', data::Attributes.new(**kwargs))
|
21
|
+
instance_variable_set('@id', kwargs[id_arg_name])
|
20
22
|
end
|
21
23
|
|
22
24
|
def to_h
|
23
|
-
{
|
25
|
+
props = {
|
24
26
|
relationships: @relationships,
|
25
27
|
attributes: attributes.to_h,
|
26
28
|
type: type
|
27
29
|
}
|
30
|
+
props[:id] = @id if id?
|
31
|
+
props.reject { |_k, v| v.blank? }
|
28
32
|
end
|
29
33
|
end
|
30
34
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/concern'
|
4
|
+
|
5
|
+
module AppStoreConnect
|
6
|
+
module Object
|
7
|
+
module Id
|
8
|
+
extend ActiveSupport::Concern
|
9
|
+
|
10
|
+
class_methods do
|
11
|
+
def id(arg_name = :id)
|
12
|
+
@include_id_in_body = true
|
13
|
+
@id_arg_name = arg_name
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
included do
|
18
|
+
def id?
|
19
|
+
self.class.instance_variable_get('@include_id_in_body')
|
20
|
+
end
|
21
|
+
|
22
|
+
def id_arg_name
|
23
|
+
self.class.instance_variable_get('@id_arg_name')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'app_store_connect/create_request'
|
4
|
+
|
5
|
+
module AppStoreConnect
|
6
|
+
class ReviewSubmissionCreateRequest < CreateRequest
|
7
|
+
data do
|
8
|
+
type 'reviewSubmissions'
|
9
|
+
|
10
|
+
attributes do
|
11
|
+
property :platform, required: true
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'app_store_connect/create_request'
|
4
|
+
|
5
|
+
module AppStoreConnect
|
6
|
+
class ReviewSubmissionUpdateRequest < CreateRequest
|
7
|
+
data do
|
8
|
+
id
|
9
|
+
type 'reviewSubmissions'
|
10
|
+
|
11
|
+
attributes do
|
12
|
+
property :canceled
|
13
|
+
property :submitted
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/app_store_connect.rb
CHANGED
@@ -2,17 +2,27 @@
|
|
2
2
|
|
3
3
|
require 'app_store_connect/client'
|
4
4
|
require 'app_store_connect/object/type'
|
5
|
+
require 'app_store_connect/object/id'
|
5
6
|
require 'app_store_connect/object/attributes'
|
6
7
|
require 'app_store_connect/object/properties'
|
7
8
|
require 'app_store_connect/object/data'
|
8
9
|
require 'app_store_connect/version'
|
9
10
|
|
10
|
-
require 'app_store_connect/
|
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'
|
11
17
|
require 'app_store_connect/bundle_id_capability_create_request'
|
18
|
+
require 'app_store_connect/bundle_id_create_request'
|
12
19
|
require 'app_store_connect/certificate_create_request'
|
13
20
|
require 'app_store_connect/device_create_request'
|
14
|
-
require 'app_store_connect/user_invitation_create_request'
|
15
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'
|
16
26
|
|
17
27
|
module AppStoreConnect
|
18
28
|
@config = {}
|