Utils for Vereign Mini Product
Abstract
Utilities can be used in Browser and Node.JS environments.
The project is written with TypeScript. Import desired types in the code as needed.
import { StatusData } from "@vereign/light-utils
Installation
- Set up authentication to the company NPM account
$ yarn add git+ssh://git@code.vereign.com:light/clients/utils.git @vereign/lib-mime
Development
Startup
git submodule init
git submodule update
yarn install
./generateProto.sh
yarn start
Testing
Some of the tests serving purely demonstration purpose and do not validate anything.
yarn test
-
NODE_ICU_DATA=node_modules/full-icu yarn test
if there are problems with the mime encoding
Local usage in external projects
- In the
utils
project directory callyarn link
ornpm link
- In the project which depends on
utils
callyarn link @vereign/light-utils
ornpm link @vereign/light-utils
Services and utilities
-
CryptoService
- servers cryptographic needs. Works based on WebCrypto (browser) and Node.JS Crypto, depending on the environment. -
MailParser
- utility used to parse MIME messages -
[DEPRECATED] MimeVerificationService
- used to verify plain and HTML parts of the MIME messages using the Rabin-Karp searching algorithm. Contains normalization strategies for GMail and Outlook MIME messages. -
CloudflareService
- performs interaction with Backblaze CDN. Contains utility methods to retrieve and parse statuses data. -
AeternityService
- performs interaction with Aeternity blockchain -
VerificationService
- performs verification of the status data using Merkle Tree/SHA256 batch. Depends onAeternityService
andCloudflareService
. -
QrCodeDataService
- performs protobuffer encoding/decoding of the Qr Code Data -
StatusesService
- performs protobuffer encoding/decoding of the statuses data.
Usage examples of some services provided in the corresponding __tests__