{"id":18758561,"url":"https://github.com/braveulysses/scim2-js","last_synced_at":"2025-04-13T02:31:56.334Z","repository":{"id":66659266,"uuid":"79862509","full_name":"braveulysses/scim2-js","owner":"braveulysses","description":"A simple SCIM 2 library for JavaScript","archived":true,"fork":false,"pushed_at":"2020-02-21T11:20:41.000Z","size":195,"stargazers_count":4,"open_issues_count":18,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T02:27:11.163Z","etag":null,"topics":["scim"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/braveulysses.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}},"created_at":"2017-01-24T00:13:40.000Z","updated_at":"2025-03-14T21:53:50.000Z","dependencies_parsed_at":"2023-03-27T13:18:08.957Z","dependency_job_id":null,"html_url":"https://github.com/braveulysses/scim2-js","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"afe1e84fc1d81767ed1823755dee236fdf2da761"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braveulysses%2Fscim2-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braveulysses%2Fscim2-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braveulysses%2Fscim2-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braveulysses%2Fscim2-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/braveulysses","download_url":"https://codeload.github.com/braveulysses/scim2-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657793,"owners_count":21140842,"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":["scim"],"created_at":"2024-11-07T17:46:50.542Z","updated_at":"2025-04-13T02:31:56.328Z","avatar_url":"https://github.com/braveulysses.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/braveulysses/scim2-js.svg?branch=master)](https://travis-ci.org/braveulysses/scim2-js)\n\n# scim2-js\n\nThis is a simple JavaScript library for [SCIM 2](http://www.simplecloud.info/) applications. SCIM 2 is a set of standards that defines a schema for representing identities, plus a REST API for creating, retrieving, updating, and deleting them.\n\nThis library's feature set is not exhaustive and covers a limited set of common cases. These include:\n\n* Parsing a JSON document into a SCIM resource object.\n  * Getting attribute values from a SCIM object using SCIM paths like `userName` or `emails[value eq \"user@example.com\"]`. (Not supported: filters containing multiple expressions)\n* Modifying a SCIM resource object.\n* Building a PATCH request.\n\nIf you're looking for a SCIM 2 library with more comprehensive support for the SCIM 2 standard, see the [UnboundID SCIM 2 SDK for Java](https://github.com/UnboundID/scim2). I'm not aware of a comparable JavaScript SDK.\n\n## Installation\n\n```\nnpm install @braveulysses/scim2-js\n```\n\nOr\n\n```\nyarn add @braveulysses/scim2-js\n```\n\n## API\n\nSee the generated [API docs](API.md).\n\n### Making requests\n\nThis library will help you parse SCIM responses and formulate certain kinds of requests, but it doesn't actually provide an HTTP client, since numerous generic options are already available that work well. For example, see [Axios](https://github.com/mzabriskie/axios), [whatwg-fetch](https://github.com/github/fetch), or [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch).\n\n## Example\n\n```javascript\nimport { Resource, Patch, Constants } from 'scim2-js';\n\nconst url = 'https://example.com/scim/v2/Users/7f93b9ae-85ce-4bce-baf8-1c18f25ace64';\nconst accessToken = '...';\nconst expectedUsername = '...';\n\n// This example uses the Fetch API, but the request mechanism is up to you.\nfetch(url, {\n  method: 'get',\n  headers: {\n    'Authorization': 'Bearer ' + accessToken,\n    'Accept': Constants.SCIM_MEDIA_TYPE\n  }\n}).then(function(response) {\n  return response.json();\n}).then(function(json) {\n  const user = new Resource(json);\n  expect(user.id()).toEqual('7f93b9ae-85ce-4bce-baf8-1c18f25ace64');\n  expect(user.schemas()).toContain('urn:ietf:params:scim:schemas:core:2.0:User');\n  expect(user.get('userName')).toEqual(expectedUsername);\n  \n  // Modify an attribute.\n  const phoneNumbers = user.get('phoneNumbers');\n  phoneNumbers.push({\n    value: \"+1 555 555 1234\",\n    type: \"other\",\n    primary: false\n  });\n  user.set('phoneNumbers', phoneNumbers);\n  // You could then apply the modification by replacing the resource with PUT.\n  expect(user.get('phoneNumbers')).toEqual(phoneNumbers);\n  \n  // Alternatively, you could build a partial modification request...\n  const patch = Patch.patchRequest(\n    Patch.addOperation('phoneNumbers', {\n      value: \"+1 555 555 1234\",\n      type: \"other\",\n      primary: false\n    })\n  );\n  // ... and then apply the modification by sending a PATCH request.\n});\n```\n\n## License\n\nThis is licensed under the Apache License 2.0.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraveulysses%2Fscim2-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbraveulysses%2Fscim2-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraveulysses%2Fscim2-js/lists"}