{"id":21883794,"url":"https://github.com/vovanr/api-toggler","last_synced_at":"2026-02-16T20:34:14.957Z","repository":{"id":53720365,"uuid":"56861204","full_name":"VovanR/api-toggler","owner":"VovanR","description":"Alias your app API with other API","archived":false,"fork":false,"pushed_at":"2022-12-15T19:29:22.000Z","size":432,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-13T16:35:51.070Z","etag":null,"topics":["api","utility"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/VovanR.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-22T14:26:32.000Z","updated_at":"2023-02-13T12:30:25.000Z","dependencies_parsed_at":"2023-01-29T04:16:06.704Z","dependency_job_id":null,"html_url":"https://github.com/VovanR/api-toggler","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/VovanR/api-toggler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VovanR%2Fapi-toggler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VovanR%2Fapi-toggler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VovanR%2Fapi-toggler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VovanR%2Fapi-toggler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VovanR","download_url":"https://codeload.github.com/VovanR/api-toggler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VovanR%2Fapi-toggler/sbom","scorecard":{"id":149038,"data":{"date":"2025-08-11","repo":{"name":"github.com/VovanR/api-toggler","commit":"10d623b348fa24cf4ccbcfe3f8fe2235a811d13d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test-workflow.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":4,"reason":"dependency not pinned by hash detected -- score normalized to 4","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-workflow.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/VovanR/api-toggler/test-workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-workflow.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/VovanR/api-toggler/test-workflow.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-workflow.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/VovanR/api-toggler/test-workflow.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"17 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T10:06:28.862Z","repository_id":53720365,"created_at":"2025-08-16T10:06:28.862Z","updated_at":"2025-08-16T10:06:28.862Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016357,"owners_count":26085828,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","utility"],"created_at":"2024-11-28T09:46:52.168Z","updated_at":"2025-10-13T17:35:36.226Z","avatar_url":"https://github.com/VovanR.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# api-toggler\n\n[![Commitizen friendly][commitizen-image]][commitizen-url]\n[![XO code style][codestyle-image]][codestyle-url]\n\n[![NPM version][npm-image]][npm-url]\n[![Build Status][build-image]][build-url]\n[![Coveralls Status][coveralls-image]][coveralls-url]\n\n\u003e Alias your app API with other API\n\n## Install\n\n```shell\nnpm install --save api-toggler\n```\n\n## Usage\n\n```js\nconst ApiToggler = require('api-toggler');\n\nconst someApiToggler = new ApiToggler({\n  name: 'first_name',\n  surname: 'last_name'\n});\n```\n\n### String\n```js\nsomeApiToggler.toggle('name');\n//=\u003e 'first_name'\n\nsomeApiToggler.toggle('first_name');\n//=\u003e 'name'\n```\n\n### Object\n```js\nsomeApiToggler.toggle({first_name: 'Vladimir', last_name: 'Rodkin'});\n//=\u003e {name: 'Vladimir', surname: 'Rodkin'}\n\nsomeApiToggler.toggle({name: 'Vladimir', surname: 'Rodkin'});\n//=\u003e {first_name: 'Vladimir', last_name: 'Rodkin'}\n```\n\n### Array\n```js\nsomeApiToggler.toggle([{\n  first_name: 'Vladimir',\n  last_name: 'Rodkin'\n}, {\n  first_name: 'Foo',\n  last_name: 'Bar'\n}]);\n//=\u003e [{name: 'Vladimir', surname: 'Rodkin'}, {name: 'Foo', surname: 'Bar'}]\n\nsomeApiToggler.toggle([{\n  name: 'Vladimir',\n  surname: 'Rodkin'\n}, {\n  name: 'Foo',\n  surname: 'Bar'\n}]);\n//=\u003e [{first_name: 'Vladimir', last_name: 'Rodkin'}, {first_name: 'Foo', last_name: 'Bar'}]\n```\n\n## Example\n| My API | GitHub API |\n|--------|------------|\n| `pk` | `id` |\n| `username` | `login` |\n| `fullname` | `name` |\n\nI need to convert GitHub API to my and back\n\nInitialize schema toggler:\n```js\nconst ApiToggler = require('api-toggler');\n\nconst ghApiToggler = new ApiToggler({\n  username: 'login',\n  fullname: 'name',\n  pk: 'id'\n});\n```\n\nToggle GitHub API to my API:\n```js\nfetch('https://api.github.com/users/vovanr')\n  .then(x =\u003e x.json())\n  //=\u003e {id: 1, login: 'VovanR', name: 'Vladimir Rodkin', . . . }\n  .then(x =\u003e ghApiToggler.toggle(x))\n  //=\u003e {pk: 1, username: 'VovanR', fullname: 'Vladimir Rodkin', . . . }\n```\n\nToggle my API to GitHub API:\n```js\nx\n//=\u003e {pk: 1, username: 'VovanR', fullname: 'Vladimir Rodkin', . . . }\napiToggler.toggle(x)\n//=\u003e {id: 1, login: 'VovanR', name: 'Vladimir Rodkin', . . . }\n\n```\n\n## License\nMIT © [Vladimir Rodkin](https://github.com/VovanR)\n\n[commitizen-url]: https://commitizen.github.io/cz-cli/\n[commitizen-image]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square\n\n[codestyle-url]: https://github.com/xojs/xo\n[codestyle-image]: https://img.shields.io/badge/code_style-XO-5ed9c7.svg?style=flat-square\n\n[npm-url]: https://npmjs.org/package/api-toggler\n[npm-image]: https://img.shields.io/npm/v/api-toggler.svg?style=flat-square\n\n[build-url]: https://github.com/VovanR/api-toggler/actions/workflows/test-workflow.yml\n[build-image]: https://img.shields.io/github/actions/workflow/status/vovanr/api-toggler/test-workflow.yml?branch=master\u0026style=flat-square\n\n[coveralls-url]: https://coveralls.io/r/VovanR/api-toggler\n[coveralls-image]: https://img.shields.io/coveralls/VovanR/api-toggler.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvovanr%2Fapi-toggler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvovanr%2Fapi-toggler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvovanr%2Fapi-toggler/lists"}