@onergy/onergy-client
v1.0.10
Published
CLI onergy client para o VS Code
Downloads
10
Readme
ONERGY-CLIENT
File .env
Path: /.env
| KEY | DESCRIPTION | | - | - | | URI_ONERGY | Host do Onergy | | SUB_KEY_ONERGY | SubscriptionKey (OCP) assinatura Onergy | | - | - | | NODE_ENV | Tipo de conexão TAXFY_LINK ou PROD ou DEV => CONECTION_{NODE_ENV} | | CONECTION_TAXFY_LINK | ConnectionString banco Taxfy Link | | CONECTION_PRD | ConnectionString banco PROD | | CONECTION_DEV | ConnectionString banco DEV | | - | - | | DATABASE | Nome da base | | COLLECTION | Nome da collection | | ASS_ID | Id. da Assinatura Onergy | | USR_ID | Id. do Usuário Adm ou de Serviço | | - | - |
Example
const { onergy, onergy_get, utils, mongo, ajax... } = require('@onergy/onergy-client');
async function init() {
//utils.GetNewGuid
const guid = utils.GetNewGuid();
//utils.GetUserDtNow
const dateUserNow = utils.GetUserDtNow();
//onergy.log
onergy.log(dateUserNow);
onergy.log(guid);
//onergy_get
const options = {
ftdid: "",
assid: "",
usrid: "",
filter: null
}
try {
const items = await onergy_get(options);
} catch (error) {
onergy.log(error);
}
//onergy.sendto
const ftdid = "";
const fedid = "";
const resetfdtData = true;
const resetPrc = true;
const s = await onergy.sendto(ftdid, fedid, resetfdtData, resetPrc);
//mongo.FindJson
const collection = "";
const filter = "{}";
const order = "_id";
const r = await mongo.FindJson(collection, filter, order, 1, 0)
}
init();