{"id":14483531,"url":"https://github.com/dnum-mi/ds-api-client","last_synced_at":"2025-04-23T15:24:58.021Z","repository":{"id":60505445,"uuid":"539996640","full_name":"dnum-mi/ds-api-client","owner":"dnum-mi","description":"Client d'API DémarcheSimplifiée","archived":false,"fork":false,"pushed_at":"2024-10-21T10:24:46.000Z","size":1332,"stargazers_count":2,"open_issues_count":4,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-22T19:57:16.596Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dnum-mi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2022-09-22T13:30:46.000Z","updated_at":"2025-01-28T09:57:50.000Z","dependencies_parsed_at":"2024-10-22T11:10:50.897Z","dependency_job_id":null,"html_url":"https://github.com/dnum-mi/ds-api-client","commit_stats":null,"previous_names":["lab-mi/ds-api-client"],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnum-mi%2Fds-api-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnum-mi%2Fds-api-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnum-mi%2Fds-api-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnum-mi%2Fds-api-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnum-mi","download_url":"https://codeload.github.com/dnum-mi/ds-api-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250458593,"owners_count":21433904,"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-09-03T00:01:50.587Z","updated_at":"2025-04-23T15:24:57.998Z","avatar_url":"https://github.com/dnum-mi.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# ds-api-client\n\nUn DS Client GraphQL prenant en charge Node et les navigateurs pour les scripts ou les applications simples\n\n## Fonctionnalités\n\n* DS **API V2** Client GraphQL\n* Promise-based API (fonctionne avec `async` / `await`)\n* Prise en charge de TypeScript\n* Isomorphic (fonctionne avec Node / navigateurs)\n\n## Run Test\n\n```shell\ncp test/env.example .env \n# Changer les valeurs dans le .env\nnpm test\n```\n\n## Installation\n\nNPM: [https://www.npmjs.com/package/@dnum-mi/ds-api-client](https://www.npmjs.com/package/@dnum-mi/ds-api-client)\n\n```shell\nnpm add ds-api-client\n```\n\n## Utilisation\n\n```js\nimport { DsApiClient } from 'ds-api-client'\n\nconst token = 'xxxxx'\nconst url = 'https://www.demarches-simplifiees.fr/api/v2/graphql'\n\n// ... Créer une instance DS API client  \nconst client = new DsApiClient(url, token)\n\n// ... Créer une instance DS API client avec un http proxy\nconst client = new DsApiClient(url, token, proxyUrl)\n\n// ... Rechercher une demarche par id de demarche \nconst demarche = await client.demarche(idDemarche)\n\n// ... Rechercher les dossiers d'une demarche par id de demarche \nconst demarcheDossiers = await client.demarcheDossiers(idDemarche).then((data) =\u003e console.log(data))\n\n// ... Rechercher les dossiers supprimés d'une demarche par id de demarche \nconst demarcheDeletedDossiers = await client.demarcheDeletedDossiers(idDemarche).then((data) =\u003e console.log(data))\n\n// ... Rechercher un dossier par id de dossier\nconst dossier = await client.dossier(idDossier).then((data) =\u003e console.log(data))\n\n// ... Rechercher les groupeInstructeur par une id\nconst groupeInstructeur = await client.groupeInstructeur(idGroupeInstructeur).then((data) =\u003e console.log(data))\n```\n\n## Generation des types à partir du schema grapghql\n\nLe schema de Demarches-Simplifiées peut-être récupérer de lien [ici](https://github.com/demarches-simplifiees/demarches-simplifiees.fr/blob/main/app/graphql/schema.graphql).\n\nPour générer, utliser le site generation [https://the-guild.dev/graphql/codegen](https://the-guild.dev/graphql/codegen).\nLa configuration à mettre est au nivau de codegen.yml est\n\n```yaml\ngenerates:\n  generated-types.ts:\n    plugins:\n      - typescript\n    config:\n      enumsAsConst: true\n```\n\n## Publier dans le registre npm\n\n* Sur un action de 'push' ou fusion sur la branche \"main\", un \"pull resquet\" de création de \"release\" sera crée\n* Fusionner cet \"pull request\" sur main\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnum-mi%2Fds-api-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnum-mi%2Fds-api-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnum-mi%2Fds-api-client/lists"}