Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@nfctron/eet
Advanced tools
Node.js library for EET (Electronic Registration of Sales in the Czech Republic) (Elektronickou evidenci tržeb).
Note: this library is still in development (version 0.x). API should stay the same, but there are not enough tests and documentation. Pull requests are welcome!
This is fork of JakubMrozek/eet with the following changes:
Requirements: Node.js 7+ (it might work under 6.x but it is not tested)
Using npm:
npm install @nfctron/eet --save
or with yarn:
yarn add @nfctron/eet
const { createClient } = require('eet');
// privatni klic a certifikat podnikatele
const options = {
privateKey: '...',
certificate: '...',
playground: true
};
// polozky, ktere se posilaji do EET
const items = {
dicPopl: 'CZ1212121218',
idPokl: '/5546/RO24',
poradCis: '0/6460/ZQ42',
datTrzby: new Date(),
celkTrzba: 34113,
idProvoz: '273'
};
// ziskani FIK (kod uctenky) pomoci async/await (Node.js 8+ / Babel)
const client = await createClient(options);
try {
const { fik } = await client.request(items);
}
// ziskani FIK v Node.js 6+
createClient(options)
.then(client => client.request(items))
.then(response => {
// response.fik
});
TODO example using command line with OpenSSL
This library works only with certificates and keys in string format .pem. From the binary .p12 you can convert them for example by package pem:
npm install pem --save
const pem = require('pem');
const file = require('fs').readFileSync('cesta/k/souboru.p12');
const password = ''; //pro testovací certifikáty EET je heslo 'eet'
pem.readPkcs12(file, {p12Password: password}, (err, result) => {
if (err) ...
// result.key je privátní klíč
// result.cert je certifikát
});
name | type | required | default | description |
---|---|---|---|---|
privateKey | string | yes | private key for the certificate | |
certificate | string | yes | certificate | |
offline | boolean | no | false | if true, includes PKP and BKB in response on unsuccessful request to EET |
playground | boolean | no | false | use Playground EET endpoint instead of production |
timeout | number | no | 2000 ms | maximal time to wait in milliseconds |
measureResponseTime | boolean | no | false | measure response time using node-soap's client.lastElapsedTime |
httpClient | object | no | see soap options, just for testing |
items - data to send in EET request, same name as in EET specification but in camel case (so instead of dic_popl
use dicPopl
)
TODO add table of items (required, data type, and description)
TODO document whole API
Na 99% půjde o problém s certifikátem, více je popsáno v issue #1.
see description of each release in Releases
FAQs
Node.js library for EET
We found that @nfctron/eet demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.