{"id":13711821,"url":"https://github.com/bitbar/cloud-api-client-js","last_synced_at":"2025-05-06T12:30:41.489Z","repository":{"id":37818856,"uuid":"147863355","full_name":"bitbar/cloud-api-client-js","owner":"bitbar","description":"Bitbar Cloud API Client for JavaScript","archived":false,"fork":false,"pushed_at":"2025-04-22T06:46:32.000Z","size":4076,"stargazers_count":1,"open_issues_count":9,"forks_count":11,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-22T07:17:06.824Z","etag":null,"topics":["api","api-client","bitbar","bitbar-cloud","cloud","javascript","node","node-js","nodejs","testdroid","typescript","umd"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitbar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-07T18:58:03.000Z","updated_at":"2025-04-22T06:46:36.000Z","dependencies_parsed_at":"2023-12-19T12:12:21.059Z","dependency_job_id":"2dff2270-5235-4126-bf09-03a4de0882a4","html_url":"https://github.com/bitbar/cloud-api-client-js","commit_stats":{"total_commits":233,"total_committers":16,"mean_commits":14.5625,"dds":0.7339055793991416,"last_synced_commit":"7267a0a5c31291a2660a90f15cac077592963b79"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitbar%2Fcloud-api-client-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitbar%2Fcloud-api-client-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitbar%2Fcloud-api-client-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitbar%2Fcloud-api-client-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitbar","download_url":"https://codeload.github.com/bitbar/cloud-api-client-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252683385,"owners_count":21788029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","bitbar","bitbar-cloud","cloud","javascript","node","node-js","nodejs","testdroid","typescript","umd"],"created_at":"2024-08-02T23:01:11.978Z","updated_at":"2025-05-06T12:30:41.477Z","avatar_url":"https://github.com/bitbar.png","language":"TypeScript","funding_links":[],"categories":["By Technology"],"sub_categories":["JavaScript"],"readme":"# Bitbar Cloud API Client for JavaScript\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE.md)\n[![Build Status](https://travis-ci.com/bitbar/cloud-api-client-js.svg?branch=master)](https://travis-ci.com/bitbar/cloud-api-client-js)\n\nThis repository contains official [Bitbar Cloud](https://bitbar.com/testing/) API Client for JavaScript.\nSmartbear's Bitbar Cloud hosts hundreds of Android and iOS devices, enabling users to create and test high quality mobile apps and games.\n\n## Getting Started\n\n### Disclaimer\n\nPLEASE NOTE, that project is under development (versions is below 1.0.0). Because of that not all resources are implemented\nand/or tested. List of working resources can be found [here](WORKING-RESOURCES.md).\n\n### Prerequisites\n\nThis package is using [UMD](https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js) pattern,\nso it means that you can use it:\n\n* in Node.js project\n* browser running project\n\n  * without AMD\n  * with AMD\n\n### Concepts\n\nThe syntax of the library is heavily inspired by the [Chai HTTP](https://github.com/chaijs/chai-http) syntax.\nUnderstanding the following general concepts will allow you to quickly learn the syntax\n\n#### 1. Chaining\n\nMost methods in library is chainable. That's means that you don't need to write long code like:\n\n```js\nvar meRef = apiClient.me();\nvar projectRef = me.project(1);\nvar runRef = project.run(2);\n```\n\nRather it was designed to use it this way:\n\n```js\napiClient.me().project(1).run(2);\n```\n\n#### 2. Every URL Part is a Method\n\nExample: API resource to download list of device sessions of run with ID `10` in project with ID `20` will be:\n\n```\nGET https://cloud.bitbar.com/api/me/projects/20/runs/10/device-sessions\n```\n\nFirst part is `/me` (`/api` doesn't count because it's \"directory\" where API is stored). So:\n\n```js\napiClient.me();\n```\n\nSecond is `/projects`, but next is the ID, so method will be in singular form:\n\n```js\napiClient.me().project(20);\n```\n\nThird is `/runs`, but again - there is the ID, so (again) singular form:\n\n```js\napiClient.me().project(20).run(10);\n```\n\nLast one is `/device-dessions`. Because it's _kebab-case_, we need to transform it to _camelCase_:\n\n```js\napiclient.me().project(20).runs(10).deviceSessions();\n```\n\nNow, because `GET` method is default one in `axios`, then we don't need to explicit set it (but you can if you want).\nSo what's left is to send it:\n\n```js\napiclient.me().project(20).runs(10).deviceSessions().send();\n```\n\n#### 3. Structure\n\nNow that you know how to build a chaining call you probably will want to e.g. set params, or set data to send.\nAll classes are documented so it should be easy to read docs from code.\n\nIf resource chain ends on method that is _singular_ (so in Swagger it returns single object) then it's descendant of\n[APIResource](src/APIResource.ts). It means that you can use all methods that are there.\n\nIf resource chain ends on method that is _plural_ (so in Swagger it returns list) then it's descendant of\n[APIList](src/APIList.ts). It means that you can use all methods that are there.\n\nBoth `APIResource` and `APIList` are children of `APIEntity`.\n\n#### 4. HTTP Methods\n\nHTTP methods are also methods.\n\n* If you want to send GET request then add to your chain `.get()`.\n* If you want to send POST request then add to your chain `.post()`.\n* If you want to send DELETE request then add to your chain `.delete()`.\n\n#### 5. Send\n\nMethod `.send()` is sending request and returning `Promise`. With this kind of approach you can chain all you want.\nWhen you are ready, then just call `.send()`.\n\n### Usage\n\n#### CommonJS\n\n```sh\nnpm install @bitbar/cloud-api-client --save\n```\n\n```js\nconst CloudApiClient = require('@bitbar/cloud-api-client');\n\nconst apiClient = new CloudApiClient.API({\n  cloudUrl: 'https://cloud.bitbar.com',\n  apiKey: 'PASTE_HERE_YOUR_OWN_KEY'\n});\n\napiClient.me().send().then( (resp) =\u003e {\n  console.log(resp.data);\n}).catch( (err) =\u003e {\n  console.error(err);\n});\n```\n\n#### AMD\n\n```js\nrequirejs(['cloud-api-client'], function (CloudApiClient) {\n  var api = new CloudApiClient.API({\n    cloudUrl: 'https://cloud.bitbar.com',\n    apiKey: 'PASTE_HERE_YOUR_OWN_KEY'\n  });\n});\n```\n\n#### Old School\n\n```html\n\u003c!-- note that this is URL to version 0.8.0 -- please check which version is latest --\u003e\n\u003cscript src=\"https://github.com/bitbar/cloud-api-client-js/releases/download/v0.8.0/cloud-api-client.min.js\"\u003e\u003c/script\u003e\n```\n\n```js\nvar api = new CloudApiClient.API({\n  cloudUrl: 'https://cloud.bitbar.com',\n  apiKey: 'PASTE_HERE_YOUR_OWN_KEY'\n});\n```\n\n### Examples\n\nSimple examples are placed in [examples directory](examples/README.md)\n\n### Documentation\n\n[https://bitbar.github.io/cloud-api-client-js/](https://bitbar.github.io/cloud-api-client-js/)\n\n## Contribution\n\n### Checking code quality\n\n```sh\nnpm run lint\n```\n\n### Running tests\n\n```sh\nnpm run test\n```\n\n### Building\n\n```sh\nnpm run build\n```\n\n## Authors\n\n* **Marek Sierociński** - [marverix](https://github.com/marverix)\n\nSee also the list of [contributors](https://github.com/bitbar/cloud-api-client-js/contributors)\nwho participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitbar%2Fcloud-api-client-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitbar%2Fcloud-api-client-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitbar%2Fcloud-api-client-js/lists"}