{"id":20797689,"url":"https://github.com/beachmachine/angular-resource-url-type-factory","last_synced_at":"2026-04-29T05:06:23.936Z","repository":{"id":57179004,"uuid":"89060847","full_name":"beachmachine/angular-resource-url-type-factory","owner":"beachmachine","description":"A factory used to build ui-router URL types that fetch data from RESTful APIs.","archived":false,"fork":false,"pushed_at":"2017-04-22T10:08:55.000Z","size":88,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T17:40:01.020Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beachmachine.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}},"created_at":"2017-04-22T10:08:09.000Z","updated_at":"2018-03-15T07:16:24.000Z","dependencies_parsed_at":"2022-09-09T17:12:22.512Z","dependency_job_id":null,"html_url":"https://github.com/beachmachine/angular-resource-url-type-factory","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/beachmachine/angular-resource-url-type-factory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beachmachine%2Fangular-resource-url-type-factory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beachmachine%2Fangular-resource-url-type-factory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beachmachine%2Fangular-resource-url-type-factory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beachmachine%2Fangular-resource-url-type-factory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beachmachine","download_url":"https://codeload.github.com/beachmachine/angular-resource-url-type-factory/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beachmachine%2Fangular-resource-url-type-factory/sbom","scorecard":{"id":229307,"data":{"date":"2025-08-11","repo":{"name":"github.com/beachmachine/angular-resource-url-type-factory","commit":"53fb04f151f619437c23f2d011fce4595ad416ef"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/1 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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Warn: project license file does not contain an FSF or OSI license."],"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"}}]},"last_synced_at":"2025-08-17T04:32:39.355Z","repository_id":57179004,"created_at":"2025-08-17T04:32:39.355Z","updated_at":"2025-08-17T04:32:39.355Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32411600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T03:46:11.172Z","status":"ssl_error","status_checked_at":"2026-04-29T03:37:55.317Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-17T16:34:55.141Z","updated_at":"2026-04-29T05:06:23.914Z","avatar_url":"https://github.com/beachmachine.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Angular ResourceUrlTypeFactory\n\nAngular ResourceUrlTypeFactory is an AngularJS library that helps you creating ui-router url matcher types that\nresolve the ID component in a URL to the actual resource instance. This way you do not need to bother with fetching\nthe data in your controllers, redirecting to 404 pages when the fetch was unsuccessful, and dealing with all the \npermission stuff. You just have the resource instance available in your `$stateParams`.\n\n**Note:** This library is for AngularJS 1.x only!\n\n\n## Dependencies\n\nAngular ResourceUrlTypeFactory depends on AngularJS 1.x.\n\n\n## Installation\n\n* Via `npm`: `npm install --save angular-resource-url-type-factory`\n* Via `git`: `git clone git@github.com:beachmachine/angular-resource-url-type-factory.git`\n\n\n## Examples\n\n### Type definition\n\nIn the following example shows how to define a resource url type, how to use it in your route definitions, and how\nto access the data in your controller. We assume we have a resource service called `MemberResourceService` defined to \nmake calls to our RESTful API.\n\nFollowing libraries may be helpful for you creating resource services:\n* [angular-resource-factory](https://www.npmjs.com/package/angular-resource-factory): A factory build upon $resource \n  helping you to interact with RESTful APIs with advanced features as caches and data stores.\n* [angular-resource](https://www.npmjs.com/package/angular-resource): A factory which creates a resource object that \n  lets you interact with RESTful server-side data sources.\n\nTo make things a bit clearer, this is the data we assume to get from our RESTful API:\n````json\n[\n  {\n    \"pk\": 1,\n    \"url\": \"http://example.api/member/1/\",\n    \"creation_date\": \"2017-01-11T06:00:00Z\",\n    \"last_modification_date\": \"2017-01-12T08:00:00Z\",\n    \"name\": \"Example Member 1\"\n  },\n  {\n    \"pk\": 2,\n    \"url\": \"http://example.api/member/2/\",\n    \"creation_date\": \"2017-01-11T06:00:00Z\",\n    \"last_modification_date\": \"2017-01-12T08:00:00Z\",\n    \"name\": \"Example Member 2\"\n  }\n]\n````\n\nThis is how to define the ui-router url matcher type for that resource:\n````javascript\nvar module = angular.module('shared');\n\nmodule.config(\n    function (ResourceUrlTypeFactoryServiceProvider) {\n        ResourceUrlTypeFactoryServiceProvider.registerType(\n            'member', // name of the new type\n            /\\d+/, // regex to match the identifier in the URL\n            'pk', // attribute name on the instance to get the identifier from\n            // function (with injection pattern) that is used to fetch the instance from the RESTful API. Should return \n            // a promise, a `$resource` instance, or a regular object. `$pk` is the string from the URL matched by the\n            // type definition.\n            function ($pk, MemberResourceService) {\n                return MemberResourceService.get({pk: $pk});\n            }\n        );\n    }\n);\n````\n\nNow we can use the defined type in our route definitions:\n```javascript\nvar module = angular.module('app');\n\nmodule.config(\n    function ($stateProvider) {\n        $stateProvider\n            .state('member', {\n                url: '/member/{mymember:member}/',\n                component: 'memberView'\n            });\n    }\n);\n```\n\nThe user now can go the the path `\"/member/1/\"`, ResourceUrlTypeFactory fetches the data from the RESTful API, publishes\nthe resource instance on the `$stateParams`, and transitions to the `member` state. This is how to use the data in\nyour controller then:\n```javascript\nvar module = angular.module('app');\n\nmodule.component('memberView', {\n    controller: 'MemberViewController'\n});\n\nmodule.controller('MemberViewController',\n    function ($stateParams) {\n        // Logs \"Member name is: Example Member 1\"\n        console.log(\"Member name is: \" + $stateParams.mymember.name);\n    }\n);\n```\n\n\n## Contributions\n\n* Andreas Stocker \u003candreas@stocker.co.it\u003e, Main developer\n\n\n## License\n\nAngular ResourceUrlTypeFactory,\nCopyright 2016 Andreas Stocker,\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the\nSoftware.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\nWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\nOR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeachmachine%2Fangular-resource-url-type-factory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeachmachine%2Fangular-resource-url-type-factory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeachmachine%2Fangular-resource-url-type-factory/lists"}