
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
powerbi-models
Advanced tools
Contains JavaScript & TypeScript object models for Microsoft Power BI JavaScript SDK. For each model there is a TypeScript interface, and a validation function to ensure and object is valid.
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.
Install
npm install --save powerbi-models
Import
import * as models from 'powerbi-models';
Usage
Validation:
let testObject = { x: 1 };
const errors = models.validateLoad(testObject);
if(errors) {
console.warn(errors);
}
Would output to the console:
[
{
message: 'accessToken is required'
}
]
Creating filters:
const basicFilter: models.IBasicFilter = {
target: {
table: "Products",
column: "Version"
},
operator: "In",
values: [
1,
2,
3,
4
]
};
const advancedFilter: models.IAdvancedFilter = {
target: {
table: "Products",
column: "Name"
},
logicalOperator: "Or",
conditions: [
{
operator: "Contains",
value: "Power"
},
{
operator: "Contains",
value: "Microsoft"
}
]
};
Or use the constructor methods:
const advancedFilter = new models.AdvancedFilter(
{
table: "Products",
column: "Name"
},
"Or",
{
operator: "Contains",
value: "Power"
},
{
operator: "Contains",
value: "Microsoft"
}
);
Dates should be formated using ISO 8601 standard. Example: 2016-09-08T00:15:46.861Z
This is how dates are naturally serialized to JSON:
new Date().toJSON(); //=> 2016-09-08T00:15:46.861Z
An example filter using this Date format would look like the following:
{
"$schema": "http://powerbi.com/product/schema#advanced",
"target": {
"table": "Time",
"column": "Date"
},
"logicalOperator": "And",
"conditions": [
{
"operator": "GreaterThan",
"value": "2014-06-01T07:00:00.000Z"
}
]
}
FAQs
Contains JavaScript & TypeScript object models for Microsoft Power BI JavaScript SDK. For each model there is a TypeScript interface, and a validation function to ensure and object is valid.
The npm package powerbi-models receives a total of 161,304 weekly downloads. As such, powerbi-models popularity was classified as popular.
We found that powerbi-models demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.