{"id":28171130,"url":"https://github.com/philips-software/qubekit","last_synced_at":"2025-05-15T18:16:46.245Z","repository":{"id":292331728,"uuid":"876214371","full_name":"philips-software/qubekit","owner":"philips-software","description":"A Javascript SDK for the SonarQube API","archived":false,"fork":false,"pushed_at":"2025-05-09T10:23:58.000Z","size":309,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-09T11:47:45.181Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philips-software.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-21T15:31:44.000Z","updated_at":"2025-05-09T10:22:26.000Z","dependencies_parsed_at":"2025-05-09T11:58:56.313Z","dependency_job_id":null,"html_url":"https://github.com/philips-software/qubekit","commit_stats":null,"previous_names":["philips-software/qubekit"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips-software%2Fqubekit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips-software%2Fqubekit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips-software%2Fqubekit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips-software%2Fqubekit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philips-software","download_url":"https://codeload.github.com/philips-software/qubekit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254394704,"owners_count":22063985,"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":"2025-05-15T18:16:02.327Z","updated_at":"2025-05-15T18:16:46.239Z","avatar_url":"https://github.com/philips-software.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Qubekit - a toolkit for the SonarQube API\n\nQubekit is a Node.js package that provides an API to facilitate communication\nwith the SonarQube API, aiding in the communicating with a SonarQube instance\nvia its web API.\n\n## Overview\n\nQubekit supports both v1 and v2 of the SonarQube API and generates APIs from\nOpenAPI specifications using [hey-api](https://heyapi.dev/openapi-ts/)\ngenerator.\n\nThe v1 API is hand-created based on the SonarQueb documentation provided in an\ninstance. At present only a limited number of endpoints are supported, new\nendpoints can be added as needed\n\nThe v2 API is automatically generated from the OpenAPI specification provided by\na SonarQube instance.\n\nA wrapper function, `createQubekit`, is provided around these APIs to enable the\neasy creation of the client and validation of the required configuration inputs.\n\n## Installation\n\nTo install Qubekit, run:\n\n```sh\nnpm install @philips-software/qubekit\n# or\nyarn add @philips-software/qubekit\n```\n\n## Usage\n\nTo create a Qubekit client, use the createQubekit function:\n\n```ts\nimport { createQubekit } from '@philips-software/qubekit';\n\nconst client = createQubekit({\n  baseURL: 'https://your-sonarqube-instance.com/api',\n  token: 'your-token',\n});\n```\n\n### Unified API Access\n\nQubeKit provides a unified API that merges the v1 and v2 APIs into a single\ninterface. This makes your code cleaner and more maintainable:\n\n```ts\n// Search for projects\nconst result = await client.project.searchProjects({\n  query: {\n    projects: 'project1',\n  },\n});\n\n// Use user endpoints\nconst users = await client.user.search();\n```\n\n### Method Name Improvements\n\nThe SDK automatically cleans method names by removing numeric suffixes. For\nexample, if the OpenAPI specification defines a method as `search1`, you can\naccess it as simply `search` in your code.\n\n**Benefits:**\n\n- Cleaner, more intuitive API\n- No need to remember numeric suffixes\n- Improved code readability\n\n### Type Safety\n\nThe SDK provides full TypeScript support with proper type definitions for all\nmethods and parameters. This ensures you get proper IDE autocompletion and type\nchecking when using the API.\n\n## Updating the Schema\n\nThe SDK is generated from OpenAPI schemas that define the SonarQube API. Both\nthe v1 and v2 APIs are documented independently. To make changes/additions you\nneed to update the openapi schemas and then generate the code. The generation\nwill merge the schemas into a single unified schema.\n\n### API Schemas\n\n**V1 API**\n\n- Located at `src/schema/sonarqube-v1.yaml`\n- Hand-crafted based on SonarQube documentation\n- Can be edited using the\n  [api-fiddle workspace](https://api-fiddle.com/editor/scott-guymers-organization-0xi/sonarqube-v1-api)\n\n**V2 API**\n\n- Located at `src/schema/sonarqube-v2.json`\n- Can be obtained from any SonarQube instance at\n  `https://your-instance/api/v2/api-docs`\n\n### Merging Schemas\n\nThe schemas are merged using the\n[OpenAPI Merge](https://www.npmjs.com/package/openapi-merge-cli) tool. This is\nautomatic as part of the `yarn openapi-ts` command. The\n`src/schema/sonarqube-all.yaml` file is the merged schema which the code is\ngenerated from.\n\n### Generating the TypeScript SDK\n\nAfter updating the schemas, run:\n\n```sh\nyarn openapi-ts\n```\n\nThis will regenerate the SDK with the latest API definitions. The QubeKit\nwrapper will automatically:\n\n1. Clean method names by removing numeric suffixes\n2. Provide a unified interface to both v1 and v2 APIs\n3. Ensure proper TypeScript type definitions\n\nCommit all changes to the repository after regeneration.\n\n## Community\n\nThis project uses a [CODE_OF_CONDUCT](./CODE_OF_CONDUCT.md) to define expected\nconduct in our community. Instances of abusive, harassing, or otherwise\nunacceptable behavior may be reported to the repository administrators by using\nthe\n[Report content](https://docs.github.com/en/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam)\nfunctionality of GitHub.\n\n## Changelog\n\nThe changelog is automatically generated from the commits that are squashed into\nthe main using\n[conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) to define\nthe different impact of changes (features, fixes, etc)\n\nSee [CHANGELOG](./CHANGELOG.md) for more info on what's been changed.\n\n## Contributing Guidelines\n\nSee [CONTRIBUTING](./CONTRIBUTING.md)\n\n## Licenses\n\nSee [LICENSE](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilips-software%2Fqubekit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilips-software%2Fqubekit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilips-software%2Fqubekit/lists"}