https://github.com/itwin/insights-client
https://github.com/itwin/insights-client
bentley carbon-calculation itwinjs reporting
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/itwin/insights-client
- Owner: iTwin
- License: mit
- Created: 2022-02-04T20:12:12.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-18T00:11:47.000Z (about 1 year ago)
- Last Synced: 2025-03-24T04:49:58.427Z (about 1 year ago)
- Topics: bentley, carbon-calculation, itwinjs, reporting
- Language: TypeScript
- Homepage:
- Size: 3.07 MB
- Stars: 1
- Watchers: 2
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Insights Client Library
Copyright © Bentley Systems, Incorporated. All rights reserved. See [LICENSE.md](./LICENSE.md) for license terms and full copyright notice.
[iTwin.js](http://www.itwinjs.org) is an open source platform for creating, querying, modifying, and displaying Infrastructure Digital Twins. To learn more about the iTwin Platform and its APIs, visit the [iTwin developer portal](https://developer.bentley.com/).
If you have questions, or wish to contribute to iTwin.js, see our [Contributing guide](./CONTRIBUTING.md).
## About this Repository
Contains the **@itwin/insights-client** package that wraps sending requests to the reporting service. Visit the [Insights API](https://developer.bentley.com/apis/insights/) and [Carbon calculation API](https://developer.bentley.com/apis/carbon-calculation/) for more documentation on the insights service.
### Authorization for running tests
- Create .env file and configure the following variables:
```
TEST_ITWIN_NAME=
TEST_IMODEL_NAME=
AUTH_AUTHORITY="https://ims.bentley.com"
AUTH_CLIENT_ID=
AUTH_CLIENT_SECRET=
AUTH_REDIRECT_URL=
AUTH_SCOPES=itwin-platform
APIS_REPORTING_BASE_URL=https://api.bentley.com/insights/reporting
APIS_CARBONCALCULATION_BASE_URL=https://api.bentley.com/insights/carbon-calculation
APIS_GROUPING_AND_MAPPING_BASE_URL=https://api.bentley.com/grouping-and-mapping
APIS_NAMED_GROUPS_BASE_URL=https://api.bentley.com/named-groups
APIS_IMODELS_BASE_URL=https://api.bentley.com/imodels
APIS_IMODELS_VERSION=itwin-platform.v2
APIS_ITWINS_BASE_URL=https://api.bentley.com/itwins
TEST_USERS_ADMIN1_EMAIL=
TEST_USERS_ADMIN1_PASSWORD=
TEST_BEHAVIOR_OPTIONS_RECREATE_IMODEL=<1 to recreate iModel for each test suite run>
```
- Test project and imodel will be created automatically with provided names.
- You can then run `npm run test:integration`.
- There are currently no tests for `oneClickLcaClient`
## Build Instructions
Install dependencies and build source
```
npm install
npm run build
```
Run tests
```
npm run test
```
Run linters
```
npm run lint
```
## Helper files
.githooks
- copyright-linter
To use custom hooks, run the command:
```
git config --local core.hooksPath .githooks/
```