{"id":21392323,"url":"https://github.com/hiyali/ng-s-resource","last_synced_at":"2025-08-20T21:22:50.855Z","repository":{"id":65457925,"uuid":"100254214","full_name":"hiyali/ng-s-resource","owner":"hiyali","description":"🏌🏽 Simplify RESTful http resource generator for Angular 4+","archived":false,"fork":false,"pushed_at":"2017-08-31T03:13:08.000Z","size":59,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T12:02:14.748Z","etag":null,"topics":["angular","angular2","http","ng-sresource","ng2","resource","restful","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/hiyali.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":"2017-08-14T10:07:05.000Z","updated_at":"2023-07-22T21:16:50.000Z","dependencies_parsed_at":"2023-01-24T12:45:27.143Z","dependency_job_id":null,"html_url":"https://github.com/hiyali/ng-s-resource","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hiyali/ng-s-resource","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiyali%2Fng-s-resource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiyali%2Fng-s-resource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiyali%2Fng-s-resource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiyali%2Fng-s-resource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hiyali","download_url":"https://codeload.github.com/hiyali/ng-s-resource/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiyali%2Fng-s-resource/sbom","scorecard":{"id":465795,"data":{"date":"2025-08-11","repo":{"name":"github.com/hiyali/ng-s-resource","commit":"48478fdf45357cb81818600b42c489f918949232"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/16 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":"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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":"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":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-c75v-2vq8-878f"],"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-19T12:28:18.944Z","repository_id":65457925,"created_at":"2025-08-19T12:28:18.944Z","updated_at":"2025-08-19T12:28:18.944Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271386448,"owners_count":24750518,"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-08-20T02:00:09.606Z","response_time":69,"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":["angular","angular2","http","ng-sresource","ng2","resource","restful","typescript"],"created_at":"2024-11-22T13:39:58.472Z","updated_at":"2025-08-20T21:22:50.824Z","avatar_url":"https://github.com/hiyali.png","language":"TypeScript","funding_links":[],"categories":["Awesome Angular [![Awesome TipeIO](https://img.shields.io/badge/Awesome%20Angular-@TipeIO-6C6AE7.svg)](https://github.com/gdi2290/awesome-angular) [![Awesome devarchy.com](https://img.shields.io/badge/Awesome%20Angular-@devarchy.com-86BDC1.svg)](https://github.com/brillout/awesome-angular-components)"],"sub_categories":["Angular \u003ca id=\"angular\"\u003e\u003c/a\u003e"],"readme":"# ng-s-resource\n🏌🏽 Simplify RESTful http resource generator for Angular 4+\n\n[![npm package](https://img.shields.io/npm/v/ng-s-resource.svg)](https://npmjs.com/package/ng-s-resource)\n[![NPM downloads](http://img.shields.io/npm/dm/ng-s-resource.svg)](https://npmjs.org/package/ng-s-resource)\n\n## Quick look\n```typescript\nUserService = this._res.create('/api/user/:id') // 1. define\n...\nthis.api.UserService.get({ params: { id : 5 } })... // 2. usage\n/*\nAlso can use `...UserService. post | put | head | patch | delete`\n*/\n```\n\n![Screen shot](https://raw.githubusercontent.com/hiyali/ng-s-resource/master/assets/nice-shot.png \"screenshot\")\n\n## Install\n```shell\nyarn add ng-s-resource\n```\nor\n```\nnpm i -S ng-s-resource\n```\n\n## Configuration\n\u003e _res.create(url, [options])\n\u003e Service.Sub([options])\n\n| Name                 | Type            | Explain                                       |\n| -------------------- | --------------- | --------------------------------------------- |\n| url                  | `String`        | Api url, and you can use api/user/`:id`, and use dynamic params { id: 2 } for replace it |\n| options[sub]         | `Object`        | Service children name                      |\n| options[sub].params  | `Object`        | Resource params, like url params etc.         |\n| options[sub].headers | `Object`        | Api headers, like { ...headers: { 'x-auth-token': '***' } } |\n| options[sub].data    | `Object`        | Api data, just use in these methods `post`, `put`, `patch` |\n| options[sub].method  | `String`        | Api method type, like `get`, `head`, `delete`, `post`, `put`, `patch` |\n\n## Example\n### Define\n#### services/api.service.ts\n```typescript\nimport { Injectable } from '@angular/core'\nimport { Http } from '@angular/http'\nimport { Resources } from 'ng-s-resource'\n\n@Injectable()\nexport class ApiResources {\n  _res: Resources\n  constructor (private _http: Http) {\n    this._res = new Resources(_http)\n  }\n  get PayService () { return this._res.create('/api/transaction/payInfo/:payReason') } // any method\n  get LoginService() { return this._res.create('/api/user/customer/registerOrLogin/:uriName', {\n    dynamicKey: { params: { uriName: 'finish' }, method: 'post' }, // just post\n    requestKey: { params: { uriName: 'request'} } // any method\n  }) }\n}\n```\n\n### Usage\n#### pages/app.component.ts\n```typescript\nimport { API } from '../services'\n...\n@Component(...)\nexport class AppComponent {\n  constructor (private api: API) {}\n\n  someMethod () {\n    const payReason = 'yo'\n\n    // get\n    this.api.PayService.get({ params: { payReason }}).subscribe(res =\u003e {\n      console.log(res)\n    })\n\n    // post\n    this.api.LoginService.dynamicKey({ data: { payReason }, headers: { 'token': 'asdf' }}).subscribe(res =\u003e {\n      console.log(res)\n    })\n  }\n}\n```\n\n### Required things\n#### app.module.ts\n```typescript\nimport { HttpModule } from '@angular/http'\nimport { AppServices } from '../services'\n...\n@NgModule({\n  ...\n  imports: [\n    HttpModule\n  ],\n  providers: [\n    AppServices\n  ]\n  ...\n})\n```\n\n#### services/index.ts\n```typescript\nimport { ApiResources as API } from './api.service'\n\nexport { API }\nexport const AppServices = [\n  API\n]\n```\n\n## Any problem?\n\n\u003e Please let me know.\n* [Open a new issue for this repo](https://github.com/hiyali/ng-s-resource/issues)\n* [Send a Email to: hiyali920@gmail.com](mailto:hiyali920@gmail.com)\n\n## Is it useful?\n\n🌚 [Donate a github star ⍟](https://github.com/hiyali/ng-s-resource)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiyali%2Fng-s-resource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiyali%2Fng-s-resource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiyali%2Fng-s-resource/lists"}