fabricio 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +7 -0
  2. data/.codeclimate.yml +12 -0
  3. data/.idea/runConfigurations/IRB_console__fabricio.xml +23 -0
  4. data/.rspec +2 -0
  5. data/.rubocop.yml +1156 -0
  6. data/.travis.yml +10 -0
  7. data/CODE_OF_CONDUCT.md +74 -0
  8. data/Gemfile +4 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +149 -0
  11. data/Rakefile +6 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +8 -0
  14. data/docs/api_reference.md +611 -0
  15. data/docs/swagger-api.json +553 -0
  16. data/fabricio.gemspec +29 -0
  17. data/lib/fabricio.rb +2 -0
  18. data/lib/fabricio/authorization/abstract_session_storage.rb +26 -0
  19. data/lib/fabricio/authorization/authorization_client.rb +122 -0
  20. data/lib/fabricio/authorization/memory_session_storage.rb +35 -0
  21. data/lib/fabricio/authorization/session.rb +21 -0
  22. data/lib/fabricio/client/client.rb +92 -0
  23. data/lib/fabricio/models/abstract_model.rb +17 -0
  24. data/lib/fabricio/models/app.rb +24 -0
  25. data/lib/fabricio/models/build.rb +23 -0
  26. data/lib/fabricio/models/organization.rb +22 -0
  27. data/lib/fabricio/models/point.rb +17 -0
  28. data/lib/fabricio/networking/app_request_model_factory.rb +229 -0
  29. data/lib/fabricio/networking/build_request_model_factory.rb +103 -0
  30. data/lib/fabricio/networking/network_client.rb +101 -0
  31. data/lib/fabricio/networking/organization_request_model_factory.rb +27 -0
  32. data/lib/fabricio/networking/request_model.rb +39 -0
  33. data/lib/fabricio/services/app_service.rb +146 -0
  34. data/lib/fabricio/services/build_service.rb +59 -0
  35. data/lib/fabricio/services/organization_service.rb +33 -0
  36. data/lib/fabricio/version.rb +3 -0
  37. metadata +163 -0
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.2.1
5
+ before_install: gem install bundler -v 1.13.5
6
+ addons:
7
+ code_climate:
8
+ repo_token: e4de543181c2bc71c778f9112f45e35467bdd3b8ef58ec4621f5b556ff54c141
9
+ after_success:
10
+ - bundle exec codeclimate-test-reporter
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at e.tolstoy@rambler-co.ru. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fabricio.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Rambler Digital Solutions
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,149 @@
1
+ # Fabricio
2
+
3
+ [![](https://travis-ci.org/etolstoy/fabricio.svg?branch=develop)](https://travis-ci.org/etolstoy/fabricio)
4
+ [![Code Climate](https://codeclimate.com/github/etolstoy/fabricio/badges/gpa.svg)](https://codeclimate.com/github/etolstoy/fabricio)
5
+ [![Test Coverage](https://codeclimate.com/github/etolstoy/fabricio/badges/coverage.svg)](https://codeclimate.com/github/etolstoy/fabricio/coverage)
6
+
7
+ > pronounce as [f-ah-bree-see-oh]
8
+
9
+ A simple gem that fetches mobile application statistics from [Fabric.io](http://fabric.io) using its ~~private~~ not publicly opened [API](https://github.com/etolstoy/fabricio/blob/develop/docs/api_reference.md).
10
+
11
+ There is a possibility that in some point of time it may break. Feel free to [post an issue](https://github.com/etolstoy/fabricio/issues) and we'll fix it ASAP.
12
+
13
+ ## The Story Behind
14
+
15
+ [Fabric.io](http://fabric.io) is a great tool made for mobile application developers. It provides data about standard and out-of-memory crashes, active users, audience growth and a lot more. Unfortunately the only official way to work with this data is using Fabric.io website. That means - no automation and no integrations with other services.
16
+
17
+ We decided to fix this issue.
18
+
19
+ | Key Features
20
+ ---------|---------------
21
+ 🍫 | Hides the complexity of different Fabric.io APIs behind a simple wrapper.
22
+ 📚 | Provides data about organization, applications and builds.
23
+ 💥 | Shows crash- and out-of-memory- free metrics.
24
+ ⏰ | Automatically refreshes session in case of its expiration.
25
+ 🛠 | Provides a simple way of adding your adapter for storing session data in a database of your choice.
26
+
27
+ ## Installation
28
+
29
+ Add this line to your application's Gemfile:
30
+
31
+ ```ruby
32
+ gem 'fabricio'
33
+ ```
34
+
35
+ And then execute:
36
+
37
+ $ bundle
38
+
39
+ Or install it yourself as:
40
+
41
+ $ gem install fabricio
42
+
43
+ ## Quick Start
44
+
45
+ 1. Create a `Fabricio::Client` object and configure it on initialization.
46
+
47
+ ```ruby
48
+ client = Fabricio::Client.new do |config|
49
+ config.username = 'your_email'
50
+ config.password = 'your_password'
51
+ end
52
+ ```
53
+
54
+ 2. Use this client to query any data you want.
55
+
56
+ ```ruby
57
+ client.app.all # Returns all applications on your account
58
+ client.app.get('app_id') # Returns information about specific application
59
+ client.app.crashfree('app_id', '1478736000', '1481328000' 'all') # Returns application crashfree for a given period of time
60
+ client.organization.get # Returns information about your organization
61
+ ```
62
+
63
+ 3. If you want to check the exact server output for a model, you can call `json` method on it:
64
+
65
+ `client.app.get('app_id').json`
66
+
67
+ You can call a method similar to any key in this hash:
68
+
69
+ `client.app.get('app_id').importance_level`
70
+
71
+ ## Commands
72
+
73
+ ### Organization
74
+
75
+ #### `client.organization.get`
76
+
77
+ Obtains information about your organization.
78
+
79
+ ### App
80
+
81
+ #### `client.app.all`
82
+
83
+ Obtains the list of all apps.
84
+
85
+ #### `client.app.get('app_id')`
86
+
87
+ Obtains a specific app.
88
+
89
+ #### `client.app.active_now('app_id')`
90
+
91
+ Obtains the count of active users at the current moment.
92
+
93
+ #### `client.app.daily_new('app_id', 'start_timestamp', 'end_timestamp')`
94
+
95
+ Obtains the count of daily new users.
96
+
97
+ #### `client.app.daily_active('app_id', 'start_timestamp', 'end_timestamp', 'build')`
98
+
99
+ Obtains the count of daily active users.
100
+
101
+ #### `client.app.total_sessions('app_id', 'start_timestamp', 'end_timestamp', 'build')`
102
+
103
+ Obtains the count of sessions.
104
+
105
+ #### `client.app.crashes('app_id', 'start_timestamp', 'end_timestamp', 'builds')`
106
+
107
+ Obtains the count of crashes for a number of builds.
108
+
109
+ #### `client.app.crashfree('app_id', 'start_timestamp', 'end_timestamp', 'build')`
110
+
111
+ Obtains application crashfree.
112
+
113
+ > Fabric.io website uses the same calculations. However, mobile app behaves differently and shows another value.
114
+
115
+ #### `client.app.oomfree('app_id', 'start_timestamp', 'end_timestamp', 'builds')`
116
+
117
+ Obtains application out-of-memory free for a number of builds.
118
+
119
+ ### Build
120
+
121
+ #### `client.build.all('app_id')`
122
+
123
+ Obtains the list of all application builds.
124
+
125
+ #### `client.build.get('app_id', 'version', 'build_number')`
126
+
127
+ Obtains a specific build for a specific application.
128
+
129
+ #### `client.build.top_versions('app_id', 'start_timestamp', 'end_timestamp')`
130
+
131
+ Obtains an array of top versions for a given application.
132
+
133
+ ## Additional Info
134
+
135
+ Fabric.io API:
136
+
137
+ - [cURL requests](https://github.com/etolstoy/fabricio/blob/develop/docs/api_reference.md)
138
+ - [Swagger](https://github.com/etolstoy/fabricio/blob/develop/docs/swagger-api.json)
139
+
140
+ ## Authors
141
+
142
+ - Egor Tolstoy
143
+
144
+ Thanks for help in dealing with API to Vadim Smal, Irina Dyagileva and Andrey Smirnov.
145
+
146
+ ## License
147
+
148
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
149
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "fabricio"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,611 @@
1
+ # API
2
+
3
+ ## Requests
4
+
5
+ ### **POST** - /oauth/token
6
+
7
+ #### CURL
8
+
9
+ ```sh
10
+ curl -X POST "https://fabric.io/oauth/token" \
11
+ -H "Content-Type: application/json" \
12
+ --data-raw "$body"
13
+ ```
14
+
15
+ #### Header Parameters
16
+
17
+ - **Content-Type** should respect the following schema:
18
+
19
+ ```
20
+ {
21
+ "type": "string",
22
+ "enum": [
23
+ "application/json"
24
+ ],
25
+ "default": "application/json"
26
+ }
27
+ ```
28
+
29
+ #### Body Parameters
30
+
31
+ - **body** should respect the following schema:
32
+
33
+ ```
34
+ {
35
+ "type": "string",
36
+ "default": "{\"grant_type\":\"password\",\"scope\":\"organizations apps issues features account twitter_client_apps beta software answers\",\"username\":\"email@rambler.ru\",\"password\":\"pa$$word\",\"client_id\":\"your_client_id\",\"client_secret\":\"your_client_secret\"}"
37
+ }
38
+ ```
39
+
40
+ ### **GET** - /api/v2/organizations
41
+
42
+ #### CURL
43
+
44
+ ```sh
45
+ curl -X GET "https://fabric.io/api/v2/organizations" \
46
+ -H "Authorization: Bearer {access_token}"
47
+ ```
48
+
49
+ #### Header Parameters
50
+
51
+ - **Authorization** should respect the following schema:
52
+
53
+ ```
54
+ {
55
+ "type": "string",
56
+ "default": "Bearer {access_token}"
57
+ }
58
+ ```
59
+
60
+ ### **GET** - /api/v2/apps
61
+
62
+ #### CURL
63
+
64
+ ```sh
65
+ curl -X GET "https://fabric.io/api/v2/apps" \
66
+ -H "Authorization: Bearer {access_token}"
67
+ ```
68
+
69
+ #### Header Parameters
70
+
71
+ - **Authorization** should respect the following schema:
72
+
73
+ ```
74
+ {
75
+ "type": "string",
76
+ "default": "Bearer {access_token}"
77
+ }
78
+ ```
79
+
80
+ ### **GET** - /api/v2/apps/{app_id}
81
+
82
+ #### CURL
83
+
84
+ ```sh
85
+ curl -X GET "https://fabric.io/api/v2/apps/{app_id}" \
86
+ -H "Authorization: Bearer {access_token}"
87
+ ```
88
+
89
+ #### Header Parameters
90
+
91
+ - **Authorization** should respect the following schema:
92
+
93
+ ```
94
+ {
95
+ "type": "string",
96
+ "default": "Bearer {access_token}"
97
+ }
98
+ ```
99
+
100
+ ### **GET** - /api/v2/organizations/{organization_id}/apps/{app_id}/growth_analytics/active_now.json
101
+
102
+ #### CURL
103
+
104
+ ```sh
105
+ curl -X GET "https://fabric.io/api/v2/organizations/{organization_id}/apps/{app_id}/growth_analytics/active_now.json\
106
+ ?build=all" \
107
+ -H "Authorization: Bearer {access_token}"
108
+ ```
109
+
110
+ #### Path Parameters
111
+
112
+ - **ResponseBodyPath** should respect the following schema:
113
+
114
+ ```
115
+ {
116
+ "type": "string",
117
+ "default": "{organization_id}"
118
+ }
119
+ ```
120
+
121
+ #### Query Parameters
122
+
123
+ - **build** should respect the following schema:
124
+
125
+ ```
126
+ {
127
+ "type": "string",
128
+ "enum": [
129
+ "all",
130
+ "x.x.x (y)"
131
+ ],
132
+ "default": "all"
133
+ }
134
+ ```
135
+
136
+ #### Header Parameters
137
+
138
+ - **Authorization** should respect the following schema:
139
+
140
+ ```
141
+ {
142
+ "type": "string",
143
+ "default": "Bearer {access_token}"
144
+ }
145
+ ```
146
+
147
+ ### **GET** - /api/v2/organizations/{organization_id}/apps/{app_id}/growth_analytics/daily_new.json
148
+
149
+ #### CURL
150
+
151
+ ```sh
152
+ curl -X GET "https://fabric.io/api/v2/organizations/{organization_id}/apps/{app_id}/growth_analytics/daily_new.json\
153
+ ?start=1478736000&end=1481328000&build=all" \
154
+ -H "Authorization: Bearer {access_token}"
155
+ ```
156
+
157
+ #### Path Parameters
158
+
159
+ - **ResponseBodyPath** should respect the following schema:
160
+
161
+ ```
162
+ {
163
+ "type": "string",
164
+ "default": "{organization_id}"
165
+ }
166
+ ```
167
+
168
+ #### Query Parameters
169
+
170
+ - **start** should respect the following schema:
171
+
172
+ ```
173
+ {
174
+ "type": "timestamp",
175
+ }
176
+ ```
177
+ - **end** should respect the following schema:
178
+
179
+ ```
180
+ {
181
+ "type": "timestamp",
182
+ }
183
+ ```
184
+ - **build** should respect the following schema:
185
+
186
+ ```
187
+ {
188
+ "type": "string",
189
+ "enum": [
190
+ "all",
191
+ "x.x.x (y)"
192
+ ],
193
+ "default": "all"
194
+ }
195
+ ```
196
+
197
+ #### Header Parameters
198
+
199
+ - **Authorization** should respect the following schema:
200
+
201
+ ```
202
+ {
203
+ "type": "string",
204
+ "default": "Bearer {access_token}"
205
+ }
206
+ ```
207
+
208
+ ### **GET** - /api/v2/organizations/{organization_id}/apps/{app_id}/growth_analytics/daily_active.json
209
+
210
+ #### CURL
211
+
212
+ ```sh
213
+ curl -X GET "https://fabric.io/api/v2/organizations/{organization_id}/apps/{app_id}/growth_analytics/daily_active.json\
214
+ ?start=1478736000&end=1481328000&build=3.0.4%20(71)" \
215
+ -H "Authorization: Bearer {access_token}"
216
+ ```
217
+
218
+ #### Path Parameters
219
+
220
+ - **ResponseBodyPath** should respect the following schema:
221
+
222
+ ```
223
+ {
224
+ "type": "string",
225
+ "default": "{organization_id}"
226
+ }
227
+ ```
228
+
229
+ #### Query Parameters
230
+
231
+ - **start** should respect the following schema:
232
+
233
+ ```
234
+ {
235
+ "type": "timestamp",
236
+ }
237
+ ```
238
+ - **end** should respect the following schema:
239
+
240
+ ```
241
+ {
242
+ "type": "timestamp",
243
+ }
244
+ ```
245
+ - **build** should respect the following schema:
246
+
247
+ ```
248
+ {
249
+ "type": "string",
250
+ "enum": [
251
+ "all",
252
+ "x.x.x (y)"
253
+ ],
254
+ "default": "all"
255
+ }
256
+ ```
257
+
258
+ #### Header Parameters
259
+
260
+ - **Authorization** should respect the following schema:
261
+
262
+ ```
263
+ {
264
+ "type": "string",
265
+ "default": "Bearer {access_token}"
266
+ }
267
+ ```
268
+
269
+ ### **POST** - /graphql
270
+
271
+ #### CURL
272
+
273
+ ```sh
274
+ curl -X POST "https://api-dash.fabric.io/graphql" \
275
+ -H "Authorization: Bearer {access_token}" \
276
+ -H "Content-Type: application/json" \
277
+ --data-raw "$body"
278
+ ```
279
+
280
+ #### Header Parameters
281
+
282
+ - **Authorization** should respect the following schema:
283
+
284
+ ```
285
+ {
286
+ "type": "string",
287
+ "default": "Bearer {access_token}"
288
+ }
289
+ ```
290
+ - **Content-Type** should respect the following schema:
291
+
292
+ ```
293
+ {
294
+ "type": "string",
295
+ "default": "application/json"
296
+ }
297
+ ```
298
+
299
+ #### Body Parameters
300
+
301
+ - **body** should respect the following schema:
302
+
303
+ ```
304
+ {
305
+ "type": "string",
306
+ "default": "{\n \"query\": \"query AppScalars($app_id:String!,$type:IssueType!) {project(externalId:$app_id) {crashlytics {scalars:scalars(synthesizedBuildVersions:[\\\"x.x.x (y)\\\", \\\"x.x.x (y)\\\"],type:$type,start:1477958400,end:1480411080) {crashes,issues,impactedDevices}}}}\",\n \"variables\": {\n \"app_id\": \"{app_id}\",\n \"type\": \"crash\"\n }\n}"
307
+ }
308
+ ```
309
+ - **synthesizedBuildVersions** should respect the following schema:
310
+
311
+ ```
312
+ {
313
+ "type": "string",
314
+ "default": "[\"x.x.x (y)\"]"
315
+ }
316
+ ```
317
+
318
+ - **start** should respect the following schema:
319
+
320
+ ```
321
+ {
322
+ "type": "timestamp"
323
+ }
324
+ ```
325
+
326
+ - **end** should respect the following schema:
327
+
328
+ ```
329
+ {
330
+ "type": "timestamp"
331
+ }
332
+ ```
333
+
334
+ ### **GET** - /api/v2/organizations/{organization_id}/apps/{app_id}/growth_analytics/total_sessions_scalar.json
335
+
336
+ #### CURL
337
+
338
+ ```sh
339
+ curl -X GET "https://fabric.io/api/v2/organizations/{organization_id}/apps/{app_id}/growth_analytics/total_sessions_scalar.json\
340
+ ?build=all&start=1480636800&end=1480723200" \
341
+ -H "Authorization: Bearer {access_token}" \
342
+ -H "Content-Type: text/plain"
343
+ ```
344
+
345
+ #### Path Parameters
346
+
347
+ - **ResponseBodyPath** should respect the following schema:
348
+
349
+ ```
350
+ {
351
+ "type": "string",
352
+ "default": "{organization_id}"
353
+ }
354
+ ```
355
+
356
+ #### Query Parameters
357
+
358
+ - **build** should respect the following schema:
359
+
360
+ ```
361
+ {
362
+ "type": "string",
363
+ "enum": [
364
+ "all",
365
+ "x.x.x (y)"
366
+ ],
367
+ "default": "all"
368
+ }
369
+ ```
370
+ - **start** should respect the following schema:
371
+
372
+ ```
373
+ {
374
+ "type": "timestamp"
375
+ }
376
+ ```
377
+ - **end** should respect the following schema:
378
+
379
+ ```
380
+ {
381
+ "type": "timestamp"
382
+ }
383
+ ```
384
+
385
+ #### Header Parameters
386
+
387
+ - **Authorization** should respect the following schema:
388
+
389
+ ```
390
+ {
391
+ "type": "string",
392
+ "default": "Bearer {access_token}"
393
+ }
394
+ ```
395
+
396
+ ### **POST** - /graphql
397
+
398
+ #### CURL
399
+
400
+ ```sh
401
+ curl -X POST "https://api-dash.fabric.io/graphql" \
402
+ -H "Authorization: Bearer {access_token}" \
403
+ -H "Content-Type: application/json" \
404
+ --data-raw "$body"
405
+ ```
406
+
407
+ #### Header Parameters
408
+
409
+ - **Authorization** should respect the following schema:
410
+
411
+ ```
412
+ {
413
+ "type": "string",
414
+ "default": "Bearer {access_token}"
415
+ }
416
+ ```
417
+ - **Content-Type** should respect the following schema:
418
+
419
+ ```
420
+ {
421
+ "type": "string",
422
+ "enum": [
423
+ "application/json"
424
+ ],
425
+ "default": "application/json"
426
+ }
427
+ ```
428
+
429
+ #### Body Parameters
430
+
431
+ - **body** should respect the following schema:
432
+
433
+ ```
434
+ {
435
+ "type": "string",
436
+ "default": "{\n \"query\": \"query oomCountForDaysForBuild($app_id: String!, $builds: [String!]!, $days: Int!) { project(externalId: $app_id) { crashlytics{ oomCounts(builds: $builds, days: $days){ timeSeries{ allTimeCount } } oomSessionCounts(builds: $builds, days: $days){ timeSeries{ allTimeCount } } } } }\",\n \"variables\": {\n \"app_id\": \"{app_id}\",\n \"days\": 1,\n \"builds\": [\n \"3.0.4 (71)\"\n ]\n }\n}"
437
+ }
438
+ ```
439
+
440
+ - **builds** should respect the following schema:
441
+
442
+ ```
443
+ {
444
+ "type": "string",
445
+ "default": "[\"x.x.x (y)\"]"
446
+ }
447
+ ```
448
+
449
+ - **app_id** should respect the following schema:
450
+
451
+ ```
452
+ {
453
+ "type": "string"
454
+ }
455
+ ```
456
+
457
+ - **days** should respect the following schema:
458
+
459
+ ```
460
+ {
461
+ "type": "integer"
462
+ }
463
+ ```
464
+
465
+ ### **GET** - /api/v2/organizations/{organization_id}/apps/{app_id}/beta_distribution/releases/{release_id}
466
+
467
+ #### CURL
468
+
469
+ ```sh
470
+ curl -X GET "https://fabric.io/api/v2/organizations/{organization_id}/apps/{app_id}/beta_distribution/releases/{release_id}" \
471
+ -H "Authorization: Bearer {access_token}" \
472
+ -H "Content-Type: text/plain"
473
+ ```
474
+
475
+ #### Path Parameters
476
+
477
+ - **ResponseBodyPath** should respect the following schema:
478
+
479
+ ```
480
+ {
481
+ "type": "string",
482
+ "default": "{organization_id}"
483
+ }
484
+ ```
485
+
486
+ #### Header Parameters
487
+
488
+ - **Authorization** should respect the following schema:
489
+
490
+ ```
491
+ {
492
+ "type": "string",
493
+ "default": "Bearer {access_token}"
494
+ }
495
+ ```
496
+
497
+ ### **GET** - /api/v2/organizations/{organization_id}/apps/{app_id}/beta_distribution/releases
498
+
499
+ #### CURL
500
+
501
+ ```sh
502
+ curl -X GET "https://fabric.io/api/v2/organizations/{organization_id}/apps/{app_id}/beta_distribution/releases\
503
+ ?app%5Bdisplay_version%5D=3.0.5&app%5Bbuild_version%5D=75" \
504
+ -H "Authorization: Bearer {access_token}"
505
+ ```
506
+
507
+ #### Path Parameters
508
+
509
+ - **ResponseBodyPath** should respect the following schema:
510
+
511
+ ```
512
+ {
513
+ "type": "string",
514
+ "default": "{organization_id}"
515
+ }
516
+ ```
517
+
518
+ #### Query Parameters
519
+
520
+ - **app[display_version]** should respect the following schema:
521
+
522
+ ```
523
+ {
524
+ "type": "string",
525
+ "enum": [
526
+ "x.x.x"
527
+ ]
528
+ }
529
+ ```
530
+ - **app[build_version]** should respect the following schema:
531
+
532
+ ```
533
+ {
534
+ "type": "string",
535
+ "enum": [
536
+ "y"
537
+ ]
538
+ }
539
+ ```
540
+
541
+ #### Header Parameters
542
+
543
+ - **Authorization** should respect the following schema:
544
+
545
+ ```
546
+ {
547
+ "type": "string",
548
+ "default": "Bearer {access_token}"
549
+ }
550
+ ```
551
+
552
+ ### **GET** - /api/v2/organizations/{organization_id}/apps/{app_id}/growth_analytics/top_builds
553
+
554
+ #### CURL
555
+
556
+ ```sh
557
+ curl -X GET "https://fabric.io/api/v2/organizations/{organization_id}/apps/{app_id}/growth_analytics/top_builds\
558
+ ?start=0&app_id={app_id}&end=1481328000" \
559
+ -H "Authorization: Bearer {access_token}"
560
+ ```
561
+
562
+ #### Path Parameters
563
+
564
+ - **ResponseBodyPath** should respect the following schema:
565
+
566
+ ```
567
+ {
568
+ "type": "string",
569
+ "default": "{organization_id}"
570
+ }
571
+ ```
572
+
573
+ #### Query Parameters
574
+
575
+ - **app_id** should respect the following schema:
576
+
577
+ ```
578
+ {
579
+ "type": "string",
580
+ "default": "{app_id}"
581
+ }
582
+ ```
583
+ - **start** should respect the following schema:
584
+
585
+ ```
586
+ {
587
+ "type": "timestamp"
588
+ }
589
+ ```
590
+ - **end** should respect the following schema:
591
+
592
+ ```
593
+ {
594
+ "type": "timestamp"
595
+ }
596
+ ```
597
+
598
+ #### Header Parameters
599
+
600
+ - **Authorization** should respect the following schema:
601
+
602
+ ```
603
+ {
604
+ "type": "string",
605
+ "default": "Bearer {access_token}"
606
+ }
607
+ ```
608
+
609
+ ## References
610
+
611
+ - [API in Swagger format](swagger-api.json)