npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@socialgouv/kali-data-types

v3.203.0

Published

[![License][img-license]][link-license] [![NPM Version][img-npm]][link-npm] [![Code Coverage][img-coverage]][link-coverage]

Downloads

2,349

Readme

@socialgouv/kali-data

License NPM Version Code Coverage


Dump JSON régulier des conventions collectives publiées par l'API DILA.

:warning: Experimental, for internal usage only :warning:


Extracted with dila-api-client from DILA API API using unist (Univeral Syntax Tree) structure.

Usage

Getting started

npm i @socialgouv/kali-data

Definitions

Agreement

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.

Article

An article always refers to an agreement article.

API

This package is typed with Typescript, you can check the returns type details there.

Data

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

getAgreement()

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

getAgreementArticlesWithParentSections()

:warning: Deprecated: Use 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[]

getAgreementArticlesWithPath()

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[]

getAgreementIdFromIdOrIdcc()

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

getAgreements()

Get the full list of indexed agreements.

Return Type

KaliData.IndexedAgreement[]

getArticles()

Get the full list of indexed articles.

Return Type

KaliData.IndexedArticle[]

getArticleWithParentSections()

:warning: Deprecated: Use 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

getArticleWithPath()

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

getIndexedArticle()

Get an indexed article.

| Parameter | Type | Default | Description | | ---------------- | -------- | ------------ | ----------------- | | articleIdOrCid | string | required | Article ID or CID |

Return Type

KaliData.IndexedArticle

hasAgreement()

Check if an agreement is available.

| Parameter | Type | Default | Description | | ------------------- | ------------------ | ------------ | -------------------- | | agreementIdOrIdcc | number \| string | required | Agreement ID or IDCC |

Return Type

boolean

hasArticle()

Check if an article is available.

| Parameter | Type | Default | Description | | ---------------- | -------- | ------------ | ----------------- | | articleIdOrCid | string | required | Article ID or CID |

Return Type

boolean

Contributing

Getting started

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.

Data Generation

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 Update REFERENCES.md file.

Tests

  • 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.

References

The agreement references list is available here.

See Also