Socket
Socket
Sign inDemoInstall

powerbi-models

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

powerbi-models - npm Package Compare versions

Comparing version 0.7.3 to 0.7.4

36

dist/models-noexports.d.ts

@@ -1,2 +0,2 @@

/*! powerbi-models v0.7.3 | (c) 2016 Microsoft Corporation MIT */
/*! powerbi-models v0.7.4 | (c) 2016 Microsoft Corporation MIT */
declare const advancedFilterSchema: any;

@@ -24,2 +24,6 @@ declare const filterSchema: any;

declare const validateLoad: (x: any) => IError[];
interface IReport {
id: string;
displayName: string;
}
interface IPage {

@@ -31,2 +35,4 @@ name: string;

name: string;
title: string;
type: string;
}

@@ -81,6 +87,6 @@ declare const validatePage: (x: any) => IError[];

declare abstract class Filter {
static schema: string;
protected static schemaUrl: string;
target: IFilterTarget;
protected schemaUrl: string;
static schema: string;
target: IFilterTarget;
constructor(target: IFilterTarget);

@@ -103,1 +109,25 @@ toJSON(): IFilter;

}
interface IDataReference {
target: IFilterTarget;
}
interface IEqualsDataReference extends IDataReference {
equals: string | boolean | number;
}
interface IBetweenDataReference extends IDataReference {
between: (string | boolean | number)[];
}
interface IValueDataReference extends IDataReference {
value: string | boolean | number;
}
interface IIdentityValue<T extends IDataReference> {
identity: T[];
values: IValueDataReference[];
}
interface ISelection {
visual: IVisual;
page: IPage;
report: IReport;
dataPoints: IIdentityValue<IEqualsDataReference>[];
regions: IIdentityValue<IEqualsDataReference | IBetweenDataReference>[];
filters: (IBasicFilter | IAdvancedFilter)[];
}

@@ -1,2 +0,2 @@

/*! powerbi-models v0.7.3 | (c) 2016 Microsoft Corporation MIT */
/*! powerbi-models v0.7.4 | (c) 2016 Microsoft Corporation MIT */
export declare const advancedFilterSchema: any;

@@ -24,2 +24,6 @@ export declare const filterSchema: any;

export declare const validateLoad: (x: any) => IError[];
export interface IReport {
id: string;
displayName: string;
}
export interface IPage {

@@ -31,2 +35,4 @@ name: string;

name: string;
title: string;
type: string;
}

@@ -81,6 +87,6 @@ export declare const validatePage: (x: any) => IError[];

export declare abstract class Filter {
static schema: string;
protected static schemaUrl: string;
target: IFilterTarget;
protected schemaUrl: string;
static schema: string;
target: IFilterTarget;
constructor(target: IFilterTarget);

@@ -103,1 +109,25 @@ toJSON(): IFilter;

}
export interface IDataReference {
target: IFilterTarget;
}
export interface IEqualsDataReference extends IDataReference {
equals: string | boolean | number;
}
export interface IBetweenDataReference extends IDataReference {
between: (string | boolean | number)[];
}
export interface IValueDataReference extends IDataReference {
value: string | boolean | number;
}
export interface IIdentityValue<T extends IDataReference> {
identity: T[];
values: IValueDataReference[];
}
export interface ISelection {
visual: IVisual;
page: IPage;
report: IReport;
dataPoints: IIdentityValue<IEqualsDataReference>[];
regions: IIdentityValue<IEqualsDataReference | IBetweenDataReference>[];
filters: (IBasicFilter | IAdvancedFilter)[];
}

4

dist/models.js

@@ -1,2 +0,2 @@

/*! powerbi-models v0.7.3 | (c) 2016 Microsoft Corporation MIT */
/*! powerbi-models v0.7.4 | (c) 2016 Microsoft Corporation MIT */
(function webpackUniversalModuleDefinition(root, factory) {

@@ -63,2 +63,3 @@ if(typeof exports === 'object' && typeof module === 'object')

};
/* tslint:disable:no-var-requires */
exports.advancedFilterSchema = __webpack_require__(1);

@@ -70,2 +71,3 @@ exports.filterSchema = __webpack_require__(2);

exports.basicFilterSchema = __webpack_require__(6);
/* tslint:enable:no-var-requires */
var jsen = __webpack_require__(7);

@@ -72,0 +74,0 @@ function normalizeError(error) {

@@ -1,2 +0,2 @@

/*! powerbi-models v0.7.3 | (c) 2016 Microsoft Corporation MIT */
/*! powerbi-models v0.7.4 | (c) 2016 Microsoft Corporation MIT */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["powerbi-models"]=t():e["powerbi-models"]=t()}(this,function(){return function(e){function t(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){function i(e){return e.message||(e.message=e.path+" is invalid. Not meeting "+e.keyword+" constraint"),delete e.path,delete e.keyword,e}function n(e,t){return function(r){var n=u(e,t),o=n(r);return o?void 0:n.errors.map(i)}}function o(e){var t=e,r=e;return"string"==typeof t.operator&&Array.isArray(t.values)?p.Basic:"string"==typeof r.logicalOperator&&Array.isArray(r.conditions)?p.Advanced:p.Unknown}function a(e){return void 0!==e.table&&void 0!==e.measure}function s(e){return void 0!==e.table&&void 0!==e.column}function c(e){return void 0!==e.table&&void 0!==e.hierarchy&&void 0!==e.hierarchyLevel}var f=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};t.advancedFilterSchema=r(1),t.filterSchema=r(2),t.loadSchema=r(3),t.pageSchema=r(4),t.settingsSchema=r(5),t.basicFilterSchema=r(6);var u=r(7);t.validateSettings=n(t.settingsSchema,{schemas:{basicFilter:t.basicFilterSchema,advancedFilter:t.advancedFilterSchema}}),t.validateLoad=n(t.loadSchema,{schemas:{settings:t.settingsSchema,basicFilter:t.basicFilterSchema,advancedFilter:t.advancedFilterSchema}}),t.validatePage=n(t.pageSchema),t.validateFilter=n(t.filterSchema,{schemas:{basicFilter:t.basicFilterSchema,advancedFilter:t.advancedFilterSchema}}),function(e){e[e.Advanced=0]="Advanced",e[e.Basic=1]="Basic",e[e.Unknown=2]="Unknown"}(t.FilterType||(t.FilterType={}));var p=t.FilterType;t.getFilterType=o,t.isMeasure=a,t.isColumn=s,t.isHierarchy=c;var l=function(){function e(e){this.target=e}return e.prototype.toJSON=function(){return{$schema:this.schemaUrl,target:this.target}},e}();t.Filter=l;var m=function(e){function t(r,i){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];if(e.call(this,r),this.operator=i,this.schemaUrl=t.schemaUrl,0===n.length)throw new Error("values must be a non-empty array. You passed: "+n);Array.isArray(n[0])?this.values=n[0]:this.values=n}return f(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.operator=this.operator,t.values=this.values,t},t.schemaUrl="http://powerbi.com/product/schema#basic",t}(l);t.BasicFilter=m;var d=function(e){function t(r,i){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];if(e.call(this,r),this.schemaUrl=t.schemaUrl,"string"!=typeof i||0===i.length)throw new Error("logicalOperator must be a valid operator, You passed: "+i);this.logicalOperator=i;var a;if(a=Array.isArray(n[0])?n[0]:n,0===a.length)throw new Error("conditions must be a non-empty array. You passed: "+n);if(a.length>2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+n.length);if(1===a.length&&"And"!==i)throw new Error('Logical Operator must be "And" when there is only one condition provided');this.conditions=a}return f(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.logicalOperator=this.logicalOperator,t.conditions=this.conditions,t},t.schemaUrl="http://powerbi.com/product/schema#advanced",t}(l);t.AdvancedFilter=d},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{oneOf:[{type:"object",properties:{table:{type:"string"},column:{type:"string"}},required:["table","column"]},{type:"object",properties:{table:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"}},required:["table","hierarchy","hierarchyLevel"]},{type:"object",properties:{table:{type:"string"},measure:{type:"string"}},required:["table","measure"]}]},logicalOperator:{type:"string"},conditions:{type:"array",items:{type:"object",properties:{value:{type:["string","boolean","number"]},operator:{type:"string"}},required:["value","operator"]}}},required:["target","logicalOperator","conditions"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filter is invalid"}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"},invalidMessage:"accessToken property is invalid"},id:{type:"string",messages:{type:"id must be a string",required:"id is required"},invalidMessage:"id property is invalid"},settings:{$ref:"#settings"},pageName:{type:"string",messages:{type:"pageName must be a string"}},filters:{type:"array",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filters property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{filterPaneEnabled:{type:"boolean",messages:{type:"filterPaneEnabled must be a boolean"}},navContentPaneEnabled:{type:"boolean",messages:{type:"navContentPaneEnabled must be a boolean"}}}}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{type:"object",properties:{table:{type:"string"},column:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"},measure:{type:"string"}},required:["table"]},operator:{type:"string"},values:{type:"array",items:{type:["string","boolean","number"]}}},required:["target","operator","values"]}},function(e,t,r){e.exports=r(8)},function(e,t,r){(function(t){"use strict";function i(e){var t=e instanceof RegExp?e.toString():new RegExp(e).toString();return x?(t=t.substr(1,t.length-2),t="/"+t.replace(y,"\\$&")+"/"):t}function n(e,t){return g.lastIndex=0,g.test(t)?e+"."+t:e+'["'+t+'"]'}function o(e){var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function a(e){return(0|e)===e}function s(e){var t,r,i=Object.keys(e),n=[],o={};for(r=0;r<i.length;r++)t=P[i[r]],t&&(t.type?(o[t.type]||(o[t.type]=[]),o[t.type].push(t)):n.push(t));return n.concat(Object.keys(o).reduce(function(e,t){return e.concat(o[t])},[]))}function c(e){var t=e.replace(h,"$1");return isNaN(+t)?'"'===t[0]?'[\\"'+t.substr(1,t.length-2)+'\\"]':'." + '+t+' + "':"."+t}function f(e){return'"'+e.replace(d,c).substr(5)+'"'}function u(e){var t,r,i=e,n=o(e);if("object"===n){i={};for(t in e)i[t]=u(e[t])}else if("array"===n)for(i=[],r=0;r<e.length;r++)i[r]=u(e[r]);else{if("regexp"===n)return new RegExp(e);if("date"===n)return new Date(e.toJSON())}return i}function p(){this.objects=[],this.properties=[]}function l(e,t,r,i,n){var a,s,c,f,m;if("object"!==o(e))return t;if(e=i.resolve(e),void 0===t&&e.hasOwnProperty("default")&&(t=u(e["default"])),a=o(t),"object"===a&&"object"===o(e.properties)){for(c in e.properties)s=l(e.properties[c],t[c],r,i),void 0!==s&&(t[c]=s);for(c in t)c in e.properties||e.additionalProperties!==!1&&(r!==!1||e.additionalProperties)||(n?n.mark(t,c):delete t[c])}else if("array"===a&&e.items){if("array"===o(e.items))for(f=0;f<e.items.length;f++)s=l(e.items[f],t[f],r,i),(void 0!==s||f<t.length)&&(t[f]=s);else if(t.length)for(f=0;f<t.length;f++)t[f]=l(e.items,t[f],r,i)}else if("array"===o(e.allOf)&&e.allOf.length){for(m=new p,f=0;f<e.allOf.length;f++)t=l(e.allOf[f],t,r,i,m);m.deleteDuplicates(),m.dispose()}return t}function m(e,t){function r(e){var t,r=p.resolve(e),i=e.$ref,o=h[i];return o||(o=h[i]={key:d(),func:function(e){return t(e)}},t=n(r),Object.defineProperty(o.func,"errors",{get:function(){return t.errors}}),y[o.key]=o.func),"refs."+o.key}function n(e){function n(e){var t=d();return c.def(t,e),t}function o(e,a,u){function p(r,i){var n,o=e,s=i&&a.properties&&a.properties[i]&&a.properties[i].requiredMessage||a.invalidMessage;s||(s=i&&a.properties&&a.properties[i]&&a.properties[i].messages&&a.properties[i].messages[r]||a.messages&&a.messages[r]),e.indexOf("[")>-1?(o=f(e),i&&(o=o?o+' + ".'+i+'"':i),c("errors.push({")("path: "+o+", ")('keyword: "'+r+'"'+(s?",":"")),s&&c('message: "'+s+'"'),c("})")):(n=d(),o=o.substr(5),i&&(o=o?o+"."+i:i),y[n]={path:o,keyword:r},s&&(y[n].message=s),c("errors.push(refs."+n+")")),u||t.greedy||c("return (validate.errors = errors) && false")}var l,m,h,v,b,x,j,A,O;if(void 0!==a.$ref)return m=r(a),h=f(e),v=n(0),void c("if (!"+m+"("+e+")) {")("if ("+m+".errors) {")("errors.push.apply(errors, "+m+".errors)")("for ("+v+" = 0; "+v+" < "+m+".errors.length; "+v+"++) {")("if ("+m+".errors["+v+"].path) {")("errors[errors.length - "+m+".errors.length + "+v+"].path = "+h+' + "." + '+m+".errors["+v+"].path")("} else {")("errors[errors.length - "+m+".errors.length + "+v+"].path = "+h)("}")("}")("}")("}");for(l={path:e,schema:a,code:c,declare:n,validate:o,error:p,noFailFast:u},j=s(a),O=0;O<j.length;O++)A=j[O],A.type&&b!==A.type&&(b&&c("}"),b=A.type,c("if ("+$[A.type](e)+") {")),A(l);b&&c("}"),a.format&&t.formats&&(x=t.formats[a.format],x&&("string"==typeof x||x instanceof RegExp?(c("if (!("+i(x)+").test("+l.path+")) {"),p("format"),c("}")):"function"==typeof x&&((g.formats||(g.formats={}))[a.format]=x,(g.schemas||(g.schemas={}))[a.format]=a,c('if (!formats["'+a.format+'"]('+l.path+', schemas["'+a.format+'"])) {'),p("format"),c("}"))))}var c=j("validate","data")("var errors = []");return o("data",e),c("return (validate.errors = errors) && errors.length === 0"),a=c.compile(g),a.errors=[],a.build=function(t,r){return l(e,r&&r.copy===!1?t:u(t),r&&r.additionalProperties,p)},a}if("object"!==o(e))throw new Error(v);t=t||{};var a,c=t.missing$Ref||!1,p=new F(e,t.schemas,c),m=0,d=function(){return"i"+m++},h={},y={errors:[]},g={equal:A,unique:O,refs:y};return n(e)}var d=/\[.+?\]/g,h=/\[?(.*?)?\]/,y=/[\/]/g,g=/^[a-z_$][0-9a-z]*$/gi,v="jsen: invalid schema object",b="object"==typeof window&&!!window.navigator,x="object"==typeof t&&"v0"===t.version.split(".")[0],j=r(10),A=r(11),O=r(12),F=r(13),w=r(15),$={},P={};$["null"]=function(e){return e+" === null"},$["boolean"]=function(e){return"typeof "+e+' === "boolean"'},$.string=function(e){return"typeof "+e+' === "string"'},$.number=function(e){return"typeof "+e+' === "number"'},$.integer=function(e){return"typeof "+e+' === "number" && !('+e+" % 1)"},$.array=function(e){return e+" !== undefined && Array.isArray("+e+")"},$.object=function(e){return e+" !== undefined && typeof "+e+' === "object" && '+e+" !== null && !Array.isArray("+e+")"},$.date=function(e){return e+" !== undefined && "+e+" instanceof Date"},P.type=function(e){if(e.schema.type){var t=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type],r=t.map(function(t){return $[t]?$[t](e.path)||"true":"true"}).join(" || ");r&&(e.code("if (!("+r+")) {"),e.error("type"),e.code("}"))}},P["enum"]=function(e){var t,r,i,n=e.schema["enum"],o=[];if(Array.isArray(n)){for(i=0;i<n.length;i++)t=n[i],r=typeof t,null===t||["boolean","number","string"].indexOf(r)>-1?"string"===r?o.push(e.path+' === "'+t+'"'):o.push(e.path+" === "+t):o.push("equal("+e.path+", "+JSON.stringify(t)+")");e.code("if (!("+o.join(" || ")+")) {"),e.error("enum"),e.code("}")}},P.minimum=function(e){"number"==typeof e.schema.minimum&&(e.code("if ("+e.path+" < "+e.schema.minimum+") {"),e.error("minimum"),e.code("}"))},P.exclusiveMinimum=function(e){e.schema.exclusiveMinimum===!0&&"number"==typeof e.schema.minimum&&(e.code("if ("+e.path+" === "+e.schema.minimum+") {"),e.error("exclusiveMinimum"),e.code("}"))},P.maximum=function(e){"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" > "+e.schema.maximum+") {"),e.error("maximum"),e.code("}"))},P.exclusiveMaximum=function(e){e.schema.exclusiveMaximum===!0&&"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" === "+e.schema.maximum+") {"),e.error("exclusiveMaximum"),e.code("}"))},P.multipleOf=function(e){if("number"==typeof e.schema.multipleOf){var t=e.schema.multipleOf,r=t.toString().length-t.toFixed(0).length-1,i=r>0?Math.pow(10,r):1,n=e.path;r>0?e.code("if (+(Math.round(("+n+" * "+i+') + "e+" + '+r+') + "e-" + '+r+") % "+t*i+" !== 0) {"):e.code("if ((("+n+" * "+i+") % "+t*i+") !== 0) {"),e.error("multipleOf"),e.code("}")}},P.minLength=function(e){a(e.schema.minLength)&&(e.code("if ("+e.path+".length < "+e.schema.minLength+") {"),e.error("minLength"),e.code("}"))},P.maxLength=function(e){a(e.schema.maxLength)&&(e.code("if ("+e.path+".length > "+e.schema.maxLength+") {"),e.error("maxLength"),e.code("}"))},P.pattern=function(e){var t="string"==typeof e.schema.pattern?new RegExp(e.schema.pattern):e.schema.pattern;"regexp"===o(t)&&(e.code("if (!("+i(t)+").test("+e.path+")) {"),e.error("pattern"),e.code("}"))},P.format=function(e){"string"==typeof e.schema.format&&w[e.schema.format]&&(e.code("if (!("+w[e.schema.format]+").test("+e.path+")) {"),e.error("format"),e.code("}"))},P.minItems=function(e){a(e.schema.minItems)&&(e.code("if ("+e.path+".length < "+e.schema.minItems+") {"),e.error("minItems"),e.code("}"))},P.maxItems=function(e){a(e.schema.maxItems)&&(e.code("if ("+e.path+".length > "+e.schema.maxItems+") {"),e.error("maxItems"),e.code("}"))},P.additionalItems=function(e){e.schema.additionalItems===!1&&Array.isArray(e.schema.items)&&(e.code("if ("+e.path+".length > "+e.schema.items.length+") {"),e.error("additionalItems"),e.code("}"))},P.uniqueItems=function(e){e.schema.uniqueItems&&(e.code("if (unique("+e.path+").length !== "+e.path+".length) {"),e.error("uniqueItems"),e.code("}"))},P.items=function(e){var t=e.declare(0),r=0;if("object"===o(e.schema.items))e.code("for ("+t+"; "+t+" < "+e.path+".length; "+t+"++) {"),e.validate(e.path+"["+t+"]",e.schema.items,e.noFailFast),e.code("}");else if(Array.isArray(e.schema.items)){for(;r<e.schema.items.length;r++)e.code("if ("+e.path+".length - 1 >= "+r+") {"),e.validate(e.path+"["+r+"]",e.schema.items[r],e.noFailFast),e.code("}");"object"===o(e.schema.additionalItems)&&(e.code("for ("+t+" = "+r+"; "+t+" < "+e.path+".length; "+t+"++) {"),e.validate(e.path+"["+t+"]",e.schema.additionalItems,e.noFailFast),e.code("}"))}},P.maxProperties=function(e){a(e.schema.maxProperties)&&(e.code("if (Object.keys("+e.path+").length > "+e.schema.maxProperties+") {"),e.error("maxProperties"),e.code("}"))},P.minProperties=function(e){a(e.schema.minProperties)&&(e.code("if (Object.keys("+e.path+").length < "+e.schema.minProperties+") {"),e.error("minProperties"),e.code("}"))},P.required=function(e){if(Array.isArray(e.schema.required))for(var t=0;t<e.schema.required.length;t++)e.code("if ("+n(e.path,e.schema.required[t])+" === undefined) {"),e.error("required",e.schema.required[t]),e.code("}")},P.properties=function(e){if(!e.validatedProperties){var t,r,i,a=e.schema.properties,s="object"===o(a)?Object.keys(a):[],c=e.schema.patternProperties,f="object"===o(c)?Object.keys(c):[],u=e.schema.additionalProperties,p=u===!1||"object"===o(u);if(s.length&&!f.length&&!p){for(r=0;r<s.length;r++)t=s[r],i=n(e.path,t),e.code("if ("+i+" !== undefined) {"),e.validate(i,a[t],e.noFailFast),e.code("}");e.validatedProperties=!0}}},P.patternProperties=P.additionalProperties=function(e){if(!e.validatedProperties){var t,r,a,s,c,f,u,p=e.schema.properties,l="object"===o(p)?Object.keys(p):[],m=e.schema.patternProperties,d="object"===o(m)?Object.keys(m):[],h=e.schema.additionalProperties,y=h===!1||"object"===o(h);if(l.length||d.length||y){for(t=e.declare("[]"),r=e.declare('""'),a=e.declare(0),y&&(s=e.declare(!1)),e.code(t+" = Object.keys("+e.path+")"),e.code("for ("+a+"; "+a+" < "+t+".length; "+a+"++) {")(r+" = "+t+"["+a+"]")("if ("+e.path+"["+r+"] === undefined) {")("continue")("}"),y&&e.code(s+" = false"),u=0;u<l.length;u++)c=l[u],e.code((u?"else ":"")+"if ("+r+' === "'+c+'") {'),y&&e.code(s+" = true"),e.validate(n(e.path,c),p[c],e.noFailFast),e.code("}");for(u=0;u<d.length;u++)f=d[u],e.code("if (("+i(f)+").test("+r+")) {"),y&&e.code(s+" = true"),e.validate(e.path+"["+r+"]",m[f],e.noFailFast),e.code("}");y&&(e.code("if (!"+s+") {"),h===!1?e.error("additionalProperties"):e.validate(e.path+"["+r+"]",h,e.noFailFast),e.code("}")),e.code("}"),e.validatedProperties=!0}}},P.dependencies=function(e){if("object"===o(e.schema.dependencies)){var t,r,i=0;for(t in e.schema.dependencies){if(r=e.schema.dependencies[t],e.code("if ("+n(e.path,t)+" !== undefined) {"),"object"===o(r))e.validate(e.path,r,e.noFailFast);else for(i;i<r.length;i++)e.code("if ("+n(e.path,r[i])+" === undefined) {"),e.error("dependencies",r[i]),e.code("}");e.code("}")}}},P.allOf=function(e){if(Array.isArray(e.schema.allOf))for(var t=0;t<e.schema.allOf.length;t++)e.validate(e.path,e.schema.allOf[t],e.noFailFast)},P.anyOf=function(e){if(Array.isArray(e.schema.anyOf)){var t=e.declare(0),r=e.declare(0),i=e.declare(!1),n=0;for(e.code(r+" = errors.length");n<e.schema.anyOf.length;n++)e.code("if (!"+i+") {"),e.code(t+" = errors.length"),e.validate(e.path,e.schema.anyOf[n],!0),e.code(i+" = errors.length === "+t)("}");e.code("if (!"+i+") {"),e.error("anyOf"),e.code("} else {")("errors.length = "+r)("}")}},P.oneOf=function(e){if(Array.isArray(e.schema.oneOf)){var t=e.declare(0),r=e.declare(0),i=e.declare(0),n=0;for(e.code(r+" = errors.length");n<e.schema.oneOf.length;n++)e.code(i+" = errors.length"),e.validate(e.path,e.schema.oneOf[n],!0),e.code("if (errors.length === "+i+") {")(t+"++")("}");e.code("if ("+t+" !== 1) {"),e.error("oneOf"),e.code("} else {")("errors.length = "+r)("}")}},P.not=function(e){if("object"===o(e.schema.not)){var t=e.declare(0);e.code(t+" = errors.length"),e.validate(e.path,e.schema.not,!0),e.code("if (errors.length === "+t+") {"),e.error("not"),e.code("} else {")("errors.length = "+t)("}")}},["minimum","exclusiveMinimum","maximum","exclusiveMaximum","multipleOf"].forEach(function(e){P[e].type="number"}),["minLength","maxLength","pattern","format"].forEach(function(e){P[e].type="string"}),["minItems","maxItems","additionalItems","uniqueItems","items"].forEach(function(e){P[e].type="array"}),["maxProperties","minProperties","required","properties","patternProperties","additionalProperties","dependencies"].forEach(function(e){P[e].type="object"}),p.prototype.mark=function(e,t){var r,i=this.objects.indexOf(e);return i<0?(this.objects.push(e),r={},r[t]=1,void this.properties.push(r)):(r=this.properties[i],void(r[t]=r[t]?r[t]+1:1))},p.prototype.deleteDuplicates=function(){var e,t;for(t=0;t<this.properties.length;t++)for(e in this.properties[t])this.properties[t][e]>1&&delete this.objects[t][e]},p.prototype.dispose=function(){this.objects.length=0,this.properties.length=0},m.browser=b,m.clone=u,m.equal=A,m.unique=O,m.resolve=F.resolvePointer,e.exports=m}).call(t,r(9))},function(e,t){function r(e){if(c===setTimeout)return setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(f===clearTimeout)return clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function n(){m&&p&&(m=!1,p.length?l=p.concat(l):d=-1,l.length&&o())}function o(){if(!m){var e=r(n);m=!0;for(var t=l.length;t;){for(p=l,l=[];++d<t;)p&&p[d].run();d=-1,t=l.length}p=null,m=!1,i(e)}}function a(e,t){this.fun=e,this.array=t}function s(){}var c,f,u=e.exports={};!function(){try{c=setTimeout}catch(e){c=function(){throw new Error("setTimeout is not defined")}}try{f=clearTimeout}catch(e){f=function(){throw new Error("clearTimeout is not defined")}}}();var p,l=[],m=!1,d=-1;u.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];l.push(new a(e,t)),1!==l.length||m||r(o)},a.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=s,u.addListener=s,u.once=s,u.off=s,u.removeListener=s,u.removeAllListeners=s,u.emit=s,u.binding=function(e){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(e){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},function(e,t){"use strict";e.exports=function(){var e=arguments[0]||"",t=[].join.call([].slice.call(arguments,1),", "),r="",i="",n=1,o=" ",a="{[",s="}]",c=function(){return new Array(n+1).join(o)},f=function(e){r+=c()+e+"\n"},u=function(e){var t=e[0],r=e[e.length-1];return s.indexOf(t)>-1&&a.indexOf(r)>-1?(n--,f(e),n++):a.indexOf(r)>-1?(f(e),n++):s.indexOf(t)>-1?(n--,f(e)):f(e),u};return u.def=function(e,t){return i+=c()+"var "+e+(void 0!==t?" = "+t:"")+"\n",u},u.toSource=function(){return"function "+e+"("+t+") {\n"+i+"\n"+r+"\n}"},u.compile=function(e){var t="return ("+u.toSource()+")",r=e||{},i=Object.keys(r),n=i.map(function(e){return r[e]});return Function.apply(null,i.concat(t)).apply(null,n)},u}},function(e,t){"use strict";function r(e){var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function i(e,t){var r,i,o=Object.keys(e).sort(),a=Object.keys(t).sort();if(!n(o,a))return!1;for(r=0;r<o.length;r++)if(i=o[r],!n(e[i],t[i]))return!1;return!0}function n(e,t){var o,a=typeof e,s=typeof t;if("object"===a&&(a=r(e)),"object"===s&&(s=r(t)),a!==s)return!1;if("object"===a)return i(e,t);if("regexp"===a)return e.toString()===t.toString();if("array"===a){if(e.length!==t.length)return!1;for(o=0;o<e.length;o++)if(!n(e[o],t[o]))return!1;return!0}return e===t}e.exports=n},function(e,t,r){"use strict";function i(e,t,r){for(var i=0,n=e.length;i<n;i++)if(r(e[i],t))return i;return-1}var n=r(11);e.exports=function(e){return e.filter(function(e,t,r){return i(r,e,n)===t})},e.exports.findIndex=i},function(e,t,r){"use strict";function i(e,t){if(!t.length)return e;var r,n=t.shift();e&&"object"==typeof e&&e.hasOwnProperty(n)&&(r=e[n]);{if(!t.length)return r;if(r&&"object"==typeof r)return i(r,t)}}function n(e){var t,r=e.indexOf("#");return 0!==r?[e]:(e=e.substr(r+1))?(t=e.split("/").map(function(e){return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}),"/"===e[0]&&t.shift(),t):[]}function o(e,t){if(e&&"object"==typeof e)return e.id===t?e:Object.keys(e).reduce(function(r,i){return r||o(e[i],t)},void 0)}function a(e){var t,r,i=Object.keys(e),n={};for(r=0;r<i.length;r++)t=i[r],n[t]=new s(e[t]);return n}function s(e,t,r){this.rootSchema=e,this.resolvedRootSchema=null,this.cache={},this.missing$Ref=r,this.resolvers=t&&"object"==typeof t?a(t):null}var c=r(14),f="jsen: invalid schema reference";s.prototype.resolveRef=function(e){var t,r,a,s=new Error(f+" "+e),u=this.rootSchema,p=this.resolvedRootSchema;if(!e||"string"!=typeof e)throw s;if(e===c.id&&(a=c),void 0===a&&p&&(a=o(p,e)),void 0===a&&(a=o(u,e)),void 0===a&&(r=n(e),p&&(a=i(p,r.slice(0))),void 0===a&&(a=i(u,r.slice(0)))),void 0===a&&r.length&&this.resolvers&&(t=i(this.resolvers,r),t&&(a=t.resolve(t.rootSchema))),void 0===a||"object"!=typeof a){if(!this.missing$Ref)throw s;a={}}return this.cache[e]===a?a:(this.cache[e]=a,void 0!==a.$ref&&(a=this.cache[e]=this.resolveRef(a.$ref)),a)},s.prototype.resolve=function(e){if(!e||"object"!=typeof e)return e;var t=e.$ref,r=this.cache[t];return void 0===t?e:void 0!==r?r:(r=this.resolveRef(t),e===this.rootSchema&&e!==r&&(this.resolvedRootSchema=r),r)},s.resolvePointer=function(e,t){return i(e,n(t))},e.exports=s},function(e,t){e.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{"default":0}]},simpleTypes:{anyOf:[{"enum":["array","boolean","integer","null","number","object","string","any"]},{type:"string"}]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},"default":{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean","default":!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean","default":!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],"default":{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean","default":!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],"default":{}},definitions:{type:"object",additionalProperties:{$ref:"#"},"default":{}},properties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},"enum":{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},"default":{}}},function(e,t){"use strict";var r={};r["date-time"]=/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/,r.uri=/^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\/\/[^\s]*$/,r.email=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,r.ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,r.ipv6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,r.hostname=/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/,e.exports=r}])});
{
"name": "powerbi-models",
"version": "0.7.3",
"version": "0.7.4",
"description": "Contains JavaScript &amp; 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 and object is valid.",

@@ -13,4 +13,5 @@ "main": "dist/models.js",

"test": "gulp test",
"postinstall": "typings install",
"prepublish": "gulp build"
"prepublish": "typings install && gulp build",
"gulp": "gulp",
"typings": "typings"
},

@@ -42,2 +43,3 @@ "files": [

"gulp-replace": "^0.5.4",
"gulp-tslint": "^6.0.2",
"gulp-typedoc": "^2.0.0",

@@ -57,5 +59,7 @@ "gulp-uglify": "^1.5.4",

"ts-loader": "^0.8.2",
"tslint": "^3.14.0",
"typedoc": "^0.4.4",
"typescript": "^1.8.10",
"typings": "^1.3.2",
"webpack": "^1.13.2",
"webpack-stream": "^3.2.0",

@@ -62,0 +66,0 @@ "yargs": "^4.7.1"

@@ -31,2 +31,4 @@ # powerbi-models

Validation:
```typescript

@@ -51,1 +53,55 @@ let testObject = { x: 1 };

```
Creating filters:
```typescript
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:
```typescript
const advancedFilter = new models.AdvancedFilter(
{
table: "Products",
column: "Name"
},
"Or",
{
operator: "Contains",
value: "Power"
},
{
operator: "Contains",
value: "Microsoft"
}
);
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc