{"id":24419025,"url":"https://github.com/badbatch/getta","last_synced_at":"2025-12-26T21:22:57.856Z","repository":{"id":41125137,"uuid":"95480004","full_name":"badbatch/getta","owner":"badbatch","description":"An isomorphic rest client based on the Fetch API.","archived":false,"fork":false,"pushed_at":"2025-06-18T16:44:15.000Z","size":1443,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-21T23:51:45.163Z","etag":null,"topics":["api-client","fetch","isomorphic","rest"],"latest_commit_sha":null,"homepage":null,"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/badbatch.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-06-26T19:04:56.000Z","updated_at":"2025-06-18T16:44:16.000Z","dependencies_parsed_at":"2024-01-12T21:39:06.324Z","dependency_job_id":"5de70661-e128-4aa8-b58c-923810bae8e8","html_url":"https://github.com/badbatch/getta","commit_stats":{"total_commits":139,"total_committers":4,"mean_commits":34.75,"dds":"0.40287769784172667","last_synced_commit":"54dbbc6290351e17d9682a2da84f02462406746b"},"previous_names":["dylanaubrey/getta"],"tags_count":55,"template":false,"template_full_name":null,"purl":"pkg:github/badbatch/getta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badbatch%2Fgetta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badbatch%2Fgetta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badbatch%2Fgetta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badbatch%2Fgetta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badbatch","download_url":"https://codeload.github.com/badbatch/getta/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badbatch%2Fgetta/sbom","scorecard":{"id":222800,"data":{"date":"2025-08-11","repo":{"name":"github.com/badbatch/getta","commit":"13a725bd7ce056843f99d71dd5a341bf71a7e43a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"name":"Maintained","score":10,"reason":"12 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","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/build-and-deploy.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":"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":"Code-Review","score":0,"reason":"Found 0/28 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":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/build-and-deploy.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/badbatch/getta/build-and-deploy.yml/main?enable=pin","Warn: downloadThenRun not pinned by hash: shellScripts/installActivateMise.sh:6","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 downloadThenRun 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":"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":"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 2 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":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4"],"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-17T02:58:56.229Z","repository_id":41125137,"created_at":"2025-08-17T02:58:56.229Z","updated_at":"2025-08-17T02:58:56.229Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28061384,"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-12-26T02:00:06.189Z","response_time":55,"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-client","fetch","isomorphic","rest"],"created_at":"2025-01-20T09:17:16.113Z","updated_at":"2025-12-26T21:22:57.835Z","avatar_url":"https://github.com/badbatch.png","language":"TypeScript","readme":"# Getta\n\nAn isomorphic rest client based on the Fetch API.\n\n[![build-and-deploy](https://github.com/badbatch/getta/actions/workflows/build-and-deploy.yml/badge.svg)](https://github.com/badbatch/getta/actions/workflows/build-and-deploy.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![npm version](https://badge.fury.io/js/getta.svg)](https://badge.fury.io/js/getta)\n\n## Installation\n\n```bash\nnpm add getta\n```\n\n## Usage\n\nYou create an instance of the rest client with the `createRestClient` function. The function takes numerous options, including the base path of the url for all requests, a cache for caching responses against the request, and a performance module to use for recording request durations. The full list of the options are detailed below.\n\n```typescript\nimport { Core } from '@cachemap/core';\nimport { init as map } from '@cachemap/map';\nimport { createRestClient } from 'getta';\nimport { performance } from 'node:perf_hooks';\n\nconst restClient = createRestClient({\n  basePath: 'https://www.example.com',\n  cache: new Core({\n    name: 'restClient',\n    store: map(),\n    type: 'example',\n  }),\n  performance\n});\n```\n\n### Rest client options\n\n**basePath: `string`**\n\nThe base path of the url for all requests made from an instance of the rest client, i.e. `'https://www.example.com/api'`.\n\n**bodyParser?: `(...args: any[]) =\u003e any`**\n\nAn optional callback to pass each response body through after it has been parsed by the stream reader.\n\n**cache?: `Core`**\n\nAn instance of the @cachemap/core cache for caching responses against requests. Caching is only enabled on `GET` requests. For more info on @cachemap/core see \u003chttps://github.com/badbatch/cachemap\u003e.\n\n**enableConditionalRequests?: `boolean`**\n\nEnables conditional requests with If-None-Match header. Default is `true`.\n\n**fetchTimeout?: `number`**\n\nHow long to wait for a request to respond before timing out and returning an error. Default is `5000`.\n\n**headers?: `Record\u003cstring, string\u003e`**\n\nAny headers to attach to every request.\n\n**log?: `(message: string, data: PlainObject, logLevel?: LogLevel) =\u003e void`**\n\nLog function to pass rest client logs to a logger.\n\n**maxRedirects?: `number`**\n\nThe maximum number of times a request can redirect before the rest client returns an error. Default is `5`.\n\n**maxRetries?: `number`**\n\nThe maximum number of times a request can retry before the rest client returns an error. Default is `3`.\n\n**optionalPathTemplateRegExp?: `RegExp`**\n\nAn optional path template regex that can be used to clean up the template url. Default is `/({\\w+\\?})/g`.\n\n**pathTemplateCallback?: `(pathTemplate: string, data: Record\u003cstring, string\u003e, pathTemplateRegExp: RegExp) =\u003e string`**\n\nA callback that takes the path template, the data to be injected into the template, and the path template regex, and returns the templated url. There is a default template callback that will cater to most needs.\n\n**pathTemplateRegExp?: `RegExp`**\n\nA regex to tell the rest client where to inject data into the template. There is a default one that will cater to some needs. Default is `/({type})|({id})|({id,\\+})|({brief\\|standard})/g`.\n\n**performance: `Performance`**\n\nThe performance module to use for recording request durations.\n\n**queryParams?: `PlainObject`**\n\nAny query params to attach to every request.\n\n**rateLimit?: `boolean`**\n\nWhether to enable the rate limit feature.\n\n**rateLimitPerSecond?: `number`**\n\nHow many requests per second to throttle the rest client. Default is `50`.\n\n**requestRetryWait?: `number`**\n\nHow many milliseconds to wait before retrying a request. Default is `100`.\n\n**streamReader?: `'arrayBuffer' | 'blob' | 'formData' | 'json' | 'text'`**\n\nThe stream reader to use when parsing the response body. Default is `'json'`.\n\n### Making requests\n\nThe rest client supports `GET`, `POST`, `PUT` and `DELETE` methods and has functions for each method. The first argument is the path to make the request to. This can also be a path template with variable placeholders that will be replaced with data passed in on the `pathTemplateData` request option.\n\n```typescript\n// GET\nconst getResponse = await restClient.get('/path/to/resource');\n\n// POST\nconst postResponse = await restClient.post('/graphql/api', {\n  body: JSON.stringify({ /* payload */ }),\n});\n\n// PUT\nconst putResponse = await restClient.put('/path/to/resource', {\n  body: JSON.stringify({ /* payload */ }),\n});\n\n// DELETE\nconst deleteResponse = await restClient.delete('/path/to/resource');\n```\n\n### Request options\n\n**body?: `ReadableStream | Blob | BufferSource | FormData | URLSearchParams | string`**\n\nFor `POST` and `PUT` methods, the body to send with the request.\n\n**headers?: `Record\u003cstring, string\u003e`**\n\nAny headers to attach to the request.\n\n**method?: `'get' | 'post' | 'put' | 'delete'`**\n\nThe fetch method.\n\n**pathTemplateData?: `Record\u003cstring, string\u003e`**\n\nData to be injected into the path template.\n\n**queryParams?: `PlainObject`**\n\nAny query params to attach to the request.\n\n### Shortcuts\n\nIt is possible to alias a request and bake things like the path template and request options into the alias, reducing the number of options that need to be passed into a request.\n\n```typescript\nimport { createRestClient } from 'getta';\nimport { performance } from 'node:perf_hooks';\n\nconst restClient = createRestClient\u003c'getProduct'\u003e(\n  { basePath: 'https://www.example.com', performance },\n  {\n    getProduct: [\n      '/direct/rest/content/catalog/{type}/{id,+}?format={brief|standard}'\n      {\n        method: consts.GET_METHOD,\n        pathTemplateData: { 'brief|standard': 'standard', type: 'product' },\n      },\n    ],\n  }\n);\n\nconst getResponse = await restClient.getProduct({ pathTemplateData: { 'id,+': '136-7317' } });\n```\n\n## Changelog\n\nCheck out the [features, fixes and more](CHANGELOG.md) that go into each major, minor and patch version.\n\n## License\n\nGetta is [MIT Licensed](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadbatch%2Fgetta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadbatch%2Fgetta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadbatch%2Fgetta/lists"}