Gathering detailed insights and metrics for node-tra
Gathering detailed insights and metrics for node-tra
Gathering detailed insights and metrics for node-tra
Gathering detailed insights and metrics for node-tra
npm install node-tra
Typescript
Module System
Node Version
NPM Version
65.4
Supply Chain
97.1
Quality
75
Maintenance
100
Vulnerability
99.3
License
JavaScript (100%)
Total Downloads
3,275
Last Day
1
Last Week
4
Last Month
32
Last Year
625
7 Stars
22 Commits
8 Forks
1 Watching
2 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.1.2
Package Id
node-tra@1.1.2
Unpacked Size
29.00 kB
Size
6.05 kB
File Count
15
NPM Version
6.14.11
Node Version
12.21.0
Cumulative downloads
Total Downloads
Last day
-50%
1
Compared to previous day
Last week
-63.6%
4
Compared to previous week
Last month
0%
32
Compared to previous month
Last year
49.2%
625
Compared to previous year
This package implements TRA (Tanzania Revenue Authority) APIs.
npm install node-tra --save
yarn add node-tra
Before calling any APIs, you will need to load your key certificate. You can use this helper function to do so.
1import { loadKeyCertificate } from "node-tra"; 2 3const { key } = await loadKeyCertificate( 4 "YOUR KEY FILE PATH", 5 "YOUR KEY PASSWORD" 6);
To get details about your company you need to call registration API. You call this once. You can reuse the result in the next steps.
1import { sendRegistrationRequest } from "node-tra"; 2 3//test environment details 4const hostname = "virtual.tra.go.tz"; 5const path = "/efdmsRctApi/api/vfdRegReq"; 6 7const response = await sendRegistrationRequest({ 8 tin: "YOUR TIN", 9 certKey: "YOUR CERT KEY", 10 signKey: key, //key loaded from first step 11 certSerial: "YOUR CERT SERIAL", 12 hostname: hostname, 13 path: path, 14}); 15 16//if successful, response.success == true 17const { success, data } = response;
To upload receipts/invoices you will need to provide a token to TRA API. To get the token call this helper function.
1import { sendTokenRequest } from "node-tra"; 2 3//test environment details 4const hostname = "virtual.tra.go.tz"; 5const path = "/efdmsRctApi/vfdtoken"; 6 7const response = await sendTokenRequest({ 8 username: "USERNAME FROM REGISTRATION API", 9 password: "PASSWORD FROM REGISTRATION API", 10 grantType: "password", 11 hostname: hostname, 12 path: path, 13}); 14 15//if successful, response.success == true 16const { success, data } = response;
1import { sendUploadInvoiceRequest } from "node-tra"; 2 3//test environment details 4const hostname = "virtual.tra.go.tz"; 5const path = "/efdmsRctApi/api/efdmsRctInfo"; 6 7const response = await sendUploadInvoiceRequest({ 8 tin: "YOUR TIN", 9 signKey: key, //key loaded from first step 10 certSerial: "YOUR CERT SERIAL", 11 token: "YOUR TOKEN", 12 routingKey: "ROUTING KEY FROM REGISTRATION API", 13 hostname: hostname, 14 path: path, 15 date: "2021-02-03", 16 time: "20:52:53", 17 regId: "REGID FROM REGISTRATION API", 18 efdSerial: "EFDSERIAL FROM REGISTRATION API", 19 receiptCode: "RECEIPTCODE FROM REGISTRATION API", 20 rctNum: "10103", 21 zNum: "20210203", 22 dc: "1", 23 gc: "10103", 24 customerId: "", 25 customerIdType: "6", 26 customerName: "John Doe", 27 mobileNumber: "255755123123", 28 items: [ 29 { 30 ID: 1, 31 DESC: "Product 1", 32 QTY: 1, 33 TAXCODE: 1, 34 AMT: "118000.00", 35 }, 36 ], 37 totals: { 38 TOTALTAXEXCL: "100000.00", 39 TOTALTAXINCL: "118000.00", 40 DISCOUNT: "0.00", 41 }, 42 payments: { 43 PMTTYPE: "EMONEY", 44 PMTAMOUNT: "118000.00", 45 }, 46 vatTotals: { 47 VATRATE: "A", 48 NETTAMOUNT: "100000.00", 49 TAXAMOUNT: "18000.00", 50 }, 51}); 52 53//if successful, response.success == true 54const { success, data } = response;
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
SAST tool detected: CodeQL
Details
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
Reason
9 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/22 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More