{"id":19306407,"url":"https://github.com/fluse/client-api","last_synced_at":"2025-02-24T02:27:58.306Z","repository":{"id":57200250,"uuid":"50038733","full_name":"fluse/client-api","owner":"fluse","description":null,"archived":false,"fork":false,"pushed_at":"2016-09-19T14:26:02.000Z","size":111,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T01:02:24.245Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-20T15:22:13.000Z","updated_at":"2016-01-27T21:50:20.000Z","dependencies_parsed_at":"2022-09-16T15:12:42.499Z","dependency_job_id":null,"html_url":"https://github.com/fluse/client-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluse%2Fclient-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluse%2Fclient-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluse%2Fclient-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluse%2Fclient-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluse","download_url":"https://codeload.github.com/fluse/client-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240405609,"owners_count":19796210,"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":[],"created_at":"2024-11-10T00:05:56.363Z","updated_at":"2025-02-24T02:27:58.281Z","avatar_url":"https://github.com/fluse.png","language":"JavaScript","funding_links":["https://www.paypal.me/schauf"],"categories":[],"sub_categories":[],"readme":"# Client API\n\n[![Donate](https://img.shields.io/badge/donate-%20%E2%9D%A4%20-green.svg)](https://www.paypal.me/schauf)\n\nRest like client api calls\n\n## Install\n\n```shell\n\u003e npm install client-api --save\n```\n\ndependencies:\n - [superagend](https://github.com/visionmedia/superagent)\n - [node-extend](https://github.com/justmoon/node-extend)\n\n## Use\n\n```javascript\nvar Api = require('client-api');\n```\n\n## Create\n\n```javascript\nvar api = new Api(settings);\n```\n\n## Settings\n\n```javascript\nvar settings = {\n    token: '32digits',\n    version: 'v1',\n    baseName: '/api/',\n    dataType: 'json'\n}\n```\n\n| name        | type           | description  |\n| ------------- |:-------------:| :---------|\n| token      | String | server authorization with token |\n| version      | String      |   api version |\n| baseName | String      |   base url without domain.tld |\n| dataType | String      |    data format |\n\n## Calls\n\n```javascript\napi(method, path, params, data, callback);\n```\n\n| name        | type           | description  |\n| ------------- |:-------------:| :---------|\n| method      | String | get, post, put, delete, path |\n| path      | String      |   api version |\n| params | Object      |   set maximal video amount |\n| data | Object      |    option on get and delete |\n| callback | Function  |    recieving function |\n\n### GET\n```javascript\napi('get', '/category/article', {}, callback);\n```\n\n### GET with Params\n\neach :{name} will replace by key value from params object\n\n```javascript\nvar params = {\n    publisher: 'times',\n    category: 'book',\n    id: 5\n};\n\napi('get', '/:publisher/:category/:id', params, callback);\n```\n\nResult\n`http://domain.tld./api/v1/times/book/5`\n\n### PUT / POST\n```javascript\n\nvar data = {\n    name: 'newName'\n};\n\napi('put', 'category/article/:id', {\n    id: inputId\n}, data, callback);\n```\n\n### DELETE\n```javascript\n\napi('delete', 'category/article/:id', {\n    id: inputId\n}, callback);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluse%2Fclient-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluse%2Fclient-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluse%2Fclient-api/lists"}