# @tccvgithub/pdex

> Script imports data in drupal of tvcc

Latest version **1.1.4** (published 2023-06-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install @tccvgithub/pdex
pnpm add @tccvgithub/pdex
yarn add @tccvgithub/pdex
bun add @tccvgithub/pdex
```

Provides the command `pdex`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2023-06-16 |
| First published | 2023-06-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=14.16 |
| Dependencies | 7 |
| Unpacked size | 28.7 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matteo Salvestrini |
| Maintainers | tccvgithub |
| Keywords | drupal, rest, nodejs, axios, typescript |

## Links

- npm: https://www.npmjs.com/package/@tccvgithub/pdex
- Repository: https://github.com/tccvgithub/drupal-jsonapi
- Homepage: https://github.com/tccvgithub/drupal-jsonapi#readme
- Issues: https://github.com/tccvgithub/drupal-jsonapi/issues
- npm.io page: https://npm.io/package/@tccvgithub/pdex

## Dependencies (7)

- [axios](https://npm.io/package/axios.md) ^0.27.2
- [debug](https://npm.io/package/debug.md) ^4.3.4
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.1
- [ts-node](https://npm.io/package/ts-node.md) ^10.8.1
- [drupal-sdk](https://npm.io/package/drupal-sdk.md) ^1.8.0
- [p-throttle](https://npm.io/package/p-throttle.md) 4.1.1
- [typescript](https://npm.io/package/typescript.md) ^4.7.3

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.1.4 (latest) — 2023-06-16

## README

PDEX Import
--

This package is an utility for import data from pdex API to the drupal content.
It will download three types of content:
 * Recursos Fiscalizados
 * Processos Decididos na Previa
 * ContasPrestadas

# How does it work

The process look for the following environment variables:

* PDEX_REMOTE_API_URL = url of the PDEX api
* PDEX_REMOTE_API_USER = username to get the auth token
* PDEX_REMOTE_API_PASS = password to get the auth token

* PDEX_DRUPAL_HOST = drupal website url
* PDEX_DRUPAL_USER = drupal username to access rest api
* PDEX_DRUPAL_PASS = drupal password to access rest api

these variables can come from the environment or via a .env file since the process uses [dotenv](https://www.npmjs.com/package/dotenv) package.

On a unix like machine you can do 

```bash
$ export PDEX_REMOTE_API_URL="https://pdex.contas.cv"
$ export PDEX_REMOTE_API_USER="user123"
$ export PDEX_REMOTE_API_PASS="pass123"
...
```

On windows 
```pwsh
c:\> set PDEX_REMOTE_API_URL=https://pdex.contas.cv
c:\> set PDEX_REMOTE_API_USER=user123
c:\> set PDEX_REMOTE_API_PASS=pass123
...
```

To run the script just run

```bash
$ npx @hpfs/pdex
```

```pwsh
c:\> npx @hpfs/pdex
```

change the @hpfs to the new package name.


# Package publishing
The package should be published to your repository or npmjs.com
When a change happens please do ```npm version --minor``` then do ```npm publish```.
Follow [this guide](https://docs.npmjs.com/creating-and-publishing-scoped-public-packages) to understand how npm packages publishing works.

---
_Source: https://npm.io/package/@tccvgithub/pdex · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
