{"id":19164378,"url":"https://github.com/ericdowell/resource-endpoint","last_synced_at":"2026-06-23T05:31:24.367Z","repository":{"id":34261219,"uuid":"172816307","full_name":"ericdowell/resource-endpoint","owner":"ericdowell","description":"A simple resource wrapper for Axios and collection of useful Mixins for building Laravel APIs.","archived":false,"fork":false,"pushed_at":"2023-03-15T02:47:26.000Z","size":2391,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T10:53:03.170Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ericdowell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-27T01:01:25.000Z","updated_at":"2023-11-07T12:51:00.000Z","dependencies_parsed_at":"2024-11-09T09:22:33.420Z","dependency_job_id":"7ef4d12a-a717-4740-a45b-3698b6f6dbe4","html_url":"https://github.com/ericdowell/resource-endpoint","commit_stats":{"total_commits":396,"total_committers":4,"mean_commits":99.0,"dds":"0.030303030303030276","last_synced_commit":"e08ff1a9394234f9b52b7824892438a471cac878"},"previous_names":[],"tags_count":103,"template":false,"template_full_name":null,"purl":"pkg:github/ericdowell/resource-endpoint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdowell%2Fresource-endpoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdowell%2Fresource-endpoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdowell%2Fresource-endpoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdowell%2Fresource-endpoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericdowell","download_url":"https://codeload.github.com/ericdowell/resource-endpoint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericdowell%2Fresource-endpoint/sbom","scorecard":{"id":380191,"data":{"date":"2025-08-11","repo":{"name":"github.com/ericdowell/resource-endpoint","commit":"e08ff1a9394234f9b52b7824892438a471cac878"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/24 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":"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":"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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: npmCommand not pinned by hash: .husky/post-merge:4","Info:   0 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":"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":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 9 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":"20 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-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-8hc4-vh64-cxmj","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","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-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","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-72xf-g2v4-qvf3","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","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-f9xv-q969-pqx4"],"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-18T15:14:49.857Z","repository_id":34261219,"created_at":"2025-08-18T15:14:49.858Z","updated_at":"2025-08-18T15:14:49.858Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34677382,"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-06-23T02:00:07.161Z","response_time":65,"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":[],"created_at":"2024-11-09T09:21:47.631Z","updated_at":"2026-06-23T05:31:24.351Z","avatar_url":"https://github.com/ericdowell.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# resource-endpoint\n[![CircleCI](https://circleci.com/gh/ericdowell/resource-endpoint.svg?style=svg)](https://circleci.com/gh/ericdowell/resource-endpoint)\n[![npm version](https://img.shields.io/npm/v/resource-endpoint.svg?style=flat-square)](https://www.npmjs.com/package/resource-endpoint)\n[![npm downloads](https://img.shields.io/npm/dm/resource-endpoint.svg?style=flat-square)](http://npm-stat.com/charts.html?package=resource-endpoint)\n\nA simple resource wrapper for Axios and collection of useful Mixins for building Laravel APIs.\n\n## Examples\nHere are two examples using the `AuthEndpoint` and `UserEndpoint` classes with several Mixin functions:\n```js\n// js/api/endpoints/auth.js\nimport { AuthEndpoint, ApiMixin, HandleErrorMixin } from 'resource-endpoint'\n\nexport class Auth extends HandleErrorMixin(ApiMixin(AuthEndpoint)) {\n    /**\n     * Override to set as version, default to empty\n     * e.g. v1, v3, v5 and so on.\n     *\n     * @returns {string}\n     */\n    get version() {\n        return 'v1'\n    }\n}\n```\n```js\n// js/api/endpoints/user.js\nimport { ApiMixin, UserEndpoint, HandleErrorMixin } from 'resource-endpoint'\n\nexport class User extends HandleErrorMixin(ApiMixin(UserEndpoint)) {\n    /**\n     * Override to set as version, default to empty\n     * e.g. v1, v3, v5 and so on.\n     *\n     * @returns {string}\n     */\n    get version() {\n        return 'v1'\n    }\n}\n```\nYou can use a singleton/factory pattern with a base `Api` class:\n```js\n// js/api/index.js\nimport { Auth } from './endpoints/auth'\nimport { User } from './endpoints/user'\n\nclass Api {\n    /**\n     *\n     * @returns {Auth}\n     */\n    get auth() {\n        return new Auth()\n    }\n\n    /**\n     * @returns {User}\n     */\n    get user() {\n        return new User()\n    }\n}\n\nexport const api = new Api()\n```\n\n### Usage\n```js\n// js/index.js\nimport { api } from './api'\nimport { safeResponseData } from 'resource-endpoint'\n\n// Usage shown in async functions, likely placed in the component onSubmit for the form\n// Not created as helper function necessarily as shown below.\n\nconst currentUser = async () =\u003e {\n    const { user, errors } = safeResponseData(await api.user.current())\n    return { errors, user }\n}\n\nconst confirmPassword = async (values) =\u003e {\n    const { errors, confirmedAt } = safeResponseData(await api.user.confirmPassword(values.password))\n    return { errors, confirmedAt }\n}\n\nconst logoutUser = async () =\u003e {\n    const { errors } = safeResponseData(await api.auth.logout())\n    return { errors }\n}\n\nconst loginUser = async (email, password) =\u003e {\n    const { user, errors } = safeResponseData(await api.auth.login({ email, password }))\n    return { errors, user }\n}\n\nconst registerUser = async (values) =\u003e {\n    const { user, errors } = safeResponseData(await api.auth.register({\n        email: values.email,\n        emailConfirmation: values.emailConfirmation,\n        password: values.password,\n        passwordConfirmation: values.passwordConfirmation,\n        name: values.name,\n    }))\n    return { errors, user }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericdowell%2Fresource-endpoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericdowell%2Fresource-endpoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericdowell%2Fresource-endpoint/lists"}