{"id":22220399,"url":"https://github.com/labor-digital/json-api","last_synced_at":"2025-03-25T07:41:15.397Z","repository":{"id":42913745,"uuid":"249401872","full_name":"labor-digital/json-api","owner":"labor-digital","description":"Provides the implementation to communicate with an json api compatible endpoint","archived":false,"fork":false,"pushed_at":"2022-03-26T09:02:55.000Z","size":610,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T07:12:18.289Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/labor-digital.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-03-23T10:37:08.000Z","updated_at":"2021-06-07T11:55:36.000Z","dependencies_parsed_at":"2022-09-07T11:11:50.937Z","dependency_job_id":null,"html_url":"https://github.com/labor-digital/json-api","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labor-digital%2Fjson-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labor-digital%2Fjson-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labor-digital%2Fjson-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labor-digital%2Fjson-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labor-digital","download_url":"https://codeload.github.com/labor-digital/json-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245422921,"owners_count":20612725,"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","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-12-02T23:08:31.656Z","updated_at":"2025-03-25T07:41:15.377Z","avatar_url":"https://github.com/labor-digital.png","language":"TypeScript","readme":"# Json API\nProvides the implementation to communicate with an [json api compatible](https://jsonapi.org/) endpoint.\nThe package is build with [axios](https://www.npmjs.com/package/axios) as http client and utilizes [jsonapi-serializer](https://www.npmjs.com/package/json-api-serializer) to normalize the results into javascript objectes.\n\n## Installation\nInstall this package using npm:\n\n```\nnpm install @labor-digital/json-api\n```\n\n## Usage\n```typescript\nimport {JsonApiState} from \"./lib/JsonApiState\"; \nimport {JsonApi} from \"./lib/JsonApi\";\n\n// Create the instance\nconst api = new JsonApi({baseUrl: \"https://example.org/api/resources\"});\n\n// Request the resources of type \"myResource\" that are on page 2\n// The query object has some types already defined but as specified in the json-api \n// definition, it can be extended with your own keys\nconst results = api.get(\"myResource\", {page: {number: 2}});\n\n// Iterate all results in the list and print the value of \"myKey\" into the console\nresults.forEach((result: JsonApiState) =\u003e {\n    console.log(result.get(\"myKey\"));\n});\n\n// You can also request a single resource by using the unique id as a lookup query\nconst state = api.getSingle(\"myResource\", 12);\nconsole.log(state.get(\"myKey\"));\n```\n\n## Documentation\nThe documentation / API can be found [here](https://json-api.labor.tools) but is also rendered at \"./doc/index.html\" for local usage\n\n## Postcardware\nYou're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.\n\nOur address is: LABOR.digital - Fischtorplatz 21 - 55116 Mainz, Germany\n\nWe publish all received postcards on our [company website](https://labor.digital).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabor-digital%2Fjson-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabor-digital%2Fjson-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabor-digital%2Fjson-api/lists"}