@veriterra/report
v1.0.5
Published
VeriTerra Reporting SDK
Maintainers
Readme
VeriTerra Report SDK
This package provides a TypeScript SDK for interacting with the VeriTerra Reporting API.
Installation
npm install @veriterra/reportUsage
Important: ReportService is designed to run only in Node.js environments and will throw an error if instantiated in a browser environment.
import { ReportService } from '@veriterra/report';
// Initialize the service (only in Node.js environment)
const reportService = new ReportService(
'https://reporter.api.dynamics.co.uk',
'DOMAIN',
'GUID'
);
// Login to get a token
const loginResponse = await reportService.loginAsync();
// Insert title map data
const titleMapData = {
id: 'your-id',
salesOrderId: 'SO-000121',
mapUrl: 'https://example.com/map.jpg',
northing: '348267.3',
easting: '170231.44',
scale: '1:800',
dataCreated: '04/06/2025 01:24:29',
createdBy: 'Your Name',
searchAddress: {
buildingNumber: '',
buildingName: 'WILLOWBANK',
roadName: 'WILLOWMEAD DRIVE',
town: 'MACCLESFIELD',
postcode: 'SK10 4BU',
wkt: '',
polygonRawData: '',
organisationName: '',
subBuildingName: '',
locality: ''
}
};
const insertResponse = await reportService.insertTitleMapDataAsync(titleMapData);
console.log(insertResponse);
// Generate and upload a report in one step
// This method handles the entire process: inserting data, generating the report, and uploading it
const reportUrl = await reportService.generateAndUploadReportAsync(titleMapData);
console.log(`Report uploaded to: ${reportUrl}`);Testing
This project includes both mocked tests and real API tests.
Running Tests
To run all tests:
npm testTo run only the mocked tests (faster, no real API calls):
npm run test:mockTo run only the real API tests (requires valid credentials):
npm run test:realTo run a standalone test for the generateAndUploadReportAsync method with real API calls:
npm run test:generate-uploadThis standalone test avoids the circular reference issues that can occur when testing stream operations in Jest, and provides detailed logging of the process.
Test Files
__tests__/GenerateAndUploadReportAsync.test.ts: Tests specifically for the generateAndUploadReportAsync method
Development
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm testLicense
Proprietary Software – All Rights Reserved
This software is the intellectual property of Veriland Consulting Ltd. and is protected by copyright laws and international treaties.
By installing, copying, accessing, or otherwise using the VeriTerra Report SDK, you agree to be bound by the following terms:
- Unauthorised use, copying, modification, or distribution is strictly prohibited.
- This software is provided exclusively to licensed customers and integration partners of Veriland Consulting Ltd.
- You may not reverse engineer, decompile, or disassemble any part of this software.
- You may not sublicence, rent, lease, or otherwise transfer access to this software without explicit, written permission.
- This SDK is not open source, and no rights are granted beyond what is explicitly authorised in your commercial agreement.
For licencing, support, or commercial enquiries, contact:
