JSPM

dila-api-client

0.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q18811F
  • License MIT

a client for the DILA API that publishes the french law

Package Exports

  • dila-api-client

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dila-api-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

dila-api-client

This JS package helps querying the DILA API

Usage

You need to set two envrionment variables : OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET.

These variables are the "oauth identifier" defined in your custom application in the AIFE portal

Récupérer la table des matières d'un code

const DilaApiClient = require("dila-api-client");

const dilaApi = new DilaApiClient();

dilaApi.fetchCodeTableMatieres({
  date: new Date().getTime(),
  sctId: "",
  textId: "LEGITEXT000006072050"
}).then(console.log)

Other API calls

dilaApi.apiFetch({
  path: 'dila/legifrance/lf-engine-app/list/code'
  method: 'POST,
  params: {
    test: 42
  }
}).then(console.log)

Debug

you need to set the DEBUG=dila-api-client environment variable in order to see the output of inner logs.