Contains JavaScript & TypeScript object models for Microsoft Power BI JavaScript SDK
Installations
npm install powerbi-models
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
18.18.2
NPM Version
9.8.1
Score
99.4
Supply Chain
99.6
Quality
80
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (95.9%)
JavaScript (4.1%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
25,798,276
Last Day
4,131
Last Week
211,289
Last Month
825,975
Last Year
8,625,844
GitHub Statistics
NOASSERTION License
47 Stars
523 Commits
40 Forks
38 Watchers
13 Branches
36 Contributors
Updated on Dec 19, 2024
Bundle Size
107.68 kB
Minified
11.81 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.15.2
Package Id
powerbi-models@1.15.2
Unpacked Size
738.95 kB
Size
92.36 kB
File Count
7
NPM Version
9.8.1
Node Version
18.18.2
Published on
Mar 25, 2024
Total Downloads
Cumulative downloads
Total Downloads
25,798,276
Last Day
4.5%
4,131
Compared to previous day
Last Week
0.7%
211,289
Compared to previous week
Last Month
40%
825,975
Compared to previous month
Last Year
32.5%
8,625,844
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
32
powerbi-models
Contains JavaScript & TypeScript object models for Microsoft Power BI JavaScript SDK.
For each model there is a TypeScript interface, a json schema definitions, and a validation function to ensure a given object is a valid model.
Documentation
https://microsoft.github.io/powerbi-models
Getting Started
Install
1npm install --save powerbi-models
Import
1import * as models from 'powerbi-models';
Usage
Validation:
1let testObject = { x: 1 }; 2 3const errors = models.validateLoad(testObject); 4 5if(errors) { 6 console.warn(errors); 7} 8
Would output to the console:
1[ 2 { 3 message: 'accessToken is required' 4 } 5]
Creating filters:
1const basicFilter: models.IBasicFilter = { 2 target: { 3 table: "Products", 4 column: "Version" 5 }, 6 operator: "In", 7 values: [ 8 1, 9 2, 10 3, 11 4 12 ] 13}; 14 15const advancedFilter: models.IAdvancedFilter = { 16 target: { 17 table: "Products", 18 column: "Name" 19 }, 20 logicalOperator: "Or", 21 conditions: [ 22 { 23 operator: "Contains", 24 value: "Power" 25 }, 26 { 27 operator: "Contains", 28 value: "Microsoft" 29 } 30 ] 31};
Or use the constructor methods:
1const advancedFilter = new models.AdvancedFilter( 2 { 3 table: "Products", 4 column: "Name" 5 }, 6 "Or", 7 { 8 operator: "Contains", 9 value: "Power" 10 }, 11 { 12 operator: "Contains", 13 value: "Microsoft" 14 } 15);
Date Formatting
Dates should be formated using ISO 8601 standard. Example: 2016-09-08T00:15:46.861Z
This is how dates are naturally serialized to JSON:
1new Date().toJSON(); //=> 2016-09-08T00:15:46.861Z
An example filter using this Date format would look like the following:
1{ 2 "$schema": "http://powerbi.com/product/schema#advanced", 3 "target": { 4 "table": "Time", 5 "column": "Date" 6 }, 7 "logicalOperator": "And", 8 "conditions": [ 9 { 10 "operator": "GreaterThan", 11 "value": "2014-06-01T07:00:00.000Z" 12 } 13 ] 14}

No vulnerabilities found.
Reason
all changesets reviewed
Reason
security policy file detected
Details
- Info: security policy file detected: SECURITY.md:1
- Info: Found linked content: SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1
- Info: Found text in security policy: SECURITY.md:1
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE.txt:0
- Warn: project license file does not contain an FSF or OSI license.
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 30 are checked with a SAST tool
Reason
28 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx
- Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w
- Warn: Project is vulnerable to: GHSA-q9mw-68c2-j6m5
- Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5
- Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj
- Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9
- Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3
- Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
4.5
/10
Last Scanned on 2025-02-17
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