{"id":51747871,"url":"https://github.com/tramwayjs/connection-rest-api","last_synced_at":"2026-07-18T21:44:31.990Z","repository":{"id":47913645,"uuid":"235146610","full_name":"tramwayjs/connection-rest-api","owner":"tramwayjs","description":"A Provider to communicate with external REST Apis","archived":false,"fork":false,"pushed_at":"2023-01-09T19:57:36.000Z","size":715,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-11-28T12:14:24.895Z","etag":null,"topics":["connection","es7","javascript","nodejs","provider","rest-api","tramwayjs"],"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/tramwayjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-20T16:31:13.000Z","updated_at":"2020-01-20T17:17:56.000Z","dependencies_parsed_at":"2023-02-08T13:45:48.534Z","dependency_job_id":null,"html_url":"https://github.com/tramwayjs/connection-rest-api","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/tramwayjs/connection-rest-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tramwayjs%2Fconnection-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tramwayjs%2Fconnection-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tramwayjs%2Fconnection-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tramwayjs%2Fconnection-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tramwayjs","download_url":"https://codeload.github.com/tramwayjs/connection-rest-api/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tramwayjs%2Fconnection-rest-api/sbom","scorecard":{"id":896810,"data":{"date":"2025-08-11","repo":{"name":"github.com/tramwayjs/connection-rest-api","commit":"b6bcc86281c7c6494a9c083103e7487a5212a883"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"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":-1,"reason":"No tokens found","details":null,"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"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":"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":"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":"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"41 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-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-w7q9-p3jq-fmhm","Warn: Project is vulnerable to: GHSA-xvf7-4v9q-58w6","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-jv35-xqg7-f92r","Warn: Project is vulnerable to: GHSA-pfrm-4rjw-g9q5","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-wxgh-8gmr-3qh3","Warn: Project is vulnerable to: GHSA-mw4x-g2x8-qcvf","Warn: Project is vulnerable to: GHSA-5p42-m6f3-hpmj","Warn: Project is vulnerable to: GHSA-332q-7ff2-57h2","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"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-24T14:02:16.941Z","repository_id":47913645,"created_at":"2025-08-24T14:02:16.941Z","updated_at":"2025-08-24T14:02:16.941Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35632492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-18T02:00:07.223Z","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":["connection","es7","javascript","nodejs","provider","rest-api","tramwayjs"],"created_at":"2026-07-18T21:44:31.162Z","updated_at":"2026-07-18T21:44:31.982Z","avatar_url":"https://github.com/tramwayjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Tramway RestApiProvider is a simple Provider add-on to simplify the process of reading APIs from an external client built with Node's built-in http module.\n\n# Installation:\n1. `npm install tramway-connection-rest-api --save`\n\n# Example project\nhttps://gitlab.com/tramwayjs/tramway-connection-example\n\n# Documentation\n\n## Recommended Folder Structure in addition to Tramway\n- config\n- providers\n- repositories\n- entities\n\n## RestApiProvider\nThe `RestApiProvider` is a derived `Provider` which follows the same interface.\n\n### Configuration parameters\n| Parameter | Default | Usage |\n| --- | --- | --- |\n| host | Uses `ServerIPResolverService` to get host machine's IP | Source of API, use it when you have a direct accessible path |\n| port | `8080` | Port API is on |\n| path | `\"/\"` | Path from host that resource is on |\n| respondAsText | false | Defaults to returning an object, this override will return the response as is from the buffer |\n| headers | undefined | Indicates what headers to use with the request. Note that for a standard API that will perform POST and PUT requests with a JSON object, it is recommended to use the following as part of your headers: ```{\"content-type\": \"application/json; charset=utf-8\"}```. |\n\n## Getting started\nIt is recommended to make a config file with the API's core data and make an extension class to handle it before injecting that extension class into the model to work with the rest of Tramway's built-in features. The alternative to the extension class is calling the config parameters with the Repository every time the repository is used instead of just importing the provider to the repository.\n\nIn your config folder add a file after the name of your API.\n\nyourapi.js:\n```\nexport default {\n    \"host\": \"127.0.0.1\",\n    \"port\": 8080,\n    \"path\": \"yourresourcepath\",\n    \"respondAsText\": false,\n    \"headers\": {\"content-type\": \"application/json; charset=utf-8\"}\n};\n```\n\nNext up, the wrapper `Provider` is simple enough:\n\nYourAPIProvider.js:\n```\nimport RestApiProvider from 'tramway-connection-rest-api';\nimport options from '../config/yourapi.js';\n\n/**\n * @export\n * @class YourAPIProvider\n * @extends {RestApiProvider}\n */\nexport default class YourAPIProvider extends RestApiProvider {\n    constructor() {\n        super(options);\n    }\n}\n```\n\nAnd then to get the most of it, pass the provider to your `Repository` class.\n\n```\nimport {Repository} from 'tramway-core-connection';\nimport YourAPIProvider from '../connections/YourAPIProvider';\n\nnew Repository(new YourAPIProvider(options), new Factory());\n```\n\nThe following can also be easily achieved with dependency injection using `tramway-core-dependency-injector`.\n\nNote that not all of the Provider's core functions will be available at this time but here's a rundown of what you have.\n\n## Exposed Methods with this Library\n\n### Provider\n\n| Function | Availability |\n| ----- | ----- |\n| ```getOne(id: any)``` | Available |\n| ```getMany(ids: any[])``` | Available |\n| ```get()``` | Available |\n| ```find(conditions: Object, path: string)``` | Available, sends conditions object as query string |\n| ```has(id: any)``` | Available, but relies on the endpoint supporting HEAD http method. |\n| ```hasThese(ids : any[])``` | Available, but relies on the endpoint supporting HEAD http method. |\n| ```count(conditions: any)``` | Not yet available |\n| ```create(item: Entity/Object)``` | Available |\n| ```update(id: any, item: Entity/Object)``` | Available |\n| ```delete(id: any)``` | Available |\n| ```deleteMany(ids : any[])``` | Available |\n| ```query(query: string/Object, values: Object)``` | Not available, use findItems when available |\n\n### Repository\n\n| Function | Usaability |\n| --- | --- |\n| ```exists(id: any)``` | Usable as long as API utilizes HEAD method |\n| ```getOne(id: any)``` | Usable |\n| ```get()``` | Usable |\n| ```create(entity: Entity)``` | Usable |\n| ```update(entity: Entity)``` | Usable |\n| ```delete(id: any)``` | Usable |\n| ```find(condtions: string/Object)``` | Not yet Usable |\n| ```getMany(ids: any[])``` | Usable |\n| ```count(conditions)``` | Not yet Usable |\n\n## Services\nThe API suite provides a new `ServerIPResolverService` to get the IP address of the host machine. \n\nTo use it, import the class and use the static `getIp` method.\n\n```\nimport {services} from 'tramway-connection-rest-api`;\nlet {ServerIPResolverService} = services;\n```\n\nTo use it:\n\n```\nlet ip = ServerIPResolverService.getIp();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftramwayjs%2Fconnection-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftramwayjs%2Fconnection-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftramwayjs%2Fconnection-rest-api/lists"}