refs #4823 Añadido modulo colors y modif. readme
This commit is contained in:
parent
9acb656501
commit
c57916815d
|
@ -78,16 +78,16 @@ npm dev-sync # run and create the db structure
|
|||
### .env file
|
||||
|
||||
```bash
|
||||
# FLORIDAY SERVICE CONFIG
|
||||
CLIENT_ID = floriday-client_id
|
||||
CLIENT_SECRET = floriday-client_secret
|
||||
STATUS = production_or_development
|
||||
|
||||
# SEQUELIZE CONFIG
|
||||
|
||||
DB_SCHEMA = edi
|
||||
DB_USER = root
|
||||
DB_PWD = root
|
||||
DB_HOST = localhost
|
||||
DB_DIALECT = mariadb
|
||||
|
||||
FORCE_SYNC = false
|
||||
```
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -11,6 +11,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"cli-progress": "^3.11.2",
|
||||
"colors": "^1.4.0",
|
||||
"dotenv": "^16.0.3",
|
||||
"mariadb": "^3.0.2",
|
||||
"moment": "^2.29.4",
|
||||
|
|
4
utils.js
4
utils.js
|
@ -3,6 +3,7 @@ import fetch from 'node-fetch';
|
|||
import dotenv from 'dotenv';
|
||||
import { models } from './models/index.js';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import colors from 'colors';
|
||||
//import cliProgress from 'cli-progress';
|
||||
dotenv.config();
|
||||
|
||||
|
@ -22,6 +23,9 @@ const BASE_CUSTOMER_URL = 'https://api.staging.floriday.io/customers-api/2022v2/
|
|||
async function getClientToken() {
|
||||
const clientConfigData = await models.clientConfig.findAll();
|
||||
|
||||
if (!clientConfigData[0])
|
||||
throw colors.red.bold('Token has expired')
|
||||
|
||||
const now = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||
const tokenExpirationDate = clientConfigData[0].tokenExpiration;
|
||||
|
||||
|
|
Loading…
Reference in New Issue