Dump JSON régulier des conventions collectives publiées par l'API DILA.
Extracted with dila-api-client from DILA API API using unist (Univeral Syntax Tree) structure.
npm i @socialgouv/kali-data
An agreement is a labor agreement (convention collective in French). Only national agreements are available at the moment. Each agreement is made up of articles wrapped within sections.
An article always refers to an agreement article.
This package is typed with Typescript, you can check the returns type details there.
It's possible to require any of the available agreements JSON unist tree straight from the data directory:
const JournalismAgreement = require("@socialgouv/kali-data/data/KALITEXT000005652402.json");
And the list of available agreements with :
const agreements = require("@socialgouv/kali-data/data/index.json");
Return Type
KaliData.Agreement
Get a full agreement unist tree with its sections and articles.
Parameter | Type | Default | Description |
---|---|---|---|
agreementIdOrIdcc |
number | string |
required | Agreement ID or IDCC |
Return Type
KaliData.Agreement
getAgreementArticlesWithPath()
instead.
Get a flat unist array of all the articles an agreement contains.
Each article includes a list of its parent sections.
Parameter | Type | Default | Description |
---|---|---|---|
agreementIdOrIdcc |
number | string |
required | Agreement ID or IDCC |
Return Type
KaliData.AgreementArticleWithParentSections[]
Get a flat unist array of all the articles an agreement contains.
Each article includes its parent sections path, as an ordered list of their titles.
Parameter | Type | Default | Description |
---|---|---|---|
agreementIdOrIdcc |
number | string |
required | Agreement ID or IDCC |
Return Type
KaliData.AgreementArticleWithPath[]
Convert any agreement ID or IDCC into a normalized agreement ID.
Parameter | Type | Default | Description |
---|---|---|---|
agreementIdOrIdcc |
number | string |
required | Agreement ID or IDCC |
Return Type
string
Get the full list of indexed agreements.
Return Type
KaliData.IndexedAgreement[]
Get the full list of indexed articles.
Return Type
KaliData.IndexedArticle[]
getArticleWithPath()
instead.
Get an agreement article unist node with its parent sections.
Parameter | Type | Default | Description |
---|---|---|---|
articleIdOrCid |
string |
required | Article ID or CID |
Return Type
KaliData.AgreementArticleWithParentSections
Get an agreement article unist node with its parent sections path.
The parent sections path is represented as an ordered array of their titles.
Parameter | Type | Default | Description |
---|---|---|---|
articleIdOrCid |
string |
required | Article ID or CID |
Return Type
KaliData.AgreementArticleWithPath
Get an indexed article.
Parameter | Type | Default | Description |
---|---|---|---|
articleIdOrCid |
string |
required | Article ID or CID |
Return Type
KaliData.IndexedArticle
Check if an agreement is available.
Parameter | Type | Default | Description |
---|---|---|---|
agreementIdOrIdcc |
number | string |
required | Agreement ID or IDCC |
Return Type
boolean
Check if an article is available.
Parameter | Type | Default | Description |
---|---|---|---|
articleIdOrCid |
string |
required | Article ID or CID |
Return Type
boolean
First, you'll need to create an application on PISTE and select DILA - Légifrance Beta API.
Then:
yarn
yarn setup
This will automatically prompt and store your OAuth Client ID & Secret.
yarn data:update
will automatically fetch, match, list and check data package agreements with
their articles.
yarn data:check
Check agreements consistency.yarn data:fetch
: Update agreements articles from DILA API.yarn data:match
: Update agreements articles index (matching articles ID & CID with their agreements ID).yarn data:list
UpdateREFERENCES.md
file.
yarn test:lint
: Lint codebase.yarn test:type
: Check typings.yarn test:unit
Launch unit tests.yarn test:update
Update unit tests snapshots.yarn test:watch
Launch unit tests in watching mode.
The agreement references list is available here.
- Code du travail numérique
- dila-api-client : Client JavaScript pour l'API DILA AIFE
- legi-data : base LEGI
- fiches-vdd : Fiches vos droits et démarches