@itwin/insights-client
TypeScript icon, indicating that this package has built-in type declarations

0.7.0 • Public • Published

Insights Client Library

Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice.

iTwin.js 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.

If you have questions, or wish to contribute to iTwin.js, see our Contributing guide.

About this Repository

Contains the @itwin/insights-client package that wraps sending requests to the reporting service. Visit the Insights API and Carbon calculation API for more documentation on the insights service.

Authorization for running tests

  • Create .env file and configure the following variables:
TEST_ITWIN_NAME=<name to use for test iTwin>
TEST_IMODEL_NAME=<name to use for test iModel>
AUTH_AUTHORITY="https://ims.bentley.com"
AUTH_CLIENT_ID=<client id of a "Web App" client created in https://developer.bentley.com>
AUTH_CLIENT_SECRET=<client secret of a "Web App" client created in https://developer.bentley.com>
AUTH_REDIRECT_URL=<redirect url of a "Web App" client created in https://developer.bentley.com>
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_GROUPING_AND_MAPPING_SCOPES=imodels:modify
APIS_IMODELS_BASE_URL=https://api.bentley.com/imodels
APIS_IMODELS_VERSION=itwin-platform.v2
APIS_IMODELS_SCOPES=imodels:read imodels:modify insights:read insights:modify
APIS_ITWINS_BASE_URL=https://api.bentley.com/itwins
APIS_ITWINS_SCOPES=itwins:read itwins:modify
TEST_USERS_ADMIN1_EMAIL=<email of your test user>
TEST_USERS_ADMIN1_PASSWORD=<password of your test user>
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/
    

Dependencies (2)

Dev Dependencies (30)

Package Sidebar

Install

npm i @itwin/insights-client

Weekly Downloads

1,205

Version

0.7.0

License

MIT

Unpacked Size

1.82 MB

Total Files

709

Last publish

Collaborators

  • wgoehrig
  • cshafer
  • aruniverse
  • imodeljs
  • colinkerr