From c50d565f5563ead40cd2d05653d542770f923f19 Mon Sep 17 00:00:00 2001 From: Paulo Vitor Magacho Date: Fri, 2 Sep 2022 18:33:48 -0300 Subject: [PATCH 1/4] Fix issue in query. Updated libraries to Grafana 9.x --- dist/module.js | 2 +- dist/module.js.map | 2 +- dist/plugin.json | 4 +- package.json | 10 +- src/datasource.ts | 4 +- yarn.lock | 9287 ++++++++++++++++---------------------------- 6 files changed, 3422 insertions(+), 5887 deletions(-) diff --git a/dist/module.js b/dist/module.js index 4ca21b9..672af98 100644 --- a/dist/module.js +++ b/dist/module.js @@ -1,3 +1,3 @@ /*! For license information please see module.js.LICENSE.txt */ -define(["react","lodash","@grafana/ui","@grafana/data","@grafana/runtime"],(function(e,t,n,a,r){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=5)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=a},function(e,t){e.exports=r},function(e,t,n){"use strict";n.r(t);var a=n(3);function r(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n0?r[0].split("\\"):[];return i.length>1||1===i.length&&""!==i[0]?(r.splice(0,1),Object(y.each)(i,(function(e,t){n.push({label:e,value:{value:e,expandable:!0}})})),Object(y.each)(r,(function(e,t){""!==e&&a.push({label:e,value:{value:e,expandable:!1}})})),t.getElementSegments(i.length+1,n).then((function(e){return e.length>0&&n.push({label:"Select Element",value:{value:"-Select Element-"}}),n}))):Promise.resolve(n)},t.checkAfServer=function(){var e,n,a=t.props.datasource,r=[];return(null===(e=a.afserver)||void 0===e?void 0:e.name)?(r.push({label:a.afserver.name,value:{value:a.afserver.name,expandable:!0}}),(null===(n=a.afdatabase)||void 0===n?void 0:n.name)&&r.push({label:a.afdatabase.name,value:{value:a.afdatabase.name,expandable:!0}}),r.push({label:"Select Element",value:{value:"-Select Element-"}})):r.push({label:""}),r},t.updateArray=function(e,n,a,r,i){t.setState({segments:e,attributes:n,summaries:a,isPiPoint:r},(function(){return t.checkAttributeSegments(n,t.state.segments).then((function(){i&&i()}))}))},t.scopedVarsDone=!1,t.componentDidMount=function(){t.initialLoad(!1)},t.componentDidUpdate=function(){var e,n,a;"Done"===(null===(e=t.props.data)||void 0===e?void 0:e.state)&&(null===(a=null===(n=t.props.data)||void 0===n?void 0:n.request)||void 0===a?void 0:a.scopedVars)&&!t.scopedVarsDone&&(t.scopedVarsDone=!0,t.initialLoad(!0))},t.initialLoad=function(e){var n,a,r,i=t.props.query,o=Object(y.defaults)(i,x),l=o.segments,s=o.attributes,u=o.summary,c=o.isPiPoint,m=e?[]:null!==(n=null==l?void 0:l.slice(0))&&void 0!==n?n:[],h=e?[]:null!==(a=null==s?void 0:s.slice(0))&&void 0!==a?a:[],p=null!==(r=null==u?void 0:u.types)&&void 0!==r?r:[];if(c||0!==m.length)c&&m.length>0&&(t.piServer=m);else{if(i.target&&i.target.length>0&&";"!==i.target)return h=[],void t.buildFromTarget(i,m,h).then((function(e){t.updateArray(e,h,p,c)})).catch((function(e){}));m=t.checkAfServer()}t.updateArray(m,h,p,c,(function(){t.onChange(i)}))},t.onChange=function(e){var n,a=t.props,r=a.onChange,i=a.onRunQuery;if(e.summary.types=t.state.summaries,e.rawQuery){if(e.target=null!==(n=e.query)&&void 0!==n?n:"",""!==e.target){var o=e.target.split(";"),l=o[0].split("\\");o.splice(0,1),e.attributes=[],(l.length>1||1===l.length&&""!==l[0])&&(e.elementPath=l.join("\\"),Object(y.each)(o,(function(t,n){""!==t&&e.attributes.push({label:t,value:{value:t,expandable:!1}})})))}}else e.elementPath=t.getSegmentPathUpTo(t.state.segments,t.state.segments.length),e.target=e.elementPath+";"+Object(y.join)(e.attributes.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})),";");r(e),e.target&&e.target.length>0&&e.attributes.length>0&&i()},t.stateCallback=function(){var e=t.props.query;t.onChange(e)},t.onIsPiPointChange=function(e){var n=t.props.query,a=!n.isPiPoint;t.setState({segments:a?[{label:""}]:t.checkAfServer(),attributes:[],isPiPoint:a},(function(){t.onChange(Object.assign(Object.assign({},n),{expression:"",attributes:t.state.attributes,segments:t.state.segments,isPiPoint:a}))}))},t.onSegmentChange=t.onSegmentChange.bind(R(t)),t.calcBasisValueChanged=t.calcBasisValueChanged.bind(R(t)),t.calcNoDataValueChanged=t.calcNoDataValueChanged.bind(R(t)),t.onSummaryAction=t.onSummaryAction.bind(R(t)),t.onSummaryValueChanged=t.onSummaryValueChanged.bind(R(t)),t.onAttributeAction=t.onAttributeAction.bind(R(t)),t.onAttributeChange=t.onAttributeChange.bind(R(t)),t.summaryTypes=["Total","Average","Minimum","Maximum","Range","StdDev","PopulationStdDev","Count","PercentGood","All","AllForNonNumeric"],t.calculationBasis=["TimeWeighted","EventWeighted","TimeWeightedContinuous","TimeWeightedDiscrete","EventWeightedExcludeMostRecentEvent","EventWeightedExcludeEarliestEvent","EventWeightedIncludeBothEnds"],t.noDataReplacement=["Null","Drop","Previous","0","Keep"],t}return t=i,(n=[{key:"isValueEmpty",value:function(e){return!e||!e.value||!e.value.length||"-REMOVE-"===e.value}},{key:"calcBasisValueChanged",value:function(e){var t,n=this.props.query,a=n.summary;a.basis=null===(t=e.value)||void 0===t?void 0:t.value,this.onChange(Object.assign(Object.assign({},n),{summary:a}))}},{key:"getCalcBasisSegments",value:function(){return Object(y.map)(this.calculationBasis,(function(e){return{label:e,value:{value:e,expandable:!0}}}))}},{key:"calcNoDataValueChanged",value:function(e){var t,n=this.props.query,a=n.summary;a.nodata=null===(t=e.value)||void 0===t?void 0:t.value,this.onChange(Object.assign(Object.assign({},n),{summary:a}))}},{key:"getNoDataSegments",value:function(){return Object(y.map)(this.noDataReplacement,(function(e){return{label:e,value:{value:e,expandable:!0}}}))}},{key:"onSummaryValueChanged",value:function(e,t){var n=this.state.summaries.slice(0);n[t]=e,this.isValueEmpty(e.value)&&n.splice(t,1),this.setState({summaries:n},this.stateCallback)}},{key:"getSummarySegments",value:function(){var e=this,t=Object(y.filter)(this.summaryTypes,(function(t){return-1===e.state.summaries.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).indexOf(t)})),n=Object(y.map)(t,(function(e){return{label:e,value:{value:e,expandable:!0}}}));return n.unshift({label:"-REMOVE-",value:{value:"-REMOVE-"}}),n}},{key:"removeSummary",value:function(e){var t=Object(y.filter)(this.state.summaries,(function(t){return t!==e}));this.setState({summaries:t})}},{key:"onSummaryAction",value:function(e){var t,n=this.state.summaries.slice(0);if(!this.isValueEmpty(e.value)){var a={label:e.label,value:{value:null===(t=e.value)||void 0===t?void 0:t.value,expandable:!0}};n.push(a)}this.setState({summarySegment:{},summaries:n},this.stateCallback)}},{key:"removeAttribute",value:function(e){var t=Object(y.filter)(this.state.attributes,(function(t){return t!==e}));this.attributeChangeValue(t)}},{key:"onAttributeAction",value:function(e){var t,n=this.props.query,a=this.state.attributes.slice(0);if(!this.isValueEmpty(e.value)){var r={label:e.label,value:{value:null===(t=e.value)||void 0===t?void 0:t.value,expandable:!n.isPiPoint}};a.push(r)}this.attributeChangeValue(a)}},{key:"getSegmentPathUpTo",value:function(e,t){var n=e.slice(0,t);return Object(y.reduce)(n,(function(e,t){var n;return t.value?(null===(n=t.value.value)||void 0===n?void 0:n.startsWith("-Select"))?e:e?e+"\\"+t.value.value:t.value.value:""}),"")}},{key:"checkAttributeSegments",value:function(e,t){var n,a,r=this,i=this.props,o=i.datasource,l=i.data,s=this,u={path:this.getSegmentPathUpTo(t.slice(0),t.length),type:"attributes"};return o.metricFindQuery(u,Object.assign(null!==(a=null===(n=null==l?void 0:l.request)||void 0===n?void 0:n.scopedVars)&&void 0!==a?a:{},{isPiPoint:!1})).then((function(t){var n={};Object(y.each)(t,(function(e){n[e.Path.substring(e.Path.indexOf("|")+1)]=e.WebId}));var a=Object(y.filter)(e,(function(e){var t,a=o.templateSrv.replace(null===(t=e.value)||void 0===t?void 0:t.value);return void 0!==n[a]}));s.availableAttributes=n,r.attributeChangeValue(a)})).catch((function(t){s.error=t.message||"Failed to issue metric query",r.attributeChangeValue(e)}))}},{key:"checkPiPointSegments",value:function(e,t){var n,a,r=this.props,i=r.datasource,o=r.data,l=this,s={path:e.path,webId:l.getSelectedPIServer(),pointName:e.label,type:"pipoint"};return i.metricFindQuery(s,Object.assign(null!==(a=null===(n=null==o?void 0:o.request)||void 0===n?void 0:n.scopedVars)&&void 0!==a?a:{},{isPiPoint:!0})).then((function(){l.attributeChangeValue(t)})).catch((function(e){l.error=e.message||"Failed to issue metric query",l.attributeChangeValue([])}))}},{key:"getSelectedPIServer",value:function(){var e,t=this,n="";return this.piServer.forEach((function(e){var a=t.props.query.target.split(";");a.length>=2&&a[0]===e.text&&(n=e.WebId)})),this.piServer.length>0?null===(e=this.piServer[0].value)||void 0===e?void 0:e.webId:n}},{key:"textEditorChanged",value:function(){var e=this,t=this.props,n=t.query,a=t.onChange,r=n.target.split(";"),i=r.length>0?r[0].split("\\"):[],o=[],l=[];i.length>1||1===i.length&&""!==i[0]?(r.splice(0,1),Object(y.each)(i,(function(e,t){o.push({label:e,value:{type:e.match(/\${\w+}/gi)?"template":void 0,value:e,expandable:!0}})})),this.getElementSegments(i.length+1,o).then((function(e){e.length>0&&o.push({label:"Select Element",value:{value:"-Select Element-"}})})),Object(y.each)(r,(function(e,t){""!==e&&l.push({label:e,value:{value:e,expandable:!1}})})),this.updateArray(o,l,this.state.summaries,n.isPiPoint,(function(){a(Object.assign(Object.assign({},n),{query:void 0,rawQuery:!1}))}))):(o=this.checkAfServer(),this.updateArray(o,this.state.attributes,this.state.summaries,n.isPiPoint,(function(){e.onChange(Object.assign(Object.assign({},n),{query:void 0,rawQuery:!1,attributes:e.state.attributes,segments:e.state.segments}))})))}},{key:"render",value:function(){var e=this,t=this.props,n=t.query,a=t.onChange,r=t.onRunQuery,i=Object(y.defaults)(n,x),o=i.interpolate,u=i.query,c=i.rawQuery,m=i.digitalStates,h=i.recordedValues,p=i.expression,f=i.isPiPoint,d=i.summary,v=i.display,b=i.regex;return l.a.createElement(l.a.Fragment,null,l.a.createElement(s.InlineField,{label:"Is Pi Point?",labelWidth:24},l.a.createElement(s.InlineSwitch,{value:f,onChange:this.onIsPiPointChange})),!!c&&l.a.createElement(s.InlineFieldRow,null,l.a.createElement(s.InlineField,{label:"Raw Query",labelWidth:24,grow:!0},l.a.createElement(s.Input,{onBlur:this.stateCallback,value:u,onChange:function(e){return a(Object.assign(Object.assign({},i),{query:e.target.value}))},placeholder:"enter query"})),l.a.createElement(k,{isRaw:!0,onChange:function(t){return e.textEditorChanged()}})),!c&&l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{className:"gf-form-inline"},l.a.createElement(I,{label:f?"PI Server":"AF Elements",tooltip:f?"Select PI server.":"Select AF Element."},this.state.segments.map((function(t,n){return l.a.createElement(s.SegmentAsync,{key:"element-"+n,Component:l.a.createElement(q,{value:t.value,label:t.label}),onChange:function(t){return e.onSegmentChange(t,n)},loadOptions:function(t){return e.getElementSegments(n)},allowCustomValue:!0,inputMinWidth:200})})),l.a.createElement(S,null),!f&&l.a.createElement(k,{isRaw:!1,onChange:function(e){a(Object.assign(Object.assign({},i),{query:i.target,rawQuery:e}))}}))),l.a.createElement(E,{label:f?"Pi Points":"Attributes"},this.state.attributes.map((function(t,n){return f?l.a.createElement(s.SegmentAsync,{key:"attributes-"+n,Component:l.a.createElement(q,{value:t.value,label:t.label}),disabled:0===e.piServer.length,onChange:function(t){return e.onPiPointChange(t,n)},loadOptions:e.getAttributeSegmentsPI,reloadOptionsOnChange:!0,allowCustomValue:!0,inputMinWidth:250}):l.a.createElement(s.Segment,{key:"attributes-"+n,Component:l.a.createElement(q,{value:t.value,label:t.label}),disabled:e.state.segments.length<=2,onChange:function(t){return e.onAttributeChange(t,n)},options:e.getAttributeSegmentsAF(),allowCustomValue:!0,inputMinWidth:250})})),f&&l.a.createElement(s.SegmentAsync,{Component:l.a.createElement(q,{value:this.state.attributeSegment.value,label:this.state.attributeSegment.label}),disabled:0===this.piServer.length,onChange:this.onAttributeAction,loadOptions:this.getAttributeSegmentsPI,reloadOptionsOnChange:!0,allowCustomValue:!0,inputMinWidth:250}),!f&&l.a.createElement(s.Segment,{Component:l.a.createElement(q,{value:this.state.attributeSegment.value,label:this.state.attributeSegment.label}),disabled:this.state.segments.length<=2,onChange:this.onAttributeAction,options:this.getAttributeSegmentsAF(),allowCustomValue:!0,inputMinWidth:250}))),!f&&l.a.createElement(s.InlineField,{label:"Calculation",labelWidth:24,tooltip:"Modify all attributes by an equation. Use '.' for current item. Leave Attributes empty if you wish to perform element based calculations."},l.a.createElement(s.Input,{onBlur:r,value:p,onChange:function(t){return e.onChange(Object.assign(Object.assign({},i),{expression:t.target.value}))},placeholder:"'.'*2"})),l.a.createElement(s.InlineFieldRow,null,l.a.createElement(s.InlineField,{label:"Max Recorded Values",labelWidth:24,tooltip:"Maximum number of recorded value to retrive from the data archive, without using interpolation."},l.a.createElement(s.Input,{onBlur:r,value:h.maxNumber,onChange:function(t){return e.onChange(Object.assign(Object.assign({},i),{recordedValues:Object.assign(Object.assign({},h),{maxNumber:parseInt(t.target.value,10)})}))},type:"number",placeholder:"1000"})),l.a.createElement(s.InlineField,{label:"Recorded Values",labelWidth:24},l.a.createElement(s.InlineSwitch,{value:h.enable,onChange:function(){return e.onChange(Object.assign(Object.assign({},i),{recordedValues:Object.assign(Object.assign({},h),{enable:!h.enable})}))}})),l.a.createElement(s.InlineField,{label:"Digital States",labelWidth:24},l.a.createElement(s.InlineSwitch,{value:m.enable,onChange:function(){return e.onChange(Object.assign(Object.assign({},i),{digitalStates:Object.assign(Object.assign({},m),{enable:!m.enable})}))}}))),l.a.createElement(s.InlineFieldRow,null,l.a.createElement(s.InlineField,{label:"Interpolate Period",labelWidth:24,tooltip:"Override time between sampling, e.g. '30s'. Defaults to timespan/chart width."},l.a.createElement(s.Input,{onBlur:r,value:o.interval,onChange:function(t){return e.onChange(Object.assign(Object.assign({},i),{interpolate:Object.assign(Object.assign({},o),{interval:t.target.value})}))},placeholder:"30s"})),l.a.createElement(s.InlineField,{label:"Interpolate",labelWidth:24},l.a.createElement(s.InlineSwitch,{value:o.enable,onChange:function(){return e.onChange(Object.assign(Object.assign({},i),{interpolate:Object.assign(Object.assign({},o),{enable:!o.enable})}))}})),l.a.createElement(s.InlineField,{label:"Replace Bad Data",labelWidth:24,tooltip:"Replacement for bad quality values."},l.a.createElement(s.Segment,{Component:l.a.createElement(q,{value:{value:d.nodata},label:d.nodata}),onChange:this.calcNoDataValueChanged,options:this.getNoDataSegments(),allowCustomValue:!0}))),l.a.createElement(s.InlineFieldRow,null,l.a.createElement(s.InlineField,{label:"Summary Period",labelWidth:24,tooltip:"Override time between sampling, e.g. '30s'."},l.a.createElement(s.Input,{onBlur:r,value:d.interval,onChange:function(e){return a(Object.assign(Object.assign({},i),{summary:Object.assign(Object.assign({},d),{interval:e.target.value})}))},placeholder:"30s"})),l.a.createElement(s.InlineField,{label:"Basis",labelWidth:24,tooltip:"Defines the possible calculation options when performing summary calculations over time-series data."},l.a.createElement(s.Segment,{Component:l.a.createElement(q,{value:{value:d.basis},label:d.basis}),onChange:this.calcBasisValueChanged,options:this.getCalcBasisSegments(),allowCustomValue:!0})),l.a.createElement(s.InlineField,{label:"Summaries",labelWidth:24,tooltip:"Replacement for bad quality values."},l.a.createElement(s.InlineFieldRow,null,this.state.summaries.map((function(t,n){return l.a.createElement(s.Segment,{key:"summaries-"+n,Component:l.a.createElement(q,{value:t.value,label:t.label}),onChange:function(t){return e.onSummaryValueChanged(t,n)},options:e.getSummarySegments(),allowCustomValue:!0})})),l.a.createElement(s.Segment,{Component:l.a.createElement(q,{value:this.state.summarySegment.value,label:this.state.summarySegment.label}),onChange:this.onSummaryAction,options:this.getSummarySegments(),allowCustomValue:!0})))),l.a.createElement(s.InlineFieldRow,null,l.a.createElement(s.InlineField,{label:"Display Name",labelWidth:24,tooltip:"If single attribute, modify display name. Otherwise use regex to modify display name."},l.a.createElement(s.Input,{onBlur:r,value:v,onChange:function(t){return e.onChange(Object.assign(Object.assign({},i),{display:t.target.value}))},placeholder:"Display"})),l.a.createElement(s.InlineField,{label:"Enable Regex Replace",labelWidth:24},l.a.createElement(s.InlineSwitch,{value:b.enable,onChange:function(){e.onChange(Object.assign(Object.assign({},i),{regex:Object.assign(Object.assign({},b),{enable:!b.enable})}))}})),l.a.createElement(s.InlineField,{label:"Search",labelWidth:16},l.a.createElement(s.Input,{onBlur:r,value:b.search,onChange:function(t){return e.onChange(Object.assign(Object.assign({},i),{regex:Object.assign(Object.assign({},b),{search:t.target.value})}))},placeholder:"(.*)"})),l.a.createElement(s.InlineField,{label:"Replace",labelWidth:16},l.a.createElement(s.Input,{onBlur:r,value:b.replace,onChange:function(t){return e.onChange(Object.assign(Object.assign({},i),{regex:Object.assign(Object.assign({},b),{replace:t.target.value})}))},placeholder:"$1"}))))}}])&&F(t.prototype,n),a&&F(t,a),Object.defineProperty(t,"prototype",{writable:!1}),i}(o.PureComponent),G=n(4);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function L(){L=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,a){var r=t&&t.prototype instanceof m?t:m,i=Object.create(r.prototype),o=new S(a||[]);return i._invoke=function(e,t,n){var a="suspendedStart";return function(r,i){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===r)throw i;return w()}for(n.method=r,n.arg=i;;){var o=n.delegate;if(o){var l=O(o,n);if(l){if(l===c)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var s=u(e,t,n);if("normal"===s.type){if(a=n.done?"completed":"suspendedYield",s.arg===c)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(a="completed",n.method="throw",n.arg=s.arg)}}}(e,n,o),i}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var c={};function m(){}function h(){}function p(){}var f={};l(f,r,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(E([])));v&&v!==t&&n.call(v,r)&&(f=v);var b=p.prototype=m.prototype=Object.create(f);function g(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){var a;this._invoke=function(r,i){function o(){return new t((function(a,o){!function a(r,i,o,l){var s=u(e[r],e,i);if("throw"!==s.type){var c=s.arg,m=c.value;return m&&"object"==M(m)&&n.call(m,"__await")?t.resolve(m.__await).then((function(e){a("next",e,o,l)}),(function(e){a("throw",e,o,l)})):t.resolve(m).then((function(e){c.value=e,o(c)}),(function(e){return a("throw",e,o,l)}))}l(s.arg)}(r,i,a,o)}))}return a=a?a.then(o,o):o()}}function O(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,O(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,c;var r=a.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function E(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function t(){for(;++a=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(l&&s){if(this.prev=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if("throw"===a.type){var r=a.arg;P(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function Q(e,t){for(var n=0;n"+e.Name+": "+t})),{annotation:e,title:(t?"END ":e.showEndTime?"START ":"")+e.name,time:new Date(t?n.EndTime:n.StartTime).getTime(),text:n.Name+r+"
Start: "+n.StartTime+"
End: "+n.EndTime}}},{key:"buildQueryParameters",value:function(e){var t=this;return e.targets=Object(y.filter)(e.targets,(function(e){return!(!e||!e.target||e.target.startsWith("Select AF"))})),e.targets=Object(y.map)(e.targets,(function(n){var a=t,r={target:t.templateSrv.replace(n.elementPath,e.scopedVars),elementPath:t.templateSrv.replace(n.elementPath,e.scopedVars),elementPathArray:[{path:t.templateSrv.replace(n.elementPath,e.scopedVars),variable:""}],attributes:Object(y.map)(n.attributes,(function(n){var a;return t.templateSrv.replace((null===(a=n.value)||void 0===a?void 0:a.value)||n,e.scopedVars)})),segments:Object(y.map)(n.segments,(function(n){var a;return t.templateSrv.replace(null===(a=n.value)||void 0===a?void 0:a.value,e.scopedVars)})),display:n.display,refId:n.refId,hide:n.hide,interpolate:n.interpolate||{enable:!1},recordedValues:n.recordedValues||{enable:!1},digitalStates:n.digitalStates||{enable:!1},webid:n.webid,webids:n.webids||[],regex:n.regex||{enable:!1},expression:n.expression||"",summary:n.summary||{types:[]},startTime:e.range.from,endTime:e.range.to,isPiPoint:n.isPiPoint,scopedVars:e.scopedVars};r.expression&&(r.expression=t.templateSrv.replace(r.expression,e.scopedVars)),void 0!==r.summary.types&&(r.summary.types=Object(y.filter)(r.summary.types,(function(e){return null!=e&&""!==e})));var i=Object(y.keys)(e.scopedVars);return t.templateSrv.getVariables().forEach((function(e){if(a.isAllSelected(e.current)&&i.indexOf(e.name)<0){var t=e.options.filter((function(e){return!e.selected}));r.attributes=r.attributes.map((function(n){return t.map((function(t){return e.allValue?n.replace(e.allValue,t.value):n.replace(/{[a-zA-z0-9,-_]+}/gi,t.value)}))})),r.attributes=Object(y.uniq)(Object(y.flatten)(r.attributes)),r.elementPathArray=a.getElementPath(r.elementPathArray,t,e.allValue)}else if(Array.isArray(e.current.text)&&i.indexOf(e.name)<0){var n=e.options.filter((function(e){return e.selected})),o=e.current.value.join(",");r.attributes=r.attributes.map((function(e){return n.map((function(t){return e.replace("{".concat(o,"}"),t.value)}))})),r.attributes=Object(y.uniq)(Object(y.flatten)(r.attributes)),r.elementPathArray=a.getElementPath(r.elementPathArray,n,"{".concat(o,"}"))}})),r})),e}},{key:"query",value:function(e){return j(this,void 0,void 0,L().mark((function t(){var n,r;return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,(r=this.buildQueryParameters(e)).targets=Object(y.filter)(r.targets,(function(e){return!e.hide})),!(r.targets.length<=0)){t.next=7;break}return t.abrupt("return",Promise.resolve({data:[]}));case 7:return t.abrupt("return",Promise.all(n.getStream(r)).then((function(e){var t=[];return Object(y.each)(e,(function(e){Object(y.each)(e,(function(e){return t.push(e)}))})),{data:t.sort((function(e,t){return+(e.target>t.target)||+(e.target===t.target)-1})).map((function(e){return Object(a.toDataFrame)(e)}))}})));case 8:case"end":return t.stop()}}),t,this)})))}},{key:"testDatasource",value:function(){return this.backendSrv.datasourceRequest({url:this.url+"/",method:"GET"}).then((function(e){if(200===e.status)return{status:"success",message:"Data source is working",title:"Success"};throw new Error("Failed")}))}},{key:"annotationQuery",value:function(e){var t=this;if(!this.afdatabase.webid)return Promise.resolve([]);var n=e.annotation.query.categoryName?this.templateSrv.replace(e.annotation.query.categoryName,e.scopedVars,"glob"):null,a=e.annotation.query.nameFilter?this.templateSrv.replace(e.annotation.query.nameFilter,e.scopedVars,"glob"):null,r=e.annotation.template?e.annotation.template.Name:null,i={name:e.annotation.name,datasource:e.annotation.datasource,enable:e.annotation.enable,iconColor:e.annotation.iconColor,showEndTime:e.annotation.showEndTime,regex:e.annotation.regex,attribute:e.annotation.attribute,categoryName:n,templateName:r,nameFilter:a},o=[];if(i.categoryName&&o.push("categoryName="+i.categoryName),i.nameFilter&&o.push("nameFilter="+i.nameFilter),i.templateName&&o.push("templateName="+i.templateName),!o.length)return Promise.resolve([]);if(o.push("startTime="+e.range.from.toJSON()),o.push("endTime="+e.range.to.toJSON()),i.attribute&&i.attribute.enable){var l=this.piwebapiurl+"/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name";i.attribute.name&&(l=this.piwebapiurl+"/streamsets/{0}/value?nameFilter="+i.attribute.name+"&selectedFields=Items.WebId%3BItems.Value%3BItems.Name");var s={};return s[1]={Method:"GET",Resource:this.piwebapiurl+"/assetdatabases/"+this.afdatabase.webid+"/eventframes?"+o.join("&")},s[2]={Method:"GET",RequestTemplate:{Resource:l},Parameters:["$.1.Content.Items[*].WebId"],ParentIds:["1"]},this.restBatch(s).then((function(n){var a=n.data[1].Content,r=n.data[2].Content,o=Object(y.map)(a.Items,(function(e,n){return Object(y.curry)(t.eventFrameToAnnotation)(i,!1,e,r.Items[n].Content.Items)}));if(e.annotation.showEndTime){var l=Object(y.map)(a.Items,(function(e,n){return Object(y.curry)(t.eventFrameToAnnotation)(i,!0,e,r.Items[n].Content.Items)}));Object(y.each)(l,(function(e){o.push(e)}))}return o}))}return this.restGet("/assetdatabases/"+this.afdatabase.webid+"/eventframes?"+o.join("&")).then((function(n){var a=Object(y.map)(n.data.Items,Object(y.curry)(t.eventFrameToAnnotation)(i,!1));if(e.annotation.showEndTime){var r=Object(y.map)(n.data.Items,Object(y.curry)(t.eventFrameToAnnotation)(i,!0));Object(y.each)(r,(function(e){a.push(e)}))}return a}))}},{key:"metricQueryTransform",value:function(e){return Object(y.map)(e,(function(e){var t,n;return{text:e.Name,expandable:void 0===e.HasChildren||!0===e.HasChildren||(null!==(t=e.Path)&&void 0!==t?t:"").split("\\").length<=3,HasChildren:e.HasChildren,Items:null!==(n=e.Items)&&void 0!==n?n:[],Path:e.Path,WebId:e.WebId}}))}},{key:"metricFindQuery",value:function(e,t){var n,a,r=this,i=["servers","databases","databaseElements","elements"];return"string"==typeof e&&(e=JSON.parse(e)),t.isPiPoint?e.path=this.templateSrv.replace(e.path,t):(""===e.path?e.type=i[0]:"attributes"!==e.type&&(e.type=i[Math.max(0,Math.min(e.path.split("\\").length,i.length-1))]),e.path=this.templateSrv.replace(e.path,t),e.path=e.path.replace(/\{([^\\])*\}/gi,(function(e){return e.substring(1,e.length-2).split(",")[0]}))),e.filter=null!==(n=e.filter)&&void 0!==n?n:"*","servers"===e.type?(null===(a=r.afserver)||void 0===a?void 0:a.name)?r.getAssetServer(r.afserver.name).then((function(e){return[e]})).then(r.metricQueryTransform):r.getAssetServers().then(r.metricQueryTransform):"databases"===e.type?r.getAssetServer(e.path).then((function(e){var t;return r.getDatabases(null!==(t=e.WebId)&&void 0!==t?t:"",{})})).then(r.metricQueryTransform):"databaseElements"===e.type?r.getDatabase(e.path).then((function(e){var t;return r.getDatabaseElements(null!==(t=e.WebId)&&void 0!==t?t:"",{selectedFields:"Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren"})})).then(r.metricQueryTransform):"elements"===e.type?r.getElement(e.path).then((function(t){var n;return r.getElements(null!==(n=t.WebId)&&void 0!==n?n:"",{selectedFields:"Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren",nameFilter:e.filter})})).then(r.metricQueryTransform):"attributes"===e.type?r.getElement(e.path).then((function(t){var n;return r.getAttributes(null!==(n=t.WebId)&&void 0!==n?n:"",{searchFullHierarchy:"true",selectedFields:"Items.WebId%3BItems.Name%3BItems.Path",nameFilter:e.filter})})).then(r.metricQueryTransform):"dataserver"===e.type?r.getDataServers().then(r.metricQueryTransform):"pipoint"===e.type?r.piPointSearch(e.webId,e.pointName).then(r.metricQueryTransform):Promise.reject("Bad type")}},{key:"getSummaryUrl",value:function(e){return""===e.interval.trim()?"&summaryType="+e.types.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).join("&summaryType=")+"&calculationBasis="+e.basis:"&summaryType="+e.types.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).join("&summaryType=")+"&calculationBasis="+e.basis+"&summaryDuration="+e.interval.trim()}},{key:"parsePiPointValueList",value:function(e,t,n){var a=this,r=this,i=[];return Object(y.each)(e,(function(e){var o=a.noDataReplace(n?e.Value:e,t.summary.nodata,r.parsePiPointValue(n?e.Value:e,t,n)),l=o.grafanaDataPoint;o.previousValue,o.drop||i.push(l)})),i}},{key:"parsePiPointValue",value:function(e,t,n){var a,r,i=n||"object"!==M(e.Value)?e.Value:null===(a=e.Value)||void 0===a?void 0:a.Value;return!e.Good||(null===(r=t.digitalStates)||void 0===r?void 0:r.enable)?[(i=n||"object"!==M(e.Value)?e.Name:e.Value.Name).trim(),new Date(e.Timestamp).getTime()]:[this.checkNumber(i)?Number(i):i.trim(),new Date(e.Timestamp).getTime()]}},{key:"noDataReplace",value:function(e,t,n){var a,r,i=null,o=!1;return!e.Good||"No Data"===e.Value||(null===(a=e.Value)||void 0===a?void 0:a.Name)&&"No Data"===(null===(r=e.Value)||void 0===r?void 0:r.Name)?"Drop"===t?o=!0:"0"===t?n[0]=0:"Keep"===t||("Null"===t?n[0]=null:"Previous"===t&&null!==i&&(n[0]=i)):i=e.Value,{grafanaDataPoint:n,previousValue:i,drop:o}}},{key:"processResults",value:function(e,t,n,a){var r=this,i=t.summary&&t.summary.types&&t.summary.types.length>0;if(n=a?n:this.getPath(t.elementPathArray,e.Path)+"|"+n,t.regex&&t.regex.enable&&t.regex.search.length&&t.regex.replace.length&&(n=n.replace(new RegExp(t.regex.search),t.regex.replace)),i){var o=[],l=Object(y.groupBy)(e.Items,(function(e){return e.Type}));return Object(y.forOwn)(l,(function(e,a){o.push({refId:t.refId,target:n+"["+a+"]",datapoints:r.parsePiPointValueList(e,t,i)})})),o}return[{refId:t.refId,target:n,datapoints:r.parsePiPointValueList(e.Items,t,i)}]}},{key:"isAllSelected",value:function(e){return!!e&&(Array.isArray(e.text)?e.text.indexOf("All")>=0:"All"===e.text)}},{key:"checkNumber",value:function(e){return"number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)}},{key:"getElementPath",value:function(e,t,n){var a=[];return e.forEach((function(e){if(n&&e.path.indexOf(n)>=0||!n&&e.path.match(/{[a-zA-z0-9,-_]+}/gi)){var r=t.map((function(t){return{path:n?e.path.replace(n,t.value):e.path.replace(/{[a-zA-z0-9,-_]+}/gi,t.value),variable:t.value}}));a=a.concat(r)}})),a.length?Object(y.uniq)(Object(y.flatten)(a)):e}},{key:"getPath",value:function(e,t){var n,a,r=t.split("|");if(0===r.length)return"";if(0===e.length)return"";var i=0===(r=r[0].split("\\")).length?"":null!==(n=r.pop())&&void 0!==n?n:"",o=null===(a=e.find((function(e){return t.indexOf(e.path)>=0})))||void 0===a?void 0:a.variable;return o?o+"|"+i:i}},{key:"getStream",value:function(e){var t=this,n=this,a=[];return Object(y.each)(e.targets,(function(r){r.attributes=Object(y.filter)(r.attributes||[],(function(e){return e}));var i="",o=r.summary&&r.summary.types&&r.summary.types.length>0,l=r.interpolate&&r.interpolate.enable,s=r.interpolate.interval?r.interpolate.interval:e.interval,u="?startTime="+e.range.from.toJSON()+"&endTime="+e.range.to.toJSON(),c=r.expression||r.elementPath,m=r.display?t.templateSrv.replace(r.display,e.scopedVars):null;if(r.expression)i+="/calculation",i+=o?"/summary"+u+(l?"&sampleType=Interval&sampleInterval="+s:""):"/intervals"+u+"&sampleInterval="+s,i+="&expression="+encodeURIComponent(r.expression),r.attributes.length>0?a.push(n.internalStream(e,r,i)):a.push(n.restGetWebId(r.elementPath,r.isPiPoint).then((function(e){return n.restPost(i+e.WebId).then((function(e){return n.processResults(e.data,r,m||c,!1)})).catch((function(e){return n.error=e}))})));else{if(i+="/streamsets",o)i+="/summary"+u+"&intervals="+e.maxDataPoints+t.getSummaryUrl(r.summary);else if(r.interpolate&&r.interpolate.enable)i+="/interpolated"+u+"&interval="+s;else if(r.recordedValues&&r.recordedValues.enable){var h=r.recordedValues.maxNumber&&!isNaN(r.recordedValues.maxNumber)?r.recordedValues.maxNumber:1e3;i+="/recorded"+u+"&maxCount="+h}else i+="/plot"+u+"&intervals="+e.maxDataPoints;a.push(n.internalStream(e,r,i))}})),a}},{key:"internalStream",value:function(e,t,n){var a=this,r=t.expression||t.elementPath,i=t.display?this.templateSrv.replace(t.display,e.scopedVars):null,o=1===t.elementPathArray.length&&t.elementPath===t.elementPathArray[0].path;return(o?t.attributes.length>1?a.restGetWebId(t.elementPath,t.isPiPoint).then((function(e){return a.getAttributes(e.WebId,{searchFullHierarchy:"true",nameFilter:"*"})})).then((function(e){return e.filter((function(e){var n;return t.attributes.indexOf(e.Name)>=0||t.attributes.indexOf(null===(n=e.Path)||void 0===n?void 0:n.split("|").splice(1).join("|"))>=0}))})):Promise.all(Object(y.map)(t.attributes,(function(e){return a.restGetWebId(t.elementPath+"|"+e,t.isPiPoint)}))):t.attributes.length>1?Promise.all(t.elementPathArray.map((function(e){return a.restGetWebId(e.path,t.isPiPoint).then((function(e){return a.getAttributes(e.WebId,{searchFullHierarchy:"true",nameFilter:"*"})})).then((function(e){return e.filter((function(e){var n;return t.attributes.indexOf(e.Name)>=0||t.attributes.indexOf(null===(n=e.Path)||void 0===n?void 0:n.split("|").splice(1).join("|"))>=0}))}))}))):Promise.all(Object(y.flatten)(Object(y.map)(t.attributes,(function(e){return t.elementPathArray.map((function(n){return a.restGetWebId(n.path+"|"+e,t.isPiPoint)}))}))))).then((function(e){var l={};return Object(y.each)(Object(y.flatten)(e),(function(e,t){l[t+1]={Method:"GET",Resource:a.piwebapiurl+n+"&webid="+e.WebId}})),a.restBatch(l).then((function(n){var l=[];return Object(y.each)(n.data,(function(n,s){if(t.expression){var u=e[parseInt(s,10)-1].Name;Object(y.each)(a.processResults(n.Content,t,i||u||r,o),(function(e){return l.push(e)}))}else Object(y.each)(n.Content.Items,(function(e){Object(y.each)(a.processResults(e,t,i||e.Name||r,o),(function(e){return l.push(e)}))}))})),l})).catch((function(e){return a.error=e}))}))}},{key:"restGet",value:function(e){return this.backendSrv.datasourceRequest({url:this.url+e,method:"GET",headers:{"Content-Type":"application/json"}}).then((function(e){return e}))}},{key:"restGetWebId",value:function(e,t){var n=this,a=n.webidCache.get(e);if(a)return Promise.resolve({Path:e,WebId:a.WebId,Name:a.Name});var r="";return r=t?"/points?selectedFields=WebId%3BName%3BPath&path=\\\\"+e.replace("|","\\"):(e.indexOf("|")>=0?"/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\":"/elements?selectedFields=WebId%3BName%3BPath&path=\\\\")+e,this.backendSrv.datasourceRequest({url:this.url+r,method:"GET",headers:{"Content-Type":"application/json"}}).then((function(t){return n.webidCache.set(e,t.data),{Path:e,WebId:t.data.WebId,Name:t.data.Name}}))}},{key:"restBatch",value:function(e){return this.backendSrv.datasourceRequest({url:this.url+"/batch",data:e,method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"message/http"}})}},{key:"restPost",value:function(e){return this.backendSrv.datasourceRequest({url:this.url,method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"message/http","X-PIWEBAPI-HTTP-METHOD":"GET","X-PIWEBAPI-RESOURCE-ADDRESS":e}})}},{key:"getDataServers",value:function(){return this.restGet("/dataservers").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getDataServer",value:function(e){return e?this.restGet("/dataservers?name="+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getAssetServers",value:function(){return this.restGet("/assetservers").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getAssetServer",value:function(e){return e?this.restGet("/assetservers?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getDatabase",value:function(e){return e?this.restGet("/assetdatabases?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getDatabases",value:function(e,t){return e?this.restGet("/assetservers/"+e+"/assetdatabases").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]})):Promise.resolve([])}},{key:"getElement",value:function(e){return e?this.restGet("/elements?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getEventFrameTemplates",value:function(e){return e?this.restGet("/assetdatabases/"+e+"/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId").then((function(e){var t;return Object(y.filter)(null!==(t=e.data.Items)&&void 0!==t?t:[],(function(e){return"EventFrame"===e.InstanceType}))})):Promise.resolve([])}},{key:"getElementTemplates",value:function(e){return e?this.restGet("/assetdatabases/"+e+"/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId").then((function(e){var t;return Object(y.filter)(null!==(t=e.data.Items)&&void 0!==t?t:[],(function(e){return"Element"===e.InstanceType}))})):Promise.resolve([])}},{key:"getAttributes",value:function(e,t){var n="?"+Object(y.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/elements/"+e+"/attributes"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getDatabaseElements",value:function(e,t){var n="?"+Object(y.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/assetdatabases/"+e+"/elements"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getElements",value:function(e,t){var n="?"+Object(y.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/elements/"+e+"/elements"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"piPointSearch",value:function(e,t){var n=this.templateSrv.replace(t),a="".concat(n),r=!1;if(n!==t)for(var i,o=/\{(\w|,)+\}/g;null!==(i=o.exec(n));)i.index===o.lastIndex&&o.lastIndex++,i.forEach((function(e,t){0===t&&(n=n.replace(e,e.replace("{","(").replace("}",")").replace(",","|")),a=a.replace(e,"*"),r=!0)}));return this.restGet("/dataservers/"+e+"/points?maxCount=20&nameFilter="+a).then((function(e){var t;return e&&(null===(t=e.data)||void 0===t?void 0:t.Items)?r?e.data.Items.filter((function(e){var t;return null===(t=e.Name)||void 0===t?void 0:t.match(n)})):e.data.Items:[]}))}},{key:"getWebId",value:function(e){var t=e.target.indexOf("\\")>=0,n=e.target.indexOf("|")>=0;return t||-1!==e.target.indexOf(".")?t?t&&n?this.restGet("/attributes?path=\\\\"+e.target).then((function(t){return void 0===t.data||200!==t.status?[{WebId:e.target,Name:e.display||e.target}]:(t.data.Name=e.display||t.data.Name,[t.data])})):this.restGet("/elements?path=\\\\"+e.target).then((function(t){return void 0===t.data||200!==t.status?[{WebId:e.target,Name:e.display||e.target}]:(t.data.Name=e.display||t.data.Name,[t.data])})):this.piPointSearch(this.piserver.webid,e.target).then((function(t){return void 0===t||0===t.length?[{WebId:e.target,Name:e.display||e.target}]:t})):Promise.resolve([{WebId:e.target,Name:e.display||e.target}])}}])&&Q(t.prototype,n),r&&Q(t,r),Object.defineProperty(t,"prototype",{writable:!1}),o}(a.DataSourceApi);n.d(t,"plugin",(function(){return X}));var X=new a.DataSourcePlugin(J).setConfigEditor(g).setQueryEditor(_).setAnnotationQueryCtrl(i)}])})); +define(["@grafana/data","@grafana/runtime","@grafana/ui","lodash","react"],((e,t,n,a,r)=>(()=>{"use strict";var i=[e=>{e.exports=r},e=>{e.exports=n},t=>{t.exports=e},e=>{e.exports=a},,e=>{e.exports=t}],o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e](n,n.exports,l),n.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{l.r(u),l.d(u,{plugin:()=>me});var e=l(2);function t(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n0?r[0].split("\\"):[];return i.length>1||1===i.length&&""!==i[0]?(r.splice(0,1),(0,C.each)(i,(function(e,t){n.push({label:e,value:{value:e,expandable:!0}})})),(0,C.each)(r,(function(e,t){""!==e&&a.push({label:e,value:{value:e,expandable:!1}})})),t.getElementSegments(i.length+1,n).then((function(e){return e.length>0&&n.push({label:"Select Element",value:{value:"-Select Element-"}}),n}))):Promise.resolve(n)})),H($(t),"checkAfServer",(function(){var e,n,a=t.props.datasource,r=[];null!==(e=a.afserver)&&void 0!==e&&e.name?(r.push({label:a.afserver.name,value:{value:a.afserver.name,expandable:!0}}),null!==(n=a.afdatabase)&&void 0!==n&&n.name&&r.push({label:a.afdatabase.name,value:{value:a.afdatabase.name,expandable:!0}}),r.push({label:"Select Element",value:{value:"-Select Element-"}})):r.push({label:""});return r})),H($(t),"updateArray",(function(e,n,a,r,i){t.setState({segments:e,attributes:n,summaries:a,isPiPoint:r},(function(){return t.checkAttributeSegments(n,t.state.segments).then((function(){i&&i()}))}))})),H($(t),"scopedVarsDone",!1),H($(t),"componentDidMount",(function(){t.initialLoad(!1)})),H($(t),"componentDidUpdate",(function(){var e,n,a;"Done"===(null===(e=t.props.data)||void 0===e?void 0:e.state)&&null!==(n=t.props.data)&&void 0!==n&&null!==(a=n.request)&&void 0!==a&&a.scopedVars&&!t.scopedVarsDone&&(t.scopedVarsDone=!0,t.initialLoad(!0))})),H($(t),"initialLoad",(function(e){var n,a,r,i=t.props.query,o=(0,C.defaults)(i,F),l=o.segments,u=o.attributes,s=o.summary,c=o.isPiPoint,m=e?[]:null!==(n=null==l?void 0:l.slice(0))&&void 0!==n?n:[],h=e?[]:null!==(a=null==u?void 0:u.slice(0))&&void 0!==a?a:[],p=null!==(r=null==s?void 0:s.types)&&void 0!==r?r:[];if(c||0!==m.length)c&&m.length>0&&(t.piServer=m);else{if(i.target&&i.target.length>0&&";"!==i.target)return h=[],void t.buildFromTarget(i,m,h).then((function(e){t.updateArray(e,h,p,c)})).catch((function(e){}));m=t.checkAfServer()}t.updateArray(m,h,p,c,(function(){t.onChange(i)}))})),H($(t),"onChange",(function(e){var n,a=t.props,r=a.onChange,i=a.onRunQuery;if(e.summary.types=t.state.summaries,e.rawQuery){if(e.target=null!==(n=e.query)&&void 0!==n?n:"",""!==e.target){var o=e.target.split(";"),l=o[0].split("\\");o.splice(0,1),e.attributes=[],(l.length>1||1===l.length&&""!==l[0])&&(e.elementPath=l.join("\\"),(0,C.each)(o,(function(t,n){""!==t&&e.attributes.push({label:t,value:{value:t,expandable:!1}})})))}}else e.elementPath=t.getSegmentPathUpTo(t.state.segments,t.state.segments.length),e.target=e.elementPath+";"+(0,C.join)(e.attributes.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})),";");r(e),e.target&&e.target.length>0&&e.attributes.length>0&&i()})),H($(t),"stateCallback",(function(){var e=t.props.query;t.onChange(e)})),H($(t),"onIsPiPointChange",(function(e){var n=t.props.query,a=!n.isPiPoint;t.setState({segments:a?[{label:""}]:t.checkAfServer(),attributes:[],isPiPoint:a},(function(){t.onChange(_({},n,{expression:"",attributes:t.state.attributes,segments:t.state.segments,isPiPoint:a}))}))})),t.onSegmentChange=t.onSegmentChange.bind($(t)),t.calcBasisValueChanged=t.calcBasisValueChanged.bind($(t)),t.calcNoDataValueChanged=t.calcNoDataValueChanged.bind($(t)),t.onSummaryAction=t.onSummaryAction.bind($(t)),t.onSummaryValueChanged=t.onSummaryValueChanged.bind($(t)),t.onAttributeAction=t.onAttributeAction.bind($(t)),t.onAttributeChange=t.onAttributeChange.bind($(t)),t.summaryTypes=["Total","Average","Minimum","Maximum","Range","StdDev","PopulationStdDev","Count","PercentGood","All","AllForNonNumeric"],t.calculationBasis=["TimeWeighted","EventWeighted","TimeWeightedContinuous","TimeWeightedDiscrete","EventWeightedExcludeMostRecentEvent","EventWeightedExcludeEarliestEvent","EventWeightedIncludeBothEnds"],t.noDataReplacement=["Null","Drop","Previous","0","Keep"],t}return t=i,(n=[{key:"isValueEmpty",value:function(e){return!e||!e.value||!e.value.length||e.value===X}},{key:"calcBasisValueChanged",value:function(e){var t,n=this.props.query,a=n.summary;a.basis=null===(t=e.value)||void 0===t?void 0:t.value,this.onChange(_({},n,{summary:a}))}},{key:"getCalcBasisSegments",value:function(){return(0,C.map)(this.calculationBasis,(function(e){return{label:e,value:{value:e,expandable:!0}}}))}},{key:"calcNoDataValueChanged",value:function(e){var t,n=this.props.query,a=n.summary;a.nodata=null===(t=e.value)||void 0===t?void 0:t.value,this.onChange(_({},n,{summary:a}))}},{key:"getNoDataSegments",value:function(){return(0,C.map)(this.noDataReplacement,(function(e){return{label:e,value:{value:e,expandable:!0}}}))}},{key:"onSummaryValueChanged",value:function(e,t){var n=this.state.summaries.slice(0);n[t]=e,this.isValueEmpty(e.value)&&n.splice(t,1),this.setState({summaries:n},this.stateCallback)}},{key:"getSummarySegments",value:function(){var e=this,t=(0,C.filter)(this.summaryTypes,(function(t){return-1===e.state.summaries.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).indexOf(t)})),n=(0,C.map)(t,(function(e){return{label:e,value:{value:e,expandable:!0}}}));return n.unshift({label:X,value:{value:X}}),n}},{key:"removeSummary",value:function(e){var t=(0,C.filter)(this.state.summaries,(function(t){return t!==e}));this.setState({summaries:t})}},{key:"onSummaryAction",value:function(e){var t=this.state.summaries.slice(0);if(!this.isValueEmpty(e.value)){var n,a={label:e.label,value:{value:null===(n=e.value)||void 0===n?void 0:n.value,expandable:!0}};t.push(a)}this.setState({summarySegment:{},summaries:t},this.stateCallback)}},{key:"removeAttribute",value:function(e){var t=(0,C.filter)(this.state.attributes,(function(t){return t!==e}));this.attributeChangeValue(t)}},{key:"onAttributeAction",value:function(e){var t=this.props.query,n=this.state.attributes.slice(0);if(!this.isValueEmpty(e.value)){var a,r={label:e.label,value:{value:null===(a=e.value)||void 0===a?void 0:a.value,expandable:!t.isPiPoint}};n.push(r)}this.attributeChangeValue(n)}},{key:"getSegmentPathUpTo",value:function(e,t){var n=e.slice(0,t);return(0,C.reduce)(n,(function(e,t){var n;return t.value?null!==(n=t.value.value)&&void 0!==n&&n.startsWith("-Select")?e:e?e+"\\"+t.value.value:t.value.value:""}),"")}},{key:"checkAttributeSegments",value:function(e,t){var n,a,r=this,i=this.props,o=i.datasource,l=i.data,u=this,s={path:this.getSegmentPathUpTo(t.slice(0),t.length),type:"attributes"};return o.metricFindQuery(s,Object.assign(null!==(n=null==l||null===(a=l.request)||void 0===a?void 0:a.scopedVars)&&void 0!==n?n:{},{isPiPoint:!1})).then((function(t){var n={};(0,C.each)(t,(function(e){n[e.Path.substring(e.Path.indexOf("|")+1)]=e.WebId}));var a=(0,C.filter)(e,(function(e){var t,a=o.templateSrv.replace(null===(t=e.value)||void 0===t?void 0:t.value);return void 0!==n[a]}));u.availableAttributes=n,r.attributeChangeValue(a)})).catch((function(t){u.error=t.message||"Failed to issue metric query",r.attributeChangeValue(e)}))}},{key:"checkPiPointSegments",value:function(e,t){var n,a,r=this.props,i=r.datasource,o=r.data,l=this,u={path:e.path,webId:l.getSelectedPIServer(),pointName:e.label,type:"pipoint"};return i.metricFindQuery(u,Object.assign(null!==(n=null==o||null===(a=o.request)||void 0===a?void 0:a.scopedVars)&&void 0!==n?n:{},{isPiPoint:!0})).then((function(){l.attributeChangeValue(t)})).catch((function(e){l.error=e.message||"Failed to issue metric query",l.attributeChangeValue([])}))}},{key:"getSelectedPIServer",value:function(){var e,t=this,n="";return this.piServer.forEach((function(e){var a=t.props.query.target.split(";");a.length>=2&&a[0]===e.text&&(n=e.WebId)})),this.piServer.length>0?null===(e=this.piServer[0].value)||void 0===e?void 0:e.webId:n}},{key:"textEditorChanged",value:function(){var e=this,t=this.props,n=t.query,a=t.onChange,r=n.target.split(";"),i=r.length>0?r[0].split("\\"):[],o=[],l=[];i.length>1||1===i.length&&""!==i[0]?(r.splice(0,1),(0,C.each)(i,(function(e,t){o.push({label:e,value:{type:e.match(/\${\w+}/gi)?"template":void 0,value:e,expandable:!0}})})),this.getElementSegments(i.length+1,o).then((function(e){e.length>0&&o.push({label:"Select Element",value:{value:"-Select Element-"}})})),(0,C.each)(r,(function(e,t){""!==e&&l.push({label:e,value:{value:e,expandable:!1}})})),this.updateArray(o,l,this.state.summaries,n.isPiPoint,(function(){a(_({},n,{query:void 0,rawQuery:!1}))}))):(o=this.checkAfServer(),this.updateArray(o,this.state.attributes,this.state.summaries,n.isPiPoint,(function(){e.onChange(_({},n,{query:void 0,rawQuery:!1,attributes:e.state.attributes,segments:e.state.segments}))})))}},{key:"render",value:function(){var e=this,t=this.props,n=t.query,a=t.onChange,r=t.onRunQuery,i=(0,C.defaults)(n,F),l=i.interpolate,u=i.query,c=i.rawQuery,m=i.digitalStates,h=i.recordedValues,p=i.expression,d=i.isPiPoint,f=i.summary,v=i.display,b=i.regex;return o().createElement(o().Fragment,null,o().createElement(s.InlineField,{label:"Is Pi Point?",labelWidth:z},o().createElement(s.InlineSwitch,{value:d,onChange:this.onIsPiPointChange})),!!c&&o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Raw Query",labelWidth:z,grow:!0},o().createElement(s.Input,{onBlur:this.stateCallback,value:u,onChange:function(e){return a(_({},i,{query:e.target.value}))},placeholder:"enter query"})),o().createElement(B,{isRaw:!0,onChange:function(t){return e.textEditorChanged()}})),!c&&o().createElement(o().Fragment,null,o().createElement("div",{className:"gf-form-inline"},o().createElement(j,{label:d?"PI Server":"AF Elements",tooltip:d?"Select PI server.":"Select AF Element."},this.state.segments.map((function(t,n){return o().createElement(s.SegmentAsync,{key:"element-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),onChange:function(t){return e.onSegmentChange(t,n)},loadOptions:function(t){return e.getElementSegments(n)},allowCustomValue:!0,inputMinWidth:200})})),R||(R=o().createElement(A,null)),!d&&o().createElement(B,{isRaw:!1,onChange:function(e){a(_({},i,{query:i.target,rawQuery:e}))}}))),o().createElement(k,{label:d?"Pi Points":"Attributes"},this.state.attributes.map((function(t,n){return d?o().createElement(s.SegmentAsync,{key:"attributes-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),disabled:0===e.piServer.length,onChange:function(t){return e.onPiPointChange(t,n)},loadOptions:e.getAttributeSegmentsPI,reloadOptionsOnChange:!0,allowCustomValue:!0,inputMinWidth:J}):o().createElement(s.Segment,{key:"attributes-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),disabled:e.state.segments.length<=2,onChange:function(t){return e.onAttributeChange(t,n)},options:e.getAttributeSegmentsAF(),allowCustomValue:!0,inputMinWidth:J})})),d&&o().createElement(s.SegmentAsync,{Component:o().createElement(Y,{value:this.state.attributeSegment.value,label:this.state.attributeSegment.label}),disabled:0===this.piServer.length,onChange:this.onAttributeAction,loadOptions:this.getAttributeSegmentsPI,reloadOptionsOnChange:!0,allowCustomValue:!0,inputMinWidth:J}),!d&&o().createElement(s.Segment,{Component:o().createElement(Y,{value:this.state.attributeSegment.value,label:this.state.attributeSegment.label}),disabled:this.state.segments.length<=2,onChange:this.onAttributeAction,options:this.getAttributeSegmentsAF(),allowCustomValue:!0,inputMinWidth:J}))),!d&&o().createElement(s.InlineField,{label:"Calculation",labelWidth:z,tooltip:"Modify all attributes by an equation. Use '.' for current item. Leave Attributes empty if you wish to perform element based calculations."},o().createElement(s.Input,{onBlur:r,value:p,onChange:function(t){return e.onChange(_({},i,{expression:t.target.value}))},placeholder:"'.'*2"})),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Max Recorded Values",labelWidth:z,tooltip:"Maximum number of recorded value to retrive from the data archive, without using interpolation."},o().createElement(s.Input,{onBlur:r,value:h.maxNumber,onChange:function(t){return e.onChange(_({},i,{recordedValues:_({},h,{maxNumber:parseInt(t.target.value,10)})}))},type:"number",placeholder:"1000"})),o().createElement(s.InlineField,{label:"Recorded Values",labelWidth:z},o().createElement(s.InlineSwitch,{value:h.enable,onChange:function(){return e.onChange(_({},i,{recordedValues:_({},h,{enable:!h.enable})}))}})),o().createElement(s.InlineField,{label:"Digital States",labelWidth:z},o().createElement(s.InlineSwitch,{value:m.enable,onChange:function(){return e.onChange(_({},i,{digitalStates:_({},m,{enable:!m.enable})}))}}))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Interpolate Period",labelWidth:z,tooltip:"Override time between sampling, e.g. '30s'. Defaults to timespan/chart width."},o().createElement(s.Input,{onBlur:r,value:l.interval,onChange:function(t){return e.onChange(_({},i,{interpolate:_({},l,{interval:t.target.value})}))},placeholder:"30s"})),o().createElement(s.InlineField,{label:"Interpolate",labelWidth:z},o().createElement(s.InlineSwitch,{value:l.enable,onChange:function(){return e.onChange(_({},i,{interpolate:_({},l,{enable:!l.enable})}))}})),o().createElement(s.InlineField,{label:"Replace Bad Data",labelWidth:z,tooltip:"Replacement for bad quality values."},o().createElement(s.Segment,{Component:o().createElement(Y,{value:{value:f.nodata},label:f.nodata}),onChange:this.calcNoDataValueChanged,options:this.getNoDataSegments(),allowCustomValue:!0}))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Summary Period",labelWidth:z,tooltip:"Override time between sampling, e.g. '30s'."},o().createElement(s.Input,{onBlur:r,value:f.interval,onChange:function(e){return a(_({},i,{summary:_({},f,{interval:e.target.value})}))},placeholder:"30s"})),o().createElement(s.InlineField,{label:"Basis",labelWidth:z,tooltip:"Defines the possible calculation options when performing summary calculations over time-series data."},o().createElement(s.Segment,{Component:o().createElement(Y,{value:{value:f.basis},label:f.basis}),onChange:this.calcBasisValueChanged,options:this.getCalcBasisSegments(),allowCustomValue:!0})),o().createElement(s.InlineField,{label:"Summaries",labelWidth:z,tooltip:"Replacement for bad quality values."},o().createElement(s.InlineFieldRow,null,this.state.summaries.map((function(t,n){return o().createElement(s.Segment,{key:"summaries-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),onChange:function(t){return e.onSummaryValueChanged(t,n)},options:e.getSummarySegments(),allowCustomValue:!0})})),o().createElement(s.Segment,{Component:o().createElement(Y,{value:this.state.summarySegment.value,label:this.state.summarySegment.label}),onChange:this.onSummaryAction,options:this.getSummarySegments(),allowCustomValue:!0})))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Display Name",labelWidth:z,tooltip:"If single attribute, modify display name. Otherwise use regex to modify display name."},o().createElement(s.Input,{onBlur:r,value:v,onChange:function(t){return e.onChange(_({},i,{display:t.target.value}))},placeholder:"Display"})),o().createElement(s.InlineField,{label:"Enable Regex Replace",labelWidth:z},o().createElement(s.InlineSwitch,{value:b.enable,onChange:function(){e.onChange(_({},i,{regex:_({},b,{enable:!b.enable})}))}})),o().createElement(s.InlineField,{label:"Search",labelWidth:16},o().createElement(s.Input,{onBlur:r,value:b.search,onChange:function(t){return e.onChange(_({},i,{regex:_({},b,{search:t.target.value})}))},placeholder:"(.*)"})),o().createElement(s.InlineField,{label:"Replace",labelWidth:16},o().createElement(s.Input,{onBlur:r,value:b.replace,onChange:function(t){return e.onChange(_({},i,{regex:_({},b,{replace:t.target.value})}))},placeholder:"$1"}))))}}])&&G(t.prototype,n),a&&G(t,a),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.PureComponent),Z=l(5);function ee(e){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(e)}function te(){te=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var r=t&&t.prototype instanceof m?t:m,i=Object.create(r.prototype),o=new w(a||[]);return i._invoke=function(e,t,n){var a="suspendedStart";return function(r,i){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===r)throw i;return C()}for(n.method=r,n.arg=i;;){var o=n.delegate;if(o){var l=P(o,n);if(l){if(l===c)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var u=s(e,t,n);if("normal"===u.type){if(a=n.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c={};function m(){}function h(){}function p(){}var d={};l(d,r,(function(){return this}));var f=Object.getPrototypeOf,v=f&&f(f(I([])));v&&v!==t&&n.call(v,r)&&(d=v);var b=p.prototype=m.prototype=Object.create(d);function g(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function a(r,i,o,l){var u=s(e[r],e,i);if("throw"!==u.type){var c=u.arg,m=c.value;return m&&"object"==ee(m)&&n.call(m,"__await")?t.resolve(m.__await).then((function(e){a("next",e,o,l)}),(function(e){a("throw",e,o,l)})):t.resolve(m).then((function(e){c.value=e,o(c)}),(function(e){return a("throw",e,o,l)}))}l(u.arg)}var r;this._invoke=function(e,n){function i(){return new t((function(t,r){a(e,n,t,r)}))}return r=r?r.then(i,i):i()}}function P(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,P(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,c;var r=a.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function I(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function t(){for(;++a=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if("throw"===a.type){var r=a.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:I(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function ne(e,t,n,a,r,i,o){try{var l=e[i](o),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(a,r)}function ae(e,t){for(var n=0;n"+e.Name+": "+t})),{annotation:e,title:(t?"END ":e.showEndTime?"START ":"")+e.name,time:new Date(t?n.EndTime:n.StartTime).getTime(),text:n.Name+r+"
Start: "+n.StartTime+"
End: "+n.EndTime}}},{key:"buildQueryParameters",value:function(e){var t=this;return e.targets=(0,C.filter)(e.targets,(function(e){return!(!e||!e.target||e.target.startsWith("Select AF"))})),e.targets=(0,C.map)(e.targets,(function(n){var a=t,r={target:t.templateSrv.replace(n.elementPath,e.scopedVars),elementPath:t.templateSrv.replace(n.elementPath,e.scopedVars),elementPathArray:[{path:t.templateSrv.replace(n.elementPath,e.scopedVars),variable:""}],attributes:(0,C.map)(n.attributes,(function(n){var a;return t.templateSrv.replace((null===(a=n.value)||void 0===a?void 0:a.value)||n,e.scopedVars)})),segments:(0,C.map)(n.segments,(function(n){var a;return t.templateSrv.replace(null===(a=n.value)||void 0===a?void 0:a.value,e.scopedVars)})),display:n.display,refId:n.refId,hide:n.hide,interpolate:n.interpolate||{enable:!1},recordedValues:n.recordedValues||{enable:!1},digitalStates:n.digitalStates||{enable:!1},webid:n.webid,webids:n.webids||[],regex:n.regex||{enable:!1},expression:n.expression||"",summary:n.summary||{types:[]},startTime:e.range.from,endTime:e.range.to,isPiPoint:n.isPiPoint,scopedVars:e.scopedVars};r.expression&&(r.expression=t.templateSrv.replace(r.expression,e.scopedVars)),void 0!==r.summary.types&&(r.summary.types=(0,C.filter)(r.summary.types,(function(e){return null!=e&&""!==e})));var i=(0,C.keys)(e.scopedVars);return t.templateSrv.getVariables().forEach((function(e){if(a.isAllSelected(e.current)&&i.indexOf(e.name)<0){var t=e.options.filter((function(e){return!e.selected}));r.attributes=r.attributes.map((function(n){return t.map((function(t){return e.allValue?n.replace(e.allValue,t.value):n.replace(/{[a-zA-z0-9,-_]+}/gi,t.value)}))})),r.attributes=(0,C.uniq)((0,C.flatten)(r.attributes)),r.elementPathArray=a.getElementPath(r.elementPathArray,t,e.allValue)}else if(Array.isArray(e.current.text)&&i.indexOf(e.name)<0){var n=e.options.filter((function(e){return e.selected})),o=e.current.value.join(",");r.attributes=r.attributes.map((function(e){return n.map((function(t){return e.replace("{".concat(o,"}"),t.value)}))})),r.attributes=(0,C.uniq)((0,C.flatten)(r.attributes)),r.elementPathArray=a.getElementPath(r.elementPathArray,n,"{".concat(o,"}"))}})),r})),e}},{key:"query",value:(i=te().mark((function t(n){var a,r;return te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=this,(r=this.buildQueryParameters(n)).targets=(0,C.filter)(r.targets,(function(e){return!e.hide})),!(r.targets.length<=0)){t.next=7;break}return t.abrupt("return",Promise.resolve({data:[]}));case 7:return t.abrupt("return",Promise.all(a.getStream(r)).then((function(t){var n=[];return(0,C.each)(t,(function(e){(0,C.each)(e,(function(e){return n.push(e)}))})),{data:n.sort((function(e,t){return+(e.target>t.target)||+(e.target===t.target)-1})).map((function(t){return(0,e.toDataFrame)(t)}))}})));case 8:case"end":return t.stop()}}),t,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,a){var r=i.apply(e,t);function o(e){ne(r,n,a,o,l,"next",e)}function l(e){ne(r,n,a,o,l,"throw",e)}o(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"testDatasource",value:function(){return this.backendSrv.datasourceRequest({url:this.url+"/",method:"GET"}).then((function(e){if(200===e.status)return{status:"success",message:"Data source is working",title:"Success"};throw new Error("Failed")}))}},{key:"annotationQuery",value:function(e){var t=this;if(!this.afdatabase.webid)return Promise.resolve([]);var n=e.annotation.query.categoryName?this.templateSrv.replace(e.annotation.query.categoryName,e.scopedVars,"glob"):null,a=e.annotation.query.nameFilter?this.templateSrv.replace(e.annotation.query.nameFilter,e.scopedVars,"glob"):null,r=e.annotation.template?e.annotation.template.Name:null,i={name:e.annotation.name,datasource:e.annotation.datasource,enable:e.annotation.enable,iconColor:e.annotation.iconColor,showEndTime:e.annotation.showEndTime,regex:e.annotation.regex,attribute:e.annotation.attribute,categoryName:n,templateName:r,nameFilter:a},o=[];if(i.categoryName&&o.push("categoryName="+i.categoryName),i.nameFilter&&o.push("nameFilter="+i.nameFilter),i.templateName&&o.push("templateName="+i.templateName),!o.length)return Promise.resolve([]);if(o.push("startTime="+e.range.from.toJSON()),o.push("endTime="+e.range.to.toJSON()),i.attribute&&i.attribute.enable){var l=this.piwebapiurl+"/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name";i.attribute.name&&(l=this.piwebapiurl+"/streamsets/{0}/value?nameFilter="+i.attribute.name+"&selectedFields=Items.WebId%3BItems.Value%3BItems.Name");var u={};return u[1]={Method:"GET",Resource:this.piwebapiurl+"/assetdatabases/"+this.afdatabase.webid+"/eventframes?"+o.join("&")},u[2]={Method:"GET",RequestTemplate:{Resource:l},Parameters:["$.1.Content.Items[*].WebId"],ParentIds:["1"]},this.restBatch(u).then((function(n){var a=n.data[1].Content,r=n.data[2].Content,o=(0,C.map)(a.Items,(function(e,n){return(0,C.curry)(t.eventFrameToAnnotation)(i,!1,e,r.Items[n].Content.Items)}));if(e.annotation.showEndTime){var l=(0,C.map)(a.Items,(function(e,n){return(0,C.curry)(t.eventFrameToAnnotation)(i,!0,e,r.Items[n].Content.Items)}));(0,C.each)(l,(function(e){o.push(e)}))}return o}))}return this.restGet("/assetdatabases/"+this.afdatabase.webid+"/eventframes?"+o.join("&")).then((function(n){var a=(0,C.map)(n.data.Items,(0,C.curry)(t.eventFrameToAnnotation)(i,!1));if(e.annotation.showEndTime){var r=(0,C.map)(n.data.Items,(0,C.curry)(t.eventFrameToAnnotation)(i,!0));(0,C.each)(r,(function(e){a.push(e)}))}return a}))}},{key:"metricQueryTransform",value:function(e){return(0,C.map)(e,(function(e){var t,n;return{text:e.Name,expandable:void 0===e.HasChildren||!0===e.HasChildren||(null!==(t=e.Path)&&void 0!==t?t:"").split("\\").length<=3,HasChildren:e.HasChildren,Items:null!==(n=e.Items)&&void 0!==n?n:[],Path:e.Path,WebId:e.WebId}}))}},{key:"metricFindQuery",value:function(e,t){var n,a,r=this,i=["servers","databases","databaseElements","elements"];return"string"==typeof e&&(e=JSON.parse(e)),t.isPiPoint?e.path=this.templateSrv.replace(e.path,t):(""===e.path?e.type=i[0]:"attributes"!==e.type&&(e.type=i[Math.max(0,Math.min(e.path.split("\\").length,i.length-1))]),e.path=this.templateSrv.replace(e.path,t),e.path=e.path.replace(/\{([^\\])*\}/gi,(function(e){return e.substring(1,e.length-2).split(",")[0]}))),e.filter=null!==(n=e.filter)&&void 0!==n?n:"*","servers"===e.type?null!==(a=r.afserver)&&void 0!==a&&a.name?r.getAssetServer(r.afserver.name).then((function(e){return[e]})).then(r.metricQueryTransform):r.getAssetServers().then(r.metricQueryTransform):"databases"===e.type?r.getAssetServer(e.path).then((function(e){var t;return r.getDatabases(null!==(t=e.WebId)&&void 0!==t?t:"",{})})).then(r.metricQueryTransform):"databaseElements"===e.type?r.getDatabase(e.path).then((function(e){var t;return r.getDatabaseElements(null!==(t=e.WebId)&&void 0!==t?t:"",{selectedFields:"Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren"})})).then(r.metricQueryTransform):"elements"===e.type?r.getElement(e.path).then((function(t){var n;return r.getElements(null!==(n=t.WebId)&&void 0!==n?n:"",{selectedFields:"Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren",nameFilter:e.filter})})).then(r.metricQueryTransform):"attributes"===e.type?r.getElement(e.path).then((function(t){var n;return r.getAttributes(null!==(n=t.WebId)&&void 0!==n?n:"",{searchFullHierarchy:"true",selectedFields:"Items.WebId%3BItems.Name%3BItems.Path",nameFilter:e.filter})})).then(r.metricQueryTransform):"dataserver"===e.type?r.getDataServers().then(r.metricQueryTransform):"pipoint"===e.type?r.piPointSearch(e.webId,e.pointName).then(r.metricQueryTransform):Promise.reject("Bad type")}},{key:"getSummaryUrl",value:function(e){return""===e.interval.trim()?"&summaryType="+e.types.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).join("&summaryType=")+"&calculationBasis="+e.basis:"&summaryType="+e.types.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).join("&summaryType=")+"&calculationBasis="+e.basis+"&summaryDuration="+e.interval.trim()}},{key:"parsePiPointValueList",value:function(e,t,n){var a=this,r=this,i=[];return(0,C.each)(e,(function(e){var o=a.noDataReplace(n?e.Value:e,t.summary.nodata,r.parsePiPointValue(n?e.Value:e,t,n)),l=o.grafanaDataPoint;o.previousValue,o.drop||i.push(l)})),i}},{key:"parsePiPointValue",value:function(e,t,n){var a,r,i,o,l=n||"object"!==ee(e.Value)?e.Value:null===(a=e.Value)||void 0===a?void 0:a.Value;return!e.Good||null!==(r=t.digitalStates)&&void 0!==r&&r.enable?(l=null!==(i=n||"object"!==ee(e.Value)?e.Name:null===(o=e.Value)||void 0===o?void 0:o.Name)&&void 0!==i?i:"",[this.checkNumber(l)?Number(l):l.trim(),new Date(e.Timestamp).getTime()]):[this.checkNumber(l)?Number(l):l.trim(),new Date(e.Timestamp).getTime()]}},{key:"noDataReplace",value:function(e,t,n){var a,r,i=null,o=!1;return!e.Good||"No Data"===e.Value||null!==(a=e.Value)&&void 0!==a&&a.Name&&"No Data"===(null===(r=e.Value)||void 0===r?void 0:r.Name)?"Drop"===t?o=!0:"0"===t?n[0]=0:"Keep"===t||("Null"===t?n[0]=null:"Previous"===t&&null!==i&&(n[0]=i)):i=e.Value,{grafanaDataPoint:n,previousValue:i,drop:o}}},{key:"processResults",value:function(e,t,n,a){var r=this,i=t.summary&&t.summary.types&&t.summary.types.length>0;if(n=a?n:this.getPath(t.elementPathArray,e.Path)+"|"+n,t.regex&&t.regex.enable&&t.regex.search.length&&t.regex.replace.length&&(n=n.replace(new RegExp(t.regex.search),t.regex.replace)),i){var o=[],l=(0,C.groupBy)(e.Items,(function(e){return e.Type}));return(0,C.forOwn)(l,(function(e,a){o.push({refId:t.refId,target:n+"["+a+"]",datapoints:r.parsePiPointValueList(e,t,i)})})),o}return[{refId:t.refId,target:n,datapoints:r.parsePiPointValueList(e.Items,t,i)}]}},{key:"isAllSelected",value:function(e){return!!e&&(Array.isArray(e.text)?e.text.indexOf("All")>=0:"All"===e.text)}},{key:"checkNumber",value:function(e){return"number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)}},{key:"getElementPath",value:function(e,t,n){var a=[];return e.forEach((function(e){if(n&&e.path.indexOf(n)>=0||!n&&e.path.match(/{[a-zA-z0-9,-_]+}/gi)){var r=t.map((function(t){return{path:n?e.path.replace(n,t.value):e.path.replace(/{[a-zA-z0-9,-_]+}/gi,t.value),variable:t.value}}));a=a.concat(r)}})),a.length?(0,C.uniq)((0,C.flatten)(a)):e}},{key:"getPath",value:function(e,t){var n,a,r=t.split("|");if(0===r.length)return"";if(0===e.length)return"";var i=0===(r=r[0].split("\\")).length?"":null!==(n=r.pop())&&void 0!==n?n:"",o=null===(a=e.find((function(e){return t.indexOf(e.path)>=0})))||void 0===a?void 0:a.variable;return o?o+"|"+i:i}},{key:"getStream",value:function(e){var t=this,n=this,a=[];return(0,C.each)(e.targets,(function(r){r.attributes=(0,C.filter)(r.attributes||[],(function(e){return e}));var i="",o=r.summary&&r.summary.types&&r.summary.types.length>0,l=r.interpolate&&r.interpolate.enable,u=r.interpolate.interval?r.interpolate.interval:e.interval,s="?startTime="+e.range.from.toJSON()+"&endTime="+e.range.to.toJSON(),c=r.expression||r.elementPath,m=r.display?t.templateSrv.replace(r.display,e.scopedVars):null;if(r.expression)i+="/calculation",i+=o?"/summary"+s+(l?"&sampleType=Interval&sampleInterval="+u:""):"/intervals"+s+"&sampleInterval="+u,i+="&expression="+encodeURIComponent(r.expression),r.attributes.length>0?a.push(n.internalStream(e,r,i)):a.push(n.restGetWebId(r.elementPath,r.isPiPoint).then((function(e){return n.restPost(i+e.WebId).then((function(e){return n.processResults(e.data,r,m||c,!1)})).catch((function(e){return n.error=e}))})));else{if(i+="/streamsets",o)i+="/summary"+s+"&intervals="+e.maxDataPoints+t.getSummaryUrl(r.summary);else if(r.interpolate&&r.interpolate.enable)i+="/interpolated"+s+"&interval="+u;else if(r.recordedValues&&r.recordedValues.enable){var h=r.recordedValues.maxNumber&&!isNaN(r.recordedValues.maxNumber)?r.recordedValues.maxNumber:1e3;i+="/recorded"+s+"&maxCount="+h}else i+="/plot"+s+"&intervals="+e.maxDataPoints;a.push(n.internalStream(e,r,i))}})),a}},{key:"internalStream",value:function(e,t,n){var a=this,r=t.expression||t.elementPath,i=t.display?this.templateSrv.replace(t.display,e.scopedVars):null,o=1===t.elementPathArray.length&&t.elementPath===t.elementPathArray[0].path;return(o?t.attributes.length>1?a.restGetWebId(t.elementPath,t.isPiPoint).then((function(e){return a.getAttributes(e.WebId,{searchFullHierarchy:"true",nameFilter:"*"})})).then((function(e){return e.filter((function(e){var n;return t.attributes.indexOf(e.Name)>=0||t.attributes.indexOf(null===(n=e.Path)||void 0===n?void 0:n.split("|").splice(1).join("|"))>=0}))})):Promise.all((0,C.map)(t.attributes,(function(e){return a.restGetWebId(t.elementPath+"|"+e,t.isPiPoint)}))):t.attributes.length>1?Promise.all(t.elementPathArray.map((function(e){return a.restGetWebId(e.path,t.isPiPoint).then((function(e){return a.getAttributes(e.WebId,{searchFullHierarchy:"true",nameFilter:"*"})})).then((function(e){return e.filter((function(e){var n;return t.attributes.indexOf(e.Name)>=0||t.attributes.indexOf(null===(n=e.Path)||void 0===n?void 0:n.split("|").splice(1).join("|"))>=0}))}))}))):Promise.all((0,C.flatten)((0,C.map)(t.attributes,(function(e){return t.elementPathArray.map((function(n){return a.restGetWebId(n.path+"|"+e,t.isPiPoint)}))}))))).then((function(e){var l={};return(0,C.each)((0,C.flatten)(e),(function(e,t){l[t+1]={Method:"GET",Resource:a.piwebapiurl+n+"&webid="+e.WebId}})),a.restBatch(l).then((function(n){var l=[];return(0,C.each)(n.data,(function(n,u){if(t.expression){var s=e[parseInt(u,10)-1].Name;(0,C.each)(a.processResults(n.Content,t,i||s||r,o),(function(e){return l.push(e)}))}else(0,C.each)(n.Content.Items,(function(e){(0,C.each)(a.processResults(e,t,i||e.Name||r,o),(function(e){return l.push(e)}))}))})),l})).catch((function(e){return a.error=e}))}))}},{key:"restGet",value:function(e){return this.backendSrv.datasourceRequest({url:this.url+e,method:"GET",headers:{"Content-Type":"application/json"}}).then((function(e){return e}))}},{key:"restGetWebId",value:function(e,t){var n=this,a=n.webidCache.get(e);if(a)return Promise.resolve({Path:e,WebId:a.WebId,Name:a.Name});var r="";return r=t?"/points?selectedFields=WebId%3BName%3BPath&path=\\\\"+e.replace("|","\\"):(e.indexOf("|")>=0?"/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\":"/elements?selectedFields=WebId%3BName%3BPath&path=\\\\")+e,this.backendSrv.datasourceRequest({url:this.url+r,method:"GET",headers:{"Content-Type":"application/json"}}).then((function(t){return n.webidCache.set(e,t.data),{Path:e,WebId:t.data.WebId,Name:t.data.Name}}))}},{key:"restBatch",value:function(e){return this.backendSrv.datasourceRequest({url:this.url+"/batch",data:e,method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"message/http"}})}},{key:"restPost",value:function(e){return this.backendSrv.datasourceRequest({url:this.url,method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"message/http","X-PIWEBAPI-HTTP-METHOD":"GET","X-PIWEBAPI-RESOURCE-ADDRESS":e}})}},{key:"getDataServers",value:function(){return this.restGet("/dataservers").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getDataServer",value:function(e){return e?this.restGet("/dataservers?name="+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getAssetServers",value:function(){return this.restGet("/assetservers").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getAssetServer",value:function(e){return e?this.restGet("/assetservers?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getDatabase",value:function(e){return e?this.restGet("/assetdatabases?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getDatabases",value:function(e,t){return e?this.restGet("/assetservers/"+e+"/assetdatabases").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]})):Promise.resolve([])}},{key:"getElement",value:function(e){return e?this.restGet("/elements?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getEventFrameTemplates",value:function(e){return e?this.restGet("/assetdatabases/"+e+"/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId").then((function(e){var t;return(0,C.filter)(null!==(t=e.data.Items)&&void 0!==t?t:[],(function(e){return"EventFrame"===e.InstanceType}))})):Promise.resolve([])}},{key:"getElementTemplates",value:function(e){return e?this.restGet("/assetdatabases/"+e+"/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId").then((function(e){var t;return(0,C.filter)(null!==(t=e.data.Items)&&void 0!==t?t:[],(function(e){return"Element"===e.InstanceType}))})):Promise.resolve([])}},{key:"getAttributes",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/elements/"+e+"/attributes"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getDatabaseElements",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/assetdatabases/"+e+"/elements"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getElements",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/elements/"+e+"/elements"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"piPointSearch",value:function(e,t){var n=this.templateSrv.replace(t),a="".concat(n),r=!1;if(n!==t)for(var i,o=/\{(\w|,)+\}/g;null!==(i=o.exec(n));)i.index===o.lastIndex&&o.lastIndex++,i.forEach((function(e,t){0===t&&(n=n.replace(e,e.replace("{","(").replace("}",")").replace(",","|")),a=a.replace(e,"*"),r=!0)}));return this.restGet("/dataservers/"+e+"/points?maxCount=20&nameFilter="+a).then((function(e){var t;return e&&null!==(t=e.data)&&void 0!==t&&t.Items?r?e.data.Items.filter((function(e){var t;return null===(t=e.Name)||void 0===t?void 0:t.match(n)})):e.data.Items:[]}))}},{key:"getWebId",value:function(e){var t=this,n=e.target.indexOf("\\")>=0,a=e.target.indexOf("|")>=0;return n||-1!==e.target.indexOf(".")?n?n&&a?t.restGet("/attributes?path=\\\\"+e.target).then((function(t){return void 0===t.data||200!==t.status?[{WebId:e.target,Name:e.display||e.target}]:(t.data.Name=e.display||t.data.Name,[t.data])})):t.restGet("/elements?path=\\\\"+e.target).then((function(t){return void 0===t.data||200!==t.status?[{WebId:e.target,Name:e.display||e.target}]:(t.data.Name=e.display||t.data.Name,[t.data])})):t.piPointSearch(this.piserver.webid,e.target).then((function(t){return void 0===t||0===t.length?[{WebId:e.target,Name:e.display||e.target}]:t})):Promise.resolve([{WebId:e.target,Name:e.display||e.target}])}}],a&&ae(n.prototype,a),r&&ae(n,r),Object.defineProperty(n,"prototype",{writable:!1}),u}(e.DataSourceApi),me=new e.DataSourcePlugin(ce).setConfigEditor(I).setQueryEditor(K).setAnnotationQueryCtrl(a)})(),u})())); //# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/dist/module.js.map b/dist/module.js.map index 8641b24..b8b375d 100644 --- a/dist/module.js.map +++ b/dist/module.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"lodash\"","webpack:///external \"@grafana/ui\"","webpack:///external \"@grafana/data\"","webpack:///external \"@grafana/runtime\"","webpack:///./AnnotationsQueryCtrl.ts","webpack:///./ConfigEditor.tsx","webpack:///../node_modules/tslib/tslib.es6.js","webpack:///./components/Forms.tsx","webpack:///./types.ts","webpack:///./components/QueryEditorModeSwitcher.tsx","webpack:///./QueryEditor.tsx","webpack:///./datasource.ts","webpack:///./module.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__WEBPACK_EXTERNAL_MODULE__0__","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__3__","__WEBPACK_EXTERNAL_MODULE__4__","AnnotationsQueryCtrl","$scope","this","annotation","ctrl","datasource","query","databases","templates","regex","attribute","showEndTime","getAssetServer","afserver","then","result","getDatabases","WebId","getEventFrames","webid","dbs","$apply","getEventFrameTemplates","database","templateUrl","FormField","coerceOptions","options","jsonData","url","onPIServerChange","event","props","onOptionsChange","piserver","target","onAFServerChange","onAFDatabaseChange","afdatabase","onMyOptionsChange","originalOptions","defaultUrl","dataSourceConfig","onChange","showAccessOptions","className","label","labelWidth","inputWidth","placeholder","__rest","e","indexOf","getOwnPropertySymbols","length","propertyIsEnumerable","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","done","apply","tooltip","children","width","defaultQuery","attributes","segments","enable","summary","types","basis","interval","nodata","expression","interpolate","recordedValues","digitalStates","isPiPoint","isRaw","isModalOpen","setModalOpen","icon","variant","type","onClick","isOpen","title","body","confirmText","dismissText","onConfirm","onDismiss","piServer","availableAttributes","state","summaries","attributeSegment","summarySegment","calculationBasisSegment","noDataReplacementSegment","segmentChangeValue","setState","attributeChangeValue","onPiPointChange","item","index","slice","checkPiPointSegments","onAttributeChange","checkAttributeSegments","onSegmentChange","push","expandable","getElementSegments","currentSegment","data","findQuery","path","getSegmentPathUpTo","metricFindQuery","assign","request","scopedVars","items","altSegments","text","webId","variables","templateSrv","getVariables","variable","selectableValue","unshift","err","error","message","getAttributeSegmentsPI","attributeText","getSelectedPIServer","pointName","Path","getAttributeSegmentsAF","val","buildFromTarget","segmentsArray","attributesArray","splitAttributes","split","splitElements","splice","_","elements","checkAfServer","updateArray","summariesArray","cb","scopedVarsDone","componentDidMount","initialLoad","componentDidUpdate","force","metricsQuery","_segmentsArray","onRunQuery","rawQuery","elementPath","join","map","stateCallback","onIsPiPointChange","queryChange","calcBasisValueChanged","calcNoDataValueChanged","onSummaryAction","onSummaryValueChanged","onAttributeAction","summaryTypes","calculationBasis","noDataReplacement","segment","isValueEmpty","part","arr","startsWith","attributesResponse","validAttributes","substring","filteredAttributes","attrib","changedValue","replace","undefined","webID","forEach","parts","match","queryProps","display","grow","onBlur","textEditorChanged","Component","loadOptions","allowCustomValue","inputMinWidth","disabled","reloadOptionsOnChange","maxNumber","parseInt","getNoDataSegments","getCalcBasisSegments","getSummarySegments","LABEL_WIDTH","search","instanceSettings","isProxy","webidCache","Map","basicAuth","withCredentials","backendSrv","piwebapiurl","toString","test","access","all","getDataServer","getDatabase","annotationOptions","endTime","eventFrame","attributeDataItems","Name","RegExp","attributeData","attributeValue","Value","time","Date","EndTime","StartTime","getTime","targets","ds","tar","elementPathArray","att","refId","hide","webids","startTime","range","from","to","varsKeys","v","isAllSelected","current","filter","selected","attr","vv","allValue","getElementPath","Array","isArray","buildQueryParameters","getStream","targetResponses","flattened","tr","sort","a","b","datasourceRequest","method","response","status","Error","categoryName","nameFilter","templateName","template","iconColor","toJSON","resourceUrl","Method","Resource","RequestTemplate","Parameters","ParentIds","restBatch","Content","valueData","annotations","Items","eventFrameToAnnotation","ends","end","restGet","HasChildren","queryOptions","querydepth","JSON","parse","Math","max","min","metricQueryTransform","getAssetServers","server","db","getDatabaseElements","selectedFields","getElement","element","getElements","getAttributes","searchFullHierarchy","getDataServers","piPointSearch","trim","isSummary","api","datapoints","noDataReplace","parsePiPointValue","grafanaDataPoint","previousValue","drop","num","Good","Timestamp","checkNumber","Number","noDataReplacementMode","content","noTemplate","getPath","innerResults","groups","Type","parsePiPointValueList","number","isNaN","isFinite","newElementPathArray","elem","temp","concat","splitPath","splitStr","pop","foundElement","find","results","isInterpolated","intervalTime","timeRange","targetName","displayName","encodeURIComponent","internalStream","restGetWebId","webidresponse","restPost","processResults","maxDataPoints","getSummaryUrl","datarsp","datarspa","targetResults","targetResult","headers","assetPath","cachedWebId","set","batch","serverId","databaseId","InstanceType","elementId","querystring","filter1","filter2","doFilter","exec","lastIndex","groupIndex","isAf","isAttribute","setConfigEditor","setQueryEditor","setAnnotationQueryCtrl"],"mappings":";mHACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD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R,EAAOA,QAAQrB,MAAK,SAAC8V,GAC/D,YAAqBpK,IAAjBoK,EAAQhP,MAAyC,MAAnBgP,EAAQ9E,OACjC,CAAC,CAAE7Q,MAAOkB,EAAOA,OAAQ8M,KAAM9M,EAAO2K,SAAW3K,EAAOA,UAGjEyU,EAAQhP,KAAKqH,KAAO9M,EAAO2K,SAAW8J,EAAQhP,KAAKqH,KAC5C,CAAC2H,EAAQhP,UAvBX1H,KA2BGkT,QAAQ,sBAAwBjR,EAAOA,QAAQrB,MAAK,SAAC8V,GAC7D,YAAqBpK,IAAjBoK,EAAQhP,MAAyC,MAAnBgP,EAAQ9E,OACjC,CAAC,CAAE7Q,MAAOkB,EAAOA,OAAQ8M,KAAM9M,EAAO2K,SAAW3K,EAAOA,UAGjEyU,EAAQhP,KAAKqH,KAAO9M,EAAO2K,SAAW8J,EAAQhP,KAAKqH,KAC5C,CAAC2H,EAAQhP,UAjCX1H,KASGuU,cAAcvU,KAAKgC,SAASf,MAAQgB,EAAOA,QAAQrB,MAAK,SAAC8V,GACjE,YAAgBpK,IAAZoK,GAA4C,IAAnBA,EAAQtT,OAC5B,CAAC,CAAErC,MAAOkB,EAAOA,OAAQ8M,KAAM9M,EAAO2K,SAAW3K,EAAOA,SAE1DyU,KATF/S,QAAQC,QAAQ,CAAC,CAAE7C,MAAOkB,EAAOA,OAAQ8M,KAAM9M,EAAO2K,SAAW3K,EAAOA,e,8EAzpCrF,GAAwC,iBC9CxC,uCAOO,IAAM,EAAS,IAAI,mBACxB,GAEC6W,gBAAgB,GAChBC,eAAe,GACfC,uBAAuBlZ","file":"module.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","module.exports = __WEBPACK_EXTERNAL_MODULE__4__;","export class AnnotationsQueryCtrl {\r\n static templateUrl = 'partials/annotations.editor.html';\r\n\r\n $scope: any;\r\n annotation: any;\r\n datasource: any;\r\n\r\n /** @ngInject */\r\n constructor($scope: any) {\r\n this.$scope = $scope;\r\n this.annotation = $scope.ctrl.annotation;\r\n this.datasource = $scope.ctrl.datasource;\r\n\r\n // load defaults\r\n this.annotation.query = this.annotation.query || {};\r\n this.annotation.databases = this.annotation.databases || [];\r\n this.annotation.templates = this.annotation.templates || [];\r\n this.annotation.regex = this.annotation.regex || {};\r\n this.annotation.attribute = this.annotation.attribute || {};\r\n this.annotation.showEndTime = this.annotation.showEndTime || false;\r\n\r\n this.datasource.getAssetServer(this.datasource.afserver.name).then((result: any) => {\r\n return this.getDatabases(result.WebId);\r\n });\r\n }\r\n templateChanged() {\r\n // do nothing\r\n }\r\n databaseChanged() {\r\n this.annotation.templates = [];\r\n this.getEventFrames();\r\n }\r\n getDatabases(webid: string) {\r\n var ctrl = this;\r\n ctrl.datasource.getDatabases(webid).then((dbs: any) => {\r\n ctrl.annotation.databases = dbs;\r\n this.$scope.$apply();\r\n });\r\n }\r\n getEventFrames() {\r\n var ctrl = this;\r\n ctrl.datasource.getEventFrameTemplates(this.annotation.database.WebId).then((templates: any) => {\r\n ctrl.annotation.templates = templates;\r\n this.$scope.$apply();\r\n });\r\n }\r\n}\r\n","import React, { ChangeEvent, PureComponent } from 'react';\r\nimport { LegacyForms, DataSourceHttpSettings } from '@grafana/ui';\r\nimport { DataSourcePluginOptionsEditorProps, DataSourceJsonData, DataSourceSettings } from '@grafana/data';\r\nimport { PIWebAPIDataSourceJsonData } from './types';\r\n\r\nconst { FormField } = LegacyForms;\r\n\r\ninterface Props extends DataSourcePluginOptionsEditorProps {}\r\n\r\nconst coerceOptions = (\r\n options: DataSourceSettings\r\n): DataSourceSettings => {\r\n return {\r\n ...options,\r\n jsonData: {\r\n ...options.jsonData,\r\n url: options.url,\r\n },\r\n };\r\n};\r\n\r\ninterface State {}\r\n\r\nexport class PIWebAPIConfigEditor extends PureComponent {\r\n onPIServerChange = (event: ChangeEvent) => {\r\n const { onOptionsChange, options } = this.props;\r\n const jsonData = {\r\n ...options.jsonData,\r\n piserver: event.target.value,\r\n };\r\n onOptionsChange({ ...options, jsonData });\r\n };\r\n\r\n onAFServerChange = (event: ChangeEvent) => {\r\n const { onOptionsChange, options } = this.props;\r\n const jsonData = {\r\n ...options.jsonData,\r\n afserver: event.target.value,\r\n };\r\n onOptionsChange({ ...options, jsonData });\r\n };\r\n\r\n onAFDatabaseChange = (event: ChangeEvent) => {\r\n const { onOptionsChange, options } = this.props;\r\n const jsonData = {\r\n ...options.jsonData,\r\n afdatabase: event.target.value,\r\n };\r\n onOptionsChange({ ...options, jsonData });\r\n };\r\n\r\n onMyOptionsChange = (options: DataSourceSettings) => {\r\n const { onOptionsChange } = this.props;\r\n onOptionsChange(coerceOptions(options));\r\n };\r\n\r\n render() {\r\n const { options: originalOptions } = this.props;\r\n const options = coerceOptions(originalOptions);\r\n\r\n return (\r\n
\r\n \r\n\r\n

PI/AF Connection Details

\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n );\r\n }\r\n}\r\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import React, { InputHTMLAttributes, FunctionComponent } from 'react';\r\nimport { InlineFormLabel } from '@grafana/ui';\r\n\r\nexport interface Props extends InputHTMLAttributes {\r\n label: string;\r\n tooltip?: string;\r\n labelWidth?: number;\r\n children?: React.ReactNode;\r\n queryEditor?: JSX.Element;\r\n}\r\n\r\nexport const QueryField: FunctionComponent> = ({ label, labelWidth = 12, tooltip, children }) => (\r\n <>\r\n \r\n {label}\r\n \r\n {children}\r\n \r\n);\r\n\r\nexport const QueryRowTerminator = () => {\r\n return (\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport const QueryInlineField = ({ ...props }) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport const QueryEditorRow = (props: Partial) => {\r\n return (\r\n
\r\n {props.children}\r\n \r\n
\r\n );\r\n};\r\n\r\nexport const QueryRawInlineField = ({ ...props }) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport const QueryRawEditorRow = (props: Partial) => {\r\n return <>{props.children};\r\n};\r\n","import { DataQuery, DataSourceJsonData } from '@grafana/data';\r\n\r\nexport interface PIWebAPISelectableValue {\r\n webId?: string;\r\n value?: string;\r\n type?: string;\r\n expandable?: boolean;\r\n}\r\n\r\nexport interface PIWebAPIAnnotationsQuery extends DataQuery {\r\n target: string;\r\n}\r\n\r\nexport interface PIWebAPIQuery extends DataQuery {\r\n target: string;\r\n elementPath: string;\r\n attributes: any[];\r\n segments: any[];\r\n display: any;\r\n interpolate: any;\r\n recordedValues: any;\r\n digitalStates: any;\r\n webid: string;\r\n webids: string[];\r\n regex: any;\r\n summary: any;\r\n expression: string;\r\n isPiPoint: boolean;\r\n rawQuery?: boolean;\r\n query?: string;\r\n}\r\n\r\nexport const defaultQuery: Partial = {\r\n target: ';',\r\n attributes: [],\r\n segments: [],\r\n regex: { enable: false },\r\n summary: { types: [], basis: 'EventWeighted', interval: '', nodata: 'Null' },\r\n expression: '',\r\n interpolate: { enable: false },\r\n recordedValues: { enable: false },\r\n digitalStates: { enable: false },\r\n isPiPoint: false,\r\n};\r\n\r\n/**\r\n * These are options configured for each DataSource instance\r\n */\r\nexport interface PIWebAPIDataSourceJsonData extends DataSourceJsonData {\r\n url?: string;\r\n access?: string;\r\n piserver?: string;\r\n afserver?: string;\r\n afdatabase?: string;\r\n}\r\n\r\n/**\r\n * Value that is used in the backend, but never sent over HTTP to the frontend\r\n */\r\nexport interface PIWebAPISecureJsonData {\r\n apiKey?: string;\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport { Button, ConfirmModal } from '@grafana/ui';\r\n\r\ntype Props = {\r\n isRaw: boolean;\r\n onChange: (newIsRaw: boolean) => void;\r\n};\r\n\r\nexport const QueryEditorModeSwitcher = ({ isRaw, onChange }: Props): JSX.Element => {\r\n const [isModalOpen, setModalOpen] = useState(false);\r\n\r\n useEffect(() => {\r\n // if the isRaw changes, we hide the modal\r\n setModalOpen(false);\r\n }, [isRaw]);\r\n\r\n if (isRaw) {\r\n return (\r\n <>\r\n {\r\n // we show the are-you-sure modal\r\n setModalOpen(true);\r\n }}\r\n >\r\n {\r\n onChange(false);\r\n }}\r\n onDismiss={() => {\r\n setModalOpen(false);\r\n }}\r\n />\r\n \r\n );\r\n } else {\r\n return (\r\n {\r\n onChange(true);\r\n }}\r\n >\r\n );\r\n }\r\n};\r\n","import { each, filter, forOwn, join, reduce, map, slice, remove, defaults } from 'lodash';\r\n\r\nimport React, { PureComponent, ChangeEvent } from 'react';\r\nimport { Icon, InlineField, InlineFieldRow, InlineSwitch, Input, SegmentAsync, Segment } from '@grafana/ui';\r\nimport { QueryEditorProps, SelectableValue, VariableModel } from '@grafana/data';\r\n\r\nimport { PiWebAPIDatasource } from './datasource';\r\nimport { QueryInlineField, QueryRawInlineField, QueryRowTerminator } from './components/Forms';\r\nimport { PIWebAPISelectableValue, PIWebAPIDataSourceJsonData, PIWebAPIQuery, defaultQuery } from './types';\r\nimport { QueryEditorModeSwitcher } from 'components/QueryEditorModeSwitcher';\r\n\r\nconst LABEL_WIDTH = 24;\r\nconst MIN_ELEM_INPUT_WIDTH = 200;\r\nconst MIN_ATTR_INPUT_WIDTH = 250;\r\n\r\ninterface State {\r\n isPiPoint: boolean;\r\n segments: Array>;\r\n attributes: Array>;\r\n summaries: Array>;\r\n attributeSegment: SelectableValue;\r\n summarySegment: SelectableValue;\r\n calculationBasisSegment: SelectableValue;\r\n noDataReplacementSegment: SelectableValue;\r\n}\r\n\r\ntype Props = QueryEditorProps;\r\n\r\nconst REMOVE_LABEL = '-REMOVE-';\r\n\r\nconst CustomLabelComponent = (props: any) => {\r\n if (props.value) {\r\n return (\r\n
\r\n {props.label ?? '--no label--'}\r\n
\r\n );\r\n }\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport class PIWebAPIQueryEditor extends PureComponent {\r\n error: any;\r\n piServer: any[] = [];\r\n availableAttributes: any = {};\r\n summaryTypes: string[];\r\n calculationBasis: string[];\r\n noDataReplacement: string[];\r\n state: State = {\r\n isPiPoint: false,\r\n segments: [],\r\n attributes: [],\r\n summaries: [],\r\n attributeSegment: {},\r\n summarySegment: {},\r\n calculationBasisSegment: {},\r\n noDataReplacementSegment: {},\r\n };\r\n\r\n constructor(props: any) {\r\n super(props);\r\n this.onSegmentChange = this.onSegmentChange.bind(this);\r\n this.calcBasisValueChanged = this.calcBasisValueChanged.bind(this);\r\n this.calcNoDataValueChanged = this.calcNoDataValueChanged.bind(this);\r\n this.onSummaryAction = this.onSummaryAction.bind(this);\r\n this.onSummaryValueChanged = this.onSummaryValueChanged.bind(this);\r\n this.onAttributeAction = this.onAttributeAction.bind(this);\r\n this.onAttributeChange = this.onAttributeChange.bind(this);\r\n\r\n this.summaryTypes = [\r\n // 'None', // A summary type is not specified.\r\n 'Total', // A totalization over the time range.\r\n 'Average', // The average value over the time range.\r\n 'Minimum', // The minimum value over the time range.\r\n 'Maximum', // The maximum value over the time range.\r\n 'Range', // The range value over the time range (minimum-maximum).\r\n 'StdDev', // The standard deviation over the time range.\r\n 'PopulationStdDev', // The population standard deviation over the time range.\r\n 'Count', // The sum of event count over the time range when calculation basis is event weighted. The sum of event time duration over the time range when calculation basis is time weighted.\r\n 'PercentGood', // Percent of data with good value during the calculation period. For time weighted calculations, the percentage is based on time. For event weighted calculations, the percent is based on event count.\r\n 'All', // A convenience for requesting all available summary calculations.\r\n 'AllForNonNumeric', // A convenience for requesting all available summary calculations for non-numeric data.\r\n ];\r\n\r\n this.calculationBasis = [\r\n 'TimeWeighted', // Weight the values in the calculation by the time over which they apply. Interpolation is based on whether the attribute is stepped. Interpolated events are generated at the boundaries if necessary.\r\n 'EventWeighted', // Evaluate values with equal weighting for each event. No interpolation is done. There must be at least one event within the time range to perform a successful calculation. Two events are required for standard deviation. In handling events at the boundary of the calculation, the AFSDK uses following rules:\r\n 'TimeWeightedContinuous', // Apply weighting as in TimeWeighted, but do all interpolation between values as if they represent continuous data, (standard interpolation) regardless of whether the attribute is stepped.\r\n 'TimeWeightedDiscrete', // Apply weighting as in TimeWeighted but interpolation between values is performed as if they represent discrete, unrelated values (stair step plot) regardless of the attribute is stepped.\r\n 'EventWeightedExcludeMostRecentEvent', // The calculation behaves the same as _EventWeighted_, except in the handling of events at the boundary of summary intervals in a multiple intervals calculation. Use this option to prevent events at the intervals boundary from being double count at both intervals. With this option, events at the end time (most recent time) of an interval is not used in that interval.\r\n 'EventWeightedExcludeEarliestEvent', // Similar to the option _EventWeightedExcludeMostRecentEvent_. Events at the start time(earliest time) of an interval is not used in that interval.\r\n 'EventWeightedIncludeBothEnds', // Events at both ends of the interval boundaries are included in the event weighted calculation.\r\n ];\r\n\r\n this.noDataReplacement = [\r\n 'Null', // replace with nulls\r\n 'Drop', // drop items\r\n 'Previous', // use previous value if available\r\n '0', // replace with 0\r\n 'Keep', // Keep value\r\n ];\r\n }\r\n\r\n // is selected segment empty\r\n isValueEmpty(value: PIWebAPISelectableValue | undefined) {\r\n return !value || !value.value || !value.value.length || value.value === REMOVE_LABEL;\r\n }\r\n\r\n segmentChangeValue = (segments: Array>) => {\r\n const query = this.props.query;\r\n this.setState({ segments }, () => this.onChange({ ...query, segments }));\r\n };\r\n\r\n attributeChangeValue = (attributes: Array>) => {\r\n const query = this.props.query;\r\n this.setState({ attributes }, () => this.onChange({ ...query, attributes }));\r\n };\r\n\r\n // summary calculation basis change event\r\n calcBasisValueChanged(segment: SelectableValue) {\r\n const metricsQuery = this.props.query as PIWebAPIQuery;\r\n const summary = metricsQuery.summary;\r\n summary.basis = segment.value?.value;\r\n this.onChange({ ...metricsQuery, summary });\r\n }\r\n // get summary calculation basis user interface segments\r\n getCalcBasisSegments() {\r\n const segments = map(this.calculationBasis, (item: string) => {\r\n let selectableValue: SelectableValue = {\r\n label: item,\r\n value: {\r\n value: item,\r\n expandable: true,\r\n },\r\n };\r\n return selectableValue;\r\n });\r\n return segments;\r\n }\r\n\r\n // no data change event\r\n calcNoDataValueChanged(segment: SelectableValue) {\r\n const metricsQuery = this.props.query as PIWebAPIQuery;\r\n const summary = metricsQuery.summary;\r\n summary.nodata = segment.value?.value;\r\n this.onChange({ ...metricsQuery, summary });\r\n }\r\n // get no data user interface segments\r\n getNoDataSegments() {\r\n var segments = map(this.noDataReplacement, (item: string) => {\r\n let selectableValue: SelectableValue = {\r\n label: item,\r\n value: {\r\n value: item,\r\n expandable: true,\r\n },\r\n };\r\n return selectableValue;\r\n });\r\n return segments;\r\n }\r\n\r\n // summary query change event\r\n onSummaryValueChanged(item: SelectableValue, index: number) {\r\n const summaries = this.state.summaries.slice(0) as Array>;\r\n summaries[index] = item;\r\n if (this.isValueEmpty(item.value)) {\r\n summaries.splice(index, 1);\r\n }\r\n this.setState({ summaries }, this.stateCallback);\r\n }\r\n // get the list of summaries available\r\n getSummarySegments() {\r\n const ctrl = this;\r\n const summaryTypes = filter(ctrl.summaryTypes, (type) => {\r\n return this.state.summaries.map((s) => s.value?.value).indexOf(type) === -1;\r\n });\r\n var segments = map(summaryTypes, (item: string) => {\r\n let selectableValue: SelectableValue = {\r\n label: item,\r\n value: {\r\n value: item,\r\n expandable: true,\r\n },\r\n };\r\n return selectableValue;\r\n });\r\n\r\n segments.unshift({\r\n label: REMOVE_LABEL,\r\n value: {\r\n value: REMOVE_LABEL,\r\n },\r\n });\r\n\r\n return segments;\r\n }\r\n\r\n // remove a summary from the user interface and the query\r\n removeSummary(part: SelectableValue) {\r\n const summaries = filter(this.state.summaries, (item: SelectableValue) => {\r\n return item !== part;\r\n });\r\n this.setState({ summaries });\r\n }\r\n // add a new summary to the query\r\n onSummaryAction(item: SelectableValue) {\r\n const summaries = this.state.summaries.slice(0) as Array>;\r\n // if value is not empty, add new attribute segment\r\n if (!this.isValueEmpty(item.value)) {\r\n let selectableValue: SelectableValue = {\r\n label: item.label,\r\n value: {\r\n value: item.value?.value,\r\n expandable: true,\r\n },\r\n };\r\n summaries.push(selectableValue);\r\n }\r\n this.setState({ summarySegment: {}, summaries }, this.stateCallback);\r\n }\r\n\r\n // remove an attribute from the query\r\n removeAttribute(part: SelectableValue) {\r\n const attributes = filter(this.state.attributes, (item: SelectableValue) => {\r\n return item !== part;\r\n });\r\n this.attributeChangeValue(attributes);\r\n }\r\n // add an attribute to the query\r\n onAttributeAction(item: SelectableValue) {\r\n const { query } = this.props;\r\n const attributes = this.state.attributes.slice(0);\r\n // if value is not empty, add new attribute segment\r\n if (!this.isValueEmpty(item.value)) {\r\n let selectableValue: SelectableValue = {\r\n label: item.label,\r\n value: {\r\n value: item.value?.value,\r\n expandable: !query.isPiPoint,\r\n },\r\n };\r\n attributes.push(selectableValue);\r\n }\r\n this.attributeChangeValue(attributes);\r\n }\r\n\r\n // pi point change event\r\n onPiPointChange = (item: SelectableValue, index: number) => {\r\n let attributes = this.state.attributes.slice(0);\r\n\r\n if (item.label === REMOVE_LABEL) {\r\n remove(attributes, (value, n) => n === index);\r\n } else {\r\n // set current value\r\n attributes[index] = item;\r\n }\r\n\r\n this.checkPiPointSegments(item, attributes);\r\n };\r\n // attribute change event\r\n onAttributeChange = (item: SelectableValue, index: number) => {\r\n let attributes = this.state.attributes.slice(0);\r\n\r\n // set current value\r\n attributes[index] = item;\r\n\r\n this.checkAttributeSegments(attributes, this.state.segments);\r\n };\r\n // segment change\r\n onSegmentChange = (item: SelectableValue, index: number) => {\r\n const { query } = this.props;\r\n let segments = this.state.segments.slice(0);\r\n\r\n if (item.label === REMOVE_LABEL) {\r\n segments = slice(segments, 0, index);\r\n this.checkAttributeSegments([], segments);\r\n if (segments.length === 0) {\r\n segments.push({\r\n label: '',\r\n });\r\n } else if (!!segments[segments.length - 1].value?.expandable) {\r\n segments.push({\r\n label: 'Select Element',\r\n value: {\r\n value: '-Select Element-',\r\n },\r\n });\r\n }\r\n if (query.isPiPoint) {\r\n this.piServer = [];\r\n }\r\n this.segmentChangeValue(segments);\r\n return;\r\n }\r\n\r\n // set current value\r\n segments[index] = item;\r\n\r\n // Accept only one PI server\r\n if (query.isPiPoint) {\r\n this.piServer.push(item);\r\n this.segmentChangeValue(segments);\r\n return;\r\n }\r\n\r\n // changed internal selection\r\n if (index < segments.length - 1) {\r\n segments = slice(segments, 0, index + 1);\r\n }\r\n this.checkAttributeSegments([], segments);\r\n // add new options\r\n if (!!item.value?.expandable) {\r\n segments.push({\r\n label: 'Select Element',\r\n value: {\r\n value: '-Select Element-',\r\n },\r\n });\r\n }\r\n this.segmentChangeValue(segments);\r\n };\r\n\r\n // get a ui segment for the attributes\r\n getElementSegments = (\r\n index: number,\r\n currentSegment?: Array>\r\n ): Promise>> => {\r\n const { datasource, query, data } = this.props;\r\n var ctrl = this;\r\n var findQuery = query.isPiPoint\r\n ? { type: 'dataserver' }\r\n : { path: this.getSegmentPathUpTo(currentSegment ?? this.state.segments.slice(0), index) };\r\n\r\n if (!query.isPiPoint) {\r\n if (datasource.afserver?.name && index === 0) {\r\n return Promise.resolve([\r\n {\r\n label: datasource.afserver.name,\r\n value: {\r\n value: datasource.afserver.name,\r\n expandable: true,\r\n },\r\n },\r\n ]);\r\n }\r\n if (datasource.afserver?.name && datasource.afdatabase?.name && index === 1) {\r\n return Promise.resolve([\r\n {\r\n label: datasource.afdatabase.name,\r\n value: {\r\n value: datasource.afdatabase.name,\r\n expandable: true,\r\n },\r\n },\r\n ]);\r\n }\r\n\r\n // if (!findQuery.path?.length) {\r\n // return Promise.resolve([]);\r\n // }\r\n }\r\n return datasource\r\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\r\n .then((items: any[]) => {\r\n var altSegments = map(items, (item: any) => {\r\n let selectableValue: SelectableValue = {\r\n label: item.text,\r\n value: {\r\n webId: item.WebId,\r\n value: item.text,\r\n expandable: !query.isPiPoint && item.expandable,\r\n },\r\n };\r\n return selectableValue;\r\n });\r\n\r\n if (altSegments.length === 0) {\r\n return altSegments;\r\n }\r\n\r\n // add template variables\r\n const variables = datasource.templateSrv.getVariables();\r\n each(variables, (variable: VariableModel) => {\r\n let selectableValue: SelectableValue = {\r\n label: '${' + variable.name + '}',\r\n value: {\r\n type: 'template',\r\n value: '${' + variable.name + '}',\r\n expandable: !query.isPiPoint,\r\n },\r\n };\r\n altSegments.unshift(selectableValue);\r\n });\r\n\r\n altSegments.unshift({\r\n label: REMOVE_LABEL,\r\n value: {\r\n value: REMOVE_LABEL,\r\n },\r\n });\r\n\r\n return altSegments;\r\n })\r\n .catch((err: any) => {\r\n ctrl.error = err.message || 'Failed to issue metric query';\r\n return [];\r\n });\r\n };\r\n\r\n // get the list of attributes for the user interface - PI\r\n getAttributeSegmentsPI = (attributeText?: string): Promise>> => {\r\n const { datasource, query, data } = this.props;\r\n const ctrl = this;\r\n const findQuery = {\r\n path: '',\r\n webId: this.getSelectedPIServer(),\r\n pointName: (attributeText ?? '') + '*',\r\n type: 'pipoint',\r\n };\r\n let segments: Array> = [];\r\n return datasource\r\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\r\n .then((items: any[]) => {\r\n segments = map(items, (item: any) => {\r\n let selectableValue: SelectableValue = {\r\n path: item.Path,\r\n label: item.text,\r\n value: {\r\n value: item.text,\r\n expandable: false,\r\n },\r\n };\r\n return selectableValue;\r\n });\r\n segments.unshift({\r\n label: attributeText,\r\n value: {\r\n value: attributeText,\r\n expandable: false,\r\n },\r\n });\r\n segments.unshift({\r\n label: REMOVE_LABEL,\r\n value: {\r\n value: REMOVE_LABEL,\r\n },\r\n });\r\n return segments;\r\n })\r\n .catch((err: any) => {\r\n ctrl.error = err.message || 'Failed to issue metric query';\r\n return segments;\r\n });\r\n };\r\n\r\n // get the list of attributes for the user interface - AF\r\n getAttributeSegmentsAF = (attributeText?: string): Array> => {\r\n const ctrl = this;\r\n let segments: Array> = [];\r\n\r\n forOwn(ctrl.availableAttributes, (val: any, key: string) => {\r\n let selectableValue: SelectableValue = {\r\n label: key,\r\n value: {\r\n value: key,\r\n expandable: true,\r\n },\r\n };\r\n segments.push(selectableValue);\r\n });\r\n\r\n segments.unshift({\r\n label: REMOVE_LABEL,\r\n value: {\r\n value: REMOVE_LABEL,\r\n },\r\n });\r\n\r\n return segments;\r\n };\r\n\r\n // build data from target string\r\n buildFromTarget = (\r\n query: PIWebAPIQuery,\r\n segmentsArray: Array>,\r\n attributesArray: Array>\r\n ) => {\r\n const splitAttributes = query.target.split(';');\r\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\r\n\r\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\r\n // remove element hierarchy from attribute collection\r\n splitAttributes.splice(0, 1);\r\n\r\n each(splitElements, (item, _) => {\r\n segmentsArray.push({\r\n label: item,\r\n value: {\r\n value: item,\r\n expandable: true,\r\n },\r\n });\r\n });\r\n each(splitAttributes, (item, _) => {\r\n if (item !== '') {\r\n // set current value\r\n attributesArray.push({\r\n label: item,\r\n value: {\r\n value: item,\r\n expandable: false,\r\n },\r\n });\r\n }\r\n });\r\n return this.getElementSegments(splitElements.length + 1, segmentsArray).then((elements) => {\r\n if (elements.length > 0) {\r\n segmentsArray.push({\r\n label: 'Select Element',\r\n value: {\r\n value: '-Select Element-',\r\n },\r\n });\r\n }\r\n return segmentsArray;\r\n });\r\n }\r\n return Promise.resolve(segmentsArray);\r\n };\r\n\r\n /**\r\n * Gets the segment information and parses it to a string.\r\n *\r\n * @param {any} index - Last index of segment to use.\r\n * @returns - AF Path or PI Point name.\r\n *\r\n * @memberOf PIWebAPIQueryEditor\r\n */\r\n getSegmentPathUpTo(segments: Array>, index: number): string {\r\n var arr = segments.slice(0, index);\r\n\r\n return reduce(\r\n arr,\r\n (result: any, segment: SelectableValue) => {\r\n if (!segment.value) {\r\n return '';\r\n }\r\n if (!segment.value.value?.startsWith('-Select')) {\r\n return result ? result + '\\\\' + segment.value.value : segment.value.value;\r\n }\r\n return result;\r\n },\r\n ''\r\n );\r\n }\r\n\r\n /**\r\n * Get the current AF Element's child attributes. Validates when the element selection changes.\r\n *\r\n * @returns - Collection of attributes.\r\n *\r\n * @memberOf PIWebAPIQueryEditor\r\n */\r\n checkAttributeSegments(\r\n attributes: Array>,\r\n segments: Array>\r\n ): Promise {\r\n const { datasource, data } = this.props;\r\n var ctrl = this;\r\n var findQuery = {\r\n path: this.getSegmentPathUpTo(segments.slice(0), segments.length),\r\n type: 'attributes',\r\n };\r\n return datasource\r\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: false }))\r\n .then((attributesResponse: any) => {\r\n var validAttributes: any = {};\r\n\r\n each(attributesResponse, (attribute: any) => {\r\n validAttributes[attribute.Path.substring(attribute.Path.indexOf('|') + 1)] = attribute.WebId;\r\n });\r\n\r\n var filteredAttributes = filter(attributes, (attrib: SelectableValue) => {\r\n const changedValue = datasource.templateSrv.replace(attrib.value?.value);\r\n return validAttributes[changedValue] !== undefined;\r\n });\r\n\r\n ctrl.availableAttributes = validAttributes;\r\n this.attributeChangeValue(filteredAttributes);\r\n })\r\n .catch((err: any) => {\r\n ctrl.error = err.message || 'Failed to issue metric query';\r\n this.attributeChangeValue(attributes);\r\n });\r\n }\r\n\r\n /**\r\n * Get PI points from server.\r\n *\r\n * @returns - Collection of attributes.\r\n *\r\n * @memberOf PIWebAPIQueryEditor\r\n */\r\n checkPiPointSegments(\r\n attribute: SelectableValue,\r\n attributes: Array>\r\n ) {\r\n const { datasource, data } = this.props;\r\n var ctrl = this;\r\n var findQuery = {\r\n path: attribute.path,\r\n webId: ctrl.getSelectedPIServer(),\r\n pointName: attribute.label,\r\n type: 'pipoint',\r\n };\r\n return datasource\r\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: true }))\r\n .then(() => {\r\n ctrl.attributeChangeValue(attributes);\r\n })\r\n .catch((err: any) => {\r\n ctrl.error = err.message || 'Failed to issue metric query';\r\n ctrl.attributeChangeValue([]);\r\n });\r\n }\r\n\r\n /**\r\n * Gets the webid of the current selected pi data server.\r\n *\r\n * @memberOf PIWebAPIQueryEditor\r\n */\r\n getSelectedPIServer() {\r\n var webID = '';\r\n\r\n this.piServer.forEach((s) => {\r\n var parts = this.props.query.target.split(';');\r\n if (parts.length >= 2) {\r\n if (parts[0] === s.text) {\r\n webID = s.WebId;\r\n return;\r\n }\r\n }\r\n });\r\n return this.piServer.length > 0 ? this.piServer[0].value?.webId : webID;\r\n }\r\n\r\n /**\r\n * Queries PI Web API for child elements and attributes when the raw query text editor is changed.\r\n *\r\n * @memberOf PIWebAPIQueryEditor\r\n */\r\n textEditorChanged() {\r\n const { query, onChange } = this.props;\r\n const splitAttributes = query.target.split(';');\r\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\r\n\r\n let segments: Array> = [];\r\n let attributes: Array> = [];\r\n\r\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\r\n // remove element hierarchy from attribute collection\r\n splitAttributes.splice(0, 1);\r\n\r\n each(splitElements, (item, _) => {\r\n segments.push({\r\n label: item,\r\n value: {\r\n type: item.match(/\\${\\w+}/gi) ? 'template' : undefined,\r\n value: item,\r\n expandable: true,\r\n },\r\n });\r\n });\r\n this.getElementSegments(splitElements.length + 1, segments).then((elements) => {\r\n if (elements.length > 0) {\r\n segments.push({\r\n label: 'Select Element',\r\n value: {\r\n value: '-Select Element-',\r\n },\r\n });\r\n }\r\n });\r\n each(splitAttributes, function (item, index) {\r\n if (item !== '') {\r\n attributes.push({\r\n label: item,\r\n value: {\r\n value: item,\r\n expandable: false,\r\n },\r\n });\r\n }\r\n });\r\n this.updateArray(segments, attributes, this.state.summaries, query.isPiPoint, () => {\r\n onChange({ ...query, query: undefined, rawQuery: false });\r\n });\r\n } else {\r\n segments = this.checkAfServer();\r\n this.updateArray(segments, this.state.attributes, this.state.summaries, query.isPiPoint, () => {\r\n this.onChange({\r\n ...query,\r\n query: undefined,\r\n rawQuery: false,\r\n attributes: this.state.attributes,\r\n segments: this.state.segments,\r\n });\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Check if the AF server and database are configured in the datasoure config.\r\n *\r\n * @returns the segments array\r\n *\r\n * @memberOf PIWebAPIQueryEditor\r\n */\r\n checkAfServer = () => {\r\n const { datasource } = this.props;\r\n const segmentsArray = [];\r\n if (datasource.afserver?.name) {\r\n segmentsArray.push({\r\n label: datasource.afserver.name,\r\n value: {\r\n value: datasource.afserver.name,\r\n expandable: true,\r\n },\r\n });\r\n if (datasource.afdatabase?.name) {\r\n segmentsArray.push({\r\n label: datasource.afdatabase.name,\r\n value: {\r\n value: datasource.afdatabase.name,\r\n expandable: true,\r\n },\r\n });\r\n }\r\n segmentsArray.push({\r\n label: 'Select Element',\r\n value: {\r\n value: '-Select Element-',\r\n },\r\n });\r\n } else {\r\n segmentsArray.push({\r\n label: '',\r\n });\r\n }\r\n return segmentsArray;\r\n };\r\n\r\n /**\r\n * Update the internal state of the datasource.\r\n *\r\n * @param segmentsArray the segments array to update\r\n * @param attributesArray the AF attributes array to update\r\n * @param summariesArray the summaries array to update\r\n * @param isPiPoint the is PI point flag\r\n * @param cb optional callback function\r\n *\r\n * @memberOf PIWebAPIQueryEditor\r\n */\r\n updateArray = (\r\n segmentsArray: Array>,\r\n attributesArray: Array>,\r\n summariesArray: Array>,\r\n isPiPoint: boolean,\r\n cb?: (() => void) | undefined\r\n ) => {\r\n this.setState(\r\n {\r\n segments: segmentsArray,\r\n attributes: attributesArray,\r\n summaries: summariesArray,\r\n isPiPoint,\r\n },\r\n () =>\r\n this.checkAttributeSegments(attributesArray, this.state.segments).then(() => {\r\n if (cb) {\r\n cb();\r\n }\r\n })\r\n );\r\n };\r\n\r\n // React action when component is initialized/updated\r\n scopedVarsDone = false;\r\n componentDidMount = () => {\r\n this.initialLoad(false);\r\n };\r\n componentDidUpdate = () => {\r\n if (this.props.data?.state === 'Done' && !!this.props.data?.request?.scopedVars && !this.scopedVarsDone) {\r\n this.scopedVarsDone = true;\r\n this.initialLoad(true);\r\n }\r\n };\r\n initialLoad = (force: boolean) => {\r\n const { query } = this.props;\r\n const metricsQuery = defaults(query, defaultQuery) as PIWebAPIQuery;\r\n const { segments, attributes, summary, isPiPoint } = metricsQuery;\r\n\r\n let segmentsArray: Array> = force ? [] : segments?.slice(0) ?? [];\r\n let attributesArray: Array> = force ? [] : attributes?.slice(0) ?? [];\r\n let summariesArray = summary?.types ?? [];\r\n\r\n if (!isPiPoint && segmentsArray.length === 0) {\r\n if (query.target && query.target.length > 0 && query.target !== ';') {\r\n attributesArray = [];\r\n // Build query from target\r\n this.buildFromTarget(query, segmentsArray, attributesArray)\r\n .then((_segmentsArray) => {\r\n this.updateArray(_segmentsArray, attributesArray, summariesArray, isPiPoint);\r\n })\r\n .catch((e) => console.error(e));\r\n return;\r\n } else {\r\n segmentsArray = this.checkAfServer();\r\n }\r\n } else if (isPiPoint && segmentsArray.length > 0) {\r\n this.piServer = segmentsArray;\r\n }\r\n this.updateArray(segmentsArray, attributesArray, summariesArray, isPiPoint, () => {\r\n this.onChange(query);\r\n });\r\n };\r\n\r\n onChange = (query: PIWebAPIQuery) => {\r\n const { onChange, onRunQuery } = this.props;\r\n\r\n query.summary.types = this.state.summaries;\r\n if (query.rawQuery) {\r\n query.target = query.query ?? '';\r\n\r\n if (query.target !== '') {\r\n const splitAttributes = query.target.split(';');\r\n const splitElements = splitAttributes[0].split('\\\\');\r\n\r\n // remove element hierarchy from attribute collection\r\n splitAttributes.splice(0, 1);\r\n\r\n query.attributes = [];\r\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\r\n query.elementPath = splitElements.join('\\\\');\r\n each(splitAttributes, function (item, index) {\r\n if (item !== '') {\r\n query.attributes.push({\r\n label: item,\r\n value: {\r\n value: item,\r\n expandable: false,\r\n },\r\n });\r\n }\r\n });\r\n }\r\n }\r\n } else {\r\n query.elementPath = this.getSegmentPathUpTo(this.state.segments, this.state.segments.length);\r\n query.target =\r\n query.elementPath +\r\n ';' +\r\n join(\r\n query.attributes.map((s) => s.value?.value),\r\n ';'\r\n );\r\n }\r\n\r\n onChange(query);\r\n\r\n if (query.target && query.target.length > 0 && query.attributes.length > 0) {\r\n onRunQuery();\r\n }\r\n };\r\n\r\n stateCallback = () => {\r\n const query = this.props.query as PIWebAPIQuery;\r\n this.onChange(query);\r\n };\r\n\r\n onIsPiPointChange = (event: React.SyntheticEvent) => {\r\n const { query: queryChange } = this.props;\r\n const isPiPoint = !queryChange.isPiPoint;\r\n this.setState(\r\n {\r\n segments: isPiPoint ? [{ label: '' }] : this.checkAfServer(),\r\n attributes: [],\r\n isPiPoint,\r\n },\r\n () => {\r\n this.onChange({\r\n ...queryChange,\r\n expression: '',\r\n attributes: this.state.attributes,\r\n segments: this.state.segments,\r\n isPiPoint,\r\n });\r\n }\r\n );\r\n };\r\n\r\n render() {\r\n const { query: queryProps, onChange, onRunQuery } = this.props;\r\n const metricsQuery = defaults(queryProps, defaultQuery) as PIWebAPIQuery;\r\n const {\r\n interpolate,\r\n query,\r\n rawQuery,\r\n digitalStates,\r\n recordedValues,\r\n expression,\r\n isPiPoint,\r\n summary,\r\n display,\r\n regex,\r\n } = metricsQuery;\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n\r\n {!!rawQuery && (\r\n \r\n \r\n ) =>\r\n onChange({ ...metricsQuery, query: event.target.value })\r\n }\r\n placeholder=\"enter query\"\r\n />\r\n \r\n this.textEditorChanged()} />\r\n \r\n )}\r\n\r\n {!rawQuery && (\r\n <>\r\n
\r\n \r\n {this.state.segments.map((segment: SelectableValue, index: number) => {\r\n return (\r\n }\r\n onChange={(item) => this.onSegmentChange(item, index)}\r\n loadOptions={(query?: string | undefined) => {\r\n return this.getElementSegments(index);\r\n }}\r\n allowCustomValue\r\n inputMinWidth={MIN_ELEM_INPUT_WIDTH}\r\n />\r\n );\r\n })}\r\n \r\n {!isPiPoint && (\r\n {\r\n onChange({ ...metricsQuery, query: metricsQuery.target, rawQuery: value });\r\n }}\r\n />\r\n )}\r\n \r\n
\r\n\r\n \r\n {this.state.attributes.map((attribute: SelectableValue, index: number) => {\r\n if (isPiPoint) {\r\n return (\r\n }\r\n disabled={this.piServer.length === 0}\r\n onChange={(item) => this.onPiPointChange(item, index)}\r\n loadOptions={this.getAttributeSegmentsPI}\r\n reloadOptionsOnChange\r\n allowCustomValue\r\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\r\n />\r\n );\r\n }\r\n return (\r\n }\r\n disabled={this.state.segments.length <= 2}\r\n onChange={(item) => this.onAttributeChange(item, index)}\r\n options={this.getAttributeSegmentsAF()}\r\n allowCustomValue\r\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\r\n />\r\n );\r\n })}\r\n\r\n {isPiPoint && (\r\n \r\n }\r\n disabled={this.piServer.length === 0}\r\n onChange={this.onAttributeAction}\r\n loadOptions={this.getAttributeSegmentsPI}\r\n reloadOptionsOnChange\r\n allowCustomValue\r\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\r\n />\r\n )}\r\n {!isPiPoint && (\r\n \r\n }\r\n disabled={this.state.segments.length <= 2}\r\n onChange={this.onAttributeAction}\r\n options={this.getAttributeSegmentsAF()}\r\n allowCustomValue\r\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\r\n />\r\n )}\r\n \r\n \r\n )}\r\n\r\n {!isPiPoint && (\r\n \r\n ) =>\r\n this.onChange({ ...metricsQuery, expression: event.target.value })\r\n }\r\n placeholder=\"'.'*2\"\r\n />\r\n \r\n )}\r\n\r\n \r\n \r\n ) =>\r\n this.onChange({\r\n ...metricsQuery,\r\n recordedValues: { ...recordedValues, maxNumber: parseInt(event.target.value, 10) },\r\n })\r\n }\r\n type=\"number\"\r\n placeholder=\"1000\"\r\n />\r\n \r\n \r\n \r\n this.onChange({\r\n ...metricsQuery,\r\n recordedValues: { ...recordedValues, enable: !recordedValues.enable },\r\n })\r\n }\r\n />\r\n \r\n \r\n \r\n this.onChange({ ...metricsQuery, digitalStates: { ...digitalStates, enable: !digitalStates.enable } })\r\n }\r\n />\r\n \r\n \r\n\r\n \r\n \r\n ) =>\r\n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, interval: event.target.value } })\r\n }\r\n placeholder=\"30s\"\r\n />\r\n \r\n \r\n \r\n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, enable: !interpolate.enable } })\r\n }\r\n />\r\n \r\n \r\n }\r\n onChange={this.calcNoDataValueChanged}\r\n options={this.getNoDataSegments()}\r\n allowCustomValue\r\n />\r\n \r\n \r\n\r\n \r\n \r\n ) =>\r\n onChange({ ...metricsQuery, summary: { ...summary, interval: event.target.value } })\r\n }\r\n placeholder=\"30s\"\r\n />\r\n \r\n \r\n }\r\n onChange={this.calcBasisValueChanged}\r\n options={this.getCalcBasisSegments()}\r\n allowCustomValue\r\n />\r\n \r\n \r\n \r\n {this.state.summaries.map((s: SelectableValue, index: number) => {\r\n return (\r\n }\r\n onChange={(item) => this.onSummaryValueChanged(item, index)}\r\n options={this.getSummarySegments()}\r\n allowCustomValue\r\n />\r\n );\r\n })}\r\n \r\n }\r\n onChange={this.onSummaryAction}\r\n options={this.getSummarySegments()}\r\n allowCustomValue\r\n />\r\n \r\n \r\n \r\n\r\n \r\n \r\n ) =>\r\n this.onChange({ ...metricsQuery, display: event.target.value })\r\n }\r\n placeholder=\"Display\"\r\n />\r\n \r\n \r\n {\r\n this.onChange({ ...metricsQuery, regex: { ...regex, enable: !regex.enable } });\r\n }}\r\n />\r\n \r\n \r\n ) =>\r\n this.onChange({ ...metricsQuery, regex: { ...regex, search: event.target.value } })\r\n }\r\n placeholder=\"(.*)\"\r\n />\r\n \r\n \r\n ) =>\r\n this.onChange({ ...metricsQuery, regex: { ...regex, replace: event.target.value } })\r\n }\r\n placeholder=\"$1\"\r\n />\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","import { curry, each, filter, flatten, forOwn, groupBy, keys, map, uniq } from 'lodash';\r\n\r\nimport {\r\n DataQueryRequest,\r\n DataQueryResponse,\r\n DataSourceApi,\r\n DataSourceInstanceSettings,\r\n AnnotationEvent,\r\n toDataFrame,\r\n MetricFindValue,\r\n} from '@grafana/data';\r\nimport { BackendSrv, getBackendSrv, getTemplateSrv, TemplateSrv } from '@grafana/runtime';\r\n\r\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\r\n\r\ninterface PiwebapiElementPath {\r\n path: string;\r\n variable: string;\r\n}\r\n\r\ninterface PiwebapiInternalRsp {\r\n data: PiwebapiRsp;\r\n status: number;\r\n url: string;\r\n}\r\n\r\ninterface PiwebapTargetRsp {\r\n refId: string;\r\n target: string;\r\n datapoints: any[];\r\n}\r\n\r\ninterface PiwebapiRsp {\r\n Name?: string;\r\n InstanceType?: string;\r\n Items?: PiwebapiRsp[];\r\n WebId?: string;\r\n HasChildren?: boolean;\r\n Path?: string;\r\n}\r\n\r\ninterface PiDataServer {\r\n name: string | undefined;\r\n webid: string | undefined;\r\n}\r\n\r\nexport class PiWebAPIDatasource extends DataSourceApi {\r\n piserver: PiDataServer;\r\n afserver: PiDataServer;\r\n afdatabase: PiDataServer;\r\n\r\n basicAuth?: string;\r\n withCredentials?: boolean;\r\n url: string;\r\n name: string;\r\n isProxy = false;\r\n\r\n templateSrv: TemplateSrv;\r\n backendSrv: BackendSrv;\r\n\r\n piwebapiurl?: string;\r\n webidCache: Map = new Map();\r\n\r\n error: any;\r\n\r\n constructor(instanceSettings: DataSourceInstanceSettings) {\r\n super(instanceSettings);\r\n this.basicAuth = instanceSettings.basicAuth;\r\n this.withCredentials = instanceSettings.withCredentials;\r\n this.url = instanceSettings.url!;\r\n this.name = instanceSettings.name;\r\n this.templateSrv = getTemplateSrv();\r\n this.backendSrv = getBackendSrv();\r\n\r\n this.piwebapiurl = instanceSettings.jsonData.url?.toString();\r\n this.isProxy = /^http(s)?:\\/\\//.test(this.url) || instanceSettings.jsonData.access === 'proxy';\r\n\r\n this.piserver = { name: (instanceSettings.jsonData || {}).piserver, webid: undefined };\r\n this.afserver = { name: (instanceSettings.jsonData || {}).afserver, webid: undefined };\r\n this.afdatabase = { name: (instanceSettings.jsonData || {}).afdatabase, webid: undefined };\r\n\r\n Promise.all([\r\n this.getAssetServer(this.afserver.name).then((result: PiwebapiRsp) => (this.afserver.webid = result.WebId)),\r\n this.getDataServer(this.piserver.name).then((result: PiwebapiRsp) => (this.piserver.webid = result.WebId)),\r\n this.getDatabase(this.afserver.name ? this.afserver.name + '\\\\' + this.afdatabase.name : undefined).then(\r\n (result: PiwebapiRsp) => (this.afdatabase.webid = result.WebId)\r\n ),\r\n ]);\r\n }\r\n\r\n /**\r\n * Converts a PIWebAPI Event Frame response to a Grafana Annotation\r\n *\r\n * @param {any} annotationOptions - Options data from configuration panel.\r\n * @param {any} endTime - End time of the Event Frame.\r\n * @param {any} eventFrame - The Event Frame data.\r\n * @returns - Grafana Annotation\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n private eventFrameToAnnotation(\r\n annotationOptions: any,\r\n endTime: any,\r\n eventFrame: any,\r\n attributeDataItems: any\r\n ): AnnotationEvent {\r\n if (annotationOptions.regex && annotationOptions.regex.enable) {\r\n eventFrame.Name = eventFrame.Name.replace(\r\n new RegExp(annotationOptions.regex.search),\r\n annotationOptions.regex.replace\r\n );\r\n }\r\n\r\n var attributeText = '';\r\n if (attributeDataItems) {\r\n each(attributeDataItems, (attributeData: any) => {\r\n const attributeValue = attributeData.Value.Value\r\n ? attributeData.Value.Value.Name || attributeData.Value.Value.Value || attributeData.Value.Value\r\n : null;\r\n attributeText += '
' + attributeData.Name + ': ' + attributeValue;\r\n });\r\n }\r\n return {\r\n annotation: annotationOptions,\r\n title: (endTime ? 'END ' : annotationOptions.showEndTime ? 'START ' : '') + annotationOptions.name,\r\n time: new Date(endTime ? eventFrame.EndTime : eventFrame.StartTime).getTime(),\r\n text:\r\n eventFrame.Name + attributeText + '
Start: ' + eventFrame.StartTime + '
End: ' + eventFrame.EndTime,\r\n };\r\n }\r\n\r\n /**\r\n * Builds the PIWebAPI query parameters.\r\n *\r\n * @param {any} options - Grafana query and panel options.\r\n * @returns - PIWebAPI query parameters.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n private buildQueryParameters(options: DataQueryRequest) {\r\n options.targets = filter(options.targets, (target) => {\r\n if (!target || !target.target) {\r\n return false;\r\n }\r\n return !target.target.startsWith('Select AF');\r\n });\r\n\r\n options.targets = map(options.targets, (target) => {\r\n const ds = this;\r\n var tar = {\r\n target: this.templateSrv.replace(target.elementPath, options.scopedVars),\r\n elementPath: this.templateSrv.replace(target.elementPath, options.scopedVars),\r\n elementPathArray: [\r\n {\r\n path: this.templateSrv.replace(target.elementPath, options.scopedVars),\r\n variable: '',\r\n } as PiwebapiElementPath,\r\n ],\r\n attributes: map(target.attributes, (att) =>\r\n this.templateSrv.replace(att.value?.value || att, options.scopedVars)\r\n ),\r\n segments: map(target.segments, (att) => this.templateSrv.replace(att.value?.value, options.scopedVars)),\r\n display: target.display,\r\n refId: target.refId,\r\n hide: target.hide,\r\n interpolate: target.interpolate || { enable: false },\r\n recordedValues: target.recordedValues || { enable: false },\r\n digitalStates: target.digitalStates || { enable: false },\r\n webid: target.webid,\r\n webids: target.webids || [],\r\n regex: target.regex || { enable: false },\r\n expression: target.expression || '',\r\n summary: target.summary || { types: [] },\r\n startTime: options.range.from,\r\n endTime: options.range.to,\r\n isPiPoint: target.isPiPoint,\r\n scopedVars: options.scopedVars,\r\n };\r\n\r\n if (tar.expression) {\r\n tar.expression = this.templateSrv.replace(tar.expression, options.scopedVars);\r\n }\r\n\r\n if (tar.summary.types !== undefined) {\r\n tar.summary.types = filter(tar.summary.types, (item) => {\r\n return item !== undefined && item !== null && item !== '';\r\n });\r\n }\r\n\r\n // explode All or Multi-selection\r\n const varsKeys = keys(options.scopedVars);\r\n this.templateSrv.getVariables().forEach((v: any) => {\r\n if (ds.isAllSelected(v.current) && varsKeys.indexOf(v.name) < 0) {\r\n // All selection\r\n const variables = v.options.filter((o: any) => !o.selected);\r\n // attributes\r\n tar.attributes = tar.attributes.map((attr: string) =>\r\n variables.map((vv: any) =>\r\n !!v.allValue ? attr.replace(v.allValue, vv.value) : attr.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value)\r\n )\r\n );\r\n tar.attributes = uniq(flatten(tar.attributes));\r\n // elementPath\r\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, v.allValue);\r\n } else if (Array.isArray(v.current.text) && varsKeys.indexOf(v.name) < 0) {\r\n // Multi-selection\r\n const variables = v.options.filter((o: any) => o.selected);\r\n // attributes\r\n const query = v.current.value.join(',');\r\n tar.attributes = tar.attributes.map((attr: string) =>\r\n variables.map((vv: any) => attr.replace(`{${query}}`, vv.value))\r\n );\r\n tar.attributes = uniq(flatten(tar.attributes));\r\n // elementPath\r\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, `{${query}}`);\r\n }\r\n });\r\n\r\n return tar;\r\n });\r\n\r\n return options;\r\n }\r\n\r\n /**\r\n * Datasource Implementation. Primary entry point for data source.\r\n * This takes the panel configuration and queries, sends them to PI Web API and parses the response.\r\n *\r\n * @param {any} options - Grafana query and panel options.\r\n * @returns - Promise of data in the format for Grafana panels.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n async query(options: DataQueryRequest): Promise {\r\n var ds = this;\r\n var query = this.buildQueryParameters(options);\r\n query.targets = filter(query.targets, (t) => !t.hide);\r\n\r\n if (query.targets.length <= 0) {\r\n return Promise.resolve({ data: [] });\r\n } else {\r\n return Promise.all(ds.getStream(query)).then((targetResponses) => {\r\n let flattened: PiwebapTargetRsp[] = [];\r\n each(targetResponses, (tr) => {\r\n each(tr, (item) => flattened.push(item));\r\n });\r\n const response: DataQueryResponse = {\r\n data: flattened\r\n .sort((a, b) => {\r\n return +(a.target > b.target) || +(a.target === b.target) - 1;\r\n })\r\n .map((d) => toDataFrame(d)),\r\n };\r\n return response;\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Datasource Implementation.\r\n * Used for testing datasource in datasource configuration pange\r\n *\r\n * @returns - Success or failure message.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n testDatasource(): Promise {\r\n return this.backendSrv\r\n .datasourceRequest({\r\n url: this.url + '/',\r\n method: 'GET',\r\n })\r\n .then((response: any) => {\r\n if (response.status === 200) {\r\n return { status: 'success', message: 'Data source is working', title: 'Success' };\r\n }\r\n throw new Error('Failed');\r\n });\r\n }\r\n\r\n /**\r\n * Datasource Implementation.\r\n * This queries PI Web API for Event Frames and converts them into annotations.\r\n *\r\n * @param {any} options - Annotation options, usually the Event Frame Category.\r\n * @returns - A Grafana annotation.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n annotationQuery(options: any): Promise {\r\n if (!this.afdatabase.webid) {\r\n return Promise.resolve([]);\r\n }\r\n\r\n var categoryName = options.annotation.query.categoryName\r\n ? this.templateSrv.replace(options.annotation.query.categoryName, options.scopedVars, 'glob')\r\n : null;\r\n var nameFilter = options.annotation.query.nameFilter\r\n ? this.templateSrv.replace(options.annotation.query.nameFilter, options.scopedVars, 'glob')\r\n : null;\r\n var templateName = options.annotation.template ? options.annotation.template.Name : null;\r\n var annotationOptions = {\r\n name: options.annotation.name,\r\n datasource: options.annotation.datasource,\r\n enable: options.annotation.enable,\r\n iconColor: options.annotation.iconColor,\r\n showEndTime: options.annotation.showEndTime,\r\n regex: options.annotation.regex,\r\n attribute: options.annotation.attribute,\r\n categoryName: categoryName,\r\n templateName: templateName,\r\n nameFilter: nameFilter,\r\n };\r\n\r\n var filter = [];\r\n if (!!annotationOptions.categoryName) {\r\n filter.push('categoryName=' + annotationOptions.categoryName);\r\n }\r\n if (!!annotationOptions.nameFilter) {\r\n filter.push('nameFilter=' + annotationOptions.nameFilter);\r\n }\r\n if (!!annotationOptions.templateName) {\r\n filter.push('templateName=' + annotationOptions.templateName);\r\n }\r\n if (!filter.length) {\r\n return Promise.resolve([]);\r\n }\r\n filter.push('startTime=' + options.range.from.toJSON());\r\n filter.push('endTime=' + options.range.to.toJSON());\r\n\r\n if (annotationOptions.attribute && annotationOptions.attribute.enable) {\r\n var resourceUrl =\r\n this.piwebapiurl + '/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\r\n if (!!annotationOptions.attribute.name) {\r\n resourceUrl =\r\n this.piwebapiurl +\r\n '/streamsets/{0}/value?nameFilter=' +\r\n annotationOptions.attribute.name +\r\n '&selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\r\n }\r\n var query: any = {};\r\n query['1'] = {\r\n Method: 'GET',\r\n Resource: this.piwebapiurl + '/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&'),\r\n };\r\n query['2'] = {\r\n Method: 'GET',\r\n RequestTemplate: {\r\n Resource: resourceUrl,\r\n },\r\n Parameters: ['$.1.Content.Items[*].WebId'],\r\n ParentIds: ['1'],\r\n };\r\n return this.restBatch(query).then((result: any) => {\r\n const data = result.data['1'].Content;\r\n const valueData = result.data['2'].Content;\r\n\r\n var annotations = map(data.Items, (item: any, index: any) => {\r\n return curry(this.eventFrameToAnnotation)(\r\n annotationOptions,\r\n false,\r\n item,\r\n valueData.Items[index].Content.Items\r\n );\r\n });\r\n\r\n if (options.annotation.showEndTime) {\r\n var ends = map(data.Items, (item: any, index: number) => {\r\n return curry(this.eventFrameToAnnotation)(\r\n annotationOptions,\r\n true,\r\n item,\r\n valueData.Items[index].Content.Items\r\n );\r\n });\r\n each(ends, (end) => {\r\n annotations.push(end);\r\n });\r\n }\r\n\r\n return annotations;\r\n });\r\n } else {\r\n return this.restGet('/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&')).then(\r\n (result) => {\r\n var annotations = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, false));\r\n if (options.annotation.showEndTime) {\r\n var ends = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, true));\r\n each(ends, (end) => {\r\n annotations.push(end);\r\n });\r\n }\r\n return annotations;\r\n }\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Builds the Grafana metric segment for use on the query user interface.\r\n *\r\n * @param {any} response - response from PI Web API.\r\n * @returns - Grafana metric segment.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n private metricQueryTransform(response: PiwebapiRsp[]): MetricFindValue[] {\r\n return map(response, (item) => {\r\n return {\r\n text: item.Name,\r\n expandable:\r\n item.HasChildren === undefined || item.HasChildren === true || (item.Path ?? '').split('\\\\').length <= 3,\r\n HasChildren: item.HasChildren,\r\n Items: item.Items ?? [],\r\n Path: item.Path,\r\n WebId: item.WebId,\r\n } as MetricFindValue;\r\n });\r\n }\r\n\r\n /**\r\n * This method does the discovery of the AF Hierarchy and populates the query user interface segments.\r\n *\r\n * @param {any} query - Parses the query configuration and builds a PI Web API query.\r\n * @returns - Segment information.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n metricFindQuery(query: any, queryOptions: any): Promise {\r\n var ds = this;\r\n var querydepth = ['servers', 'databases', 'databaseElements', 'elements'];\r\n if (typeof query === 'string') {\r\n query = JSON.parse(query as string);\r\n }\r\n if (queryOptions.isPiPoint) {\r\n query.path = this.templateSrv.replace(query.path, queryOptions);\r\n } else {\r\n if (query.path === '') {\r\n query.type = querydepth[0];\r\n } else if (query.type !== 'attributes') {\r\n query.type = querydepth[Math.max(0, Math.min(query.path.split('\\\\').length, querydepth.length - 1))];\r\n }\r\n query.path = this.templateSrv.replace(query.path, queryOptions);\r\n query.path = query.path.replace(/\\{([^\\\\])*\\}/gi, (r: string) => r.substring(1, r.length - 2).split(',')[0]);\r\n }\r\n\r\n query.filter = query.filter ?? '*';\r\n\r\n if (query.type === 'servers') {\r\n return ds.afserver?.name\r\n ? ds\r\n .getAssetServer(ds.afserver.name)\r\n .then((result: PiwebapiRsp) => [result])\r\n .then(ds.metricQueryTransform)\r\n : ds.getAssetServers().then(ds.metricQueryTransform);\r\n } else if (query.type === 'databases') {\r\n return ds\r\n .getAssetServer(query.path)\r\n .then((server) => ds.getDatabases(server.WebId ?? '', {}))\r\n .then(ds.metricQueryTransform);\r\n } else if (query.type === 'databaseElements') {\r\n return ds\r\n .getDatabase(query.path)\r\n .then((db) =>\r\n ds.getDatabaseElements(db.WebId ?? '', {\r\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\r\n })\r\n )\r\n .then(ds.metricQueryTransform);\r\n } else if (query.type === 'elements') {\r\n return ds\r\n .getElement(query.path)\r\n .then((element) =>\r\n ds.getElements(element.WebId ?? '', {\r\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\r\n nameFilter: query.filter,\r\n })\r\n )\r\n .then(ds.metricQueryTransform);\r\n } else if (query.type === 'attributes') {\r\n return ds\r\n .getElement(query.path)\r\n .then((element) =>\r\n ds.getAttributes(element.WebId ?? '', {\r\n searchFullHierarchy: 'true',\r\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Path',\r\n nameFilter: query.filter,\r\n })\r\n )\r\n .then(ds.metricQueryTransform);\r\n } else if (query.type === 'dataserver') {\r\n return ds.getDataServers().then(ds.metricQueryTransform);\r\n } else if (query.type === 'pipoint') {\r\n return ds.piPointSearch(query.webId, query.pointName).then(ds.metricQueryTransform);\r\n }\r\n return Promise.reject('Bad type');\r\n }\r\n\r\n /**\r\n * Gets the url of summary data from the query configuration.\r\n *\r\n * @param {any} summary - Query summary configuration.\r\n * @returns - URL append string.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n getSummaryUrl(summary: any) {\r\n if (summary.interval.trim() === '') {\r\n return (\r\n '&summaryType=' +\r\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\r\n '&calculationBasis=' +\r\n summary.basis\r\n );\r\n }\r\n return (\r\n '&summaryType=' +\r\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\r\n '&calculationBasis=' +\r\n summary.basis +\r\n '&summaryDuration=' +\r\n summary.interval.trim()\r\n );\r\n }\r\n\r\n /**\r\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\r\n *\r\n * @param {any} value - A list of PIWebAPI values.\r\n * @param {any} target - The target Grafana metric.\r\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\r\n * @returns - An array of Grafana value, timestamp pairs.\r\n *\r\n */\r\n parsePiPointValueList(value: any[], target: any, isSummary: boolean) {\r\n var api = this;\r\n var datapoints: any[] = [];\r\n each(value, (item) => {\r\n // @ts-ignore\r\n var { grafanaDataPoint, previousValue, drop } = this.noDataReplace(\r\n isSummary ? item.Value : item,\r\n target.summary.nodata,\r\n api.parsePiPointValue(isSummary ? item.Value : item, target, isSummary)\r\n );\r\n if (!drop) {\r\n datapoints.push(grafanaDataPoint);\r\n }\r\n });\r\n return datapoints;\r\n }\r\n\r\n /**\r\n * Convert a PI Point value to use Grafana value/timestamp.\r\n *\r\n * @param {any} value - PI Point value.\r\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\r\n * @param {any} target - The target grafana metric.\r\n * @returns - Grafana value pair.\r\n *\r\n */\r\n parsePiPointValue(value: any, target: any, isSummary: boolean) {\r\n let num = !isSummary && typeof value.Value === 'object' ? value.Value?.Value : value.Value;\r\n\r\n if (!value.Good || !!target.digitalStates?.enable) {\r\n num = !isSummary && typeof value.Value === 'object' ? value.Value.Name : value.Name;\r\n return [num.trim(), new Date(value.Timestamp).getTime()];\r\n }\r\n\r\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\r\n }\r\n\r\n /**\r\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\r\n *\r\n * @param {any} item - 'Item' object from PIWebAPI\r\n * @param {any} noDataReplacementMode - String state of how to replace 'No Data'\r\n * @param {any} grafanaDataPoint - Single Grafana value pair (value, timestamp).\r\n * @returns grafanaDataPoint - Single Grafana value pair (value, timestamp).\r\n * @returns perviousValue - {any} Grafana value (value only).\r\n *\r\n */\r\n noDataReplace(\r\n item: any,\r\n noDataReplacementMode: any,\r\n grafanaDataPoint: any[]\r\n ): {\r\n grafanaDataPoint: any[];\r\n previousValue: any;\r\n drop: boolean;\r\n } {\r\n var previousValue = null;\r\n var drop = false;\r\n if (!item.Good || item.Value === 'No Data' || (item.Value?.Name && item.Value?.Name === 'No Data')) {\r\n if (noDataReplacementMode === 'Drop') {\r\n drop = true;\r\n } else if (noDataReplacementMode === '0') {\r\n grafanaDataPoint[0] = 0;\r\n } else if (noDataReplacementMode === 'Keep') {\r\n // Do nothing keep\r\n } else if (noDataReplacementMode === 'Null') {\r\n grafanaDataPoint[0] = null;\r\n } else if (noDataReplacementMode === 'Previous' && previousValue !== null) {\r\n grafanaDataPoint[0] = previousValue;\r\n }\r\n } else {\r\n previousValue = item.Value;\r\n }\r\n return { grafanaDataPoint, previousValue, drop };\r\n }\r\n\r\n /**\r\n * Process the response from PI Web API for a single item.\r\n *\r\n * @param {any} content - Web response data.\r\n * @param {any} target - The target grafana metric.\r\n * @param {any} name - The target metric name.\r\n * @returns - Parsed metric in target/datapoint json format.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n processResults(content: any, target: any, name: any, noTemplate: boolean): PiwebapTargetRsp[] {\r\n const api = this;\r\n const isSummary: boolean = target.summary && target.summary.types && target.summary.types.length > 0;\r\n name = noTemplate ? name : this.getPath(target.elementPathArray, content.Path) + '|' + name;\r\n if (target.regex && target.regex.enable && target.regex.search.length && target.regex.replace.length) {\r\n name = name.replace(new RegExp(target.regex.search), target.regex.replace);\r\n }\r\n if (isSummary) {\r\n var innerResults: any[] = [];\r\n var groups = groupBy(content.Items, (item: any) => item.Type);\r\n forOwn(groups, (value, key) => {\r\n innerResults.push({\r\n refId: target.refId,\r\n target: name + '[' + key + ']',\r\n datapoints: api.parsePiPointValueList(value, target, isSummary),\r\n });\r\n });\r\n return innerResults;\r\n }\r\n return [\r\n {\r\n refId: target.refId,\r\n target: name,\r\n datapoints: api.parsePiPointValueList(content.Items, target, isSummary),\r\n },\r\n ];\r\n }\r\n\r\n /** PRIVATE SECTION */\r\n\r\n /**\r\n * Check if all items are selected.\r\n *\r\n * @param {any} current the current variable selection\r\n * @return {boolean} true if all value is selected, false otherwise\r\n */\r\n private isAllSelected(current: any): boolean {\r\n if (!current) {\r\n return false;\r\n }\r\n if (Array.isArray(current.text)) {\r\n return current.text.indexOf('All') >= 0;\r\n }\r\n return current.text === 'All';\r\n }\r\n\r\n /**\r\n * Check if the value is a number.\r\n *\r\n * @param {any} number the value to check\r\n * @returns {boolean} true if the value is a number, false otherwise\r\n */\r\n private checkNumber(number: any): boolean {\r\n return typeof number === 'number' && !Number.isNaN(number) && Number.isFinite(number);\r\n }\r\n\r\n /**\r\n * Returns a new element path list based on the panel variables.\r\n *\r\n * @param {string} elementPathArray array of element paths\r\n * @param {string} variables the list of variable values\r\n * @param {string} allValue the all value value for the variable\r\n * @returns {PiwebapiElementPath[]} new element path list\r\n */\r\n private getElementPath(\r\n elementPathArray: PiwebapiElementPath[],\r\n variables: any[],\r\n allValue: string\r\n ): PiwebapiElementPath[] {\r\n // elementPath\r\n let newElementPathArray: PiwebapiElementPath[] = [];\r\n elementPathArray.forEach((elem: PiwebapiElementPath) => {\r\n if ((!!allValue && elem.path.indexOf(allValue) >= 0) || (!allValue && elem.path.match(/{[a-zA-z0-9,-_]+}/gi))) {\r\n const temp: PiwebapiElementPath[] = variables.map((vv: any) => {\r\n return {\r\n path: !!allValue\r\n ? elem.path.replace(allValue, vv.value)\r\n : elem.path.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value),\r\n variable: vv.value,\r\n } as PiwebapiElementPath;\r\n });\r\n newElementPathArray = newElementPathArray.concat(temp);\r\n }\r\n });\r\n if (newElementPathArray.length) {\r\n return uniq(flatten(newElementPathArray));\r\n }\r\n return elementPathArray;\r\n }\r\n\r\n /**\r\n * Returns the last item of the element path.\r\n *\r\n * @param {string} path element path\r\n * @returns {string} last item of the element path\r\n */\r\n private getPath(elementPathArray: PiwebapiElementPath[], path: string): string {\r\n let splitPath = path.split('|');\r\n if (splitPath.length === 0) {\r\n return '';\r\n }\r\n if (elementPathArray.length === 0) {\r\n return '';\r\n }\r\n splitPath = splitPath[0].split('\\\\');\r\n const splitStr = splitPath.length === 0 ? '' : splitPath.pop() ?? '';\r\n const foundElement = elementPathArray.find((e) => path.indexOf(e.path) >= 0)?.variable;\r\n return foundElement ? foundElement + '|' + splitStr : splitStr;\r\n }\r\n\r\n /**\r\n * Gets historical data from a PI Web API stream source.\r\n *\r\n * @param {any} query - Grafana query.\r\n * @returns - Metric data.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n private getStream(query: any): Array> {\r\n const ds = this;\r\n var results: Array> = [];\r\n\r\n each(query.targets, (target) => {\r\n target.attributes = filter(target.attributes || [], (attribute) => {\r\n return 1 && attribute;\r\n });\r\n var url = '';\r\n var isSummary = target.summary && target.summary.types && target.summary.types.length > 0;\r\n var isInterpolated = target.interpolate && target.interpolate.enable;\r\n // perhaps add a check to see if interpolate override time < query.interval\r\n var intervalTime = target.interpolate.interval ? target.interpolate.interval : query.interval;\r\n var timeRange = '?startTime=' + query.range.from.toJSON() + '&endTime=' + query.range.to.toJSON();\r\n var targetName = target.expression || target.elementPath;\r\n var displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\r\n if (target.expression) {\r\n url += '/calculation';\r\n if (isSummary) {\r\n url += '/summary' + timeRange + (isInterpolated ? '&sampleType=Interval&sampleInterval=' + intervalTime : '');\r\n } else {\r\n url += '/intervals' + timeRange + '&sampleInterval=' + intervalTime;\r\n }\r\n url += '&expression=' + encodeURIComponent(target.expression);\r\n if (target.attributes.length > 0) {\r\n results.push(ds.internalStream(query, target, url));\r\n } else {\r\n results.push(\r\n ds.restGetWebId(target.elementPath, target.isPiPoint).then((webidresponse: any) => {\r\n return ds\r\n .restPost(url + webidresponse.WebId)\r\n .then((response: any) => ds.processResults(response.data, target, displayName || targetName, false))\r\n .catch((err: any) => (ds.error = err));\r\n })\r\n );\r\n }\r\n } else {\r\n url += '/streamsets';\r\n if (isSummary) {\r\n url += '/summary' + timeRange + '&intervals=' + query.maxDataPoints + this.getSummaryUrl(target.summary);\r\n } else if (target.interpolate && target.interpolate.enable) {\r\n url += '/interpolated' + timeRange + '&interval=' + intervalTime;\r\n } else if (target.recordedValues && target.recordedValues.enable) {\r\n const maxNumber =\r\n target.recordedValues.maxNumber && !isNaN(target.recordedValues.maxNumber)\r\n ? target.recordedValues.maxNumber\r\n : 1000;\r\n url += '/recorded' + timeRange + '&maxCount=' + maxNumber;\r\n } else {\r\n url += '/plot' + timeRange + '&intervals=' + query.maxDataPoints;\r\n }\r\n\r\n results.push(ds.internalStream(query, target, url));\r\n }\r\n });\r\n\r\n return results;\r\n }\r\n\r\n /**\r\n * Return the data points from the provided Grafana query.\r\n *\r\n * @param {any} query - Grafana query.\r\n * @param {any} target - Grafana query target.\r\n * @param {string} url - The base URL for the query.\r\n * @returns - Metric data.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n private internalStream(query: any, target: any, url: string): Promise {\r\n const ds = this;\r\n const targetName = target.expression || target.elementPath;\r\n const displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\r\n const noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path;\r\n let promises: Promise;\r\n\r\n if (noTemplate) {\r\n if (target.attributes.length > 1) {\r\n promises = ds\r\n .restGetWebId(target.elementPath, target.isPiPoint)\r\n .then((datarsp) =>\r\n ds.getAttributes(datarsp.WebId!, {\r\n searchFullHierarchy: 'true',\r\n nameFilter: '*',\r\n })\r\n )\r\n .then((datarspa) =>\r\n datarspa.filter(\r\n (d) =>\r\n target.attributes.indexOf(d.Name) >= 0 ||\r\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\r\n )\r\n );\r\n } else {\r\n promises = Promise.all(\r\n map(target.attributes, (attribute: string) =>\r\n ds.restGetWebId(target.elementPath + '|' + attribute, target.isPiPoint)\r\n )\r\n );\r\n }\r\n } else {\r\n if (target.attributes.length > 1) {\r\n promises = Promise.all(\r\n target.elementPathArray.map((elementPath: PiwebapiElementPath) => {\r\n return ds\r\n .restGetWebId(elementPath.path, target.isPiPoint)\r\n .then((datarsp) =>\r\n ds.getAttributes(datarsp.WebId!, {\r\n searchFullHierarchy: 'true',\r\n nameFilter: '*',\r\n })\r\n )\r\n .then((datarspa) =>\r\n datarspa.filter(\r\n (d) =>\r\n target.attributes.indexOf(d.Name) >= 0 ||\r\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\r\n )\r\n );\r\n })\r\n );\r\n } else {\r\n promises = Promise.all(\r\n flatten(\r\n map(target.attributes, (attribute: string) => {\r\n return target.elementPathArray.map((elementPath: PiwebapiElementPath) =>\r\n ds.restGetWebId(elementPath.path + '|' + attribute, target.isPiPoint)\r\n );\r\n })\r\n )\r\n );\r\n }\r\n }\r\n\r\n return promises.then((webidresponse) => {\r\n const query: any = {};\r\n each(flatten(webidresponse), (webid, index) => {\r\n query[index + 1] = {\r\n Method: 'GET',\r\n Resource: ds.piwebapiurl + url + '&webid=' + webid.WebId,\r\n };\r\n });\r\n\r\n return ds\r\n .restBatch(query)\r\n .then((response: any) => {\r\n const targetResults: any[] = [];\r\n each(response.data, (value, key) => {\r\n if (target.expression) {\r\n const attribute = webidresponse[parseInt(key, 10) - 1].Name;\r\n each(\r\n ds.processResults(value.Content, target, displayName || attribute || targetName, noTemplate),\r\n (targetResult) => targetResults.push(targetResult)\r\n );\r\n } else {\r\n each(value.Content.Items, (item) => {\r\n each(\r\n ds.processResults(item, target, displayName || item.Name || targetName, noTemplate),\r\n (targetResult) => targetResults.push(targetResult)\r\n );\r\n });\r\n }\r\n });\r\n return targetResults;\r\n })\r\n .catch((err: any) => (ds.error = err));\r\n });\r\n }\r\n\r\n /**\r\n * Abstraction for calling the PI Web API REST endpoint\r\n *\r\n * @param {any} path - the path to append to the base server URL.\r\n * @returns - The full URL.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n private restGet(path: string): Promise {\r\n return this.backendSrv\r\n .datasourceRequest({\r\n url: this.url + path,\r\n method: 'GET',\r\n headers: { 'Content-Type': 'application/json' },\r\n })\r\n .then((response: any) => {\r\n return response as PiwebapiInternalRsp;\r\n });\r\n }\r\n\r\n /**\r\n * Resolve a Grafana query into a PI Web API webid. Uses client side cache when possible to reduce lookups.\r\n *\r\n * @param {string} assetPath - The AF Path or the Pi Point Path (\\\\ServerName\\piPointName) to the asset.\r\n * @param {boolean} isPiPoint - Flag indicating it's a PI Point\r\n * @returns - URL query parameters.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n private restGetWebId(assetPath: string, isPiPoint: boolean): Promise {\r\n var ds = this;\r\n\r\n // check cache\r\n var cachedWebId = ds.webidCache.get(assetPath);\r\n if (cachedWebId) {\r\n return Promise.resolve({ Path: assetPath, WebId: cachedWebId.WebId, Name: cachedWebId.Name });\r\n }\r\n\r\n let path = '';\r\n if (isPiPoint) {\r\n path = '/points?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\' + assetPath.replace('|', '\\\\');\r\n } else {\r\n // no cache hit, query server\r\n path =\r\n (assetPath.indexOf('|') >= 0\r\n ? '/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\'\r\n : '/elements?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\') + assetPath;\r\n }\r\n\r\n return this.backendSrv\r\n .datasourceRequest({\r\n url: this.url + path,\r\n method: 'GET',\r\n headers: { 'Content-Type': 'application/json' },\r\n })\r\n .then((response: any) => {\r\n ds.webidCache.set(assetPath, response.data);\r\n return { Path: assetPath, WebId: response.data.WebId, Name: response.data.Name };\r\n });\r\n }\r\n\r\n /**\r\n * Execute a batch query on the PI Web API.\r\n *\r\n * @param {any} batch - Batch JSON query data.\r\n * @returns - Batch response.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n private restBatch(batch: any) {\r\n return this.backendSrv.datasourceRequest({\r\n url: this.url + '/batch',\r\n data: batch,\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'X-Requested-With': 'message/http',\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Execute a POST on the PI Web API.\r\n *\r\n * @param {string} path - The full url of the POST.\r\n * @returns - POST response data.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n private restPost(path: string) {\r\n return this.backendSrv.datasourceRequest({\r\n url: this.url,\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'X-Requested-With': 'message/http',\r\n 'X-PIWEBAPI-HTTP-METHOD': 'GET',\r\n 'X-PIWEBAPI-RESOURCE-ADDRESS': path,\r\n },\r\n });\r\n }\r\n\r\n // Get a list of all data (PI) servers\r\n private getDataServers(): Promise {\r\n return this.restGet('/dataservers').then((response) => response.data.Items ?? []);\r\n }\r\n private getDataServer(name: string | undefined): Promise {\r\n if (!name) {\r\n return Promise.resolve({});\r\n }\r\n return this.restGet('/dataservers?name=' + name).then((response) => response.data);\r\n }\r\n // Get a list of all asset (AF) servers\r\n private getAssetServers(): Promise {\r\n return this.restGet('/assetservers').then((response) => response.data.Items ?? []);\r\n }\r\n private getAssetServer(name: string | undefined): Promise {\r\n if (!name) {\r\n return Promise.resolve({});\r\n }\r\n return this.restGet('/assetservers?path=\\\\\\\\' + name).then((response) => response.data);\r\n }\r\n private getDatabase(path: string | undefined): Promise {\r\n if (!path) {\r\n return Promise.resolve({});\r\n }\r\n return this.restGet('/assetdatabases?path=\\\\\\\\' + path).then((response) => response.data);\r\n }\r\n getDatabases(serverId: string, options?: any): Promise {\r\n if (!serverId) {\r\n return Promise.resolve([]);\r\n }\r\n return this.restGet('/assetservers/' + serverId + '/assetdatabases').then((response) => response.data.Items ?? []);\r\n }\r\n getElement(path: string): Promise {\r\n if (!path) {\r\n return Promise.resolve({});\r\n }\r\n return this.restGet('/elements?path=\\\\\\\\' + path).then((response) => response.data);\r\n }\r\n getEventFrameTemplates(databaseId: string): Promise {\r\n if (!databaseId) {\r\n return Promise.resolve([]);\r\n }\r\n return this.restGet(\r\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\r\n ).then((response) => {\r\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'EventFrame');\r\n });\r\n }\r\n getElementTemplates(databaseId: string): Promise {\r\n if (!databaseId) {\r\n return Promise.resolve([]);\r\n }\r\n return this.restGet(\r\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\r\n ).then((response) => {\r\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'Element');\r\n });\r\n }\r\n\r\n /**\r\n * @description\r\n * Get the child attributes of the current resource.\r\n * GET attributes/{webId}/attributes\r\n * @param {string} elementId - The ID of the parent resource. See WebID for more information.\r\n * @param {Object} options - Query Options\r\n * @param {string} options.nameFilter - The name query string used for finding attributes. The default is no filter. See Query String for more information.\r\n * @param {string} options.categoryName - Specify that returned attributes must have this category. The default is no category filter.\r\n * @param {string} options.templateName - Specify that returned attributes must be members of this template. The default is no template filter.\r\n * @param {string} options.valueType - Specify that returned attributes' value type must be the given value type. The default is no value type filter.\r\n * @param {string} options.searchFullHierarchy - Specifies if the search should include attributes nested further than the immediate attributes of the searchRoot. The default is 'false'.\r\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\r\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\r\n * @param {string} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\r\n * @param {string} options.showExcluded - Specified if the search should include attributes with the Excluded property set. The default is 'false'.\r\n * @param {string} options.showHidden - Specified if the search should include attributes with the Hidden property set. The default is 'false'.\r\n * @param {string} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\r\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\r\n */\r\n private getAttributes(elementId: string, options: any): Promise {\r\n var querystring =\r\n '?' +\r\n map(options, (value, key) => {\r\n return key + '=' + value;\r\n }).join('&');\r\n\r\n if (querystring === '?') {\r\n querystring = '';\r\n }\r\n\r\n return this.restGet('/elements/' + elementId + '/attributes' + querystring).then(\r\n (response) => response.data.Items ?? []\r\n );\r\n }\r\n\r\n /**\r\n * @description\r\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\r\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\r\n * GET assetdatabases/{webId}/elements\r\n * @param {string} databaseId - The ID of the parent resource. See WebID for more information.\r\n * @param {Object} options - Query Options\r\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\r\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\r\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\r\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\r\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\r\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\r\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\r\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\r\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\r\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\r\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\r\n */\r\n private getDatabaseElements(databaseId: string, options: any): Promise {\r\n var querystring =\r\n '?' +\r\n map(options, (value, key) => {\r\n return key + '=' + value;\r\n }).join('&');\r\n\r\n if (querystring === '?') {\r\n querystring = '';\r\n }\r\n\r\n return this.restGet('/assetdatabases/' + databaseId + '/elements' + querystring).then(\r\n (response) => response.data.Items ?? []\r\n );\r\n }\r\n\r\n /**\r\n * @description\r\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\r\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\r\n * GET elements/{webId}/elements\r\n * @param {string} databaseId - The ID of the resource to use as the root of the search. See WebID for more information.\r\n * @param {Object} options - Query Options\r\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\r\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\r\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\r\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\r\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\r\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\r\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\r\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\r\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\r\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\r\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\r\n */\r\n private getElements(elementId: string, options: any): Promise {\r\n var querystring =\r\n '?' +\r\n map(options, (value, key) => {\r\n return key + '=' + value;\r\n }).join('&');\r\n\r\n if (querystring === '?') {\r\n querystring = '';\r\n }\r\n\r\n return this.restGet('/elements/' + elementId + '/elements' + querystring).then(\r\n (response) => response.data.Items ?? []\r\n );\r\n }\r\n\r\n /**\r\n * Retrieve a list of points on a specified Data Server.\r\n *\r\n * @param {string} serverId - The ID of the server. See WebID for more information.\r\n * @param {string} nameFilter - A query string for filtering by point name. The default is no filter. *, ?, [ab], [!ab]\r\n */\r\n private piPointSearch(serverId: string, nameFilter: string): Promise {\r\n let filter1 = this.templateSrv.replace(nameFilter);\r\n let filter2 = `${filter1}`;\r\n let doFilter = false;\r\n if (filter1 !== nameFilter) {\r\n const regex = /\\{(\\w|,)+\\}/gs;\r\n let m;\r\n while ((m = regex.exec(filter1)) !== null) {\r\n // This is necessary to avoid infinite loops with zero-width matches\r\n if (m.index === regex.lastIndex) {\r\n regex.lastIndex++;\r\n }\r\n\r\n // The result can be accessed through the `m`-variable.\r\n m.forEach((match, groupIndex) => {\r\n if (groupIndex === 0) {\r\n filter1 = filter1.replace(match, match.replace('{', '(').replace('}', ')').replace(',', '|'));\r\n filter2 = filter2.replace(match, '*');\r\n doFilter = true;\r\n }\r\n });\r\n }\r\n }\r\n return this.restGet('/dataservers/' + serverId + '/points?maxCount=20&nameFilter=' + filter2).then((results) => {\r\n if (!!results && !!results.data?.Items) {\r\n return doFilter ? results.data.Items.filter((item) => item.Name?.match(filter1)) : results.data.Items;\r\n }\r\n return [];\r\n });\r\n }\r\n\r\n /**\r\n * Get the PI Web API webid or PI Point.\r\n *\r\n * @param {any} target - AF Path or Point name.\r\n * @returns - webid.\r\n *\r\n * @memberOf PiWebApiDatasource\r\n */\r\n getWebId(target: any) {\r\n var ds = this;\r\n var isAf = target.target.indexOf('\\\\') >= 0;\r\n var isAttribute = target.target.indexOf('|') >= 0;\r\n if (!isAf && target.target.indexOf('.') === -1) {\r\n return Promise.resolve([{ WebId: target.target, Name: target.display || target.target }]);\r\n }\r\n\r\n if (!isAf) {\r\n // pi point lookup\r\n return ds.piPointSearch(this.piserver.webid!, target.target).then((results) => {\r\n if (results === undefined || results.length === 0) {\r\n return [{ WebId: target.target, Name: target.display || target.target }];\r\n }\r\n return results;\r\n });\r\n } else if (isAf && isAttribute) {\r\n // af attribute lookup\r\n return ds.restGet('/attributes?path=\\\\\\\\' + target.target).then((results) => {\r\n if (results.data === undefined || results.status !== 200) {\r\n return [{ WebId: target.target, Name: target.display || target.target }];\r\n }\r\n // rewrite name if specified\r\n results.data.Name = target.display || results.data.Name;\r\n return [results.data];\r\n });\r\n } else {\r\n // af element lookup\r\n return ds.restGet('/elements?path=\\\\\\\\' + target.target).then((results) => {\r\n if (results.data === undefined || results.status !== 200) {\r\n return [{ WebId: target.target, Name: target.display || target.target }];\r\n }\r\n // rewrite name if specified\r\n results.data.Name = target.display || results.data.Name;\r\n return [results.data];\r\n });\r\n }\r\n }\r\n}\r\n","import { DataSourcePlugin } from '@grafana/data';\r\nimport { AnnotationsQueryCtrl } from './AnnotationsQueryCtrl';\r\nimport { PIWebAPIConfigEditor } from './ConfigEditor';\r\nimport { PIWebAPIQueryEditor } from './QueryEditor';\r\nimport { PiWebAPIDatasource } from './datasource';\r\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\r\n\r\nexport const plugin = new DataSourcePlugin(\r\n PiWebAPIDatasource\r\n)\r\n .setConfigEditor(PIWebAPIConfigEditor)\r\n .setQueryEditor(PIWebAPIQueryEditor)\r\n .setAnnotationQueryCtrl(AnnotationsQueryCtrl);\r\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"module.js","mappings":";uHAAAA,EAAOC,QAAUC,OCAjBF,EAAOC,QAAUE,OCAjBH,EAAOC,QAAUG,OCAjBJ,EAAOC,QAAUI,QCAjBL,EAAOC,QAAUK,ICCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAID,EAASO,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GAAUT,EAAQA,EAAOC,QAASO,GAG/CR,EAAOC,OACf,CCrBAO,EAAoBK,EAAKb,IACxB,IAAIc,EAASd,GAAUA,EAAOe,WAC7B,IAAOf,EAAiB,QACxB,IAAM,EAEP,OADAQ,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdN,EAAoBQ,EAAI,CAACf,EAASiB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEnB,EAASkB,IAC5EE,OAAOC,eAAerB,EAASkB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1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3Q,MAAyC,MAAnB2Q,EAAQjF,OACjC,CAAC,CAAElS,MAAOkB,EAAOA,OAAQgO,KAAMhO,EAAOkL,SAAWlL,EAAOA,UAGjEiW,EAAQ3Q,KAAK0I,KAAOhO,EAAOkL,SAAW+K,EAAQ3Q,KAAK0I,KAC5C,CAACiI,EAAQ3Q,MACjB,IAzBMqJ,EAAGiF,cAAc9V,KAAKiC,SAASf,MAAQgB,EAAOA,QAAQrB,MAAK,SAACsX,GACjE,YAAgB5Z,IAAZ4Z,GAA4C,IAAnBA,EAAQjR,OAC5B,CAAC,CAAElG,MAAOkB,EAAOA,OAAQgO,KAAMhO,EAAOkL,SAAWlL,EAAOA,SAE1DiW,CACR,IAVMvQ,QAAQC,QAAQ,CAAC,CAAE7G,MAAOkB,EAAOA,OAAQgO,KAAMhO,EAAOkL,SAAWlL,EAAOA,SAgClF,uFAzrCH,GAAwCuY,EAAAA,eCvC3BC,GAAS,IAAIC,EAAAA,iBACxB7L,IAEC8L,gBAAgB/Y,GAChBgZ,eAAezU,GACf0U,uBAAuBhb","sources":["webpack:///external amd \"react\"","webpack:///external amd \"@grafana/ui\"","webpack:///external amd \"@grafana/data\"","webpack:///external amd \"lodash\"","webpack:///external amd \"@grafana/runtime\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./AnnotationsQueryCtrl.ts","webpack:///./ConfigEditor.tsx","webpack:///./components/Forms.tsx","webpack:///./types.ts","webpack:///./components/QueryEditorModeSwitcher.tsx","webpack:///./QueryEditor.tsx","webpack:///./datasource.ts","webpack:///./module.ts"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export class AnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n\n $scope: any;\n annotation: any;\n datasource: any;\n\n /** @ngInject */\n constructor($scope: any) {\n this.$scope = $scope;\n this.annotation = $scope.ctrl.annotation;\n this.datasource = $scope.ctrl.datasource;\n\n // load defaults\n this.annotation.query = this.annotation.query || {};\n this.annotation.databases = this.annotation.databases || [];\n this.annotation.templates = this.annotation.templates || [];\n this.annotation.regex = this.annotation.regex || {};\n this.annotation.attribute = this.annotation.attribute || {};\n this.annotation.showEndTime = this.annotation.showEndTime || false;\n\n this.datasource.getAssetServer(this.datasource.afserver.name).then((result: any) => {\n return this.getDatabases(result.WebId);\n });\n }\n templateChanged() {\n // do nothing\n }\n databaseChanged() {\n this.annotation.templates = [];\n this.getEventFrames();\n }\n getDatabases(webid: string) {\n var ctrl = this;\n ctrl.datasource.getDatabases(webid).then((dbs: any) => {\n ctrl.annotation.databases = dbs;\n this.$scope.$apply();\n });\n }\n getEventFrames() {\n var ctrl = this;\n ctrl.datasource.getEventFrameTemplates(this.annotation.database.WebId).then((templates: any) => {\n ctrl.annotation.templates = templates;\n this.$scope.$apply();\n });\n }\n}\n","import React, { ChangeEvent, PureComponent } from 'react';\nimport { LegacyForms, DataSourceHttpSettings } from '@grafana/ui';\nimport { DataSourcePluginOptionsEditorProps, DataSourceJsonData, DataSourceSettings } from '@grafana/data';\nimport { PIWebAPIDataSourceJsonData } from './types';\n\nconst { FormField } = LegacyForms;\n\ninterface Props extends DataSourcePluginOptionsEditorProps {}\n\nconst coerceOptions = (\n options: DataSourceSettings\n): DataSourceSettings => {\n return {\n ...options,\n jsonData: {\n ...options.jsonData,\n url: options.url,\n },\n };\n};\n\ninterface State {}\n\nexport class PIWebAPIConfigEditor extends PureComponent {\n onPIServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n piserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFDatabaseChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afdatabase: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onMyOptionsChange = (options: DataSourceSettings) => {\n const { onOptionsChange } = this.props;\n onOptionsChange(coerceOptions(options));\n };\n\n render() {\n const { options: originalOptions } = this.props;\n const options = coerceOptions(originalOptions);\n\n return (\n
\n \n\n

PI/AF Connection Details

\n\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n );\n }\n}\n","import React, { InputHTMLAttributes, FunctionComponent } from 'react';\nimport { InlineFormLabel } from '@grafana/ui';\n\nexport interface Props extends InputHTMLAttributes {\n label: string;\n tooltip?: string;\n labelWidth?: number;\n children?: React.ReactNode;\n queryEditor?: JSX.Element;\n}\n\nexport const QueryField: FunctionComponent> = ({ label, labelWidth = 12, tooltip, children }) => (\n <>\n \n {label}\n \n {children}\n \n);\n\nexport const QueryRowTerminator = () => {\n return (\n
\n
\n
\n );\n};\n\nexport const QueryInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryEditorRow = (props: Partial) => {\n return (\n
\n {props.children}\n \n
\n );\n};\n\nexport const QueryRawInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryRawEditorRow = (props: Partial) => {\n return <>{props.children};\n};\n","import { DataQuery, DataSourceJsonData } from '@grafana/data';\n\nexport interface PIWebAPISelectableValue {\n webId?: string;\n value?: string;\n type?: string;\n expandable?: boolean;\n}\n\nexport interface PIWebAPIAnnotationsQuery extends DataQuery {\n target: string;\n}\n\nexport interface PIWebAPIQuery extends DataQuery {\n target: string;\n elementPath: string;\n attributes: any[];\n segments: any[];\n display: any;\n interpolate: any;\n recordedValues: any;\n digitalStates: any;\n webid: string;\n webids: string[];\n regex: any;\n summary: any;\n expression: string;\n isPiPoint: boolean;\n rawQuery?: boolean;\n query?: string;\n}\n\nexport const defaultQuery: Partial = {\n target: ';',\n attributes: [],\n segments: [],\n regex: { enable: false },\n summary: { types: [], basis: 'EventWeighted', interval: '', nodata: 'Null' },\n expression: '',\n interpolate: { enable: false },\n recordedValues: { enable: false },\n digitalStates: { enable: false },\n isPiPoint: false,\n};\n\n/**\n * These are options configured for each DataSource instance\n */\nexport interface PIWebAPIDataSourceJsonData extends DataSourceJsonData {\n url?: string;\n access?: string;\n piserver?: string;\n afserver?: string;\n afdatabase?: string;\n}\n\n/**\n * Value that is used in the backend, but never sent over HTTP to the frontend\n */\nexport interface PIWebAPISecureJsonData {\n apiKey?: string;\n}\n","import React, { useEffect, useState } from 'react';\nimport { Button, ConfirmModal } from '@grafana/ui';\n\ntype Props = {\n isRaw: boolean;\n onChange: (newIsRaw: boolean) => void;\n};\n\nexport const QueryEditorModeSwitcher = ({ isRaw, onChange }: Props): JSX.Element => {\n const [isModalOpen, setModalOpen] = useState(false);\n\n useEffect(() => {\n // if the isRaw changes, we hide the modal\n setModalOpen(false);\n }, [isRaw]);\n\n if (isRaw) {\n return (\n <>\n {\n // we show the are-you-sure modal\n setModalOpen(true);\n }}\n >\n {\n onChange(false);\n }}\n onDismiss={() => {\n setModalOpen(false);\n }}\n />\n \n );\n } else {\n return (\n {\n onChange(true);\n }}\n >\n );\n }\n};\n","import { each, filter, forOwn, join, reduce, map, slice, remove, defaults } from 'lodash';\n\nimport React, { PureComponent, ChangeEvent } from 'react';\nimport { Icon, InlineField, InlineFieldRow, InlineSwitch, Input, SegmentAsync, Segment } from '@grafana/ui';\nimport { QueryEditorProps, SelectableValue, VariableModel } from '@grafana/data';\n\nimport { PiWebAPIDatasource } from './datasource';\nimport { QueryInlineField, QueryRawInlineField, QueryRowTerminator } from './components/Forms';\nimport { PIWebAPISelectableValue, PIWebAPIDataSourceJsonData, PIWebAPIQuery, defaultQuery } from './types';\nimport { QueryEditorModeSwitcher } from 'components/QueryEditorModeSwitcher';\n\nconst LABEL_WIDTH = 24;\nconst MIN_ELEM_INPUT_WIDTH = 200;\nconst MIN_ATTR_INPUT_WIDTH = 250;\n\ninterface State {\n isPiPoint: boolean;\n segments: Array>;\n attributes: Array>;\n summaries: Array>;\n attributeSegment: SelectableValue;\n summarySegment: SelectableValue;\n calculationBasisSegment: SelectableValue;\n noDataReplacementSegment: SelectableValue;\n}\n\ntype Props = QueryEditorProps;\n\nconst REMOVE_LABEL = '-REMOVE-';\n\nconst CustomLabelComponent = (props: any) => {\n if (props.value) {\n return (\n
\n {props.label ?? '--no label--'}\n
\n );\n }\n return (\n \n \n \n );\n};\n\nexport class PIWebAPIQueryEditor extends PureComponent {\n error: any;\n piServer: any[] = [];\n availableAttributes: any = {};\n summaryTypes: string[];\n calculationBasis: string[];\n noDataReplacement: string[];\n state: State = {\n isPiPoint: false,\n segments: [],\n attributes: [],\n summaries: [],\n attributeSegment: {},\n summarySegment: {},\n calculationBasisSegment: {},\n noDataReplacementSegment: {},\n };\n\n constructor(props: any) {\n super(props);\n this.onSegmentChange = this.onSegmentChange.bind(this);\n this.calcBasisValueChanged = this.calcBasisValueChanged.bind(this);\n this.calcNoDataValueChanged = this.calcNoDataValueChanged.bind(this);\n this.onSummaryAction = this.onSummaryAction.bind(this);\n this.onSummaryValueChanged = this.onSummaryValueChanged.bind(this);\n this.onAttributeAction = this.onAttributeAction.bind(this);\n this.onAttributeChange = this.onAttributeChange.bind(this);\n\n this.summaryTypes = [\n // 'None', // A summary type is not specified.\n 'Total', // A totalization over the time range.\n 'Average', // The average value over the time range.\n 'Minimum', // The minimum value over the time range.\n 'Maximum', // The maximum value over the time range.\n 'Range', // The range value over the time range (minimum-maximum).\n 'StdDev', // The standard deviation over the time range.\n 'PopulationStdDev', // The population standard deviation over the time range.\n 'Count', // The sum of event count over the time range when calculation basis is event weighted. The sum of event time duration over the time range when calculation basis is time weighted.\n 'PercentGood', // Percent of data with good value during the calculation period. For time weighted calculations, the percentage is based on time. For event weighted calculations, the percent is based on event count.\n 'All', // A convenience for requesting all available summary calculations.\n 'AllForNonNumeric', // A convenience for requesting all available summary calculations for non-numeric data.\n ];\n\n this.calculationBasis = [\n 'TimeWeighted', // Weight the values in the calculation by the time over which they apply. Interpolation is based on whether the attribute is stepped. Interpolated events are generated at the boundaries if necessary.\n 'EventWeighted', // Evaluate values with equal weighting for each event. No interpolation is done. There must be at least one event within the time range to perform a successful calculation. Two events are required for standard deviation. In handling events at the boundary of the calculation, the AFSDK uses following rules:\n 'TimeWeightedContinuous', // Apply weighting as in TimeWeighted, but do all interpolation between values as if they represent continuous data, (standard interpolation) regardless of whether the attribute is stepped.\n 'TimeWeightedDiscrete', // Apply weighting as in TimeWeighted but interpolation between values is performed as if they represent discrete, unrelated values (stair step plot) regardless of the attribute is stepped.\n 'EventWeightedExcludeMostRecentEvent', // The calculation behaves the same as _EventWeighted_, except in the handling of events at the boundary of summary intervals in a multiple intervals calculation. Use this option to prevent events at the intervals boundary from being double count at both intervals. With this option, events at the end time (most recent time) of an interval is not used in that interval.\n 'EventWeightedExcludeEarliestEvent', // Similar to the option _EventWeightedExcludeMostRecentEvent_. Events at the start time(earliest time) of an interval is not used in that interval.\n 'EventWeightedIncludeBothEnds', // Events at both ends of the interval boundaries are included in the event weighted calculation.\n ];\n\n this.noDataReplacement = [\n 'Null', // replace with nulls\n 'Drop', // drop items\n 'Previous', // use previous value if available\n '0', // replace with 0\n 'Keep', // Keep value\n ];\n }\n\n // is selected segment empty\n isValueEmpty(value: PIWebAPISelectableValue | undefined) {\n return !value || !value.value || !value.value.length || value.value === REMOVE_LABEL;\n }\n\n segmentChangeValue = (segments: Array>) => {\n const query = this.props.query;\n this.setState({ segments }, () => this.onChange({ ...query, segments }));\n };\n\n attributeChangeValue = (attributes: Array>) => {\n const query = this.props.query;\n this.setState({ attributes }, () => this.onChange({ ...query, attributes }));\n };\n\n // summary calculation basis change event\n calcBasisValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.basis = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get summary calculation basis user interface segments\n getCalcBasisSegments() {\n const segments = map(this.calculationBasis, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // no data change event\n calcNoDataValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.nodata = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get no data user interface segments\n getNoDataSegments() {\n var segments = map(this.noDataReplacement, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // summary query change event\n onSummaryValueChanged(item: SelectableValue, index: number) {\n const summaries = this.state.summaries.slice(0) as Array>;\n summaries[index] = item;\n if (this.isValueEmpty(item.value)) {\n summaries.splice(index, 1);\n }\n this.setState({ summaries }, this.stateCallback);\n }\n // get the list of summaries available\n getSummarySegments() {\n const ctrl = this;\n const summaryTypes = filter(ctrl.summaryTypes, (type) => {\n return this.state.summaries.map((s) => s.value?.value).indexOf(type) === -1;\n });\n var segments = map(summaryTypes, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n }\n\n // remove a summary from the user interface and the query\n removeSummary(part: SelectableValue) {\n const summaries = filter(this.state.summaries, (item: SelectableValue) => {\n return item !== part;\n });\n this.setState({ summaries });\n }\n // add a new summary to the query\n onSummaryAction(item: SelectableValue) {\n const summaries = this.state.summaries.slice(0) as Array>;\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: true,\n },\n };\n summaries.push(selectableValue);\n }\n this.setState({ summarySegment: {}, summaries }, this.stateCallback);\n }\n\n // remove an attribute from the query\n removeAttribute(part: SelectableValue) {\n const attributes = filter(this.state.attributes, (item: SelectableValue) => {\n return item !== part;\n });\n this.attributeChangeValue(attributes);\n }\n // add an attribute to the query\n onAttributeAction(item: SelectableValue) {\n const { query } = this.props;\n const attributes = this.state.attributes.slice(0);\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: !query.isPiPoint,\n },\n };\n attributes.push(selectableValue);\n }\n this.attributeChangeValue(attributes);\n }\n\n // pi point change event\n onPiPointChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n remove(attributes, (value, n) => n === index);\n } else {\n // set current value\n attributes[index] = item;\n }\n\n this.checkPiPointSegments(item, attributes);\n };\n // attribute change event\n onAttributeChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n // set current value\n attributes[index] = item;\n\n this.checkAttributeSegments(attributes, this.state.segments);\n };\n // segment change\n onSegmentChange = (item: SelectableValue, index: number) => {\n const { query } = this.props;\n let segments = this.state.segments.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n segments = slice(segments, 0, index);\n this.checkAttributeSegments([], segments);\n if (segments.length === 0) {\n segments.push({\n label: '',\n });\n } else if (!!segments[segments.length - 1].value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n if (query.isPiPoint) {\n this.piServer = [];\n }\n this.segmentChangeValue(segments);\n return;\n }\n\n // set current value\n segments[index] = item;\n\n // Accept only one PI server\n if (query.isPiPoint) {\n this.piServer.push(item);\n this.segmentChangeValue(segments);\n return;\n }\n\n // changed internal selection\n if (index < segments.length - 1) {\n segments = slice(segments, 0, index + 1);\n }\n this.checkAttributeSegments([], segments);\n // add new options\n if (!!item.value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n this.segmentChangeValue(segments);\n };\n\n // get a ui segment for the attributes\n getElementSegments = (\n index: number,\n currentSegment?: Array>\n ): Promise>> => {\n const { datasource, query, data } = this.props;\n var ctrl = this;\n var findQuery = query.isPiPoint\n ? { type: 'dataserver' }\n : { path: this.getSegmentPathUpTo(currentSegment ?? this.state.segments.slice(0), index) };\n\n if (!query.isPiPoint) {\n if (datasource.afserver?.name && index === 0) {\n return Promise.resolve([\n {\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n },\n ]);\n }\n if (datasource.afserver?.name && datasource.afdatabase?.name && index === 1) {\n return Promise.resolve([\n {\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n },\n ]);\n }\n\n // if (!findQuery.path?.length) {\n // return Promise.resolve([]);\n // }\n }\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n var altSegments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n label: item.text,\n value: {\n webId: item.WebId,\n value: item.text,\n expandable: !query.isPiPoint && item.expandable,\n },\n };\n return selectableValue;\n });\n\n if (altSegments.length === 0) {\n return altSegments;\n }\n\n // add template variables\n const variables = datasource.templateSrv.getVariables();\n each(variables, (variable: VariableModel) => {\n let selectableValue: SelectableValue = {\n label: '${' + variable.name + '}',\n value: {\n type: 'template',\n value: '${' + variable.name + '}',\n expandable: !query.isPiPoint,\n },\n };\n altSegments.unshift(selectableValue);\n });\n\n altSegments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return altSegments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return [];\n });\n };\n\n // get the list of attributes for the user interface - PI\n getAttributeSegmentsPI = (attributeText?: string): Promise>> => {\n const { datasource, query, data } = this.props;\n const ctrl = this;\n const findQuery = {\n path: '',\n webId: this.getSelectedPIServer(),\n pointName: (attributeText ?? '') + '*',\n type: 'pipoint',\n };\n let segments: Array> = [];\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n segments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n path: item.Path,\n label: item.text,\n value: {\n value: item.text,\n expandable: false,\n },\n };\n return selectableValue;\n });\n segments.unshift({\n label: attributeText,\n value: {\n value: attributeText,\n expandable: false,\n },\n });\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n return segments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return segments;\n });\n };\n\n // get the list of attributes for the user interface - AF\n getAttributeSegmentsAF = (attributeText?: string): Array> => {\n const ctrl = this;\n let segments: Array> = [];\n\n forOwn(ctrl.availableAttributes, (val: any, key: string) => {\n let selectableValue: SelectableValue = {\n label: key,\n value: {\n value: key,\n expandable: true,\n },\n };\n segments.push(selectableValue);\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n };\n\n // build data from target string\n buildFromTarget = (\n query: PIWebAPIQuery,\n segmentsArray: Array>,\n attributesArray: Array>\n ) => {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segmentsArray.push({\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n });\n });\n each(splitAttributes, (item, _) => {\n if (item !== '') {\n // set current value\n attributesArray.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n return this.getElementSegments(splitElements.length + 1, segmentsArray).then((elements) => {\n if (elements.length > 0) {\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n return segmentsArray;\n });\n }\n return Promise.resolve(segmentsArray);\n };\n\n /**\n * Gets the segment information and parses it to a string.\n *\n * @param {any} index - Last index of segment to use.\n * @returns - AF Path or PI Point name.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSegmentPathUpTo(segments: Array>, index: number): string {\n var arr = segments.slice(0, index);\n\n return reduce(\n arr,\n (result: any, segment: SelectableValue) => {\n if (!segment.value) {\n return '';\n }\n if (!segment.value.value?.startsWith('-Select')) {\n return result ? result + '\\\\' + segment.value.value : segment.value.value;\n }\n return result;\n },\n ''\n );\n }\n\n /**\n * Get the current AF Element's child attributes. Validates when the element selection changes.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAttributeSegments(\n attributes: Array>,\n segments: Array>\n ): Promise {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: this.getSegmentPathUpTo(segments.slice(0), segments.length),\n type: 'attributes',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: false }))\n .then((attributesResponse: any) => {\n var validAttributes: any = {};\n\n each(attributesResponse, (attribute: any) => {\n validAttributes[attribute.Path.substring(attribute.Path.indexOf('|') + 1)] = attribute.WebId;\n });\n\n var filteredAttributes = filter(attributes, (attrib: SelectableValue) => {\n const changedValue = datasource.templateSrv.replace(attrib.value?.value);\n return validAttributes[changedValue] !== undefined;\n });\n\n ctrl.availableAttributes = validAttributes;\n this.attributeChangeValue(filteredAttributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n this.attributeChangeValue(attributes);\n });\n }\n\n /**\n * Get PI points from server.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkPiPointSegments(\n attribute: SelectableValue,\n attributes: Array>\n ) {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: attribute.path,\n webId: ctrl.getSelectedPIServer(),\n pointName: attribute.label,\n type: 'pipoint',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: true }))\n .then(() => {\n ctrl.attributeChangeValue(attributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n ctrl.attributeChangeValue([]);\n });\n }\n\n /**\n * Gets the webid of the current selected pi data server.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSelectedPIServer() {\n var webID = '';\n\n this.piServer.forEach((s) => {\n var parts = this.props.query.target.split(';');\n if (parts.length >= 2) {\n if (parts[0] === s.text) {\n webID = s.WebId;\n return;\n }\n }\n });\n return this.piServer.length > 0 ? this.piServer[0].value?.webId : webID;\n }\n\n /**\n * Queries PI Web API for child elements and attributes when the raw query text editor is changed.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n textEditorChanged() {\n const { query, onChange } = this.props;\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n let segments: Array> = [];\n let attributes: Array> = [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segments.push({\n label: item,\n value: {\n type: item.match(/\\${\\w+}/gi) ? 'template' : undefined,\n value: item,\n expandable: true,\n },\n });\n });\n this.getElementSegments(splitElements.length + 1, segments).then((elements) => {\n if (elements.length > 0) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n });\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n this.updateArray(segments, attributes, this.state.summaries, query.isPiPoint, () => {\n onChange({ ...query, query: undefined, rawQuery: false });\n });\n } else {\n segments = this.checkAfServer();\n this.updateArray(segments, this.state.attributes, this.state.summaries, query.isPiPoint, () => {\n this.onChange({\n ...query,\n query: undefined,\n rawQuery: false,\n attributes: this.state.attributes,\n segments: this.state.segments,\n });\n });\n }\n }\n\n /**\n * Check if the AF server and database are configured in the datasoure config.\n *\n * @returns the segments array\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAfServer = () => {\n const { datasource } = this.props;\n const segmentsArray = [];\n if (datasource.afserver?.name) {\n segmentsArray.push({\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n });\n if (datasource.afdatabase?.name) {\n segmentsArray.push({\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n });\n }\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n } else {\n segmentsArray.push({\n label: '',\n });\n }\n return segmentsArray;\n };\n\n /**\n * Update the internal state of the datasource.\n *\n * @param segmentsArray the segments array to update\n * @param attributesArray the AF attributes array to update\n * @param summariesArray the summaries array to update\n * @param isPiPoint the is PI point flag\n * @param cb optional callback function\n *\n * @memberOf PIWebAPIQueryEditor\n */\n updateArray = (\n segmentsArray: Array>,\n attributesArray: Array>,\n summariesArray: Array>,\n isPiPoint: boolean,\n cb?: (() => void) | undefined\n ) => {\n this.setState(\n {\n segments: segmentsArray,\n attributes: attributesArray,\n summaries: summariesArray,\n isPiPoint,\n },\n () =>\n this.checkAttributeSegments(attributesArray, this.state.segments).then(() => {\n if (cb) {\n cb();\n }\n })\n );\n };\n\n // React action when component is initialized/updated\n scopedVarsDone = false;\n componentDidMount = () => {\n this.initialLoad(false);\n };\n componentDidUpdate = () => {\n if (this.props.data?.state === 'Done' && !!this.props.data?.request?.scopedVars && !this.scopedVarsDone) {\n this.scopedVarsDone = true;\n this.initialLoad(true);\n }\n };\n initialLoad = (force: boolean) => {\n const { query } = this.props;\n const metricsQuery = defaults(query, defaultQuery) as PIWebAPIQuery;\n const { segments, attributes, summary, isPiPoint } = metricsQuery;\n\n let segmentsArray: Array> = force ? [] : segments?.slice(0) ?? [];\n let attributesArray: Array> = force ? [] : attributes?.slice(0) ?? [];\n let summariesArray = summary?.types ?? [];\n\n if (!isPiPoint && segmentsArray.length === 0) {\n if (query.target && query.target.length > 0 && query.target !== ';') {\n attributesArray = [];\n // Build query from target\n this.buildFromTarget(query, segmentsArray, attributesArray)\n .then((_segmentsArray) => {\n this.updateArray(_segmentsArray, attributesArray, summariesArray, isPiPoint);\n })\n .catch((e) => console.error(e));\n return;\n } else {\n segmentsArray = this.checkAfServer();\n }\n } else if (isPiPoint && segmentsArray.length > 0) {\n this.piServer = segmentsArray;\n }\n this.updateArray(segmentsArray, attributesArray, summariesArray, isPiPoint, () => {\n this.onChange(query);\n });\n };\n\n onChange = (query: PIWebAPIQuery) => {\n const { onChange, onRunQuery } = this.props;\n\n query.summary.types = this.state.summaries;\n if (query.rawQuery) {\n query.target = query.query ?? '';\n\n if (query.target !== '') {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes[0].split('\\\\');\n\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n query.attributes = [];\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n query.elementPath = splitElements.join('\\\\');\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n query.attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n }\n }\n } else {\n query.elementPath = this.getSegmentPathUpTo(this.state.segments, this.state.segments.length);\n query.target =\n query.elementPath +\n ';' +\n join(\n query.attributes.map((s) => s.value?.value),\n ';'\n );\n }\n\n onChange(query);\n\n if (query.target && query.target.length > 0 && query.attributes.length > 0) {\n onRunQuery();\n }\n };\n\n stateCallback = () => {\n const query = this.props.query as PIWebAPIQuery;\n this.onChange(query);\n };\n\n onIsPiPointChange = (event: React.SyntheticEvent) => {\n const { query: queryChange } = this.props;\n const isPiPoint = !queryChange.isPiPoint;\n this.setState(\n {\n segments: isPiPoint ? [{ label: '' }] : this.checkAfServer(),\n attributes: [],\n isPiPoint,\n },\n () => {\n this.onChange({\n ...queryChange,\n expression: '',\n attributes: this.state.attributes,\n segments: this.state.segments,\n isPiPoint,\n });\n }\n );\n };\n\n render() {\n const { query: queryProps, onChange, onRunQuery } = this.props;\n const metricsQuery = defaults(queryProps, defaultQuery) as PIWebAPIQuery;\n const {\n interpolate,\n query,\n rawQuery,\n digitalStates,\n recordedValues,\n expression,\n isPiPoint,\n summary,\n display,\n regex,\n } = metricsQuery;\n\n return (\n <>\n \n \n \n\n {!!rawQuery && (\n \n \n ) =>\n onChange({ ...metricsQuery, query: event.target.value })\n }\n placeholder=\"enter query\"\n />\n \n this.textEditorChanged()} />\n \n )}\n\n {!rawQuery && (\n <>\n
\n \n {this.state.segments.map((segment: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSegmentChange(item, index)}\n loadOptions={(query?: string | undefined) => {\n return this.getElementSegments(index);\n }}\n allowCustomValue\n inputMinWidth={MIN_ELEM_INPUT_WIDTH}\n />\n );\n })}\n \n {!isPiPoint && (\n {\n onChange({ ...metricsQuery, query: metricsQuery.target, rawQuery: value });\n }}\n />\n )}\n \n
\n\n \n {this.state.attributes.map((attribute: SelectableValue, index: number) => {\n if (isPiPoint) {\n return (\n }\n disabled={this.piServer.length === 0}\n onChange={(item) => this.onPiPointChange(item, index)}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n }\n return (\n }\n disabled={this.state.segments.length <= 2}\n onChange={(item) => this.onAttributeChange(item, index)}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n })}\n\n {isPiPoint && (\n \n }\n disabled={this.piServer.length === 0}\n onChange={this.onAttributeAction}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n {!isPiPoint && (\n \n }\n disabled={this.state.segments.length <= 2}\n onChange={this.onAttributeAction}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n \n \n )}\n\n {!isPiPoint && (\n \n ) =>\n this.onChange({ ...metricsQuery, expression: event.target.value })\n }\n placeholder=\"'.'*2\"\n />\n \n )}\n\n \n \n ) =>\n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, maxNumber: parseInt(event.target.value, 10) },\n })\n }\n type=\"number\"\n placeholder=\"1000\"\n />\n \n \n \n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, enable: !recordedValues.enable },\n })\n }\n />\n \n \n \n this.onChange({ ...metricsQuery, digitalStates: { ...digitalStates, enable: !digitalStates.enable } })\n }\n />\n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n \n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, enable: !interpolate.enable } })\n }\n />\n \n \n }\n onChange={this.calcNoDataValueChanged}\n options={this.getNoDataSegments()}\n allowCustomValue\n />\n \n \n\n \n \n ) =>\n onChange({ ...metricsQuery, summary: { ...summary, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n }\n onChange={this.calcBasisValueChanged}\n options={this.getCalcBasisSegments()}\n allowCustomValue\n />\n \n \n \n {this.state.summaries.map((s: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSummaryValueChanged(item, index)}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n );\n })}\n \n }\n onChange={this.onSummaryAction}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n \n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, display: event.target.value })\n }\n placeholder=\"Display\"\n />\n \n \n {\n this.onChange({ ...metricsQuery, regex: { ...regex, enable: !regex.enable } });\n }}\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, search: event.target.value } })\n }\n placeholder=\"(.*)\"\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, replace: event.target.value } })\n }\n placeholder=\"$1\"\n />\n \n \n \n );\n }\n}\n","import { curry, each, filter, flatten, forOwn, groupBy, keys, map, uniq } from 'lodash';\n\nimport {\n DataQueryRequest,\n DataQueryResponse,\n DataSourceApi,\n DataSourceInstanceSettings,\n AnnotationEvent,\n toDataFrame,\n MetricFindValue,\n} from '@grafana/data';\nimport { BackendSrv, getBackendSrv, getTemplateSrv, TemplateSrv } from '@grafana/runtime';\n\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\ninterface PiwebapiElementPath {\n path: string;\n variable: string;\n}\n\ninterface PiwebapiInternalRsp {\n data: PiwebapiRsp;\n status: number;\n url: string;\n}\n\ninterface PiwebapTargetRsp {\n refId: string;\n target: string;\n datapoints: any[];\n}\n\ninterface PiwebapiRsp {\n Name?: string;\n InstanceType?: string;\n Items?: PiwebapiRsp[];\n WebId?: string;\n HasChildren?: boolean;\n Path?: string;\n}\n\ninterface PiDataServer {\n name: string | undefined;\n webid: string | undefined;\n}\n\nexport class PiWebAPIDatasource extends DataSourceApi {\n piserver: PiDataServer;\n afserver: PiDataServer;\n afdatabase: PiDataServer;\n\n basicAuth?: string;\n withCredentials?: boolean;\n url: string;\n name: string;\n isProxy = false;\n\n templateSrv: TemplateSrv;\n backendSrv: BackendSrv;\n\n piwebapiurl?: string;\n webidCache: Map = new Map();\n\n error: any;\n\n constructor(instanceSettings: DataSourceInstanceSettings) {\n super(instanceSettings);\n this.basicAuth = instanceSettings.basicAuth;\n this.withCredentials = instanceSettings.withCredentials;\n this.url = instanceSettings.url!;\n this.name = instanceSettings.name;\n this.templateSrv = getTemplateSrv();\n this.backendSrv = getBackendSrv();\n\n this.piwebapiurl = instanceSettings.jsonData.url?.toString();\n this.isProxy = /^http(s)?:\\/\\//.test(this.url) || instanceSettings.jsonData.access === 'proxy';\n\n this.piserver = { name: (instanceSettings.jsonData || {}).piserver, webid: undefined };\n this.afserver = { name: (instanceSettings.jsonData || {}).afserver, webid: undefined };\n this.afdatabase = { name: (instanceSettings.jsonData || {}).afdatabase, webid: undefined };\n\n Promise.all([\n this.getAssetServer(this.afserver.name).then((result: PiwebapiRsp) => (this.afserver.webid = result.WebId)),\n this.getDataServer(this.piserver.name).then((result: PiwebapiRsp) => (this.piserver.webid = result.WebId)),\n this.getDatabase(this.afserver.name ? this.afserver.name + '\\\\' + this.afdatabase.name : undefined).then(\n (result: PiwebapiRsp) => (this.afdatabase.webid = result.WebId)\n ),\n ]);\n }\n\n /**\n * Converts a PIWebAPI Event Frame response to a Grafana Annotation\n *\n * @param {any} annotationOptions - Options data from configuration panel.\n * @param {any} endTime - End time of the Event Frame.\n * @param {any} eventFrame - The Event Frame data.\n * @returns - Grafana Annotation\n *\n * @memberOf PiWebApiDatasource\n */\n private eventFrameToAnnotation(\n annotationOptions: any,\n endTime: any,\n eventFrame: any,\n attributeDataItems: any\n ): AnnotationEvent {\n if (annotationOptions.regex && annotationOptions.regex.enable) {\n eventFrame.Name = eventFrame.Name.replace(\n new RegExp(annotationOptions.regex.search),\n annotationOptions.regex.replace\n );\n }\n\n var attributeText = '';\n if (attributeDataItems) {\n each(attributeDataItems, (attributeData: any) => {\n const attributeValue = attributeData.Value.Value\n ? attributeData.Value.Value.Name || attributeData.Value.Value.Value || attributeData.Value.Value\n : null;\n attributeText += '
' + attributeData.Name + ': ' + attributeValue;\n });\n }\n return {\n annotation: annotationOptions,\n title: (endTime ? 'END ' : annotationOptions.showEndTime ? 'START ' : '') + annotationOptions.name,\n time: new Date(endTime ? eventFrame.EndTime : eventFrame.StartTime).getTime(),\n text:\n eventFrame.Name + attributeText + '
Start: ' + eventFrame.StartTime + '
End: ' + eventFrame.EndTime,\n };\n }\n\n /**\n * Builds the PIWebAPI query parameters.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - PIWebAPI query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private buildQueryParameters(options: DataQueryRequest) {\n options.targets = filter(options.targets, (target) => {\n if (!target || !target.target) {\n return false;\n }\n return !target.target.startsWith('Select AF');\n });\n\n options.targets = map(options.targets, (target) => {\n const ds = this;\n var tar = {\n target: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPath: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPathArray: [\n {\n path: this.templateSrv.replace(target.elementPath, options.scopedVars),\n variable: '',\n } as PiwebapiElementPath,\n ],\n attributes: map(target.attributes, (att) =>\n this.templateSrv.replace(att.value?.value || att, options.scopedVars)\n ),\n segments: map(target.segments, (att) => this.templateSrv.replace(att.value?.value, options.scopedVars)),\n display: target.display,\n refId: target.refId,\n hide: target.hide,\n interpolate: target.interpolate || { enable: false },\n recordedValues: target.recordedValues || { enable: false },\n digitalStates: target.digitalStates || { enable: false },\n webid: target.webid,\n webids: target.webids || [],\n regex: target.regex || { enable: false },\n expression: target.expression || '',\n summary: target.summary || { types: [] },\n startTime: options.range.from,\n endTime: options.range.to,\n isPiPoint: target.isPiPoint,\n scopedVars: options.scopedVars,\n };\n\n if (tar.expression) {\n tar.expression = this.templateSrv.replace(tar.expression, options.scopedVars);\n }\n\n if (tar.summary.types !== undefined) {\n tar.summary.types = filter(tar.summary.types, (item) => {\n return item !== undefined && item !== null && item !== '';\n });\n }\n\n // explode All or Multi-selection\n const varsKeys = keys(options.scopedVars);\n this.templateSrv.getVariables().forEach((v: any) => {\n if (ds.isAllSelected(v.current) && varsKeys.indexOf(v.name) < 0) {\n // All selection\n const variables = v.options.filter((o: any) => !o.selected);\n // attributes\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) =>\n !!v.allValue ? attr.replace(v.allValue, vv.value) : attr.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value)\n )\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, v.allValue);\n } else if (Array.isArray(v.current.text) && varsKeys.indexOf(v.name) < 0) {\n // Multi-selection\n const variables = v.options.filter((o: any) => o.selected);\n // attributes\n const query = v.current.value.join(',');\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) => attr.replace(`{${query}}`, vv.value))\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, `{${query}}`);\n }\n });\n\n return tar;\n });\n\n return options;\n }\n\n /**\n * Datasource Implementation. Primary entry point for data source.\n * This takes the panel configuration and queries, sends them to PI Web API and parses the response.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - Promise of data in the format for Grafana panels.\n *\n * @memberOf PiWebApiDatasource\n */\n async query(options: DataQueryRequest): Promise {\n var ds = this;\n var query = this.buildQueryParameters(options);\n query.targets = filter(query.targets, (t) => !t.hide);\n\n if (query.targets.length <= 0) {\n return Promise.resolve({ data: [] });\n } else {\n return Promise.all(ds.getStream(query)).then((targetResponses) => {\n let flattened: PiwebapTargetRsp[] = [];\n each(targetResponses, (tr) => {\n each(tr, (item) => flattened.push(item));\n });\n const response: DataQueryResponse = {\n data: flattened\n .sort((a, b) => {\n return +(a.target > b.target) || +(a.target === b.target) - 1;\n })\n .map((d) => toDataFrame(d)),\n };\n return response;\n });\n }\n }\n\n /**\n * Datasource Implementation.\n * Used for testing datasource in datasource configuration pange\n *\n * @returns - Success or failure message.\n *\n * @memberOf PiWebApiDatasource\n */\n testDatasource(): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + '/',\n method: 'GET',\n })\n .then((response: any) => {\n if (response.status === 200) {\n return { status: 'success', message: 'Data source is working', title: 'Success' };\n }\n throw new Error('Failed');\n });\n }\n\n /**\n * Datasource Implementation.\n * This queries PI Web API for Event Frames and converts them into annotations.\n *\n * @param {any} options - Annotation options, usually the Event Frame Category.\n * @returns - A Grafana annotation.\n *\n * @memberOf PiWebApiDatasource\n */\n annotationQuery(options: any): Promise {\n if (!this.afdatabase.webid) {\n return Promise.resolve([]);\n }\n\n var categoryName = options.annotation.query.categoryName\n ? this.templateSrv.replace(options.annotation.query.categoryName, options.scopedVars, 'glob')\n : null;\n var nameFilter = options.annotation.query.nameFilter\n ? this.templateSrv.replace(options.annotation.query.nameFilter, options.scopedVars, 'glob')\n : null;\n var templateName = options.annotation.template ? options.annotation.template.Name : null;\n var annotationOptions = {\n name: options.annotation.name,\n datasource: options.annotation.datasource,\n enable: options.annotation.enable,\n iconColor: options.annotation.iconColor,\n showEndTime: options.annotation.showEndTime,\n regex: options.annotation.regex,\n attribute: options.annotation.attribute,\n categoryName: categoryName,\n templateName: templateName,\n nameFilter: nameFilter,\n };\n\n var filter = [];\n if (!!annotationOptions.categoryName) {\n filter.push('categoryName=' + annotationOptions.categoryName);\n }\n if (!!annotationOptions.nameFilter) {\n filter.push('nameFilter=' + annotationOptions.nameFilter);\n }\n if (!!annotationOptions.templateName) {\n filter.push('templateName=' + annotationOptions.templateName);\n }\n if (!filter.length) {\n return Promise.resolve([]);\n }\n filter.push('startTime=' + options.range.from.toJSON());\n filter.push('endTime=' + options.range.to.toJSON());\n\n if (annotationOptions.attribute && annotationOptions.attribute.enable) {\n var resourceUrl =\n this.piwebapiurl + '/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n if (!!annotationOptions.attribute.name) {\n resourceUrl =\n this.piwebapiurl +\n '/streamsets/{0}/value?nameFilter=' +\n annotationOptions.attribute.name +\n '&selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n }\n var query: any = {};\n query['1'] = {\n Method: 'GET',\n Resource: this.piwebapiurl + '/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&'),\n };\n query['2'] = {\n Method: 'GET',\n RequestTemplate: {\n Resource: resourceUrl,\n },\n Parameters: ['$.1.Content.Items[*].WebId'],\n ParentIds: ['1'],\n };\n return this.restBatch(query).then((result: any) => {\n const data = result.data['1'].Content;\n const valueData = result.data['2'].Content;\n\n var annotations = map(data.Items, (item: any, index: any) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n false,\n item,\n valueData.Items[index].Content.Items\n );\n });\n\n if (options.annotation.showEndTime) {\n var ends = map(data.Items, (item: any, index: number) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n true,\n item,\n valueData.Items[index].Content.Items\n );\n });\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n\n return annotations;\n });\n } else {\n return this.restGet('/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&')).then(\n (result) => {\n var annotations = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, false));\n if (options.annotation.showEndTime) {\n var ends = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, true));\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n return annotations;\n }\n );\n }\n }\n\n /**\n * Builds the Grafana metric segment for use on the query user interface.\n *\n * @param {any} response - response from PI Web API.\n * @returns - Grafana metric segment.\n *\n * @memberOf PiWebApiDatasource\n */\n private metricQueryTransform(response: PiwebapiRsp[]): MetricFindValue[] {\n return map(response, (item) => {\n return {\n text: item.Name,\n expandable:\n item.HasChildren === undefined || item.HasChildren === true || (item.Path ?? '').split('\\\\').length <= 3,\n HasChildren: item.HasChildren,\n Items: item.Items ?? [],\n Path: item.Path,\n WebId: item.WebId,\n } as MetricFindValue;\n });\n }\n\n /**\n * This method does the discovery of the AF Hierarchy and populates the query user interface segments.\n *\n * @param {any} query - Parses the query configuration and builds a PI Web API query.\n * @returns - Segment information.\n *\n * @memberOf PiWebApiDatasource\n */\n metricFindQuery(query: any, queryOptions: any): Promise {\n var ds = this;\n var querydepth = ['servers', 'databases', 'databaseElements', 'elements'];\n if (typeof query === 'string') {\n query = JSON.parse(query as string);\n }\n if (queryOptions.isPiPoint) {\n query.path = this.templateSrv.replace(query.path, queryOptions);\n } else {\n if (query.path === '') {\n query.type = querydepth[0];\n } else if (query.type !== 'attributes') {\n query.type = querydepth[Math.max(0, Math.min(query.path.split('\\\\').length, querydepth.length - 1))];\n }\n query.path = this.templateSrv.replace(query.path, queryOptions);\n query.path = query.path.replace(/\\{([^\\\\])*\\}/gi, (r: string) => r.substring(1, r.length - 2).split(',')[0]);\n }\n\n query.filter = query.filter ?? '*';\n\n if (query.type === 'servers') {\n return ds.afserver?.name\n ? ds\n .getAssetServer(ds.afserver.name)\n .then((result: PiwebapiRsp) => [result])\n .then(ds.metricQueryTransform)\n : ds.getAssetServers().then(ds.metricQueryTransform);\n } else if (query.type === 'databases') {\n return ds\n .getAssetServer(query.path)\n .then((server) => ds.getDatabases(server.WebId ?? '', {}))\n .then(ds.metricQueryTransform);\n } else if (query.type === 'databaseElements') {\n return ds\n .getDatabase(query.path)\n .then((db) =>\n ds.getDatabaseElements(db.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'elements') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getElements(element.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'attributes') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getAttributes(element.WebId ?? '', {\n searchFullHierarchy: 'true',\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Path',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'dataserver') {\n return ds.getDataServers().then(ds.metricQueryTransform);\n } else if (query.type === 'pipoint') {\n return ds.piPointSearch(query.webId, query.pointName).then(ds.metricQueryTransform);\n }\n return Promise.reject('Bad type');\n }\n\n /**\n * Gets the url of summary data from the query configuration.\n *\n * @param {any} summary - Query summary configuration.\n * @returns - URL append string.\n *\n * @memberOf PiWebApiDatasource\n */\n getSummaryUrl(summary: any) {\n if (summary.interval.trim() === '') {\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis\n );\n }\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis +\n '&summaryDuration=' +\n summary.interval.trim()\n );\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} value - A list of PIWebAPI values.\n * @param {any} target - The target Grafana metric.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @returns - An array of Grafana value, timestamp pairs.\n *\n */\n parsePiPointValueList(value: any[], target: any, isSummary: boolean) {\n var api = this;\n var datapoints: any[] = [];\n each(value, (item) => {\n // @ts-ignore\n var { grafanaDataPoint, previousValue, drop } = this.noDataReplace(\n isSummary ? item.Value : item,\n target.summary.nodata,\n api.parsePiPointValue(isSummary ? item.Value : item, target, isSummary)\n );\n if (!drop) {\n datapoints.push(grafanaDataPoint);\n }\n });\n return datapoints;\n }\n\n /**\n * Convert a PI Point value to use Grafana value/timestamp.\n *\n * @param {any} value - PI Point value.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @param {any} target - The target grafana metric.\n * @returns - Grafana value pair.\n *\n */\n parsePiPointValue(value: any, target: any, isSummary: boolean) {\n let num = !isSummary && typeof value.Value === 'object' ? value.Value?.Value : value.Value;\n\n if (!value.Good || !!target.digitalStates?.enable) {\n num = (!isSummary && typeof value.Value === 'object' ? value.Value?.Name : value.Name) ?? '';\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} item - 'Item' object from PIWebAPI\n * @param {any} noDataReplacementMode - String state of how to replace 'No Data'\n * @param {any} grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns perviousValue - {any} Grafana value (value only).\n *\n */\n noDataReplace(\n item: any,\n noDataReplacementMode: any,\n grafanaDataPoint: any[]\n ): {\n grafanaDataPoint: any[];\n previousValue: any;\n drop: boolean;\n } {\n var previousValue = null;\n var drop = false;\n if (!item.Good || item.Value === 'No Data' || (item.Value?.Name && item.Value?.Name === 'No Data')) {\n if (noDataReplacementMode === 'Drop') {\n drop = true;\n } else if (noDataReplacementMode === '0') {\n grafanaDataPoint[0] = 0;\n } else if (noDataReplacementMode === 'Keep') {\n // Do nothing keep\n } else if (noDataReplacementMode === 'Null') {\n grafanaDataPoint[0] = null;\n } else if (noDataReplacementMode === 'Previous' && previousValue !== null) {\n grafanaDataPoint[0] = previousValue;\n }\n } else {\n previousValue = item.Value;\n }\n return { grafanaDataPoint, previousValue, drop };\n }\n\n /**\n * Process the response from PI Web API for a single item.\n *\n * @param {any} content - Web response data.\n * @param {any} target - The target grafana metric.\n * @param {any} name - The target metric name.\n * @returns - Parsed metric in target/datapoint json format.\n *\n * @memberOf PiWebApiDatasource\n */\n processResults(content: any, target: any, name: any, noTemplate: boolean): PiwebapTargetRsp[] {\n const api = this;\n const isSummary: boolean = target.summary && target.summary.types && target.summary.types.length > 0;\n name = noTemplate ? name : this.getPath(target.elementPathArray, content.Path) + '|' + name;\n if (target.regex && target.regex.enable && target.regex.search.length && target.regex.replace.length) {\n name = name.replace(new RegExp(target.regex.search), target.regex.replace);\n }\n if (isSummary) {\n var innerResults: any[] = [];\n var groups = groupBy(content.Items, (item: any) => item.Type);\n forOwn(groups, (value, key) => {\n innerResults.push({\n refId: target.refId,\n target: name + '[' + key + ']',\n datapoints: api.parsePiPointValueList(value, target, isSummary),\n });\n });\n return innerResults;\n }\n return [\n {\n refId: target.refId,\n target: name,\n datapoints: api.parsePiPointValueList(content.Items, target, isSummary),\n },\n ];\n }\n\n /** PRIVATE SECTION */\n\n /**\n * Check if all items are selected.\n *\n * @param {any} current the current variable selection\n * @return {boolean} true if all value is selected, false otherwise\n */\n private isAllSelected(current: any): boolean {\n if (!current) {\n return false;\n }\n if (Array.isArray(current.text)) {\n return current.text.indexOf('All') >= 0;\n }\n return current.text === 'All';\n }\n\n /**\n * Check if the value is a number.\n *\n * @param {any} number the value to check\n * @returns {boolean} true if the value is a number, false otherwise\n */\n private checkNumber(number: any): boolean {\n return typeof number === 'number' && !Number.isNaN(number) && Number.isFinite(number);\n }\n\n /**\n * Returns a new element path list based on the panel variables.\n *\n * @param {string} elementPathArray array of element paths\n * @param {string} variables the list of variable values\n * @param {string} allValue the all value value for the variable\n * @returns {PiwebapiElementPath[]} new element path list\n */\n private getElementPath(\n elementPathArray: PiwebapiElementPath[],\n variables: any[],\n allValue: string\n ): PiwebapiElementPath[] {\n // elementPath\n let newElementPathArray: PiwebapiElementPath[] = [];\n elementPathArray.forEach((elem: PiwebapiElementPath) => {\n if ((!!allValue && elem.path.indexOf(allValue) >= 0) || (!allValue && elem.path.match(/{[a-zA-z0-9,-_]+}/gi))) {\n const temp: PiwebapiElementPath[] = variables.map((vv: any) => {\n return {\n path: !!allValue\n ? elem.path.replace(allValue, vv.value)\n : elem.path.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value),\n variable: vv.value,\n } as PiwebapiElementPath;\n });\n newElementPathArray = newElementPathArray.concat(temp);\n }\n });\n if (newElementPathArray.length) {\n return uniq(flatten(newElementPathArray));\n }\n return elementPathArray;\n }\n\n /**\n * Returns the last item of the element path.\n *\n * @param {string} path element path\n * @returns {string} last item of the element path\n */\n private getPath(elementPathArray: PiwebapiElementPath[], path: string): string {\n let splitPath = path.split('|');\n if (splitPath.length === 0) {\n return '';\n }\n if (elementPathArray.length === 0) {\n return '';\n }\n splitPath = splitPath[0].split('\\\\');\n const splitStr = splitPath.length === 0 ? '' : splitPath.pop() ?? '';\n const foundElement = elementPathArray.find((e) => path.indexOf(e.path) >= 0)?.variable;\n return foundElement ? foundElement + '|' + splitStr : splitStr;\n }\n\n /**\n * Gets historical data from a PI Web API stream source.\n *\n * @param {any} query - Grafana query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private getStream(query: any): Array> {\n const ds = this;\n var results: Array> = [];\n\n each(query.targets, (target) => {\n target.attributes = filter(target.attributes || [], (attribute) => {\n return 1 && attribute;\n });\n var url = '';\n var isSummary = target.summary && target.summary.types && target.summary.types.length > 0;\n var isInterpolated = target.interpolate && target.interpolate.enable;\n // perhaps add a check to see if interpolate override time < query.interval\n var intervalTime = target.interpolate.interval ? target.interpolate.interval : query.interval;\n var timeRange = '?startTime=' + query.range.from.toJSON() + '&endTime=' + query.range.to.toJSON();\n var targetName = target.expression || target.elementPath;\n var displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n if (target.expression) {\n url += '/calculation';\n if (isSummary) {\n url += '/summary' + timeRange + (isInterpolated ? '&sampleType=Interval&sampleInterval=' + intervalTime : '');\n } else {\n url += '/intervals' + timeRange + '&sampleInterval=' + intervalTime;\n }\n url += '&expression=' + encodeURIComponent(target.expression);\n if (target.attributes.length > 0) {\n results.push(ds.internalStream(query, target, url));\n } else {\n results.push(\n ds.restGetWebId(target.elementPath, target.isPiPoint).then((webidresponse: any) => {\n return ds\n .restPost(url + webidresponse.WebId)\n .then((response: any) => ds.processResults(response.data, target, displayName || targetName, false))\n .catch((err: any) => (ds.error = err));\n })\n );\n }\n } else {\n url += '/streamsets';\n if (isSummary) {\n url += '/summary' + timeRange + '&intervals=' + query.maxDataPoints + this.getSummaryUrl(target.summary);\n } else if (target.interpolate && target.interpolate.enable) {\n url += '/interpolated' + timeRange + '&interval=' + intervalTime;\n } else if (target.recordedValues && target.recordedValues.enable) {\n const maxNumber =\n target.recordedValues.maxNumber && !isNaN(target.recordedValues.maxNumber)\n ? target.recordedValues.maxNumber\n : 1000;\n url += '/recorded' + timeRange + '&maxCount=' + maxNumber;\n } else {\n url += '/plot' + timeRange + '&intervals=' + query.maxDataPoints;\n }\n\n results.push(ds.internalStream(query, target, url));\n }\n });\n\n return results;\n }\n\n /**\n * Return the data points from the provided Grafana query.\n *\n * @param {any} query - Grafana query.\n * @param {any} target - Grafana query target.\n * @param {string} url - The base URL for the query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private internalStream(query: any, target: any, url: string): Promise {\n const ds = this;\n const targetName = target.expression || target.elementPath;\n const displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n const noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path;\n let promises: Promise;\n\n if (noTemplate) {\n if (target.attributes.length > 1) {\n promises = ds\n .restGetWebId(target.elementPath, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n } else {\n promises = Promise.all(\n map(target.attributes, (attribute: string) =>\n ds.restGetWebId(target.elementPath + '|' + attribute, target.isPiPoint)\n )\n );\n }\n } else {\n if (target.attributes.length > 1) {\n promises = Promise.all(\n target.elementPathArray.map((elementPath: PiwebapiElementPath) => {\n return ds\n .restGetWebId(elementPath.path, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n })\n );\n } else {\n promises = Promise.all(\n flatten(\n map(target.attributes, (attribute: string) => {\n return target.elementPathArray.map((elementPath: PiwebapiElementPath) =>\n ds.restGetWebId(elementPath.path + '|' + attribute, target.isPiPoint)\n );\n })\n )\n );\n }\n }\n\n return promises.then((webidresponse) => {\n const query: any = {};\n each(flatten(webidresponse), (webid, index) => {\n query[index + 1] = {\n Method: 'GET',\n Resource: ds.piwebapiurl + url + '&webid=' + webid.WebId,\n };\n });\n\n return ds\n .restBatch(query)\n .then((response: any) => {\n const targetResults: any[] = [];\n each(response.data, (value, key) => {\n if (target.expression) {\n const attribute = webidresponse[parseInt(key, 10) - 1].Name;\n each(\n ds.processResults(value.Content, target, displayName || attribute || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n } else {\n each(value.Content.Items, (item) => {\n each(\n ds.processResults(item, target, displayName || item.Name || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n });\n }\n });\n return targetResults;\n })\n .catch((err: any) => (ds.error = err));\n });\n }\n\n /**\n * Abstraction for calling the PI Web API REST endpoint\n *\n * @param {any} path - the path to append to the base server URL.\n * @returns - The full URL.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGet(path: string): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n return response as PiwebapiInternalRsp;\n });\n }\n\n /**\n * Resolve a Grafana query into a PI Web API webid. Uses client side cache when possible to reduce lookups.\n *\n * @param {string} assetPath - The AF Path or the Pi Point Path (\\\\ServerName\\piPointName) to the asset.\n * @param {boolean} isPiPoint - Flag indicating it's a PI Point\n * @returns - URL query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGetWebId(assetPath: string, isPiPoint: boolean): Promise {\n var ds = this;\n\n // check cache\n var cachedWebId = ds.webidCache.get(assetPath);\n if (cachedWebId) {\n return Promise.resolve({ Path: assetPath, WebId: cachedWebId.WebId, Name: cachedWebId.Name });\n }\n\n let path = '';\n if (isPiPoint) {\n path = '/points?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\' + assetPath.replace('|', '\\\\');\n } else {\n // no cache hit, query server\n path =\n (assetPath.indexOf('|') >= 0\n ? '/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\'\n : '/elements?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\') + assetPath;\n }\n\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n ds.webidCache.set(assetPath, response.data);\n return { Path: assetPath, WebId: response.data.WebId, Name: response.data.Name };\n });\n }\n\n /**\n * Execute a batch query on the PI Web API.\n *\n * @param {any} batch - Batch JSON query data.\n * @returns - Batch response.\n *\n * @memberOf PiWebApiDatasource\n */\n private restBatch(batch: any) {\n return this.backendSrv.datasourceRequest({\n url: this.url + '/batch',\n data: batch,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n },\n });\n }\n\n /**\n * Execute a POST on the PI Web API.\n *\n * @param {string} path - The full url of the POST.\n * @returns - POST response data.\n *\n * @memberOf PiWebApiDatasource\n */\n private restPost(path: string) {\n return this.backendSrv.datasourceRequest({\n url: this.url,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n 'X-PIWEBAPI-HTTP-METHOD': 'GET',\n 'X-PIWEBAPI-RESOURCE-ADDRESS': path,\n },\n });\n }\n\n // Get a list of all data (PI) servers\n private getDataServers(): Promise {\n return this.restGet('/dataservers').then((response) => response.data.Items ?? []);\n }\n private getDataServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/dataservers?name=' + name).then((response) => response.data);\n }\n // Get a list of all asset (AF) servers\n private getAssetServers(): Promise {\n return this.restGet('/assetservers').then((response) => response.data.Items ?? []);\n }\n private getAssetServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/assetservers?path=\\\\\\\\' + name).then((response) => response.data);\n }\n private getDatabase(path: string | undefined): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/assetdatabases?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getDatabases(serverId: string, options?: any): Promise {\n if (!serverId) {\n return Promise.resolve([]);\n }\n return this.restGet('/assetservers/' + serverId + '/assetdatabases').then((response) => response.data.Items ?? []);\n }\n getElement(path: string): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/elements?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getEventFrameTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'EventFrame');\n });\n }\n getElementTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'Element');\n });\n }\n\n /**\n * @description\n * Get the child attributes of the current resource.\n * GET attributes/{webId}/attributes\n * @param {string} elementId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.nameFilter - The name query string used for finding attributes. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned attributes must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned attributes must be members of this template. The default is no template filter.\n * @param {string} options.valueType - Specify that returned attributes' value type must be the given value type. The default is no value type filter.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include attributes nested further than the immediate attributes of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {string} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {string} options.showExcluded - Specified if the search should include attributes with the Excluded property set. The default is 'false'.\n * @param {string} options.showHidden - Specified if the search should include attributes with the Hidden property set. The default is 'false'.\n * @param {string} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getAttributes(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/attributes' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET assetdatabases/{webId}/elements\n * @param {string} databaseId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getDatabaseElements(databaseId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/assetdatabases/' + databaseId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET elements/{webId}/elements\n * @param {string} databaseId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getElements(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * Retrieve a list of points on a specified Data Server.\n *\n * @param {string} serverId - The ID of the server. See WebID for more information.\n * @param {string} nameFilter - A query string for filtering by point name. The default is no filter. *, ?, [ab], [!ab]\n */\n private piPointSearch(serverId: string, nameFilter: string): Promise {\n let filter1 = this.templateSrv.replace(nameFilter);\n let filter2 = `${filter1}`;\n let doFilter = false;\n if (filter1 !== nameFilter) {\n const regex = /\\{(\\w|,)+\\}/gs;\n let m;\n while ((m = regex.exec(filter1)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // The result can be accessed through the `m`-variable.\n m.forEach((match, groupIndex) => {\n if (groupIndex === 0) {\n filter1 = filter1.replace(match, match.replace('{', '(').replace('}', ')').replace(',', '|'));\n filter2 = filter2.replace(match, '*');\n doFilter = true;\n }\n });\n }\n }\n return this.restGet('/dataservers/' + serverId + '/points?maxCount=20&nameFilter=' + filter2).then((results) => {\n if (!!results && !!results.data?.Items) {\n return doFilter ? results.data.Items.filter((item) => item.Name?.match(filter1)) : results.data.Items;\n }\n return [];\n });\n }\n\n /**\n * Get the PI Web API webid or PI Point.\n *\n * @param {any} target - AF Path or Point name.\n * @returns - webid.\n *\n * @memberOf PiWebApiDatasource\n */\n getWebId(target: any) {\n var ds = this;\n var isAf = target.target.indexOf('\\\\') >= 0;\n var isAttribute = target.target.indexOf('|') >= 0;\n if (!isAf && target.target.indexOf('.') === -1) {\n return Promise.resolve([{ WebId: target.target, Name: target.display || target.target }]);\n }\n\n if (!isAf) {\n // pi point lookup\n return ds.piPointSearch(this.piserver.webid!, target.target).then((results) => {\n if (results === undefined || results.length === 0) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n return results;\n });\n } else if (isAf && isAttribute) {\n // af attribute lookup\n return ds.restGet('/attributes?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n } else {\n // af element lookup\n return ds.restGet('/elements?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n }\n }\n}\n","import { DataSourcePlugin } from '@grafana/data';\nimport { AnnotationsQueryCtrl } from './AnnotationsQueryCtrl';\nimport { PIWebAPIConfigEditor } from './ConfigEditor';\nimport { PIWebAPIQueryEditor } from './QueryEditor';\nimport { PiWebAPIDatasource } from './datasource';\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\nexport const plugin = new DataSourcePlugin(\n PiWebAPIDatasource\n)\n .setConfigEditor(PIWebAPIConfigEditor)\n .setQueryEditor(PIWebAPIQueryEditor)\n .setAnnotationQueryCtrl(AnnotationsQueryCtrl);\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__0__","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__3__","__WEBPACK_EXTERNAL_MODULE__5__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","AnnotationsQueryCtrl","$scope","this","annotation","ctrl","datasource","query","databases","templates","regex","attribute","showEndTime","getAssetServer","afserver","name","then","result","getDatabases","WebId","getEventFrames","webid","dbs","$apply","getEventFrameTemplates","database","FormField","LegacyForms","coerceOptions","options","jsonData","url","PIWebAPIConfigEditor","event","props","onOptionsChange","piserver","target","afdatabase","originalOptions","DataSourceHttpSettings","defaultUrl","dataSourceConfig","onChange","onMyOptionsChange","showAccessOptions","className","label","labelWidth","inputWidth","onPIServerChange","placeholder","onAFServerChange","onAFDatabaseChange","PureComponent","QueryField","tooltip","children","InlineFormLabel","width","QueryRowTerminator","QueryInlineField","QueryEditorRow","QueryRawInlineField","QueryRawEditorRow","defaultQuery","attributes","segments","enable","summary","types","basis","interval","nodata","expression","interpolate","recordedValues","digitalStates","isPiPoint","QueryEditorModeSwitcher","isRaw","useState","isModalOpen","setModalOpen","useEffect","Button","icon","variant","type","onClick","ConfirmModal","isOpen","title","body","confirmText","dismissText","onConfirm","onDismiss","LABEL_WIDTH","MIN_ATTR_INPUT_WIDTH","REMOVE_LABEL","CustomLabelComponent","Icon","PIWebAPIQueryEditor","summaries","attributeSegment","summarySegment","calculationBasisSegment","noDataReplacementSegment","setState","item","index","state","slice","remove","checkPiPointSegments","checkAttributeSegments","length","push","expandable","piServer","segmentChangeValue","currentSegment","data","findQuery","path","getSegmentPathUpTo","Promise","resolve","metricFindQuery","assign","request","scopedVars","items","altSegments","map","text","webId","variables","templateSrv","getVariables","each","variable","selectableValue","unshift","err","error","message","attributeText","getSelectedPIServer","pointName","Path","forOwn","availableAttributes","val","segmentsArray","attributesArray","splitAttributes","split","splitElements","splice","_","getElementSegments","elements","summariesArray","cb","initialLoad","scopedVarsDone","force","metricsQuery","defaults","buildFromTarget","_segmentsArray","updateArray","e","checkAfServer","onRunQuery","rawQuery","elementPath","join","s","queryChange","onSegmentChange","bind","calcBasisValueChanged","calcNoDataValueChanged","onSummaryAction","onSummaryValueChanged","onAttributeAction","onAttributeChange","summaryTypes","calculationBasis","noDataReplacement","segment","isValueEmpty","stateCallback","filter","indexOf","part","attributeChangeValue","arr","reduce","startsWith","attributesResponse","validAttributes","substring","filteredAttributes","attrib","changedValue","replace","webID","forEach","parts","match","queryProps","display","InlineField","InlineSwitch","onIsPiPointChange","InlineFieldRow","grow","Input","onBlur","textEditorChanged","SegmentAsync","Component","loadOptions","allowCustomValue","inputMinWidth","disabled","onPiPointChange","getAttributeSegmentsPI","reloadOptionsOnChange","Segment","getAttributeSegmentsAF","maxNumber","parseInt","getNoDataSegments","getCalcBasisSegments","getSummarySegments","search","PiWebAPIDatasource","instanceSettings","Map","basicAuth","withCredentials","getTemplateSrv","backendSrv","getBackendSrv","piwebapiurl","toString","isProxy","test","access","all","getDataServer","getDatabase","annotationOptions","endTime","eventFrame","attributeDataItems","Name","RegExp","attributeData","attributeValue","Value","time","Date","EndTime","StartTime","getTime","targets","ds","tar","elementPathArray","att","refId","hide","webids","startTime","range","from","to","varsKeys","keys","v","isAllSelected","current","selected","attr","vv","allValue","uniq","flatten","getElementPath","Array","isArray","buildQueryParameters","t","getStream","targetResponses","flattened","tr","sort","b","toDataFrame","datasourceRequest","method","response","status","Error","categoryName","nameFilter","templateName","template","iconColor","toJSON","resourceUrl","Method","Resource","RequestTemplate","Parameters","ParentIds","restBatch","Content","valueData","annotations","Items","curry","eventFrameToAnnotation","ends","end","restGet","HasChildren","queryOptions","querydepth","JSON","parse","Math","max","min","metricQueryTransform","getAssetServers","server","db","getDatabaseElements","selectedFields","getElement","element","getElements","getAttributes","searchFullHierarchy","getDataServers","piPointSearch","reject","trim","isSummary","api","datapoints","noDataReplace","parsePiPointValue","grafanaDataPoint","previousValue","drop","num","Good","checkNumber","Number","Timestamp","noDataReplacementMode","content","noTemplate","getPath","innerResults","groups","groupBy","Type","parsePiPointValueList","number","isNaN","isFinite","newElementPathArray","elem","temp","concat","splitPath","splitStr","pop","foundElement","find","results","isInterpolated","intervalTime","timeRange","targetName","displayName","encodeURIComponent","internalStream","restGetWebId","webidresponse","restPost","processResults","maxDataPoints","getSummaryUrl","datarsp","datarspa","targetResults","targetResult","headers","assetPath","cachedWebId","webidCache","set","batch","serverId","databaseId","InstanceType","elementId","querystring","filter1","filter2","doFilter","m","exec","lastIndex","groupIndex","isAf","isAttribute","DataSourceApi","plugin","DataSourcePlugin","setConfigEditor","setQueryEditor","setAnnotationQueryCtrl"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/plugin.json b/dist/plugin.json index 2d4b80a..c011793 100644 --- a/dist/plugin.json +++ b/dist/plugin.json @@ -32,8 +32,8 @@ } ], "screenshots": [], - "version": "2.1.1", - "updated": "2022-07-25" + "version": "2.1.2", + "updated": "2022-09-02" }, "dependencies": { "grafanaDependency": ">=8.4.0", diff --git a/package.json b/package.json index 7877071..3d6cb17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grid-protection-alliance-osisoftpi-grafana", - "version": "2.1.1", + "version": "3.0.0", "description": "OSISoft PI Grafana Plugin", "scripts": { "build": "grafana-toolkit plugin:build", @@ -13,10 +13,10 @@ "author": "GridProtectionAlliance", "license": "Apache-2.0", "devDependencies": { - "@grafana/data": "^8.5.0", - "@grafana/runtime": "^8.5.0", - "@grafana/toolkit": "^8.5.0", - "@grafana/ui": "^8.5.0", + "@grafana/data": "^9.1.2", + "@grafana/runtime": "^9.1.2", + "@grafana/toolkit": "^9.1.2", + "@grafana/ui": "^9.1.2", "@testing-library/jest-dom": "5.4.0", "@testing-library/react": "^10.0.2", "@types/lodash": "latest" diff --git a/src/datasource.ts b/src/datasource.ts index 79a50d7..a0fdfb5 100644 --- a/src/datasource.ts +++ b/src/datasource.ts @@ -562,8 +562,8 @@ export class PiWebAPIDatasource extends DataSourceApi=2.0.0 <4.0.0", chokidar@^3.4.1, chokidar@^3.4.2: +"chokidar@>=3.0.0 <4.0.0", chokidar@^3.4.2, chokidar@^3.5.3: version "3.5.3" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -3975,30 +4150,6 @@ chardet@^0.7.0: optionalDependencies: fsevents "~2.3.2" -chokidar@^2.1.8: - version "2.1.8" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" - integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.1" - braces "^2.3.2" - glob-parent "^3.1.0" - inherits "^2.0.3" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - normalize-path "^3.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.2.1" - upath "^1.1.1" - optionalDependencies: - fsevents "^1.2.7" - -chownr@^1.1.1, chownr@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - chrome-trace-event@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz" @@ -4006,51 +4157,28 @@ chrome-trace-event@^1.0.2: dependencies: tslib "^1.9.0" -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -cjs-module-lexer@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz#4186fcca0eae175970aee870b9fe2d6cf8d5655f" - integrity sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw== +ci-info@^3.2.0: + version "3.3.2" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.2.tgz#6d2967ffa407466481c6c90b6e16b3098f080128" + integrity sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg== -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" +cjs-module-lexer@^1.0.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" + integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== classnames@2.3.1, classnames@2.x, classnames@^2.2.1, classnames@^2.2.5, classnames@^2.2.6, classnames@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/classnames/-/classnames-2.3.1.tgz" integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA== -clean-css@4.2.x: - version "4.2.4" - resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.4.tgz#733bf46eba4e607c6891ea57c24a989356831178" - integrity sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A== +clean-css@^5.2.2: + version "5.3.1" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-5.3.1.tgz#d0610b0b90d125196a2894d35366f734e5d7aa32" + integrity sha512-lCr8OHhiWCTw4v8POJovCoh4T7I9U11yVsPjMWWnnMmp9ZowCxyad1Pathle/9HjaDp+fdQKjO9fQydE6RHTZg== dependencies: source-map "~0.6.0" -clean-stack@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" - integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== - cli-cursor@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz" @@ -4058,7 +4186,7 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" -cli-spinners@^2.2.0, cli-spinners@^2.5.0: +cli-spinners@^2.5.0: version "2.6.1" resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz" integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== @@ -4068,15 +4196,6 @@ cli-width@^3.0.0: resolved "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz" integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== -cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" - cliui@^7.0.2: version "7.0.4" resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" @@ -4086,25 +4205,11 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" -clone-deep@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" - integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== - dependencies: - is-plain-object "^2.0.4" - kind-of "^6.0.2" - shallow-clone "^3.0.0" - clone@^1.0.2: version "1.0.4" resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz" integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== -clone@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== - clsx@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz" @@ -4120,14 +4225,6 @@ collect-v8-coverage@^1.0.0: resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz" integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw== - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - color-convert@^1.9.0: version "1.9.3" resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" @@ -4157,14 +4254,14 @@ colord@^2.9.1: resolved "https://registry.npmjs.org/colord/-/colord-2.9.2.tgz" integrity sha512-Uqbg+J445nc1TKn4FoDPS6ZZqAvEDnwrH42yo8B40JSOgSLxMZ/gt3h4nmCtPLQeXhjJJkqBx7SCY35WnIixaQ== -combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: +combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" -command-exists@^1.2.8: +command-exists@^1.2.9: version "1.2.9" resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== @@ -4174,30 +4271,25 @@ commander@2, commander@^2.20.0, commander@^2.20.3: resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@2.17.x: - version "2.17.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" - integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== - commander@^7.2.0: version "7.2.0" resolved "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== -commander@^8.0.0: +commander@^8.3.0: version "8.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== -commander@~2.19.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" - integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== +commander@^9.2.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.0.tgz#bc4a40918fefe52e22450c111ecd6b7acce6f11c" + integrity sha512-sRPT+umqkz90UA8M1yqYfnHlZA7fF6nSphDtxeywPZ49ysjxDQybzk13CL+mXekDRG92skbcqCLVovuCusNmFw== -comment-parser@1.3.0: - version "1.3.0" - resolved "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.0.tgz" - integrity sha512-hRpmWIKgzd81vn0ydoWoyPoALEOnF4wt8yKD35Ib1D6XC2siLiYaiqfGkYrunuKdsXGwpBpHU3+9r+RVw2NZfA== +comment-parser@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-1.3.1.tgz#3d7ea3adaf9345594aedee6563f422348f165c1b" + integrity sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA== commondir@^1.0.1: version "1.0.1" @@ -4211,11 +4303,6 @@ component-classes@^1.2.5: dependencies: component-indexof "0.0.3" -component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - component-indexof@0.0.3: version "0.0.3" resolved "https://registry.npmjs.org/component-indexof/-/component-indexof-0.0.3.tgz" @@ -4226,40 +4313,6 @@ concat-map@0.0.1: resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -concat-stream@^1.5.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -concurrently@6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-6.3.0.tgz#63128cb4a6ed54d3c0ed8528728590a5fe54582a" - integrity sha512-k4k1jQGHHKsfbqzkUszVf29qECBrkvBKkcPJEUDTyVR7tZd1G/JOfnst4g1sYbFvJ4UjHZisj1aWQR8yLKpGPw== - dependencies: - chalk "^4.1.0" - date-fns "^2.16.1" - lodash "^4.17.21" - rxjs "^6.6.3" - spawn-command "^0.0.2-1" - supports-color "^8.1.0" - tree-kill "^1.2.2" - yargs "^16.2.0" - -console-browserify@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" - integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== - -constants-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - integrity sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ== - convert-source-map@^1.4.0, convert-source-map@^1.5.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: version "1.8.0" resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz" @@ -4274,23 +4327,6 @@ copy-anything@^2.0.1: dependencies: is-what "^3.14.1" -copy-concurrently@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" - integrity sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A== - dependencies: - aproba "^1.1.1" - fs-write-stream-atomic "^1.0.8" - iferr "^0.1.5" - mkdirp "^0.5.1" - rimraf "^2.5.4" - run-queue "^1.0.0" - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw== - copy-to-clipboard@^3.3.1: version "3.3.1" resolved "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz" @@ -4298,30 +4334,24 @@ copy-to-clipboard@^3.3.1: dependencies: toggle-selection "^1.0.6" -copy-webpack-plugin@5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-5.1.2.tgz#8a889e1dcafa6c91c6cd4be1ad158f1d3823bae2" - integrity sha512-Uh7crJAco3AjBvgAy9Z75CjK8IG+gxaErro71THQ+vv/bl4HaQcpkexAY8KVW/T6D2W2IRr+couF/knIRkZMIQ== +copy-webpack-plugin@^9.0.1: + version "9.1.0" + resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-9.1.0.tgz#2d2c460c4c4695ec0a58afb2801a1205256c4e6b" + integrity sha512-rxnR7PaGigJzhqETHGmAcxKnLZSR5u1Y3/bcIv/1FnqXedcL/E2ewK7ZCNrArJKCiSv8yVXhTqetJh8inDvfsA== dependencies: - cacache "^12.0.3" - find-cache-dir "^2.1.0" - glob-parent "^3.1.0" - globby "^7.1.1" - is-glob "^4.0.1" - loader-utils "^1.2.3" - minimatch "^3.0.4" + fast-glob "^3.2.7" + glob-parent "^6.0.1" + globby "^11.0.3" normalize-path "^3.0.0" - p-limit "^2.2.1" - schema-utils "^1.0.0" - serialize-javascript "^4.0.0" - webpack-log "^2.0.0" + schema-utils "^3.1.1" + serialize-javascript "^6.0.0" -core-js-compat@^3.8.1, core-js-compat@^3.9.0: - version "3.23.2" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.23.2.tgz#5cbf8a9c8812d665392845b85ae91b5bcc7b615c" - integrity sha512-lrgZvxFwbQp9v7E8mX0rJ+JX7Bvh4eGULZXA1IAyjlsnWvCdw6TF8Tg6xtaSUSJMrSrMaLdpmk+V54LM1dvfOA== +core-js-compat@^3.21.0, core-js-compat@^3.22.1: + version "3.25.0" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.25.0.tgz#489affbfbf9cb3fa56192fe2dd9ebaee985a66c5" + integrity sha512-extKQM0g8/3GjFx9US12FAgx8KJawB7RCQ5y8ipYLbmfzEzmFRWdDjIlxDx82g7ygcNG85qMVUSRyABouELdow== dependencies: - browserslist "^4.20.4" + browserslist "^4.21.3" semver "7.0.0" core-js-pure@^3.0.0: @@ -4329,36 +4359,16 @@ core-js-pure@^3.0.0: resolved "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.8.3.tgz" integrity sha512-V5qQZVAr9K0xu7jXg1M7qTEwuxUgqr7dUOezGaNa7i+Xn9oXAU/d1fzqD9ObuwpVQOaorO5s70ckyi1woP9lVA== -core-js@3.21.1: - version "3.21.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.21.1.tgz#f2e0ddc1fc43da6f904706e8e955bc19d06a0d94" - integrity sha512-FRq5b/VMrWlrmCzwRrpDYNxyHP9BcAZC+xHJaqTgIE5091ZV1NTmyh0sGOg5XqpnHvR0svdy0sv1gWA1zmhxig== +core-js@3.24.0: + version "3.24.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.24.0.tgz#4928d4e99c593a234eb1a1f9abd3122b04d3ac57" + integrity sha512-IeOyT8A6iK37Ep4kZDD423mpi6JfPRoPUdQwEWYiGolvn4o6j2diaRzNfDfpTdu3a5qMbrGUzKUpYpRY8jXCkQ== core-js@^2.4.0: version "2.6.12" resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz" integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -cosmiconfig@^5.0.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" - integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== - dependencies: - import-fresh "^2.0.0" - is-directory "^0.3.1" - js-yaml "^3.13.1" - parse-json "^4.0.0" - cosmiconfig@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz" @@ -4370,49 +4380,23 @@ cosmiconfig@^6.0.0: path-type "^4.0.0" yaml "^1.7.2" -create-ecdh@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" - integrity sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A== +cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" + integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== dependencies: - bn.js "^4.1.0" - elliptic "^6.5.3" + "@types/parse-json" "^4.0.0" + import-fresh "^3.2.1" + parse-json "^5.0.0" + path-type "^4.0.0" + yaml "^1.10.0" -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -4421,23 +4405,6 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -crypto-browserify@^3.11.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" - css-animation@^1.3.2: version "1.6.1" resolved "https://registry.npmjs.org/css-animation/-/css-animation-1.6.1.tgz" @@ -4446,12 +4413,12 @@ css-animation@^1.3.2: babel-runtime "6.x" component-classes "^1.2.5" -css-blank-pseudo@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/css-blank-pseudo/-/css-blank-pseudo-0.1.4.tgz#dfdefd3254bf8a82027993674ccf35483bfcb3c5" - integrity sha512-LHz35Hr83dnFeipc7oqFDmsjHdljj3TQtxGGiNWSOsTLIAubSm4TEz8qCaKFpk7idaQ1GfWscF4E6mgpBysA1w== +css-blank-pseudo@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/css-blank-pseudo/-/css-blank-pseudo-3.0.3.tgz#36523b01c12a25d812df343a32c322d2a2324561" + integrity sha512-VS90XWtsHGqoM0t4KpH053c4ehxZ2E6HtGI7x68YFV0pTo/QmkV/YFA+NnlvK8guxZVNWGQhVNJGC39Q8XF4OQ== dependencies: - postcss "^7.0.5" + postcss-selector-parser "^6.0.9" css-box-model@^1.2.0: version "1.2.1" @@ -4465,13 +4432,12 @@ css-declaration-sorter@^6.3.0: resolved "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.3.0.tgz" integrity sha512-OGT677UGHJTAVMRhPO+HJ4oKln3wkBTwtDFH0ojbqm+MJm6xuDMHp2nkhh/ThaBqq20IbraBQSWKfSLNHQO9Og== -css-has-pseudo@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/css-has-pseudo/-/css-has-pseudo-0.10.0.tgz#3c642ab34ca242c59c41a125df9105841f6966ee" - integrity sha512-Z8hnfsZu4o/kt+AuFzeGpLVhFOGO9mluyHBaA2bA8aCGTwah5sT3WV/fTHH8UNZUytOIImuGPrl/prlb4oX4qQ== +css-has-pseudo@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/css-has-pseudo/-/css-has-pseudo-3.0.4.tgz#57f6be91ca242d5c9020ee3e51bbb5b89fc7af73" + integrity sha512-Vse0xpR1K9MNlp2j5w1pgWIJtm1a8qS0JwS9goFYcImjlHEmywP9VUF05aGBXzGpDJF86QXk4L0ypBmwPhGArw== dependencies: - postcss "^7.0.6" - postcss-selector-parser "^5.0.0-rc.4" + postcss-selector-parser "^6.0.9" css-in-js-utils@^2.0.0: version "2.0.1" @@ -4481,30 +4447,36 @@ css-in-js-utils@^2.0.0: hyphenate-style-name "^1.0.2" isobject "^3.0.1" -css-loader@3.4.2: - version "3.4.2" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-3.4.2.tgz#d3fdb3358b43f233b78501c5ed7b1c6da6133202" - integrity sha512-jYq4zdZT0oS0Iykt+fqnzVLRIeiPWhka+7BqPn+oSIpWJAHak5tmB/WZrJ2a21JhCeFyNnnlroSl8c+MtVndzA== - dependencies: - camelcase "^5.3.1" - cssesc "^3.0.0" - icss-utils "^4.1.1" - loader-utils "^1.2.3" - normalize-path "^3.0.0" - postcss "^7.0.23" - postcss-modules-extract-imports "^2.0.0" - postcss-modules-local-by-default "^3.0.2" - postcss-modules-scope "^2.1.1" - postcss-modules-values "^3.0.0" - postcss-value-parser "^4.0.2" - schema-utils "^2.6.0" - -css-prefers-color-scheme@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/css-prefers-color-scheme/-/css-prefers-color-scheme-3.1.1.tgz#6f830a2714199d4f0d0d0bb8a27916ed65cff1f4" - integrity sha512-MTu6+tMs9S3EUqzmqLXEcgNRbNkkD/TGFvowpeoWJn5Vfq7FMgsmRQs9X5NXAURiOBmOxm/lLjsDNXDE6k9bhg== - dependencies: - postcss "^7.0.5" +css-loader@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-6.7.1.tgz#e98106f154f6e1baf3fc3bc455cb9981c1d5fd2e" + integrity sha512-yB5CNFa14MbPJcomwNh3wLThtkZgcNyI2bNMRt8iE5Z8Vwl7f8vQXFAzn2HDOJvtDq2NTZBUGMSUNNyrv3/+cw== + dependencies: + icss-utils "^5.1.0" + postcss "^8.4.7" + postcss-modules-extract-imports "^3.0.0" + postcss-modules-local-by-default "^4.0.0" + postcss-modules-scope "^3.0.0" + postcss-modules-values "^4.0.0" + postcss-value-parser "^4.2.0" + semver "^7.3.5" + +css-minimizer-webpack-plugin@^3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-3.4.1.tgz#ab78f781ced9181992fe7b6e4f3422e76429878f" + integrity sha512-1u6D71zeIfgngN2XNRJefc/hY7Ybsxd74Jm4qngIXyUEk7fss3VUzuHxLAq/R8NAba4QU9OUSaMZlbpRc7bM4Q== + dependencies: + cssnano "^5.0.6" + jest-worker "^27.0.2" + postcss "^8.3.5" + schema-utils "^4.0.0" + serialize-javascript "^6.0.0" + source-map "^0.6.1" + +css-prefers-color-scheme@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/css-prefers-color-scheme/-/css-prefers-color-scheme-6.0.3.tgz#ca8a22e5992c10a5b9d315155e7caee625903349" + integrity sha512-4BqMbZksRkJQx2zAjrokiGMd07RqOa2IxIrrN10lyBe9xhn9DEvjUK79J6jkeiv9D9hQFXKb6g1jwU62jziJZA== css-select@^4.1.3: version "4.3.0" @@ -4550,15 +4522,10 @@ csscolorparser@~1.0.2: resolved "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz" integrity sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w== -cssdb@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/cssdb/-/cssdb-4.4.0.tgz#3bf2f2a68c10f5c6a08abd92378331ee803cddb0" - integrity sha512-LsTAR1JPEM9TpGhl/0p3nQecC2LJ0kD8X5YARu1hk/9I1gril5vDtMZyNxcEpxxDj34YNck/ucjuoUd66K03oQ== - -cssesc@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-2.0.0.tgz#3b13bd1bb1cb36e1bcb5a4dcd27f54c5dcb35703" - integrity sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg== +cssdb@^6.5.0: + version "6.6.3" + resolved "https://registry.yarnpkg.com/cssdb/-/cssdb-6.6.3.tgz#1f331a2fab30c18d9f087301e6122a878bb1e505" + integrity sha512-7GDvDSmE+20+WcSMhP17Q1EVWUrLlbxxpMDqG731n8P99JhnQZHR9YvtjPvEHfjFUjvQJvdpKCjlKOX+xe4UVA== cssesc@^3.0.0: version "3.0.0" @@ -4615,10 +4582,10 @@ cssnano-utils@^3.1.0: resolved "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-3.1.0.tgz" integrity sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA== -cssnano@^5.0.2: - version "5.1.12" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.1.12.tgz#bcd0b64d6be8692de79332c501daa7ece969816c" - integrity sha512-TgvArbEZu0lk/dvg2ja+B7kYoD7BBCmn3+k58xD0qjrGHsFzXY/wKTo9M5egcUCabPol05e/PVoIu79s2JN4WQ== +cssnano@^5.0.6: + version "5.1.13" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.1.13.tgz#83d0926e72955332dc4802a7070296e6258efc0a" + integrity sha512-S2SL2ekdEz6w6a2epXn4CmMKU4K3KpcyXLKfAYc9UQQqJRkD/2eLUG0vJ3Db/9OvO5GuAdgXw3pFbR6abqghDQ== dependencies: cssnano-preset-default "^5.2.12" lilconfig "^2.0.3" @@ -4631,7 +4598,7 @@ csso@^4.2.0: dependencies: css-tree "^1.1.2" -cssom@^0.4.1, cssom@^0.4.4: +cssom@^0.4.4: version "0.4.4" resolved "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz" integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== @@ -4641,7 +4608,7 @@ cssom@~0.3.6: resolved "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz" integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== -cssstyle@^2.0.0, cssstyle@^2.3.0: +cssstyle@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz" integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== @@ -4658,11 +4625,6 @@ csstype@^3.0.6: resolved "https://registry.npmjs.org/csstype/-/csstype-3.0.10.tgz" integrity sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA== -cyclist@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" - integrity sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A== - d3-array@1, d3-array@^1.1.1, d3-array@^1.2.0: version "1.2.4" resolved "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz" @@ -4911,22 +4873,6 @@ d3@5.15.0: d3-voronoi "1" d3-zoom "1" -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== - dependencies: - assert-plus "^1.0.0" - -data-urls@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" - integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== - dependencies: - abab "^2.0.0" - whatwg-mimetype "^2.2.0" - whatwg-url "^7.0.0" - data-urls@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz" @@ -4936,37 +4882,32 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -date-fns@2.28.0, date-fns@^2.16.1: - version "2.28.0" - resolved "https://registry.npmjs.org/date-fns/-/date-fns-2.28.0.tgz" - integrity sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw== +date-fns@2.29.1: + version "2.29.1" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.1.tgz#9667c2615525e552b5135a3116b95b1961456e60" + integrity sha512-dlLD5rKaKxpFdnjrs+5azHDFOPEu4ANy/LTh04A1DTzMM7qoajmKCBc8pkKRFT41CNzw+4gQh79X5C+Jq27HAw== -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" -debug@^2.2.0, debug@^2.3.3, debug@^2.6.0: +debug@^2.6.0: version "2.6.9" resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@^3.1.0: +debug@^3.1.0, debug@^3.2.6: version "3.2.7" resolved "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== dependencies: ms "^2.1.1" -decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== - decimal.js@^10.2.1: version "10.3.1" resolved "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz" @@ -4977,6 +4918,11 @@ decode-uri-component@^0.2.0: resolved "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz" integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= +dedent@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== + deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.3" resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz" @@ -4999,7 +4945,7 @@ define-lazy-prop@^2.0.0: resolved "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz" integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== -define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: +define-properties@^1.1.3, define-properties@^1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz" integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== @@ -5007,41 +4953,11 @@ define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: has-property-descriptors "^1.0.0" object-keys "^1.1.1" -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA== - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA== - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== -des.js@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" - integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz" @@ -5060,11 +4976,6 @@ diff-sequences@^25.2.6: resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.2.6.tgz" integrity sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg== -diff-sequences@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" - integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q== - diff-sequences@^27.5.1: version "27.5.1" resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz" @@ -5075,22 +4986,6 @@ diff@^4.0.1: resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -diffie-hellman@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" - integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" - -dir-glob@^2.0.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.2.2.tgz#fa09f0694153c8918b18ba0deafae94769fc50c4" - integrity sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw== - dependencies: - path-type "^3.0.0" - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" @@ -5148,13 +5043,6 @@ dom-css@^2.0.0: prefix-style "2.0.1" to-camel-case "1.0.0" -dom-helpers@^3.3.1: - version "3.4.0" - resolved "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.4.0.tgz" - integrity sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA== - dependencies: - "@babel/runtime" "^7.1.2" - dom-helpers@^5.0.1: version "5.2.0" resolved "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.0.tgz" @@ -5165,7 +5053,7 @@ dom-helpers@^5.0.1: dom-helpers@^5.2.1: version "5.2.1" - resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.2.1.tgz#d9400536b2bf8225ad98fe052e029451ac40e902" + resolved "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz" integrity sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA== dependencies: "@babel/runtime" "^7.8.7" @@ -5180,23 +5068,11 @@ dom-serializer@^1.0.1: domhandler "^4.2.0" entities "^2.0.0" -domain-browser@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" - integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== - domelementtype@^2.0.1, domelementtype@^2.2.0: version "2.3.0" resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz" integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== -domexception@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" - integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== - dependencies: - webidl-conversions "^4.0.2" - domexception@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz" @@ -5220,96 +5096,58 @@ domutils@^2.5.2, domutils@^2.8.0: domelementtype "^2.2.0" domhandler "^4.2.0" +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + duplexer@^0.1.2: version "0.1.2" resolved "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== -duplexify@^3.4.2, duplexify@^3.6.0: - version "3.7.1" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" - integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== - dependencies: - end-of-stream "^1.0.0" - inherits "^2.0.1" - readable-stream "^2.0.0" - stream-shift "^1.0.0" - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - electron-to-chromium@^1.4.164: version "1.4.165" resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.165.tgz" integrity sha512-DKQW1lqUSAYQvn9dnpK7mWaDpWbNOXQLXhfCi7Iwx0BKxdZOxkKcCyKw1l3ihWWW5iWSxKKbhEUoNRoHvl/hbA== -elliptic@^6.5.3: - version "6.5.4" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" +electron-to-chromium@^1.4.202: + version "1.4.240" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.240.tgz#b11fb838f2e79f34fbe8b57eec55e7e5d81ee6ea" + integrity sha512-r20dUOtZ4vUPTqAajDGonIM1uas5tf85Up+wPdtNBNvBSqGCfkpvMVvQ1T8YJzPV9/Y9g3FbUDcXb94Rafycow== -emittery@^0.7.1: - version "0.7.2" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.7.2.tgz#25595908e13af0f5674ab419396e2fb394cdfa82" - integrity sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ== +emittery@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" + integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - integrity sha512-knHEZMgs8BB+MInokmNTg/OyPlAddghe1YBgNwJBc5zsJi/uyIcXoSDsL/W9ymOsBoBGdPIHXYJ9+qKFwRwDng== - emojis-list@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== -end-of-stream@^1.0.0, end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz#2f3cfd84dbe3b487f18f2db2ef1e064a571ca5ec" - integrity sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg== - dependencies: - graceful-fs "^4.1.2" - memory-fs "^0.5.0" - tapable "^1.0.0" - -enquirer@^2.3.5: - version "2.3.6" - resolved "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== +enhanced-resolve@^5.0.0, enhanced-resolve@^5.10.0: + version "5.10.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6" + integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ== dependencies: - ansi-colors "^4.1.1" + graceful-fs "^4.2.4" + tapable "^2.2.0" entities@^2.0.0: version "2.2.0" resolved "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== -errno@^0.1.1, errno@^0.1.3, errno@~0.1.7: +errno@^0.1.1: version "0.1.8" resolved "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz" integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A== @@ -5330,7 +5168,7 @@ error-stack-parser@^2.0.6: dependencies: stackframe "^1.1.1" -es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19.5, es-abstract@^1.20.1: +es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19.5: version "1.20.1" resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz" integrity sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA== @@ -5359,10 +5197,10 @@ es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19 string.prototype.trimstart "^1.0.5" unbox-primitive "^1.0.2" -es-array-method-boxes-properly@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" - integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== +es-module-lexer@^0.9.0: + version "0.9.3" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" + integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== es-shim-unscopables@^1.0.0: version "1.0.0" @@ -5380,14 +5218,6 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -es6-templates@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/es6-templates/-/es6-templates-0.2.3.tgz#5cb9ac9fb1ded6eb1239342b81d792bbb4078ee4" - integrity sha512-sziUVwcvQ+lOsrTyUY0Q11ilAPj+dy7AQ1E1MgSaHTaaAFTffaa08QSlGNU61iyVaroyb6nYdBV6oD7nzn6i8w== - dependencies: - recast "~0.11.12" - through "~2.3.6" - escalade@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" @@ -5408,18 +5238,6 @@ escape-string-regexp@^4.0.0: resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escodegen@^1.11.1: - version "1.14.3" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" - integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== - dependencies: - esprima "^4.0.1" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - escodegen@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz" @@ -5432,79 +5250,70 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" -eslint-config-prettier@8.3.0: - version "8.3.0" - resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz" - integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== +eslint-config-prettier@8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" + integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== -eslint-plugin-jsdoc@37.7.0: - version "37.7.0" - resolved "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.7.0.tgz" - integrity sha512-vzy3/ltXoGtabRnjLogaEmhGxxIv5B8HK5MJLIrdxFJUvhBppZjuVuLr71DjIBi0jg6bFomwkYKjojt29cN8PA== +eslint-plugin-jsdoc@38.0.6: + version "38.0.6" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-38.0.6.tgz#b26843bdc445202b9f0e3830bda39ec5aacbfa97" + integrity sha512-Wvh5ERLUL8zt2yLZ8LLgi8RuF2UkjDvD+ri1/i7yMpbfreK2S29B9b5JC7iBIoFR7KDaEWCLnUPHTqgwcXX1Sg== dependencies: - "@es-joy/jsdoccomment" "~0.18.0" - comment-parser "1.3.0" - debug "^4.3.3" + "@es-joy/jsdoccomment" "~0.22.1" + comment-parser "1.3.1" + debug "^4.3.4" escape-string-regexp "^4.0.0" esquery "^1.4.0" regextras "^0.8.0" semver "^7.3.5" spdx-expression-parse "^3.0.1" -eslint-plugin-prettier@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0" - integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ== - dependencies: - prettier-linter-helpers "^1.0.0" - eslint-plugin-react-hooks@4.3.0: version "4.3.0" resolved "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.3.0.tgz" integrity sha512-XslZy0LnMn+84NEG9jSGR6eGqaZB3133L8xewQo3fQagbQuGt7a63gf+P1NGKZavEYEC3UXaWEAA/AqDkuN6xA== -eslint-plugin-react@7.28.0: - version "7.28.0" - resolved "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.28.0.tgz" - integrity sha512-IOlFIRHzWfEQQKcAD4iyYDndHwTQiCMcJVJjxempf203jnNLUnW34AXLrV33+nEXoifJE2ZEGmcjKPL8957eSw== +eslint-plugin-react-hooks@4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3" + integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g== + +eslint-plugin-react@7.29.4: + version "7.29.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.29.4.tgz#4717de5227f55f3801a5fd51a16a4fa22b5914d2" + integrity sha512-CVCXajliVh509PcZYRFyu/BoUEz452+jtQJq2b3Bae4v3xBUWPLCmtmBM+ZinG4MzwmxJgJ2M5rMqhqLVn7MtQ== dependencies: array-includes "^3.1.4" array.prototype.flatmap "^1.2.5" doctrine "^2.1.0" estraverse "^5.3.0" jsx-ast-utils "^2.4.1 || ^3.0.0" - minimatch "^3.0.4" + minimatch "^3.1.2" object.entries "^1.1.5" object.fromentries "^2.0.5" object.hasown "^1.1.0" object.values "^1.1.5" - prop-types "^15.7.2" + prop-types "^15.8.1" resolve "^2.0.0-next.3" semver "^6.3.0" string.prototype.matchall "^4.0.6" -eslint-scope@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" - integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-scope@^5.1.1: +eslint-scope@5.1.1, eslint-scope@^5.1.1: version "5.1.1" - resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== dependencies: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== +eslint-scope@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" + integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== dependencies: - eslint-visitor-keys "^1.1.0" + esrecurse "^4.3.0" + estraverse "^5.2.0" eslint-utils@^3.0.0: version "3.0.0" @@ -5513,85 +5322,112 @@ eslint-utils@^3.0.0: dependencies: eslint-visitor-keys "^2.0.0" -eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - eslint-visitor-keys@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint-visitor-keys@^3.0.0: +eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: version "3.3.0" - resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@7.28.0: - version "7.28.0" - resolved "https://registry.npmjs.org/eslint/-/eslint-7.28.0.tgz" - integrity sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g== +eslint@8.11.0: + version "8.11.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.11.0.tgz#88b91cfba1356fc10bb9eb592958457dfe09fb37" + integrity sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA== + dependencies: + "@eslint/eslintrc" "^1.2.1" + "@humanwhocodes/config-array" "^0.9.2" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.1" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.3.0" + espree "^9.3.1" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^6.0.1" + globals "^13.6.0" + ignore "^5.2.0" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.0.4" + natural-compare "^1.4.0" + optionator "^0.9.1" + regexpp "^3.2.0" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + +eslint@8.20.0: + version "8.20.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.20.0.tgz#048ac56aa18529967da8354a478be4ec0a2bc81b" + integrity sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA== dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.2" + "@eslint/eslintrc" "^1.3.0" + "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" - debug "^4.0.1" + debug "^4.3.2" doctrine "^3.0.0" - enquirer "^2.3.5" escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" + eslint-scope "^7.1.1" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.3.0" + espree "^9.3.2" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" - glob-parent "^5.1.2" - globals "^13.6.0" - ignore "^4.0.6" + glob-parent "^6.0.1" + globals "^13.15.0" + ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - js-yaml "^3.13.1" + js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" - minimatch "^3.0.4" + minimatch "^3.1.2" natural-compare "^1.4.0" optionator "^0.9.1" - progress "^2.0.0" - regexpp "^3.1.0" - semver "^7.2.1" - strip-ansi "^6.0.0" + regexpp "^3.2.0" + strip-ansi "^6.0.1" strip-json-comments "^3.1.0" - table "^6.0.9" text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== +espree@^9.3.1, espree@^9.3.2, espree@^9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.0.tgz#cd4bc3d6e9336c433265fc0aa016fc1aaf182f8a" + integrity sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw== dependencies: - acorn "^7.4.0" - acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" + acorn "^8.8.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.3.0" esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esprima@~3.1.0: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - integrity sha512-AWwVMNxwhN8+NIPQzAQZCm7RkLC4RbM3B1OobMuyp3i+w73X57KCKaVIxaRZb+DYCojq7rspo+fmuQfAboyhFg== - esquery@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz" @@ -5599,7 +5435,7 @@ esquery@^1.4.0: dependencies: estraverse "^5.1.0" -esrecurse@^4.1.0, esrecurse@^4.3.0: +esrecurse@^4.3.0: version "4.3.0" resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz" integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== @@ -5611,7 +5447,7 @@ esrever@^0.2.0: resolved "https://registry.npmjs.org/esrever/-/esrever-0.2.0.tgz" integrity sha1-lunSj08bGnZ4TNXUkOquAQ50B7g= -estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.1.1: version "4.3.0" resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== @@ -5636,53 +5472,12 @@ eventemitter3@4.0.7, eventemitter3@^4.0.0: resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== -events@^3.0.0: +events@^3.2.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== -evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - -exec-sh@^0.3.2: - version "0.3.6" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.6.tgz#ff264f9e325519a60cb5e273692943483cca63bc" - integrity sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w== - -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -execa@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" - integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== - dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - human-signals "^1.1.1" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.0" - onetime "^5.1.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - -execa@^5.1.1: +execa@^5.0.0, execa@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== @@ -5707,50 +5502,15 @@ exit@^0.1.2: resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA== - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expect@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-26.6.2.tgz#c6b996bf26bf3fe18b67b2d0f51fc981ba934417" - integrity sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA== - dependencies: - "@jest/types" "^26.6.2" - ansi-styles "^4.0.0" - jest-get-type "^26.3.0" - jest-matcher-utils "^26.6.2" - jest-message-util "^26.6.2" - jest-regex-util "^26.0.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q== +expect@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.1.tgz#83ce59f1e5bdf5f9d2b94b61d2050db48f3fef74" + integrity sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw== dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + "@jest/types" "^27.5.1" + jest-get-type "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" external-editor@^3.0.3: version "3.1.0" @@ -5761,41 +5521,12 @@ external-editor@^3.0.3: iconv-lite "^0.4.24" tmp "^0.0.33" -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== - -extsprintf@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" - integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-diff@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" - integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== - -fast-glob@^3.0.3, fast-glob@^3.2.9: +fast-glob@^3.2.7, fast-glob@^3.2.9: version "3.2.11" resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz" integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== @@ -5826,11 +5557,6 @@ fastest-stable-stringify@^2.0.2: resolved "https://registry.npmjs.org/fastest-stable-stringify/-/fastest-stable-stringify-2.0.2.tgz" integrity sha512-bijHueCGd0LqqNK9b5oCMHc0MluJAx0cwqASgbWMvkO01lCYgIhacVRLcaDz3QnyYIRNJRDwMb41VuT6pHJ91Q== -fastparse@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.2.tgz#91728c5a5942eced8531283c79441ee4122c35a9" - integrity sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ== - fastq@^1.6.0: version "1.10.1" resolved "https://registry.npmjs.org/fastq/-/fastq-1.10.1.tgz" @@ -5845,11 +5571,6 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -figgy-pudding@^3.5.1: - version "3.5.2" - resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" - integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw== - figures@^3.0.0: version "3.2.0" resolved "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz" @@ -5864,7 +5585,7 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" -file-loader@6.2.0: +file-loader@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d" integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw== @@ -5872,33 +5593,18 @@ file-loader@6.2.0: loader-utils "^2.0.0" schema-utils "^3.0.0" -file-selector@^0.4.0: - version "0.4.0" - resolved "https://registry.npmjs.org/file-selector/-/file-selector-0.4.0.tgz" - integrity sha512-iACCiXeMYOvZqlF1kTiYINzgepRBymz1wwjiuup9u9nayhb6g4fSwiyJ/6adli+EPwrWtpgQAh2PoS7HukEGEg== +file-selector@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/file-selector/-/file-selector-0.6.0.tgz#fa0a8d9007b829504db4d07dd4de0310b65287dc" + integrity sha512-QlZ5yJC0VxHxQQsQhXvBaC7VRJ2uaxTf+Tfpu4Z/OcVQJVpZO+DGU0rkoVW5ce2SccxugvpBJoMvUs59iILYdw== dependencies: - tslib "^2.0.3" - -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + tslib "^2.4.0" filesize@^8.0.6: version "8.0.7" resolved "https://registry.npmjs.org/filesize/-/filesize-8.0.7.tgz" integrity sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ== -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ== - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - fill-range@^7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" @@ -5906,15 +5612,6 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -find-cache-dir@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" - integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== - dependencies: - commondir "^1.0.1" - make-dir "^2.0.0" - pkg-dir "^3.0.0" - find-cache-dir@^3.3.1: version "3.3.2" resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz" @@ -5965,60 +5662,11 @@ flatted@^3.1.0: resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz" integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== -flatten@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.3.tgz#c1283ac9f27b368abc1e36d1ff7b04501a30356b" - integrity sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg== - -flush-write-stream@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" - integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== - dependencies: - inherits "^2.0.3" - readable-stream "^2.3.6" - -follow-redirects@^1.0.0, follow-redirects@^1.14.0: +follow-redirects@^1.0.0, follow-redirects@^1.14.8: version "1.15.1" resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz" integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== -for-each@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" - integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== - dependencies: - is-callable "^1.1.3" - -for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== - -fork-ts-checker-webpack-plugin@6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-6.4.0.tgz#057e477cf1d8b013b2ed2669437f818680289c4c" - integrity sha512-3I3wFkc4DbzaUDPWEi96wdYGu4EKtxBafhZYm0o4mX51d9bphAY4P3mBl8K5mFXFJqVzHfmdbm9kLGnm7vwwBg== - dependencies: - "@babel/code-frame" "^7.8.3" - "@types/json-schema" "^7.0.5" - chalk "^4.1.0" - chokidar "^3.4.2" - cosmiconfig "^6.0.0" - deepmerge "^4.2.2" - fs-extra "^9.0.0" - glob "^7.1.6" - memfs "^3.1.2" - minimatch "^3.0.4" - schema-utils "2.7.0" - semver "^7.3.2" - tapable "^1.0.0" - fork-ts-checker-webpack-plugin@^6.5.0: version "6.5.0" resolved "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-6.5.0.tgz" @@ -6038,6 +5686,24 @@ fork-ts-checker-webpack-plugin@^6.5.0: semver "^7.3.2" tapable "^1.0.0" +fork-ts-checker-webpack-plugin@^7.2.1: + version "7.2.13" + resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-7.2.13.tgz#51ffd6a2f96f03ab64b92f8aedf305dbf3dee0f1" + integrity sha512-fR3WRkOb4bQdWB/y7ssDUlVdrclvwtyCUIHCfivAoYxq9dF7XfrDKbMdZIfwJ7hxIAqkYSGeU7lLJE6xrxIBdg== + dependencies: + "@babel/code-frame" "^7.16.7" + chalk "^4.1.2" + chokidar "^3.5.3" + cosmiconfig "^7.0.1" + deepmerge "^4.2.2" + fs-extra "^10.0.0" + memfs "^3.4.1" + minimatch "^3.0.4" + node-abort-controller "^3.0.1" + schema-utils "^3.1.1" + semver "^7.3.5" + tapable "^2.2.1" + form-data@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz" @@ -6047,29 +5713,10 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA== - dependencies: - map-cache "^0.2.2" - -from2@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" - integrity sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g== - dependencies: - inherits "^2.0.1" - readable-stream "^2.0.0" +fraction.js@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.2.0.tgz#448e5109a313a3527f5a3ab2119ec4cf0e0e2950" + integrity sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA== fs-extra@^10.0.0: version "10.0.1" @@ -6090,42 +5737,17 @@ fs-extra@^9.0.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-minipass@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" - integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== - dependencies: - minipass "^3.0.0" - -fs-monkey@1.0.3: +fs-monkey@1.0.3, fs-monkey@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.3.tgz" integrity sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q== -fs-write-stream-atomic@^1.0.8: - version "1.0.10" - resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" - integrity sha512-gehEzmPn2nAwr39eay+x3X34Ra+M2QlVUTLhkXPjWdeO8RF9kszk116avgBJM3ZyNHgHXBNx+VmPaFC36k0PzA== - dependencies: - graceful-fs "^4.1.2" - iferr "^0.1.5" - imurmurhash "^0.1.4" - readable-stream "1 || 2" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@^1.2.7: - version "1.2.13" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" - integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" - -fsevents@^2.1.2, fsevents@~2.3.2: +fsevents@^2.3.2, fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -6160,20 +5782,20 @@ gensync@^1.0.0-beta.2: resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== -geotiff@^2.0.2: - version "2.0.5" - resolved "https://registry.npmjs.org/geotiff/-/geotiff-2.0.5.tgz" - integrity sha512-U5kVYm118YAmw2swiLu8rhfrYnDKOFI7VaMjuQwcq6Intuuid9Pyb4jjxYUxxkq8kOu2r7Am0Rmb52PObGp4pQ== +geotiff@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/geotiff/-/geotiff-2.0.4.tgz#d6f231fdd76186aba21c61823ed759fcbf5d4f86" + integrity sha512-aG8h9bJccGusioPsEWsEqx8qdXpZN71A20WCvRKGxcnHSOWLKmC5ZmsAmodfxb9TRQvs+89KikGuPzxchhA+Uw== dependencies: "@petamoriken/float16" "^3.4.7" lerc "^3.0.0" + lru-cache "^6.0.0" pako "^2.0.4" parse-headers "^2.0.2" - quick-lru "^6.1.0" web-worker "^1.2.0" xml-utils "^1.0.2" -get-caller-file@^2.0.1, get-caller-file@^2.0.5: +get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -6197,20 +5819,6 @@ get-package-type@^0.1.0: resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== -get-stream@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - -get-stream@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - get-stream@^6.0.0: version "6.0.1" resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" @@ -6231,11 +5839,6 @@ get-user-locale@^1.2.0: dependencies: lodash.once "^4.1.1" -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== - get-window@^1.1.1: version "1.1.2" resolved "https://registry.npmjs.org/get-window/-/get-window-1.1.2.tgz" @@ -6243,21 +5846,6 @@ get-window@^1.1.1: dependencies: get-document "1" -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== - dependencies: - assert-plus "^1.0.0" - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA== - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" @@ -6265,6 +5853,18 @@ glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" +glob-parent@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob-to-regexp@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" + integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== + glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.1.6" resolved "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz" @@ -6298,6 +5898,13 @@ globals@^11.1.0: resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== +globals@^13.15.0: + version "13.17.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.17.0.tgz#902eb1e680a41da93945adbdcb5a9f361ba69bd4" + integrity sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw== + dependencies: + type-fest "^0.20.2" + globals@^13.6.0: version "13.15.0" resolved "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz" @@ -6305,27 +5912,6 @@ globals@^13.6.0: dependencies: type-fest "^0.20.2" -globals@^13.9.0: - version "13.12.0" - resolved "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz" - integrity sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg== - dependencies: - type-fest "^0.20.2" - -globby@^10.0.1: - version "10.0.2" - resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.2.tgz#277593e745acaa4646c3ab411289ec47a0392543" - integrity sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg== - dependencies: - "@types/glob" "^7.1.1" - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.0.3" - glob "^7.1.3" - ignore "^5.1.1" - merge2 "^1.2.3" - slash "^3.0.0" - globby@^11.0.3, globby@^11.0.4: version "11.1.0" resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" @@ -6338,28 +5924,11 @@ globby@^11.0.3, globby@^11.0.4: merge2 "^1.4.1" slash "^3.0.0" -globby@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680" - integrity sha512-yANWAN2DUcBtuus5Cpd+SKROzXHs2iVXFZt/Ykrfz6SAXqacLX25NZpltE+39ceMexYF4TtEadjuSTw8+3wX4g== - dependencies: - array-union "^1.0.1" - dir-glob "^2.0.0" - glob "^7.1.2" - ignore "^3.3.5" - pify "^3.0.0" - slash "^1.0.0" - -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4: +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -growly@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" - integrity sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw== - gzip-size@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz" @@ -6367,19 +5936,6 @@ gzip-size@^6.0.0: dependencies: duplexer "^0.1.2" -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz" @@ -6414,37 +5970,6 @@ has-tostringtag@^1.0.0: dependencies: has-symbols "^1.0.2" -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q== - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw== - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ== - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ== - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - has@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" @@ -6452,24 +5977,7 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -he@1.2.x: +he@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== @@ -6491,15 +5999,6 @@ history@4.10.1, history@^4.9.0: tiny-warning "^1.0.0" value-equal "^1.0.1" -hmac-drbg@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - hoist-non-react-statics@3.3.2, hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2: version "3.3.2" resolved "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz" @@ -6507,18 +6006,6 @@ hoist-non-react-statics@3.3.2, hoist-non-react-statics@^3.1.0, hoist-non-react-s dependencies: react-is "^16.7.0" -hosted-git-info@^2.1.4: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - -html-encoding-sniffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" - integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== - dependencies: - whatwg-encoding "^1.0.1" - html-encoding-sniffer@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz" @@ -6531,42 +6018,37 @@ html-escaper@^2.0.0: resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -html-loader@0.5.5: - version "0.5.5" - resolved "https://registry.yarnpkg.com/html-loader/-/html-loader-0.5.5.tgz#6356dbeb0c49756d8ebd5ca327f16ff06ab5faea" - integrity sha512-7hIW7YinOYUpo//kSYcPB6dCKoceKLmOwjEMmhIobHuWGDVl0Nwe4l68mdG/Ru0wcUxQjVMEoZpkalZ/SE7zog== - dependencies: - es6-templates "^0.2.3" - fastparse "^1.1.1" - html-minifier "^3.5.8" - loader-utils "^1.1.0" - object-assign "^4.1.1" - -html-minifier@^3.2.3, html-minifier@^3.5.8: - version "3.5.21" - resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.21.tgz#d0040e054730e354db008463593194015212d20c" - integrity sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA== +html-loader@^3.1.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/html-loader/-/html-loader-3.1.2.tgz#5dc7e52d110b97c381468ac3354efd9bfa36c9fd" + integrity sha512-9WQlLiAV5N9fCna4MUmBW/ifaUbuFZ2r7IZmtXzhyfyi4zgPEjXsmsYCKs+yT873MzRj+f1WMjuAiPNA7C6Tcw== dependencies: - camel-case "3.0.x" - clean-css "4.2.x" - commander "2.17.x" - he "1.2.x" - param-case "2.1.x" - relateurl "0.2.x" - uglify-js "3.4.x" + html-minifier-terser "^6.0.2" + parse5 "^6.0.1" -html-webpack-plugin@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz#b01abbd723acaaa7b37b6af4492ebda03d9dd37b" - integrity sha512-Br4ifmjQojUP4EmHnRBoUIYcZ9J7M4bTMcm7u6xoIAIuq2Nte4TzXX0533owvkQKQD1WeMTTTyD4Ni4QKxS0Bg== +html-minifier-terser@^6.0.2: + version "6.1.0" + resolved "https://registry.yarnpkg.com/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#bfc818934cc07918f6b3669f5774ecdfd48f32ab" + integrity sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw== + dependencies: + camel-case "^4.1.2" + clean-css "^5.2.2" + commander "^8.3.0" + he "^1.2.0" + param-case "^3.0.4" + relateurl "^0.2.7" + terser "^5.10.0" + +html-webpack-plugin@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-5.5.0.tgz#c3911936f57681c1f9f4d8b68c158cd9dfe52f50" + integrity sha512-sy88PC2cRTVxvETRgUHFrL4No3UxvcH8G1NepGhqaTT+GXN2kTamqasot0inS5hXeg1cMbFDt27zzo9p35lZVw== dependencies: - html-minifier "^3.2.3" - loader-utils "^0.2.16" - lodash "^4.17.3" - pretty-error "^2.0.2" - tapable "^1.0.0" - toposort "^1.0.0" - util.promisify "1.0.0" + "@types/html-minifier-terser" "^6.0.0" + html-minifier-terser "^6.0.2" + lodash "^4.17.21" + pretty-error "^4.0.0" + tapable "^2.0.0" htmlparser2@^6.1.0: version "6.1.0" @@ -6607,20 +6089,6 @@ http-proxy@^1.18.1: follow-redirects "^1.0.0" requires-port "^1.0.0" -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -https-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg== - https-proxy-agent@^5.0.0: version "5.0.1" resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz" @@ -6629,11 +6097,6 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" -human-signals@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" - integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== - human-signals@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" @@ -6651,34 +6114,24 @@ iconv-lite@0.4, iconv-lite@0.4.24, iconv-lite@^0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -icss-utils@^4.0.0, icss-utils@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-4.1.1.tgz#21170b53789ee27447c2f47dd683081403f9a467" - integrity sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA== +iconv-lite@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== dependencies: - postcss "^7.0.14" + safer-buffer ">= 2.1.2 < 3.0.0" + +icss-utils@^5.0.0, icss-utils@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" + integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA== -ieee754@^1.1.12, ieee754@^1.1.13, ieee754@^1.1.4: +ieee754@^1.1.12, ieee754@^1.1.13: version "1.2.1" resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -iferr@^0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" - integrity sha512-DUNFN5j7Tln0D+TxzloUjKB+CtVu6myn0JEFak6dG18mNt9YkQ6lzGCdafwofISZ1lLF3xRHJ98VKy9ynkcFaA== - -ignore@^3.3.5: - version "3.3.10" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" - integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== - -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -ignore@^5.1.1, ignore@^5.1.8, ignore@^5.2.0: +ignore@^5.1.8, ignore@^5.2.0: version "5.2.0" resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz" integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== @@ -6693,25 +6146,10 @@ immer@^9.0.7: resolved "https://registry.npmjs.org/immer/-/immer-9.0.12.tgz" integrity sha512-lk7UNmSbAukB5B6dh9fnh5D0bJTOFKxVg2cyJWTYrWRfhLrLMBquONcUs3aFq507hNoIZEDDh8lb8UtOizSMhA== -immutable@4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz" - integrity sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw== - -import-cwd@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" - integrity sha512-Ew5AZzJQFqrOV5BTW3EIoHAnoie1LojZLXKcCQ/yTRyVZosBhK1x1ViYjHGf5pAFOq8ZyChZp6m/fSN7pJyZtg== - dependencies: - import-from "^2.1.0" - -import-fresh@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" - integrity sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg== - dependencies: - caller-path "^2.0.0" - resolve-from "^3.0.0" +immutable@4.1.0, immutable@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.1.0.tgz#f795787f0db780183307b9eb2091fcac1f6fafef" + integrity sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ== import-fresh@^3.0.0, import-fresh@^3.1.0, import-fresh@^3.2.1: version "3.3.0" @@ -6721,13 +6159,6 @@ import-fresh@^3.0.0, import-fresh@^3.1.0, import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" -import-from@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" - integrity sha512-0vdnLL2wSGnhlRmzHJAg5JHjt1l2vYhzJ7tNLGbeVg0fse56tpGaH0uzH+r9Slej+BSXXEHvBKDEnVSLLE9/+w== - dependencies: - resolve-from "^3.0.0" - import-local@^3.0.2: version "3.1.0" resolved "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz" @@ -6746,16 +6177,6 @@ indent-string@^4.0.0: resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== -indexes-of@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" - integrity sha512-bup+4tap3Hympa+JBJUG7XuOsdNQ6fxt0MHyXMKuLBKn0OqsTfvUxkUrroEX1+B2VsSHvCjiIcZVxRtYa4nllA== - -infer-owner@^1.0.3, infer-owner@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" - integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== - inflight@^1.0.4: version "1.0.6" resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" @@ -6764,21 +6185,11 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@^2.0.3, inherits@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - integrity sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA== - -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== - ini@^1.3.5: version "1.3.8" resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" @@ -6791,7 +6202,7 @@ inline-style-prefixer@^6.0.0: dependencies: css-in-js-utils "^2.0.0" -inquirer@^8.0.0: +inquirer@^8.2.2: version "8.2.4" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.4.tgz#ddbfe86ca2f67649a67daa6f1051c128f684f0b4" integrity sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg== @@ -6821,6 +6232,16 @@ internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" +intl-messageformat@^10.1.0: + version "10.1.4" + resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-10.1.4.tgz#bf5ad48e357e3f3ab6559599296f54c175b22a92" + integrity sha512-tXCmWCXhbeHOF28aIf5b9ce3kwdwGyIiiSXVZsyDwksMiGn5Tp0MrMvyeuHuz4uN1UL+NfGOztHmE+6aLFp1wQ== + dependencies: + "@formatjs/ecma402-abstract" "1.12.0" + "@formatjs/fast-memoize" "1.2.6" + "@formatjs/icu-messageformat-parser" "2.1.7" + tslib "2.4.0" + intl-messageformat@^9.12.0: version "9.13.0" resolved "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-9.13.0.tgz" @@ -6831,31 +6252,12 @@ intl-messageformat@^9.12.0: "@formatjs/icu-messageformat-parser" "2.1.0" tslib "^2.1.0" -invariant@^2.2.2, invariant@^2.2.4: +invariant@^2.2.2: version "2.2.4" - resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== - dependencies: - loose-envify "^1.0.0" - -ip-regex@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" - integrity sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw== - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A== - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== dependencies: - kind-of "^6.0.0" + loose-envify "^1.0.0" is-arrayish@^0.2.1: version "0.2.1" @@ -6869,13 +6271,6 @@ is-bigint@^1.0.1: dependencies: has-bigints "^1.0.1" -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q== - dependencies: - binary-extensions "^1.0.0" - is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" @@ -6891,23 +6286,11 @@ is-boolean-object@^1.1.0: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.4: +is-callable@^1.1.4, is-callable@^1.2.4: version "1.2.4" resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz" integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== -is-ci@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" - integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== - dependencies: - ci-info "^2.0.0" - is-core-module@^2.9.0: version "2.9.0" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz" @@ -6915,20 +6298,6 @@ is-core-module@^2.9.0: dependencies: has "^1.0.3" -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg== - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - is-date-object@^1.0.1: version "1.0.5" resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz" @@ -6936,29 +6305,6 @@ is-date-object@^1.0.1: dependencies: has-tostringtag "^1.0.0" -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-directory@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" - integrity sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw== - is-docker@^2.0.0: version "2.1.1" resolved "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz" @@ -6969,19 +6315,7 @@ is-docker@^2.1.1: resolved "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.0, is-extglob@^2.1.1: +is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= @@ -6996,13 +6330,6 @@ is-generator-fn@^2.0.0: resolved "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw== - dependencies: - is-extglob "^2.1.0" - is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" @@ -7042,29 +6369,17 @@ is-number-object@^1.0.4: dependencies: has-tostringtag "^1.0.0" -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg== - dependencies: - kind-of "^3.0.2" - is-number@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-plain-obj@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== - is-plain-obj@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz" integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA== -is-plain-object@^2.0.3, is-plain-object@^2.0.4: +is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== @@ -7096,11 +6411,6 @@ is-shared-array-buffer@^1.0.2: dependencies: call-bind "^1.0.2" -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== - is-stream@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz" @@ -7120,7 +6430,7 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" -is-typedarray@^1.0.0, is-typedarray@~1.0.0: +is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== @@ -7147,16 +6457,6 @@ is-window@^1.0.2: resolved "https://registry.npmjs.org/is-window/-/is-window-1.0.2.tgz" integrity sha1-LIlspT25feRdPDMTOmXYyfVjSA0= -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -is-wsl@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" - integrity sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw== - is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz" @@ -7169,24 +6469,12 @@ isarray@0.0.1: resolved "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= -isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== - isexe@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA== - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: +isobject@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= @@ -7196,45 +6484,12 @@ isomorphic-base64@^1.0.2: resolved "https://registry.npmjs.org/isomorphic-base64/-/isomorphic-base64-1.0.2.tgz" integrity sha1-9Caq6CVpuopOxcpzrSGkSrHueAM= -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== - -istanbul-lib-coverage@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" - integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== - istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz" integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== -istanbul-lib-instrument@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" - integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== - dependencies: - "@babel/generator" "^7.4.0" - "@babel/parser" "^7.4.3" - "@babel/template" "^7.4.0" - "@babel/traverse" "^7.4.3" - "@babel/types" "^7.4.0" - istanbul-lib-coverage "^2.0.5" - semver "^6.0.0" - -istanbul-lib-instrument@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" - integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== - dependencies: - "@babel/core" "^7.7.5" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.0.0" - semver "^6.3.0" - -istanbul-lib-instrument@^5.0.4: +istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: version "5.2.0" resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz" integrity sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A== @@ -7263,80 +6518,103 @@ istanbul-lib-source-maps@^4.0.0: istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" -istanbul-reports@^3.0.2: - version "3.1.4" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.4.tgz#1b6f068ecbc6c331040aab5741991273e609e40c" - integrity sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw== +istanbul-reports@^3.1.3: + version "3.1.5" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae" + integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-canvas-mock@2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/jest-canvas-mock/-/jest-canvas-mock-2.3.0.tgz#50f4cc178ae52c4c0e2ce4fd3a3ad2a41ad4eb36" - integrity sha512-3TMyR66VG2MzAW8Negzec03bbcIjVJMfGNvKzrEnbws1CYKqMNkvIJ8LbkoGYfp42tKqDmhIpQq3v+MNLW2A2w== +jest-canvas-mock@2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/jest-canvas-mock/-/jest-canvas-mock-2.3.1.tgz#9535d14bc18ccf1493be36ac37dd349928387826" + integrity sha512-5FnSZPrX3Q2ZfsbYNE3wqKR3+XorN8qFzDzB5o0golWgt6EOX1+emBnpOc9IAQ+NXFj8Nzm3h7ZdE/9H0ylBcg== dependencies: cssfontparser "^1.2.1" moo-color "^1.0.2" -jest-changed-files@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.6.2.tgz#f6198479e1cc66f22f9ae1e22acaa0b429c042d0" - integrity sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ== +jest-changed-files@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.5.1.tgz#a348aed00ec9bf671cc58a66fcbe7c3dfd6a68f5" + integrity sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw== dependencies: - "@jest/types" "^26.6.2" - execa "^4.0.0" - throat "^5.0.0" + "@jest/types" "^27.5.1" + execa "^5.0.0" + throat "^6.0.1" -jest-cli@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-26.6.3.tgz#43117cfef24bc4cd691a174a8796a532e135e92a" - integrity sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg== +jest-circus@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.5.1.tgz#37a5a4459b7bf4406e53d637b49d22c65d125ecc" + integrity sha512-D95R7x5UtlMA5iBYsOHFFbMD/GVA4R/Kdq15f7xYWUfWHBto9NYRsOvnSauTgdF+ogCpJ4tyKOXhUifxS65gdw== dependencies: - "@jest/core" "^26.6.3" - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/environment" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^0.7.0" + expect "^27.5.1" + is-generator-fn "^2.0.0" + jest-each "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" + jest-runtime "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" + pretty-format "^27.5.1" + slash "^3.0.0" + stack-utils "^2.0.3" + throat "^6.0.1" + +jest-cli@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.5.1.tgz#278794a6e6458ea8029547e6c6cbf673bd30b145" + integrity sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw== + dependencies: + "@jest/core" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" chalk "^4.0.0" exit "^0.1.2" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" import-local "^3.0.2" - is-ci "^2.0.0" - jest-config "^26.6.3" - jest-util "^26.6.2" - jest-validate "^26.6.2" + jest-config "^27.5.1" + jest-util "^27.5.1" + jest-validate "^27.5.1" prompts "^2.0.1" - yargs "^15.4.1" + yargs "^16.2.0" -jest-config@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-26.6.3.tgz#64f41444eef9eb03dc51d5c53b75c8c71f645349" - integrity sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg== +jest-config@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.5.1.tgz#5c387de33dca3f99ad6357ddeccd91bf3a0e4a41" + integrity sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA== dependencies: - "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^26.6.3" - "@jest/types" "^26.6.2" - babel-jest "^26.6.3" + "@babel/core" "^7.8.0" + "@jest/test-sequencer" "^27.5.1" + "@jest/types" "^27.5.1" + babel-jest "^27.5.1" chalk "^4.0.0" + ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.1" - graceful-fs "^4.2.4" - jest-environment-jsdom "^26.6.2" - jest-environment-node "^26.6.2" - jest-get-type "^26.3.0" - jest-jasmine2 "^26.6.3" - jest-regex-util "^26.0.0" - jest-resolve "^26.6.2" - jest-util "^26.6.2" - jest-validate "^26.6.2" - micromatch "^4.0.2" - pretty-format "^26.6.2" - -jest-coverage-badges@^1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/jest-coverage-badges/-/jest-coverage-badges-1.1.2.tgz" - integrity sha512-44A7i2xR6os8+fWk8ZRM6W4fKiD2jwKOLU9eB3iTIIWACd9RbdvmiCNpQZTOsUBhKvz7aQ/ASFhu5JOEhWUOlg== - dependencies: - mkdirp "0.5.1" + graceful-fs "^4.2.9" + jest-circus "^27.5.1" + jest-environment-jsdom "^27.5.1" + jest-environment-node "^27.5.1" + jest-get-type "^27.5.1" + jest-jasmine2 "^27.5.1" + jest-regex-util "^27.5.1" + jest-resolve "^27.5.1" + jest-runner "^27.5.1" + jest-util "^27.5.1" + jest-validate "^27.5.1" + micromatch "^4.0.4" + parse-json "^5.2.0" + pretty-format "^27.5.1" + slash "^3.0.0" + strip-json-comments "^3.1.1" jest-diff@^25.1.0, jest-diff@^25.5.0: version "25.5.0" @@ -7348,19 +6626,9 @@ jest-diff@^25.1.0, jest-diff@^25.5.0: jest-get-type "^25.2.6" pretty-format "^25.5.0" -jest-diff@^26.0.0, jest-diff@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394" - integrity sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA== - dependencies: - chalk "^4.0.0" - diff-sequences "^26.6.2" - jest-get-type "^26.3.0" - pretty-format "^26.6.2" - -jest-diff@^27.0.0, jest-diff@^27.5.1: +jest-diff@^27.5.1: version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" + resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-27.5.1.tgz" integrity sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw== dependencies: chalk "^4.0.0" @@ -7368,157 +6636,119 @@ jest-diff@^27.0.0, jest-diff@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-docblock@^26.0.0: - version "26.0.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-26.0.0.tgz#3e2fa20899fc928cb13bd0ff68bd3711a36889b5" - integrity sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w== +jest-docblock@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.1.tgz#14092f364a42c6108d42c33c8cf30e058e25f6c0" + integrity sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ== dependencies: detect-newline "^3.0.0" -jest-each@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-26.6.2.tgz#02526438a77a67401c8a6382dfe5999952c167cb" - integrity sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A== +jest-each@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.5.1.tgz#5bc87016f45ed9507fed6e4702a5b468a5b2c44e" + integrity sha512-1Ff6p+FbhT/bXQnEouYy00bkNSY7OUpfIcmdl8vZ31A1UUaurOLPA8a8BbJOF2RDUElwJhmeaV7LnagI+5UwNQ== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.5.1" chalk "^4.0.0" - jest-get-type "^26.3.0" - jest-util "^26.6.2" - pretty-format "^26.6.2" - -jest-environment-jsdom-fifteen@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom-fifteen/-/jest-environment-jsdom-fifteen-1.0.2.tgz#49a0af55e0d32737a6114a1575dd714702ad63b0" - integrity sha512-nfrnAfwklE1872LIB31HcjM65cWTh1wzvMSp10IYtPJjLDUbTTvDpajZgIxUnhRmzGvogdHDayCIlerLK0OBBg== - dependencies: - "@jest/environment" "^24.3.0" - "@jest/fake-timers" "^24.3.0" - "@jest/types" "^24.3.0" - jest-mock "^24.0.0" - jest-util "^24.0.0" - jsdom "^15.2.1" + jest-get-type "^27.5.1" + jest-util "^27.5.1" + pretty-format "^27.5.1" -jest-environment-jsdom@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz#78d09fe9cf019a357009b9b7e1f101d23bd1da3e" - integrity sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q== +jest-environment-jsdom@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz#ea9ccd1fc610209655a77898f86b2b559516a546" + integrity sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw== dependencies: - "@jest/environment" "^26.6.2" - "@jest/fake-timers" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/environment" "^27.5.1" + "@jest/fake-timers" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" - jest-mock "^26.6.2" - jest-util "^26.6.2" - jsdom "^16.4.0" + jest-mock "^27.5.1" + jest-util "^27.5.1" + jsdom "^16.6.0" -jest-environment-node@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-26.6.2.tgz#824e4c7fb4944646356f11ac75b229b0035f2b0c" - integrity sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag== +jest-environment-node@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.5.1.tgz#dedc2cfe52fab6b8f5714b4808aefa85357a365e" + integrity sha512-Jt4ZUnxdOsTGwSRAfKEnE6BcwsSPNOijjwifq5sDFSA2kesnXTvNqKHYgM0hDq3549Uf/KzdXNYn4wMZJPlFLw== dependencies: - "@jest/environment" "^26.6.2" - "@jest/fake-timers" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/environment" "^27.5.1" + "@jest/fake-timers" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" - jest-mock "^26.6.2" - jest-util "^26.6.2" + jest-mock "^27.5.1" + jest-util "^27.5.1" jest-get-type@^25.2.6: version "25.2.6" resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-25.2.6.tgz" integrity sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig== -jest-get-type@^26.3.0: - version "26.3.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" - integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== - jest-get-type@^27.5.1: version "27.5.1" resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz" integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw== -jest-haste-map@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.9.0.tgz#b38a5d64274934e21fa417ae9a9fbeb77ceaac7d" - integrity sha512-kfVFmsuWui2Sj1Rp1AJ4D9HqJwE4uwTlS/vO+eRUaMmd54BFpli2XhMQnPC2k4cHFVbB2Q2C+jtI1AGLgEnCjQ== - dependencies: - "@jest/types" "^24.9.0" - anymatch "^2.0.0" - fb-watchman "^2.0.0" - graceful-fs "^4.1.15" - invariant "^2.2.4" - jest-serializer "^24.9.0" - jest-util "^24.9.0" - jest-worker "^24.9.0" - micromatch "^3.1.10" - sane "^4.0.3" - walker "^1.0.7" - optionalDependencies: - fsevents "^1.2.7" - -jest-haste-map@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.6.2.tgz#dd7e60fe7dc0e9f911a23d79c5ff7fb5c2cafeaa" - integrity sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w== +jest-haste-map@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.1.tgz#9fd8bd7e7b4fa502d9c6164c5640512b4e811e7f" + integrity sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.5.1" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" - graceful-fs "^4.2.4" - jest-regex-util "^26.0.0" - jest-serializer "^26.6.2" - jest-util "^26.6.2" - jest-worker "^26.6.2" - micromatch "^4.0.2" - sane "^4.0.3" + graceful-fs "^4.2.9" + jest-regex-util "^27.5.1" + jest-serializer "^27.5.1" + jest-util "^27.5.1" + jest-worker "^27.5.1" + micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: - fsevents "^2.1.2" + fsevents "^2.3.2" -jest-jasmine2@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz#adc3cf915deacb5212c93b9f3547cd12958f2edd" - integrity sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg== +jest-jasmine2@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz#a037b0034ef49a9f3d71c4375a796f3b230d1ac4" + integrity sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ== dependencies: - "@babel/traverse" "^7.1.0" - "@jest/environment" "^26.6.2" - "@jest/source-map" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/environment" "^27.5.1" + "@jest/source-map" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^26.6.2" + expect "^27.5.1" is-generator-fn "^2.0.0" - jest-each "^26.6.2" - jest-matcher-utils "^26.6.2" - jest-message-util "^26.6.2" - jest-runtime "^26.6.3" - jest-snapshot "^26.6.2" - jest-util "^26.6.2" - pretty-format "^26.6.2" - throat "^5.0.0" + jest-each "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" + jest-runtime "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" + pretty-format "^27.5.1" + throat "^6.0.1" -jest-junit@^13.0.0: - version "13.2.0" - resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-13.2.0.tgz#66eeb86429aafac8c1745a70f44ace185aacb943" - integrity sha512-B0XNlotl1rdsvFZkFfoa19mc634+rrd8E4Sskb92Bb8MmSXeWV9XJGUyctunZS1W410uAxcyYuPUGVnbcOH8cg== +jest-junit@13.1.0: + version "13.1.0" + resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-13.1.0.tgz#c364b90b88ad2492dae4002f00c9fed75e0590c4" + integrity sha512-ECbhzEG3Oe2IH3Mnwcv2vAXM4qTbcObN/gTUzwKPlpaNsf2G/zlj/teEUqRGV17YQiQ4AqzTf3pCO7W59DKVIw== dependencies: mkdirp "^1.0.4" strip-ansi "^6.0.1" uuid "^8.3.2" xml "^1.0.1" -jest-leak-detector@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz#7717cf118b92238f2eba65054c8a0c9c653a91af" - integrity sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg== +jest-leak-detector@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8" + integrity sha512-POXfWAMvfU6WMUXftV4HolnJfnPOGEu10fscNCA76KBpRRhcMN2c8d3iT2pxQS3HLbA+5X4sOUPzYO2NUyIlHQ== dependencies: - jest-get-type "^26.3.0" - pretty-format "^26.6.2" + jest-get-type "^27.5.1" + pretty-format "^27.5.1" jest-matcher-utils@^25.1.0: version "25.5.0" @@ -7530,17 +6760,7 @@ jest-matcher-utils@^25.1.0: jest-get-type "^25.2.6" pretty-format "^25.5.0" -jest-matcher-utils@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz#8e6fd6e863c8b2d31ac6472eeb237bc595e53e7a" - integrity sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw== - dependencies: - chalk "^4.0.0" - jest-diff "^26.6.2" - jest-get-type "^26.3.0" - pretty-format "^26.6.2" - -jest-matcher-utils@^27.0.0: +jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.5.1: version "27.5.1" resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz" integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== @@ -7550,48 +6770,27 @@ jest-matcher-utils@^27.0.0: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-message-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.9.0.tgz#527f54a1e380f5e202a8d1149b0ec872f43119e3" - integrity sha512-oCj8FiZ3U0hTP4aSui87P4L4jC37BtQwUMqk+zk/b11FR19BJDeZsZAvIHutWnmtw7r85UmR3CEWZ0HWU2mAlw== - dependencies: - "@babel/code-frame" "^7.0.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/stack-utils" "^1.0.1" - chalk "^2.0.1" - micromatch "^3.1.10" - slash "^2.0.0" - stack-utils "^1.0.1" - -jest-message-util@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.6.2.tgz#58173744ad6fc0506b5d21150b9be56ef001ca07" - integrity sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA== +jest-message-util@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" + integrity sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g== dependencies: - "@babel/code-frame" "^7.0.0" - "@jest/types" "^26.6.2" + "@babel/code-frame" "^7.12.13" + "@jest/types" "^27.5.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" - graceful-fs "^4.2.4" - micromatch "^4.0.2" - pretty-format "^26.6.2" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^27.5.1" slash "^3.0.0" - stack-utils "^2.0.2" + stack-utils "^2.0.3" -jest-mock@^24.0.0, jest-mock@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.9.0.tgz#c22835541ee379b908673ad51087a2185c13f1c6" - integrity sha512-3BEYN5WbSq9wd+SyLDES7AHnjH9A/ROBwmz7l2y+ol+NtSFO8DYiEBzoO1CeFc9a8DYy10EO4dDFVv/wN3zl1w== - dependencies: - "@jest/types" "^24.9.0" - -jest-mock@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-26.6.2.tgz#d6cb712b041ed47fe0d9b6fc3474bc6543feb302" - integrity sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew== +jest-mock@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.1.tgz#19948336d49ef4d9c52021d34ac7b5f36ff967d6" + integrity sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.5.1" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -7599,221 +6798,181 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.9.0.tgz#c13fb3380bde22bf6575432c493ea8fe37965636" - integrity sha512-05Cmb6CuxaA+Ys6fjr3PhvV3bGQmO+2p2La4hFbU+W5uOc479f7FdLXUWXw4pYMAhhSZIuKHwSXSu6CsSBAXQA== - -jest-regex-util@^26.0.0: - version "26.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" - integrity sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A== +jest-regex-util@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.5.1.tgz#4da143f7e9fd1e542d4aa69617b38e4a78365b95" + integrity sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg== -jest-resolve-dependencies@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz#6680859ee5d22ee5dcd961fe4871f59f4c784fb6" - integrity sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg== +jest-resolve-dependencies@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz#d811ecc8305e731cc86dd79741ee98fed06f1da8" + integrity sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg== dependencies: - "@jest/types" "^26.6.2" - jest-regex-util "^26.0.0" - jest-snapshot "^26.6.2" + "@jest/types" "^27.5.1" + jest-regex-util "^27.5.1" + jest-snapshot "^27.5.1" -jest-resolve@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.6.2.tgz#a3ab1517217f469b504f1b56603c5bb541fbb507" - integrity sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ== +jest-resolve@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.5.1.tgz#a2f1c5a0796ec18fe9eb1536ac3814c23617b384" + integrity sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.5.1" chalk "^4.0.0" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" + jest-haste-map "^27.5.1" jest-pnp-resolver "^1.2.2" - jest-util "^26.6.2" - read-pkg-up "^7.0.1" - resolve "^1.18.1" + jest-util "^27.5.1" + jest-validate "^27.5.1" + resolve "^1.20.0" + resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-26.6.3.tgz#2d1fed3d46e10f233fd1dbd3bfaa3fe8924be159" - integrity sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ== - dependencies: - "@jest/console" "^26.6.2" - "@jest/environment" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" +jest-runner@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.5.1.tgz#071b27c1fa30d90540805c5645a0ec167c7b62e5" + integrity sha512-g4NPsM4mFCOwFKXO4p/H/kWGdJp9V8kURY2lX8Me2drgXqG7rrZAx5kv+5H7wtt/cdFIjhqYx1HrlqWHaOvDaQ== + dependencies: + "@jest/console" "^27.5.1" + "@jest/environment" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" - emittery "^0.7.1" - exit "^0.1.2" - graceful-fs "^4.2.4" - jest-config "^26.6.3" - jest-docblock "^26.0.0" - jest-haste-map "^26.6.2" - jest-leak-detector "^26.6.2" - jest-message-util "^26.6.2" - jest-resolve "^26.6.2" - jest-runtime "^26.6.3" - jest-util "^26.6.2" - jest-worker "^26.6.2" + emittery "^0.8.1" + graceful-fs "^4.2.9" + jest-docblock "^27.5.1" + jest-environment-jsdom "^27.5.1" + jest-environment-node "^27.5.1" + jest-haste-map "^27.5.1" + jest-leak-detector "^27.5.1" + jest-message-util "^27.5.1" + jest-resolve "^27.5.1" + jest-runtime "^27.5.1" + jest-util "^27.5.1" + jest-worker "^27.5.1" source-map-support "^0.5.6" - throat "^5.0.0" - -jest-runtime@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-26.6.3.tgz#4f64efbcfac398331b74b4b3c82d27d401b8fa2b" - integrity sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw== - dependencies: - "@jest/console" "^26.6.2" - "@jest/environment" "^26.6.2" - "@jest/fake-timers" "^26.6.2" - "@jest/globals" "^26.6.2" - "@jest/source-map" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/transform" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/yargs" "^15.0.0" + throat "^6.0.1" + +jest-runtime@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.5.1.tgz#4896003d7a334f7e8e4a53ba93fb9bcd3db0a1af" + integrity sha512-o7gxw3Gf+H2IGt8fv0RiyE1+r83FJBRruoA+FXrlHw6xEyBsU8ugA6IPfTdVyA0w8HClpbK+DGJxH59UrNMx8A== + dependencies: + "@jest/environment" "^27.5.1" + "@jest/fake-timers" "^27.5.1" + "@jest/globals" "^27.5.1" + "@jest/source-map" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" chalk "^4.0.0" - cjs-module-lexer "^0.6.0" + cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" - exit "^0.1.2" + execa "^5.0.0" glob "^7.1.3" - graceful-fs "^4.2.4" - jest-config "^26.6.3" - jest-haste-map "^26.6.2" - jest-message-util "^26.6.2" - jest-mock "^26.6.2" - jest-regex-util "^26.0.0" - jest-resolve "^26.6.2" - jest-snapshot "^26.6.2" - jest-util "^26.6.2" - jest-validate "^26.6.2" + graceful-fs "^4.2.9" + jest-haste-map "^27.5.1" + jest-message-util "^27.5.1" + jest-mock "^27.5.1" + jest-regex-util "^27.5.1" + jest-resolve "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" slash "^3.0.0" strip-bom "^4.0.0" - yargs "^15.4.1" -jest-serializer@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.9.0.tgz#e6d7d7ef96d31e8b9079a714754c5d5c58288e73" - integrity sha512-DxYipDr8OvfrKH3Kel6NdED3OXxjvxXZ1uIY2I9OFbGg+vUkkg7AGvi65qbhbWNPvDckXmzMPbK3u3HaDO49bQ== - -jest-serializer@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.6.2.tgz#d139aafd46957d3a448f3a6cdabe2919ba0742d1" - integrity sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g== +jest-serializer@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.5.1.tgz#81438410a30ea66fd57ff730835123dea1fb1f64" + integrity sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w== dependencies: "@types/node" "*" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" -jest-snapshot@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.6.2.tgz#f3b0af1acb223316850bd14e1beea9837fb39c84" - integrity sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og== +jest-snapshot@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.5.1.tgz#b668d50d23d38054a51b42c4039cab59ae6eb6a1" + integrity sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA== dependencies: + "@babel/core" "^7.7.2" + "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/types" "^26.6.2" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" "@types/babel__traverse" "^7.0.4" - "@types/prettier" "^2.0.0" + "@types/prettier" "^2.1.5" + babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^26.6.2" - graceful-fs "^4.2.4" - jest-diff "^26.6.2" - jest-get-type "^26.3.0" - jest-haste-map "^26.6.2" - jest-matcher-utils "^26.6.2" - jest-message-util "^26.6.2" - jest-resolve "^26.6.2" + expect "^27.5.1" + graceful-fs "^4.2.9" + jest-diff "^27.5.1" + jest-get-type "^27.5.1" + jest-haste-map "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" + jest-util "^27.5.1" natural-compare "^1.4.0" - pretty-format "^26.6.2" + pretty-format "^27.5.1" semver "^7.3.2" -jest-util@^24.0.0, jest-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.9.0.tgz#7396814e48536d2e85a37de3e4c431d7cb140162" - integrity sha512-x+cZU8VRmOJxbA1K5oDBdxQmdq0OIdADarLxk0Mq+3XS4jgvhG/oKGWcIDCtPG0HgjxOYvF+ilPJQsAyXfbNOg== - dependencies: - "@jest/console" "^24.9.0" - "@jest/fake-timers" "^24.9.0" - "@jest/source-map" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - callsites "^3.0.0" - chalk "^2.0.1" - graceful-fs "^4.1.15" - is-ci "^2.0.0" - mkdirp "^0.5.1" - slash "^2.0.0" - source-map "^0.6.0" - -jest-util@^26.1.0, jest-util@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" - integrity sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q== +jest-util@^27.0.0, jest-util@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.1.tgz#3ba9771e8e31a0b85da48fe0b0891fb86c01c2f9" + integrity sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" - graceful-fs "^4.2.4" - is-ci "^2.0.0" - micromatch "^4.0.2" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" -jest-validate@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.6.2.tgz#23d380971587150467342911c3d7b4ac57ab20ec" - integrity sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ== +jest-validate@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.1.tgz#9197d54dc0bdb52260b8db40b46ae668e04df067" + integrity sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ== dependencies: - "@jest/types" "^26.6.2" - camelcase "^6.0.0" + "@jest/types" "^27.5.1" + camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^26.3.0" + jest-get-type "^27.5.1" leven "^3.1.0" - pretty-format "^26.6.2" + pretty-format "^27.5.1" -jest-watcher@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-26.6.2.tgz#a5b683b8f9d68dbcb1d7dae32172d2cca0592975" - integrity sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ== +jest-watcher@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.5.1.tgz#71bd85fb9bde3a2c2ec4dc353437971c43c642a2" + integrity sha512-z676SuD6Z8o8qbmEGhoEUFOM1+jfEiL3DXHK/xgEiG2EyNYfFG60jluWcupY6dATjfEsKQuibReS1djInQnoVw== dependencies: - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^26.6.2" + jest-util "^27.5.1" string-length "^4.0.1" -jest-worker@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" - integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== - dependencies: - merge-stream "^2.0.0" - supports-color "^6.1.0" - -jest-worker@^25.4.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-25.5.0.tgz#2611d071b79cea0f43ee57a3d118593ac1547db1" - integrity sha512-/dsSmUkIy5EBGfv/IjjqmFxrNAUpBERfGs1oHROyD7yxjG/w+t0GOJDX8O1k32ySmd7+a5IhnJU2qQFcJ4n1vw== - dependencies: - merge-stream "^2.0.0" - supports-color "^7.0.0" - -jest-worker@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" - integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== +jest-worker@^27.0.2, jest-worker@^27.4.5, jest-worker@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== dependencies: "@types/node" "*" merge-stream "^2.0.0" - supports-color "^7.0.0" + supports-color "^8.0.0" -jest@26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-26.6.3.tgz#40e8fdbe48f00dfa1f0ce8121ca74b88ac9148ef" - integrity sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q== +jest@27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.5.1.tgz#dadf33ba70a779be7a6fc33015843b51494f63fc" + integrity sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ== dependencies: - "@jest/core" "^26.6.3" + "@jest/core" "^27.5.1" import-local "^3.0.2" - jest-cli "^26.6.3" + jest-cli "^27.5.1" jquery@3.6.0: version "3.6.0" @@ -7838,49 +6997,19 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" -jsdoc-type-pratt-parser@~2.2.2: +jsdoc-type-pratt-parser@~2.2.5: version "2.2.5" - resolved "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-2.2.5.tgz" + resolved "https://registry.yarnpkg.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-2.2.5.tgz#c9f93afac7ee4b5ed4432fe3f09f7d36b05ed0ff" integrity sha512-2a6eRxSxp1BW040hFvaJxhsCMI9lT8QB8t14t+NY5tC5rckIR0U9cr2tjOeaFirmEOy6MHvmJnY7zTBHq431Lw== -jsdom@^15.2.1: - version "15.2.1" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-15.2.1.tgz#d2feb1aef7183f86be521b8c6833ff5296d07ec5" - integrity sha512-fAl1W0/7T2G5vURSyxBzrJ1LSdQn6Tr5UX/xD4PXDx/PDgwygedfW6El/KIj3xJ7FU61TTYnc/l/B7P49Eqt6g== - dependencies: - abab "^2.0.0" - acorn "^7.1.0" - acorn-globals "^4.3.2" - array-equal "^1.0.0" - cssom "^0.4.1" - cssstyle "^2.0.0" - data-urls "^1.1.0" - domexception "^1.0.1" - escodegen "^1.11.1" - html-encoding-sniffer "^1.0.2" - nwsapi "^2.2.0" - parse5 "5.1.0" - pn "^1.1.0" - request "^2.88.0" - request-promise-native "^1.0.7" - saxes "^3.1.9" - symbol-tree "^3.2.2" - tough-cookie "^3.0.1" - w3c-hr-time "^1.0.1" - w3c-xmlserializer "^1.1.2" - webidl-conversions "^4.0.2" - whatwg-encoding "^1.0.5" - whatwg-mimetype "^2.3.0" - whatwg-url "^7.0.0" - ws "^7.0.0" - xml-name-validator "^3.0.0" - -jsdom@^16.4.0: +jsdom@^16.6.0: version "16.7.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" integrity sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw== @@ -7923,12 +7052,7 @@ jsesc@~0.5.0: resolved "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== -json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - -json-parse-even-better-errors@^2.3.0: +json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== @@ -7943,11 +7067,6 @@ json-schema-traverse@^1.0.0: resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz" integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== -json-schema@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" - integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== - json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" @@ -7958,28 +7077,11 @@ json-stringify-pretty-compact@^2.0.0: resolved "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-2.0.0.tgz" integrity sha512-WRitRfs6BGq4q8gTgOy4ek7iPFXjbra0H3PmDLKm2xnZ+Gh1HUhiKGgCZkSPNULlP7mvfu6FV/mOLhCarspADQ== -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== - json5@2.x, json5@^2.1.2, json5@^2.2.1: version "2.2.1" resolved "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz" integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== -json5@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw== - -json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== - dependencies: - minimist "^1.2.0" - jsonfile@^6.0.1: version "6.1.0" resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz" @@ -7989,16 +7091,6 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" -jsprim@^1.2.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" - integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" - "jsx-ast-utils@^2.4.1 || ^3.0.0": version "3.3.0" resolved "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.0.tgz" @@ -8007,26 +7099,7 @@ jsprim@^1.2.2: array-includes "^3.1.4" object.assign "^4.1.2" -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw== - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: +kind-of@^6.0.2: version "6.0.3" resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== @@ -8036,42 +7109,38 @@ kleur@^3.0.3: resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== -last-call-webpack-plugin@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/last-call-webpack-plugin/-/last-call-webpack-plugin-3.0.0.tgz#9742df0e10e3cf46e5c0381c2de90d3a7a2d7555" - integrity sha512-7KI2l2GIZa9p2spzPIVZBYyNKkN+e/SQPpnjlTiPhdbDW3F86tdKKELxKpzJ5sgU19wQWsACULZmpTPYHeWO5w== - dependencies: - lodash "^4.17.5" - webpack-sources "^1.1.0" +klona@^2.0.4, klona@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.5.tgz#d166574d90076395d9963aa7a928fabb8d76afbc" + integrity sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ== lerc@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/lerc/-/lerc-3.0.0.tgz" integrity sha512-Rm4J/WaHhRa93nCN2mwWDZFoRVF18G1f47C+kvQWyHGEZxFpTUi73p7lMVSAndyxGt6lJ2/CFbOcf9ra5p8aww== -less-loader@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-5.0.0.tgz#498dde3a6c6c4f887458ee9ed3f086a12ad1b466" - integrity sha512-bquCU89mO/yWLaUq0Clk7qCsKhsF/TZpJUzETRvJa9KSVEL9SO3ovCvdEHISBhrC81OwC8QSVX7E0bzElZj9cg== +less-loader@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-10.2.0.tgz#97286d8797dc3dc05b1d16b0ecec5f968bdd4e32" + integrity sha512-AV5KHWvCezW27GT90WATaDnfXBv99llDbtaj4bshq6DvAihMdNjaPDcUMa6EXKLRF+P2opFenJp89BXg91XLYg== dependencies: - clone "^2.1.1" - loader-utils "^1.1.0" - pify "^4.0.1" + klona "^2.0.4" -less@^3.11.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/less/-/less-3.13.1.tgz#0ebc91d2a0e9c0c6735b83d496b0ab0583077909" - integrity sha512-SwA1aQXGUvp+P5XdZslUOhhLnClSLIjWvJhmd+Vgib5BFIr9lMNlQwmwUNOjXThF/A0x+MCYYPeWEfeWiLRnTw== +less@^4.1.2: + version "4.1.3" + resolved "https://registry.yarnpkg.com/less/-/less-4.1.3.tgz#175be9ddcbf9b250173e0a00b4d6920a5b770246" + integrity sha512-w16Xk/Ta9Hhyei0Gpz9m7VS8F28nieJaL/VyShID7cYvP6IL5oHeL6p4TXSDJqZE/lNv0oJ2pGVjJsRkfwm5FA== dependencies: copy-anything "^2.0.1" - tslib "^1.10.0" + parse-node-version "^1.0.1" + tslib "^2.3.0" optionalDependencies: errno "^0.1.1" graceful-fs "^4.1.2" image-size "~0.5.0" make-dir "^2.1.0" mime "^1.4.1" - native-request "^1.0.5" + needle "^3.1.0" source-map "~0.6.0" leven@^3.1.0: @@ -8105,39 +7174,10 @@ lines-and-columns@^1.1.6: resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw== - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - -loader-runner@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" - integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== - -loader-utils@^0.2.16: - version "0.2.17" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348" - integrity sha512-tiv66G0SmiOx+pLWMtGEkfSEejxvb6N6uRrQjfWJIT79W9GMpgKeCAmm9aVBKtd4WEgntciI8CsGqjpDoCWJug== - dependencies: - big.js "^3.1.3" - emojis-list "^2.0.0" - json5 "^0.5.0" - object-assign "^4.0.1" - -loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" - integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^1.0.1" +loader-runner@^4.2.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" + integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== loader-utils@^2.0.0: version "2.0.2" @@ -8185,9 +7225,9 @@ lodash.memoize@4.x, lodash.memoize@^4.1.2: resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz" integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== -lodash.merge@^4.6.2: +lodash.merge@4.6.2, lodash.merge@^4.6.2: version "4.6.2" - resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== lodash.once@^4.1.1: @@ -8195,33 +7235,16 @@ lodash.once@^4.1.1: resolved "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz" integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg== -lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== - -lodash.truncate@^4.4.2: - version "4.4.2" - resolved "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz" - integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= - lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== -lodash@4.17.21, lodash@^4.1.1, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.7.0: +lodash@4.17.21, lodash@^4.1.1, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.7.0: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== - dependencies: - chalk "^2.4.2" - log-symbols@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz" @@ -8237,17 +7260,12 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3 dependencies: js-tokens "^3.0.0 || ^4.0.0" -lower-case@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" - integrity sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA== - -lru-cache@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" - integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== dependencies: - yallist "^3.0.2" + tslib "^2.0.3" lru-cache@^6.0.0: version "6.0.0" @@ -8261,7 +7279,7 @@ lz-string@^1.4.4: resolved "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz" integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY= -make-dir@^2.0.0, make-dir@^2.1.0: +make-dir@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz" integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== @@ -8288,47 +7306,21 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" -mamacro@^0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/mamacro/-/mamacro-0.0.3.tgz#ad2c9576197c9f1abf308d0787865bd975a3f3e4" - integrity sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA== - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg== - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w== - dependencies: - object-visit "^1.0.0" - mapbox-to-css-font@^2.4.1: version "2.4.1" resolved "https://registry.npmjs.org/mapbox-to-css-font/-/mapbox-to-css-font-2.4.1.tgz" integrity sha512-QQ/iKiM43DM9+aujTL45Iz5o7gDeSFmy4LPl3HZmNcwCE++NxGazf+yFpY+wCb+YS23sDa1ghpo3zrNFOcHlow== -marked@4.0.12: - version "4.0.12" - resolved "https://registry.yarnpkg.com/marked/-/marked-4.0.12.tgz#2262a4e6fd1afd2f13557726238b69a48b982f7d" - integrity sha512-hgibXWrEDNBWgGiK18j/4lkS6ihTe9sxtV4Q1OQppb/0zzyPSzoFANBa5MfsG/zgsWklmNnhm0XACZOH/0HBiQ== +marked@4.0.18: + version "4.0.18" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.0.18.tgz#cd0ac54b2e5610cfb90e8fd46ccaa8292c9ed569" + integrity sha512-wbLDJ7Zh0sqA0Vdg6aqlbT+yPxqLblpAZh1mK2+AO2twQkPywvvqQNfEPVwSSRjZ7dZcdeVBIAgiO7MMp3Dszw== md5-file@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/md5-file/-/md5-file-5.0.0.tgz" integrity sha512-xbEFXCYVWrSx/gEKS1VPlg84h/4L20znVIulKw6kMfmBUAZNAnF00eczz9ICMl+/hjQGo5KSXRxbL/47X3rmMw== -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - mdn-data@2.0.14: version "2.0.14" resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz" @@ -8341,6 +7333,13 @@ memfs@^3.1.2: dependencies: fs-monkey "1.0.3" +memfs@^3.4.1: + version "3.4.7" + resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.4.7.tgz#e5252ad2242a724f938cb937e3c4f7ceb1f70e5a" + integrity sha512-ygaiUSNalBX85388uskeCyhSAoOSgzBbtVCr9jA2RROssFL9Q19/ZXFqS+2Th2sr1ewNIWgFdLzLC3Yl1Zv+lw== + dependencies: + fs-monkey "^1.0.3" + memoize-one@6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz" @@ -8361,22 +7360,6 @@ memoize-one@^5.1.1: resolved "https://registry.npmjs.org/memoize-one/-/memoize-one-5.1.1.tgz" integrity sha512-HKeeBpWvqiVJD57ZUAsJNm71eHTykffzcLZVYWiVfQeI1rJtuEaS7hQiEpWfVVk18donPwJEcFKIkCmPJNOhHA== -memory-fs@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" - integrity sha512-cda4JKCxReDXFXRqOHPQscuIYg1PvxbE2S2GP45rnwfEK+vZaXC8C1OFvdHIbgw0DLzowXGVoxLaAmlgRy14GQ== - dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" - -memory-fs@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.5.0.tgz#324c01288b88652966d161db77838720845a8e3c" - integrity sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA== - dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" - merge-class-names@^1.1.1: version "1.4.2" resolved "https://registry.npmjs.org/merge-class-names/-/merge-class-names-1.4.2.tgz" @@ -8387,30 +7370,11 @@ merge-stream@^2.0.0: resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: +merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -micromatch@^3.1.10, micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4: version "4.0.5" resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz" @@ -8419,22 +7383,14 @@ micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - mime-db@1.52.0: version "1.52.0" resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@~2.1.19: +mime-types@^2.1.12, mime-types@^2.1.27: version "2.1.35" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" @@ -8444,11 +7400,6 @@ mime@^1.4.1: resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mime@^2.4.4: - version "2.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" - integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== - mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" @@ -8467,25 +7418,12 @@ mini-create-react-context@^0.4.0: "@babel/runtime" "^7.12.1" tiny-warning "^1.0.3" -mini-css-extract-plugin@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.7.0.tgz#5ba8290fbb4179a43dd27cca444ba150bee743a0" - integrity sha512-RQIw6+7utTYn8DBGsf/LpRgZCJMpZt+kuawJ/fju0KiOL6nAaTBNmCJwS7HtwSCXfS47gCkmtBFS7HdsquhdxQ== +mini-css-extract-plugin@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.6.1.tgz#9a1251d15f2035c342d99a468ab9da7a0451b71e" + integrity sha512-wd+SD57/K6DiV7jIR34P+s3uckTRuQvx0tKPcvjFlrEylk6P4mQ2KSWk1hblj1Kxaqok7LogKOieygXqBczNlg== dependencies: - loader-utils "^1.1.0" - normalize-url "1.9.1" - schema-utils "^1.0.0" - webpack-sources "^1.1.0" - -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + schema-utils "^4.0.0" minimatch@3.0.4, minimatch@^3.0.4: version "3.0.4" @@ -8494,87 +7432,23 @@ minimatch@3.0.4, minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= +minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" -minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: +minimist@^1.2.6: version "1.2.6" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== -minipass-collect@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" - integrity sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA== - dependencies: - minipass "^3.0.0" - -minipass-flush@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/minipass-flush/-/minipass-flush-1.0.5.tgz#82e7135d7e89a50ffe64610a787953c4c4cbb373" - integrity sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw== - dependencies: - minipass "^3.0.0" - -minipass-pipeline@^1.2.2: - version "1.2.4" - resolved "https://registry.yarnpkg.com/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz#68472f79711c084657c067c5c6ad93cddea8214c" - integrity sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A== - dependencies: - minipass "^3.0.0" - -minipass@^3.0.0, minipass@^3.1.1: - version "3.3.3" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.3.tgz#fd1f0e6c06449c10dadda72618b59c00f3d6378d" - integrity sha512-N0BOsdFAlNRfmwMhjAsLVWOk7Ljmeb39iqFlsV1At+jqRhSUP9yeof8FyJu4imaJiSUp8vQebWD/guZwGQC8iA== - dependencies: - yallist "^4.0.0" - -mississippi@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" - integrity sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA== - dependencies: - concat-stream "^1.5.0" - duplexify "^3.4.2" - end-of-stream "^1.1.0" - flush-write-stream "^1.0.0" - from2 "^2.1.0" - parallel-transform "^1.1.0" - pump "^3.0.0" - pumpify "^1.3.3" - stream-each "^1.1.0" - through2 "^2.0.0" - -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@0.5.1: - version "0.5.1" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -mkdirp@1.x, mkdirp@^1.0.4: +mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mkdirp@^0.5.1: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - moment-timezone@0.5.34: version "0.5.34" resolved "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz" @@ -8582,10 +7456,10 @@ moment-timezone@0.5.34: dependencies: moment ">= 2.9.0" -moment@2.29.2: - version "2.29.2" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.2.tgz#00910c60b20843bcba52d37d58c628b47b1f20e4" - integrity sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg== +moment@2.29.4: + version "2.29.4" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" + integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== moment@2.x, "moment@>= 2.9.0": version "2.29.3" @@ -8604,18 +7478,6 @@ moo-color@^1.0.2: dependencies: color-name "^1.1.4" -move-concurrently@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" - integrity sha512-hdrFxZOycD/g6A6SoI2bB5NA/5NEqD0569+S47WZhPvm46sD50ZHdYaFmnua5lndde9rCHGjmfK7Z8BuCt/PcQ== - dependencies: - aproba "^1.1.1" - copy-concurrently "^1.0.0" - fs-write-stream-atomic "^1.0.8" - mkdirp "^0.5.1" - rimraf "^2.5.4" - run-queue "^1.0.3" - ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" @@ -8631,11 +7493,6 @@ mute-stream@0.0.8: resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== -nan@^2.12.1: - version "2.16.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" - integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA== - nano-css@^5.3.1: version "5.3.4" resolved "https://registry.npmjs.org/nano-css/-/nano-css-5.3.4.tgz" @@ -8655,117 +7512,52 @@ nanoid@^3.3.4: resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz" integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -native-request@^1.0.5: - version "1.1.0" - resolved "https://registry.yarnpkg.com/native-request/-/native-request-1.1.0.tgz#acdb30fe2eefa3e1bc8c54b3a6852e9c5c0d3cb0" - integrity sha512-uZ5rQaeRn15XmpgE0xoPL8YWqcX90VtCFglYwAgkvKM5e8fog+vePLAhHxuuv/gRkrQxIeh5U3q9sMNUrENqWw== - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -neo-async@^2.5.0, neo-async@^2.6.1: +needle@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/needle/-/needle-3.1.0.tgz#3bf5cd090c28eb15644181ab6699e027bd6c53c9" + integrity sha512-gCE9weDhjVGCRqS8dwDR/D3GTAeyXLXuqp7I8EzH6DllZGXSUyxuqqLh+YX9rMAWaaTFyVAg6rHGL25dqvczKw== + dependencies: + debug "^3.2.6" + iconv-lite "^0.6.3" + sax "^1.2.4" + +neo-async@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - -no-case@^2.2.0: - version "2.3.2" - resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" - integrity sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ== +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== dependencies: - lower-case "^1.1.1" + lower-case "^2.0.2" + tslib "^2.0.3" + +node-abort-controller@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/node-abort-controller/-/node-abort-controller-3.0.1.tgz#f91fa50b1dee3f909afabb7e261b1e1d6b0cb74e" + integrity sha512-/ujIVxthRs+7q6hsdjHMaj8hRG9NuWmwrz+JdRwZ14jdFoKSkm+vDsCbF9PLpnSqjaWQJuTmVtcWHNLr+vrOFw== node-int64@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-libs-browser@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425" - integrity sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q== - dependencies: - assert "^1.1.1" - browserify-zlib "^0.2.0" - buffer "^4.3.0" - console-browserify "^1.1.0" - constants-browserify "^1.0.0" - crypto-browserify "^3.11.0" - domain-browser "^1.1.1" - events "^3.0.0" - https-browserify "^1.0.0" - os-browserify "^0.3.0" - path-browserify "0.0.1" - process "^0.11.10" - punycode "^1.2.4" - querystring-es3 "^0.2.0" - readable-stream "^2.3.3" - stream-browserify "^2.0.1" - stream-http "^2.7.2" - string_decoder "^1.0.0" - timers-browserify "^2.0.4" - tty-browserify "0.0.0" - url "^0.11.0" - util "^0.11.0" - vm-browserify "^1.0.1" - -node-notifier@^8.0.0: - version "8.0.2" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.2.tgz#f3167a38ef0d2c8a866a83e318c1ba0efeb702c5" - integrity sha512-oJP/9NAdd9+x2Q+rfphB2RJCHjod70RcRLjosiPMMu5gjIfwVnOUGq2nbTjTUbmy0DJ/tFIVT30+Qe3nzl4TJg== - dependencies: - growly "^1.3.0" - is-wsl "^2.2.0" - semver "^7.3.2" - shellwords "^0.1.1" - uuid "^8.3.0" - which "^2.0.2" - node-releases@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.5.tgz" integrity sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q== -normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w== - dependencies: - remove-trailing-separator "^1.0.1" +node-releases@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" + integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" @@ -8777,29 +7569,12 @@ normalize-range@^0.1.2: resolved "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz" integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA== -normalize-url@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c" - integrity sha512-A48My/mtCklowHBlI8Fq2jFWK4tX4lJ5E6ytFsSOq1fzpvT0SQSgKhSg7lN5c2uYFOrUAOQp6zhhJnpp1eMloQ== - dependencies: - object-assign "^4.0.1" - prepend-http "^1.0.0" - query-string "^4.1.0" - sort-keys "^1.0.0" - normalize-url@^6.0.1: version "6.1.0" resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw== - dependencies: - path-key "^2.0.0" - -npm-run-path@^4.0.0, npm-run-path@^4.0.1: +npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== @@ -8813,35 +7588,16 @@ nth-check@^2.0.1: dependencies: boolbase "^1.0.0" -num2fraction@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" - integrity sha512-Y1wZESM7VUThYY+4W+X4ySH2maqcA+p7UR+w8VWNWVAd6lwuXXWz/w/Cz43J/dI2I+PS6wD5N+bJUF+gjWvIqg== - nwsapi@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz" integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -object-assign@4.x, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@4.x, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ== - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - object-inspect@^1.12.0, object-inspect@^1.9.0: version "1.12.2" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz" @@ -8852,13 +7608,6 @@ object-keys@^1.1.1: resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA== - dependencies: - isobject "^3.0.0" - object.assign@^4.1.0, object.assign@^4.1.2: version "4.1.2" resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz" @@ -8887,16 +7636,6 @@ object.fromentries@^2.0.5: define-properties "^1.1.3" es-abstract "^1.19.1" -object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.1: - version "2.1.4" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.4.tgz#7965e6437a57278b587383831a9b829455a4bc37" - integrity sha512-sccv3L/pMModT6dJAYF3fzGMVcb38ysQ0tEE6ixv2yXJDtEIPph268OlAdJj5/qZMZDq2g/jqvwppt36uS/uQQ== - dependencies: - array.prototype.reduce "^1.0.4" - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.1" - object.hasown@^1.1.0: version "1.1.1" resolved "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.1.tgz" @@ -8905,13 +7644,6 @@ object.hasown@^1.1.0: define-properties "^1.1.4" es-abstract "^1.19.5" -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ== - dependencies: - isobject "^3.0.1" - object.values@^1.1.5: version "1.1.5" resolved "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz" @@ -8921,26 +7653,25 @@ object.values@^1.1.5: define-properties "^1.1.3" es-abstract "^1.19.1" -ol-mapbox-style@^7.1.1: - version "7.1.1" - resolved "https://registry.npmjs.org/ol-mapbox-style/-/ol-mapbox-style-7.1.1.tgz" - integrity sha512-GLTEYiH/Ec9Zn1eS4S/zXyR2sierVrUc+OLVP8Ra0FRyqRhoYbXdko0b7OIeSHWdtJfHssWYefDOGxfTRUUZ/A== +ol-mapbox-style@^8.0.5: + version "8.2.1" + resolved "https://registry.yarnpkg.com/ol-mapbox-style/-/ol-mapbox-style-8.2.1.tgz#0f0c252b6495853a137d7e4dd3f915fab664b356" + integrity sha512-3kBBuZC627vDL8vnUdfVbCbfkhkcZj2kXPHQcuLhC4JJEA+XkEVEtEde8x8+AZctRbHwBkSiubTPaRukgLxIRw== dependencies: - "@mapbox/mapbox-gl-style-spec" "^13.20.1" + "@mapbox/mapbox-gl-style-spec" "^13.23.1" mapbox-to-css-font "^2.4.1" - webfont-matcher "^1.1.0" -ol@6.14.1: - version "6.14.1" - resolved "https://registry.npmjs.org/ol/-/ol-6.14.1.tgz" - integrity sha512-sIcUWkGud3Y2gT3TJubSHlkyMXiPVh1yxfCPHxmY8+qtm79bB9oRnei9xHVIbRRG0Ro6Ldp5E+BMVSvYCxSpaA== +ol@6.15.1: + version "6.15.1" + resolved "https://registry.yarnpkg.com/ol/-/ol-6.15.1.tgz#364f459939ef71f970b2376a821a896529f65e3a" + integrity sha512-ZG2CKTpJ8Q+tPywYysVwPk+yevwJzlbwjRKhoCvd7kLVWMbfBl1O/+Kg/yrZZrhG9FNXbFH4GeOZ5yVRqo3P4w== dependencies: - geotiff "^2.0.2" - ol-mapbox-style "^7.1.1" + geotiff "2.0.4" + ol-mapbox-style "^8.0.5" pbf "3.2.1" rbush "^3.0.1" -once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@^1.3.0: version "1.4.0" resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= @@ -8963,15 +7694,6 @@ open@^8.4.0: is-docker "^2.1.1" is-wsl "^2.2.0" -optimize-css-assets-webpack-plugin@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-6.0.1.tgz#7719bceabba1f3891ec3ae04efb81a1cc99cd793" - integrity sha512-BshV2UZPfggZLdUfN3zFBbG4sl/DynUI+YCB6fRRDWaqO2OiWN8GPcp4Y0/fEV6B3k9Hzyk3czve3V/8B/SzKQ== - dependencies: - cssnano "^5.0.2" - last-call-webpack-plugin "^3.0.0" - postcss "^8.2.1" - optionator@^0.8.1: version "0.8.3" resolved "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz" @@ -8996,20 +7718,6 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" -ora@^4.0.3: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ora/-/ora-4.1.1.tgz#566cc0348a15c36f5f0e979612842e02ba9dddbc" - integrity sha512-sjYP8QyVWBpBZWD6Vr1M/KwknSw6kJOz41tvGMlwWeClHBtYKTbHMki1PsLZnxKpXMPbTKv9b3pjQu3REib96A== - dependencies: - chalk "^3.0.0" - cli-cursor "^3.1.0" - cli-spinners "^2.2.0" - is-interactive "^1.0.0" - log-symbols "^3.0.0" - mute-stream "0.0.8" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - ora@^5.4.1: version "5.4.1" resolved "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz" @@ -9025,27 +7733,12 @@ ora@^5.4.1: strip-ansi "^6.0.0" wcwidth "^1.0.1" -os-browserify@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - integrity sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A== - os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== -p-each-series@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" - integrity sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA== - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== - -p-limit@^2.0.0, p-limit@^2.2.0, p-limit@^2.2.1, p-limit@^2.3.0: +p-limit@^2.0.0, p-limit@^2.2.0: version "2.3.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== @@ -9080,13 +7773,6 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" -p-map@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-3.0.0.tgz#d704d9af8a2ba684e2600d9a215983d4141a979d" - integrity sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ== - dependencies: - aggregate-error "^3.0.0" - p-try@^2.0.0: version "2.2.0" resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" @@ -9097,31 +7783,18 @@ pako@^2.0.4: resolved "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz" integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg== -pako@~1.0.5: - version "1.0.11" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" - integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== - papaparse@5.3.2: version "5.3.2" resolved "https://registry.npmjs.org/papaparse/-/papaparse-5.3.2.tgz" integrity sha512-6dNZu0Ki+gyV0eBsFKJhYr+MdQYAzFUGlBMNj3GNrmHxmz1lfRa24CjFObPXtjcetlOv5Ad299MhIK0znp3afw== -parallel-transform@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.2.0.tgz#9049ca37d6cb2182c3b1d2c720be94d14a5814fc" - integrity sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg== - dependencies: - cyclist "^1.0.1" - inherits "^2.0.3" - readable-stream "^2.1.5" - -param-case@2.1.x: - version "2.1.1" - resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" - integrity sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w== +param-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/param-case/-/param-case-3.0.4.tgz#7d17fe4aa12bde34d4a77d91acfb6219caad01c5" + integrity sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A== dependencies: - no-case "^2.2.0" + dot-case "^3.0.4" + tslib "^2.0.3" parent-module@^1.0.0: version "1.0.1" @@ -9130,31 +7803,12 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-asn1@^5.0.0, parse-asn1@^5.1.5: - version "5.1.6" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4" - integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw== - dependencies: - asn1.js "^5.2.0" - browserify-aes "^1.0.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - safe-buffer "^5.1.1" - parse-headers@^2.0.2: version "2.0.5" resolved "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz" integrity sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA== -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw== - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - -parse-json@^5.0.0: +parse-json@^5.0.0, parse-json@^5.2.0: version "5.2.0" resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== @@ -9164,30 +7818,23 @@ parse-json@^5.0.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -parse5@5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" - integrity sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ== +parse-node-version@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" + integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA== -parse5@6.0.1: +parse5@6.0.1, parse5@^6.0.1: version "6.0.1" - resolved "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw== - -path-browserify@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a" - integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ== - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q== +pascal-case@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb" + integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" path-exists@^3.0.0: version "3.0.0" @@ -9204,11 +7851,6 @@ path-is-absolute@^1.0.0: resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== - path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" @@ -9226,13 +7868,6 @@ path-to-regexp@^1.7.0: dependencies: isarray "0.0.1" -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - path-type@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" @@ -9246,66 +7881,38 @@ pbf@3.2.1: ieee754 "^1.1.12" resolve-protobuf-schema "^2.1.0" -pbkdf2@^3.0.3: - version "3.1.2" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" - integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - performance-now@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -picocolors@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" - integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== - picocolors@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== - pify@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== -pirates@^4.0.1: +pirates@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== -pixelmatch@^5.1.0: +pixelmatch@^5.2.1: version "5.3.0" resolved "https://registry.yarnpkg.com/pixelmatch/-/pixelmatch-5.3.0.tgz#5e5321a7abedfb7962d60dbf345deda87cb9560a" integrity sha512-o8mkY4E/+LNUf6LzX96ht6k6CEDi65k9G2rjMtBe9Oo+VPKSvl+0GKHuH/AlG+GA5LPG/i5hrekkxUc3s2HU+Q== dependencies: pngjs "^6.0.0" -pkg-dir@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" - integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== - dependencies: - find-up "^3.0.0" - pkg-dir@^4.1.0, pkg-dir@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz" @@ -9320,28 +7927,17 @@ pkg-up@^3.1.0: dependencies: find-up "^3.0.0" -pn@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" - integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== - pngjs@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz" integrity sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg== -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== - -postcss-attribute-case-insensitive@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-4.0.2.tgz#d93e46b504589e94ac7277b0463226c68041a880" - integrity sha512-clkFxk/9pcdb4Vkn0hAHq3YnxBQ2p0CGD1dy24jN+reBck+EWxMbxSUqN4Yj7t0w8csl87K6p0gxBe1utkJsYA== +postcss-attribute-case-insensitive@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-5.0.2.tgz#03d761b24afc04c09e757e92ff53716ae8ea2741" + integrity sha512-XIidXV8fDr0kKt28vqki84fRK8VW8eTuIa4PChv2MqKuT6C9UjmSKzen6KaWhWEoYvwxFCa7n/tC1SZ3tyq4SQ== dependencies: - postcss "^7.0.2" - postcss-selector-parser "^6.0.2" + postcss-selector-parser "^6.0.10" postcss-calc@^8.2.3: version "8.2.4" @@ -9351,47 +7947,33 @@ postcss-calc@^8.2.3: postcss-selector-parser "^6.0.9" postcss-value-parser "^4.2.0" -postcss-color-functional-notation@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/postcss-color-functional-notation/-/postcss-color-functional-notation-2.0.1.tgz#5efd37a88fbabeb00a2966d1e53d98ced93f74e0" - integrity sha512-ZBARCypjEDofW4P6IdPVTLhDNXPRn8T2s1zHbZidW6rPaaZvcnCS2soYFIQJrMZSxiePJ2XIYTlcb2ztr/eT2g== - dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" - -postcss-color-gray@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/postcss-color-gray/-/postcss-color-gray-5.0.0.tgz#532a31eb909f8da898ceffe296fdc1f864be8547" - integrity sha512-q6BuRnAGKM/ZRpfDascZlIZPjvwsRye7UDNalqVz3s7GDxMtqPY6+Q871liNxsonUw8oC61OG+PSaysYpl1bnw== +postcss-clamp@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/postcss-clamp/-/postcss-clamp-4.1.0.tgz#7263e95abadd8c2ba1bd911b0b5a5c9c93e02363" + integrity sha512-ry4b1Llo/9zz+PKC+030KUnPITTJAHeOwjfAyyB60eT0AorGLdzp52s31OsPRHRf8NchkgFoG2y6fCfn1IV1Ow== dependencies: - "@csstools/convert-colors" "^1.4.0" - postcss "^7.0.5" - postcss-values-parser "^2.0.0" + postcss-value-parser "^4.2.0" -postcss-color-hex-alpha@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/postcss-color-hex-alpha/-/postcss-color-hex-alpha-5.0.3.tgz#a8d9ca4c39d497c9661e374b9c51899ef0f87388" - integrity sha512-PF4GDel8q3kkreVXKLAGNpHKilXsZ6xuu+mOQMHWHLPNyjiUBOr75sp5ZKJfmv1MCus5/DWUGcK9hm6qHEnXYw== +postcss-color-functional-notation@^4.2.2: + version "4.2.4" + resolved "https://registry.yarnpkg.com/postcss-color-functional-notation/-/postcss-color-functional-notation-4.2.4.tgz#21a909e8d7454d3612d1659e471ce4696f28caec" + integrity sha512-2yrTAUZUab9s6CpxkxC4rVgFEVaR6/2Pipvi6qcgvnYiVqZcbDHEoBDhrXzyb7Efh2CCfHQNtcqWcIruDTIUeg== dependencies: - postcss "^7.0.14" - postcss-values-parser "^2.0.1" + postcss-value-parser "^4.2.0" -postcss-color-mod-function@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/postcss-color-mod-function/-/postcss-color-mod-function-3.0.3.tgz#816ba145ac11cc3cb6baa905a75a49f903e4d31d" - integrity sha512-YP4VG+xufxaVtzV6ZmhEtc+/aTXH3d0JLpnYfxqTvwZPbJhWqp8bSY3nfNzNRFLgB4XSaBA82OE4VjOOKpCdVQ== +postcss-color-hex-alpha@^8.0.3: + version "8.0.4" + resolved "https://registry.yarnpkg.com/postcss-color-hex-alpha/-/postcss-color-hex-alpha-8.0.4.tgz#c66e2980f2fbc1a63f5b079663340ce8b55f25a5" + integrity sha512-nLo2DCRC9eE4w2JmuKgVA3fGL3d01kGq752pVALF68qpGLmx2Qrk91QTKkdUqqp45T1K1XV8IhQpcu1hoAQflQ== dependencies: - "@csstools/convert-colors" "^1.4.0" - postcss "^7.0.2" - postcss-values-parser "^2.0.0" + postcss-value-parser "^4.2.0" -postcss-color-rebeccapurple@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-color-rebeccapurple/-/postcss-color-rebeccapurple-4.0.1.tgz#c7a89be872bb74e45b1e3022bfe5748823e6de77" - integrity sha512-aAe3OhkS6qJXBbqzvZth2Au4V3KieR5sRQ4ptb2b2O8wgvB3SJBsdG+jsn2BZbbwekDG8nTfcCNKcSfe/lEy8g== +postcss-color-rebeccapurple@^7.0.2: + version "7.1.1" + resolved "https://registry.yarnpkg.com/postcss-color-rebeccapurple/-/postcss-color-rebeccapurple-7.1.1.tgz#63fdab91d878ebc4dd4b7c02619a0c3d6a56ced0" + integrity sha512-pGxkuVEInwLHgkNxUc4sdg4g3py7zUeCQ9sMfwyHAT+Ezk8a4OaaVZ8lIY5+oNqA/BXXgLyXv0+5wHP68R79hg== dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" + postcss-value-parser "^4.2.0" postcss-colormin@^5.3.0: version "5.3.0" @@ -9411,36 +7993,33 @@ postcss-convert-values@^5.1.2: browserslist "^4.20.3" postcss-value-parser "^4.2.0" -postcss-custom-media@^7.0.8: - version "7.0.8" - resolved "https://registry.yarnpkg.com/postcss-custom-media/-/postcss-custom-media-7.0.8.tgz#fffd13ffeffad73621be5f387076a28b00294e0c" - integrity sha512-c9s5iX0Ge15o00HKbuRuTqNndsJUbaXdiNsksnVH8H4gdc+zbLzr/UasOwNG6CTDpLFekVY4672eWdiiWu2GUg== +postcss-custom-media@^8.0.0: + version "8.0.2" + resolved "https://registry.yarnpkg.com/postcss-custom-media/-/postcss-custom-media-8.0.2.tgz#c8f9637edf45fef761b014c024cee013f80529ea" + integrity sha512-7yi25vDAoHAkbhAzX9dHx2yc6ntS4jQvejrNcC+csQJAXjj15e7VcWfMgLqBNAbOvqi5uIa9huOVwdHbf+sKqg== dependencies: - postcss "^7.0.14" + postcss-value-parser "^4.2.0" -postcss-custom-properties@^8.0.11: - version "8.0.11" - resolved "https://registry.yarnpkg.com/postcss-custom-properties/-/postcss-custom-properties-8.0.11.tgz#2d61772d6e92f22f5e0d52602df8fae46fa30d97" - integrity sha512-nm+o0eLdYqdnJ5abAJeXp4CEU1c1k+eB2yMCvhgzsds/e0umabFrN6HoTy/8Q4K5ilxERdl/JD1LO5ANoYBeMA== +postcss-custom-properties@^12.1.5: + version "12.1.8" + resolved "https://registry.yarnpkg.com/postcss-custom-properties/-/postcss-custom-properties-12.1.8.tgz#aa003e1885c5bd28e2e32496cd597e389ca889e4" + integrity sha512-8rbj8kVu00RQh2fQF81oBqtduiANu4MIxhyf0HbbStgPtnFlWn0yiaYTpLHrPnJbffVY1s9apWsIoVZcc68FxA== dependencies: - postcss "^7.0.17" - postcss-values-parser "^2.0.1" + postcss-value-parser "^4.2.0" -postcss-custom-selectors@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/postcss-custom-selectors/-/postcss-custom-selectors-5.1.2.tgz#64858c6eb2ecff2fb41d0b28c9dd7b3db4de7fba" - integrity sha512-DSGDhqinCqXqlS4R7KGxL1OSycd1lydugJ1ky4iRXPHdBRiozyMHrdu0H3o7qNOCiZwySZTUI5MV0T8QhCLu+w== +postcss-custom-selectors@^6.0.0: + version "6.0.3" + resolved "https://registry.yarnpkg.com/postcss-custom-selectors/-/postcss-custom-selectors-6.0.3.tgz#1ab4684d65f30fed175520f82d223db0337239d9" + integrity sha512-fgVkmyiWDwmD3JbpCmB45SvvlCD6z9CG6Ie6Iere22W5aHea6oWa7EM2bpnv2Fj3I94L3VbtvX9KqwSi5aFzSg== dependencies: - postcss "^7.0.2" - postcss-selector-parser "^5.0.0-rc.3" + postcss-selector-parser "^6.0.4" -postcss-dir-pseudo-class@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/postcss-dir-pseudo-class/-/postcss-dir-pseudo-class-5.0.0.tgz#6e3a4177d0edb3abcc85fdb6fbb1c26dabaeaba2" - integrity sha512-3pm4oq8HYWMZePJY+5ANriPs3P07q+LW6FAdTlkFH2XqDdP4HeeJYMOzn0HYLhRSjBO3fhiqSwwU9xEULSrPgw== +postcss-dir-pseudo-class@^6.0.4: + version "6.0.5" + resolved "https://registry.yarnpkg.com/postcss-dir-pseudo-class/-/postcss-dir-pseudo-class-6.0.5.tgz#2bf31de5de76added44e0a25ecf60ae9f7c7c26c" + integrity sha512-eqn4m70P031PF7ZQIvSgy9RSJ5uI2171O/OO/zcRNYpJbvaeKFUlar1aJ7rmgiQtbm0FSPsRewjpdS0Oew7MPA== dependencies: - postcss "^7.0.2" - postcss-selector-parser "^5.0.0-rc.3" + postcss-selector-parser "^6.0.10" postcss-discard-comments@^5.1.2: version "5.1.2" @@ -9462,112 +8041,88 @@ postcss-discard-overridden@^5.1.0: resolved "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-5.1.0.tgz" integrity sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw== -postcss-double-position-gradients@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/postcss-double-position-gradients/-/postcss-double-position-gradients-1.0.0.tgz#fc927d52fddc896cb3a2812ebc5df147e110522e" - integrity sha512-G+nV8EnQq25fOI8CH/B6krEohGWnF5+3A6H/+JEpOncu5dCnkS1QQ6+ct3Jkaepw1NGVqqOZH6lqrm244mCftA== - dependencies: - postcss "^7.0.5" - postcss-values-parser "^2.0.0" - -postcss-env-function@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/postcss-env-function/-/postcss-env-function-2.0.2.tgz#0f3e3d3c57f094a92c2baf4b6241f0b0da5365d7" - integrity sha512-rwac4BuZlITeUbiBq60h/xbLzXY43qOsIErngWa4l7Mt+RaSkT7QBjXVGTcBHupykkblHMDrBFh30zchYPaOUw== +postcss-double-position-gradients@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/postcss-double-position-gradients/-/postcss-double-position-gradients-3.1.2.tgz#b96318fdb477be95997e86edd29c6e3557a49b91" + integrity sha512-GX+FuE/uBR6eskOK+4vkXgT6pDkexLokPaz/AbJna9s5Kzp/yl488pKPjhy0obB475ovfT1Wv8ho7U/cHNaRgQ== dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" + "@csstools/postcss-progressive-custom-properties" "^1.1.0" + postcss-value-parser "^4.2.0" -postcss-flexbugs-fixes@4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-4.2.0.tgz#662b3dcb6354638b9213a55eed8913bcdc8d004a" - integrity sha512-QRE0n3hpkxxS/OGvzOa+PDuy4mh/Jg4o9ui22/ko5iGYOG3M5dfJabjnAZjTdh2G9F85c7Hv8hWcEDEKW/xceQ== +postcss-env-function@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/postcss-env-function/-/postcss-env-function-4.0.6.tgz#7b2d24c812f540ed6eda4c81f6090416722a8e7a" + integrity sha512-kpA6FsLra+NqcFnL81TnsU+Z7orGtDTxcOhl6pwXeEq1yFPpRMkCDpHhrz8CFQDr/Wfm0jLiNQ1OsGGPjlqPwA== dependencies: - postcss "^7.0.26" + postcss-value-parser "^4.2.0" -postcss-focus-visible@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-focus-visible/-/postcss-focus-visible-4.0.0.tgz#477d107113ade6024b14128317ade2bd1e17046e" - integrity sha512-Z5CkWBw0+idJHSV6+Bgf2peDOFf/x4o+vX/pwcNYrWpXFrSfTkQ3JQ1ojrq9yS+upnAlNRHeg8uEwFTgorjI8g== - dependencies: - postcss "^7.0.2" +postcss-flexbugs-fixes@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-5.0.2.tgz#2028e145313074fc9abe276cb7ca14e5401eb49d" + integrity sha512-18f9voByak7bTktR2QgDveglpn9DTbBWPUzSOe9g0N4WR/2eSt6Vrcbf0hmspvMI6YWGywz6B9f7jzpFNJJgnQ== -postcss-focus-within@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-focus-within/-/postcss-focus-within-3.0.0.tgz#763b8788596cee9b874c999201cdde80659ef680" - integrity sha512-W0APui8jQeBKbCGZudW37EeMCjDeVxKgiYfIIEo8Bdh5SpB9sxds/Iq8SEuzS0Q4YFOlG7EPFulbbxujpkrV2w== +postcss-focus-visible@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/postcss-focus-visible/-/postcss-focus-visible-6.0.4.tgz#50c9ea9afa0ee657fb75635fabad25e18d76bf9e" + integrity sha512-QcKuUU/dgNsstIK6HELFRT5Y3lbrMLEOwG+A4s5cA+fx3A3y/JTq3X9LaOj3OC3ALH0XqyrgQIgey/MIZ8Wczw== dependencies: - postcss "^7.0.2" + postcss-selector-parser "^6.0.9" -postcss-font-variant@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-font-variant/-/postcss-font-variant-4.0.1.tgz#42d4c0ab30894f60f98b17561eb5c0321f502641" - integrity sha512-I3ADQSTNtLTTd8uxZhtSOrTCQ9G4qUVKPjHiDk0bV75QSxXjVWiJVJ2VLdspGUi9fbW9BcjKJoRvxAH1pckqmA== +postcss-focus-within@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/postcss-focus-within/-/postcss-focus-within-5.0.4.tgz#5b1d2ec603195f3344b716c0b75f61e44e8d2e20" + integrity sha512-vvjDN++C0mu8jz4af5d52CB184ogg/sSxAFS+oUJQq2SuCe7T5U2iIsVJtsCp2d6R4j0jr5+q3rPkBVZkXD9fQ== dependencies: - postcss "^7.0.2" + postcss-selector-parser "^6.0.9" -postcss-gap-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-gap-properties/-/postcss-gap-properties-2.0.0.tgz#431c192ab3ed96a3c3d09f2ff615960f902c1715" - integrity sha512-QZSqDaMgXCHuHTEzMsS2KfVDOq7ZFiknSpkrPJY6jmxbugUPTuSzs/vuE5I3zv0WAS+3vhrlqhijiprnuQfzmg== - dependencies: - postcss "^7.0.2" +postcss-font-variant@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/postcss-font-variant/-/postcss-font-variant-5.0.0.tgz#efd59b4b7ea8bb06127f2d031bfbb7f24d32fa66" + integrity sha512-1fmkBaCALD72CK2a9i468mA/+tr9/1cBxRRMXOUaZqO43oWPR5imcyPjXwuv7PXbCid4ndlP5zWhidQVVa3hmA== -postcss-image-set-function@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/postcss-image-set-function/-/postcss-image-set-function-3.0.1.tgz#28920a2f29945bed4c3198d7df6496d410d3f288" - integrity sha512-oPTcFFip5LZy8Y/whto91L9xdRHCWEMs3e1MdJxhgt4jy2WYXfhkng59fH5qLXSCPN8k4n94p1Czrfe5IOkKUw== - dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" +postcss-gap-properties@^3.0.3: + version "3.0.5" + resolved "https://registry.yarnpkg.com/postcss-gap-properties/-/postcss-gap-properties-3.0.5.tgz#f7e3cddcf73ee19e94ccf7cb77773f9560aa2fff" + integrity sha512-IuE6gKSdoUNcvkGIqdtjtcMtZIFyXZhmFd5RUlg97iVEvp1BZKV5ngsAjCjrVy+14uhGBQl9tzmi1Qwq4kqVOg== -postcss-initial@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/postcss-initial/-/postcss-initial-3.0.4.tgz#9d32069a10531fe2ecafa0b6ac750ee0bc7efc53" - integrity sha512-3RLn6DIpMsK1l5UUy9jxQvoDeUN4gP939tDcKUHD/kM8SGSKbFAnvkpFpj3Bhtz3HGk1jWY5ZNWX6mPta5M9fg== +postcss-image-set-function@^4.0.6: + version "4.0.7" + resolved "https://registry.yarnpkg.com/postcss-image-set-function/-/postcss-image-set-function-4.0.7.tgz#08353bd756f1cbfb3b6e93182c7829879114481f" + integrity sha512-9T2r9rsvYzm5ndsBE8WgtrMlIT7VbtTfE7b3BQnudUqnBcBo7L758oc+o+pdj/dUV0l5wjwSdjeOH2DZtfv8qw== dependencies: - postcss "^7.0.2" + postcss-value-parser "^4.2.0" -postcss-lab-function@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/postcss-lab-function/-/postcss-lab-function-2.0.1.tgz#bb51a6856cd12289ab4ae20db1e3821ef13d7d2e" - integrity sha512-whLy1IeZKY+3fYdqQFuDBf8Auw+qFuVnChWjmxm/UhHWqNHZx+B99EwxTvGYmUBqe3Fjxs4L1BoZTJmPu6usVg== - dependencies: - "@csstools/convert-colors" "^1.4.0" - postcss "^7.0.2" - postcss-values-parser "^2.0.0" +postcss-initial@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-initial/-/postcss-initial-4.0.1.tgz#529f735f72c5724a0fb30527df6fb7ac54d7de42" + integrity sha512-0ueD7rPqX8Pn1xJIjay0AZeIuDoF+V+VvMt/uOnn+4ezUKhZM/NokDeP6DwMNyIoYByuN/94IQnt5FEkaN59xQ== -postcss-load-config@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-2.1.2.tgz#c5ea504f2c4aef33c7359a34de3573772ad7502a" - integrity sha512-/rDeGV6vMUo3mwJZmeHfEDvwnTKKqQ0S7OHUi/kJvvtx3aWtyWG2/0ZWnzCt2keEclwN6Tf0DST2v9kITdOKYw== +postcss-lab-function@^4.1.2: + version "4.2.1" + resolved "https://registry.yarnpkg.com/postcss-lab-function/-/postcss-lab-function-4.2.1.tgz#6fe4c015102ff7cd27d1bd5385582f67ebdbdc98" + integrity sha512-xuXll4isR03CrQsmxyz92LJB2xX9n+pZJ5jE9JgcnmsCammLyKdlzrBin+25dy6wIjfhJpKBAN80gsTlCgRk2w== dependencies: - cosmiconfig "^5.0.0" - import-cwd "^2.0.0" + "@csstools/postcss-progressive-custom-properties" "^1.1.0" + postcss-value-parser "^4.2.0" -postcss-loader@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-3.0.0.tgz#6b97943e47c72d845fa9e03f273773d4e8dd6c2d" - integrity sha512-cLWoDEY5OwHcAjDnkyRQzAXfs2jrKjXpO/HQFcc5b5u/r7aa471wdmChmwfnv7x2u840iat/wi0lQ5nbRgSkUA== +postcss-loader@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-6.2.1.tgz#0895f7346b1702103d30fdc66e4d494a93c008ef" + integrity sha512-WbbYpmAaKcux/P66bZ40bpWsBucjx/TTgVVzRZ9yUO8yQfVBlameJ0ZGVaPfH64hNSBh63a+ICP5nqOpBA0w+Q== dependencies: - loader-utils "^1.1.0" - postcss "^7.0.0" - postcss-load-config "^2.0.0" - schema-utils "^1.0.0" + cosmiconfig "^7.0.0" + klona "^2.0.5" + semver "^7.3.5" -postcss-logical@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-logical/-/postcss-logical-3.0.0.tgz#2495d0f8b82e9f262725f75f9401b34e7b45d5b5" - integrity sha512-1SUKdJc2vuMOmeItqGuNaC+N8MzBWFWEkAnRnLpFYj1tGGa7NqyVBujfRtgNa2gXR+6RkGUiB2O5Vmh7E2RmiA== - dependencies: - postcss "^7.0.2" +postcss-logical@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/postcss-logical/-/postcss-logical-5.0.4.tgz#ec75b1ee54421acc04d5921576b7d8db6b0e6f73" + integrity sha512-RHXxplCeLh9VjinvMrZONq7im4wjWGlRJAqmAVLXyZaXwfDWP73/oq4NdIp+OZwhQUMj0zjqDfM5Fj7qby+B4g== -postcss-media-minmax@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-media-minmax/-/postcss-media-minmax-4.0.0.tgz#b75bb6cbc217c8ac49433e12f22048814a4f5ed5" - integrity sha512-fo9moya6qyxsjbFAYl97qKO9gyre3qvbMnkOZeZwlsW6XYFsvs2DMGDlchVLfAd8LHPZDxivu/+qW2SMQeTHBw== - dependencies: - postcss "^7.0.2" +postcss-media-minmax@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/postcss-media-minmax/-/postcss-media-minmax-5.0.0.tgz#7140bddec173e2d6d657edbd8554a55794e2a5b5" + integrity sha512-yDUvFf9QdFZTuCUg0g0uNSHVlJ5X1lSzDZjPSFaiCWvjgsvu8vEVxtahPrLMinIDEEGnx6cBe6iqdx5YWz08wQ== postcss-merge-longhand@^5.1.6: version "5.1.6" @@ -9619,45 +8174,41 @@ postcss-minify-selectors@^5.2.1: dependencies: postcss-selector-parser "^6.0.5" -postcss-modules-extract-imports@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz#818719a1ae1da325f9832446b01136eeb493cd7e" - integrity sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ== - dependencies: - postcss "^7.0.5" +postcss-modules-extract-imports@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz#cda1f047c0ae80c97dbe28c3e76a43b88025741d" + integrity sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw== -postcss-modules-local-by-default@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz#bb14e0cc78279d504dbdcbfd7e0ca28993ffbbb0" - integrity sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw== +postcss-modules-local-by-default@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz#ebbb54fae1598eecfdf691a02b3ff3b390a5a51c" + integrity sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ== dependencies: - icss-utils "^4.1.1" - postcss "^7.0.32" + icss-utils "^5.0.0" postcss-selector-parser "^6.0.2" postcss-value-parser "^4.1.0" -postcss-modules-scope@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-2.2.0.tgz#385cae013cc7743f5a7d7602d1073a89eaae62ee" - integrity sha512-YyEgsTMRpNd+HmyC7H/mh3y+MeFWevy7V1evVhJWewmMbjDHIbZbOXICC2y+m1xI1UVfIT1HMW/O04Hxyu9oXQ== +postcss-modules-scope@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz#9ef3151456d3bbfa120ca44898dfca6f2fa01f06" + integrity sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg== dependencies: - postcss "^7.0.6" - postcss-selector-parser "^6.0.0" + postcss-selector-parser "^6.0.4" -postcss-modules-values@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz#5b5000d6ebae29b4255301b4a3a54574423e7f10" - integrity sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg== +postcss-modules-values@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz#d7c5e7e68c3bb3c9b27cbf48ca0bb3ffb4602c9c" + integrity sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ== dependencies: - icss-utils "^4.0.0" - postcss "^7.0.6" + icss-utils "^5.0.0" -postcss-nesting@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-nesting/-/postcss-nesting-7.0.1.tgz#b50ad7b7f0173e5b5e3880c3501344703e04c052" - integrity sha512-FrorPb0H3nuVq0Sff7W2rnc3SmIcruVC6YwpcS+k687VxyxO33iE1amna7wHuRVzM8vfiYofXSBHNAZ3QhLvYg== +postcss-nesting@^10.1.3: + version "10.1.10" + resolved "https://registry.yarnpkg.com/postcss-nesting/-/postcss-nesting-10.1.10.tgz#9c396df3d8232cbedfa95baaac6b765b8fd2a817" + integrity sha512-lqd7LXCq0gWc0wKXtoKDru5wEUNjm3OryLVNRZ8OnW8km6fSNUuFrjEhU3nklxXE2jvd4qrox566acgh+xQt8w== dependencies: - postcss "^7.0.2" + "@csstools/selector-specificity" "^2.0.0" + postcss-selector-parser "^6.0.10" postcss-normalize-charset@^5.1.0: version "5.1.0" @@ -9722,6 +8273,11 @@ postcss-normalize-whitespace@^5.1.1: dependencies: postcss-value-parser "^4.2.0" +postcss-opacity-percentage@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/postcss-opacity-percentage/-/postcss-opacity-percentage-1.1.2.tgz#bd698bb3670a0a27f6d657cc16744b3ebf3b1145" + integrity sha512-lyUfF7miG+yewZ8EAk9XUBIlrHyUE6fijnesuz+Mj5zrIHIEw6KcIZSOk/elVMqzLvREmXB83Zi/5QpNRYd47w== + postcss-ordered-values@^5.1.3: version "5.1.3" resolved "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-5.1.3.tgz" @@ -9730,78 +8286,80 @@ postcss-ordered-values@^5.1.3: cssnano-utils "^3.1.0" postcss-value-parser "^4.2.0" -postcss-overflow-shorthand@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-overflow-shorthand/-/postcss-overflow-shorthand-2.0.0.tgz#31ecf350e9c6f6ddc250a78f0c3e111f32dd4c30" - integrity sha512-aK0fHc9CBNx8jbzMYhshZcEv8LtYnBIRYQD5i7w/K/wS9c2+0NSR6B3OVMu5y0hBHYLcMGjfU+dmWYNKH0I85g== +postcss-overflow-shorthand@^3.0.3: + version "3.0.4" + resolved "https://registry.yarnpkg.com/postcss-overflow-shorthand/-/postcss-overflow-shorthand-3.0.4.tgz#7ed6486fec44b76f0eab15aa4866cda5d55d893e" + integrity sha512-otYl/ylHK8Y9bcBnPLo3foYFLL6a6Ak+3EQBPOTR7luMYCOsiVTUk1iLvNf6tVPNGXcoL9Hoz37kpfriRIFb4A== dependencies: - postcss "^7.0.2" + postcss-value-parser "^4.2.0" -postcss-page-break@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-page-break/-/postcss-page-break-2.0.0.tgz#add52d0e0a528cabe6afee8b46e2abb277df46bf" - integrity sha512-tkpTSrLpfLfD9HvgOlJuigLuk39wVTbbd8RKcy8/ugV2bNBUW3xU+AIqyxhDrQr1VUj1RmyJrBn1YWrqUm9zAQ== +postcss-page-break@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/postcss-page-break/-/postcss-page-break-3.0.4.tgz#7fbf741c233621622b68d435babfb70dd8c1ee5f" + integrity sha512-1JGu8oCjVXLa9q9rFTo4MbeeA5FMe00/9C7lN4va606Rdb+HkxXtXsmEDrIraQ11fGz/WvKWa8gMuCKkrXpTsQ== + +postcss-place@^7.0.4: + version "7.0.5" + resolved "https://registry.yarnpkg.com/postcss-place/-/postcss-place-7.0.5.tgz#95dbf85fd9656a3a6e60e832b5809914236986c4" + integrity sha512-wR8igaZROA6Z4pv0d+bvVrvGY4GVHihBCBQieXFY3kuSuMyOmEnnfFzHl/tQuqHZkfkIVBEbDvYcFfHmpSet9g== dependencies: - postcss "^7.0.2" + postcss-value-parser "^4.2.0" -postcss-place@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-place/-/postcss-place-4.0.1.tgz#e9f39d33d2dc584e46ee1db45adb77ca9d1dcc62" - integrity sha512-Zb6byCSLkgRKLODj/5mQugyuj9bvAAw9LqJJjgwz5cYryGeXfFZfSXoP1UfveccFmeq0b/2xxwcTEVScnqGxBg== - dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" - -postcss-preset-env@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/postcss-preset-env/-/postcss-preset-env-6.7.0.tgz#c34ddacf8f902383b35ad1e030f178f4cdf118a5" - integrity sha512-eU4/K5xzSFwUFJ8hTdTQzo2RBLbDVt83QZrAvI07TULOkmyQlnYlpwep+2yIK+K+0KlZO4BvFcleOCCcUtwchg== - dependencies: - autoprefixer "^9.6.1" - browserslist "^4.6.4" - caniuse-lite "^1.0.30000981" - css-blank-pseudo "^0.1.4" - css-has-pseudo "^0.10.0" - css-prefers-color-scheme "^3.1.1" - cssdb "^4.4.0" - postcss "^7.0.17" - postcss-attribute-case-insensitive "^4.0.1" - postcss-color-functional-notation "^2.0.1" - postcss-color-gray "^5.0.0" - postcss-color-hex-alpha "^5.0.3" - postcss-color-mod-function "^3.0.3" - postcss-color-rebeccapurple "^4.0.1" - postcss-custom-media "^7.0.8" - postcss-custom-properties "^8.0.11" - postcss-custom-selectors "^5.1.2" - postcss-dir-pseudo-class "^5.0.0" - postcss-double-position-gradients "^1.0.0" - postcss-env-function "^2.0.2" - postcss-focus-visible "^4.0.0" - postcss-focus-within "^3.0.0" - postcss-font-variant "^4.0.0" - postcss-gap-properties "^2.0.0" - postcss-image-set-function "^3.0.1" - postcss-initial "^3.0.0" - postcss-lab-function "^2.0.1" - postcss-logical "^3.0.0" - postcss-media-minmax "^4.0.0" - postcss-nesting "^7.0.0" - postcss-overflow-shorthand "^2.0.0" - postcss-page-break "^2.0.0" - postcss-place "^4.0.1" - postcss-pseudo-class-any-link "^6.0.0" - postcss-replace-overflow-wrap "^3.0.0" - postcss-selector-matches "^4.0.0" - postcss-selector-not "^4.0.0" - -postcss-pseudo-class-any-link@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-pseudo-class-any-link/-/postcss-pseudo-class-any-link-6.0.0.tgz#2ed3eed393b3702879dec4a87032b210daeb04d1" - integrity sha512-lgXW9sYJdLqtmw23otOzrtbDXofUdfYzNm4PIpNE322/swES3VU9XlXHeJS46zT2onFO7V1QFdD4Q9LiZj8mew== +postcss-preset-env@7.4.3: + version "7.4.3" + resolved "https://registry.yarnpkg.com/postcss-preset-env/-/postcss-preset-env-7.4.3.tgz#fb1c8b4cb405da042da0ddb8c5eda7842c08a449" + integrity sha512-dlPA65g9KuGv7YsmGyCKtFkZKCPLkoVMUE3omOl6yM+qrynVHxFvf0tMuippIrXB/sB/MyhL1FgTIbrO+qMERg== + dependencies: + "@csstools/postcss-color-function" "^1.0.3" + "@csstools/postcss-font-format-keywords" "^1.0.0" + "@csstools/postcss-hwb-function" "^1.0.0" + "@csstools/postcss-ic-unit" "^1.0.0" + "@csstools/postcss-is-pseudo-class" "^2.0.1" + "@csstools/postcss-normalize-display-values" "^1.0.0" + "@csstools/postcss-oklab-function" "^1.0.2" + "@csstools/postcss-progressive-custom-properties" "^1.3.0" + autoprefixer "^10.4.4" + browserslist "^4.20.2" + css-blank-pseudo "^3.0.3" + css-has-pseudo "^3.0.4" + css-prefers-color-scheme "^6.0.3" + cssdb "^6.5.0" + postcss-attribute-case-insensitive "^5.0.0" + postcss-clamp "^4.1.0" + postcss-color-functional-notation "^4.2.2" + postcss-color-hex-alpha "^8.0.3" + postcss-color-rebeccapurple "^7.0.2" + postcss-custom-media "^8.0.0" + postcss-custom-properties "^12.1.5" + postcss-custom-selectors "^6.0.0" + postcss-dir-pseudo-class "^6.0.4" + postcss-double-position-gradients "^3.1.1" + postcss-env-function "^4.0.6" + postcss-focus-visible "^6.0.4" + postcss-focus-within "^5.0.4" + postcss-font-variant "^5.0.0" + postcss-gap-properties "^3.0.3" + postcss-image-set-function "^4.0.6" + postcss-initial "^4.0.1" + postcss-lab-function "^4.1.2" + postcss-logical "^5.0.4" + postcss-media-minmax "^5.0.0" + postcss-nesting "^10.1.3" + postcss-opacity-percentage "^1.1.2" + postcss-overflow-shorthand "^3.0.3" + postcss-page-break "^3.0.4" + postcss-place "^7.0.4" + postcss-pseudo-class-any-link "^7.1.1" + postcss-replace-overflow-wrap "^4.0.0" + postcss-selector-not "^5.0.0" + postcss-value-parser "^4.2.0" + +postcss-pseudo-class-any-link@^7.1.1: + version "7.1.6" + resolved "https://registry.yarnpkg.com/postcss-pseudo-class-any-link/-/postcss-pseudo-class-any-link-7.1.6.tgz#2693b221902da772c278def85a4d9a64b6e617ab" + integrity sha512-9sCtZkO6f/5ML9WcTLcIyV1yz9D1rf0tWc+ulKcvV30s0iZKS/ONyETvoWsr6vnrmW+X+KmuK3gV/w5EWnT37w== dependencies: - postcss "^7.0.2" - postcss-selector-parser "^5.0.0-rc.3" + postcss-selector-parser "^6.0.10" postcss-reduce-initial@^5.1.0: version "5.1.0" @@ -9818,39 +8376,19 @@ postcss-reduce-transforms@^5.1.0: dependencies: postcss-value-parser "^4.2.0" -postcss-replace-overflow-wrap@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-3.0.0.tgz#61b360ffdaedca84c7c918d2b0f0d0ea559ab01c" - integrity sha512-2T5hcEHArDT6X9+9dVSPQdo7QHzG4XKclFT8rU5TzJPDN7RIRTbO9c4drUISOVemLj03aezStHCR2AIcr8XLpw== - dependencies: - postcss "^7.0.2" - -postcss-selector-matches@^4.0.0: +postcss-replace-overflow-wrap@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-selector-matches/-/postcss-selector-matches-4.0.0.tgz#71c8248f917ba2cc93037c9637ee09c64436fcff" - integrity sha512-LgsHwQR/EsRYSqlwdGzeaPKVT0Ml7LAT6E75T8W8xLJY62CE4S/l03BWIt3jT8Taq22kXP08s2SfTSzaraoPww== - dependencies: - balanced-match "^1.0.0" - postcss "^7.0.2" + resolved "https://registry.yarnpkg.com/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-4.0.0.tgz#d2df6bed10b477bf9c52fab28c568b4b29ca4319" + integrity sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw== -postcss-selector-not@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-selector-not/-/postcss-selector-not-4.0.1.tgz#263016eef1cf219e0ade9a913780fc1f48204cbf" - integrity sha512-YolvBgInEK5/79C+bdFMyzqTg6pkYqDbzZIST/PDMqa/o3qtXenD05apBG2jLgT0/BQ77d4U2UK12jWpilqMAQ== - dependencies: - balanced-match "^1.0.0" - postcss "^7.0.2" - -postcss-selector-parser@^5.0.0-rc.3, postcss-selector-parser@^5.0.0-rc.4: +postcss-selector-not@^5.0.0: version "5.0.0" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz#249044356697b33b64f1a8f7c80922dddee7195c" - integrity sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ== + resolved "https://registry.yarnpkg.com/postcss-selector-not/-/postcss-selector-not-5.0.0.tgz#ac5fc506f7565dd872f82f5314c0f81a05630dc7" + integrity sha512-/2K3A4TCP9orP4TNS7u3tGdRFVKqz/E6pX3aGnriPG0jU78of8wsUcqE4QAhWEU0d+WnMSF93Ah3F//vUtK+iQ== dependencies: - cssesc "^2.0.0" - indexes-of "^1.0.1" - uniq "^1.0.1" + balanced-match "^1.0.0" -postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.5, postcss-selector-parser@^6.0.9: +postcss-selector-parser@^6.0.10, postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.5, postcss-selector-parser@^6.0.9: version "6.0.10" resolved "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz" integrity sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w== @@ -9873,32 +8411,15 @@ postcss-unique-selectors@^5.1.1: dependencies: postcss-selector-parser "^6.0.5" -postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: +postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== -postcss-values-parser@^2.0.0, postcss-values-parser@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz#da8b472d901da1e205b47bdc98637b9e9e550e5f" - integrity sha512-2tLuBsA6P4rYTNKCXYG/71C7j1pU6pK503suYOmn4xYrQIzW+opD+7FAFNuGSdZC/3Qfy334QbeMu7MEb8gOxg== - dependencies: - flatten "^1.0.2" - indexes-of "^1.0.1" - uniq "^1.0.1" - -postcss@^7.0.0, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.23, postcss@^7.0.26, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6: - version "7.0.39" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.39.tgz#9624375d965630e2e1f2c02a935c82a59cb48309" - integrity sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA== - dependencies: - picocolors "^0.2.1" - source-map "^0.6.1" - -postcss@^8.2.1: - version "8.4.14" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" - integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== +postcss@^8.3.5, postcss@^8.4.12, postcss@^8.4.7: + version "8.4.16" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.16.tgz#33a1d675fac39941f5f445db0de4db2b6e01d43c" + integrity sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ== dependencies: nanoid "^3.3.4" picocolors "^1.0.0" @@ -9919,35 +8440,18 @@ prelude-ls@~1.1.2: resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== -prepend-http@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg== - -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - -prettier@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" - integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== - -prettier@2.6.0: - version "2.6.0" - resolved "https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz" - integrity sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A== +prettier@2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" + integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== -pretty-error@^2.0.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.2.tgz#be89f82d81b1c86ec8fdfbc385045882727f93b6" - integrity sha512-EY5oDzmsX5wvuynAByrmY0P0hcp+QpnAKbJng2A2MPjVKXCxrDSUkzghVJ4ZGPIv+JC4gX8fPUWscC0RtjsWGw== +pretty-error@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-4.0.0.tgz#90a703f46dd7234adb46d0f84823e9d1cb8f10d6" + integrity sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw== dependencies: lodash "^4.17.20" - renderkid "^2.0.4" + renderkid "^3.0.0" pretty-format@^25.5.0: version "25.5.0" @@ -9959,7 +8463,7 @@ pretty-format@^25.5.0: ansi-styles "^4.0.0" react-is "^16.12.0" -pretty-format@^26.0.0, pretty-format@^26.6.2: +pretty-format@^26.6.2: version "26.6.2" resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz" integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== @@ -9987,35 +8491,10 @@ pretty-format@^27.0.2: ansi-styles "^5.0.0" react-is "^17.0.1" -prismjs@1.27.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.27.0.tgz#bb6ee3138a0b438a3653dd4d6ce0cc6510a45057" - integrity sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA== - -private@~0.1.5: - version "0.1.8" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -process@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -promise-inflight@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" - integrity sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g== +prismjs@1.28.0: + version "1.28.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.28.0.tgz#0d8f561fa0f7cf6ebca901747828b149147044b6" + integrity sha512-8aaXdYvl1F7iC7Xm1spqSaY/OJBpYW3v+KJ+F17iYxvdc8sfjW194COK5wVhMZX45tGteiBQgdvD/nhxcRwylw== prompts@^2.0.1, prompts@^2.4.2: version "2.4.2" @@ -10044,91 +8523,16 @@ prr@~1.0.1: resolved "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz" integrity sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw== -psl@^1.1.28, psl@^1.1.33: +psl@^1.1.33: version "1.8.0" resolved "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz" integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== -public-encrypt@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" - integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - safe-buffer "^5.1.2" - -pump@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" - integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pumpify@^1.3.3: - version "1.5.1" - resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" - integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== - dependencies: - duplexify "^3.6.0" - inherits "^2.0.3" - pump "^2.0.0" - -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw== - -punycode@^1.2.4: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== - punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -qs@~6.5.2: - version "6.5.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" - integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== - -query-string@^4.1.0: - version "4.3.4" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" - integrity sha512-O2XLNDBIg1DnTOa+2XrIwSiXEV8h2KImXUnjhhn2+UsvZ+Es2uyd5CCRTNQlDGbzUQOW3aYCBx9rVA6dzsiY7Q== - dependencies: - object-assign "^4.1.0" - strict-uri-encode "^1.0.0" - -querystring-es3@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - integrity sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA== - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g== - -quick-lru@^6.1.0: - version "6.1.1" - resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.1.tgz" - integrity sha512-S27GBT+F0NTRiehtbrgaSE1idUAJ5bX8dPAQTdylEyNlrdcH5X4Lz7Edz3DYzecbsCluD5zO8ZNEe04z3D3u6Q== - quickselect@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz" @@ -10146,21 +8550,13 @@ raf@^3.1.0, raf@^3.4.0, raf@^3.4.1: dependencies: performance-now "^2.1.0" -randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: +randombytes@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== dependencies: safe-buffer "^5.1.0" -randomfill@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" - integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== - dependencies: - randombytes "^2.0.5" - safe-buffer "^5.1.0" - rbush@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz" @@ -10202,16 +8598,16 @@ rc-animate@2.x: rc-util "^4.15.3" react-lifecycles-compat "^3.0.4" -rc-cascader@3.4.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/rc-cascader/-/rc-cascader-3.4.1.tgz#7943738cd3fe67b7cee745134c958d3f64a76e30" - integrity sha512-9O3uPK47XwnXez0tEUHt5Lyv+E2b/9irOWXEVpL1ba5rPhKIipU1i+/W0P69BtU/rPG3kOQAJdCbvWBus7Xpzw== +rc-cascader@3.6.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/rc-cascader/-/rc-cascader-3.6.1.tgz#2e94fb3ed770ffd71d87ebcf17a9b44a6442e76f" + integrity sha512-+GmN2Z0IybKT45t0Z94jkjmsOHGxAliobR2tzt05/Gw0AKBYLHX5bdvsVXR7abPnarYyYzZ/cWe8CoFgDjAFNw== dependencies: "@babel/runtime" "^7.12.5" array-tree-filter "^2.1.0" classnames "^2.3.1" - rc-select "~14.0.0-alpha.23" - rc-tree "~5.5.0" + rc-select "~14.1.0" + rc-tree "~5.6.3" rc-util "^5.6.1" rc-drawer@4.4.3: @@ -10252,10 +8648,10 @@ rc-resize-observer@^1.0.0: rc-util "^5.15.0" resize-observer-polyfill "^1.5.1" -rc-select@~14.0.0-alpha.23: - version "14.0.6" - resolved "https://registry.yarnpkg.com/rc-select/-/rc-select-14.0.6.tgz#93be0b185a9d66dc84795e079121f0f65310d8bf" - integrity sha512-HMb2BwfTvBxMmIWTR/afP4bcRJLbVKFSBW/VFfL5Z+kdV2XlrYdlliK2uHY7pRRvW16PPGwmOwGfV+eoulPINw== +rc-select@~14.1.0: + version "14.1.11" + resolved "https://registry.yarnpkg.com/rc-select/-/rc-select-14.1.11.tgz#7f1227c14fe47c0f6e880a57e428c3318ac9bffe" + integrity sha512-3UI781eaTg/V4BEc8rLk1i2BQmO+n0sOsi3RKcV2EkHu2ErjTlg/1SOixllnWTWcH02oizvdvALZ1nvZulin9A== dependencies: "@babel/runtime" "^7.10.1" classnames "2.x" @@ -10296,16 +8692,16 @@ rc-tooltip@^5.0.1: "@babel/runtime" "^7.11.2" rc-trigger "^5.0.0" -rc-tree@~5.5.0: - version "5.5.0" - resolved "https://registry.npmjs.org/rc-tree/-/rc-tree-5.5.0.tgz" - integrity sha512-vpKeFsDyj7weik8UPseCTaSNAPt939qn1dQd8goSbRDajbjJEja0v/WFXyRhOiF1HLemNTfqMz4MYc9qlqyNXg== +rc-tree@~5.6.3: + version "5.6.6" + resolved "https://registry.yarnpkg.com/rc-tree/-/rc-tree-5.6.6.tgz#c04253d8f8345ec52fc196dec2be06c7e708125b" + integrity sha512-HI/q4D4AHOp48OZcBUvJFWkI5OfnZivvGYI0xzI0dy0Mita2KcTGZv7/Yl6Aq3bL3od3x5AqAXq/7qxR3x4Kkg== dependencies: "@babel/runtime" "^7.10.1" classnames "2.x" rc-motion "^2.0.1" rc-util "^5.16.1" - rc-virtual-list "^3.4.2" + rc-virtual-list "^3.4.8" rc-trigger@^2.2.0: version "2.6.5" @@ -10353,7 +8749,7 @@ rc-util@^4.0.4, rc-util@^4.15.3, rc-util@^4.4.0: react-lifecycles-compat "^3.0.4" shallowequal "^1.1.0" -rc-util@^5.15.0, rc-util@^5.16.1, rc-util@^5.19.2, rc-util@^5.6.1: +rc-util@^5.15.0, rc-util@^5.16.1, rc-util@^5.19.2, rc-util@^5.2.1, rc-util@^5.3.0, rc-util@^5.5.0, rc-util@^5.6.1, rc-util@^5.7.0: version "5.19.3" resolved "https://registry.npmjs.org/rc-util/-/rc-util-5.19.3.tgz" integrity sha512-S28epi9E2s7Nir05q8Ffl3hzDLwkavTGi0PGH1cTqCmkpG1AeBEuZgQDpksYeU6IgHcds5hWIPE5PUcdFiZl8w== @@ -10362,25 +8758,7 @@ rc-util@^5.15.0, rc-util@^5.16.1, rc-util@^5.19.2, rc-util@^5.6.1: react-is "^16.12.0" shallowequal "^1.1.0" -rc-util@^5.2.1, rc-util@^5.3.0, rc-util@^5.5.0: - version "5.7.0" - resolved "https://registry.npmjs.org/rc-util/-/rc-util-5.7.0.tgz" - integrity sha512-0hh5XkJ+vBDeMJsHElqT1ijMx+gC3gpClwQ10h/5hccrrgrMx8VUem183KLlH1YrWCfMMPmDXWWNnwsn+p6URw== - dependencies: - "@babel/runtime" "^7.12.5" - react-is "^16.12.0" - shallowequal "^1.1.0" - -rc-util@^5.7.0: - version "5.16.1" - resolved "https://registry.npmjs.org/rc-util/-/rc-util-5.16.1.tgz" - integrity sha512-kSCyytvdb3aRxQacS/71ta6c+kBWvM1v8/2h9d/HaNWauc3qB8pLnF20PJ8NajkNN8gb+rR1l0eWO+D4Pz+LLQ== - dependencies: - "@babel/runtime" "^7.12.5" - react-is "^16.12.0" - shallowequal "^1.1.0" - -rc-virtual-list@^3.2.0, rc-virtual-list@^3.4.2: +rc-virtual-list@^3.2.0, rc-virtual-list@^3.4.8: version "3.4.8" resolved "https://registry.npmjs.org/rc-virtual-list/-/rc-virtual-list-3.4.8.tgz" integrity sha512-qSN+Rv4i/E7RCTvTMr1uZo7f3crJJg/5DekoCagydo9zsXrxj07zsFSxqizqW+ldGA16lwa8So/bIbV9Ofjddg== @@ -10417,10 +8795,10 @@ react-colorful@5.5.1: resolved "https://registry.npmjs.org/react-colorful/-/react-colorful-5.5.1.tgz" integrity sha512-M1TJH2X3RXEt12sWkpa6hLc/bbYS0H6F4rIqjQZ+RxNBstpY67d9TrFXtqdZwhpmBXcCwEi7stKqFue3ZRkiOg== -react-custom-scrollbars-2@4.4.0: - version "4.4.0" - resolved "https://registry.npmjs.org/react-custom-scrollbars-2/-/react-custom-scrollbars-2-4.4.0.tgz" - integrity sha512-I+oxZ9rfHfvYm85jdH2lQqpzwNr/ZAdYB8htm6R/hwRGoIEK31jq+YE6MmFwBzuO7C5zcAtH5HN9vwZxnW61NQ== +react-custom-scrollbars-2@4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/react-custom-scrollbars-2/-/react-custom-scrollbars-2-4.5.0.tgz#cff18e7368bce9d570aea0be780045eda392c745" + integrity sha512-/z0nWAeXfMDr4+OXReTpYd1Atq9kkn4oI3qxq3iMXGQx1EEfwETSqB8HTAvg1X7dEqcCachbny1DRNGlqX5bDQ== dependencies: dom-css "^2.0.0" prop-types "^15.5.10" @@ -10465,13 +8843,13 @@ react-dom@17.0.2: object-assign "^4.1.1" scheduler "^0.20.2" -react-dropzone@12.0.4: - version "12.0.4" - resolved "https://registry.npmjs.org/react-dropzone/-/react-dropzone-12.0.4.tgz" - integrity sha512-fcqHEYe1MzAghU6/Hz86lHDlBNsA+lO48nAcm7/wA+kIzwS6uuJbUG33tBZjksj7GAZ1iUQ6NHwjUURPmSGang== +react-dropzone@14.2.2: + version "14.2.2" + resolved "https://registry.yarnpkg.com/react-dropzone/-/react-dropzone-14.2.2.tgz#a75a0676055fe9e2cb78578df4dedb4c42b54f98" + integrity sha512-5oyGN/B5rNhop2ggUnxztXBQ6q6zii+OMEftPzsxAR2hhpVWz0nAV+3Ktxo2h5bZzdcCKrpd8bfWAVsveIBM+w== dependencies: attr-accept "^2.2.2" - file-selector "^0.4.0" + file-selector "^0.6.0" prop-types "^15.8.1" react-error-overlay@^6.0.10: @@ -10484,15 +8862,15 @@ react-fast-compare@^3.0.1: resolved "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz" integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA== -react-from-dom@^0.6.0: - version "0.6.1" - resolved "https://registry.npmjs.org/react-from-dom/-/react-from-dom-0.6.1.tgz" - integrity sha512-7aAZx7LhRnmR51W5XtmTBYHGFl2n1AdEk1uoXLuzHa1OoGXrxOW/iwLcudvgp6BGX/l4Yh1rtMrIzvhlvbVddg== +react-from-dom@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/react-from-dom/-/react-from-dom-0.6.2.tgz#9da903a508c91c013b55afcd59348b8b0a39bdb4" + integrity sha512-qvWWTL/4xw4k/Dywd41RBpLQUSq97csuv15qrxN+izNeLYlD9wn5W8LspbfYe5CWbaSdkZ72BsaYBPQf2x4VbQ== -react-highlight-words@0.17.0: - version "0.17.0" - resolved "https://registry.yarnpkg.com/react-highlight-words/-/react-highlight-words-0.17.0.tgz#e79a559a2de301548339d7216264d6cd0f1eed6f" - integrity sha512-uX1Qh5IGjnLuJT0Zok234QDwRC8h4hcVMnB99Cb7aquB1NlPPDiWKm0XpSZOTdSactvnClCk8LOmVlP+75dgHA== +react-highlight-words@0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/react-highlight-words/-/react-highlight-words-0.18.0.tgz#ff3b3ef7cb497fa2e8fa4d54c1a1a98ac6390d0e" + integrity sha512-5z+46eLPjB4JWgOhuQ0E+6iUPTD1U3amiy5KKjzZmeJ5zyvHr91hnzBT3UHya/KlySm5KRTKpYpba9vs67oO2A== dependencies: highlight-words-core "^1.2.0" memoize-one "^4.0.0" @@ -10510,13 +8888,13 @@ react-immutable-proptypes@^2.1.0: dependencies: invariant "^2.2.2" -react-inlinesvg@2.3.0: - version "2.3.0" - resolved "https://registry.npmjs.org/react-inlinesvg/-/react-inlinesvg-2.3.0.tgz" - integrity sha512-fEGOdDf4k4bcveArbEpj01pJcH8pOCKLxmSj2POFdGvEk5YK0NZVnH6BXpW/PzACHPRsuh1YKAhNZyFnD28oxg== +react-inlinesvg@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/react-inlinesvg/-/react-inlinesvg-3.0.0.tgz#801c6bac1535334586708cd346f4b1125dcfa8f9" + integrity sha512-zUt0DW3cKBk+vYZJJCzJqA9STRb+ZFmKLQFWurTvM4UR6vyHT8kHZSzyZZseX9BUNbTFJAfirtwpt97BWDJoSg== dependencies: exenv "^1.2.2" - react-from-dom "^0.6.0" + react-from-dom "^0.6.2" react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0: version "16.13.1" @@ -10542,15 +8920,7 @@ react-popper-tooltip@^4.3.1: "@popperjs/core" "^2.11.5" react-popper "^2.3.0" -react-popper@2.2.5: - version "2.2.5" - resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-2.2.5.tgz#1214ef3cec86330a171671a4fbcbeeb65ee58e96" - integrity sha512-kxGkS80eQGtLl18+uig1UIf9MKixFSyPxglsgLBxlYnyDf65BiY9B3nZSc6C9XUNDgStROB0fMQlTEz1KxGddw== - dependencies: - react-fast-compare "^3.0.1" - warning "^4.0.2" - -react-popper@^2.3.0: +react-popper@2.3.0, react-popper@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/react-popper/-/react-popper-2.3.0.tgz" integrity sha512-e1hj8lL3uM+sgSR4Lxzn5h1GxBlpa4CQz0XLF8kx4MDrDRWY0Ena4c97PUeSX9i5W3UAfDP0z0FXCTQkoXUl3Q== @@ -10606,23 +8976,23 @@ react-select-event@^5.1.0: dependencies: "@testing-library/dom" ">=7" -react-select@5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/react-select/-/react-select-5.2.2.tgz#3d5edf0a60f1276fd5f29f9f90a305f0a25a5189" - integrity sha512-miGS2rT1XbFNjduMZT+V73xbJEeMzVkJOz727F6MeAr2hKE0uUSA8Ff7vD44H32x2PD3SRB6OXTY/L+fTV3z9w== +react-select@5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/react-select/-/react-select-5.4.0.tgz#81f6ac73906126706f104751ee14437bd16798f4" + integrity sha512-CjE9RFLUvChd5SdlfG4vqxZd55AZJRrLrHzkQyTYeHlpOztqcgnyftYAolJ0SGsBev6zAs6qFrjm6KU3eo2hzg== dependencies: "@babel/runtime" "^7.12.0" "@emotion/cache" "^11.4.0" - "@emotion/react" "^11.1.1" + "@emotion/react" "^11.8.1" "@types/react-transition-group" "^4.4.0" memoize-one "^5.0.0" prop-types "^15.6.0" react-transition-group "^4.3.0" -react-table@7.7.0: - version "7.7.0" - resolved "https://registry.yarnpkg.com/react-table/-/react-table-7.7.0.tgz#e2ce14d7fe3a559f7444e9ecfe8231ea8373f912" - integrity sha512-jBlj70iBwOTvvImsU9t01LjFjy4sXEtclBovl3mTiqjz23Reu0DKnRza4zlLtOPACx6j2/7MrQIthIK1Wi+LIA== +react-table@7.8.0: + version "7.8.0" + resolved "https://registry.yarnpkg.com/react-table/-/react-table-7.8.0.tgz#07858c01c1718c09f7f1aed7034fcfd7bda907d2" + integrity sha512-hNaz4ygkZO4bESeFfnfOft73iBUj8K5oKi1EcSHPAibEydfsX2MyU6Z8KCr3mv3C9Kqqh71U+DhZkFvibbnPbA== react-transition-group@4.4.2, react-transition-group@^4.3.0, react-transition-group@^4.4.2: version "4.4.2" @@ -10639,10 +9009,10 @@ react-universal-interface@^0.6.2: resolved "https://registry.npmjs.org/react-universal-interface/-/react-universal-interface-0.6.2.tgz" integrity sha512-dg8yXdcQmvgR13RIlZbTRQOoUrDciFVoSBZILwjE2LFISxZZ8loVJKAkuzswl5js8BHda79bIb2b84ehU8IjXw== -react-use@17.3.2: - version "17.3.2" - resolved "https://registry.npmjs.org/react-use/-/react-use-17.3.2.tgz" - integrity sha512-bj7OD0/1wL03KyWmzFXAFe425zziuTf7q8olwCYBfOeFHY1qfO1FAMjROQLsLZYwG4Rx63xAfb7XAbBrJsZmEw== +react-use@17.4.0: + version "17.4.0" + resolved "https://registry.yarnpkg.com/react-use/-/react-use-17.4.0.tgz#cefef258b0a6c534a5c8021c2528ac6e1a4cdc6d" + integrity sha512-TgbNTCA33Wl7xzIJegn1HndB4qTS9u03QUwyNycUnXaweZkE4Kq2SB+Yoxx8qbshkZGYBDvUXbXWRUmQDcZZ/Q== dependencies: "@types/js-cookie" "^2.2.6" "@xobotyi/scrollbar-width" "^1.9.5" @@ -10659,10 +9029,10 @@ react-use@17.3.2: ts-easing "^0.2.0" tslib "^2.1.0" -react-window@1.8.6: - version "1.8.6" - resolved "https://registry.yarnpkg.com/react-window/-/react-window-1.8.6.tgz#d011950ac643a994118632665aad0c6382e2a112" - integrity sha512-8VwEEYyjz6DCnGBsd+MgkD0KJ2/OXFULyDtorIiTz+QzwoP94tBoA7CnbtyXMm+cCeAUER5KJcPtWl9cpKbOBg== +react-window@1.8.7: + version "1.8.7" + resolved "https://registry.yarnpkg.com/react-window/-/react-window-1.8.7.tgz#5e9fd0d23f48f432d7022cdb327219353a15f0d4" + integrity sha512-JHEZbPXBpKMmoNO1bNhoXOOLg/ujhL/BU4IqVU9r8eQPcy5KQnGHIHDRkJ0ns9IM5+Aq5LNwt3j8t3tIrePQzA== dependencies: "@babel/runtime" "^7.0.0" memoize-one ">=3.1.1 <6" @@ -10675,56 +9045,7 @@ react@17.0.2: loose-envify "^1.1.0" object-assign "^4.1.1" -read-pkg-up@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" - integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== - dependencies: - find-up "^3.0.0" - read-pkg "^3.0.0" - -read-pkg-up@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" - integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== - dependencies: - find-up "^4.1.0" - read-pkg "^5.2.0" - type-fest "^0.8.1" - -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA== - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - -read-pkg@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" - integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== - dependencies: - "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^2.5.0" - parse-json "^5.0.0" - type-fest "^0.6.0" - -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@^3.4.0, readable-stream@^3.6.0: +readable-stream@^3.4.0: version "3.6.0" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -10733,15 +9054,6 @@ readable-stream@^3.4.0, readable-stream@^3.6.0: string_decoder "^1.1.1" util-deprecate "^1.0.1" -readdirp@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - readdirp@~3.6.0: version "3.6.0" resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" @@ -10749,23 +9061,6 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -realpath-native@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" - integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== - dependencies: - util.promisify "^1.0.0" - -recast@~0.11.12: - version "0.11.23" - resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.23.tgz#451fd3004ab1e4df9b4e4b66376b2a21912462d3" - integrity sha512-+nixG+3NugceyR8O1bLU45qs84JgI3+8EauyRZafLgC9XbdAOIVgwV1Pe2da0YzGo62KzWoZwUpVEQf6qNAXWA== - dependencies: - ast-types "0.9.6" - esprima "~3.1.0" - private "~0.1.5" - source-map "~0.5.0" - recursive-readdir@^2.2.2: version "2.2.2" resolved "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz" @@ -10830,14 +9125,6 @@ regenerator-transform@^0.15.0: dependencies: "@babel/runtime" "^7.8.4" -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - regexp.prototype.flags@^1.4.1, regexp.prototype.flags@^1.4.3: version "1.4.3" resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz" @@ -10847,7 +9134,7 @@ regexp.prototype.flags@^1.4.1, regexp.prototype.flags@^1.4.3: define-properties "^1.1.3" functions-have-names "^1.2.2" -regexpp@^3.1.0, regexpp@^3.2.0: +regexpp@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== @@ -10864,6 +9151,18 @@ regexpu-core@^5.0.1: unicode-match-property-ecmascript "^2.0.0" unicode-match-property-value-ecmascript "^2.0.0" +regexpu-core@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.1.0.tgz#2f8504c3fd0ebe11215783a41541e21c79942c6d" + integrity sha512-bb6hk+xWd2PEOkj5It46A16zFMs2mv86Iwpdu94la4S3sJ7C973h2dHpYKwIBGaWSO7cIRJ+UX0IeMaWcO4qwA== + dependencies: + regenerate "^1.4.2" + regenerate-unicode-properties "^10.0.1" + regjsgen "^0.6.0" + regjsparser "^0.8.2" + unicode-match-property-ecmascript "^2.0.0" + unicode-match-property-value-ecmascript "^2.0.0" + regextras@^0.8.0: version "0.8.0" resolved "https://registry.npmjs.org/regextras/-/regextras-0.8.0.tgz" @@ -10881,93 +9180,27 @@ regjsparser@^0.8.2: dependencies: jsesc "~0.5.0" -relateurl@0.2.x: +relateurl@^0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" integrity sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog== -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw== - -renderkid@^2.0.4: - version "2.0.7" - resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-2.0.7.tgz#464f276a6bdcee606f4a15993f9b29fc74ca8609" - integrity sha512-oCcFyxaMrKsKcTY59qnCAtmDVSLfPbrv6A3tVbPdFMMrv5jaK10V6m40cKsoPNhAqN6rmHW9sswW4o3ruSrwUQ== +renderkid@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-3.0.0.tgz#5fd823e4d6951d37358ecc9a58b1f06836b6268a" + integrity sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg== dependencies: css-select "^4.1.3" dom-converter "^0.2.0" htmlparser2 "^6.1.0" lodash "^4.17.21" - strip-ansi "^3.0.1" - -repeat-element@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" - integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== + strip-ansi "^6.0.1" -replace-in-file-webpack-plugin@^1.0.6: +replace-in-file-webpack-plugin@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/replace-in-file-webpack-plugin/-/replace-in-file-webpack-plugin-1.0.6.tgz#eee7e139be967e8e48a0552f73037ed567b54dbd" integrity sha512-+KRgNYL2nbc6nza6SeF+wTBNkovuHFTfJF8QIEqZg5MbwkYpU9no0kH2YU354wvY/BK8mAC2UKoJ7q+sJTvciw== -replace-in-file@^4.1.0: - version "4.3.1" - resolved "https://registry.yarnpkg.com/replace-in-file/-/replace-in-file-4.3.1.tgz#c67c92178b38052008e379197cc0d86ca927f7b0" - integrity sha512-FqVvfmpqGTD2JRGI1JjJ86b24P17x/WWwGdxExeyJxnh/2rVQz2+jXfD1507UnnhEQw092X0u0DPCBf1WC4ooQ== - dependencies: - chalk "^2.4.2" - glob "^7.1.6" - yargs "^15.0.2" - -request-promise-core@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" - integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== - dependencies: - lodash "^4.17.19" - -request-promise-native@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" - integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== - dependencies: - request-promise-core "1.1.4" - stealthy-require "^1.1.1" - tough-cookie "^2.3.3" - -request@^2.88.0: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" @@ -10978,11 +9211,6 @@ require-from-string@^2.0.2: resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - requires-port@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" @@ -11000,11 +9228,6 @@ resolve-cwd@^3.0.0: dependencies: resolve-from "^5.0.0" -resolve-from@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" - integrity sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw== - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" @@ -11032,7 +9255,12 @@ resolve-url@^0.2.1: resolved "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.18.1: +resolve.exports@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" + integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== + +resolve@^1.12.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0: version "1.22.1" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -11058,43 +9286,18 @@ restore-cursor@^3.1.0: onetime "^5.1.0" signal-exit "^3.0.2" -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - reusify@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@^2.5.4, rimraf@^2.6.3, rimraf@^2.7.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" - -rimraf@^3.0.0, rimraf@^3.0.2: +rimraf@3.0.2, rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== dependencies: glob "^7.1.3" -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - -rsvp@^4.8.4: - version "4.8.5" - resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" - integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== - rtl-css-js@^1.14.0: version "1.15.0" resolved "https://registry.npmjs.org/rtl-css-js/-/rtl-css-js-1.15.0.tgz" @@ -11112,93 +9315,61 @@ run-parallel@^1.1.9: resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz" integrity sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw== -run-queue@^1.0.0, run-queue@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" - integrity sha512-ntymy489o0/QQplUDnpYAYUsO50K9SBrIVaKCWDOJzYJts0f9WH9RFJkyagebkw5+y1oi00R7ynNW/d12GBumg== - dependencies: - aproba "^1.1.1" - rw@1, rw@^1.3.3: version "1.3.3" resolved "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz" integrity sha1-P4Yt+pGrdmsUiF700BEkv9oHT7Q= -rxjs@7.5.5, rxjs@^7.2.0, rxjs@^7.5.5: +rxjs@7.5.6: + version "7.5.6" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.6.tgz#0446577557862afd6903517ce7cae79ecb9662bc" + integrity sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw== + dependencies: + tslib "^2.1.0" + +rxjs@^7.5.5: version "7.5.5" resolved "https://registry.npmjs.org/rxjs/-/rxjs-7.5.5.tgz" integrity sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw== dependencies: tslib "^2.1.0" -rxjs@^6.6.3: - version "6.6.7" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" - integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== - dependencies: - tslib "^1.9.0" - -safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: +safe-buffer@^5.1.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-buffer@^5.1.0, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg== - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sane@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" - integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== - dependencies: - "@cnakazawa/watch" "^1.0.3" - anymatch "^2.0.0" - capture-exit "^2.0.0" - exec-sh "^0.3.2" - execa "^1.0.0" - fb-watchman "^2.0.0" - micromatch "^3.1.4" - minimist "^1.1.1" - walker "~1.0.5" - -sass-loader@8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-8.0.2.tgz#debecd8c3ce243c76454f2e8290482150380090d" - integrity sha512-7o4dbSK8/Ol2KflEmSco4jTjQoV988bM82P9CZdmo9hR3RLnvNc0ufMNdMrB0caq38JQ/FgF4/7RcbcfKzxoFQ== +sass-loader@^12.6.0: + version "12.6.0" + resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-12.6.0.tgz#5148362c8e2cdd4b950f3c63ac5d16dbfed37bcb" + integrity sha512-oLTaH0YCtX4cfnJZxKSLAyglED0naiYfNG1iXfU5w1LNZ+ukoA5DtyDIN5zmKVZwYNJP4KRc5Y3hkWga+7tYfA== dependencies: - clone-deep "^4.0.1" - loader-utils "^1.2.3" - neo-async "^2.6.1" - schema-utils "^2.6.1" - semver "^6.3.0" + klona "^2.0.4" + neo-async "^2.6.2" -sass@1.27.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.27.0.tgz#0657ff674206b95ec20dc638a93e179c78f6ada2" - integrity sha512-0gcrER56OkzotK/GGwgg4fPrKuiFlPNitO7eUJ18Bs+/NBlofJfMxmxqpqJxjae9vu0Wq8TZzrSyxZal00WDig== +sass@^1.49.9: + version "1.54.8" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.54.8.tgz#4adef0dd86ea2b1e4074f551eeda4fc5f812a996" + integrity sha512-ib4JhLRRgbg6QVy6bsv5uJxnJMTS2soVcCp9Y88Extyy13A8vV0G1fAwujOzmNkFQbR3LvedudAMbtuNRPbQww== dependencies: - chokidar ">=2.0.0 <4.0.0" + chokidar ">=3.0.0 <4.0.0" + immutable "^4.0.0" + source-map-js ">=0.6.2 <2.0.0" -saxes@^3.1.9: - version "3.1.11" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-3.1.11.tgz#d59d1fd332ec92ad98a2e0b2ee644702384b1c5b" - integrity sha512-Ydydq3zC+WYDJK1+gRxRapLIED9PWeSuuS41wqyoRmzvhhh9nc+QQrVMKJYzJFULazeGhzSV0QleN2wD3boh2g== - dependencies: - xmlchars "^2.1.1" +sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== saxes@^5.0.1: version "5.0.1" @@ -11224,16 +9395,7 @@ schema-utils@2.7.0: ajv "^6.12.2" ajv-keywords "^3.4.1" -schema-utils@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" - integrity sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g== - dependencies: - ajv "^6.1.0" - ajv-errors "^1.0.0" - ajv-keywords "^3.1.0" - -schema-utils@^2.5.0, schema-utils@^2.6.0, schema-utils@^2.6.1, schema-utils@^2.6.4, schema-utils@^2.6.5, schema-utils@^2.6.6: +schema-utils@^2.6.5: version "2.7.1" resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz" integrity sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg== @@ -11242,7 +9404,7 @@ schema-utils@^2.5.0, schema-utils@^2.6.0, schema-utils@^2.6.1, schema-utils@^2.6 ajv "^6.12.4" ajv-keywords "^3.5.2" -schema-utils@^3.0.0: +schema-utils@^3.0.0, schema-utils@^3.1.0, schema-utils@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz" integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== @@ -11251,6 +9413,16 @@ schema-utils@^3.0.0: ajv "^6.12.5" ajv-keywords "^3.5.2" +schema-utils@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.0.0.tgz#60331e9e3ae78ec5d16353c467c34b3a0a1d3df7" + integrity sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg== + dependencies: + "@types/json-schema" "^7.0.9" + ajv "^8.8.0" + ajv-formats "^2.1.1" + ajv-keywords "^5.0.0" + screenfull@^5.1.0: version "5.2.0" resolved "https://registry.npmjs.org/screenfull/-/screenfull-5.2.0.tgz" @@ -11261,94 +9433,45 @@ selection-is-backward@^1.0.0: resolved "https://registry.npmjs.org/selection-is-backward/-/selection-is-backward-1.0.0.tgz" integrity sha1-l6VGMxiKURq6ZBn8XB+pG0Z+a+E= -"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0: - version "5.7.1" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - semver@7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@7.x, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.5: +semver@7.x, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: version "7.3.7" resolved "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz" integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== dependencies: lru-cache "^6.0.0" +semver@^5.6.0: + version "5.7.1" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: version "6.3.0" resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -serialize-javascript@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-3.1.0.tgz#8bf3a9170712664ef2561b44b691eafe399214ea" - integrity sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg== - dependencies: - randombytes "^2.1.0" - -serialize-javascript@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" - integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== +serialize-javascript@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== dependencies: randombytes "^2.1.0" -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== - set-harmonic-interval@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/set-harmonic-interval/-/set-harmonic-interval-1.0.1.tgz" integrity sha512-AhICkFV84tBP1aWqPwLZqFvAwqEoVA9kxNMniGEUvzOlm4vLmOFLiTT3UZ6bziJTy4bOVpzWGTfSCbmaayGx8g== -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setimmediate@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -shallow-clone@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" - integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== - dependencies: - kind-of "^6.0.2" - shallowequal@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz" integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== - dependencies: - shebang-regex "^1.0.0" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" @@ -11356,11 +9479,6 @@ shebang-command@^2.0.0: dependencies: shebang-regex "^3.0.0" -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== - shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" @@ -11371,11 +9489,6 @@ shell-quote@^1.7.3: resolved "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz" integrity sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw== -shellwords@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" - integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== - side-channel@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz" @@ -11385,15 +9498,15 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: +signal-exit@^3.0.2, signal-exit@^3.0.3: version "3.0.7" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== -simple-git@^3.5.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.9.0.tgz#0b29fa5b6749d32b6ce95ea2faaac359f5fce25d" - integrity sha512-twG3rcFMYASct3mJcCP8KBtmtN7V2s6cdO5IXVAe/ffIu6TjdkdVnatR+PGmcirKXiK5y28eIdCVF0i3UQypfQ== +simple-git@^3.6.0: + version "3.13.0" + resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.13.0.tgz#36589e201c28cecaca6f3a898e7257c6610e8588" + integrity sha512-VYrs3joeHvWGcN3K135RpGpPjm4AHYeOrclwew6LlfHgq6ozQYIW2yMnmjf4PCgVOuSYCbXkdUjyiFawuJz8MA== dependencies: "@kwsites/file-exists" "^1.1.1" "@kwsites/promise-deferred" "^1.1.1" @@ -11409,16 +9522,6 @@ sisteransi@^1.0.5: resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== -slash@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg== - -slash@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" - integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== - slash@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" @@ -11480,45 +9583,6 @@ slate@0.47.8: tiny-warning "^0.0.3" type-of "^2.0.1" -slice-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz" - integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - sort-asc@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/sort-asc/-/sort-asc-0.1.0.tgz" @@ -11529,13 +9593,6 @@ sort-desc@^0.1.1: resolved "https://registry.npmjs.org/sort-desc/-/sort-desc-0.1.1.tgz" integrity sha512-jfZacW5SKOP97BF5rX5kQfJmRVZP5/adDUTY8fCSPvNcXDVpUEe2pr/iKGlcyZzchRJZrswnp68fgk3qBXgkJw== -sort-keys@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" - integrity sha512-vzn8aSqKgytVik0iwdBEi+zevbTYZogewTUM6dtpmGwEcdzbub/TX4bCzRhebDCRC3QzXgJsLRKB2V/Oof7HXg== - dependencies: - is-plain-obj "^1.0.0" - sort-object@^0.3.2: version "0.3.2" resolved "https://registry.npmjs.org/sort-object/-/sort-object-0.3.2.tgz" @@ -11544,19 +9601,14 @@ sort-object@^0.3.2: sort-asc "^0.1.0" sort-desc "^0.1.1" -source-list-map@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" - integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== - -source-map-js@^1.0.2: +"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== -source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: +source-map-resolve@^0.5.2: version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" + resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz" integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== dependencies: atob "^2.1.2" @@ -11565,7 +9617,7 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.17, source-map-support@^0.5.6, source-map-support@~0.5.12: +source-map-support@^0.5.17, source-map-support@^0.5.6, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== @@ -11583,7 +9635,7 @@ source-map@0.5.6: resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz" integrity sha1-dc449SvwczxafwwRjYEzSiu19BI= -source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.0: +source-map@^0.5.7: version "0.5.7" resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== @@ -11603,25 +9655,12 @@ sourcemap-codec@^1.4.8: resolved "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== -spawn-command@^0.0.2-1: - version "0.0.2-1" - resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" - integrity sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg== - -spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - spdx-exceptions@^2.1.0: version "2.3.0" resolved "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz" integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== -spdx-expression-parse@^3.0.0, spdx-expression-parse@^3.0.1: +spdx-expression-parse@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz" integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== @@ -11634,48 +9673,11 @@ spdx-license-ids@^3.0.0: resolved "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz" integrity sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g== -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -sshpk@^1.7.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" - integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -ssri@^6.0.1: - version "6.0.2" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.2.tgz#157939134f20464e7301ddba3e90ffa8f7728ac5" - integrity sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q== - dependencies: - figgy-pudding "^3.5.1" - -ssri@^7.0.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-7.1.1.tgz#33e44f896a967158e3c63468e47ec46613b95b5f" - integrity sha512-w+daCzXN89PseTL99MkA+fxJEcU3wfaE/ah0i0lnOlpG1CYLJ2ZjzEry68YBKfLs4JfoTShrTEsJkAZuNZ/stw== - dependencies: - figgy-pudding "^3.5.1" - minipass "^3.1.1" - stable@^0.1.8: version "0.1.8" resolved "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz" @@ -11688,14 +9690,7 @@ stack-generator@^2.0.5: dependencies: stackframe "^1.1.1" -stack-utils@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.5.tgz#a19b0b01947e0029c8e451d5d61a498f5bb1471b" - integrity sha512-KZiTzuV3CnSnSvgMRrARVCj+Ht7rMbauGDK0LdVFRGyenwdylpajAp4Q0i6SX8rEmbTpMMf6ryq2gb8pPq2WgQ== - dependencies: - escape-string-regexp "^2.0.0" - -stack-utils@^2.0.2: +stack-utils@^2.0.3: version "2.0.5" resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== @@ -11729,56 +9724,6 @@ state-local@^1.0.6: resolved "https://registry.npmjs.org/state-local/-/state-local-1.0.7.tgz" integrity sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w== -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g== - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -stealthy-require@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" - integrity sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g== - -stream-browserify@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" - integrity sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg== - dependencies: - inherits "~2.0.1" - readable-stream "^2.0.2" - -stream-each@^1.1.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" - integrity sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw== - dependencies: - end-of-stream "^1.1.0" - stream-shift "^1.0.0" - -stream-http@^2.7.2: - version "2.8.3" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" - integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== - dependencies: - builtin-status-codes "^3.0.0" - inherits "^2.0.1" - readable-stream "^2.3.6" - to-arraybuffer "^1.0.0" - xtend "^4.0.0" - -stream-shift@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" - integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== - -strict-uri-encode@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - integrity sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ== - string-length@^4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz" @@ -11787,7 +9732,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -11828,27 +9773,13 @@ string.prototype.trimstart@^1.0.5: define-properties "^1.1.4" es-abstract "^1.19.5" -string_decoder@^1.0.0, string_decoder@^1.1.1: +string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== dependencies: safe-buffer "~5.2.0" -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== - dependencies: - ansi-regex "^2.0.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" @@ -11856,21 +9787,11 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== - strip-bom@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz" integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q== - strip-final-newline@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" @@ -11888,13 +9809,10 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -style-loader@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.1.3.tgz#9e826e69c683c4d9bf9db924f85e9abb30d5e200" - integrity sha512-rlkH7X/22yuwFYK357fMN/BxYOorfnfq0eD7+vqlemSK4wEcejFF1dg4zxP0euBW8NrYx2WZzZ8PPFevr7D+Kw== - dependencies: - loader-utils "^1.2.3" - schema-utils "^2.6.4" +style-loader@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.1.tgz#057dfa6b3d4d7c7064462830f9113ed417d38575" + integrity sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ== stylehacks@^5.1.0: version "5.1.0" @@ -11916,13 +9834,6 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" - integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== - dependencies: - has-flag "^3.0.0" - supports-color@^7.0.0, supports-color@^7.1.0: version "7.2.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" @@ -11930,7 +9841,7 @@ supports-color@^7.0.0, supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-color@^8.1.0: +supports-color@^8.0.0: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== @@ -11968,7 +9879,7 @@ symbol-observable@^1.2.0: resolved "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== -symbol-tree@^3.2.2, symbol-tree@^3.2.4: +symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== @@ -11978,25 +9889,14 @@ systemjs@0.20.19: resolved "https://registry.npmjs.org/systemjs/-/systemjs-0.20.19.tgz" integrity sha512-H/rKwNEEyej/+IhkmFNmKFyJul8tbH/muiPq5TyNoVTwsGhUjRsN3NlFnFQUvFXA3+GQmsXkCNXU6QKPl779aw== -table@^6.0.9: - version "6.8.0" - resolved "https://registry.npmjs.org/table/-/table-6.8.0.tgz" - integrity sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA== - dependencies: - ajv "^8.0.1" - lodash.truncate "^4.4.2" - slice-ansi "^4.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" - -tapable@^1.0.0, tapable@^1.1.3: +tapable@^1.0.0: version "1.1.3" resolved "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== -tapable@^2.2.0: +tapable@^2.0.0, tapable@^2.1.1, tapable@^2.2.0, tapable@^2.2.1: version "2.2.1" - resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== terminal-link@^2.0.0: @@ -12007,54 +9907,26 @@ terminal-link@^2.0.0: ansi-escapes "^4.2.1" supports-hyperlinks "^2.0.0" -terser-webpack-plugin@2.3.7: - version "2.3.7" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-2.3.7.tgz#4910ff5d1a872168cc7fa6cd3749e2b0d60a8a0b" - integrity sha512-xzYyaHUNhzgaAdBsXxk2Yvo/x1NJdslUaussK3fdpBbvttm1iIwU+c26dj9UxJcwk2c5UWt5F55MUTIA8BE7Dg== +terser-webpack-plugin@^5.1.3, terser-webpack-plugin@^5.3.1: + version "5.3.6" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz#5590aec31aa3c6f771ce1b1acca60639eab3195c" + integrity sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ== dependencies: - cacache "^13.0.1" - find-cache-dir "^3.3.1" - jest-worker "^25.4.0" - p-limit "^2.3.0" - schema-utils "^2.6.6" - serialize-javascript "^3.1.0" - source-map "^0.6.1" - terser "^4.6.12" - webpack-sources "^1.4.3" - -terser-webpack-plugin@^1.4.3: - version "1.4.5" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz#a217aefaea330e734ffacb6120ec1fa312d6040b" - integrity sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw== - dependencies: - cacache "^12.0.2" - find-cache-dir "^2.1.0" - is-wsl "^1.1.0" - schema-utils "^1.0.0" - serialize-javascript "^4.0.0" - source-map "^0.6.1" - terser "^4.1.2" - webpack-sources "^1.4.0" - worker-farm "^1.7.0" + "@jridgewell/trace-mapping" "^0.3.14" + jest-worker "^27.4.5" + schema-utils "^3.1.1" + serialize-javascript "^6.0.0" + terser "^5.14.1" -terser@^4.1.2, terser@^4.6.12: - version "4.8.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f" - integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw== +terser@^5.10.0, terser@^5.14.1: + version "5.15.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.15.0.tgz#e16967894eeba6e1091509ec83f0c60e179f2425" + integrity sha512-L1BJiXVmheAQQy+as0oF3Pwtlo4s3Wi1X2zNZ2NxOB4wx9bdS9Vk67XQENLFdLYGCK/Z2di53mTj/hBafR+dTA== dependencies: + "@jridgewell/source-map" "^0.3.2" + acorn "^8.5.0" commander "^2.20.0" - source-map "~0.6.1" - source-map-support "~0.5.12" - -test-exclude@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" - integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== - dependencies: - glob "^7.1.3" - minimatch "^3.0.4" - read-pkg-up "^4.0.0" - require-main-filename "^2.0.0" + source-map-support "~0.5.20" test-exclude@^6.0.0: version "6.0.0" @@ -12070,36 +9942,21 @@ text-table@^0.2.0: resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= -throat@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" - integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== +throat@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.1.tgz#d514fedad95740c12c2d7fc70ea863eb51ade375" + integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w== throttle-debounce@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-3.0.1.tgz" integrity sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg== -through2@^2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" - integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== - dependencies: - readable-stream "~2.3.6" - xtend "~4.0.1" - -through@^2.3.6, through@~2.3.6: +through@^2.3.6: version "2.3.8" resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== -timers-browserify@^2.0.4: - version "2.0.12" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.12.tgz#44a45c11fbf407f34f97bccd1577c652361b00ee" - integrity sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ== - dependencies: - setimmediate "^1.0.4" - tiny-invariant@^1.0.1, tiny-invariant@^1.0.2, tiny-invariant@^1.0.6: version "1.1.0" resolved "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz" @@ -12132,11 +9989,6 @@ tmpl@1.0.5: resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz" integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - integrity sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA== - to-camel-case@1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/to-camel-case/-/to-camel-case-1.0.0.tgz" @@ -12154,21 +10006,6 @@ to-no-case@^1.0.0: resolved "https://registry.npmjs.org/to-no-case/-/to-no-case-1.0.2.tgz" integrity sha1-xyKQcWTvaxeBMsjmmTAhLRtKoWo= -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg== - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg== - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" @@ -12176,16 +10013,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - to-space-case@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/to-space-case/-/to-space-case-1.0.0.tgz" @@ -12198,28 +10025,6 @@ toggle-selection@^1.0.6: resolved "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz" integrity sha1-bkWxJj8gF/oKzH2J14sVuL932jI= -toposort@^1.0.0: - version "1.0.7" - resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.7.tgz#2e68442d9f64ec720b8cc89e6443ac6caa950029" - integrity sha512-FclLrw8b9bMWf4QlCJuHBEVhSRsqDj6u3nIjAzPeJvgl//1hBlffdlk0MALceL14+koWEdU4ofRAXofbODxQzg== - -tough-cookie@^2.3.3, tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -tough-cookie@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2" - integrity sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg== - dependencies: - ip-regex "^2.1.0" - psl "^1.1.28" - punycode "^2.1.1" - tough-cookie@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz" @@ -12229,13 +10034,6 @@ tough-cookie@^4.0.0: punycode "^2.1.1" universalify "^0.1.2" -tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== - dependencies: - punycode "^2.1.0" - tr46@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz" @@ -12243,65 +10041,62 @@ tr46@^2.1.0: dependencies: punycode "^2.1.1" -tree-kill@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" - integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== - ts-easing@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/ts-easing/-/ts-easing-0.2.0.tgz" integrity sha512-Z86EW+fFFh/IFB1fqQ3/+7Zpf9t2ebOAxNI/V6Wo7r5gqiqtxmgTlQ1qbqQcjLKYeSHPTsEmvlJUDg/EuL0uHQ== -ts-jest@26.4.4: - version "26.4.4" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.4.4.tgz#61f13fb21ab400853c532270e52cc0ed7e502c49" - integrity sha512-3lFWKbLxJm34QxyVNNCgXX1u4o/RV0myvA2y2Bxm46iGIjKlaY0own9gIckbjZJPn+WaJEnfPPJ20HHGpoq4yg== +ts-jest@27.1.3: + version "27.1.3" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.3.tgz#1f723e7e74027c4da92c0ffbd73287e8af2b2957" + integrity sha512-6Nlura7s6uM9BVUAoqLH7JHyMXjz8gluryjpPXxr3IxZdAXnU6FhjvVLHFtfd1vsE1p8zD1OJfskkc0jhTSnkA== dependencies: - "@types/jest" "26.x" bs-logger "0.x" - buffer-from "1.x" fast-json-stable-stringify "2.x" - jest-util "^26.1.0" + jest-util "^27.0.0" json5 "2.x" lodash.memoize "4.x" make-error "1.x" - mkdirp "1.x" semver "7.x" yargs-parser "20.x" -ts-loader@6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-6.2.1.tgz#67939d5772e8a8c6bdaf6277ca023a4812da02ef" - integrity sha512-Dd9FekWuABGgjE1g0TlQJ+4dFUfYGbYcs52/HQObE0ZmUNjQlmLAS7xXsSzy23AMaMwipsx5sNHvoEpT2CZq1g== +ts-loader@^9.3.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.3.1.tgz#fe25cca56e3e71c1087fe48dc67f4df8c59b22d4" + integrity sha512-OkyShkcZTsTwyS3Kt7a4rsT/t2qvEVQuKCTg4LJmpj9fhFR7ukGdZwV6Qq3tRUkqcXtfGpPR7+hFKHCG/0d3Lw== dependencies: - chalk "^2.3.0" - enhanced-resolve "^4.0.0" - loader-utils "^1.0.2" + chalk "^4.1.0" + enhanced-resolve "^5.0.0" micromatch "^4.0.0" - semver "^6.0.0" + semver "^7.3.4" -ts-node@9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.0.0.tgz#e7699d2a110cc8c0d3b831715e417688683460b3" - integrity sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg== +ts-node@^9.1.0: + version "9.1.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.1.1.tgz#51a9a450a3e959401bda5f004a72d54b936d376d" + integrity sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg== dependencies: arg "^4.1.0" + create-require "^1.1.0" diff "^4.0.1" make-error "^1.1.1" source-map-support "^0.5.17" yn "3.1.1" -tslib@2.3.1, tslib@^2.0.3, tslib@^2.1.0: - version "2.3.1" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz" - integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== +tslib@2.4.0, tslib@^2.3.0, tslib@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== -tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: +tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: version "1.14.1" resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== +tslib@^2.0.3, tslib@^2.1.0: + version "2.3.1" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz" + integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== + tsutils@^3.21.0: version "3.21.0" resolved "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz" @@ -12309,23 +10104,6 @@ tsutils@^3.21.0: dependencies: tslib "^1.8.1" -tty-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - integrity sha512-JVa5ijo+j/sOoHGjw0sxw734b1LhBkQ3bvUGNdxnVXDCX81Yx7TFgnZygxrIIWn23hbfTaMYLwRmAxFyDuFmIw== - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz" @@ -12355,16 +10133,6 @@ type-fest@^0.21.3: resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-fest@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" - integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - type-of@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/type-of/-/type-of-2.0.1.tgz" @@ -12377,28 +10145,20 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== +typescript@4.6.4: + version "4.6.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" + integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== -typescript@4.4.3: - version "4.4.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" - integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== - -typescript@4.4.4: - version "4.4.4" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz" - integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== +typescript@4.7.4: + version "4.7.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" + integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== -uglify-js@3.4.x: - version "3.4.10" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.10.tgz#9ad9563d8eb3acdfb8d38597d2af1d815f6a755f" - integrity sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw== - dependencies: - commander "~2.19.0" - source-map "~0.6.1" +ua-parser-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.2.tgz#e2976c34dbfb30b15d2c300b2a53eac87c57a775" + integrity sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg== unbox-primitive@^1.0.2: version "1.0.2" @@ -12433,35 +10193,6 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz" integrity sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ== -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - -uniq@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" - integrity sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA== - -unique-filename@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" - integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== - dependencies: - unique-slug "^2.0.0" - -unique-slug@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c" - integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w== - dependencies: - imurmurhash "^0.1.4" - universalify@^0.1.2: version "0.1.2" resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz" @@ -12472,19 +10203,6 @@ universalify@^2.0.0: resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz" integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ== - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -upath@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" - integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== - update-browserslist-db@^1.0.0: version "1.0.3" resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.3.tgz" @@ -12493,15 +10211,18 @@ update-browserslist-db@^1.0.0: escalade "^3.1.1" picocolors "^1.0.0" -uplot@1.6.19: - version "1.6.19" - resolved "https://registry.yarnpkg.com/uplot/-/uplot-1.6.19.tgz#98f461992a3f7f3bda7a62f4a028b8afa8da7942" - integrity sha512-s5Oab13s8zUzuZ/KiSV0GRhEvuKptAg2831fkt2PFsginIP1NSsiNrcozlc+tTPuUEAt+4rAXqX521I1DrZwEg== +update-browserslist-db@^1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.7.tgz#16279639cff1d0f800b14792de43d97df2d11b7d" + integrity sha512-iN/XYesmZ2RmmWAiI4Z5rq0YqSiv0brj9Ce9CfhNE4xIW2h+MFxcgkxIzZ+ShkFPUkjU3gQ+3oypadD3RAMtrg== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" -upper-case@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" - integrity sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA== +uplot@1.6.22: + version "1.6.22" + resolved "https://registry.yarnpkg.com/uplot/-/uplot-1.6.22.tgz#28a136c7c5fce92ce5e25f38f19314a029bec390" + integrity sha512-2jtSb/YHUgtmIUn0+QJjf7ggcJicb5PKe7ijBiRDTPsG/f8F/MFayZ+g6/0kATNkDyF/qQsHJDmCp6cxncg1EQ== uri-js@^4.2.2: version "4.4.1" @@ -12515,143 +10236,61 @@ urix@^0.1.0: resolved "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz" integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= -url-loader@^2.0.1: - version "2.3.0" - resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-2.3.0.tgz#e0e2ef658f003efb8ca41b0f3ffbf76bab88658b" - integrity sha512-goSdg8VY+7nPZKUEChZSEtW5gjbS66USIGCeSJ1OVOJ7Yfuh/36YxCwMi5HVEJh6mqUYOoy3NJ0vlOMrWsSHog== - dependencies: - loader-utils "^1.2.3" - mime "^2.4.4" - schema-utils "^2.5.0" - -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ== +url-loader@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-4.1.1.tgz#28505e905cae158cf07c92ca622d7f237e70a4e2" + integrity sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA== dependencies: - punycode "1.3.2" - querystring "0.2.0" + loader-utils "^2.0.0" + mime-types "^2.1.27" + schema-utils "^3.0.0" use-memo-one@^1.1.1: version "1.1.2" resolved "https://registry.npmjs.org/use-memo-one/-/use-memo-one-1.1.2.tgz" integrity sha512-u2qFKtxLsia/r8qG0ZKkbytbztzRb317XCkT7yP8wxL0tZ/CzK2G+WWie5vWvpyeP7+YoPIwbJoIHJ4Ba4k0oQ== -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -util.promisify@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" - integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== - dependencies: - define-properties "^1.1.2" - object.getownpropertydescriptors "^2.0.3" - -util.promisify@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.1.1.tgz#77832f57ced2c9478174149cae9b96e9918cd54b" - integrity sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - for-each "^0.3.3" - has-symbols "^1.0.1" - object.getownpropertydescriptors "^2.1.1" - -util@0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - integrity sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ== - dependencies: - inherits "2.0.1" - -util@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" - integrity sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ== - dependencies: - inherits "2.0.3" - utila@~0.4: version "0.4.0" resolved "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz" integrity sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA== -uuid@8.3.2, uuid@^8.3.0, uuid@^8.3.2: +uuid@8.3.2, uuid@^8.3.2: version "8.3.2" resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - v8-compile-cache@^2.0.3: version "2.2.0" resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz" integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== -v8-to-istanbul@^7.0.0: - version "7.1.2" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.1.2.tgz#30898d1a7fa0c84d225a2c1434fb958f290883c1" - integrity sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow== +v8-to-istanbul@^8.1.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" + integrity sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" source-map "^0.7.3" -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - value-equal@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz" integrity sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw== -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -vm-browserify@^1.0.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" - integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== - -w3c-hr-time@^1.0.1, w3c-hr-time@^1.0.2: +w3c-hr-time@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz" integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== dependencies: browser-process-hrtime "^1.0.0" -w3c-xmlserializer@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz#30485ca7d70a6fd052420a3d12fd90e6339ce794" - integrity sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg== - dependencies: - domexception "^1.0.1" - webidl-conversions "^4.0.2" - xml-name-validator "^3.0.0" - w3c-xmlserializer@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz" @@ -12659,7 +10298,7 @@ w3c-xmlserializer@^2.0.0: dependencies: xml-name-validator "^3.0.0" -walker@^1.0.7, walker@~1.0.5: +walker@^1.0.7: version "1.0.8" resolved "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz" integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== @@ -12673,23 +10312,13 @@ warning@^4.0.2: dependencies: loose-envify "^1.0.0" -watchpack-chokidar2@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz#38500072ee6ece66f3769936950ea1771be1c957" - integrity sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww== - dependencies: - chokidar "^2.1.8" - -watchpack@^1.6.0: - version "1.7.5" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.7.5.tgz#1267e6c55e0b9b5be44c2023aed5437a2c26c453" - integrity sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ== +watchpack@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" + integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== dependencies: + glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" - neo-async "^2.5.0" - optionalDependencies: - chokidar "^3.4.1" - watchpack-chokidar2 "^2.0.1" wcwidth@^1.0.1: version "1.0.1" @@ -12698,21 +10327,16 @@ wcwidth@^1.0.1: dependencies: defaults "^1.0.3" +web-vitals@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-2.1.4.tgz#76563175a475a5e835264d373704f9dde718290c" + integrity sha512-sVWcwhU5mX6crfI5Vd2dC4qchyTqxV8URinzt25XqVh+bHEPGH4C3NPrNionCP7Obx59wrYEbNlw4Z8sjALzZg== + web-worker@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz" integrity sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA== -webfont-matcher@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/webfont-matcher/-/webfont-matcher-1.1.0.tgz" - integrity sha512-ov8lMvF9wi4PD7fK2Axn9PQEpO9cYI0fIoGqErwd+wi8xacFFDmX114D5Q2Lw0Wlgmb+Qw/dKI2KTtimrJf85g== - -webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== - webidl-conversions@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz" @@ -12723,72 +10347,53 @@ webidl-conversions@^6.1.0: resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== -webpack-log@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/webpack-log/-/webpack-log-2.0.0.tgz#5b7928e0637593f119d32f6227c1e0ac31e1b47f" - integrity sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg== - dependencies: - ansi-colors "^3.0.0" - uuid "^3.3.2" - -webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-sources@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933" - integrity sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ== - dependencies: - source-list-map "^2.0.0" - source-map "~0.6.1" - -webpack@4.41.5: - version "4.41.5" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.41.5.tgz#3210f1886bce5310e62bb97204d18c263341b77c" - integrity sha512-wp0Co4vpyumnp3KlkmpM5LWuzvZYayDwM2n17EHFr4qxBBbRokC7DJawPJC7TfSFZ9HZ6GsdH40EBj4UV0nmpw== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-module-context" "1.8.5" - "@webassemblyjs/wasm-edit" "1.8.5" - "@webassemblyjs/wasm-parser" "1.8.5" - acorn "^6.2.1" - ajv "^6.10.2" - ajv-keywords "^3.4.1" +webpack-sources@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" + integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== + +webpack@^5.72.0: + version "5.74.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.74.0.tgz#02a5dac19a17e0bb47093f2be67c695102a55980" + integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA== + dependencies: + "@types/eslint-scope" "^3.7.3" + "@types/estree" "^0.0.51" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/wasm-edit" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + acorn "^8.7.1" + acorn-import-assertions "^1.7.6" + browserslist "^4.14.5" chrome-trace-event "^1.0.2" - enhanced-resolve "^4.1.0" - eslint-scope "^4.0.3" - json-parse-better-errors "^1.0.2" - loader-runner "^2.4.0" - loader-utils "^1.2.3" - memory-fs "^0.4.1" - micromatch "^3.1.10" - mkdirp "^0.5.1" - neo-async "^2.6.1" - node-libs-browser "^2.2.1" - schema-utils "^1.0.0" - tapable "^1.1.3" - terser-webpack-plugin "^1.4.3" - watchpack "^1.6.0" - webpack-sources "^1.4.1" - -whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.5: + enhanced-resolve "^5.10.0" + es-module-lexer "^0.9.0" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.9" + json-parse-even-better-errors "^2.3.1" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.1.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.1.3" + watchpack "^2.4.0" + webpack-sources "^3.2.3" + +whatwg-encoding@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz" integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== dependencies: iconv-lite "0.4.24" -whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: +whatwg-mimetype@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== -whatwg-url@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" - integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - whatwg-url@^8.0.0, whatwg-url@^8.5.0: version "8.7.0" resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz" @@ -12809,19 +10414,14 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== - -which@^1.2.9, which@^1.3.1: +which@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" -which@^2.0.1, which@^2.0.2: +which@^2.0.1: version "2.0.2" resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== @@ -12833,22 +10433,6 @@ word-wrap@^1.2.3, word-wrap@~1.2.3: resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== -worker-farm@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" - integrity sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw== - dependencies: - errno "~0.1.7" - -wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" @@ -12863,15 +10447,6 @@ wrappy@1: resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write-file-atomic@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" - integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg== - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - signal-exit "^3.0.2" - write-file-atomic@^3.0.0: version "3.0.3" resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz" @@ -12882,7 +10457,7 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -ws@^7.0.0, ws@^7.4.6: +ws@^7.4.6: version "7.5.8" resolved "https://registry.npmjs.org/ws/-/ws-7.5.8.tgz" integrity sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw== @@ -12902,45 +10477,30 @@ xml@^1.0.1: resolved "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz" integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw== -xmlchars@^2.1.1, xmlchars@^2.2.0: +xmlchars@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== -xss@1.0.11: - version "1.0.11" - resolved "https://registry.npmjs.org/xss/-/xss-1.0.11.tgz" - integrity sha512-EimjrjThZeK2MO7WKR9mN5ZC1CSqivSl55wvUK5EtU6acf0rzEE1pN+9ZDrFXJ82BRp3JL38pPE6S4o/rpp1zQ== +xss@1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/xss/-/xss-1.0.13.tgz#6e48f616128b39f366dfadc57411e1eb5b341c6c" + integrity sha512-clu7dxTm1e8Mo5fz3n/oW3UCXBfV89xZ72jM8yzo1vR/pIS0w3sgB3XV2H8Vm6zfGnHL0FzvLJPJEBhd86/z4Q== dependencies: commander "^2.20.3" cssfilter "0.0.10" -xtend@^4.0.0, xtend@~4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -y18n@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== - y18n@^5.0.5: version "5.0.8" resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yallist@^3.0.2: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - yallist@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^1.10.2, yaml@^1.7.2: +yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2: version "1.10.2" resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== @@ -12950,31 +10510,6 @@ yargs-parser@20.x, yargs-parser@^20.2.2: resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs@^15.0.2, yargs@^15.4.1: - version "15.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== - dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" - yargs@^16.2.0: version "16.2.0" resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" From f7773682017ec00157c2dda239af195d77f3b771 Mon Sep 17 00:00:00 2001 From: Paulo Vitor Magacho Date: Fri, 2 Sep 2022 18:55:53 -0300 Subject: [PATCH 2/4] Fix issue with Pi Points --- dist/module.js | 3437 +++++++++++++++++++++++++++++++++++++++++++- dist/module.js.map | 2 +- dist/plugin.json | 2 +- src/datasource.ts | 4 +- 4 files changed, 3439 insertions(+), 6 deletions(-) diff --git a/dist/module.js b/dist/module.js index 672af98..ec70413 100644 --- a/dist/module.js +++ b/dist/module.js @@ -1,3 +1,3436 @@ -/*! For license information please see module.js.LICENSE.txt */ -define(["@grafana/data","@grafana/runtime","@grafana/ui","lodash","react"],((e,t,n,a,r)=>(()=>{"use strict";var i=[e=>{e.exports=r},e=>{e.exports=n},t=>{t.exports=e},e=>{e.exports=a},,e=>{e.exports=t}],o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e](n,n.exports,l),n.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{l.r(u),l.d(u,{plugin:()=>me});var e=l(2);function t(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n0?r[0].split("\\"):[];return i.length>1||1===i.length&&""!==i[0]?(r.splice(0,1),(0,C.each)(i,(function(e,t){n.push({label:e,value:{value:e,expandable:!0}})})),(0,C.each)(r,(function(e,t){""!==e&&a.push({label:e,value:{value:e,expandable:!1}})})),t.getElementSegments(i.length+1,n).then((function(e){return e.length>0&&n.push({label:"Select Element",value:{value:"-Select Element-"}}),n}))):Promise.resolve(n)})),H($(t),"checkAfServer",(function(){var e,n,a=t.props.datasource,r=[];null!==(e=a.afserver)&&void 0!==e&&e.name?(r.push({label:a.afserver.name,value:{value:a.afserver.name,expandable:!0}}),null!==(n=a.afdatabase)&&void 0!==n&&n.name&&r.push({label:a.afdatabase.name,value:{value:a.afdatabase.name,expandable:!0}}),r.push({label:"Select Element",value:{value:"-Select Element-"}})):r.push({label:""});return r})),H($(t),"updateArray",(function(e,n,a,r,i){t.setState({segments:e,attributes:n,summaries:a,isPiPoint:r},(function(){return t.checkAttributeSegments(n,t.state.segments).then((function(){i&&i()}))}))})),H($(t),"scopedVarsDone",!1),H($(t),"componentDidMount",(function(){t.initialLoad(!1)})),H($(t),"componentDidUpdate",(function(){var e,n,a;"Done"===(null===(e=t.props.data)||void 0===e?void 0:e.state)&&null!==(n=t.props.data)&&void 0!==n&&null!==(a=n.request)&&void 0!==a&&a.scopedVars&&!t.scopedVarsDone&&(t.scopedVarsDone=!0,t.initialLoad(!0))})),H($(t),"initialLoad",(function(e){var n,a,r,i=t.props.query,o=(0,C.defaults)(i,F),l=o.segments,u=o.attributes,s=o.summary,c=o.isPiPoint,m=e?[]:null!==(n=null==l?void 0:l.slice(0))&&void 0!==n?n:[],h=e?[]:null!==(a=null==u?void 0:u.slice(0))&&void 0!==a?a:[],p=null!==(r=null==s?void 0:s.types)&&void 0!==r?r:[];if(c||0!==m.length)c&&m.length>0&&(t.piServer=m);else{if(i.target&&i.target.length>0&&";"!==i.target)return h=[],void t.buildFromTarget(i,m,h).then((function(e){t.updateArray(e,h,p,c)})).catch((function(e){}));m=t.checkAfServer()}t.updateArray(m,h,p,c,(function(){t.onChange(i)}))})),H($(t),"onChange",(function(e){var n,a=t.props,r=a.onChange,i=a.onRunQuery;if(e.summary.types=t.state.summaries,e.rawQuery){if(e.target=null!==(n=e.query)&&void 0!==n?n:"",""!==e.target){var o=e.target.split(";"),l=o[0].split("\\");o.splice(0,1),e.attributes=[],(l.length>1||1===l.length&&""!==l[0])&&(e.elementPath=l.join("\\"),(0,C.each)(o,(function(t,n){""!==t&&e.attributes.push({label:t,value:{value:t,expandable:!1}})})))}}else e.elementPath=t.getSegmentPathUpTo(t.state.segments,t.state.segments.length),e.target=e.elementPath+";"+(0,C.join)(e.attributes.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})),";");r(e),e.target&&e.target.length>0&&e.attributes.length>0&&i()})),H($(t),"stateCallback",(function(){var e=t.props.query;t.onChange(e)})),H($(t),"onIsPiPointChange",(function(e){var n=t.props.query,a=!n.isPiPoint;t.setState({segments:a?[{label:""}]:t.checkAfServer(),attributes:[],isPiPoint:a},(function(){t.onChange(_({},n,{expression:"",attributes:t.state.attributes,segments:t.state.segments,isPiPoint:a}))}))})),t.onSegmentChange=t.onSegmentChange.bind($(t)),t.calcBasisValueChanged=t.calcBasisValueChanged.bind($(t)),t.calcNoDataValueChanged=t.calcNoDataValueChanged.bind($(t)),t.onSummaryAction=t.onSummaryAction.bind($(t)),t.onSummaryValueChanged=t.onSummaryValueChanged.bind($(t)),t.onAttributeAction=t.onAttributeAction.bind($(t)),t.onAttributeChange=t.onAttributeChange.bind($(t)),t.summaryTypes=["Total","Average","Minimum","Maximum","Range","StdDev","PopulationStdDev","Count","PercentGood","All","AllForNonNumeric"],t.calculationBasis=["TimeWeighted","EventWeighted","TimeWeightedContinuous","TimeWeightedDiscrete","EventWeightedExcludeMostRecentEvent","EventWeightedExcludeEarliestEvent","EventWeightedIncludeBothEnds"],t.noDataReplacement=["Null","Drop","Previous","0","Keep"],t}return t=i,(n=[{key:"isValueEmpty",value:function(e){return!e||!e.value||!e.value.length||e.value===X}},{key:"calcBasisValueChanged",value:function(e){var t,n=this.props.query,a=n.summary;a.basis=null===(t=e.value)||void 0===t?void 0:t.value,this.onChange(_({},n,{summary:a}))}},{key:"getCalcBasisSegments",value:function(){return(0,C.map)(this.calculationBasis,(function(e){return{label:e,value:{value:e,expandable:!0}}}))}},{key:"calcNoDataValueChanged",value:function(e){var t,n=this.props.query,a=n.summary;a.nodata=null===(t=e.value)||void 0===t?void 0:t.value,this.onChange(_({},n,{summary:a}))}},{key:"getNoDataSegments",value:function(){return(0,C.map)(this.noDataReplacement,(function(e){return{label:e,value:{value:e,expandable:!0}}}))}},{key:"onSummaryValueChanged",value:function(e,t){var n=this.state.summaries.slice(0);n[t]=e,this.isValueEmpty(e.value)&&n.splice(t,1),this.setState({summaries:n},this.stateCallback)}},{key:"getSummarySegments",value:function(){var e=this,t=(0,C.filter)(this.summaryTypes,(function(t){return-1===e.state.summaries.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).indexOf(t)})),n=(0,C.map)(t,(function(e){return{label:e,value:{value:e,expandable:!0}}}));return n.unshift({label:X,value:{value:X}}),n}},{key:"removeSummary",value:function(e){var t=(0,C.filter)(this.state.summaries,(function(t){return t!==e}));this.setState({summaries:t})}},{key:"onSummaryAction",value:function(e){var t=this.state.summaries.slice(0);if(!this.isValueEmpty(e.value)){var n,a={label:e.label,value:{value:null===(n=e.value)||void 0===n?void 0:n.value,expandable:!0}};t.push(a)}this.setState({summarySegment:{},summaries:t},this.stateCallback)}},{key:"removeAttribute",value:function(e){var t=(0,C.filter)(this.state.attributes,(function(t){return t!==e}));this.attributeChangeValue(t)}},{key:"onAttributeAction",value:function(e){var t=this.props.query,n=this.state.attributes.slice(0);if(!this.isValueEmpty(e.value)){var a,r={label:e.label,value:{value:null===(a=e.value)||void 0===a?void 0:a.value,expandable:!t.isPiPoint}};n.push(r)}this.attributeChangeValue(n)}},{key:"getSegmentPathUpTo",value:function(e,t){var n=e.slice(0,t);return(0,C.reduce)(n,(function(e,t){var n;return t.value?null!==(n=t.value.value)&&void 0!==n&&n.startsWith("-Select")?e:e?e+"\\"+t.value.value:t.value.value:""}),"")}},{key:"checkAttributeSegments",value:function(e,t){var n,a,r=this,i=this.props,o=i.datasource,l=i.data,u=this,s={path:this.getSegmentPathUpTo(t.slice(0),t.length),type:"attributes"};return o.metricFindQuery(s,Object.assign(null!==(n=null==l||null===(a=l.request)||void 0===a?void 0:a.scopedVars)&&void 0!==n?n:{},{isPiPoint:!1})).then((function(t){var n={};(0,C.each)(t,(function(e){n[e.Path.substring(e.Path.indexOf("|")+1)]=e.WebId}));var a=(0,C.filter)(e,(function(e){var t,a=o.templateSrv.replace(null===(t=e.value)||void 0===t?void 0:t.value);return void 0!==n[a]}));u.availableAttributes=n,r.attributeChangeValue(a)})).catch((function(t){u.error=t.message||"Failed to issue metric query",r.attributeChangeValue(e)}))}},{key:"checkPiPointSegments",value:function(e,t){var n,a,r=this.props,i=r.datasource,o=r.data,l=this,u={path:e.path,webId:l.getSelectedPIServer(),pointName:e.label,type:"pipoint"};return i.metricFindQuery(u,Object.assign(null!==(n=null==o||null===(a=o.request)||void 0===a?void 0:a.scopedVars)&&void 0!==n?n:{},{isPiPoint:!0})).then((function(){l.attributeChangeValue(t)})).catch((function(e){l.error=e.message||"Failed to issue metric query",l.attributeChangeValue([])}))}},{key:"getSelectedPIServer",value:function(){var e,t=this,n="";return this.piServer.forEach((function(e){var a=t.props.query.target.split(";");a.length>=2&&a[0]===e.text&&(n=e.WebId)})),this.piServer.length>0?null===(e=this.piServer[0].value)||void 0===e?void 0:e.webId:n}},{key:"textEditorChanged",value:function(){var e=this,t=this.props,n=t.query,a=t.onChange,r=n.target.split(";"),i=r.length>0?r[0].split("\\"):[],o=[],l=[];i.length>1||1===i.length&&""!==i[0]?(r.splice(0,1),(0,C.each)(i,(function(e,t){o.push({label:e,value:{type:e.match(/\${\w+}/gi)?"template":void 0,value:e,expandable:!0}})})),this.getElementSegments(i.length+1,o).then((function(e){e.length>0&&o.push({label:"Select Element",value:{value:"-Select Element-"}})})),(0,C.each)(r,(function(e,t){""!==e&&l.push({label:e,value:{value:e,expandable:!1}})})),this.updateArray(o,l,this.state.summaries,n.isPiPoint,(function(){a(_({},n,{query:void 0,rawQuery:!1}))}))):(o=this.checkAfServer(),this.updateArray(o,this.state.attributes,this.state.summaries,n.isPiPoint,(function(){e.onChange(_({},n,{query:void 0,rawQuery:!1,attributes:e.state.attributes,segments:e.state.segments}))})))}},{key:"render",value:function(){var e=this,t=this.props,n=t.query,a=t.onChange,r=t.onRunQuery,i=(0,C.defaults)(n,F),l=i.interpolate,u=i.query,c=i.rawQuery,m=i.digitalStates,h=i.recordedValues,p=i.expression,d=i.isPiPoint,f=i.summary,v=i.display,b=i.regex;return o().createElement(o().Fragment,null,o().createElement(s.InlineField,{label:"Is Pi Point?",labelWidth:z},o().createElement(s.InlineSwitch,{value:d,onChange:this.onIsPiPointChange})),!!c&&o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Raw Query",labelWidth:z,grow:!0},o().createElement(s.Input,{onBlur:this.stateCallback,value:u,onChange:function(e){return a(_({},i,{query:e.target.value}))},placeholder:"enter query"})),o().createElement(B,{isRaw:!0,onChange:function(t){return e.textEditorChanged()}})),!c&&o().createElement(o().Fragment,null,o().createElement("div",{className:"gf-form-inline"},o().createElement(j,{label:d?"PI Server":"AF Elements",tooltip:d?"Select PI server.":"Select AF Element."},this.state.segments.map((function(t,n){return o().createElement(s.SegmentAsync,{key:"element-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),onChange:function(t){return e.onSegmentChange(t,n)},loadOptions:function(t){return e.getElementSegments(n)},allowCustomValue:!0,inputMinWidth:200})})),R||(R=o().createElement(A,null)),!d&&o().createElement(B,{isRaw:!1,onChange:function(e){a(_({},i,{query:i.target,rawQuery:e}))}}))),o().createElement(k,{label:d?"Pi Points":"Attributes"},this.state.attributes.map((function(t,n){return d?o().createElement(s.SegmentAsync,{key:"attributes-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),disabled:0===e.piServer.length,onChange:function(t){return e.onPiPointChange(t,n)},loadOptions:e.getAttributeSegmentsPI,reloadOptionsOnChange:!0,allowCustomValue:!0,inputMinWidth:J}):o().createElement(s.Segment,{key:"attributes-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),disabled:e.state.segments.length<=2,onChange:function(t){return e.onAttributeChange(t,n)},options:e.getAttributeSegmentsAF(),allowCustomValue:!0,inputMinWidth:J})})),d&&o().createElement(s.SegmentAsync,{Component:o().createElement(Y,{value:this.state.attributeSegment.value,label:this.state.attributeSegment.label}),disabled:0===this.piServer.length,onChange:this.onAttributeAction,loadOptions:this.getAttributeSegmentsPI,reloadOptionsOnChange:!0,allowCustomValue:!0,inputMinWidth:J}),!d&&o().createElement(s.Segment,{Component:o().createElement(Y,{value:this.state.attributeSegment.value,label:this.state.attributeSegment.label}),disabled:this.state.segments.length<=2,onChange:this.onAttributeAction,options:this.getAttributeSegmentsAF(),allowCustomValue:!0,inputMinWidth:J}))),!d&&o().createElement(s.InlineField,{label:"Calculation",labelWidth:z,tooltip:"Modify all attributes by an equation. Use '.' for current item. Leave Attributes empty if you wish to perform element based calculations."},o().createElement(s.Input,{onBlur:r,value:p,onChange:function(t){return e.onChange(_({},i,{expression:t.target.value}))},placeholder:"'.'*2"})),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Max Recorded Values",labelWidth:z,tooltip:"Maximum number of recorded value to retrive from the data archive, without using interpolation."},o().createElement(s.Input,{onBlur:r,value:h.maxNumber,onChange:function(t){return e.onChange(_({},i,{recordedValues:_({},h,{maxNumber:parseInt(t.target.value,10)})}))},type:"number",placeholder:"1000"})),o().createElement(s.InlineField,{label:"Recorded Values",labelWidth:z},o().createElement(s.InlineSwitch,{value:h.enable,onChange:function(){return e.onChange(_({},i,{recordedValues:_({},h,{enable:!h.enable})}))}})),o().createElement(s.InlineField,{label:"Digital States",labelWidth:z},o().createElement(s.InlineSwitch,{value:m.enable,onChange:function(){return e.onChange(_({},i,{digitalStates:_({},m,{enable:!m.enable})}))}}))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Interpolate Period",labelWidth:z,tooltip:"Override time between sampling, e.g. '30s'. Defaults to timespan/chart width."},o().createElement(s.Input,{onBlur:r,value:l.interval,onChange:function(t){return e.onChange(_({},i,{interpolate:_({},l,{interval:t.target.value})}))},placeholder:"30s"})),o().createElement(s.InlineField,{label:"Interpolate",labelWidth:z},o().createElement(s.InlineSwitch,{value:l.enable,onChange:function(){return e.onChange(_({},i,{interpolate:_({},l,{enable:!l.enable})}))}})),o().createElement(s.InlineField,{label:"Replace Bad Data",labelWidth:z,tooltip:"Replacement for bad quality values."},o().createElement(s.Segment,{Component:o().createElement(Y,{value:{value:f.nodata},label:f.nodata}),onChange:this.calcNoDataValueChanged,options:this.getNoDataSegments(),allowCustomValue:!0}))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Summary Period",labelWidth:z,tooltip:"Override time between sampling, e.g. '30s'."},o().createElement(s.Input,{onBlur:r,value:f.interval,onChange:function(e){return a(_({},i,{summary:_({},f,{interval:e.target.value})}))},placeholder:"30s"})),o().createElement(s.InlineField,{label:"Basis",labelWidth:z,tooltip:"Defines the possible calculation options when performing summary calculations over time-series data."},o().createElement(s.Segment,{Component:o().createElement(Y,{value:{value:f.basis},label:f.basis}),onChange:this.calcBasisValueChanged,options:this.getCalcBasisSegments(),allowCustomValue:!0})),o().createElement(s.InlineField,{label:"Summaries",labelWidth:z,tooltip:"Replacement for bad quality values."},o().createElement(s.InlineFieldRow,null,this.state.summaries.map((function(t,n){return o().createElement(s.Segment,{key:"summaries-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),onChange:function(t){return e.onSummaryValueChanged(t,n)},options:e.getSummarySegments(),allowCustomValue:!0})})),o().createElement(s.Segment,{Component:o().createElement(Y,{value:this.state.summarySegment.value,label:this.state.summarySegment.label}),onChange:this.onSummaryAction,options:this.getSummarySegments(),allowCustomValue:!0})))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Display Name",labelWidth:z,tooltip:"If single attribute, modify display name. Otherwise use regex to modify display name."},o().createElement(s.Input,{onBlur:r,value:v,onChange:function(t){return e.onChange(_({},i,{display:t.target.value}))},placeholder:"Display"})),o().createElement(s.InlineField,{label:"Enable Regex Replace",labelWidth:z},o().createElement(s.InlineSwitch,{value:b.enable,onChange:function(){e.onChange(_({},i,{regex:_({},b,{enable:!b.enable})}))}})),o().createElement(s.InlineField,{label:"Search",labelWidth:16},o().createElement(s.Input,{onBlur:r,value:b.search,onChange:function(t){return e.onChange(_({},i,{regex:_({},b,{search:t.target.value})}))},placeholder:"(.*)"})),o().createElement(s.InlineField,{label:"Replace",labelWidth:16},o().createElement(s.Input,{onBlur:r,value:b.replace,onChange:function(t){return e.onChange(_({},i,{regex:_({},b,{replace:t.target.value})}))},placeholder:"$1"}))))}}])&&G(t.prototype,n),a&&G(t,a),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.PureComponent),Z=l(5);function ee(e){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(e)}function te(){te=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var r=t&&t.prototype instanceof m?t:m,i=Object.create(r.prototype),o=new w(a||[]);return i._invoke=function(e,t,n){var a="suspendedStart";return function(r,i){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===r)throw i;return C()}for(n.method=r,n.arg=i;;){var o=n.delegate;if(o){var l=P(o,n);if(l){if(l===c)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var u=s(e,t,n);if("normal"===u.type){if(a=n.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c={};function m(){}function h(){}function p(){}var d={};l(d,r,(function(){return this}));var f=Object.getPrototypeOf,v=f&&f(f(I([])));v&&v!==t&&n.call(v,r)&&(d=v);var b=p.prototype=m.prototype=Object.create(d);function g(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function a(r,i,o,l){var u=s(e[r],e,i);if("throw"!==u.type){var c=u.arg,m=c.value;return m&&"object"==ee(m)&&n.call(m,"__await")?t.resolve(m.__await).then((function(e){a("next",e,o,l)}),(function(e){a("throw",e,o,l)})):t.resolve(m).then((function(e){c.value=e,o(c)}),(function(e){return a("throw",e,o,l)}))}l(u.arg)}var r;this._invoke=function(e,n){function i(){return new t((function(t,r){a(e,n,t,r)}))}return r=r?r.then(i,i):i()}}function P(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,P(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,c;var r=a.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function I(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function t(){for(;++a=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if("throw"===a.type){var r=a.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:I(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function ne(e,t,n,a,r,i,o){try{var l=e[i](o),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(a,r)}function ae(e,t){for(var n=0;n"+e.Name+": "+t})),{annotation:e,title:(t?"END ":e.showEndTime?"START ":"")+e.name,time:new Date(t?n.EndTime:n.StartTime).getTime(),text:n.Name+r+"
Start: "+n.StartTime+"
End: "+n.EndTime}}},{key:"buildQueryParameters",value:function(e){var t=this;return e.targets=(0,C.filter)(e.targets,(function(e){return!(!e||!e.target||e.target.startsWith("Select AF"))})),e.targets=(0,C.map)(e.targets,(function(n){var a=t,r={target:t.templateSrv.replace(n.elementPath,e.scopedVars),elementPath:t.templateSrv.replace(n.elementPath,e.scopedVars),elementPathArray:[{path:t.templateSrv.replace(n.elementPath,e.scopedVars),variable:""}],attributes:(0,C.map)(n.attributes,(function(n){var a;return t.templateSrv.replace((null===(a=n.value)||void 0===a?void 0:a.value)||n,e.scopedVars)})),segments:(0,C.map)(n.segments,(function(n){var a;return t.templateSrv.replace(null===(a=n.value)||void 0===a?void 0:a.value,e.scopedVars)})),display:n.display,refId:n.refId,hide:n.hide,interpolate:n.interpolate||{enable:!1},recordedValues:n.recordedValues||{enable:!1},digitalStates:n.digitalStates||{enable:!1},webid:n.webid,webids:n.webids||[],regex:n.regex||{enable:!1},expression:n.expression||"",summary:n.summary||{types:[]},startTime:e.range.from,endTime:e.range.to,isPiPoint:n.isPiPoint,scopedVars:e.scopedVars};r.expression&&(r.expression=t.templateSrv.replace(r.expression,e.scopedVars)),void 0!==r.summary.types&&(r.summary.types=(0,C.filter)(r.summary.types,(function(e){return null!=e&&""!==e})));var i=(0,C.keys)(e.scopedVars);return t.templateSrv.getVariables().forEach((function(e){if(a.isAllSelected(e.current)&&i.indexOf(e.name)<0){var t=e.options.filter((function(e){return!e.selected}));r.attributes=r.attributes.map((function(n){return t.map((function(t){return e.allValue?n.replace(e.allValue,t.value):n.replace(/{[a-zA-z0-9,-_]+}/gi,t.value)}))})),r.attributes=(0,C.uniq)((0,C.flatten)(r.attributes)),r.elementPathArray=a.getElementPath(r.elementPathArray,t,e.allValue)}else if(Array.isArray(e.current.text)&&i.indexOf(e.name)<0){var n=e.options.filter((function(e){return e.selected})),o=e.current.value.join(",");r.attributes=r.attributes.map((function(e){return n.map((function(t){return e.replace("{".concat(o,"}"),t.value)}))})),r.attributes=(0,C.uniq)((0,C.flatten)(r.attributes)),r.elementPathArray=a.getElementPath(r.elementPathArray,n,"{".concat(o,"}"))}})),r})),e}},{key:"query",value:(i=te().mark((function t(n){var a,r;return te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=this,(r=this.buildQueryParameters(n)).targets=(0,C.filter)(r.targets,(function(e){return!e.hide})),!(r.targets.length<=0)){t.next=7;break}return t.abrupt("return",Promise.resolve({data:[]}));case 7:return t.abrupt("return",Promise.all(a.getStream(r)).then((function(t){var n=[];return(0,C.each)(t,(function(e){(0,C.each)(e,(function(e){return n.push(e)}))})),{data:n.sort((function(e,t){return+(e.target>t.target)||+(e.target===t.target)-1})).map((function(t){return(0,e.toDataFrame)(t)}))}})));case 8:case"end":return t.stop()}}),t,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,a){var r=i.apply(e,t);function o(e){ne(r,n,a,o,l,"next",e)}function l(e){ne(r,n,a,o,l,"throw",e)}o(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"testDatasource",value:function(){return this.backendSrv.datasourceRequest({url:this.url+"/",method:"GET"}).then((function(e){if(200===e.status)return{status:"success",message:"Data source is working",title:"Success"};throw new Error("Failed")}))}},{key:"annotationQuery",value:function(e){var t=this;if(!this.afdatabase.webid)return Promise.resolve([]);var n=e.annotation.query.categoryName?this.templateSrv.replace(e.annotation.query.categoryName,e.scopedVars,"glob"):null,a=e.annotation.query.nameFilter?this.templateSrv.replace(e.annotation.query.nameFilter,e.scopedVars,"glob"):null,r=e.annotation.template?e.annotation.template.Name:null,i={name:e.annotation.name,datasource:e.annotation.datasource,enable:e.annotation.enable,iconColor:e.annotation.iconColor,showEndTime:e.annotation.showEndTime,regex:e.annotation.regex,attribute:e.annotation.attribute,categoryName:n,templateName:r,nameFilter:a},o=[];if(i.categoryName&&o.push("categoryName="+i.categoryName),i.nameFilter&&o.push("nameFilter="+i.nameFilter),i.templateName&&o.push("templateName="+i.templateName),!o.length)return Promise.resolve([]);if(o.push("startTime="+e.range.from.toJSON()),o.push("endTime="+e.range.to.toJSON()),i.attribute&&i.attribute.enable){var l=this.piwebapiurl+"/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name";i.attribute.name&&(l=this.piwebapiurl+"/streamsets/{0}/value?nameFilter="+i.attribute.name+"&selectedFields=Items.WebId%3BItems.Value%3BItems.Name");var u={};return u[1]={Method:"GET",Resource:this.piwebapiurl+"/assetdatabases/"+this.afdatabase.webid+"/eventframes?"+o.join("&")},u[2]={Method:"GET",RequestTemplate:{Resource:l},Parameters:["$.1.Content.Items[*].WebId"],ParentIds:["1"]},this.restBatch(u).then((function(n){var a=n.data[1].Content,r=n.data[2].Content,o=(0,C.map)(a.Items,(function(e,n){return(0,C.curry)(t.eventFrameToAnnotation)(i,!1,e,r.Items[n].Content.Items)}));if(e.annotation.showEndTime){var l=(0,C.map)(a.Items,(function(e,n){return(0,C.curry)(t.eventFrameToAnnotation)(i,!0,e,r.Items[n].Content.Items)}));(0,C.each)(l,(function(e){o.push(e)}))}return o}))}return this.restGet("/assetdatabases/"+this.afdatabase.webid+"/eventframes?"+o.join("&")).then((function(n){var a=(0,C.map)(n.data.Items,(0,C.curry)(t.eventFrameToAnnotation)(i,!1));if(e.annotation.showEndTime){var r=(0,C.map)(n.data.Items,(0,C.curry)(t.eventFrameToAnnotation)(i,!0));(0,C.each)(r,(function(e){a.push(e)}))}return a}))}},{key:"metricQueryTransform",value:function(e){return(0,C.map)(e,(function(e){var t,n;return{text:e.Name,expandable:void 0===e.HasChildren||!0===e.HasChildren||(null!==(t=e.Path)&&void 0!==t?t:"").split("\\").length<=3,HasChildren:e.HasChildren,Items:null!==(n=e.Items)&&void 0!==n?n:[],Path:e.Path,WebId:e.WebId}}))}},{key:"metricFindQuery",value:function(e,t){var n,a,r=this,i=["servers","databases","databaseElements","elements"];return"string"==typeof e&&(e=JSON.parse(e)),t.isPiPoint?e.path=this.templateSrv.replace(e.path,t):(""===e.path?e.type=i[0]:"attributes"!==e.type&&(e.type=i[Math.max(0,Math.min(e.path.split("\\").length,i.length-1))]),e.path=this.templateSrv.replace(e.path,t),e.path=e.path.replace(/\{([^\\])*\}/gi,(function(e){return e.substring(1,e.length-2).split(",")[0]}))),e.filter=null!==(n=e.filter)&&void 0!==n?n:"*","servers"===e.type?null!==(a=r.afserver)&&void 0!==a&&a.name?r.getAssetServer(r.afserver.name).then((function(e){return[e]})).then(r.metricQueryTransform):r.getAssetServers().then(r.metricQueryTransform):"databases"===e.type?r.getAssetServer(e.path).then((function(e){var t;return r.getDatabases(null!==(t=e.WebId)&&void 0!==t?t:"",{})})).then(r.metricQueryTransform):"databaseElements"===e.type?r.getDatabase(e.path).then((function(e){var t;return r.getDatabaseElements(null!==(t=e.WebId)&&void 0!==t?t:"",{selectedFields:"Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren"})})).then(r.metricQueryTransform):"elements"===e.type?r.getElement(e.path).then((function(t){var n;return r.getElements(null!==(n=t.WebId)&&void 0!==n?n:"",{selectedFields:"Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren",nameFilter:e.filter})})).then(r.metricQueryTransform):"attributes"===e.type?r.getElement(e.path).then((function(t){var n;return r.getAttributes(null!==(n=t.WebId)&&void 0!==n?n:"",{searchFullHierarchy:"true",selectedFields:"Items.WebId%3BItems.Name%3BItems.Path",nameFilter:e.filter})})).then(r.metricQueryTransform):"dataserver"===e.type?r.getDataServers().then(r.metricQueryTransform):"pipoint"===e.type?r.piPointSearch(e.webId,e.pointName).then(r.metricQueryTransform):Promise.reject("Bad type")}},{key:"getSummaryUrl",value:function(e){return""===e.interval.trim()?"&summaryType="+e.types.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).join("&summaryType=")+"&calculationBasis="+e.basis:"&summaryType="+e.types.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).join("&summaryType=")+"&calculationBasis="+e.basis+"&summaryDuration="+e.interval.trim()}},{key:"parsePiPointValueList",value:function(e,t,n){var a=this,r=this,i=[];return(0,C.each)(e,(function(e){var o=a.noDataReplace(n?e.Value:e,t.summary.nodata,r.parsePiPointValue(n?e.Value:e,t,n)),l=o.grafanaDataPoint;o.previousValue,o.drop||i.push(l)})),i}},{key:"parsePiPointValue",value:function(e,t,n){var a,r,i,o,l=n||"object"!==ee(e.Value)?e.Value:null===(a=e.Value)||void 0===a?void 0:a.Value;return!e.Good||null!==(r=t.digitalStates)&&void 0!==r&&r.enable?(l=null!==(i=n||"object"!==ee(e.Value)?e.Name:null===(o=e.Value)||void 0===o?void 0:o.Name)&&void 0!==i?i:"",[this.checkNumber(l)?Number(l):l.trim(),new Date(e.Timestamp).getTime()]):[this.checkNumber(l)?Number(l):l.trim(),new Date(e.Timestamp).getTime()]}},{key:"noDataReplace",value:function(e,t,n){var a,r,i=null,o=!1;return!e.Good||"No Data"===e.Value||null!==(a=e.Value)&&void 0!==a&&a.Name&&"No Data"===(null===(r=e.Value)||void 0===r?void 0:r.Name)?"Drop"===t?o=!0:"0"===t?n[0]=0:"Keep"===t||("Null"===t?n[0]=null:"Previous"===t&&null!==i&&(n[0]=i)):i=e.Value,{grafanaDataPoint:n,previousValue:i,drop:o}}},{key:"processResults",value:function(e,t,n,a){var r=this,i=t.summary&&t.summary.types&&t.summary.types.length>0;if(n=a?n:this.getPath(t.elementPathArray,e.Path)+"|"+n,t.regex&&t.regex.enable&&t.regex.search.length&&t.regex.replace.length&&(n=n.replace(new RegExp(t.regex.search),t.regex.replace)),i){var o=[],l=(0,C.groupBy)(e.Items,(function(e){return e.Type}));return(0,C.forOwn)(l,(function(e,a){o.push({refId:t.refId,target:n+"["+a+"]",datapoints:r.parsePiPointValueList(e,t,i)})})),o}return[{refId:t.refId,target:n,datapoints:r.parsePiPointValueList(e.Items,t,i)}]}},{key:"isAllSelected",value:function(e){return!!e&&(Array.isArray(e.text)?e.text.indexOf("All")>=0:"All"===e.text)}},{key:"checkNumber",value:function(e){return"number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)}},{key:"getElementPath",value:function(e,t,n){var a=[];return e.forEach((function(e){if(n&&e.path.indexOf(n)>=0||!n&&e.path.match(/{[a-zA-z0-9,-_]+}/gi)){var r=t.map((function(t){return{path:n?e.path.replace(n,t.value):e.path.replace(/{[a-zA-z0-9,-_]+}/gi,t.value),variable:t.value}}));a=a.concat(r)}})),a.length?(0,C.uniq)((0,C.flatten)(a)):e}},{key:"getPath",value:function(e,t){var n,a,r=t.split("|");if(0===r.length)return"";if(0===e.length)return"";var i=0===(r=r[0].split("\\")).length?"":null!==(n=r.pop())&&void 0!==n?n:"",o=null===(a=e.find((function(e){return t.indexOf(e.path)>=0})))||void 0===a?void 0:a.variable;return o?o+"|"+i:i}},{key:"getStream",value:function(e){var t=this,n=this,a=[];return(0,C.each)(e.targets,(function(r){r.attributes=(0,C.filter)(r.attributes||[],(function(e){return e}));var i="",o=r.summary&&r.summary.types&&r.summary.types.length>0,l=r.interpolate&&r.interpolate.enable,u=r.interpolate.interval?r.interpolate.interval:e.interval,s="?startTime="+e.range.from.toJSON()+"&endTime="+e.range.to.toJSON(),c=r.expression||r.elementPath,m=r.display?t.templateSrv.replace(r.display,e.scopedVars):null;if(r.expression)i+="/calculation",i+=o?"/summary"+s+(l?"&sampleType=Interval&sampleInterval="+u:""):"/intervals"+s+"&sampleInterval="+u,i+="&expression="+encodeURIComponent(r.expression),r.attributes.length>0?a.push(n.internalStream(e,r,i)):a.push(n.restGetWebId(r.elementPath,r.isPiPoint).then((function(e){return n.restPost(i+e.WebId).then((function(e){return n.processResults(e.data,r,m||c,!1)})).catch((function(e){return n.error=e}))})));else{if(i+="/streamsets",o)i+="/summary"+s+"&intervals="+e.maxDataPoints+t.getSummaryUrl(r.summary);else if(r.interpolate&&r.interpolate.enable)i+="/interpolated"+s+"&interval="+u;else if(r.recordedValues&&r.recordedValues.enable){var h=r.recordedValues.maxNumber&&!isNaN(r.recordedValues.maxNumber)?r.recordedValues.maxNumber:1e3;i+="/recorded"+s+"&maxCount="+h}else i+="/plot"+s+"&intervals="+e.maxDataPoints;a.push(n.internalStream(e,r,i))}})),a}},{key:"internalStream",value:function(e,t,n){var a=this,r=t.expression||t.elementPath,i=t.display?this.templateSrv.replace(t.display,e.scopedVars):null,o=1===t.elementPathArray.length&&t.elementPath===t.elementPathArray[0].path;return(o?t.attributes.length>1?a.restGetWebId(t.elementPath,t.isPiPoint).then((function(e){return a.getAttributes(e.WebId,{searchFullHierarchy:"true",nameFilter:"*"})})).then((function(e){return e.filter((function(e){var n;return t.attributes.indexOf(e.Name)>=0||t.attributes.indexOf(null===(n=e.Path)||void 0===n?void 0:n.split("|").splice(1).join("|"))>=0}))})):Promise.all((0,C.map)(t.attributes,(function(e){return a.restGetWebId(t.elementPath+"|"+e,t.isPiPoint)}))):t.attributes.length>1?Promise.all(t.elementPathArray.map((function(e){return a.restGetWebId(e.path,t.isPiPoint).then((function(e){return a.getAttributes(e.WebId,{searchFullHierarchy:"true",nameFilter:"*"})})).then((function(e){return e.filter((function(e){var n;return t.attributes.indexOf(e.Name)>=0||t.attributes.indexOf(null===(n=e.Path)||void 0===n?void 0:n.split("|").splice(1).join("|"))>=0}))}))}))):Promise.all((0,C.flatten)((0,C.map)(t.attributes,(function(e){return t.elementPathArray.map((function(n){return a.restGetWebId(n.path+"|"+e,t.isPiPoint)}))}))))).then((function(e){var l={};return(0,C.each)((0,C.flatten)(e),(function(e,t){l[t+1]={Method:"GET",Resource:a.piwebapiurl+n+"&webid="+e.WebId}})),a.restBatch(l).then((function(n){var l=[];return(0,C.each)(n.data,(function(n,u){if(t.expression){var s=e[parseInt(u,10)-1].Name;(0,C.each)(a.processResults(n.Content,t,i||s||r,o),(function(e){return l.push(e)}))}else(0,C.each)(n.Content.Items,(function(e){(0,C.each)(a.processResults(e,t,i||e.Name||r,o),(function(e){return l.push(e)}))}))})),l})).catch((function(e){return a.error=e}))}))}},{key:"restGet",value:function(e){return this.backendSrv.datasourceRequest({url:this.url+e,method:"GET",headers:{"Content-Type":"application/json"}}).then((function(e){return e}))}},{key:"restGetWebId",value:function(e,t){var n=this,a=n.webidCache.get(e);if(a)return Promise.resolve({Path:e,WebId:a.WebId,Name:a.Name});var r="";return r=t?"/points?selectedFields=WebId%3BName%3BPath&path=\\\\"+e.replace("|","\\"):(e.indexOf("|")>=0?"/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\":"/elements?selectedFields=WebId%3BName%3BPath&path=\\\\")+e,this.backendSrv.datasourceRequest({url:this.url+r,method:"GET",headers:{"Content-Type":"application/json"}}).then((function(t){return n.webidCache.set(e,t.data),{Path:e,WebId:t.data.WebId,Name:t.data.Name}}))}},{key:"restBatch",value:function(e){return this.backendSrv.datasourceRequest({url:this.url+"/batch",data:e,method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"message/http"}})}},{key:"restPost",value:function(e){return this.backendSrv.datasourceRequest({url:this.url,method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"message/http","X-PIWEBAPI-HTTP-METHOD":"GET","X-PIWEBAPI-RESOURCE-ADDRESS":e}})}},{key:"getDataServers",value:function(){return this.restGet("/dataservers").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getDataServer",value:function(e){return e?this.restGet("/dataservers?name="+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getAssetServers",value:function(){return this.restGet("/assetservers").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getAssetServer",value:function(e){return e?this.restGet("/assetservers?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getDatabase",value:function(e){return e?this.restGet("/assetdatabases?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getDatabases",value:function(e,t){return e?this.restGet("/assetservers/"+e+"/assetdatabases").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]})):Promise.resolve([])}},{key:"getElement",value:function(e){return e?this.restGet("/elements?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getEventFrameTemplates",value:function(e){return e?this.restGet("/assetdatabases/"+e+"/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId").then((function(e){var t;return(0,C.filter)(null!==(t=e.data.Items)&&void 0!==t?t:[],(function(e){return"EventFrame"===e.InstanceType}))})):Promise.resolve([])}},{key:"getElementTemplates",value:function(e){return e?this.restGet("/assetdatabases/"+e+"/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId").then((function(e){var t;return(0,C.filter)(null!==(t=e.data.Items)&&void 0!==t?t:[],(function(e){return"Element"===e.InstanceType}))})):Promise.resolve([])}},{key:"getAttributes",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/elements/"+e+"/attributes"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getDatabaseElements",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/assetdatabases/"+e+"/elements"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getElements",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/elements/"+e+"/elements"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"piPointSearch",value:function(e,t){var n=this.templateSrv.replace(t),a="".concat(n),r=!1;if(n!==t)for(var i,o=/\{(\w|,)+\}/g;null!==(i=o.exec(n));)i.index===o.lastIndex&&o.lastIndex++,i.forEach((function(e,t){0===t&&(n=n.replace(e,e.replace("{","(").replace("}",")").replace(",","|")),a=a.replace(e,"*"),r=!0)}));return this.restGet("/dataservers/"+e+"/points?maxCount=20&nameFilter="+a).then((function(e){var t;return e&&null!==(t=e.data)&&void 0!==t&&t.Items?r?e.data.Items.filter((function(e){var t;return null===(t=e.Name)||void 0===t?void 0:t.match(n)})):e.data.Items:[]}))}},{key:"getWebId",value:function(e){var t=this,n=e.target.indexOf("\\")>=0,a=e.target.indexOf("|")>=0;return n||-1!==e.target.indexOf(".")?n?n&&a?t.restGet("/attributes?path=\\\\"+e.target).then((function(t){return void 0===t.data||200!==t.status?[{WebId:e.target,Name:e.display||e.target}]:(t.data.Name=e.display||t.data.Name,[t.data])})):t.restGet("/elements?path=\\\\"+e.target).then((function(t){return void 0===t.data||200!==t.status?[{WebId:e.target,Name:e.display||e.target}]:(t.data.Name=e.display||t.data.Name,[t.data])})):t.piPointSearch(this.piserver.webid,e.target).then((function(t){return void 0===t||0===t.length?[{WebId:e.target,Name:e.display||e.target}]:t})):Promise.resolve([{WebId:e.target,Name:e.display||e.target}])}}],a&&ae(n.prototype,a),r&&ae(n,r),Object.defineProperty(n,"prototype",{writable:!1}),u}(e.DataSourceApi),me=new e.DataSourcePlugin(ce).setConfigEditor(I).setQueryEditor(K).setAnnotationQueryCtrl(a)})(),u})())); +define(["@grafana/data","@grafana/runtime","@grafana/ui","lodash","react"], (__WEBPACK_EXTERNAL_MODULE__grafana_data__, __WEBPACK_EXTERNAL_MODULE__grafana_runtime__, __WEBPACK_EXTERNAL_MODULE__grafana_ui__, __WEBPACK_EXTERNAL_MODULE_lodash__, __WEBPACK_EXTERNAL_MODULE_react__) => { return /******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./AnnotationsQueryCtrl.ts": +/*!*********************************!*\ + !*** ./AnnotationsQueryCtrl.ts ***! + \*********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "AnnotationsQueryCtrl": () => (/* binding */ AnnotationsQueryCtrl) +/* harmony export */ }); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var AnnotationsQueryCtrl = /*#__PURE__*/function () { + AnnotationsQueryCtrl.$inject = ["$scope"]; + + /** @ngInject */ + function AnnotationsQueryCtrl($scope) { + var _this = this; + + _classCallCheck(this, AnnotationsQueryCtrl); + + _defineProperty(this, "$scope", void 0); + + _defineProperty(this, "annotation", void 0); + + _defineProperty(this, "datasource", void 0); + + this.$scope = $scope; + this.annotation = $scope.ctrl.annotation; + this.datasource = $scope.ctrl.datasource; // load defaults + + this.annotation.query = this.annotation.query || {}; + this.annotation.databases = this.annotation.databases || []; + this.annotation.templates = this.annotation.templates || []; + this.annotation.regex = this.annotation.regex || {}; + this.annotation.attribute = this.annotation.attribute || {}; + this.annotation.showEndTime = this.annotation.showEndTime || false; + this.datasource.getAssetServer(this.datasource.afserver.name).then(function (result) { + return _this.getDatabases(result.WebId); + }); + } + + _createClass(AnnotationsQueryCtrl, [{ + key: "templateChanged", + value: function templateChanged() {// do nothing + } + }, { + key: "databaseChanged", + value: function databaseChanged() { + this.annotation.templates = []; + this.getEventFrames(); + } + }, { + key: "getDatabases", + value: function getDatabases(webid) { + var _this2 = this; + + var ctrl = this; + ctrl.datasource.getDatabases(webid).then(function (dbs) { + ctrl.annotation.databases = dbs; + + _this2.$scope.$apply(); + }); + } + }, { + key: "getEventFrames", + value: function getEventFrames() { + var _this3 = this; + + var ctrl = this; + ctrl.datasource.getEventFrameTemplates(this.annotation.database.WebId).then(function (templates) { + ctrl.annotation.templates = templates; + + _this3.$scope.$apply(); + }); + } + }]); + + return AnnotationsQueryCtrl; +}(); + +_defineProperty(AnnotationsQueryCtrl, "templateUrl", 'partials/annotations.editor.html'); + +/***/ }), + +/***/ "./ConfigEditor.tsx": +/*!**************************!*\ + !*** ./ConfigEditor.tsx ***! + \**************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PIWebAPIConfigEditor": () => (/* binding */ PIWebAPIConfigEditor) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @grafana/ui */ "@grafana/ui"); +/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +var _h; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + + + +var FormField = _grafana_ui__WEBPACK_IMPORTED_MODULE_1__.LegacyForms.FormField; + +var coerceOptions = function coerceOptions(options) { + return _extends({}, options, { + jsonData: _extends({}, options.jsonData, { + url: options.url + }) + }); +}; + +var PIWebAPIConfigEditor = /*#__PURE__*/function (_PureComponent) { + _inherits(PIWebAPIConfigEditor, _PureComponent); + + var _super = _createSuper(PIWebAPIConfigEditor); + + function PIWebAPIConfigEditor() { + var _this; + + _classCallCheck(this, PIWebAPIConfigEditor); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _defineProperty(_assertThisInitialized(_this), "onPIServerChange", function (event) { + var _this$props = _this.props, + onOptionsChange = _this$props.onOptionsChange, + options = _this$props.options; + + var jsonData = _extends({}, options.jsonData, { + piserver: event.target.value + }); + + onOptionsChange(_extends({}, options, { + jsonData: jsonData + })); + }); + + _defineProperty(_assertThisInitialized(_this), "onAFServerChange", function (event) { + var _this$props2 = _this.props, + onOptionsChange = _this$props2.onOptionsChange, + options = _this$props2.options; + + var jsonData = _extends({}, options.jsonData, { + afserver: event.target.value + }); + + onOptionsChange(_extends({}, options, { + jsonData: jsonData + })); + }); + + _defineProperty(_assertThisInitialized(_this), "onAFDatabaseChange", function (event) { + var _this$props3 = _this.props, + onOptionsChange = _this$props3.onOptionsChange, + options = _this$props3.options; + + var jsonData = _extends({}, options.jsonData, { + afdatabase: event.target.value + }); + + onOptionsChange(_extends({}, options, { + jsonData: jsonData + })); + }); + + _defineProperty(_assertThisInitialized(_this), "onMyOptionsChange", function (options) { + var onOptionsChange = _this.props.onOptionsChange; + onOptionsChange(coerceOptions(options)); + }); + + return _this; + } + + _createClass(PIWebAPIConfigEditor, [{ + key: "render", + value: function render() { + var originalOptions = this.props.options; + var options = coerceOptions(originalOptions); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__.DataSourceHttpSettings, { + defaultUrl: "https://server.name/piwebapi", + dataSourceConfig: options, + onChange: this.onMyOptionsChange, + showAccessOptions: true + }), _h || (_h = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", { + className: "page-heading" + }, "PI/AF Connection Details")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + className: "gf-form-group" + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + className: "gf-form" + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(FormField, { + label: "PI Server", + labelWidth: 10, + inputWidth: 25, + onChange: this.onPIServerChange, + value: options.jsonData.piserver || '', + placeholder: "Default PI Server to use for data requests" + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + className: "gf-form" + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(FormField, { + label: "AF Server", + labelWidth: 10, + inputWidth: 25, + onChange: this.onAFServerChange, + value: options.jsonData.afserver || '', + placeholder: "Default AF Server to use for data requests" + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + className: "gf-form" + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(FormField, { + label: "AF Database", + labelWidth: 10, + inputWidth: 25, + onChange: this.onAFDatabaseChange, + value: options.jsonData.afdatabase || '', + placeholder: "Default AF Database server for AF queries" + })))); + } + }]); + + return PIWebAPIConfigEditor; +}(react__WEBPACK_IMPORTED_MODULE_0__.PureComponent); + +/***/ }), + +/***/ "./QueryEditor.tsx": +/*!*************************!*\ + !*** ./QueryEditor.tsx ***! + \*************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PIWebAPIQueryEditor": () => (/* binding */ PIWebAPIQueryEditor) +/* harmony export */ }); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @grafana/ui */ "@grafana/ui"); +/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _components_Forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/Forms */ "./components/Forms.tsx"); +/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./types */ "./types.ts"); +/* harmony import */ var components_QueryEditorModeSwitcher__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! components/QueryEditorModeSwitcher */ "./components/QueryEditorModeSwitcher.tsx"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +var _a, _QueryRowTerminator; + +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + +var LABEL_WIDTH = 24; +var MIN_ELEM_INPUT_WIDTH = 200; +var MIN_ATTR_INPUT_WIDTH = 250; +var REMOVE_LABEL = '-REMOVE-'; + +var CustomLabelComponent = function CustomLabelComponent(props) { + if (props.value) { + var _props$label; + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { + className: "gf-form-label ".concat(props.value.type === 'template' ? 'query-keyword' : '') + }, (_props$label = props.label) !== null && _props$label !== void 0 ? _props$label : '--no label--'); + } + + return _a || (_a = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("a", { + className: "gf-form-label query-part" + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Icon, { + name: "plus" + }))); +}; + +var PIWebAPIQueryEditor = /*#__PURE__*/function (_PureComponent) { + _inherits(PIWebAPIQueryEditor, _PureComponent); + + var _super = _createSuper(PIWebAPIQueryEditor); + + function PIWebAPIQueryEditor(props) { + var _this; + + _classCallCheck(this, PIWebAPIQueryEditor); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "error", void 0); + + _defineProperty(_assertThisInitialized(_this), "piServer", []); + + _defineProperty(_assertThisInitialized(_this), "availableAttributes", {}); + + _defineProperty(_assertThisInitialized(_this), "summaryTypes", void 0); + + _defineProperty(_assertThisInitialized(_this), "calculationBasis", void 0); + + _defineProperty(_assertThisInitialized(_this), "noDataReplacement", void 0); + + _defineProperty(_assertThisInitialized(_this), "state", { + isPiPoint: false, + segments: [], + attributes: [], + summaries: [], + attributeSegment: {}, + summarySegment: {}, + calculationBasisSegment: {}, + noDataReplacementSegment: {} + }); + + _defineProperty(_assertThisInitialized(_this), "segmentChangeValue", function (segments) { + var query = _this.props.query; + + _this.setState({ + segments: segments + }, function () { + return _this.onChange(_extends({}, query, { + segments: segments + })); + }); + }); + + _defineProperty(_assertThisInitialized(_this), "attributeChangeValue", function (attributes) { + var query = _this.props.query; + + _this.setState({ + attributes: attributes + }, function () { + return _this.onChange(_extends({}, query, { + attributes: attributes + })); + }); + }); + + _defineProperty(_assertThisInitialized(_this), "onPiPointChange", function (item, index) { + var attributes = _this.state.attributes.slice(0); + + if (item.label === REMOVE_LABEL) { + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.remove)(attributes, function (value, n) { + return n === index; + }); + } else { + // set current value + attributes[index] = item; + } + + _this.checkPiPointSegments(item, attributes); + }); + + _defineProperty(_assertThisInitialized(_this), "onAttributeChange", function (item, index) { + var attributes = _this.state.attributes.slice(0); // set current value + + + attributes[index] = item; + + _this.checkAttributeSegments(attributes, _this.state.segments); + }); + + _defineProperty(_assertThisInitialized(_this), "onSegmentChange", function (item, index) { + var _item$value; + + var query = _this.props.query; + + var segments = _this.state.segments.slice(0); + + if (item.label === REMOVE_LABEL) { + var _segments$value; + + segments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.slice)(segments, 0, index); + + _this.checkAttributeSegments([], segments); + + if (segments.length === 0) { + segments.push({ + label: '' + }); + } else if (!!((_segments$value = segments[segments.length - 1].value) !== null && _segments$value !== void 0 && _segments$value.expandable)) { + segments.push({ + label: 'Select Element', + value: { + value: '-Select Element-' + } + }); + } + + if (query.isPiPoint) { + _this.piServer = []; + } + + _this.segmentChangeValue(segments); + + return; + } // set current value + + + segments[index] = item; // Accept only one PI server + + if (query.isPiPoint) { + _this.piServer.push(item); + + _this.segmentChangeValue(segments); + + return; + } // changed internal selection + + + if (index < segments.length - 1) { + segments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.slice)(segments, 0, index + 1); + } + + _this.checkAttributeSegments([], segments); // add new options + + + if (!!((_item$value = item.value) !== null && _item$value !== void 0 && _item$value.expandable)) { + segments.push({ + label: 'Select Element', + value: { + value: '-Select Element-' + } + }); + } + + _this.segmentChangeValue(segments); + }); + + _defineProperty(_assertThisInitialized(_this), "getElementSegments", function (index, currentSegment) { + var _data$request$scopedV, _data$request; + + var _this$props = _this.props, + datasource = _this$props.datasource, + query = _this$props.query, + data = _this$props.data; + + var ctrl = _assertThisInitialized(_this); + + var findQuery = query.isPiPoint ? { + type: 'dataserver' + } : { + path: _this.getSegmentPathUpTo(currentSegment !== null && currentSegment !== void 0 ? currentSegment : _this.state.segments.slice(0), index) + }; + + if (!query.isPiPoint) { + var _datasource$afserver, _datasource$afserver2, _datasource$afdatabas; + + if ((_datasource$afserver = datasource.afserver) !== null && _datasource$afserver !== void 0 && _datasource$afserver.name && index === 0) { + return Promise.resolve([{ + label: datasource.afserver.name, + value: { + value: datasource.afserver.name, + expandable: true + } + }]); + } + + if ((_datasource$afserver2 = datasource.afserver) !== null && _datasource$afserver2 !== void 0 && _datasource$afserver2.name && (_datasource$afdatabas = datasource.afdatabase) !== null && _datasource$afdatabas !== void 0 && _datasource$afdatabas.name && index === 1) { + return Promise.resolve([{ + label: datasource.afdatabase.name, + value: { + value: datasource.afdatabase.name, + expandable: true + } + }]); + } // if (!findQuery.path?.length) { + // return Promise.resolve([]); + // } + + } + + return datasource.metricFindQuery(findQuery, Object.assign((_data$request$scopedV = data === null || data === void 0 ? void 0 : (_data$request = data.request) === null || _data$request === void 0 ? void 0 : _data$request.scopedVars) !== null && _data$request$scopedV !== void 0 ? _data$request$scopedV : {}, { + isPiPoint: query.isPiPoint + })).then(function (items) { + var altSegments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(items, function (item) { + var selectableValue = { + label: item.text, + value: { + webId: item.WebId, + value: item.text, + expandable: !query.isPiPoint && item.expandable + } + }; + return selectableValue; + }); + + if (altSegments.length === 0) { + return altSegments; + } // add template variables + + + var variables = datasource.templateSrv.getVariables(); + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(variables, function (variable) { + var selectableValue = { + label: '${' + variable.name + '}', + value: { + type: 'template', + value: '${' + variable.name + '}', + expandable: !query.isPiPoint + } + }; + altSegments.unshift(selectableValue); + }); + altSegments.unshift({ + label: REMOVE_LABEL, + value: { + value: REMOVE_LABEL + } + }); + return altSegments; + })["catch"](function (err) { + ctrl.error = err.message || 'Failed to issue metric query'; + return []; + }); + }); + + _defineProperty(_assertThisInitialized(_this), "getAttributeSegmentsPI", function (attributeText) { + var _data$request$scopedV2, _data$request2; + + var _this$props2 = _this.props, + datasource = _this$props2.datasource, + query = _this$props2.query, + data = _this$props2.data; + + var ctrl = _assertThisInitialized(_this); + + var findQuery = { + path: '', + webId: _this.getSelectedPIServer(), + pointName: (attributeText !== null && attributeText !== void 0 ? attributeText : '') + '*', + type: 'pipoint' + }; + var segments = []; + return datasource.metricFindQuery(findQuery, Object.assign((_data$request$scopedV2 = data === null || data === void 0 ? void 0 : (_data$request2 = data.request) === null || _data$request2 === void 0 ? void 0 : _data$request2.scopedVars) !== null && _data$request$scopedV2 !== void 0 ? _data$request$scopedV2 : {}, { + isPiPoint: query.isPiPoint + })).then(function (items) { + segments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(items, function (item) { + var selectableValue = { + path: item.Path, + label: item.text, + value: { + value: item.text, + expandable: false + } + }; + return selectableValue; + }); + segments.unshift({ + label: attributeText, + value: { + value: attributeText, + expandable: false + } + }); + segments.unshift({ + label: REMOVE_LABEL, + value: { + value: REMOVE_LABEL + } + }); + return segments; + })["catch"](function (err) { + ctrl.error = err.message || 'Failed to issue metric query'; + return segments; + }); + }); + + _defineProperty(_assertThisInitialized(_this), "getAttributeSegmentsAF", function (attributeText) { + var ctrl = _assertThisInitialized(_this); + + var segments = []; + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.forOwn)(ctrl.availableAttributes, function (val, key) { + var selectableValue = { + label: key, + value: { + value: key, + expandable: true + } + }; + segments.push(selectableValue); + }); + segments.unshift({ + label: REMOVE_LABEL, + value: { + value: REMOVE_LABEL + } + }); + return segments; + }); + + _defineProperty(_assertThisInitialized(_this), "buildFromTarget", function (query, segmentsArray, attributesArray) { + var splitAttributes = query.target.split(';'); + var splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\') : []; + + if (splitElements.length > 1 || splitElements.length === 1 && splitElements[0] !== '') { + // remove element hierarchy from attribute collection + splitAttributes.splice(0, 1); + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(splitElements, function (item, _) { + segmentsArray.push({ + label: item, + value: { + value: item, + expandable: true + } + }); + }); + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(splitAttributes, function (item, _) { + if (item !== '') { + // set current value + attributesArray.push({ + label: item, + value: { + value: item, + expandable: false + } + }); + } + }); + return _this.getElementSegments(splitElements.length + 1, segmentsArray).then(function (elements) { + if (elements.length > 0) { + segmentsArray.push({ + label: 'Select Element', + value: { + value: '-Select Element-' + } + }); + } + + return segmentsArray; + }); + } + + return Promise.resolve(segmentsArray); + }); + + _defineProperty(_assertThisInitialized(_this), "checkAfServer", function () { + var _datasource$afserver3; + + var datasource = _this.props.datasource; + var segmentsArray = []; + + if ((_datasource$afserver3 = datasource.afserver) !== null && _datasource$afserver3 !== void 0 && _datasource$afserver3.name) { + var _datasource$afdatabas2; + + segmentsArray.push({ + label: datasource.afserver.name, + value: { + value: datasource.afserver.name, + expandable: true + } + }); + + if ((_datasource$afdatabas2 = datasource.afdatabase) !== null && _datasource$afdatabas2 !== void 0 && _datasource$afdatabas2.name) { + segmentsArray.push({ + label: datasource.afdatabase.name, + value: { + value: datasource.afdatabase.name, + expandable: true + } + }); + } + + segmentsArray.push({ + label: 'Select Element', + value: { + value: '-Select Element-' + } + }); + } else { + segmentsArray.push({ + label: '' + }); + } + + return segmentsArray; + }); + + _defineProperty(_assertThisInitialized(_this), "updateArray", function (segmentsArray, attributesArray, summariesArray, isPiPoint, cb) { + _this.setState({ + segments: segmentsArray, + attributes: attributesArray, + summaries: summariesArray, + isPiPoint: isPiPoint + }, function () { + return _this.checkAttributeSegments(attributesArray, _this.state.segments).then(function () { + if (cb) { + cb(); + } + }); + }); + }); + + _defineProperty(_assertThisInitialized(_this), "scopedVarsDone", false); + + _defineProperty(_assertThisInitialized(_this), "componentDidMount", function () { + _this.initialLoad(false); + }); + + _defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function () { + var _this$props$data, _this$props$data2, _this$props$data2$req; + + if (((_this$props$data = _this.props.data) === null || _this$props$data === void 0 ? void 0 : _this$props$data.state) === 'Done' && !!((_this$props$data2 = _this.props.data) !== null && _this$props$data2 !== void 0 && (_this$props$data2$req = _this$props$data2.request) !== null && _this$props$data2$req !== void 0 && _this$props$data2$req.scopedVars) && !_this.scopedVarsDone) { + _this.scopedVarsDone = true; + + _this.initialLoad(true); + } + }); + + _defineProperty(_assertThisInitialized(_this), "initialLoad", function (force) { + var _segments$slice, _attributes$slice, _summary$types; + + var query = _this.props.query; + var metricsQuery = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.defaults)(query, _types__WEBPACK_IMPORTED_MODULE_4__.defaultQuery); + var segments = metricsQuery.segments, + attributes = metricsQuery.attributes, + summary = metricsQuery.summary, + isPiPoint = metricsQuery.isPiPoint; + var segmentsArray = force ? [] : (_segments$slice = segments === null || segments === void 0 ? void 0 : segments.slice(0)) !== null && _segments$slice !== void 0 ? _segments$slice : []; + var attributesArray = force ? [] : (_attributes$slice = attributes === null || attributes === void 0 ? void 0 : attributes.slice(0)) !== null && _attributes$slice !== void 0 ? _attributes$slice : []; + var summariesArray = (_summary$types = summary === null || summary === void 0 ? void 0 : summary.types) !== null && _summary$types !== void 0 ? _summary$types : []; + + if (!isPiPoint && segmentsArray.length === 0) { + if (query.target && query.target.length > 0 && query.target !== ';') { + attributesArray = []; // Build query from target + + _this.buildFromTarget(query, segmentsArray, attributesArray).then(function (_segmentsArray) { + _this.updateArray(_segmentsArray, attributesArray, summariesArray, isPiPoint); + })["catch"](function (e) { + return console.error(e); + }); + + return; + } else { + segmentsArray = _this.checkAfServer(); + } + } else if (isPiPoint && segmentsArray.length > 0) { + _this.piServer = segmentsArray; + } + + _this.updateArray(segmentsArray, attributesArray, summariesArray, isPiPoint, function () { + _this.onChange(query); + }); + }); + + _defineProperty(_assertThisInitialized(_this), "onChange", function (query) { + var _this$props3 = _this.props, + onChange = _this$props3.onChange, + onRunQuery = _this$props3.onRunQuery; + query.summary.types = _this.state.summaries; + + if (query.rawQuery) { + var _query$query; + + query.target = (_query$query = query.query) !== null && _query$query !== void 0 ? _query$query : ''; + + if (query.target !== '') { + var splitAttributes = query.target.split(';'); + var splitElements = splitAttributes[0].split('\\'); // remove element hierarchy from attribute collection + + splitAttributes.splice(0, 1); + query.attributes = []; + + if (splitElements.length > 1 || splitElements.length === 1 && splitElements[0] !== '') { + query.elementPath = splitElements.join('\\'); + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(splitAttributes, function (item, index) { + if (item !== '') { + query.attributes.push({ + label: item, + value: { + value: item, + expandable: false + } + }); + } + }); + } + } + } else { + query.elementPath = _this.getSegmentPathUpTo(_this.state.segments, _this.state.segments.length); + query.target = query.elementPath + ';' + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.join)(query.attributes.map(function (s) { + var _s$value; + + return (_s$value = s.value) === null || _s$value === void 0 ? void 0 : _s$value.value; + }), ';'); + } + + onChange(query); + + if (query.target && query.target.length > 0 && query.attributes.length > 0) { + onRunQuery(); + } + }); + + _defineProperty(_assertThisInitialized(_this), "stateCallback", function () { + var query = _this.props.query; + + _this.onChange(query); + }); + + _defineProperty(_assertThisInitialized(_this), "onIsPiPointChange", function (event) { + var queryChange = _this.props.query; + var isPiPoint = !queryChange.isPiPoint; + + _this.setState({ + segments: isPiPoint ? [{ + label: '' + }] : _this.checkAfServer(), + attributes: [], + isPiPoint: isPiPoint + }, function () { + _this.onChange(_extends({}, queryChange, { + expression: '', + attributes: _this.state.attributes, + segments: _this.state.segments, + isPiPoint: isPiPoint + })); + }); + }); + + _this.onSegmentChange = _this.onSegmentChange.bind(_assertThisInitialized(_this)); + _this.calcBasisValueChanged = _this.calcBasisValueChanged.bind(_assertThisInitialized(_this)); + _this.calcNoDataValueChanged = _this.calcNoDataValueChanged.bind(_assertThisInitialized(_this)); + _this.onSummaryAction = _this.onSummaryAction.bind(_assertThisInitialized(_this)); + _this.onSummaryValueChanged = _this.onSummaryValueChanged.bind(_assertThisInitialized(_this)); + _this.onAttributeAction = _this.onAttributeAction.bind(_assertThisInitialized(_this)); + _this.onAttributeChange = _this.onAttributeChange.bind(_assertThisInitialized(_this)); + _this.summaryTypes = [// 'None', // A summary type is not specified. + 'Total', // A totalization over the time range. + 'Average', // The average value over the time range. + 'Minimum', // The minimum value over the time range. + 'Maximum', // The maximum value over the time range. + 'Range', // The range value over the time range (minimum-maximum). + 'StdDev', // The standard deviation over the time range. + 'PopulationStdDev', // The population standard deviation over the time range. + 'Count', // The sum of event count over the time range when calculation basis is event weighted. The sum of event time duration over the time range when calculation basis is time weighted. + 'PercentGood', // Percent of data with good value during the calculation period. For time weighted calculations, the percentage is based on time. For event weighted calculations, the percent is based on event count. + 'All', // A convenience for requesting all available summary calculations. + 'AllForNonNumeric' // A convenience for requesting all available summary calculations for non-numeric data. + ]; + _this.calculationBasis = ['TimeWeighted', // Weight the values in the calculation by the time over which they apply. Interpolation is based on whether the attribute is stepped. Interpolated events are generated at the boundaries if necessary. + 'EventWeighted', // Evaluate values with equal weighting for each event. No interpolation is done. There must be at least one event within the time range to perform a successful calculation. Two events are required for standard deviation. In handling events at the boundary of the calculation, the AFSDK uses following rules: + 'TimeWeightedContinuous', // Apply weighting as in TimeWeighted, but do all interpolation between values as if they represent continuous data, (standard interpolation) regardless of whether the attribute is stepped. + 'TimeWeightedDiscrete', // Apply weighting as in TimeWeighted but interpolation between values is performed as if they represent discrete, unrelated values (stair step plot) regardless of the attribute is stepped. + 'EventWeightedExcludeMostRecentEvent', // The calculation behaves the same as _EventWeighted_, except in the handling of events at the boundary of summary intervals in a multiple intervals calculation. Use this option to prevent events at the intervals boundary from being double count at both intervals. With this option, events at the end time (most recent time) of an interval is not used in that interval. + 'EventWeightedExcludeEarliestEvent', // Similar to the option _EventWeightedExcludeMostRecentEvent_. Events at the start time(earliest time) of an interval is not used in that interval. + 'EventWeightedIncludeBothEnds' // Events at both ends of the interval boundaries are included in the event weighted calculation. + ]; + _this.noDataReplacement = ['Null', // replace with nulls + 'Drop', // drop items + 'Previous', // use previous value if available + '0', // replace with 0 + 'Keep' // Keep value + ]; + return _this; + } // is selected segment empty + + + _createClass(PIWebAPIQueryEditor, [{ + key: "isValueEmpty", + value: function isValueEmpty(value) { + return !value || !value.value || !value.value.length || value.value === REMOVE_LABEL; + } + }, { + key: "calcBasisValueChanged", + value: // summary calculation basis change event + function calcBasisValueChanged(segment) { + var _segment$value; + + var metricsQuery = this.props.query; + var summary = metricsQuery.summary; + summary.basis = (_segment$value = segment.value) === null || _segment$value === void 0 ? void 0 : _segment$value.value; + this.onChange(_extends({}, metricsQuery, { + summary: summary + })); + } // get summary calculation basis user interface segments + + }, { + key: "getCalcBasisSegments", + value: function getCalcBasisSegments() { + var segments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(this.calculationBasis, function (item) { + var selectableValue = { + label: item, + value: { + value: item, + expandable: true + } + }; + return selectableValue; + }); + return segments; + } // no data change event + + }, { + key: "calcNoDataValueChanged", + value: function calcNoDataValueChanged(segment) { + var _segment$value2; + + var metricsQuery = this.props.query; + var summary = metricsQuery.summary; + summary.nodata = (_segment$value2 = segment.value) === null || _segment$value2 === void 0 ? void 0 : _segment$value2.value; + this.onChange(_extends({}, metricsQuery, { + summary: summary + })); + } // get no data user interface segments + + }, { + key: "getNoDataSegments", + value: function getNoDataSegments() { + var segments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(this.noDataReplacement, function (item) { + var selectableValue = { + label: item, + value: { + value: item, + expandable: true + } + }; + return selectableValue; + }); + return segments; + } // summary query change event + + }, { + key: "onSummaryValueChanged", + value: function onSummaryValueChanged(item, index) { + var summaries = this.state.summaries.slice(0); + summaries[index] = item; + + if (this.isValueEmpty(item.value)) { + summaries.splice(index, 1); + } + + this.setState({ + summaries: summaries + }, this.stateCallback); + } // get the list of summaries available + + }, { + key: "getSummarySegments", + value: function getSummarySegments() { + var _this2 = this; + + var ctrl = this; + var summaryTypes = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(ctrl.summaryTypes, function (type) { + return _this2.state.summaries.map(function (s) { + var _s$value2; + + return (_s$value2 = s.value) === null || _s$value2 === void 0 ? void 0 : _s$value2.value; + }).indexOf(type) === -1; + }); + var segments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(summaryTypes, function (item) { + var selectableValue = { + label: item, + value: { + value: item, + expandable: true + } + }; + return selectableValue; + }); + segments.unshift({ + label: REMOVE_LABEL, + value: { + value: REMOVE_LABEL + } + }); + return segments; + } // remove a summary from the user interface and the query + + }, { + key: "removeSummary", + value: function removeSummary(part) { + var summaries = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(this.state.summaries, function (item) { + return item !== part; + }); + this.setState({ + summaries: summaries + }); + } // add a new summary to the query + + }, { + key: "onSummaryAction", + value: function onSummaryAction(item) { + var summaries = this.state.summaries.slice(0); // if value is not empty, add new attribute segment + + if (!this.isValueEmpty(item.value)) { + var _item$value2; + + var selectableValue = { + label: item.label, + value: { + value: (_item$value2 = item.value) === null || _item$value2 === void 0 ? void 0 : _item$value2.value, + expandable: true + } + }; + summaries.push(selectableValue); + } + + this.setState({ + summarySegment: {}, + summaries: summaries + }, this.stateCallback); + } // remove an attribute from the query + + }, { + key: "removeAttribute", + value: function removeAttribute(part) { + var attributes = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(this.state.attributes, function (item) { + return item !== part; + }); + this.attributeChangeValue(attributes); + } // add an attribute to the query + + }, { + key: "onAttributeAction", + value: function onAttributeAction(item) { + var query = this.props.query; + var attributes = this.state.attributes.slice(0); // if value is not empty, add new attribute segment + + if (!this.isValueEmpty(item.value)) { + var _item$value3; + + var selectableValue = { + label: item.label, + value: { + value: (_item$value3 = item.value) === null || _item$value3 === void 0 ? void 0 : _item$value3.value, + expandable: !query.isPiPoint + } + }; + attributes.push(selectableValue); + } + + this.attributeChangeValue(attributes); + } // pi point change event + + }, { + key: "getSegmentPathUpTo", + value: + /** + * Gets the segment information and parses it to a string. + * + * @param {any} index - Last index of segment to use. + * @returns - AF Path or PI Point name. + * + * @memberOf PIWebAPIQueryEditor + */ + function getSegmentPathUpTo(segments, index) { + var arr = segments.slice(0, index); + return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.reduce)(arr, function (result, segment) { + var _segment$value$value; + + if (!segment.value) { + return ''; + } + + if (!((_segment$value$value = segment.value.value) !== null && _segment$value$value !== void 0 && _segment$value$value.startsWith('-Select'))) { + return result ? result + '\\' + segment.value.value : segment.value.value; + } + + return result; + }, ''); + } + /** + * Get the current AF Element's child attributes. Validates when the element selection changes. + * + * @returns - Collection of attributes. + * + * @memberOf PIWebAPIQueryEditor + */ + + }, { + key: "checkAttributeSegments", + value: function checkAttributeSegments(attributes, segments) { + var _data$request$scopedV3, + _data$request3, + _this3 = this; + + var _this$props4 = this.props, + datasource = _this$props4.datasource, + data = _this$props4.data; + var ctrl = this; + var findQuery = { + path: this.getSegmentPathUpTo(segments.slice(0), segments.length), + type: 'attributes' + }; + return datasource.metricFindQuery(findQuery, Object.assign((_data$request$scopedV3 = data === null || data === void 0 ? void 0 : (_data$request3 = data.request) === null || _data$request3 === void 0 ? void 0 : _data$request3.scopedVars) !== null && _data$request$scopedV3 !== void 0 ? _data$request$scopedV3 : {}, { + isPiPoint: false + })).then(function (attributesResponse) { + var validAttributes = {}; + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(attributesResponse, function (attribute) { + validAttributes[attribute.Path.substring(attribute.Path.indexOf('|') + 1)] = attribute.WebId; + }); + var filteredAttributes = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(attributes, function (attrib) { + var _attrib$value; + + var changedValue = datasource.templateSrv.replace((_attrib$value = attrib.value) === null || _attrib$value === void 0 ? void 0 : _attrib$value.value); + return validAttributes[changedValue] !== undefined; + }); + ctrl.availableAttributes = validAttributes; + + _this3.attributeChangeValue(filteredAttributes); + })["catch"](function (err) { + ctrl.error = err.message || 'Failed to issue metric query'; + + _this3.attributeChangeValue(attributes); + }); + } + /** + * Get PI points from server. + * + * @returns - Collection of attributes. + * + * @memberOf PIWebAPIQueryEditor + */ + + }, { + key: "checkPiPointSegments", + value: function checkPiPointSegments(attribute, attributes) { + var _data$request$scopedV4, _data$request4; + + var _this$props5 = this.props, + datasource = _this$props5.datasource, + data = _this$props5.data; + var ctrl = this; + var findQuery = { + path: attribute.path, + webId: ctrl.getSelectedPIServer(), + pointName: attribute.label, + type: 'pipoint' + }; + return datasource.metricFindQuery(findQuery, Object.assign((_data$request$scopedV4 = data === null || data === void 0 ? void 0 : (_data$request4 = data.request) === null || _data$request4 === void 0 ? void 0 : _data$request4.scopedVars) !== null && _data$request$scopedV4 !== void 0 ? _data$request$scopedV4 : {}, { + isPiPoint: true + })).then(function () { + ctrl.attributeChangeValue(attributes); + })["catch"](function (err) { + ctrl.error = err.message || 'Failed to issue metric query'; + ctrl.attributeChangeValue([]); + }); + } + /** + * Gets the webid of the current selected pi data server. + * + * @memberOf PIWebAPIQueryEditor + */ + + }, { + key: "getSelectedPIServer", + value: function getSelectedPIServer() { + var _this4 = this, + _this$piServer$0$valu; + + var webID = ''; + this.piServer.forEach(function (s) { + var parts = _this4.props.query.target.split(';'); + + if (parts.length >= 2) { + if (parts[0] === s.text) { + webID = s.WebId; + return; + } + } + }); + return this.piServer.length > 0 ? (_this$piServer$0$valu = this.piServer[0].value) === null || _this$piServer$0$valu === void 0 ? void 0 : _this$piServer$0$valu.webId : webID; + } + /** + * Queries PI Web API for child elements and attributes when the raw query text editor is changed. + * + * @memberOf PIWebAPIQueryEditor + */ + + }, { + key: "textEditorChanged", + value: function textEditorChanged() { + var _this5 = this; + + var _this$props6 = this.props, + query = _this$props6.query, + onChange = _this$props6.onChange; + var splitAttributes = query.target.split(';'); + var splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\') : []; + var segments = []; + var attributes = []; + + if (splitElements.length > 1 || splitElements.length === 1 && splitElements[0] !== '') { + // remove element hierarchy from attribute collection + splitAttributes.splice(0, 1); + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(splitElements, function (item, _) { + segments.push({ + label: item, + value: { + type: item.match(/\${\w+}/gi) ? 'template' : undefined, + value: item, + expandable: true + } + }); + }); + this.getElementSegments(splitElements.length + 1, segments).then(function (elements) { + if (elements.length > 0) { + segments.push({ + label: 'Select Element', + value: { + value: '-Select Element-' + } + }); + } + }); + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(splitAttributes, function (item, index) { + if (item !== '') { + attributes.push({ + label: item, + value: { + value: item, + expandable: false + } + }); + } + }); + this.updateArray(segments, attributes, this.state.summaries, query.isPiPoint, function () { + onChange(_extends({}, query, { + query: undefined, + rawQuery: false + })); + }); + } else { + segments = this.checkAfServer(); + this.updateArray(segments, this.state.attributes, this.state.summaries, query.isPiPoint, function () { + _this5.onChange(_extends({}, query, { + query: undefined, + rawQuery: false, + attributes: _this5.state.attributes, + segments: _this5.state.segments + })); + }); + } + } + /** + * Check if the AF server and database are configured in the datasoure config. + * + * @returns the segments array + * + * @memberOf PIWebAPIQueryEditor + */ + + }, { + key: "render", + value: function render() { + var _this6 = this; + + var _this$props7 = this.props, + queryProps = _this$props7.query, + _onChange = _this$props7.onChange, + onRunQuery = _this$props7.onRunQuery; + var metricsQuery = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.defaults)(queryProps, _types__WEBPACK_IMPORTED_MODULE_4__.defaultQuery); + var interpolate = metricsQuery.interpolate, + query = metricsQuery.query, + rawQuery = metricsQuery.rawQuery, + digitalStates = metricsQuery.digitalStates, + recordedValues = metricsQuery.recordedValues, + expression = metricsQuery.expression, + isPiPoint = metricsQuery.isPiPoint, + summary = metricsQuery.summary, + display = metricsQuery.display, + regex = metricsQuery.regex; + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Is Pi Point?", + labelWidth: LABEL_WIDTH + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineSwitch, { + value: isPiPoint, + onChange: this.onIsPiPointChange + })), !!rawQuery && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineFieldRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Raw Query", + labelWidth: LABEL_WIDTH, + grow: true + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { + onBlur: this.stateCallback, + value: query, + onChange: function onChange(event) { + return _onChange(_extends({}, metricsQuery, { + query: event.target.value + })); + }, + placeholder: "enter query" + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(components_QueryEditorModeSwitcher__WEBPACK_IMPORTED_MODULE_5__.QueryEditorModeSwitcher, { + isRaw: true, + onChange: function onChange(value) { + return _this6.textEditorChanged(); + } + })), !rawQuery && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { + className: "gf-form-inline" + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_Forms__WEBPACK_IMPORTED_MODULE_3__.QueryRawInlineField, { + label: isPiPoint ? 'PI Server' : 'AF Elements', + tooltip: isPiPoint ? 'Select PI server.' : 'Select AF Element.' + }, this.state.segments.map(function (segment, index) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.SegmentAsync, { + key: 'element-' + index, + Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { + value: segment.value, + label: segment.label + }), + onChange: function onChange(item) { + return _this6.onSegmentChange(item, index); + }, + loadOptions: function loadOptions(query) { + return _this6.getElementSegments(index); + }, + allowCustomValue: true, + inputMinWidth: MIN_ELEM_INPUT_WIDTH + }); + }), _QueryRowTerminator || (_QueryRowTerminator = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_Forms__WEBPACK_IMPORTED_MODULE_3__.QueryRowTerminator, null)), !isPiPoint && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(components_QueryEditorModeSwitcher__WEBPACK_IMPORTED_MODULE_5__.QueryEditorModeSwitcher, { + isRaw: false, + onChange: function onChange(value) { + _onChange(_extends({}, metricsQuery, { + query: metricsQuery.target, + rawQuery: value + })); + } + }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_Forms__WEBPACK_IMPORTED_MODULE_3__.QueryInlineField, { + label: isPiPoint ? 'Pi Points' : 'Attributes' + }, this.state.attributes.map(function (attribute, index) { + if (isPiPoint) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.SegmentAsync, { + key: 'attributes-' + index, + Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { + value: attribute.value, + label: attribute.label + }), + disabled: _this6.piServer.length === 0, + onChange: function onChange(item) { + return _this6.onPiPointChange(item, index); + }, + loadOptions: _this6.getAttributeSegmentsPI, + reloadOptionsOnChange: true, + allowCustomValue: true, + inputMinWidth: MIN_ATTR_INPUT_WIDTH + }); + } + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Segment, { + key: 'attributes-' + index, + Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { + value: attribute.value, + label: attribute.label + }), + disabled: _this6.state.segments.length <= 2, + onChange: function onChange(item) { + return _this6.onAttributeChange(item, index); + }, + options: _this6.getAttributeSegmentsAF(), + allowCustomValue: true, + inputMinWidth: MIN_ATTR_INPUT_WIDTH + }); + }), isPiPoint && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.SegmentAsync, { + Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { + value: this.state.attributeSegment.value, + label: this.state.attributeSegment.label + }), + disabled: this.piServer.length === 0, + onChange: this.onAttributeAction, + loadOptions: this.getAttributeSegmentsPI, + reloadOptionsOnChange: true, + allowCustomValue: true, + inputMinWidth: MIN_ATTR_INPUT_WIDTH + }), !isPiPoint && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Segment, { + Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { + value: this.state.attributeSegment.value, + label: this.state.attributeSegment.label + }), + disabled: this.state.segments.length <= 2, + onChange: this.onAttributeAction, + options: this.getAttributeSegmentsAF(), + allowCustomValue: true, + inputMinWidth: MIN_ATTR_INPUT_WIDTH + }))), !isPiPoint && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Calculation", + labelWidth: LABEL_WIDTH, + tooltip: "Modify all attributes by an equation. Use '.' for current item. Leave Attributes empty if you wish to perform element based calculations." + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { + onBlur: onRunQuery, + value: expression, + onChange: function onChange(event) { + return _this6.onChange(_extends({}, metricsQuery, { + expression: event.target.value + })); + }, + placeholder: "'.'*2" + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineFieldRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Max Recorded Values", + labelWidth: LABEL_WIDTH, + tooltip: 'Maximum number of recorded value to retrive from the data archive, without using interpolation.' + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { + onBlur: onRunQuery, + value: recordedValues.maxNumber, + onChange: function onChange(event) { + return _this6.onChange(_extends({}, metricsQuery, { + recordedValues: _extends({}, recordedValues, { + maxNumber: parseInt(event.target.value, 10) + }) + })); + }, + type: "number", + placeholder: "1000" + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Recorded Values", + labelWidth: LABEL_WIDTH + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineSwitch, { + value: recordedValues.enable, + onChange: function onChange() { + return _this6.onChange(_extends({}, metricsQuery, { + recordedValues: _extends({}, recordedValues, { + enable: !recordedValues.enable + }) + })); + } + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Digital States", + labelWidth: LABEL_WIDTH + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineSwitch, { + value: digitalStates.enable, + onChange: function onChange() { + return _this6.onChange(_extends({}, metricsQuery, { + digitalStates: _extends({}, digitalStates, { + enable: !digitalStates.enable + }) + })); + } + }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineFieldRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Interpolate Period", + labelWidth: LABEL_WIDTH, + tooltip: "Override time between sampling, e.g. '30s'. Defaults to timespan/chart width." + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { + onBlur: onRunQuery, + value: interpolate.interval, + onChange: function onChange(event) { + return _this6.onChange(_extends({}, metricsQuery, { + interpolate: _extends({}, interpolate, { + interval: event.target.value + }) + })); + }, + placeholder: "30s" + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Interpolate", + labelWidth: LABEL_WIDTH + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineSwitch, { + value: interpolate.enable, + onChange: function onChange() { + return _this6.onChange(_extends({}, metricsQuery, { + interpolate: _extends({}, interpolate, { + enable: !interpolate.enable + }) + })); + } + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Replace Bad Data", + labelWidth: LABEL_WIDTH, + tooltip: 'Replacement for bad quality values.' + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Segment, { + Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { + value: { + value: summary.nodata + }, + label: summary.nodata + }), + onChange: this.calcNoDataValueChanged, + options: this.getNoDataSegments(), + allowCustomValue: true + }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineFieldRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Summary Period", + labelWidth: LABEL_WIDTH, + tooltip: "Override time between sampling, e.g. '30s'." + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { + onBlur: onRunQuery, + value: summary.interval, + onChange: function onChange(event) { + return _onChange(_extends({}, metricsQuery, { + summary: _extends({}, summary, { + interval: event.target.value + }) + })); + }, + placeholder: "30s" + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Basis", + labelWidth: LABEL_WIDTH, + tooltip: 'Defines the possible calculation options when performing summary calculations over time-series data.' + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Segment, { + Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { + value: { + value: summary.basis + }, + label: summary.basis + }), + onChange: this.calcBasisValueChanged, + options: this.getCalcBasisSegments(), + allowCustomValue: true + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Summaries", + labelWidth: LABEL_WIDTH, + tooltip: 'Replacement for bad quality values.' + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineFieldRow, null, this.state.summaries.map(function (s, index) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Segment, { + key: 'summaries-' + index, + Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { + value: s.value, + label: s.label + }), + onChange: function onChange(item) { + return _this6.onSummaryValueChanged(item, index); + }, + options: _this6.getSummarySegments(), + allowCustomValue: true + }); + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Segment, { + Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { + value: this.state.summarySegment.value, + label: this.state.summarySegment.label + }), + onChange: this.onSummaryAction, + options: this.getSummarySegments(), + allowCustomValue: true + })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineFieldRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Display Name", + labelWidth: LABEL_WIDTH, + tooltip: 'If single attribute, modify display name. Otherwise use regex to modify display name.' + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { + onBlur: onRunQuery, + value: display, + onChange: function onChange(event) { + return _this6.onChange(_extends({}, metricsQuery, { + display: event.target.value + })); + }, + placeholder: "Display" + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Enable Regex Replace", + labelWidth: LABEL_WIDTH + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineSwitch, { + value: regex.enable, + onChange: function onChange() { + _this6.onChange(_extends({}, metricsQuery, { + regex: _extends({}, regex, { + enable: !regex.enable + }) + })); + } + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Search", + labelWidth: LABEL_WIDTH - 8 + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { + onBlur: onRunQuery, + value: regex.search, + onChange: function onChange(event) { + return _this6.onChange(_extends({}, metricsQuery, { + regex: _extends({}, regex, { + search: event.target.value + }) + })); + }, + placeholder: "(.*)" + })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { + label: "Replace", + labelWidth: LABEL_WIDTH - 8 + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { + onBlur: onRunQuery, + value: regex.replace, + onChange: function onChange(event) { + return _this6.onChange(_extends({}, metricsQuery, { + regex: _extends({}, regex, { + replace: event.target.value + }) + })); + }, + placeholder: "$1" + })))); + } + }]); + + return PIWebAPIQueryEditor; +}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent); + +/***/ }), + +/***/ "./components/Forms.tsx": +/*!******************************!*\ + !*** ./components/Forms.tsx ***! + \******************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "QueryEditorRow": () => (/* binding */ QueryEditorRow), +/* harmony export */ "QueryField": () => (/* binding */ QueryField), +/* harmony export */ "QueryInlineField": () => (/* binding */ QueryInlineField), +/* harmony export */ "QueryRawEditorRow": () => (/* binding */ QueryRawEditorRow), +/* harmony export */ "QueryRawInlineField": () => (/* binding */ QueryRawInlineField), +/* harmony export */ "QueryRowTerminator": () => (/* binding */ QueryRowTerminator) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @grafana/ui */ "@grafana/ui"); +/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__); +var _div, _QueryRowTerminator; + +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + + + +var QueryField = function QueryField(_ref) { + var label = _ref.label, + _ref$labelWidth = _ref.labelWidth, + labelWidth = _ref$labelWidth === void 0 ? 12 : _ref$labelWidth, + tooltip = _ref.tooltip, + children = _ref.children; + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__.InlineFormLabel, { + width: labelWidth, + tooltip: tooltip + }, label), children); +}; +var QueryRowTerminator = function QueryRowTerminator() { + return _div || (_div = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + className: "gf-form gf-form--grow" + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + className: "gf-form-label gf-form-label--grow" + }))); +}; +var QueryInlineField = function QueryInlineField(_ref2) { + var props = _extends({}, _ref2); + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(QueryEditorRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(QueryField, props)); +}; +var QueryEditorRow = function QueryEditorRow(props) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + className: "gf-form-inline" + }, props.children, _QueryRowTerminator || (_QueryRowTerminator = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(QueryRowTerminator, null))); +}; +var QueryRawInlineField = function QueryRawInlineField(_ref3) { + var props = _extends({}, _ref3); + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(QueryRawEditorRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(QueryField, props)); +}; +var QueryRawEditorRow = function QueryRawEditorRow(props) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, props.children); +}; + +/***/ }), + +/***/ "./components/QueryEditorModeSwitcher.tsx": +/*!************************************************!*\ + !*** ./components/QueryEditorModeSwitcher.tsx ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "QueryEditorModeSwitcher": () => (/* binding */ QueryEditorModeSwitcher) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @grafana/ui */ "@grafana/ui"); +/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + +var QueryEditorModeSwitcher = function QueryEditorModeSwitcher(_ref) { + var isRaw = _ref.isRaw, + onChange = _ref.onChange; + + var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + isModalOpen = _useState2[0], + setModalOpen = _useState2[1]; + + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { + // if the isRaw changes, we hide the modal + setModalOpen(false); + }, [isRaw]); + + if (isRaw) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__.Button, { + "aria-label": "Switch to visual editor", + icon: "pen", + variant: "secondary", + type: "button", + onClick: function onClick() { + // we show the are-you-sure modal + setModalOpen(true); + } + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__.ConfirmModal, { + isOpen: isModalOpen, + title: "Switch to visual editor mode", + body: "Are you sure to switch to visual editor mode? You will lose the changes done in raw query mode.", + confirmText: "Yes, switch to editor mode", + dismissText: "No, stay in raw query mode", + onConfirm: function onConfirm() { + onChange(false); + }, + onDismiss: function onDismiss() { + setModalOpen(false); + } + })); + } else { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__.Button, { + "aria-label": "Switch to text editor", + icon: "pen", + variant: "secondary", + type: "button", + onClick: function onClick() { + onChange(true); + } + }); + } +}; + +/***/ }), + +/***/ "./datasource.ts": +/*!***********************!*\ + !*** ./datasource.ts ***! + \***********************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "PiWebAPIDatasource": () => (/* binding */ PiWebAPIDatasource) +/* harmony export */ }); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @grafana/data */ "@grafana/data"); +/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_grafana_data__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _grafana_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @grafana/runtime */ "@grafana/runtime"); +/* harmony import */ var _grafana_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_grafana_runtime__WEBPACK_IMPORTED_MODULE_2__); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } + +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + +var PiWebAPIDatasource = /*#__PURE__*/function (_DataSourceApi) { + _inherits(PiWebAPIDatasource, _DataSourceApi); + + var _super = _createSuper(PiWebAPIDatasource); + + function PiWebAPIDatasource(instanceSettings) { + var _instanceSettings$jso; + + var _this; + + _classCallCheck(this, PiWebAPIDatasource); + + _this = _super.call(this, instanceSettings); + + _defineProperty(_assertThisInitialized(_this), "piserver", void 0); + + _defineProperty(_assertThisInitialized(_this), "afserver", void 0); + + _defineProperty(_assertThisInitialized(_this), "afdatabase", void 0); + + _defineProperty(_assertThisInitialized(_this), "basicAuth", void 0); + + _defineProperty(_assertThisInitialized(_this), "withCredentials", void 0); + + _defineProperty(_assertThisInitialized(_this), "url", void 0); + + _defineProperty(_assertThisInitialized(_this), "name", void 0); + + _defineProperty(_assertThisInitialized(_this), "isProxy", false); + + _defineProperty(_assertThisInitialized(_this), "templateSrv", void 0); + + _defineProperty(_assertThisInitialized(_this), "backendSrv", void 0); + + _defineProperty(_assertThisInitialized(_this), "piwebapiurl", void 0); + + _defineProperty(_assertThisInitialized(_this), "webidCache", new Map()); + + _defineProperty(_assertThisInitialized(_this), "error", void 0); + + _this.basicAuth = instanceSettings.basicAuth; + _this.withCredentials = instanceSettings.withCredentials; + _this.url = instanceSettings.url; + _this.name = instanceSettings.name; + _this.templateSrv = (0,_grafana_runtime__WEBPACK_IMPORTED_MODULE_2__.getTemplateSrv)(); + _this.backendSrv = (0,_grafana_runtime__WEBPACK_IMPORTED_MODULE_2__.getBackendSrv)(); + _this.piwebapiurl = (_instanceSettings$jso = instanceSettings.jsonData.url) === null || _instanceSettings$jso === void 0 ? void 0 : _instanceSettings$jso.toString(); + _this.isProxy = /^http(s)?:\/\//.test(_this.url) || instanceSettings.jsonData.access === 'proxy'; + _this.piserver = { + name: (instanceSettings.jsonData || {}).piserver, + webid: undefined + }; + _this.afserver = { + name: (instanceSettings.jsonData || {}).afserver, + webid: undefined + }; + _this.afdatabase = { + name: (instanceSettings.jsonData || {}).afdatabase, + webid: undefined + }; + Promise.all([_this.getAssetServer(_this.afserver.name).then(function (result) { + return _this.afserver.webid = result.WebId; + }), _this.getDataServer(_this.piserver.name).then(function (result) { + return _this.piserver.webid = result.WebId; + }), _this.getDatabase(_this.afserver.name ? _this.afserver.name + '\\' + _this.afdatabase.name : undefined).then(function (result) { + return _this.afdatabase.webid = result.WebId; + })]); + return _this; + } + /** + * Converts a PIWebAPI Event Frame response to a Grafana Annotation + * + * @param {any} annotationOptions - Options data from configuration panel. + * @param {any} endTime - End time of the Event Frame. + * @param {any} eventFrame - The Event Frame data. + * @returns - Grafana Annotation + * + * @memberOf PiWebApiDatasource + */ + + + _createClass(PiWebAPIDatasource, [{ + key: "eventFrameToAnnotation", + value: function eventFrameToAnnotation(annotationOptions, endTime, eventFrame, attributeDataItems) { + if (annotationOptions.regex && annotationOptions.regex.enable) { + eventFrame.Name = eventFrame.Name.replace(new RegExp(annotationOptions.regex.search), annotationOptions.regex.replace); + } + + var attributeText = ''; + + if (attributeDataItems) { + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(attributeDataItems, function (attributeData) { + var attributeValue = attributeData.Value.Value ? attributeData.Value.Value.Name || attributeData.Value.Value.Value || attributeData.Value.Value : null; + attributeText += '
' + attributeData.Name + ': ' + attributeValue; + }); + } + + return { + annotation: annotationOptions, + title: (endTime ? 'END ' : annotationOptions.showEndTime ? 'START ' : '') + annotationOptions.name, + time: new Date(endTime ? eventFrame.EndTime : eventFrame.StartTime).getTime(), + text: eventFrame.Name + attributeText + '
Start: ' + eventFrame.StartTime + '
End: ' + eventFrame.EndTime + }; + } + /** + * Builds the PIWebAPI query parameters. + * + * @param {any} options - Grafana query and panel options. + * @returns - PIWebAPI query parameters. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "buildQueryParameters", + value: function buildQueryParameters(options) { + var _this2 = this; + + options.targets = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(options.targets, function (target) { + if (!target || !target.target) { + return false; + } + + return !target.target.startsWith('Select AF'); + }); + options.targets = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(options.targets, function (target) { + var ds = _this2; + var tar = { + target: _this2.templateSrv.replace(target.elementPath, options.scopedVars), + elementPath: _this2.templateSrv.replace(target.elementPath, options.scopedVars), + elementPathArray: [{ + path: _this2.templateSrv.replace(target.elementPath, options.scopedVars), + variable: '' + }], + attributes: (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(target.attributes, function (att) { + var _att$value; + + return _this2.templateSrv.replace(((_att$value = att.value) === null || _att$value === void 0 ? void 0 : _att$value.value) || att, options.scopedVars); + }), + segments: (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(target.segments, function (att) { + var _att$value2; + + return _this2.templateSrv.replace((_att$value2 = att.value) === null || _att$value2 === void 0 ? void 0 : _att$value2.value, options.scopedVars); + }), + display: target.display, + refId: target.refId, + hide: target.hide, + interpolate: target.interpolate || { + enable: false + }, + recordedValues: target.recordedValues || { + enable: false + }, + digitalStates: target.digitalStates || { + enable: false + }, + webid: target.webid, + webids: target.webids || [], + regex: target.regex || { + enable: false + }, + expression: target.expression || '', + summary: target.summary || { + types: [] + }, + startTime: options.range.from, + endTime: options.range.to, + isPiPoint: target.isPiPoint, + scopedVars: options.scopedVars + }; + + if (tar.expression) { + tar.expression = _this2.templateSrv.replace(tar.expression, options.scopedVars); + } + + if (tar.summary.types !== undefined) { + tar.summary.types = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(tar.summary.types, function (item) { + return item !== undefined && item !== null && item !== ''; + }); + } // explode All or Multi-selection + + + var varsKeys = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.keys)(options.scopedVars); + + _this2.templateSrv.getVariables().forEach(function (v) { + if (ds.isAllSelected(v.current) && varsKeys.indexOf(v.name) < 0) { + // All selection + var variables = v.options.filter(function (o) { + return !o.selected; + }); // attributes + + tar.attributes = tar.attributes.map(function (attr) { + return variables.map(function (vv) { + return !!v.allValue ? attr.replace(v.allValue, vv.value) : attr.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value); + }); + }); + tar.attributes = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.uniq)((0,lodash__WEBPACK_IMPORTED_MODULE_0__.flatten)(tar.attributes)); // elementPath + + tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, v.allValue); + } else if (Array.isArray(v.current.text) && varsKeys.indexOf(v.name) < 0) { + // Multi-selection + var _variables = v.options.filter(function (o) { + return o.selected; + }); // attributes + + + var query = v.current.value.join(','); + tar.attributes = tar.attributes.map(function (attr) { + return _variables.map(function (vv) { + return attr.replace("{".concat(query, "}"), vv.value); + }); + }); + tar.attributes = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.uniq)((0,lodash__WEBPACK_IMPORTED_MODULE_0__.flatten)(tar.attributes)); // elementPath + + tar.elementPathArray = ds.getElementPath(tar.elementPathArray, _variables, "{".concat(query, "}")); + } + }); + + console.log('tar', tar); + return tar; + }); + return options; + } + /** + * Datasource Implementation. Primary entry point for data source. + * This takes the panel configuration and queries, sends them to PI Web API and parses the response. + * + * @param {any} options - Grafana query and panel options. + * @returns - Promise of data in the format for Grafana panels. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "query", + value: function () { + var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) { + var ds, query; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + ds = this; + query = this.buildQueryParameters(options); + query.targets = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(query.targets, function (t) { + return !t.hide; + }); + + if (!(query.targets.length <= 0)) { + _context.next = 7; + break; + } + + return _context.abrupt("return", Promise.resolve({ + data: [] + })); + + case 7: + return _context.abrupt("return", Promise.all(ds.getStream(query)).then(function (targetResponses) { + var flattened = []; + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(targetResponses, function (tr) { + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(tr, function (item) { + return flattened.push(item); + }); + }); + var response = { + data: flattened.sort(function (a, b) { + return +(a.target > b.target) || +(a.target === b.target) - 1; + }).map(function (d) { + return (0,_grafana_data__WEBPACK_IMPORTED_MODULE_1__.toDataFrame)(d); + }) + }; + return response; + })); + + case 8: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + + function query(_x) { + return _query.apply(this, arguments); + } + + return query; + }() + /** + * Datasource Implementation. + * Used for testing datasource in datasource configuration pange + * + * @returns - Success or failure message. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "testDatasource", + value: function testDatasource() { + return this.backendSrv.datasourceRequest({ + url: this.url + '/', + method: 'GET' + }).then(function (response) { + if (response.status === 200) { + return { + status: 'success', + message: 'Data source is working', + title: 'Success' + }; + } + + throw new Error('Failed'); + }); + } + /** + * Datasource Implementation. + * This queries PI Web API for Event Frames and converts them into annotations. + * + * @param {any} options - Annotation options, usually the Event Frame Category. + * @returns - A Grafana annotation. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "annotationQuery", + value: function annotationQuery(options) { + var _this3 = this; + + if (!this.afdatabase.webid) { + return Promise.resolve([]); + } + + var categoryName = options.annotation.query.categoryName ? this.templateSrv.replace(options.annotation.query.categoryName, options.scopedVars, 'glob') : null; + var nameFilter = options.annotation.query.nameFilter ? this.templateSrv.replace(options.annotation.query.nameFilter, options.scopedVars, 'glob') : null; + var templateName = options.annotation.template ? options.annotation.template.Name : null; + var annotationOptions = { + name: options.annotation.name, + datasource: options.annotation.datasource, + enable: options.annotation.enable, + iconColor: options.annotation.iconColor, + showEndTime: options.annotation.showEndTime, + regex: options.annotation.regex, + attribute: options.annotation.attribute, + categoryName: categoryName, + templateName: templateName, + nameFilter: nameFilter + }; + var filter = []; + + if (!!annotationOptions.categoryName) { + filter.push('categoryName=' + annotationOptions.categoryName); + } + + if (!!annotationOptions.nameFilter) { + filter.push('nameFilter=' + annotationOptions.nameFilter); + } + + if (!!annotationOptions.templateName) { + filter.push('templateName=' + annotationOptions.templateName); + } + + if (!filter.length) { + return Promise.resolve([]); + } + + filter.push('startTime=' + options.range.from.toJSON()); + filter.push('endTime=' + options.range.to.toJSON()); + + if (annotationOptions.attribute && annotationOptions.attribute.enable) { + var resourceUrl = this.piwebapiurl + '/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name'; + + if (!!annotationOptions.attribute.name) { + resourceUrl = this.piwebapiurl + '/streamsets/{0}/value?nameFilter=' + annotationOptions.attribute.name + '&selectedFields=Items.WebId%3BItems.Value%3BItems.Name'; + } + + var query = {}; + query['1'] = { + Method: 'GET', + Resource: this.piwebapiurl + '/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&') + }; + query['2'] = { + Method: 'GET', + RequestTemplate: { + Resource: resourceUrl + }, + Parameters: ['$.1.Content.Items[*].WebId'], + ParentIds: ['1'] + }; + return this.restBatch(query).then(function (result) { + var data = result.data['1'].Content; + var valueData = result.data['2'].Content; + var annotations = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(data.Items, function (item, index) { + return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.curry)(_this3.eventFrameToAnnotation)(annotationOptions, false, item, valueData.Items[index].Content.Items); + }); + + if (options.annotation.showEndTime) { + var ends = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(data.Items, function (item, index) { + return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.curry)(_this3.eventFrameToAnnotation)(annotationOptions, true, item, valueData.Items[index].Content.Items); + }); + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(ends, function (end) { + annotations.push(end); + }); + } + + return annotations; + }); + } else { + return this.restGet('/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&')).then(function (result) { + var annotations = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(result.data.Items, (0,lodash__WEBPACK_IMPORTED_MODULE_0__.curry)(_this3.eventFrameToAnnotation)(annotationOptions, false)); + + if (options.annotation.showEndTime) { + var ends = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(result.data.Items, (0,lodash__WEBPACK_IMPORTED_MODULE_0__.curry)(_this3.eventFrameToAnnotation)(annotationOptions, true)); + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(ends, function (end) { + annotations.push(end); + }); + } + + return annotations; + }); + } + } + /** + * Builds the Grafana metric segment for use on the query user interface. + * + * @param {any} response - response from PI Web API. + * @returns - Grafana metric segment. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "metricQueryTransform", + value: function metricQueryTransform(response) { + return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(response, function (item) { + var _item$Path, _item$Items; + + return { + text: item.Name, + expandable: item.HasChildren === undefined || item.HasChildren === true || ((_item$Path = item.Path) !== null && _item$Path !== void 0 ? _item$Path : '').split('\\').length <= 3, + HasChildren: item.HasChildren, + Items: (_item$Items = item.Items) !== null && _item$Items !== void 0 ? _item$Items : [], + Path: item.Path, + WebId: item.WebId + }; + }); + } + /** + * This method does the discovery of the AF Hierarchy and populates the query user interface segments. + * + * @param {any} query - Parses the query configuration and builds a PI Web API query. + * @returns - Segment information. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "metricFindQuery", + value: function metricFindQuery(query, queryOptions) { + var _query$filter; + + var ds = this; + var querydepth = ['servers', 'databases', 'databaseElements', 'elements']; + + if (typeof query === 'string') { + query = JSON.parse(query); + } + + if (queryOptions.isPiPoint) { + query.path = this.templateSrv.replace(query.path, queryOptions); + } else { + if (query.path === '') { + query.type = querydepth[0]; + } else if (query.type !== 'attributes') { + query.type = querydepth[Math.max(0, Math.min(query.path.split('\\').length, querydepth.length - 1))]; + } + + query.path = this.templateSrv.replace(query.path, queryOptions); + query.path = query.path.replace(/\{([^\\])*\}/gi, function (r) { + return r.substring(1, r.length - 2).split(',')[0]; + }); + } + + query.filter = (_query$filter = query.filter) !== null && _query$filter !== void 0 ? _query$filter : '*'; + + if (query.type === 'servers') { + var _ds$afserver; + + return (_ds$afserver = ds.afserver) !== null && _ds$afserver !== void 0 && _ds$afserver.name ? ds.getAssetServer(ds.afserver.name).then(function (result) { + return [result]; + }).then(ds.metricQueryTransform) : ds.getAssetServers().then(ds.metricQueryTransform); + } else if (query.type === 'databases') { + return ds.getAssetServer(query.path).then(function (server) { + var _server$WebId; + + return ds.getDatabases((_server$WebId = server.WebId) !== null && _server$WebId !== void 0 ? _server$WebId : '', {}); + }).then(ds.metricQueryTransform); + } else if (query.type === 'databaseElements') { + return ds.getDatabase(query.path).then(function (db) { + var _db$WebId; + + return ds.getDatabaseElements((_db$WebId = db.WebId) !== null && _db$WebId !== void 0 ? _db$WebId : '', { + selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren' + }); + }).then(ds.metricQueryTransform); + } else if (query.type === 'elements') { + return ds.getElement(query.path).then(function (element) { + var _element$WebId; + + return ds.getElements((_element$WebId = element.WebId) !== null && _element$WebId !== void 0 ? _element$WebId : '', { + selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren', + nameFilter: query.filter + }); + }).then(ds.metricQueryTransform); + } else if (query.type === 'attributes') { + return ds.getElement(query.path).then(function (element) { + var _element$WebId2; + + return ds.getAttributes((_element$WebId2 = element.WebId) !== null && _element$WebId2 !== void 0 ? _element$WebId2 : '', { + searchFullHierarchy: 'true', + selectedFields: 'Items.WebId%3BItems.Name%3BItems.Path', + nameFilter: query.filter + }); + }).then(ds.metricQueryTransform); + } else if (query.type === 'dataserver') { + return ds.getDataServers().then(ds.metricQueryTransform); + } else if (query.type === 'pipoint') { + return ds.piPointSearch(query.webId, query.pointName).then(ds.metricQueryTransform); + } + + return Promise.reject('Bad type'); + } + /** + * Gets the url of summary data from the query configuration. + * + * @param {any} summary - Query summary configuration. + * @returns - URL append string. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "getSummaryUrl", + value: function getSummaryUrl(summary) { + if (summary.interval.trim() === '') { + return '&summaryType=' + summary.types.map(function (s) { + var _s$value; + + return (_s$value = s.value) === null || _s$value === void 0 ? void 0 : _s$value.value; + }).join('&summaryType=') + '&calculationBasis=' + summary.basis; + } + + return '&summaryType=' + summary.types.map(function (s) { + var _s$value2; + + return (_s$value2 = s.value) === null || _s$value2 === void 0 ? void 0 : _s$value2.value; + }).join('&summaryType=') + '&calculationBasis=' + summary.basis + '&summaryDuration=' + summary.interval.trim(); + } + /** + * Resolve PIWebAPI response 'value' data to value - timestamp pairs. + * + * @param {any} value - A list of PIWebAPI values. + * @param {any} target - The target Grafana metric. + * @param {any} isSummary - Boolean for tracking if data is of summary class. + * @returns - An array of Grafana value, timestamp pairs. + * + */ + + }, { + key: "parsePiPointValueList", + value: function parsePiPointValueList(value, target, isSummary) { + var _this4 = this; + + var api = this; + var datapoints = []; + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(value, function (item) { + // @ts-ignore + var _this4$noDataReplace = _this4.noDataReplace(isSummary ? item.Value : item, target.summary.nodata, api.parsePiPointValue(isSummary ? item.Value : item, target, isSummary)), + grafanaDataPoint = _this4$noDataReplace.grafanaDataPoint, + previousValue = _this4$noDataReplace.previousValue, + drop = _this4$noDataReplace.drop; + + if (!drop) { + datapoints.push(grafanaDataPoint); + } + }); + return datapoints; + } + /** + * Convert a PI Point value to use Grafana value/timestamp. + * + * @param {any} value - PI Point value. + * @param {any} isSummary - Boolean for tracking if data is of summary class. + * @param {any} target - The target grafana metric. + * @returns - Grafana value pair. + * + */ + + }, { + key: "parsePiPointValue", + value: function parsePiPointValue(value, target, isSummary) { + var _value$Value, _target$digitalStates; + + var num = !isSummary && _typeof(value.Value) === 'object' ? (_value$Value = value.Value) === null || _value$Value === void 0 ? void 0 : _value$Value.Value : value.Value; + + if (!value.Good || !!((_target$digitalStates = target.digitalStates) !== null && _target$digitalStates !== void 0 && _target$digitalStates.enable)) { + var _ref, _value$Value2; + + num = (_ref = !isSummary && _typeof(value.Value) === 'object' ? (_value$Value2 = value.Value) === null || _value$Value2 === void 0 ? void 0 : _value$Value2.Name : value.Name) !== null && _ref !== void 0 ? _ref : ''; + return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()]; + } + + return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()]; + } + /** + * Resolve PIWebAPI response 'value' data to value - timestamp pairs. + * + * @param {any} item - 'Item' object from PIWebAPI + * @param {any} noDataReplacementMode - String state of how to replace 'No Data' + * @param {any} grafanaDataPoint - Single Grafana value pair (value, timestamp). + * @returns grafanaDataPoint - Single Grafana value pair (value, timestamp). + * @returns perviousValue - {any} Grafana value (value only). + * + */ + + }, { + key: "noDataReplace", + value: function noDataReplace(item, noDataReplacementMode, grafanaDataPoint) { + var _item$Value, _item$Value2; + + var previousValue = null; + var drop = false; + + if (!item.Good || item.Value === 'No Data' || (_item$Value = item.Value) !== null && _item$Value !== void 0 && _item$Value.Name && ((_item$Value2 = item.Value) === null || _item$Value2 === void 0 ? void 0 : _item$Value2.Name) === 'No Data') { + if (noDataReplacementMode === 'Drop') { + drop = true; + } else if (noDataReplacementMode === '0') { + grafanaDataPoint[0] = 0; + } else if (noDataReplacementMode === 'Keep') {// Do nothing keep + } else if (noDataReplacementMode === 'Null') { + grafanaDataPoint[0] = null; + } else if (noDataReplacementMode === 'Previous' && previousValue !== null) { + grafanaDataPoint[0] = previousValue; + } + } else { + previousValue = item.Value; + } + + return { + grafanaDataPoint: grafanaDataPoint, + previousValue: previousValue, + drop: drop + }; + } + /** + * Process the response from PI Web API for a single item. + * + * @param {any} content - Web response data. + * @param {any} target - The target grafana metric. + * @param {any} name - The target metric name. + * @returns - Parsed metric in target/datapoint json format. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "processResults", + value: function processResults(content, target, name, noTemplate) { + var api = this; + var isSummary = target.summary && target.summary.types && target.summary.types.length > 0; + name = noTemplate ? name : this.getPath(target.elementPathArray, content.Path) + '|' + name; + + if (target.regex && target.regex.enable && target.regex.search.length && target.regex.replace.length) { + name = name.replace(new RegExp(target.regex.search), target.regex.replace); + } + + if (isSummary) { + var innerResults = []; + var groups = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.groupBy)(content.Items, function (item) { + return item.Type; + }); + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.forOwn)(groups, function (value, key) { + innerResults.push({ + refId: target.refId, + target: name + '[' + key + ']', + datapoints: api.parsePiPointValueList(value, target, isSummary) + }); + }); + return innerResults; + } + + return [{ + refId: target.refId, + target: name, + datapoints: api.parsePiPointValueList(content.Items, target, isSummary) + }]; + } + /** PRIVATE SECTION */ + + /** + * Check if all items are selected. + * + * @param {any} current the current variable selection + * @return {boolean} true if all value is selected, false otherwise + */ + + }, { + key: "isAllSelected", + value: function isAllSelected(current) { + if (!current) { + return false; + } + + if (Array.isArray(current.text)) { + return current.text.indexOf('All') >= 0; + } + + return current.text === 'All'; + } + /** + * Check if the value is a number. + * + * @param {any} number the value to check + * @returns {boolean} true if the value is a number, false otherwise + */ + + }, { + key: "checkNumber", + value: function checkNumber(number) { + return typeof number === 'number' && !Number.isNaN(number) && Number.isFinite(number); + } + /** + * Returns a new element path list based on the panel variables. + * + * @param {string} elementPathArray array of element paths + * @param {string} variables the list of variable values + * @param {string} allValue the all value value for the variable + * @returns {PiwebapiElementPath[]} new element path list + */ + + }, { + key: "getElementPath", + value: function getElementPath(elementPathArray, variables, allValue) { + // elementPath + var newElementPathArray = []; + elementPathArray.forEach(function (elem) { + if (!!allValue && elem.path.indexOf(allValue) >= 0 || !allValue && elem.path.match(/{[a-zA-z0-9,-_]+}/gi)) { + var temp = variables.map(function (vv) { + return { + path: !!allValue ? elem.path.replace(allValue, vv.value) : elem.path.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value), + variable: vv.value + }; + }); + newElementPathArray = newElementPathArray.concat(temp); + } + }); + + if (newElementPathArray.length) { + return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.uniq)((0,lodash__WEBPACK_IMPORTED_MODULE_0__.flatten)(newElementPathArray)); + } + + return elementPathArray; + } + /** + * Returns the last item of the element path. + * + * @param {string} path element path + * @returns {string} last item of the element path + */ + + }, { + key: "getPath", + value: function getPath(elementPathArray, path) { + var _splitPath$pop, _elementPathArray$fin; + + var splitPath = path.split('|'); + + if (splitPath.length === 0) { + return ''; + } + + if (elementPathArray.length === 0) { + return ''; + } + + splitPath = splitPath[0].split('\\'); + var splitStr = splitPath.length === 0 ? '' : (_splitPath$pop = splitPath.pop()) !== null && _splitPath$pop !== void 0 ? _splitPath$pop : ''; + var foundElement = (_elementPathArray$fin = elementPathArray.find(function (e) { + return path.indexOf(e.path) >= 0; + })) === null || _elementPathArray$fin === void 0 ? void 0 : _elementPathArray$fin.variable; + return foundElement ? foundElement + '|' + splitStr : splitStr; + } + /** + * Gets historical data from a PI Web API stream source. + * + * @param {any} query - Grafana query. + * @returns - Metric data. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "getStream", + value: function getStream(query) { + var _this5 = this; + + var ds = this; + var results = []; + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(query.targets, function (target) { + target.attributes = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(target.attributes || [], function (attribute) { + return true && attribute; + }); + var url = ''; + var isSummary = target.summary && target.summary.types && target.summary.types.length > 0; + var isInterpolated = target.interpolate && target.interpolate.enable; // perhaps add a check to see if interpolate override time < query.interval + + var intervalTime = target.interpolate.interval ? target.interpolate.interval : query.interval; + var timeRange = '?startTime=' + query.range.from.toJSON() + '&endTime=' + query.range.to.toJSON(); + var targetName = target.expression || target.elementPath; + var displayName = target.display ? _this5.templateSrv.replace(target.display, query.scopedVars) : null; + + if (target.expression) { + url += '/calculation'; + + if (isSummary) { + url += '/summary' + timeRange + (isInterpolated ? '&sampleType=Interval&sampleInterval=' + intervalTime : ''); + } else { + url += '/intervals' + timeRange + '&sampleInterval=' + intervalTime; + } + + url += '&expression=' + encodeURIComponent(target.expression); + + if (target.attributes.length > 0) { + results.push(ds.internalStream(query, target, url)); + } else { + results.push(ds.restGetWebId(target.elementPath, target.isPiPoint).then(function (webidresponse) { + return ds.restPost(url + webidresponse.WebId).then(function (response) { + return ds.processResults(response.data, target, displayName || targetName, false); + })["catch"](function (err) { + return ds.error = err; + }); + })); + } + } else { + url += '/streamsets'; + + if (isSummary) { + url += '/summary' + timeRange + '&intervals=' + query.maxDataPoints + _this5.getSummaryUrl(target.summary); + } else if (target.interpolate && target.interpolate.enable) { + url += '/interpolated' + timeRange + '&interval=' + intervalTime; + } else if (target.recordedValues && target.recordedValues.enable) { + var maxNumber = target.recordedValues.maxNumber && !isNaN(target.recordedValues.maxNumber) ? target.recordedValues.maxNumber : 1000; + url += '/recorded' + timeRange + '&maxCount=' + maxNumber; + } else { + url += '/plot' + timeRange + '&intervals=' + query.maxDataPoints; + } + + results.push(ds.internalStream(query, target, url)); + } + }); + return results; + } + /** + * Return the data points from the provided Grafana query. + * + * @param {any} query - Grafana query. + * @param {any} target - Grafana query target. + * @param {string} url - The base URL for the query. + * @returns - Metric data. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "internalStream", + value: function internalStream(query, target, url) { + var ds = this; + var targetName = target.expression || target.elementPath; + var displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null; + var noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path; + var promises; + + if (noTemplate) { + if (target.attributes.length > 1 && !target.isPiPoint) { + promises = ds.restGetWebId(target.elementPath, target.isPiPoint).then(function (datarsp) { + return ds.getAttributes(datarsp.WebId, { + searchFullHierarchy: 'true', + nameFilter: '*' + }); + }).then(function (datarspa) { + return datarspa.filter(function (d) { + var _d$Path; + + return target.attributes.indexOf(d.Name) >= 0 || target.attributes.indexOf((_d$Path = d.Path) === null || _d$Path === void 0 ? void 0 : _d$Path.split('|').splice(1).join('|')) >= 0; + }); + }); + } else { + promises = Promise.all((0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(target.attributes, function (attribute) { + return ds.restGetWebId(target.elementPath + '|' + attribute, target.isPiPoint); + })); + } + } else { + if (target.attributes.length > 1 && !target.isPiPoint) { + promises = Promise.all(target.elementPathArray.map(function (elementPath) { + return ds.restGetWebId(elementPath.path, target.isPiPoint).then(function (datarsp) { + return ds.getAttributes(datarsp.WebId, { + searchFullHierarchy: 'true', + nameFilter: '*' + }); + }).then(function (datarspa) { + return datarspa.filter(function (d) { + var _d$Path2; + + return target.attributes.indexOf(d.Name) >= 0 || target.attributes.indexOf((_d$Path2 = d.Path) === null || _d$Path2 === void 0 ? void 0 : _d$Path2.split('|').splice(1).join('|')) >= 0; + }); + }); + })); + } else { + promises = Promise.all((0,lodash__WEBPACK_IMPORTED_MODULE_0__.flatten)((0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(target.attributes, function (attribute) { + return target.elementPathArray.map(function (elementPath) { + return ds.restGetWebId(elementPath.path + '|' + attribute, target.isPiPoint); + }); + }))); + } + } + + return promises.then(function (webidresponse) { + var query = {}; + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)((0,lodash__WEBPACK_IMPORTED_MODULE_0__.flatten)(webidresponse), function (webid, index) { + query[index + 1] = { + Method: 'GET', + Resource: ds.piwebapiurl + url + '&webid=' + webid.WebId + }; + }); + return ds.restBatch(query).then(function (response) { + var targetResults = []; + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(response.data, function (value, key) { + if (target.expression) { + var attribute = webidresponse[parseInt(key, 10) - 1].Name; + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(ds.processResults(value.Content, target, displayName || attribute || targetName, noTemplate), function (targetResult) { + return targetResults.push(targetResult); + }); + } else { + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(value.Content.Items, function (item) { + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(ds.processResults(item, target, displayName || item.Name || targetName, noTemplate), function (targetResult) { + return targetResults.push(targetResult); + }); + }); + } + }); + return targetResults; + })["catch"](function (err) { + return ds.error = err; + }); + }); + } + /** + * Abstraction for calling the PI Web API REST endpoint + * + * @param {any} path - the path to append to the base server URL. + * @returns - The full URL. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "restGet", + value: function restGet(path) { + return this.backendSrv.datasourceRequest({ + url: this.url + path, + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(function (response) { + return response; + }); + } + /** + * Resolve a Grafana query into a PI Web API webid. Uses client side cache when possible to reduce lookups. + * + * @param {string} assetPath - The AF Path or the Pi Point Path (\\ServerName\piPointName) to the asset. + * @param {boolean} isPiPoint - Flag indicating it's a PI Point + * @returns - URL query parameters. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "restGetWebId", + value: function restGetWebId(assetPath, isPiPoint) { + var ds = this; // check cache + + var cachedWebId = ds.webidCache.get(assetPath); + + if (cachedWebId) { + return Promise.resolve({ + Path: assetPath, + WebId: cachedWebId.WebId, + Name: cachedWebId.Name + }); + } + + var path = ''; + + if (isPiPoint) { + path = '/points?selectedFields=WebId%3BName%3BPath&path=\\\\' + assetPath.replace('|', '\\'); + } else { + // no cache hit, query server + path = (assetPath.indexOf('|') >= 0 ? '/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\' : '/elements?selectedFields=WebId%3BName%3BPath&path=\\\\') + assetPath; + } + + return this.backendSrv.datasourceRequest({ + url: this.url + path, + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(function (response) { + ds.webidCache.set(assetPath, response.data); + return { + Path: assetPath, + WebId: response.data.WebId, + Name: response.data.Name + }; + }); + } + /** + * Execute a batch query on the PI Web API. + * + * @param {any} batch - Batch JSON query data. + * @returns - Batch response. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "restBatch", + value: function restBatch(batch) { + return this.backendSrv.datasourceRequest({ + url: this.url + '/batch', + data: batch, + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-Requested-With': 'message/http' + } + }); + } + /** + * Execute a POST on the PI Web API. + * + * @param {string} path - The full url of the POST. + * @returns - POST response data. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "restPost", + value: function restPost(path) { + return this.backendSrv.datasourceRequest({ + url: this.url, + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-Requested-With': 'message/http', + 'X-PIWEBAPI-HTTP-METHOD': 'GET', + 'X-PIWEBAPI-RESOURCE-ADDRESS': path + } + }); + } // Get a list of all data (PI) servers + + }, { + key: "getDataServers", + value: function getDataServers() { + return this.restGet('/dataservers').then(function (response) { + var _response$data$Items; + + return (_response$data$Items = response.data.Items) !== null && _response$data$Items !== void 0 ? _response$data$Items : []; + }); + } + }, { + key: "getDataServer", + value: function getDataServer(name) { + if (!name) { + return Promise.resolve({}); + } + + return this.restGet('/dataservers?name=' + name).then(function (response) { + return response.data; + }); + } // Get a list of all asset (AF) servers + + }, { + key: "getAssetServers", + value: function getAssetServers() { + return this.restGet('/assetservers').then(function (response) { + var _response$data$Items2; + + return (_response$data$Items2 = response.data.Items) !== null && _response$data$Items2 !== void 0 ? _response$data$Items2 : []; + }); + } + }, { + key: "getAssetServer", + value: function getAssetServer(name) { + if (!name) { + return Promise.resolve({}); + } + + return this.restGet('/assetservers?path=\\\\' + name).then(function (response) { + return response.data; + }); + } + }, { + key: "getDatabase", + value: function getDatabase(path) { + if (!path) { + return Promise.resolve({}); + } + + return this.restGet('/assetdatabases?path=\\\\' + path).then(function (response) { + return response.data; + }); + } + }, { + key: "getDatabases", + value: function getDatabases(serverId, options) { + if (!serverId) { + return Promise.resolve([]); + } + + return this.restGet('/assetservers/' + serverId + '/assetdatabases').then(function (response) { + var _response$data$Items3; + + return (_response$data$Items3 = response.data.Items) !== null && _response$data$Items3 !== void 0 ? _response$data$Items3 : []; + }); + } + }, { + key: "getElement", + value: function getElement(path) { + if (!path) { + return Promise.resolve({}); + } + + return this.restGet('/elements?path=\\\\' + path).then(function (response) { + return response.data; + }); + } + }, { + key: "getEventFrameTemplates", + value: function getEventFrameTemplates(databaseId) { + if (!databaseId) { + return Promise.resolve([]); + } + + return this.restGet('/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId').then(function (response) { + var _response$data$Items4; + + return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)((_response$data$Items4 = response.data.Items) !== null && _response$data$Items4 !== void 0 ? _response$data$Items4 : [], function (item) { + return item.InstanceType === 'EventFrame'; + }); + }); + } + }, { + key: "getElementTemplates", + value: function getElementTemplates(databaseId) { + if (!databaseId) { + return Promise.resolve([]); + } + + return this.restGet('/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId').then(function (response) { + var _response$data$Items5; + + return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)((_response$data$Items5 = response.data.Items) !== null && _response$data$Items5 !== void 0 ? _response$data$Items5 : [], function (item) { + return item.InstanceType === 'Element'; + }); + }); + } + /** + * @description + * Get the child attributes of the current resource. + * GET attributes/{webId}/attributes + * @param {string} elementId - The ID of the parent resource. See WebID for more information. + * @param {Object} options - Query Options + * @param {string} options.nameFilter - The name query string used for finding attributes. The default is no filter. See Query String for more information. + * @param {string} options.categoryName - Specify that returned attributes must have this category. The default is no category filter. + * @param {string} options.templateName - Specify that returned attributes must be members of this template. The default is no template filter. + * @param {string} options.valueType - Specify that returned attributes' value type must be the given value type. The default is no value type filter. + * @param {string} options.searchFullHierarchy - Specifies if the search should include attributes nested further than the immediate attributes of the searchRoot. The default is 'false'. + * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'. + * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'. + * @param {string} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0. + * @param {string} options.showExcluded - Specified if the search should include attributes with the Excluded property set. The default is 'false'. + * @param {string} options.showHidden - Specified if the search should include attributes with the Hidden property set. The default is 'false'. + * @param {string} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000. + * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information. + */ + + }, { + key: "getAttributes", + value: function getAttributes(elementId, options) { + var querystring = '?' + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(options, function (value, key) { + return key + '=' + value; + }).join('&'); + + if (querystring === '?') { + querystring = ''; + } + + return this.restGet('/elements/' + elementId + '/attributes' + querystring).then(function (response) { + var _response$data$Items6; + + return (_response$data$Items6 = response.data.Items) !== null && _response$data$Items6 !== void 0 ? _response$data$Items6 : []; + }); + } + /** + * @description + * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource. + * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search. + * GET assetdatabases/{webId}/elements + * @param {string} databaseId - The ID of the parent resource. See WebID for more information. + * @param {Object} options - Query Options + * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information. + * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information. + * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter. + * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter. + * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information. + * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'. + * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'. + * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'. + * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0. + * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000. + * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information. + */ + + }, { + key: "getDatabaseElements", + value: function getDatabaseElements(databaseId, options) { + var querystring = '?' + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(options, function (value, key) { + return key + '=' + value; + }).join('&'); + + if (querystring === '?') { + querystring = ''; + } + + return this.restGet('/assetdatabases/' + databaseId + '/elements' + querystring).then(function (response) { + var _response$data$Items7; + + return (_response$data$Items7 = response.data.Items) !== null && _response$data$Items7 !== void 0 ? _response$data$Items7 : []; + }); + } + /** + * @description + * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource. + * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search. + * GET elements/{webId}/elements + * @param {string} databaseId - The ID of the resource to use as the root of the search. See WebID for more information. + * @param {Object} options - Query Options + * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information. + * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information. + * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter. + * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter. + * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information. + * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'. + * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'. + * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'. + * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0. + * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000. + * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information. + */ + + }, { + key: "getElements", + value: function getElements(elementId, options) { + var querystring = '?' + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(options, function (value, key) { + return key + '=' + value; + }).join('&'); + + if (querystring === '?') { + querystring = ''; + } + + return this.restGet('/elements/' + elementId + '/elements' + querystring).then(function (response) { + var _response$data$Items8; + + return (_response$data$Items8 = response.data.Items) !== null && _response$data$Items8 !== void 0 ? _response$data$Items8 : []; + }); + } + /** + * Retrieve a list of points on a specified Data Server. + * + * @param {string} serverId - The ID of the server. See WebID for more information. + * @param {string} nameFilter - A query string for filtering by point name. The default is no filter. *, ?, [ab], [!ab] + */ + + }, { + key: "piPointSearch", + value: function piPointSearch(serverId, nameFilter) { + var filter1 = this.templateSrv.replace(nameFilter); + var filter2 = "".concat(filter1); + var doFilter = false; + + if (filter1 !== nameFilter) { + var regex = /\{(\w|,)+\}/g; + var m; + + while ((m = regex.exec(filter1)) !== null) { + // This is necessary to avoid infinite loops with zero-width matches + if (m.index === regex.lastIndex) { + regex.lastIndex++; + } // The result can be accessed through the `m`-variable. + + + m.forEach(function (match, groupIndex) { + if (groupIndex === 0) { + filter1 = filter1.replace(match, match.replace('{', '(').replace('}', ')').replace(',', '|')); + filter2 = filter2.replace(match, '*'); + doFilter = true; + } + }); + } + } + + return this.restGet('/dataservers/' + serverId + '/points?maxCount=20&nameFilter=' + filter2).then(function (results) { + var _results$data; + + if (!!results && !!((_results$data = results.data) !== null && _results$data !== void 0 && _results$data.Items)) { + return doFilter ? results.data.Items.filter(function (item) { + var _item$Name; + + return (_item$Name = item.Name) === null || _item$Name === void 0 ? void 0 : _item$Name.match(filter1); + }) : results.data.Items; + } + + return []; + }); + } + /** + * Get the PI Web API webid or PI Point. + * + * @param {any} target - AF Path or Point name. + * @returns - webid. + * + * @memberOf PiWebApiDatasource + */ + + }, { + key: "getWebId", + value: function getWebId(target) { + var ds = this; + var isAf = target.target.indexOf('\\') >= 0; + var isAttribute = target.target.indexOf('|') >= 0; + + if (!isAf && target.target.indexOf('.') === -1) { + return Promise.resolve([{ + WebId: target.target, + Name: target.display || target.target + }]); + } + + if (!isAf) { + // pi point lookup + return ds.piPointSearch(this.piserver.webid, target.target).then(function (results) { + if (results === undefined || results.length === 0) { + return [{ + WebId: target.target, + Name: target.display || target.target + }]; + } + + return results; + }); + } else if (isAf && isAttribute) { + // af attribute lookup + return ds.restGet('/attributes?path=\\\\' + target.target).then(function (results) { + if (results.data === undefined || results.status !== 200) { + return [{ + WebId: target.target, + Name: target.display || target.target + }]; + } // rewrite name if specified + + + results.data.Name = target.display || results.data.Name; + return [results.data]; + }); + } else { + // af element lookup + return ds.restGet('/elements?path=\\\\' + target.target).then(function (results) { + if (results.data === undefined || results.status !== 200) { + return [{ + WebId: target.target, + Name: target.display || target.target + }]; + } // rewrite name if specified + + + results.data.Name = target.display || results.data.Name; + return [results.data]; + }); + } + } + }]); + + return PiWebAPIDatasource; +}(_grafana_data__WEBPACK_IMPORTED_MODULE_1__.DataSourceApi); + +/***/ }), + +/***/ "./types.ts": +/*!******************!*\ + !*** ./types.ts ***! + \******************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "defaultQuery": () => (/* binding */ defaultQuery) +/* harmony export */ }); +var defaultQuery = { + target: ';', + attributes: [], + segments: [], + regex: { + enable: false + }, + summary: { + types: [], + basis: 'EventWeighted', + interval: '', + nodata: 'Null' + }, + expression: '', + interpolate: { + enable: false + }, + recordedValues: { + enable: false + }, + digitalStates: { + enable: false + }, + isPiPoint: false +}; +/** + * These are options configured for each DataSource instance + */ + +/***/ }), + +/***/ "@grafana/data": +/*!********************************!*\ + !*** external "@grafana/data" ***! + \********************************/ +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_data__; + +/***/ }), + +/***/ "@grafana/runtime": +/*!***********************************!*\ + !*** external "@grafana/runtime" ***! + \***********************************/ +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_runtime__; + +/***/ }), + +/***/ "@grafana/ui": +/*!******************************!*\ + !*** external "@grafana/ui" ***! + \******************************/ +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_ui__; + +/***/ }), + +/***/ "lodash": +/*!*************************!*\ + !*** external "lodash" ***! + \*************************/ +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_MODULE_lodash__; + +/***/ }), + +/***/ "react": +/*!************************!*\ + !*** external "react" ***! + \************************/ +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_MODULE_react__; + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { +/*!*******************!*\ + !*** ./module.ts ***! + \*******************/ +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "plugin": () => (/* binding */ plugin) +/* harmony export */ }); +/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @grafana/data */ "@grafana/data"); +/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_grafana_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _AnnotationsQueryCtrl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AnnotationsQueryCtrl */ "./AnnotationsQueryCtrl.ts"); +/* harmony import */ var _ConfigEditor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ConfigEditor */ "./ConfigEditor.tsx"); +/* harmony import */ var _QueryEditor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./QueryEditor */ "./QueryEditor.tsx"); +/* harmony import */ var _datasource__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./datasource */ "./datasource.ts"); + + + + + +var plugin = new _grafana_data__WEBPACK_IMPORTED_MODULE_0__.DataSourcePlugin(_datasource__WEBPACK_IMPORTED_MODULE_4__.PiWebAPIDatasource).setConfigEditor(_ConfigEditor__WEBPACK_IMPORTED_MODULE_2__.PIWebAPIConfigEditor).setQueryEditor(_QueryEditor__WEBPACK_IMPORTED_MODULE_3__.PIWebAPIQueryEditor).setAnnotationQueryCtrl(_AnnotationsQueryCtrl__WEBPACK_IMPORTED_MODULE_1__.AnnotationsQueryCtrl); +})(); + +/******/ return __webpack_exports__; +/******/ })() +; +});; //# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/dist/module.js.map b/dist/module.js.map index b8b375d..a74a832 100644 --- a/dist/module.js.map +++ b/dist/module.js.map @@ -1 +1 @@ -{"version":3,"file":"module.js","mappings":";uHAAAA,EAAOC,QAAUC,OCAjBF,EAAOC,QAAUE,OCAjBH,EAAOC,QAAUG,OCAjBJ,EAAOC,QAAUI,QCAjBL,EAAOC,QAAUK,ICCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C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@grafana/data\"","webpack:///external amd \"lodash\"","webpack:///external amd \"@grafana/runtime\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./AnnotationsQueryCtrl.ts","webpack:///./ConfigEditor.tsx","webpack:///./components/Forms.tsx","webpack:///./types.ts","webpack:///./components/QueryEditorModeSwitcher.tsx","webpack:///./QueryEditor.tsx","webpack:///./datasource.ts","webpack:///./module.ts"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export class AnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n\n $scope: any;\n annotation: any;\n datasource: any;\n\n /** @ngInject */\n constructor($scope: any) {\n this.$scope = $scope;\n this.annotation = $scope.ctrl.annotation;\n this.datasource = $scope.ctrl.datasource;\n\n // load defaults\n this.annotation.query = this.annotation.query || {};\n this.annotation.databases = this.annotation.databases || [];\n this.annotation.templates = this.annotation.templates || [];\n this.annotation.regex = this.annotation.regex || {};\n this.annotation.attribute = this.annotation.attribute || {};\n this.annotation.showEndTime = this.annotation.showEndTime || false;\n\n this.datasource.getAssetServer(this.datasource.afserver.name).then((result: any) => {\n return this.getDatabases(result.WebId);\n });\n }\n templateChanged() {\n // do nothing\n }\n databaseChanged() {\n this.annotation.templates = [];\n this.getEventFrames();\n }\n getDatabases(webid: string) {\n var ctrl = this;\n ctrl.datasource.getDatabases(webid).then((dbs: any) => {\n ctrl.annotation.databases = dbs;\n this.$scope.$apply();\n });\n }\n getEventFrames() {\n var ctrl = this;\n ctrl.datasource.getEventFrameTemplates(this.annotation.database.WebId).then((templates: any) => {\n ctrl.annotation.templates = templates;\n this.$scope.$apply();\n });\n }\n}\n","import React, { ChangeEvent, PureComponent } from 'react';\nimport { LegacyForms, DataSourceHttpSettings } from '@grafana/ui';\nimport { DataSourcePluginOptionsEditorProps, DataSourceJsonData, DataSourceSettings } from '@grafana/data';\nimport { PIWebAPIDataSourceJsonData } from './types';\n\nconst { FormField } = LegacyForms;\n\ninterface Props extends DataSourcePluginOptionsEditorProps {}\n\nconst coerceOptions = (\n options: DataSourceSettings\n): DataSourceSettings => {\n return {\n ...options,\n jsonData: {\n ...options.jsonData,\n url: options.url,\n },\n };\n};\n\ninterface State {}\n\nexport class PIWebAPIConfigEditor extends PureComponent {\n onPIServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n piserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFDatabaseChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afdatabase: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onMyOptionsChange = (options: DataSourceSettings) => {\n const { onOptionsChange } = this.props;\n onOptionsChange(coerceOptions(options));\n };\n\n render() {\n const { options: originalOptions } = this.props;\n const options = coerceOptions(originalOptions);\n\n return (\n
\n \n\n

PI/AF Connection Details

\n\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n );\n }\n}\n","import React, { InputHTMLAttributes, FunctionComponent } from 'react';\nimport { InlineFormLabel } from '@grafana/ui';\n\nexport interface Props extends InputHTMLAttributes {\n label: string;\n tooltip?: string;\n labelWidth?: number;\n children?: React.ReactNode;\n queryEditor?: JSX.Element;\n}\n\nexport const QueryField: FunctionComponent> = ({ label, labelWidth = 12, tooltip, children }) => (\n <>\n \n {label}\n \n {children}\n \n);\n\nexport const QueryRowTerminator = () => {\n return (\n
\n
\n
\n );\n};\n\nexport const QueryInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryEditorRow = (props: Partial) => {\n return (\n
\n {props.children}\n \n
\n );\n};\n\nexport const QueryRawInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryRawEditorRow = (props: Partial) => {\n return <>{props.children};\n};\n","import { DataQuery, DataSourceJsonData } from '@grafana/data';\n\nexport interface PIWebAPISelectableValue {\n webId?: string;\n value?: string;\n type?: string;\n expandable?: boolean;\n}\n\nexport interface PIWebAPIAnnotationsQuery extends DataQuery {\n target: string;\n}\n\nexport interface PIWebAPIQuery extends DataQuery {\n target: string;\n elementPath: string;\n attributes: any[];\n segments: any[];\n display: any;\n interpolate: any;\n recordedValues: any;\n digitalStates: any;\n webid: string;\n webids: string[];\n regex: any;\n summary: any;\n expression: string;\n isPiPoint: boolean;\n rawQuery?: boolean;\n query?: string;\n}\n\nexport const defaultQuery: Partial = {\n target: ';',\n attributes: [],\n segments: [],\n regex: { enable: false },\n summary: { types: [], basis: 'EventWeighted', interval: '', nodata: 'Null' },\n expression: '',\n interpolate: { enable: false },\n recordedValues: { enable: false },\n digitalStates: { enable: false },\n isPiPoint: false,\n};\n\n/**\n * These are options configured for each DataSource instance\n */\nexport interface PIWebAPIDataSourceJsonData extends DataSourceJsonData {\n url?: string;\n access?: string;\n piserver?: string;\n afserver?: string;\n afdatabase?: string;\n}\n\n/**\n * Value that is used in the backend, but never sent over HTTP to the frontend\n */\nexport interface PIWebAPISecureJsonData {\n apiKey?: string;\n}\n","import React, { useEffect, useState } from 'react';\nimport { Button, ConfirmModal } from '@grafana/ui';\n\ntype Props = {\n isRaw: boolean;\n onChange: (newIsRaw: boolean) => void;\n};\n\nexport const QueryEditorModeSwitcher = ({ isRaw, onChange }: Props): JSX.Element => {\n const [isModalOpen, setModalOpen] = useState(false);\n\n useEffect(() => {\n // if the isRaw changes, we hide the modal\n setModalOpen(false);\n }, [isRaw]);\n\n if (isRaw) {\n return (\n <>\n {\n // we show the are-you-sure modal\n setModalOpen(true);\n }}\n >\n {\n onChange(false);\n }}\n onDismiss={() => {\n setModalOpen(false);\n }}\n />\n \n );\n } else {\n return (\n {\n onChange(true);\n }}\n >\n );\n }\n};\n","import { each, filter, forOwn, join, reduce, map, slice, remove, defaults } from 'lodash';\n\nimport React, { PureComponent, ChangeEvent } from 'react';\nimport { Icon, InlineField, InlineFieldRow, InlineSwitch, Input, SegmentAsync, Segment } from '@grafana/ui';\nimport { QueryEditorProps, SelectableValue, VariableModel } from '@grafana/data';\n\nimport { PiWebAPIDatasource } from './datasource';\nimport { QueryInlineField, QueryRawInlineField, QueryRowTerminator } from './components/Forms';\nimport { PIWebAPISelectableValue, PIWebAPIDataSourceJsonData, PIWebAPIQuery, defaultQuery } from './types';\nimport { QueryEditorModeSwitcher } from 'components/QueryEditorModeSwitcher';\n\nconst LABEL_WIDTH = 24;\nconst MIN_ELEM_INPUT_WIDTH = 200;\nconst MIN_ATTR_INPUT_WIDTH = 250;\n\ninterface State {\n isPiPoint: boolean;\n segments: Array>;\n attributes: Array>;\n summaries: Array>;\n attributeSegment: SelectableValue;\n summarySegment: SelectableValue;\n calculationBasisSegment: SelectableValue;\n noDataReplacementSegment: SelectableValue;\n}\n\ntype Props = QueryEditorProps;\n\nconst REMOVE_LABEL = '-REMOVE-';\n\nconst CustomLabelComponent = (props: any) => {\n if (props.value) {\n return (\n
\n {props.label ?? '--no label--'}\n
\n );\n }\n return (\n \n \n \n );\n};\n\nexport class PIWebAPIQueryEditor extends PureComponent {\n error: any;\n piServer: any[] = [];\n availableAttributes: any = {};\n summaryTypes: string[];\n calculationBasis: string[];\n noDataReplacement: string[];\n state: State = {\n isPiPoint: false,\n segments: [],\n attributes: [],\n summaries: [],\n attributeSegment: {},\n summarySegment: {},\n calculationBasisSegment: {},\n noDataReplacementSegment: {},\n };\n\n constructor(props: any) {\n super(props);\n this.onSegmentChange = this.onSegmentChange.bind(this);\n this.calcBasisValueChanged = this.calcBasisValueChanged.bind(this);\n this.calcNoDataValueChanged = this.calcNoDataValueChanged.bind(this);\n this.onSummaryAction = this.onSummaryAction.bind(this);\n this.onSummaryValueChanged = this.onSummaryValueChanged.bind(this);\n this.onAttributeAction = this.onAttributeAction.bind(this);\n this.onAttributeChange = this.onAttributeChange.bind(this);\n\n this.summaryTypes = [\n // 'None', // A summary type is not specified.\n 'Total', // A totalization over the time range.\n 'Average', // The average value over the time range.\n 'Minimum', // The minimum value over the time range.\n 'Maximum', // The maximum value over the time range.\n 'Range', // The range value over the time range (minimum-maximum).\n 'StdDev', // The standard deviation over the time range.\n 'PopulationStdDev', // The population standard deviation over the time range.\n 'Count', // The sum of event count over the time range when calculation basis is event weighted. The sum of event time duration over the time range when calculation basis is time weighted.\n 'PercentGood', // Percent of data with good value during the calculation period. For time weighted calculations, the percentage is based on time. For event weighted calculations, the percent is based on event count.\n 'All', // A convenience for requesting all available summary calculations.\n 'AllForNonNumeric', // A convenience for requesting all available summary calculations for non-numeric data.\n ];\n\n this.calculationBasis = [\n 'TimeWeighted', // Weight the values in the calculation by the time over which they apply. Interpolation is based on whether the attribute is stepped. Interpolated events are generated at the boundaries if necessary.\n 'EventWeighted', // Evaluate values with equal weighting for each event. No interpolation is done. There must be at least one event within the time range to perform a successful calculation. Two events are required for standard deviation. In handling events at the boundary of the calculation, the AFSDK uses following rules:\n 'TimeWeightedContinuous', // Apply weighting as in TimeWeighted, but do all interpolation between values as if they represent continuous data, (standard interpolation) regardless of whether the attribute is stepped.\n 'TimeWeightedDiscrete', // Apply weighting as in TimeWeighted but interpolation between values is performed as if they represent discrete, unrelated values (stair step plot) regardless of the attribute is stepped.\n 'EventWeightedExcludeMostRecentEvent', // The calculation behaves the same as _EventWeighted_, except in the handling of events at the boundary of summary intervals in a multiple intervals calculation. Use this option to prevent events at the intervals boundary from being double count at both intervals. With this option, events at the end time (most recent time) of an interval is not used in that interval.\n 'EventWeightedExcludeEarliestEvent', // Similar to the option _EventWeightedExcludeMostRecentEvent_. Events at the start time(earliest time) of an interval is not used in that interval.\n 'EventWeightedIncludeBothEnds', // Events at both ends of the interval boundaries are included in the event weighted calculation.\n ];\n\n this.noDataReplacement = [\n 'Null', // replace with nulls\n 'Drop', // drop items\n 'Previous', // use previous value if available\n '0', // replace with 0\n 'Keep', // Keep value\n ];\n }\n\n // is selected segment empty\n isValueEmpty(value: PIWebAPISelectableValue | undefined) {\n return !value || !value.value || !value.value.length || value.value === REMOVE_LABEL;\n }\n\n segmentChangeValue = (segments: Array>) => {\n const query = this.props.query;\n this.setState({ segments }, () => this.onChange({ ...query, segments }));\n };\n\n attributeChangeValue = (attributes: Array>) => {\n const query = this.props.query;\n this.setState({ attributes }, () => this.onChange({ ...query, attributes }));\n };\n\n // summary calculation basis change event\n calcBasisValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.basis = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get summary calculation basis user interface segments\n getCalcBasisSegments() {\n const segments = map(this.calculationBasis, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // no data change event\n calcNoDataValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.nodata = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get no data user interface segments\n getNoDataSegments() {\n var segments = map(this.noDataReplacement, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // summary query change event\n onSummaryValueChanged(item: SelectableValue, index: number) {\n const summaries = this.state.summaries.slice(0) as Array>;\n summaries[index] = item;\n if (this.isValueEmpty(item.value)) {\n summaries.splice(index, 1);\n }\n this.setState({ summaries }, this.stateCallback);\n }\n // get the list of summaries available\n getSummarySegments() {\n const ctrl = this;\n const summaryTypes = filter(ctrl.summaryTypes, (type) => {\n return this.state.summaries.map((s) => s.value?.value).indexOf(type) === -1;\n });\n var segments = map(summaryTypes, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n }\n\n // remove a summary from the user interface and the query\n removeSummary(part: SelectableValue) {\n const summaries = filter(this.state.summaries, (item: SelectableValue) => {\n return item !== part;\n });\n this.setState({ summaries });\n }\n // add a new summary to the query\n onSummaryAction(item: SelectableValue) {\n const summaries = this.state.summaries.slice(0) as Array>;\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: true,\n },\n };\n summaries.push(selectableValue);\n }\n this.setState({ summarySegment: {}, summaries }, this.stateCallback);\n }\n\n // remove an attribute from the query\n removeAttribute(part: SelectableValue) {\n const attributes = filter(this.state.attributes, (item: SelectableValue) => {\n return item !== part;\n });\n this.attributeChangeValue(attributes);\n }\n // add an attribute to the query\n onAttributeAction(item: SelectableValue) {\n const { query } = this.props;\n const attributes = this.state.attributes.slice(0);\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: !query.isPiPoint,\n },\n };\n attributes.push(selectableValue);\n }\n this.attributeChangeValue(attributes);\n }\n\n // pi point change event\n onPiPointChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n remove(attributes, (value, n) => n === index);\n } else {\n // set current value\n attributes[index] = item;\n }\n\n this.checkPiPointSegments(item, attributes);\n };\n // attribute change event\n onAttributeChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n // set current value\n attributes[index] = item;\n\n this.checkAttributeSegments(attributes, this.state.segments);\n };\n // segment change\n onSegmentChange = (item: SelectableValue, index: number) => {\n const { query } = this.props;\n let segments = this.state.segments.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n segments = slice(segments, 0, index);\n this.checkAttributeSegments([], segments);\n if (segments.length === 0) {\n segments.push({\n label: '',\n });\n } else if (!!segments[segments.length - 1].value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n if (query.isPiPoint) {\n this.piServer = [];\n }\n this.segmentChangeValue(segments);\n return;\n }\n\n // set current value\n segments[index] = item;\n\n // Accept only one PI server\n if (query.isPiPoint) {\n this.piServer.push(item);\n this.segmentChangeValue(segments);\n return;\n }\n\n // changed internal selection\n if (index < segments.length - 1) {\n segments = slice(segments, 0, index + 1);\n }\n this.checkAttributeSegments([], segments);\n // add new options\n if (!!item.value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n this.segmentChangeValue(segments);\n };\n\n // get a ui segment for the attributes\n getElementSegments = (\n index: number,\n currentSegment?: Array>\n ): Promise>> => {\n const { datasource, query, data } = this.props;\n var ctrl = this;\n var findQuery = query.isPiPoint\n ? { type: 'dataserver' }\n : { path: this.getSegmentPathUpTo(currentSegment ?? this.state.segments.slice(0), index) };\n\n if (!query.isPiPoint) {\n if (datasource.afserver?.name && index === 0) {\n return Promise.resolve([\n {\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n },\n ]);\n }\n if (datasource.afserver?.name && datasource.afdatabase?.name && index === 1) {\n return Promise.resolve([\n {\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n },\n ]);\n }\n\n // if (!findQuery.path?.length) {\n // return Promise.resolve([]);\n // }\n }\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n var altSegments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n label: item.text,\n value: {\n webId: item.WebId,\n value: item.text,\n expandable: !query.isPiPoint && item.expandable,\n },\n };\n return selectableValue;\n });\n\n if (altSegments.length === 0) {\n return altSegments;\n }\n\n // add template variables\n const variables = datasource.templateSrv.getVariables();\n each(variables, (variable: VariableModel) => {\n let selectableValue: SelectableValue = {\n label: '${' + variable.name + '}',\n value: {\n type: 'template',\n value: '${' + variable.name + '}',\n expandable: !query.isPiPoint,\n },\n };\n altSegments.unshift(selectableValue);\n });\n\n altSegments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return altSegments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return [];\n });\n };\n\n // get the list of attributes for the user interface - PI\n getAttributeSegmentsPI = (attributeText?: string): Promise>> => {\n const { datasource, query, data } = this.props;\n const ctrl = this;\n const findQuery = {\n path: '',\n webId: this.getSelectedPIServer(),\n pointName: (attributeText ?? '') + '*',\n type: 'pipoint',\n };\n let segments: Array> = [];\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n segments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n path: item.Path,\n label: item.text,\n value: {\n value: item.text,\n expandable: false,\n },\n };\n return selectableValue;\n });\n segments.unshift({\n label: attributeText,\n value: {\n value: attributeText,\n expandable: false,\n },\n });\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n return segments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return segments;\n });\n };\n\n // get the list of attributes for the user interface - AF\n getAttributeSegmentsAF = (attributeText?: string): Array> => {\n const ctrl = this;\n let segments: Array> = [];\n\n forOwn(ctrl.availableAttributes, (val: any, key: string) => {\n let selectableValue: SelectableValue = {\n label: key,\n value: {\n value: key,\n expandable: true,\n },\n };\n segments.push(selectableValue);\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n };\n\n // build data from target string\n buildFromTarget = (\n query: PIWebAPIQuery,\n segmentsArray: Array>,\n attributesArray: Array>\n ) => {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segmentsArray.push({\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n });\n });\n each(splitAttributes, (item, _) => {\n if (item !== '') {\n // set current value\n attributesArray.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n return this.getElementSegments(splitElements.length + 1, segmentsArray).then((elements) => {\n if (elements.length > 0) {\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n return segmentsArray;\n });\n }\n return Promise.resolve(segmentsArray);\n };\n\n /**\n * Gets the segment information and parses it to a string.\n *\n * @param {any} index - Last index of segment to use.\n * @returns - AF Path or PI Point name.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSegmentPathUpTo(segments: Array>, index: number): string {\n var arr = segments.slice(0, index);\n\n return reduce(\n arr,\n (result: any, segment: SelectableValue) => {\n if (!segment.value) {\n return '';\n }\n if (!segment.value.value?.startsWith('-Select')) {\n return result ? result + '\\\\' + segment.value.value : segment.value.value;\n }\n return result;\n },\n ''\n );\n }\n\n /**\n * Get the current AF Element's child attributes. Validates when the element selection changes.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAttributeSegments(\n attributes: Array>,\n segments: Array>\n ): Promise {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: this.getSegmentPathUpTo(segments.slice(0), segments.length),\n type: 'attributes',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: false }))\n .then((attributesResponse: any) => {\n var validAttributes: any = {};\n\n each(attributesResponse, (attribute: any) => {\n validAttributes[attribute.Path.substring(attribute.Path.indexOf('|') + 1)] = attribute.WebId;\n });\n\n var filteredAttributes = filter(attributes, (attrib: SelectableValue) => {\n const changedValue = datasource.templateSrv.replace(attrib.value?.value);\n return validAttributes[changedValue] !== undefined;\n });\n\n ctrl.availableAttributes = validAttributes;\n this.attributeChangeValue(filteredAttributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n this.attributeChangeValue(attributes);\n });\n }\n\n /**\n * Get PI points from server.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkPiPointSegments(\n attribute: SelectableValue,\n attributes: Array>\n ) {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: attribute.path,\n webId: ctrl.getSelectedPIServer(),\n pointName: attribute.label,\n type: 'pipoint',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: true }))\n .then(() => {\n ctrl.attributeChangeValue(attributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n ctrl.attributeChangeValue([]);\n });\n }\n\n /**\n * Gets the webid of the current selected pi data server.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSelectedPIServer() {\n var webID = '';\n\n this.piServer.forEach((s) => {\n var parts = this.props.query.target.split(';');\n if (parts.length >= 2) {\n if (parts[0] === s.text) {\n webID = s.WebId;\n return;\n }\n }\n });\n return this.piServer.length > 0 ? this.piServer[0].value?.webId : webID;\n }\n\n /**\n * Queries PI Web API for child elements and attributes when the raw query text editor is changed.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n textEditorChanged() {\n const { query, onChange } = this.props;\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n let segments: Array> = [];\n let attributes: Array> = [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segments.push({\n label: item,\n value: {\n type: item.match(/\\${\\w+}/gi) ? 'template' : undefined,\n value: item,\n expandable: true,\n },\n });\n });\n this.getElementSegments(splitElements.length + 1, segments).then((elements) => {\n if (elements.length > 0) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n });\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n this.updateArray(segments, attributes, this.state.summaries, query.isPiPoint, () => {\n onChange({ ...query, query: undefined, rawQuery: false });\n });\n } else {\n segments = this.checkAfServer();\n this.updateArray(segments, this.state.attributes, this.state.summaries, query.isPiPoint, () => {\n this.onChange({\n ...query,\n query: undefined,\n rawQuery: false,\n attributes: this.state.attributes,\n segments: this.state.segments,\n });\n });\n }\n }\n\n /**\n * Check if the AF server and database are configured in the datasoure config.\n *\n * @returns the segments array\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAfServer = () => {\n const { datasource } = this.props;\n const segmentsArray = [];\n if (datasource.afserver?.name) {\n segmentsArray.push({\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n });\n if (datasource.afdatabase?.name) {\n segmentsArray.push({\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n });\n }\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n } else {\n segmentsArray.push({\n label: '',\n });\n }\n return segmentsArray;\n };\n\n /**\n * Update the internal state of the datasource.\n *\n * @param segmentsArray the segments array to update\n * @param attributesArray the AF attributes array to update\n * @param summariesArray the summaries array to update\n * @param isPiPoint the is PI point flag\n * @param cb optional callback function\n *\n * @memberOf PIWebAPIQueryEditor\n */\n updateArray = (\n segmentsArray: Array>,\n attributesArray: Array>,\n summariesArray: Array>,\n isPiPoint: boolean,\n cb?: (() => void) | undefined\n ) => {\n this.setState(\n {\n segments: segmentsArray,\n attributes: attributesArray,\n summaries: summariesArray,\n isPiPoint,\n },\n () =>\n this.checkAttributeSegments(attributesArray, this.state.segments).then(() => {\n if (cb) {\n cb();\n }\n })\n );\n };\n\n // React action when component is initialized/updated\n scopedVarsDone = false;\n componentDidMount = () => {\n this.initialLoad(false);\n };\n componentDidUpdate = () => {\n if (this.props.data?.state === 'Done' && !!this.props.data?.request?.scopedVars && !this.scopedVarsDone) {\n this.scopedVarsDone = true;\n this.initialLoad(true);\n }\n };\n initialLoad = (force: boolean) => {\n const { query } = this.props;\n const metricsQuery = defaults(query, defaultQuery) as PIWebAPIQuery;\n const { segments, attributes, summary, isPiPoint } = metricsQuery;\n\n let segmentsArray: Array> = force ? [] : segments?.slice(0) ?? [];\n let attributesArray: Array> = force ? [] : attributes?.slice(0) ?? [];\n let summariesArray = summary?.types ?? [];\n\n if (!isPiPoint && segmentsArray.length === 0) {\n if (query.target && query.target.length > 0 && query.target !== ';') {\n attributesArray = [];\n // Build query from target\n this.buildFromTarget(query, segmentsArray, attributesArray)\n .then((_segmentsArray) => {\n this.updateArray(_segmentsArray, attributesArray, summariesArray, isPiPoint);\n })\n .catch((e) => console.error(e));\n return;\n } else {\n segmentsArray = this.checkAfServer();\n }\n } else if (isPiPoint && segmentsArray.length > 0) {\n this.piServer = segmentsArray;\n }\n this.updateArray(segmentsArray, attributesArray, summariesArray, isPiPoint, () => {\n this.onChange(query);\n });\n };\n\n onChange = (query: PIWebAPIQuery) => {\n const { onChange, onRunQuery } = this.props;\n\n query.summary.types = this.state.summaries;\n if (query.rawQuery) {\n query.target = query.query ?? '';\n\n if (query.target !== '') {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes[0].split('\\\\');\n\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n query.attributes = [];\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n query.elementPath = splitElements.join('\\\\');\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n query.attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n }\n }\n } else {\n query.elementPath = this.getSegmentPathUpTo(this.state.segments, this.state.segments.length);\n query.target =\n query.elementPath +\n ';' +\n join(\n query.attributes.map((s) => s.value?.value),\n ';'\n );\n }\n\n onChange(query);\n\n if (query.target && query.target.length > 0 && query.attributes.length > 0) {\n onRunQuery();\n }\n };\n\n stateCallback = () => {\n const query = this.props.query as PIWebAPIQuery;\n this.onChange(query);\n };\n\n onIsPiPointChange = (event: React.SyntheticEvent) => {\n const { query: queryChange } = this.props;\n const isPiPoint = !queryChange.isPiPoint;\n this.setState(\n {\n segments: isPiPoint ? [{ label: '' }] : this.checkAfServer(),\n attributes: [],\n isPiPoint,\n },\n () => {\n this.onChange({\n ...queryChange,\n expression: '',\n attributes: this.state.attributes,\n segments: this.state.segments,\n isPiPoint,\n });\n }\n );\n };\n\n render() {\n const { query: queryProps, onChange, onRunQuery } = this.props;\n const metricsQuery = defaults(queryProps, defaultQuery) as PIWebAPIQuery;\n const {\n interpolate,\n query,\n rawQuery,\n digitalStates,\n recordedValues,\n expression,\n isPiPoint,\n summary,\n display,\n regex,\n } = metricsQuery;\n\n return (\n <>\n \n \n \n\n {!!rawQuery && (\n \n \n ) =>\n onChange({ ...metricsQuery, query: event.target.value })\n }\n placeholder=\"enter query\"\n />\n \n this.textEditorChanged()} />\n \n )}\n\n {!rawQuery && (\n <>\n
\n \n {this.state.segments.map((segment: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSegmentChange(item, index)}\n loadOptions={(query?: string | undefined) => {\n return this.getElementSegments(index);\n }}\n allowCustomValue\n inputMinWidth={MIN_ELEM_INPUT_WIDTH}\n />\n );\n })}\n \n {!isPiPoint && (\n {\n onChange({ ...metricsQuery, query: metricsQuery.target, rawQuery: value });\n }}\n />\n )}\n \n
\n\n \n {this.state.attributes.map((attribute: SelectableValue, index: number) => {\n if (isPiPoint) {\n return (\n }\n disabled={this.piServer.length === 0}\n onChange={(item) => this.onPiPointChange(item, index)}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n }\n return (\n }\n disabled={this.state.segments.length <= 2}\n onChange={(item) => this.onAttributeChange(item, index)}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n })}\n\n {isPiPoint && (\n \n }\n disabled={this.piServer.length === 0}\n onChange={this.onAttributeAction}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n {!isPiPoint && (\n \n }\n disabled={this.state.segments.length <= 2}\n onChange={this.onAttributeAction}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n \n \n )}\n\n {!isPiPoint && (\n \n ) =>\n this.onChange({ ...metricsQuery, expression: event.target.value })\n }\n placeholder=\"'.'*2\"\n />\n \n )}\n\n \n \n ) =>\n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, maxNumber: parseInt(event.target.value, 10) },\n })\n }\n type=\"number\"\n placeholder=\"1000\"\n />\n \n \n \n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, enable: !recordedValues.enable },\n })\n }\n />\n \n \n \n this.onChange({ ...metricsQuery, digitalStates: { ...digitalStates, enable: !digitalStates.enable } })\n }\n />\n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n \n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, enable: !interpolate.enable } })\n }\n />\n \n \n }\n onChange={this.calcNoDataValueChanged}\n options={this.getNoDataSegments()}\n allowCustomValue\n />\n \n \n\n \n \n ) =>\n onChange({ ...metricsQuery, summary: { ...summary, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n }\n onChange={this.calcBasisValueChanged}\n options={this.getCalcBasisSegments()}\n allowCustomValue\n />\n \n \n \n {this.state.summaries.map((s: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSummaryValueChanged(item, index)}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n );\n })}\n \n }\n onChange={this.onSummaryAction}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n \n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, display: event.target.value })\n }\n placeholder=\"Display\"\n />\n \n \n {\n this.onChange({ ...metricsQuery, regex: { ...regex, enable: !regex.enable } });\n }}\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, search: event.target.value } })\n }\n placeholder=\"(.*)\"\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, replace: event.target.value } })\n }\n placeholder=\"$1\"\n />\n \n \n \n );\n }\n}\n","import { curry, each, filter, flatten, forOwn, groupBy, keys, map, uniq } from 'lodash';\n\nimport {\n DataQueryRequest,\n DataQueryResponse,\n DataSourceApi,\n DataSourceInstanceSettings,\n AnnotationEvent,\n toDataFrame,\n MetricFindValue,\n} from '@grafana/data';\nimport { BackendSrv, getBackendSrv, getTemplateSrv, TemplateSrv } from '@grafana/runtime';\n\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\ninterface PiwebapiElementPath {\n path: string;\n variable: string;\n}\n\ninterface PiwebapiInternalRsp {\n data: PiwebapiRsp;\n status: number;\n url: string;\n}\n\ninterface PiwebapTargetRsp {\n refId: string;\n target: string;\n datapoints: any[];\n}\n\ninterface PiwebapiRsp {\n Name?: string;\n InstanceType?: string;\n Items?: PiwebapiRsp[];\n WebId?: string;\n HasChildren?: boolean;\n Path?: string;\n}\n\ninterface PiDataServer {\n name: string | undefined;\n webid: string | undefined;\n}\n\nexport class PiWebAPIDatasource extends DataSourceApi {\n piserver: PiDataServer;\n afserver: PiDataServer;\n afdatabase: PiDataServer;\n\n basicAuth?: string;\n withCredentials?: boolean;\n url: string;\n name: string;\n isProxy = false;\n\n templateSrv: TemplateSrv;\n backendSrv: BackendSrv;\n\n piwebapiurl?: string;\n webidCache: Map = new Map();\n\n error: any;\n\n constructor(instanceSettings: DataSourceInstanceSettings) {\n super(instanceSettings);\n this.basicAuth = instanceSettings.basicAuth;\n this.withCredentials = instanceSettings.withCredentials;\n this.url = instanceSettings.url!;\n this.name = instanceSettings.name;\n this.templateSrv = getTemplateSrv();\n this.backendSrv = getBackendSrv();\n\n this.piwebapiurl = instanceSettings.jsonData.url?.toString();\n this.isProxy = /^http(s)?:\\/\\//.test(this.url) || instanceSettings.jsonData.access === 'proxy';\n\n this.piserver = { name: (instanceSettings.jsonData || {}).piserver, webid: undefined };\n this.afserver = { name: (instanceSettings.jsonData || {}).afserver, webid: undefined };\n this.afdatabase = { name: (instanceSettings.jsonData || {}).afdatabase, webid: undefined };\n\n Promise.all([\n this.getAssetServer(this.afserver.name).then((result: PiwebapiRsp) => (this.afserver.webid = result.WebId)),\n this.getDataServer(this.piserver.name).then((result: PiwebapiRsp) => (this.piserver.webid = result.WebId)),\n this.getDatabase(this.afserver.name ? this.afserver.name + '\\\\' + this.afdatabase.name : undefined).then(\n (result: PiwebapiRsp) => (this.afdatabase.webid = result.WebId)\n ),\n ]);\n }\n\n /**\n * Converts a PIWebAPI Event Frame response to a Grafana Annotation\n *\n * @param {any} annotationOptions - Options data from configuration panel.\n * @param {any} endTime - End time of the Event Frame.\n * @param {any} eventFrame - The Event Frame data.\n * @returns - Grafana Annotation\n *\n * @memberOf PiWebApiDatasource\n */\n private eventFrameToAnnotation(\n annotationOptions: any,\n endTime: any,\n eventFrame: any,\n attributeDataItems: any\n ): AnnotationEvent {\n if (annotationOptions.regex && annotationOptions.regex.enable) {\n eventFrame.Name = eventFrame.Name.replace(\n new RegExp(annotationOptions.regex.search),\n annotationOptions.regex.replace\n );\n }\n\n var attributeText = '';\n if (attributeDataItems) {\n each(attributeDataItems, (attributeData: any) => {\n const attributeValue = attributeData.Value.Value\n ? attributeData.Value.Value.Name || attributeData.Value.Value.Value || attributeData.Value.Value\n : null;\n attributeText += '
' + attributeData.Name + ': ' + attributeValue;\n });\n }\n return {\n annotation: annotationOptions,\n title: (endTime ? 'END ' : annotationOptions.showEndTime ? 'START ' : '') + annotationOptions.name,\n time: new Date(endTime ? eventFrame.EndTime : eventFrame.StartTime).getTime(),\n text:\n eventFrame.Name + attributeText + '
Start: ' + eventFrame.StartTime + '
End: ' + eventFrame.EndTime,\n };\n }\n\n /**\n * Builds the PIWebAPI query parameters.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - PIWebAPI query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private buildQueryParameters(options: DataQueryRequest) {\n options.targets = filter(options.targets, (target) => {\n if (!target || !target.target) {\n return false;\n }\n return !target.target.startsWith('Select AF');\n });\n\n options.targets = map(options.targets, (target) => {\n const ds = this;\n var tar = {\n target: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPath: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPathArray: [\n {\n path: this.templateSrv.replace(target.elementPath, options.scopedVars),\n variable: '',\n } as PiwebapiElementPath,\n ],\n attributes: map(target.attributes, (att) =>\n this.templateSrv.replace(att.value?.value || att, options.scopedVars)\n ),\n segments: map(target.segments, (att) => this.templateSrv.replace(att.value?.value, options.scopedVars)),\n display: target.display,\n refId: target.refId,\n hide: target.hide,\n interpolate: target.interpolate || { enable: false },\n recordedValues: target.recordedValues || { enable: false },\n digitalStates: target.digitalStates || { enable: false },\n webid: target.webid,\n webids: target.webids || [],\n regex: target.regex || { enable: false },\n expression: target.expression || '',\n summary: target.summary || { types: [] },\n startTime: options.range.from,\n endTime: options.range.to,\n isPiPoint: target.isPiPoint,\n scopedVars: options.scopedVars,\n };\n\n if (tar.expression) {\n tar.expression = this.templateSrv.replace(tar.expression, options.scopedVars);\n }\n\n if (tar.summary.types !== undefined) {\n tar.summary.types = filter(tar.summary.types, (item) => {\n return item !== undefined && item !== null && item !== '';\n });\n }\n\n // explode All or Multi-selection\n const varsKeys = keys(options.scopedVars);\n this.templateSrv.getVariables().forEach((v: any) => {\n if (ds.isAllSelected(v.current) && varsKeys.indexOf(v.name) < 0) {\n // All selection\n const variables = v.options.filter((o: any) => !o.selected);\n // attributes\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) =>\n !!v.allValue ? attr.replace(v.allValue, vv.value) : attr.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value)\n )\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, v.allValue);\n } else if (Array.isArray(v.current.text) && varsKeys.indexOf(v.name) < 0) {\n // Multi-selection\n const variables = v.options.filter((o: any) => o.selected);\n // attributes\n const query = v.current.value.join(',');\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) => attr.replace(`{${query}}`, vv.value))\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, `{${query}}`);\n }\n });\n\n return tar;\n });\n\n return options;\n }\n\n /**\n * Datasource Implementation. Primary entry point for data source.\n * This takes the panel configuration and queries, sends them to PI Web API and parses the response.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - Promise of data in the format for Grafana panels.\n *\n * @memberOf PiWebApiDatasource\n */\n async query(options: DataQueryRequest): Promise {\n var ds = this;\n var query = this.buildQueryParameters(options);\n query.targets = filter(query.targets, (t) => !t.hide);\n\n if (query.targets.length <= 0) {\n return Promise.resolve({ data: [] });\n } else {\n return Promise.all(ds.getStream(query)).then((targetResponses) => {\n let flattened: PiwebapTargetRsp[] = [];\n each(targetResponses, (tr) => {\n each(tr, (item) => flattened.push(item));\n });\n const response: DataQueryResponse = {\n data: flattened\n .sort((a, b) => {\n return +(a.target > b.target) || +(a.target === b.target) - 1;\n })\n .map((d) => toDataFrame(d)),\n };\n return response;\n });\n }\n }\n\n /**\n * Datasource Implementation.\n * Used for testing datasource in datasource configuration pange\n *\n * @returns - Success or failure message.\n *\n * @memberOf PiWebApiDatasource\n */\n testDatasource(): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + '/',\n method: 'GET',\n })\n .then((response: any) => {\n if (response.status === 200) {\n return { status: 'success', message: 'Data source is working', title: 'Success' };\n }\n throw new Error('Failed');\n });\n }\n\n /**\n * Datasource Implementation.\n * This queries PI Web API for Event Frames and converts them into annotations.\n *\n * @param {any} options - Annotation options, usually the Event Frame Category.\n * @returns - A Grafana annotation.\n *\n * @memberOf PiWebApiDatasource\n */\n annotationQuery(options: any): Promise {\n if (!this.afdatabase.webid) {\n return Promise.resolve([]);\n }\n\n var categoryName = options.annotation.query.categoryName\n ? this.templateSrv.replace(options.annotation.query.categoryName, options.scopedVars, 'glob')\n : null;\n var nameFilter = options.annotation.query.nameFilter\n ? this.templateSrv.replace(options.annotation.query.nameFilter, options.scopedVars, 'glob')\n : null;\n var templateName = options.annotation.template ? options.annotation.template.Name : null;\n var annotationOptions = {\n name: options.annotation.name,\n datasource: options.annotation.datasource,\n enable: options.annotation.enable,\n iconColor: options.annotation.iconColor,\n showEndTime: options.annotation.showEndTime,\n regex: options.annotation.regex,\n attribute: options.annotation.attribute,\n categoryName: categoryName,\n templateName: templateName,\n nameFilter: nameFilter,\n };\n\n var filter = [];\n if (!!annotationOptions.categoryName) {\n filter.push('categoryName=' + annotationOptions.categoryName);\n }\n if (!!annotationOptions.nameFilter) {\n filter.push('nameFilter=' + annotationOptions.nameFilter);\n }\n if (!!annotationOptions.templateName) {\n filter.push('templateName=' + annotationOptions.templateName);\n }\n if (!filter.length) {\n return Promise.resolve([]);\n }\n filter.push('startTime=' + options.range.from.toJSON());\n filter.push('endTime=' + options.range.to.toJSON());\n\n if (annotationOptions.attribute && annotationOptions.attribute.enable) {\n var resourceUrl =\n this.piwebapiurl + '/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n if (!!annotationOptions.attribute.name) {\n resourceUrl =\n this.piwebapiurl +\n '/streamsets/{0}/value?nameFilter=' +\n annotationOptions.attribute.name +\n '&selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n }\n var query: any = {};\n query['1'] = {\n Method: 'GET',\n Resource: this.piwebapiurl + '/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&'),\n };\n query['2'] = {\n Method: 'GET',\n RequestTemplate: {\n Resource: resourceUrl,\n },\n Parameters: ['$.1.Content.Items[*].WebId'],\n ParentIds: ['1'],\n };\n return this.restBatch(query).then((result: any) => {\n const data = result.data['1'].Content;\n const valueData = result.data['2'].Content;\n\n var annotations = map(data.Items, (item: any, index: any) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n false,\n item,\n valueData.Items[index].Content.Items\n );\n });\n\n if (options.annotation.showEndTime) {\n var ends = map(data.Items, (item: any, index: number) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n true,\n item,\n valueData.Items[index].Content.Items\n );\n });\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n\n return annotations;\n });\n } else {\n return this.restGet('/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&')).then(\n (result) => {\n var annotations = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, false));\n if (options.annotation.showEndTime) {\n var ends = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, true));\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n return annotations;\n }\n );\n }\n }\n\n /**\n * Builds the Grafana metric segment for use on the query user interface.\n *\n * @param {any} response - response from PI Web API.\n * @returns - Grafana metric segment.\n *\n * @memberOf PiWebApiDatasource\n */\n private metricQueryTransform(response: PiwebapiRsp[]): MetricFindValue[] {\n return map(response, (item) => {\n return {\n text: item.Name,\n expandable:\n item.HasChildren === undefined || item.HasChildren === true || (item.Path ?? '').split('\\\\').length <= 3,\n HasChildren: item.HasChildren,\n Items: item.Items ?? [],\n Path: item.Path,\n WebId: item.WebId,\n } as MetricFindValue;\n });\n }\n\n /**\n * This method does the discovery of the AF Hierarchy and populates the query user interface segments.\n *\n * @param {any} query - Parses the query configuration and builds a PI Web API query.\n * @returns - Segment information.\n *\n * @memberOf PiWebApiDatasource\n */\n metricFindQuery(query: any, queryOptions: any): Promise {\n var ds = this;\n var querydepth = ['servers', 'databases', 'databaseElements', 'elements'];\n if (typeof query === 'string') {\n query = JSON.parse(query as string);\n }\n if (queryOptions.isPiPoint) {\n query.path = this.templateSrv.replace(query.path, queryOptions);\n } else {\n if (query.path === '') {\n query.type = querydepth[0];\n } else if (query.type !== 'attributes') {\n query.type = querydepth[Math.max(0, Math.min(query.path.split('\\\\').length, querydepth.length - 1))];\n }\n query.path = this.templateSrv.replace(query.path, queryOptions);\n query.path = query.path.replace(/\\{([^\\\\])*\\}/gi, (r: string) => r.substring(1, r.length - 2).split(',')[0]);\n }\n\n query.filter = query.filter ?? '*';\n\n if (query.type === 'servers') {\n return ds.afserver?.name\n ? ds\n .getAssetServer(ds.afserver.name)\n .then((result: PiwebapiRsp) => [result])\n .then(ds.metricQueryTransform)\n : ds.getAssetServers().then(ds.metricQueryTransform);\n } else if (query.type === 'databases') {\n return ds\n .getAssetServer(query.path)\n .then((server) => ds.getDatabases(server.WebId ?? '', {}))\n .then(ds.metricQueryTransform);\n } else if (query.type === 'databaseElements') {\n return ds\n .getDatabase(query.path)\n .then((db) =>\n ds.getDatabaseElements(db.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'elements') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getElements(element.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'attributes') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getAttributes(element.WebId ?? '', {\n searchFullHierarchy: 'true',\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Path',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'dataserver') {\n return ds.getDataServers().then(ds.metricQueryTransform);\n } else if (query.type === 'pipoint') {\n return ds.piPointSearch(query.webId, query.pointName).then(ds.metricQueryTransform);\n }\n return Promise.reject('Bad type');\n }\n\n /**\n * Gets the url of summary data from the query configuration.\n *\n * @param {any} summary - Query summary configuration.\n * @returns - URL append string.\n *\n * @memberOf PiWebApiDatasource\n */\n getSummaryUrl(summary: any) {\n if (summary.interval.trim() === '') {\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis\n );\n }\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis +\n '&summaryDuration=' +\n summary.interval.trim()\n );\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} value - A list of PIWebAPI values.\n * @param {any} target - The target Grafana metric.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @returns - An array of Grafana value, timestamp pairs.\n *\n */\n parsePiPointValueList(value: any[], target: any, isSummary: boolean) {\n var api = this;\n var datapoints: any[] = [];\n each(value, (item) => {\n // @ts-ignore\n var { grafanaDataPoint, previousValue, drop } = this.noDataReplace(\n isSummary ? item.Value : item,\n target.summary.nodata,\n api.parsePiPointValue(isSummary ? item.Value : item, target, isSummary)\n );\n if (!drop) {\n datapoints.push(grafanaDataPoint);\n }\n });\n return datapoints;\n }\n\n /**\n * Convert a PI Point value to use Grafana value/timestamp.\n *\n * @param {any} value - PI Point value.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @param {any} target - The target grafana metric.\n * @returns - Grafana value pair.\n *\n */\n parsePiPointValue(value: any, target: any, isSummary: boolean) {\n let num = !isSummary && typeof value.Value === 'object' ? value.Value?.Value : value.Value;\n\n if (!value.Good || !!target.digitalStates?.enable) {\n num = (!isSummary && typeof value.Value === 'object' ? value.Value?.Name : value.Name) ?? '';\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} item - 'Item' object from PIWebAPI\n * @param {any} noDataReplacementMode - String state of how to replace 'No Data'\n * @param {any} grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns perviousValue - {any} Grafana value (value only).\n *\n */\n noDataReplace(\n item: any,\n noDataReplacementMode: any,\n grafanaDataPoint: any[]\n ): {\n grafanaDataPoint: any[];\n previousValue: any;\n drop: boolean;\n } {\n var previousValue = null;\n var drop = false;\n if (!item.Good || item.Value === 'No Data' || (item.Value?.Name && item.Value?.Name === 'No Data')) {\n if (noDataReplacementMode === 'Drop') {\n drop = true;\n } else if (noDataReplacementMode === '0') {\n grafanaDataPoint[0] = 0;\n } else if (noDataReplacementMode === 'Keep') {\n // Do nothing keep\n } else if (noDataReplacementMode === 'Null') {\n grafanaDataPoint[0] = null;\n } else if (noDataReplacementMode === 'Previous' && previousValue !== null) {\n grafanaDataPoint[0] = previousValue;\n }\n } else {\n previousValue = item.Value;\n }\n return { grafanaDataPoint, previousValue, drop };\n }\n\n /**\n * Process the response from PI Web API for a single item.\n *\n * @param {any} content - Web response data.\n * @param {any} target - The target grafana metric.\n * @param {any} name - The target metric name.\n * @returns - Parsed metric in target/datapoint json format.\n *\n * @memberOf PiWebApiDatasource\n */\n processResults(content: any, target: any, name: any, noTemplate: boolean): PiwebapTargetRsp[] {\n const api = this;\n const isSummary: boolean = target.summary && target.summary.types && target.summary.types.length > 0;\n name = noTemplate ? name : this.getPath(target.elementPathArray, content.Path) + '|' + name;\n if (target.regex && target.regex.enable && target.regex.search.length && target.regex.replace.length) {\n name = name.replace(new RegExp(target.regex.search), target.regex.replace);\n }\n if (isSummary) {\n var innerResults: any[] = [];\n var groups = groupBy(content.Items, (item: any) => item.Type);\n forOwn(groups, (value, key) => {\n innerResults.push({\n refId: target.refId,\n target: name + '[' + key + ']',\n datapoints: api.parsePiPointValueList(value, target, isSummary),\n });\n });\n return innerResults;\n }\n return [\n {\n refId: target.refId,\n target: name,\n datapoints: api.parsePiPointValueList(content.Items, target, isSummary),\n },\n ];\n }\n\n /** PRIVATE SECTION */\n\n /**\n * Check if all items are selected.\n *\n * @param {any} current the current variable selection\n * @return {boolean} true if all value is selected, false otherwise\n */\n private isAllSelected(current: any): boolean {\n if (!current) {\n return false;\n }\n if (Array.isArray(current.text)) {\n return current.text.indexOf('All') >= 0;\n }\n return current.text === 'All';\n }\n\n /**\n * Check if the value is a number.\n *\n * @param {any} number the value to check\n * @returns {boolean} true if the value is a number, false otherwise\n */\n private checkNumber(number: any): boolean {\n return typeof number === 'number' && !Number.isNaN(number) && Number.isFinite(number);\n }\n\n /**\n * Returns a new element path list based on the panel variables.\n *\n * @param {string} elementPathArray array of element paths\n * @param {string} variables the list of variable values\n * @param {string} allValue the all value value for the variable\n * @returns {PiwebapiElementPath[]} new element path list\n */\n private getElementPath(\n elementPathArray: PiwebapiElementPath[],\n variables: any[],\n allValue: string\n ): PiwebapiElementPath[] {\n // elementPath\n let newElementPathArray: PiwebapiElementPath[] = [];\n elementPathArray.forEach((elem: PiwebapiElementPath) => {\n if ((!!allValue && elem.path.indexOf(allValue) >= 0) || (!allValue && elem.path.match(/{[a-zA-z0-9,-_]+}/gi))) {\n const temp: PiwebapiElementPath[] = variables.map((vv: any) => {\n return {\n path: !!allValue\n ? elem.path.replace(allValue, vv.value)\n : elem.path.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value),\n variable: vv.value,\n } as PiwebapiElementPath;\n });\n newElementPathArray = newElementPathArray.concat(temp);\n }\n });\n if (newElementPathArray.length) {\n return uniq(flatten(newElementPathArray));\n }\n return elementPathArray;\n }\n\n /**\n * Returns the last item of the element path.\n *\n * @param {string} path element path\n * @returns {string} last item of the element path\n */\n private getPath(elementPathArray: PiwebapiElementPath[], path: string): string {\n let splitPath = path.split('|');\n if (splitPath.length === 0) {\n return '';\n }\n if (elementPathArray.length === 0) {\n return '';\n }\n splitPath = splitPath[0].split('\\\\');\n const splitStr = splitPath.length === 0 ? '' : splitPath.pop() ?? '';\n const foundElement = elementPathArray.find((e) => path.indexOf(e.path) >= 0)?.variable;\n return foundElement ? foundElement + '|' + splitStr : splitStr;\n }\n\n /**\n * Gets historical data from a PI Web API stream source.\n *\n * @param {any} query - Grafana query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private getStream(query: any): Array> {\n const ds = this;\n var results: Array> = [];\n\n each(query.targets, (target) => {\n target.attributes = filter(target.attributes || [], (attribute) => {\n return 1 && attribute;\n });\n var url = '';\n var isSummary = target.summary && target.summary.types && target.summary.types.length > 0;\n var isInterpolated = target.interpolate && target.interpolate.enable;\n // perhaps add a check to see if interpolate override time < query.interval\n var intervalTime = target.interpolate.interval ? target.interpolate.interval : query.interval;\n var timeRange = '?startTime=' + query.range.from.toJSON() + '&endTime=' + query.range.to.toJSON();\n var targetName = target.expression || target.elementPath;\n var displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n if (target.expression) {\n url += '/calculation';\n if (isSummary) {\n url += '/summary' + timeRange + (isInterpolated ? '&sampleType=Interval&sampleInterval=' + intervalTime : '');\n } else {\n url += '/intervals' + timeRange + '&sampleInterval=' + intervalTime;\n }\n url += '&expression=' + encodeURIComponent(target.expression);\n if (target.attributes.length > 0) {\n results.push(ds.internalStream(query, target, url));\n } else {\n results.push(\n ds.restGetWebId(target.elementPath, target.isPiPoint).then((webidresponse: any) => {\n return ds\n .restPost(url + webidresponse.WebId)\n .then((response: any) => ds.processResults(response.data, target, displayName || targetName, false))\n .catch((err: any) => (ds.error = err));\n })\n );\n }\n } else {\n url += '/streamsets';\n if (isSummary) {\n url += '/summary' + timeRange + '&intervals=' + query.maxDataPoints + this.getSummaryUrl(target.summary);\n } else if (target.interpolate && target.interpolate.enable) {\n url += '/interpolated' + timeRange + '&interval=' + intervalTime;\n } else if (target.recordedValues && target.recordedValues.enable) {\n const maxNumber =\n target.recordedValues.maxNumber && !isNaN(target.recordedValues.maxNumber)\n ? target.recordedValues.maxNumber\n : 1000;\n url += '/recorded' + timeRange + '&maxCount=' + maxNumber;\n } else {\n url += '/plot' + timeRange + '&intervals=' + query.maxDataPoints;\n }\n\n results.push(ds.internalStream(query, target, url));\n }\n });\n\n return results;\n }\n\n /**\n * Return the data points from the provided Grafana query.\n *\n * @param {any} query - Grafana query.\n * @param {any} target - Grafana query target.\n * @param {string} url - The base URL for the query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private internalStream(query: any, target: any, url: string): Promise {\n const ds = this;\n const targetName = target.expression || target.elementPath;\n const displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n const noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path;\n let promises: Promise;\n\n if (noTemplate) {\n if (target.attributes.length > 1) {\n promises = ds\n .restGetWebId(target.elementPath, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n } else {\n promises = Promise.all(\n map(target.attributes, (attribute: string) =>\n ds.restGetWebId(target.elementPath + '|' + attribute, target.isPiPoint)\n )\n );\n }\n } else {\n if (target.attributes.length > 1) {\n promises = Promise.all(\n target.elementPathArray.map((elementPath: PiwebapiElementPath) => {\n return ds\n .restGetWebId(elementPath.path, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n })\n );\n } else {\n promises = Promise.all(\n flatten(\n map(target.attributes, (attribute: string) => {\n return target.elementPathArray.map((elementPath: PiwebapiElementPath) =>\n ds.restGetWebId(elementPath.path + '|' + attribute, target.isPiPoint)\n );\n })\n )\n );\n }\n }\n\n return promises.then((webidresponse) => {\n const query: any = {};\n each(flatten(webidresponse), (webid, index) => {\n query[index + 1] = {\n Method: 'GET',\n Resource: ds.piwebapiurl + url + '&webid=' + webid.WebId,\n };\n });\n\n return ds\n .restBatch(query)\n .then((response: any) => {\n const targetResults: any[] = [];\n each(response.data, (value, key) => {\n if (target.expression) {\n const attribute = webidresponse[parseInt(key, 10) - 1].Name;\n each(\n ds.processResults(value.Content, target, displayName || attribute || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n } else {\n each(value.Content.Items, (item) => {\n each(\n ds.processResults(item, target, displayName || item.Name || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n });\n }\n });\n return targetResults;\n })\n .catch((err: any) => (ds.error = err));\n });\n }\n\n /**\n * Abstraction for calling the PI Web API REST endpoint\n *\n * @param {any} path - the path to append to the base server URL.\n * @returns - The full URL.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGet(path: string): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n return response as PiwebapiInternalRsp;\n });\n }\n\n /**\n * Resolve a Grafana query into a PI Web API webid. Uses client side cache when possible to reduce lookups.\n *\n * @param {string} assetPath - The AF Path or the Pi Point Path (\\\\ServerName\\piPointName) to the asset.\n * @param {boolean} isPiPoint - Flag indicating it's a PI Point\n * @returns - URL query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGetWebId(assetPath: string, isPiPoint: boolean): Promise {\n var ds = this;\n\n // check cache\n var cachedWebId = ds.webidCache.get(assetPath);\n if (cachedWebId) {\n return Promise.resolve({ Path: assetPath, WebId: cachedWebId.WebId, Name: cachedWebId.Name });\n }\n\n let path = '';\n if (isPiPoint) {\n path = '/points?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\' + assetPath.replace('|', '\\\\');\n } else {\n // no cache hit, query server\n path =\n (assetPath.indexOf('|') >= 0\n ? '/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\'\n : '/elements?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\') + assetPath;\n }\n\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n ds.webidCache.set(assetPath, response.data);\n return { Path: assetPath, WebId: response.data.WebId, Name: response.data.Name };\n });\n }\n\n /**\n * Execute a batch query on the PI Web API.\n *\n * @param {any} batch - Batch JSON query data.\n * @returns - Batch response.\n *\n * @memberOf PiWebApiDatasource\n */\n private restBatch(batch: any) {\n return this.backendSrv.datasourceRequest({\n url: this.url + '/batch',\n data: batch,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n },\n });\n }\n\n /**\n * Execute a POST on the PI Web API.\n *\n * @param {string} path - The full url of the POST.\n * @returns - POST response data.\n *\n * @memberOf PiWebApiDatasource\n */\n private restPost(path: string) {\n return this.backendSrv.datasourceRequest({\n url: this.url,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n 'X-PIWEBAPI-HTTP-METHOD': 'GET',\n 'X-PIWEBAPI-RESOURCE-ADDRESS': path,\n },\n });\n }\n\n // Get a list of all data (PI) servers\n private getDataServers(): Promise {\n return this.restGet('/dataservers').then((response) => response.data.Items ?? []);\n }\n private getDataServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/dataservers?name=' + name).then((response) => response.data);\n }\n // Get a list of all asset (AF) servers\n private getAssetServers(): Promise {\n return this.restGet('/assetservers').then((response) => response.data.Items ?? []);\n }\n private getAssetServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/assetservers?path=\\\\\\\\' + name).then((response) => response.data);\n }\n private getDatabase(path: string | undefined): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/assetdatabases?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getDatabases(serverId: string, options?: any): Promise {\n if (!serverId) {\n return Promise.resolve([]);\n }\n return this.restGet('/assetservers/' + serverId + '/assetdatabases').then((response) => response.data.Items ?? []);\n }\n getElement(path: string): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/elements?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getEventFrameTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'EventFrame');\n });\n }\n getElementTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'Element');\n });\n }\n\n /**\n * @description\n * Get the child attributes of the current resource.\n * GET attributes/{webId}/attributes\n * @param {string} elementId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.nameFilter - The name query string used for finding attributes. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned attributes must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned attributes must be members of this template. The default is no template filter.\n * @param {string} options.valueType - Specify that returned attributes' value type must be the given value type. The default is no value type filter.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include attributes nested further than the immediate attributes of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {string} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {string} options.showExcluded - Specified if the search should include attributes with the Excluded property set. The default is 'false'.\n * @param {string} options.showHidden - Specified if the search should include attributes with the Hidden property set. The default is 'false'.\n * @param {string} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getAttributes(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/attributes' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET assetdatabases/{webId}/elements\n * @param {string} databaseId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getDatabaseElements(databaseId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/assetdatabases/' + databaseId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET elements/{webId}/elements\n * @param {string} databaseId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getElements(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * Retrieve a list of points on a specified Data Server.\n *\n * @param {string} serverId - The ID of the server. See WebID for more information.\n * @param {string} nameFilter - A query string for filtering by point name. The default is no filter. *, ?, [ab], [!ab]\n */\n private piPointSearch(serverId: string, nameFilter: string): Promise {\n let filter1 = this.templateSrv.replace(nameFilter);\n let filter2 = `${filter1}`;\n let doFilter = false;\n if (filter1 !== nameFilter) {\n const regex = /\\{(\\w|,)+\\}/gs;\n let m;\n while ((m = regex.exec(filter1)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // The result can be accessed through the `m`-variable.\n m.forEach((match, groupIndex) => {\n if (groupIndex === 0) {\n filter1 = filter1.replace(match, match.replace('{', '(').replace('}', ')').replace(',', '|'));\n filter2 = filter2.replace(match, '*');\n doFilter = true;\n }\n });\n }\n }\n return this.restGet('/dataservers/' + serverId + '/points?maxCount=20&nameFilter=' + filter2).then((results) => {\n if (!!results && !!results.data?.Items) {\n return doFilter ? results.data.Items.filter((item) => item.Name?.match(filter1)) : results.data.Items;\n }\n return [];\n });\n }\n\n /**\n * Get the PI Web API webid or PI Point.\n *\n * @param {any} target - AF Path or Point name.\n * @returns - webid.\n *\n * @memberOf PiWebApiDatasource\n */\n getWebId(target: any) {\n var ds = this;\n var isAf = target.target.indexOf('\\\\') >= 0;\n var isAttribute = target.target.indexOf('|') >= 0;\n if (!isAf && target.target.indexOf('.') === -1) {\n return Promise.resolve([{ WebId: target.target, Name: target.display || target.target }]);\n }\n\n if (!isAf) {\n // pi point lookup\n return ds.piPointSearch(this.piserver.webid!, target.target).then((results) => {\n if (results === undefined || results.length === 0) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n return results;\n });\n } else if (isAf && isAttribute) {\n // af attribute lookup\n return ds.restGet('/attributes?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n } else {\n // af element lookup\n return ds.restGet('/elements?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n }\n }\n}\n","import { DataSourcePlugin } from '@grafana/data';\nimport { AnnotationsQueryCtrl } from './AnnotationsQueryCtrl';\nimport { PIWebAPIConfigEditor } from './ConfigEditor';\nimport { PIWebAPIQueryEditor } from './QueryEditor';\nimport { PiWebAPIDatasource } from './datasource';\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\nexport const plugin = new DataSourcePlugin(\n PiWebAPIDatasource\n)\n .setConfigEditor(PIWebAPIConfigEditor)\n .setQueryEditor(PIWebAPIQueryEditor)\n .setAnnotationQueryCtrl(AnnotationsQueryCtrl);\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__0__","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__3__","__WEBPACK_EXTERNAL_MODULE__5__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","AnnotationsQueryCtrl","$scope","this","annotation","ctrl","datasource","query","databases","templates","regex","attribute","showEndTime","getAssetServer","afserver","name","then","result","getDatabases","WebId","getEventFrames","webid","dbs","$apply","getEventFrameTemplates","database","FormField","LegacyForms","coerceOptions","options","jsonData","url","PIWebAPIConfigEditor","event","props","onOptionsChange","piserver","target","afdatabase","originalOptions","DataSourceHttpSettings","defaultUrl","dataSourceConfig","onChange","onMyOptionsChange","showAccessOptions","className","label","labelWidth","inputWidth","onPIServerChange","placeholder","onAFServerChange","onAFDatabaseChange","PureComponent","QueryField","tooltip","children","InlineFormLabel","width","QueryRowTerminator","QueryInlineField","QueryEditorRow","QueryRawInlineField","QueryRawEditorRow","defaultQuery","attributes","segments","enable","summary","types","basis","interval","nodata","expression","interpolate","recordedValues","digitalStates","isPiPoint","QueryEditorModeSwitcher","isRaw","useState","isModalOpen","setModalOpen","useEffect","Button","icon","variant","type","onClick","ConfirmModal","isOpen","title","body","confirmText","dismissText","onConfirm","onDismiss","LABEL_WIDTH","MIN_ATTR_INPUT_WIDTH","REMOVE_LABEL","CustomLabelComponent","Icon","PIWebAPIQueryEditor","summaries","attributeSegment","summarySegment","calculationBasisSegment","noDataReplacementSegment","setState","item","index","state","slice","remove","checkPiPointSegments","checkAttributeSegments","length","push","expandable","piServer","segmentChangeValue","currentSegment","data","findQuery","path","getSegmentPathUpTo","Promise","resolve","metricFindQuery","assign","request","scopedVars","items","altSegments","map","text","webId","variables","templateSrv","getVariables","each","variable","selectableValue","unshift","err","error","message","attributeText","getSelectedPIServer","pointName","Path","forOwn","availableAttributes","val","segmentsArray","attributesArray","splitAttributes","split","splitElements","splice","_","getElementSegments","elements","summariesArray","cb","initialLoad","scopedVarsDone","force","metricsQuery","defaults","buildFromTarget","_segmentsArray","updateArray","e","checkAfServer","onRunQuery","rawQuery","elementPath","join","s","queryChange","onSegmentChange","bind","calcBasisValueChanged","calcNoDataValueChanged","onSummaryAction","onSummaryValueChanged","onAttributeAction","onAttributeChange","summaryTypes","calculationBasis","noDataReplacement","segment","isValueEmpty","stateCallback","filter","indexOf","part","attributeChangeValue","arr","reduce","startsWith","attributesResponse","validAttributes","substring","filteredAttributes","attrib","changedValue","replace","webID","forEach","parts","match","queryProps","display","InlineField","InlineSwitch","onIsPiPointChange","InlineFieldRow","grow","Input","onBlur","textEditorChanged","SegmentAsync","Component","loadOptions","allowCustomValue","inputMinWidth","disabled","onPiPointChange","getAttributeSegmentsPI","reloadOptionsOnChange","Segment","getAttributeSegmentsAF","maxNumber","parseInt","getNoDataSegments","getCalcBasisSegments","getSummarySegments","search","PiWebAPIDatasource","instanceSettings","Map","basicAuth","withCredentials","getTemplateSrv","backendSrv","getBackendSrv","piwebapiurl","toString","isProxy","test","access","all","getDataServer","getDatabase","annotationOptions","endTime","eventFrame","attributeDataItems","Name","RegExp","attributeData","attributeValue","Value","time","Date","EndTime","StartTime","getTime","targets","ds","tar","elementPathArray","att","refId","hide","webids","startTime","range","from","to","varsKeys","keys","v","isAllSelected","current","selected","attr","vv","allValue","uniq","flatten","getElementPath","Array","isArray","buildQueryParameters","t","getStream","targetResponses","flattened","tr","sort","b","toDataFrame","datasourceRequest","method","response","status","Error","categoryName","nameFilter","templateName","template","iconColor","toJSON","resourceUrl","Method","Resource","RequestTemplate","Parameters","ParentIds","restBatch","Content","valueData","annotations","Items","curry","eventFrameToAnnotation","ends","end","restGet","HasChildren","queryOptions","querydepth","JSON","parse","Math","max","min","metricQueryTransform","getAssetServers","server","db","getDatabaseElements","selectedFields","getElement","element","getElements","getAttributes","searchFullHierarchy","getDataServers","piPointSearch","reject","trim","isSummary","api","datapoints","noDataReplace","parsePiPointValue","grafanaDataPoint","previousValue","drop","num","Good","checkNumber","Number","Timestamp","noDataReplacementMode","content","noTemplate","getPath","innerResults","groups","groupBy","Type","parsePiPointValueList","number","isNaN","isFinite","newElementPathArray","elem","temp","concat","splitPath","splitStr","pop","foundElement","find","results","isInterpolated","intervalTime","timeRange","targetName","displayName","encodeURIComponent","internalStream","restGetWebId","webidresponse","restPost","processResults","maxDataPoints","getSummaryUrl","datarsp","datarspa","targetResults","targetResult","headers","assetPath","cachedWebId","webidCache","set","batch","serverId","databaseId","InstanceType","elementId","querystring","filter1","filter2","doFilter","m","exec","lastIndex","groupIndex","isAf","isAttribute","DataSourceApi","plugin","DataSourcePlugin","setConfigEditor","setQueryEditor","setAnnotationQueryCtrl"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"module.js","mappings":";;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,oBAAb;EAAA;;EAOE;EACA,8BAAYC,MAAZ,EAAyB;IAAA;;IA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A;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AAGO,IAAMwV,MAAM,GAAG,IAAID,2DAAJ,CACpB3L,2DADoB,EAGnB6L,eAHmB,CAGHnY,+DAHG,EAInBoY,cAJmB,CAIJ3V,6DAJI,EAKnB4V,sBALmB,CAKIta,uEALJ,CAAf,C","sources":["webpack:///./AnnotationsQueryCtrl.ts","webpack:///./ConfigEditor.tsx","webpack:///./QueryEditor.tsx","webpack:///./components/Forms.tsx","webpack:///./components/QueryEditorModeSwitcher.tsx","webpack:///./datasource.ts","webpack:///./types.ts","webpack:///external amd \"@grafana/data\"","webpack:///external amd \"@grafana/runtime\"","webpack:///external amd \"@grafana/ui\"","webpack:///external amd \"lodash\"","webpack:///external amd \"react\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./module.ts"],"sourcesContent":["export class AnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n\n $scope: any;\n annotation: any;\n datasource: any;\n\n /** @ngInject */\n constructor($scope: any) {\n this.$scope = $scope;\n this.annotation = $scope.ctrl.annotation;\n this.datasource = $scope.ctrl.datasource;\n\n // load defaults\n this.annotation.query = this.annotation.query || {};\n this.annotation.databases = this.annotation.databases || [];\n this.annotation.templates = this.annotation.templates || [];\n this.annotation.regex = this.annotation.regex || {};\n this.annotation.attribute = this.annotation.attribute || {};\n this.annotation.showEndTime = this.annotation.showEndTime || false;\n\n this.datasource.getAssetServer(this.datasource.afserver.name).then((result: any) => {\n return this.getDatabases(result.WebId);\n });\n }\n templateChanged() {\n // do nothing\n }\n databaseChanged() {\n this.annotation.templates = [];\n this.getEventFrames();\n }\n getDatabases(webid: string) {\n var ctrl = this;\n ctrl.datasource.getDatabases(webid).then((dbs: any) => {\n ctrl.annotation.databases = dbs;\n this.$scope.$apply();\n });\n }\n getEventFrames() {\n var ctrl = this;\n ctrl.datasource.getEventFrameTemplates(this.annotation.database.WebId).then((templates: any) => {\n ctrl.annotation.templates = templates;\n this.$scope.$apply();\n });\n }\n}\n","import React, { ChangeEvent, PureComponent } from 'react';\nimport { LegacyForms, DataSourceHttpSettings } from '@grafana/ui';\nimport { DataSourcePluginOptionsEditorProps, DataSourceJsonData, DataSourceSettings } from '@grafana/data';\nimport { PIWebAPIDataSourceJsonData } from './types';\n\nconst { FormField } = LegacyForms;\n\ninterface Props extends DataSourcePluginOptionsEditorProps {}\n\nconst coerceOptions = (\n options: DataSourceSettings\n): DataSourceSettings => {\n return {\n ...options,\n jsonData: {\n ...options.jsonData,\n url: options.url,\n },\n };\n};\n\ninterface State {}\n\nexport class PIWebAPIConfigEditor extends PureComponent {\n onPIServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n piserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFDatabaseChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afdatabase: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onMyOptionsChange = (options: DataSourceSettings) => {\n const { onOptionsChange } = this.props;\n onOptionsChange(coerceOptions(options));\n };\n\n render() {\n const { options: originalOptions } = this.props;\n const options = coerceOptions(originalOptions);\n\n return (\n
\n \n\n

PI/AF Connection Details

\n\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n );\n }\n}\n","import { each, filter, forOwn, join, reduce, map, slice, remove, defaults } from 'lodash';\n\nimport React, { PureComponent, ChangeEvent } from 'react';\nimport { Icon, InlineField, InlineFieldRow, InlineSwitch, Input, SegmentAsync, Segment } from '@grafana/ui';\nimport { QueryEditorProps, SelectableValue, VariableModel } from '@grafana/data';\n\nimport { PiWebAPIDatasource } from './datasource';\nimport { QueryInlineField, QueryRawInlineField, QueryRowTerminator } from './components/Forms';\nimport { PIWebAPISelectableValue, PIWebAPIDataSourceJsonData, PIWebAPIQuery, defaultQuery } from './types';\nimport { QueryEditorModeSwitcher } from 'components/QueryEditorModeSwitcher';\n\nconst LABEL_WIDTH = 24;\nconst MIN_ELEM_INPUT_WIDTH = 200;\nconst MIN_ATTR_INPUT_WIDTH = 250;\n\ninterface State {\n isPiPoint: boolean;\n segments: Array>;\n attributes: Array>;\n summaries: Array>;\n attributeSegment: SelectableValue;\n summarySegment: SelectableValue;\n calculationBasisSegment: SelectableValue;\n noDataReplacementSegment: SelectableValue;\n}\n\ntype Props = QueryEditorProps;\n\nconst REMOVE_LABEL = '-REMOVE-';\n\nconst CustomLabelComponent = (props: any) => {\n if (props.value) {\n return (\n
\n {props.label ?? '--no label--'}\n
\n );\n }\n return (\n \n \n \n );\n};\n\nexport class PIWebAPIQueryEditor extends PureComponent {\n error: any;\n piServer: any[] = [];\n availableAttributes: any = {};\n summaryTypes: string[];\n calculationBasis: string[];\n noDataReplacement: string[];\n state: State = {\n isPiPoint: false,\n segments: [],\n attributes: [],\n summaries: [],\n attributeSegment: {},\n summarySegment: {},\n calculationBasisSegment: {},\n noDataReplacementSegment: {},\n };\n\n constructor(props: any) {\n super(props);\n this.onSegmentChange = this.onSegmentChange.bind(this);\n this.calcBasisValueChanged = this.calcBasisValueChanged.bind(this);\n this.calcNoDataValueChanged = this.calcNoDataValueChanged.bind(this);\n this.onSummaryAction = this.onSummaryAction.bind(this);\n this.onSummaryValueChanged = this.onSummaryValueChanged.bind(this);\n this.onAttributeAction = this.onAttributeAction.bind(this);\n this.onAttributeChange = this.onAttributeChange.bind(this);\n\n this.summaryTypes = [\n // 'None', // A summary type is not specified.\n 'Total', // A totalization over the time range.\n 'Average', // The average value over the time range.\n 'Minimum', // The minimum value over the time range.\n 'Maximum', // The maximum value over the time range.\n 'Range', // The range value over the time range (minimum-maximum).\n 'StdDev', // The standard deviation over the time range.\n 'PopulationStdDev', // The population standard deviation over the time range.\n 'Count', // The sum of event count over the time range when calculation basis is event weighted. The sum of event time duration over the time range when calculation basis is time weighted.\n 'PercentGood', // Percent of data with good value during the calculation period. For time weighted calculations, the percentage is based on time. For event weighted calculations, the percent is based on event count.\n 'All', // A convenience for requesting all available summary calculations.\n 'AllForNonNumeric', // A convenience for requesting all available summary calculations for non-numeric data.\n ];\n\n this.calculationBasis = [\n 'TimeWeighted', // Weight the values in the calculation by the time over which they apply. Interpolation is based on whether the attribute is stepped. Interpolated events are generated at the boundaries if necessary.\n 'EventWeighted', // Evaluate values with equal weighting for each event. No interpolation is done. There must be at least one event within the time range to perform a successful calculation. Two events are required for standard deviation. In handling events at the boundary of the calculation, the AFSDK uses following rules:\n 'TimeWeightedContinuous', // Apply weighting as in TimeWeighted, but do all interpolation between values as if they represent continuous data, (standard interpolation) regardless of whether the attribute is stepped.\n 'TimeWeightedDiscrete', // Apply weighting as in TimeWeighted but interpolation between values is performed as if they represent discrete, unrelated values (stair step plot) regardless of the attribute is stepped.\n 'EventWeightedExcludeMostRecentEvent', // The calculation behaves the same as _EventWeighted_, except in the handling of events at the boundary of summary intervals in a multiple intervals calculation. Use this option to prevent events at the intervals boundary from being double count at both intervals. With this option, events at the end time (most recent time) of an interval is not used in that interval.\n 'EventWeightedExcludeEarliestEvent', // Similar to the option _EventWeightedExcludeMostRecentEvent_. Events at the start time(earliest time) of an interval is not used in that interval.\n 'EventWeightedIncludeBothEnds', // Events at both ends of the interval boundaries are included in the event weighted calculation.\n ];\n\n this.noDataReplacement = [\n 'Null', // replace with nulls\n 'Drop', // drop items\n 'Previous', // use previous value if available\n '0', // replace with 0\n 'Keep', // Keep value\n ];\n }\n\n // is selected segment empty\n isValueEmpty(value: PIWebAPISelectableValue | undefined) {\n return !value || !value.value || !value.value.length || value.value === REMOVE_LABEL;\n }\n\n segmentChangeValue = (segments: Array>) => {\n const query = this.props.query;\n this.setState({ segments }, () => this.onChange({ ...query, segments }));\n };\n\n attributeChangeValue = (attributes: Array>) => {\n const query = this.props.query;\n this.setState({ attributes }, () => this.onChange({ ...query, attributes }));\n };\n\n // summary calculation basis change event\n calcBasisValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.basis = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get summary calculation basis user interface segments\n getCalcBasisSegments() {\n const segments = map(this.calculationBasis, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // no data change event\n calcNoDataValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.nodata = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get no data user interface segments\n getNoDataSegments() {\n var segments = map(this.noDataReplacement, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // summary query change event\n onSummaryValueChanged(item: SelectableValue, index: number) {\n const summaries = this.state.summaries.slice(0) as Array>;\n summaries[index] = item;\n if (this.isValueEmpty(item.value)) {\n summaries.splice(index, 1);\n }\n this.setState({ summaries }, this.stateCallback);\n }\n // get the list of summaries available\n getSummarySegments() {\n const ctrl = this;\n const summaryTypes = filter(ctrl.summaryTypes, (type) => {\n return this.state.summaries.map((s) => s.value?.value).indexOf(type) === -1;\n });\n var segments = map(summaryTypes, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n }\n\n // remove a summary from the user interface and the query\n removeSummary(part: SelectableValue) {\n const summaries = filter(this.state.summaries, (item: SelectableValue) => {\n return item !== part;\n });\n this.setState({ summaries });\n }\n // add a new summary to the query\n onSummaryAction(item: SelectableValue) {\n const summaries = this.state.summaries.slice(0) as Array>;\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: true,\n },\n };\n summaries.push(selectableValue);\n }\n this.setState({ summarySegment: {}, summaries }, this.stateCallback);\n }\n\n // remove an attribute from the query\n removeAttribute(part: SelectableValue) {\n const attributes = filter(this.state.attributes, (item: SelectableValue) => {\n return item !== part;\n });\n this.attributeChangeValue(attributes);\n }\n // add an attribute to the query\n onAttributeAction(item: SelectableValue) {\n const { query } = this.props;\n const attributes = this.state.attributes.slice(0);\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: !query.isPiPoint,\n },\n };\n attributes.push(selectableValue);\n }\n this.attributeChangeValue(attributes);\n }\n\n // pi point change event\n onPiPointChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n remove(attributes, (value, n) => n === index);\n } else {\n // set current value\n attributes[index] = item;\n }\n\n this.checkPiPointSegments(item, attributes);\n };\n // attribute change event\n onAttributeChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n // set current value\n attributes[index] = item;\n\n this.checkAttributeSegments(attributes, this.state.segments);\n };\n // segment change\n onSegmentChange = (item: SelectableValue, index: number) => {\n const { query } = this.props;\n let segments = this.state.segments.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n segments = slice(segments, 0, index);\n this.checkAttributeSegments([], segments);\n if (segments.length === 0) {\n segments.push({\n label: '',\n });\n } else if (!!segments[segments.length - 1].value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n if (query.isPiPoint) {\n this.piServer = [];\n }\n this.segmentChangeValue(segments);\n return;\n }\n\n // set current value\n segments[index] = item;\n\n // Accept only one PI server\n if (query.isPiPoint) {\n this.piServer.push(item);\n this.segmentChangeValue(segments);\n return;\n }\n\n // changed internal selection\n if (index < segments.length - 1) {\n segments = slice(segments, 0, index + 1);\n }\n this.checkAttributeSegments([], segments);\n // add new options\n if (!!item.value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n this.segmentChangeValue(segments);\n };\n\n // get a ui segment for the attributes\n getElementSegments = (\n index: number,\n currentSegment?: Array>\n ): Promise>> => {\n const { datasource, query, data } = this.props;\n var ctrl = this;\n var findQuery = query.isPiPoint\n ? { type: 'dataserver' }\n : { path: this.getSegmentPathUpTo(currentSegment ?? this.state.segments.slice(0), index) };\n\n if (!query.isPiPoint) {\n if (datasource.afserver?.name && index === 0) {\n return Promise.resolve([\n {\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n },\n ]);\n }\n if (datasource.afserver?.name && datasource.afdatabase?.name && index === 1) {\n return Promise.resolve([\n {\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n },\n ]);\n }\n\n // if (!findQuery.path?.length) {\n // return Promise.resolve([]);\n // }\n }\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n var altSegments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n label: item.text,\n value: {\n webId: item.WebId,\n value: item.text,\n expandable: !query.isPiPoint && item.expandable,\n },\n };\n return selectableValue;\n });\n\n if (altSegments.length === 0) {\n return altSegments;\n }\n\n // add template variables\n const variables = datasource.templateSrv.getVariables();\n each(variables, (variable: VariableModel) => {\n let selectableValue: SelectableValue = {\n label: '${' + variable.name + '}',\n value: {\n type: 'template',\n value: '${' + variable.name + '}',\n expandable: !query.isPiPoint,\n },\n };\n altSegments.unshift(selectableValue);\n });\n\n altSegments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return altSegments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return [];\n });\n };\n\n // get the list of attributes for the user interface - PI\n getAttributeSegmentsPI = (attributeText?: string): Promise>> => {\n const { datasource, query, data } = this.props;\n const ctrl = this;\n const findQuery = {\n path: '',\n webId: this.getSelectedPIServer(),\n pointName: (attributeText ?? '') + '*',\n type: 'pipoint',\n };\n let segments: Array> = [];\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n segments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n path: item.Path,\n label: item.text,\n value: {\n value: item.text,\n expandable: false,\n },\n };\n return selectableValue;\n });\n segments.unshift({\n label: attributeText,\n value: {\n value: attributeText,\n expandable: false,\n },\n });\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n return segments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return segments;\n });\n };\n\n // get the list of attributes for the user interface - AF\n getAttributeSegmentsAF = (attributeText?: string): Array> => {\n const ctrl = this;\n let segments: Array> = [];\n\n forOwn(ctrl.availableAttributes, (val: any, key: string) => {\n let selectableValue: SelectableValue = {\n label: key,\n value: {\n value: key,\n expandable: true,\n },\n };\n segments.push(selectableValue);\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n };\n\n // build data from target string\n buildFromTarget = (\n query: PIWebAPIQuery,\n segmentsArray: Array>,\n attributesArray: Array>\n ) => {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segmentsArray.push({\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n });\n });\n each(splitAttributes, (item, _) => {\n if (item !== '') {\n // set current value\n attributesArray.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n return this.getElementSegments(splitElements.length + 1, segmentsArray).then((elements) => {\n if (elements.length > 0) {\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n return segmentsArray;\n });\n }\n return Promise.resolve(segmentsArray);\n };\n\n /**\n * Gets the segment information and parses it to a string.\n *\n * @param {any} index - Last index of segment to use.\n * @returns - AF Path or PI Point name.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSegmentPathUpTo(segments: Array>, index: number): string {\n var arr = segments.slice(0, index);\n\n return reduce(\n arr,\n (result: any, segment: SelectableValue) => {\n if (!segment.value) {\n return '';\n }\n if (!segment.value.value?.startsWith('-Select')) {\n return result ? result + '\\\\' + segment.value.value : segment.value.value;\n }\n return result;\n },\n ''\n );\n }\n\n /**\n * Get the current AF Element's child attributes. Validates when the element selection changes.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAttributeSegments(\n attributes: Array>,\n segments: Array>\n ): Promise {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: this.getSegmentPathUpTo(segments.slice(0), segments.length),\n type: 'attributes',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: false }))\n .then((attributesResponse: any) => {\n var validAttributes: any = {};\n\n each(attributesResponse, (attribute: any) => {\n validAttributes[attribute.Path.substring(attribute.Path.indexOf('|') + 1)] = attribute.WebId;\n });\n\n var filteredAttributes = filter(attributes, (attrib: SelectableValue) => {\n const changedValue = datasource.templateSrv.replace(attrib.value?.value);\n return validAttributes[changedValue] !== undefined;\n });\n\n ctrl.availableAttributes = validAttributes;\n this.attributeChangeValue(filteredAttributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n this.attributeChangeValue(attributes);\n });\n }\n\n /**\n * Get PI points from server.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkPiPointSegments(\n attribute: SelectableValue,\n attributes: Array>\n ) {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: attribute.path,\n webId: ctrl.getSelectedPIServer(),\n pointName: attribute.label,\n type: 'pipoint',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: true }))\n .then(() => {\n ctrl.attributeChangeValue(attributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n ctrl.attributeChangeValue([]);\n });\n }\n\n /**\n * Gets the webid of the current selected pi data server.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSelectedPIServer() {\n var webID = '';\n\n this.piServer.forEach((s) => {\n var parts = this.props.query.target.split(';');\n if (parts.length >= 2) {\n if (parts[0] === s.text) {\n webID = s.WebId;\n return;\n }\n }\n });\n return this.piServer.length > 0 ? this.piServer[0].value?.webId : webID;\n }\n\n /**\n * Queries PI Web API for child elements and attributes when the raw query text editor is changed.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n textEditorChanged() {\n const { query, onChange } = this.props;\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n let segments: Array> = [];\n let attributes: Array> = [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segments.push({\n label: item,\n value: {\n type: item.match(/\\${\\w+}/gi) ? 'template' : undefined,\n value: item,\n expandable: true,\n },\n });\n });\n this.getElementSegments(splitElements.length + 1, segments).then((elements) => {\n if (elements.length > 0) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n });\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n this.updateArray(segments, attributes, this.state.summaries, query.isPiPoint, () => {\n onChange({ ...query, query: undefined, rawQuery: false });\n });\n } else {\n segments = this.checkAfServer();\n this.updateArray(segments, this.state.attributes, this.state.summaries, query.isPiPoint, () => {\n this.onChange({\n ...query,\n query: undefined,\n rawQuery: false,\n attributes: this.state.attributes,\n segments: this.state.segments,\n });\n });\n }\n }\n\n /**\n * Check if the AF server and database are configured in the datasoure config.\n *\n * @returns the segments array\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAfServer = () => {\n const { datasource } = this.props;\n const segmentsArray = [];\n if (datasource.afserver?.name) {\n segmentsArray.push({\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n });\n if (datasource.afdatabase?.name) {\n segmentsArray.push({\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n });\n }\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n } else {\n segmentsArray.push({\n label: '',\n });\n }\n return segmentsArray;\n };\n\n /**\n * Update the internal state of the datasource.\n *\n * @param segmentsArray the segments array to update\n * @param attributesArray the AF attributes array to update\n * @param summariesArray the summaries array to update\n * @param isPiPoint the is PI point flag\n * @param cb optional callback function\n *\n * @memberOf PIWebAPIQueryEditor\n */\n updateArray = (\n segmentsArray: Array>,\n attributesArray: Array>,\n summariesArray: Array>,\n isPiPoint: boolean,\n cb?: (() => void) | undefined\n ) => {\n this.setState(\n {\n segments: segmentsArray,\n attributes: attributesArray,\n summaries: summariesArray,\n isPiPoint,\n },\n () =>\n this.checkAttributeSegments(attributesArray, this.state.segments).then(() => {\n if (cb) {\n cb();\n }\n })\n );\n };\n\n // React action when component is initialized/updated\n scopedVarsDone = false;\n componentDidMount = () => {\n this.initialLoad(false);\n };\n componentDidUpdate = () => {\n if (this.props.data?.state === 'Done' && !!this.props.data?.request?.scopedVars && !this.scopedVarsDone) {\n this.scopedVarsDone = true;\n this.initialLoad(true);\n }\n };\n initialLoad = (force: boolean) => {\n const { query } = this.props;\n const metricsQuery = defaults(query, defaultQuery) as PIWebAPIQuery;\n const { segments, attributes, summary, isPiPoint } = metricsQuery;\n\n let segmentsArray: Array> = force ? [] : segments?.slice(0) ?? [];\n let attributesArray: Array> = force ? [] : attributes?.slice(0) ?? [];\n let summariesArray = summary?.types ?? [];\n\n if (!isPiPoint && segmentsArray.length === 0) {\n if (query.target && query.target.length > 0 && query.target !== ';') {\n attributesArray = [];\n // Build query from target\n this.buildFromTarget(query, segmentsArray, attributesArray)\n .then((_segmentsArray) => {\n this.updateArray(_segmentsArray, attributesArray, summariesArray, isPiPoint);\n })\n .catch((e) => console.error(e));\n return;\n } else {\n segmentsArray = this.checkAfServer();\n }\n } else if (isPiPoint && segmentsArray.length > 0) {\n this.piServer = segmentsArray;\n }\n this.updateArray(segmentsArray, attributesArray, summariesArray, isPiPoint, () => {\n this.onChange(query);\n });\n };\n\n onChange = (query: PIWebAPIQuery) => {\n const { onChange, onRunQuery } = this.props;\n\n query.summary.types = this.state.summaries;\n if (query.rawQuery) {\n query.target = query.query ?? '';\n\n if (query.target !== '') {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes[0].split('\\\\');\n\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n query.attributes = [];\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n query.elementPath = splitElements.join('\\\\');\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n query.attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n }\n }\n } else {\n query.elementPath = this.getSegmentPathUpTo(this.state.segments, this.state.segments.length);\n query.target =\n query.elementPath +\n ';' +\n join(\n query.attributes.map((s) => s.value?.value),\n ';'\n );\n }\n\n onChange(query);\n\n if (query.target && query.target.length > 0 && query.attributes.length > 0) {\n onRunQuery();\n }\n };\n\n stateCallback = () => {\n const query = this.props.query as PIWebAPIQuery;\n this.onChange(query);\n };\n\n onIsPiPointChange = (event: React.SyntheticEvent) => {\n const { query: queryChange } = this.props;\n const isPiPoint = !queryChange.isPiPoint;\n this.setState(\n {\n segments: isPiPoint ? [{ label: '' }] : this.checkAfServer(),\n attributes: [],\n isPiPoint,\n },\n () => {\n this.onChange({\n ...queryChange,\n expression: '',\n attributes: this.state.attributes,\n segments: this.state.segments,\n isPiPoint,\n });\n }\n );\n };\n\n render() {\n const { query: queryProps, onChange, onRunQuery } = this.props;\n const metricsQuery = defaults(queryProps, defaultQuery) as PIWebAPIQuery;\n const {\n interpolate,\n query,\n rawQuery,\n digitalStates,\n recordedValues,\n expression,\n isPiPoint,\n summary,\n display,\n regex,\n } = metricsQuery;\n\n return (\n <>\n \n \n \n\n {!!rawQuery && (\n \n \n ) =>\n onChange({ ...metricsQuery, query: event.target.value })\n }\n placeholder=\"enter query\"\n />\n \n this.textEditorChanged()} />\n \n )}\n\n {!rawQuery && (\n <>\n
\n \n {this.state.segments.map((segment: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSegmentChange(item, index)}\n loadOptions={(query?: string | undefined) => {\n return this.getElementSegments(index);\n }}\n allowCustomValue\n inputMinWidth={MIN_ELEM_INPUT_WIDTH}\n />\n );\n })}\n \n {!isPiPoint && (\n {\n onChange({ ...metricsQuery, query: metricsQuery.target, rawQuery: value });\n }}\n />\n )}\n \n
\n\n \n {this.state.attributes.map((attribute: SelectableValue, index: number) => {\n if (isPiPoint) {\n return (\n }\n disabled={this.piServer.length === 0}\n onChange={(item) => this.onPiPointChange(item, index)}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n }\n return (\n }\n disabled={this.state.segments.length <= 2}\n onChange={(item) => this.onAttributeChange(item, index)}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n })}\n\n {isPiPoint && (\n \n }\n disabled={this.piServer.length === 0}\n onChange={this.onAttributeAction}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n {!isPiPoint && (\n \n }\n disabled={this.state.segments.length <= 2}\n onChange={this.onAttributeAction}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n \n \n )}\n\n {!isPiPoint && (\n \n ) =>\n this.onChange({ ...metricsQuery, expression: event.target.value })\n }\n placeholder=\"'.'*2\"\n />\n \n )}\n\n \n \n ) =>\n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, maxNumber: parseInt(event.target.value, 10) },\n })\n }\n type=\"number\"\n placeholder=\"1000\"\n />\n \n \n \n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, enable: !recordedValues.enable },\n })\n }\n />\n \n \n \n this.onChange({ ...metricsQuery, digitalStates: { ...digitalStates, enable: !digitalStates.enable } })\n }\n />\n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n \n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, enable: !interpolate.enable } })\n }\n />\n \n \n }\n onChange={this.calcNoDataValueChanged}\n options={this.getNoDataSegments()}\n allowCustomValue\n />\n \n \n\n \n \n ) =>\n onChange({ ...metricsQuery, summary: { ...summary, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n }\n onChange={this.calcBasisValueChanged}\n options={this.getCalcBasisSegments()}\n allowCustomValue\n />\n \n \n \n {this.state.summaries.map((s: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSummaryValueChanged(item, index)}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n );\n })}\n \n }\n onChange={this.onSummaryAction}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n \n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, display: event.target.value })\n }\n placeholder=\"Display\"\n />\n \n \n {\n this.onChange({ ...metricsQuery, regex: { ...regex, enable: !regex.enable } });\n }}\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, search: event.target.value } })\n }\n placeholder=\"(.*)\"\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, replace: event.target.value } })\n }\n placeholder=\"$1\"\n />\n \n \n \n );\n }\n}\n","import React, { InputHTMLAttributes, FunctionComponent } from 'react';\nimport { InlineFormLabel } from '@grafana/ui';\n\nexport interface Props extends InputHTMLAttributes {\n label: string;\n tooltip?: string;\n labelWidth?: number;\n children?: React.ReactNode;\n queryEditor?: JSX.Element;\n}\n\nexport const QueryField: FunctionComponent> = ({ label, labelWidth = 12, tooltip, children }) => (\n <>\n \n {label}\n \n {children}\n \n);\n\nexport const QueryRowTerminator = () => {\n return (\n
\n
\n
\n );\n};\n\nexport const QueryInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryEditorRow = (props: Partial) => {\n return (\n
\n {props.children}\n \n
\n );\n};\n\nexport const QueryRawInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryRawEditorRow = (props: Partial) => {\n return <>{props.children};\n};\n","import React, { useEffect, useState } from 'react';\nimport { Button, ConfirmModal } from '@grafana/ui';\n\ntype Props = {\n isRaw: boolean;\n onChange: (newIsRaw: boolean) => void;\n};\n\nexport const QueryEditorModeSwitcher = ({ isRaw, onChange }: Props): JSX.Element => {\n const [isModalOpen, setModalOpen] = useState(false);\n\n useEffect(() => {\n // if the isRaw changes, we hide the modal\n setModalOpen(false);\n }, [isRaw]);\n\n if (isRaw) {\n return (\n <>\n {\n // we show the are-you-sure modal\n setModalOpen(true);\n }}\n >\n {\n onChange(false);\n }}\n onDismiss={() => {\n setModalOpen(false);\n }}\n />\n \n );\n } else {\n return (\n {\n onChange(true);\n }}\n >\n );\n }\n};\n","import { curry, each, filter, flatten, forOwn, groupBy, keys, map, uniq } from 'lodash';\n\nimport {\n DataQueryRequest,\n DataQueryResponse,\n DataSourceApi,\n DataSourceInstanceSettings,\n AnnotationEvent,\n toDataFrame,\n MetricFindValue,\n} from '@grafana/data';\nimport { BackendSrv, getBackendSrv, getTemplateSrv, TemplateSrv } from '@grafana/runtime';\n\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\ninterface PiwebapiElementPath {\n path: string;\n variable: string;\n}\n\ninterface PiwebapiInternalRsp {\n data: PiwebapiRsp;\n status: number;\n url: string;\n}\n\ninterface PiwebapTargetRsp {\n refId: string;\n target: string;\n datapoints: any[];\n}\n\ninterface PiwebapiRsp {\n Name?: string;\n InstanceType?: string;\n Items?: PiwebapiRsp[];\n WebId?: string;\n HasChildren?: boolean;\n Path?: string;\n}\n\ninterface PiDataServer {\n name: string | undefined;\n webid: string | undefined;\n}\n\nexport class PiWebAPIDatasource extends DataSourceApi {\n piserver: PiDataServer;\n afserver: PiDataServer;\n afdatabase: PiDataServer;\n\n basicAuth?: string;\n withCredentials?: boolean;\n url: string;\n name: string;\n isProxy = false;\n\n templateSrv: TemplateSrv;\n backendSrv: BackendSrv;\n\n piwebapiurl?: string;\n webidCache: Map = new Map();\n\n error: any;\n\n constructor(instanceSettings: DataSourceInstanceSettings) {\n super(instanceSettings);\n this.basicAuth = instanceSettings.basicAuth;\n this.withCredentials = instanceSettings.withCredentials;\n this.url = instanceSettings.url!;\n this.name = instanceSettings.name;\n this.templateSrv = getTemplateSrv();\n this.backendSrv = getBackendSrv();\n\n this.piwebapiurl = instanceSettings.jsonData.url?.toString();\n this.isProxy = /^http(s)?:\\/\\//.test(this.url) || instanceSettings.jsonData.access === 'proxy';\n\n this.piserver = { name: (instanceSettings.jsonData || {}).piserver, webid: undefined };\n this.afserver = { name: (instanceSettings.jsonData || {}).afserver, webid: undefined };\n this.afdatabase = { name: (instanceSettings.jsonData || {}).afdatabase, webid: undefined };\n\n Promise.all([\n this.getAssetServer(this.afserver.name).then((result: PiwebapiRsp) => (this.afserver.webid = result.WebId)),\n this.getDataServer(this.piserver.name).then((result: PiwebapiRsp) => (this.piserver.webid = result.WebId)),\n this.getDatabase(this.afserver.name ? this.afserver.name + '\\\\' + this.afdatabase.name : undefined).then(\n (result: PiwebapiRsp) => (this.afdatabase.webid = result.WebId)\n ),\n ]);\n }\n\n /**\n * Converts a PIWebAPI Event Frame response to a Grafana Annotation\n *\n * @param {any} annotationOptions - Options data from configuration panel.\n * @param {any} endTime - End time of the Event Frame.\n * @param {any} eventFrame - The Event Frame data.\n * @returns - Grafana Annotation\n *\n * @memberOf PiWebApiDatasource\n */\n private eventFrameToAnnotation(\n annotationOptions: any,\n endTime: any,\n eventFrame: any,\n attributeDataItems: any\n ): AnnotationEvent {\n if (annotationOptions.regex && annotationOptions.regex.enable) {\n eventFrame.Name = eventFrame.Name.replace(\n new RegExp(annotationOptions.regex.search),\n annotationOptions.regex.replace\n );\n }\n\n var attributeText = '';\n if (attributeDataItems) {\n each(attributeDataItems, (attributeData: any) => {\n const attributeValue = attributeData.Value.Value\n ? attributeData.Value.Value.Name || attributeData.Value.Value.Value || attributeData.Value.Value\n : null;\n attributeText += '
' + attributeData.Name + ': ' + attributeValue;\n });\n }\n return {\n annotation: annotationOptions,\n title: (endTime ? 'END ' : annotationOptions.showEndTime ? 'START ' : '') + annotationOptions.name,\n time: new Date(endTime ? eventFrame.EndTime : eventFrame.StartTime).getTime(),\n text:\n eventFrame.Name + attributeText + '
Start: ' + eventFrame.StartTime + '
End: ' + eventFrame.EndTime,\n };\n }\n\n /**\n * Builds the PIWebAPI query parameters.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - PIWebAPI query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private buildQueryParameters(options: DataQueryRequest) {\n options.targets = filter(options.targets, (target) => {\n if (!target || !target.target) {\n return false;\n }\n return !target.target.startsWith('Select AF');\n });\n\n options.targets = map(options.targets, (target) => {\n const ds = this;\n var tar = {\n target: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPath: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPathArray: [\n {\n path: this.templateSrv.replace(target.elementPath, options.scopedVars),\n variable: '',\n } as PiwebapiElementPath,\n ],\n attributes: map(target.attributes, (att) =>\n this.templateSrv.replace(att.value?.value || att, options.scopedVars)\n ),\n segments: map(target.segments, (att) => this.templateSrv.replace(att.value?.value, options.scopedVars)),\n display: target.display,\n refId: target.refId,\n hide: target.hide,\n interpolate: target.interpolate || { enable: false },\n recordedValues: target.recordedValues || { enable: false },\n digitalStates: target.digitalStates || { enable: false },\n webid: target.webid,\n webids: target.webids || [],\n regex: target.regex || { enable: false },\n expression: target.expression || '',\n summary: target.summary || { types: [] },\n startTime: options.range.from,\n endTime: options.range.to,\n isPiPoint: target.isPiPoint,\n scopedVars: options.scopedVars,\n };\n\n if (tar.expression) {\n tar.expression = this.templateSrv.replace(tar.expression, options.scopedVars);\n }\n\n if (tar.summary.types !== undefined) {\n tar.summary.types = filter(tar.summary.types, (item) => {\n return item !== undefined && item !== null && item !== '';\n });\n }\n\n // explode All or Multi-selection\n const varsKeys = keys(options.scopedVars);\n this.templateSrv.getVariables().forEach((v: any) => {\n if (ds.isAllSelected(v.current) && varsKeys.indexOf(v.name) < 0) {\n // All selection\n const variables = v.options.filter((o: any) => !o.selected);\n // attributes\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) =>\n !!v.allValue ? attr.replace(v.allValue, vv.value) : attr.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value)\n )\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, v.allValue);\n } else if (Array.isArray(v.current.text) && varsKeys.indexOf(v.name) < 0) {\n // Multi-selection\n const variables = v.options.filter((o: any) => o.selected);\n // attributes\n const query = v.current.value.join(',');\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) => attr.replace(`{${query}}`, vv.value))\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, `{${query}}`);\n }\n });\n\n console.log('tar', tar);\n\n return tar;\n });\n\n return options;\n }\n\n /**\n * Datasource Implementation. Primary entry point for data source.\n * This takes the panel configuration and queries, sends them to PI Web API and parses the response.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - Promise of data in the format for Grafana panels.\n *\n * @memberOf PiWebApiDatasource\n */\n async query(options: DataQueryRequest): Promise {\n var ds = this;\n var query = this.buildQueryParameters(options);\n query.targets = filter(query.targets, (t) => !t.hide);\n\n if (query.targets.length <= 0) {\n return Promise.resolve({ data: [] });\n } else {\n return Promise.all(ds.getStream(query)).then((targetResponses) => {\n let flattened: PiwebapTargetRsp[] = [];\n each(targetResponses, (tr) => {\n each(tr, (item) => flattened.push(item));\n });\n const response: DataQueryResponse = {\n data: flattened\n .sort((a, b) => {\n return +(a.target > b.target) || +(a.target === b.target) - 1;\n })\n .map((d) => toDataFrame(d)),\n };\n return response;\n });\n }\n }\n\n /**\n * Datasource Implementation.\n * Used for testing datasource in datasource configuration pange\n *\n * @returns - Success or failure message.\n *\n * @memberOf PiWebApiDatasource\n */\n testDatasource(): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + '/',\n method: 'GET',\n })\n .then((response: any) => {\n if (response.status === 200) {\n return { status: 'success', message: 'Data source is working', title: 'Success' };\n }\n throw new Error('Failed');\n });\n }\n\n /**\n * Datasource Implementation.\n * This queries PI Web API for Event Frames and converts them into annotations.\n *\n * @param {any} options - Annotation options, usually the Event Frame Category.\n * @returns - A Grafana annotation.\n *\n * @memberOf PiWebApiDatasource\n */\n annotationQuery(options: any): Promise {\n if (!this.afdatabase.webid) {\n return Promise.resolve([]);\n }\n\n var categoryName = options.annotation.query.categoryName\n ? this.templateSrv.replace(options.annotation.query.categoryName, options.scopedVars, 'glob')\n : null;\n var nameFilter = options.annotation.query.nameFilter\n ? this.templateSrv.replace(options.annotation.query.nameFilter, options.scopedVars, 'glob')\n : null;\n var templateName = options.annotation.template ? options.annotation.template.Name : null;\n var annotationOptions = {\n name: options.annotation.name,\n datasource: options.annotation.datasource,\n enable: options.annotation.enable,\n iconColor: options.annotation.iconColor,\n showEndTime: options.annotation.showEndTime,\n regex: options.annotation.regex,\n attribute: options.annotation.attribute,\n categoryName: categoryName,\n templateName: templateName,\n nameFilter: nameFilter,\n };\n\n var filter = [];\n if (!!annotationOptions.categoryName) {\n filter.push('categoryName=' + annotationOptions.categoryName);\n }\n if (!!annotationOptions.nameFilter) {\n filter.push('nameFilter=' + annotationOptions.nameFilter);\n }\n if (!!annotationOptions.templateName) {\n filter.push('templateName=' + annotationOptions.templateName);\n }\n if (!filter.length) {\n return Promise.resolve([]);\n }\n filter.push('startTime=' + options.range.from.toJSON());\n filter.push('endTime=' + options.range.to.toJSON());\n\n if (annotationOptions.attribute && annotationOptions.attribute.enable) {\n var resourceUrl =\n this.piwebapiurl + '/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n if (!!annotationOptions.attribute.name) {\n resourceUrl =\n this.piwebapiurl +\n '/streamsets/{0}/value?nameFilter=' +\n annotationOptions.attribute.name +\n '&selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n }\n var query: any = {};\n query['1'] = {\n Method: 'GET',\n Resource: this.piwebapiurl + '/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&'),\n };\n query['2'] = {\n Method: 'GET',\n RequestTemplate: {\n Resource: resourceUrl,\n },\n Parameters: ['$.1.Content.Items[*].WebId'],\n ParentIds: ['1'],\n };\n return this.restBatch(query).then((result: any) => {\n const data = result.data['1'].Content;\n const valueData = result.data['2'].Content;\n\n var annotations = map(data.Items, (item: any, index: any) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n false,\n item,\n valueData.Items[index].Content.Items\n );\n });\n\n if (options.annotation.showEndTime) {\n var ends = map(data.Items, (item: any, index: number) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n true,\n item,\n valueData.Items[index].Content.Items\n );\n });\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n\n return annotations;\n });\n } else {\n return this.restGet('/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&')).then(\n (result) => {\n var annotations = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, false));\n if (options.annotation.showEndTime) {\n var ends = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, true));\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n return annotations;\n }\n );\n }\n }\n\n /**\n * Builds the Grafana metric segment for use on the query user interface.\n *\n * @param {any} response - response from PI Web API.\n * @returns - Grafana metric segment.\n *\n * @memberOf PiWebApiDatasource\n */\n private metricQueryTransform(response: PiwebapiRsp[]): MetricFindValue[] {\n return map(response, (item) => {\n return {\n text: item.Name,\n expandable:\n item.HasChildren === undefined || item.HasChildren === true || (item.Path ?? '').split('\\\\').length <= 3,\n HasChildren: item.HasChildren,\n Items: item.Items ?? [],\n Path: item.Path,\n WebId: item.WebId,\n } as MetricFindValue;\n });\n }\n\n /**\n * This method does the discovery of the AF Hierarchy and populates the query user interface segments.\n *\n * @param {any} query - Parses the query configuration and builds a PI Web API query.\n * @returns - Segment information.\n *\n * @memberOf PiWebApiDatasource\n */\n metricFindQuery(query: any, queryOptions: any): Promise {\n var ds = this;\n var querydepth = ['servers', 'databases', 'databaseElements', 'elements'];\n if (typeof query === 'string') {\n query = JSON.parse(query as string);\n }\n if (queryOptions.isPiPoint) {\n query.path = this.templateSrv.replace(query.path, queryOptions);\n } else {\n if (query.path === '') {\n query.type = querydepth[0];\n } else if (query.type !== 'attributes') {\n query.type = querydepth[Math.max(0, Math.min(query.path.split('\\\\').length, querydepth.length - 1))];\n }\n query.path = this.templateSrv.replace(query.path, queryOptions);\n query.path = query.path.replace(/\\{([^\\\\])*\\}/gi, (r: string) => r.substring(1, r.length - 2).split(',')[0]);\n }\n\n query.filter = query.filter ?? '*';\n\n if (query.type === 'servers') {\n return ds.afserver?.name\n ? ds\n .getAssetServer(ds.afserver.name)\n .then((result: PiwebapiRsp) => [result])\n .then(ds.metricQueryTransform)\n : ds.getAssetServers().then(ds.metricQueryTransform);\n } else if (query.type === 'databases') {\n return ds\n .getAssetServer(query.path)\n .then((server) => ds.getDatabases(server.WebId ?? '', {}))\n .then(ds.metricQueryTransform);\n } else if (query.type === 'databaseElements') {\n return ds\n .getDatabase(query.path)\n .then((db) =>\n ds.getDatabaseElements(db.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'elements') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getElements(element.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'attributes') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getAttributes(element.WebId ?? '', {\n searchFullHierarchy: 'true',\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Path',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'dataserver') {\n return ds.getDataServers().then(ds.metricQueryTransform);\n } else if (query.type === 'pipoint') {\n return ds.piPointSearch(query.webId, query.pointName).then(ds.metricQueryTransform);\n }\n return Promise.reject('Bad type');\n }\n\n /**\n * Gets the url of summary data from the query configuration.\n *\n * @param {any} summary - Query summary configuration.\n * @returns - URL append string.\n *\n * @memberOf PiWebApiDatasource\n */\n getSummaryUrl(summary: any) {\n if (summary.interval.trim() === '') {\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis\n );\n }\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis +\n '&summaryDuration=' +\n summary.interval.trim()\n );\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} value - A list of PIWebAPI values.\n * @param {any} target - The target Grafana metric.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @returns - An array of Grafana value, timestamp pairs.\n *\n */\n parsePiPointValueList(value: any[], target: any, isSummary: boolean) {\n var api = this;\n var datapoints: any[] = [];\n each(value, (item) => {\n // @ts-ignore\n var { grafanaDataPoint, previousValue, drop } = this.noDataReplace(\n isSummary ? item.Value : item,\n target.summary.nodata,\n api.parsePiPointValue(isSummary ? item.Value : item, target, isSummary)\n );\n if (!drop) {\n datapoints.push(grafanaDataPoint);\n }\n });\n return datapoints;\n }\n\n /**\n * Convert a PI Point value to use Grafana value/timestamp.\n *\n * @param {any} value - PI Point value.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @param {any} target - The target grafana metric.\n * @returns - Grafana value pair.\n *\n */\n parsePiPointValue(value: any, target: any, isSummary: boolean) {\n let num = !isSummary && typeof value.Value === 'object' ? value.Value?.Value : value.Value;\n\n if (!value.Good || !!target.digitalStates?.enable) {\n num = (!isSummary && typeof value.Value === 'object' ? value.Value?.Name : value.Name) ?? '';\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} item - 'Item' object from PIWebAPI\n * @param {any} noDataReplacementMode - String state of how to replace 'No Data'\n * @param {any} grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns perviousValue - {any} Grafana value (value only).\n *\n */\n noDataReplace(\n item: any,\n noDataReplacementMode: any,\n grafanaDataPoint: any[]\n ): {\n grafanaDataPoint: any[];\n previousValue: any;\n drop: boolean;\n } {\n var previousValue = null;\n var drop = false;\n if (!item.Good || item.Value === 'No Data' || (item.Value?.Name && item.Value?.Name === 'No Data')) {\n if (noDataReplacementMode === 'Drop') {\n drop = true;\n } else if (noDataReplacementMode === '0') {\n grafanaDataPoint[0] = 0;\n } else if (noDataReplacementMode === 'Keep') {\n // Do nothing keep\n } else if (noDataReplacementMode === 'Null') {\n grafanaDataPoint[0] = null;\n } else if (noDataReplacementMode === 'Previous' && previousValue !== null) {\n grafanaDataPoint[0] = previousValue;\n }\n } else {\n previousValue = item.Value;\n }\n return { grafanaDataPoint, previousValue, drop };\n }\n\n /**\n * Process the response from PI Web API for a single item.\n *\n * @param {any} content - Web response data.\n * @param {any} target - The target grafana metric.\n * @param {any} name - The target metric name.\n * @returns - Parsed metric in target/datapoint json format.\n *\n * @memberOf PiWebApiDatasource\n */\n processResults(content: any, target: any, name: any, noTemplate: boolean): PiwebapTargetRsp[] {\n const api = this;\n const isSummary: boolean = target.summary && target.summary.types && target.summary.types.length > 0;\n name = noTemplate ? name : this.getPath(target.elementPathArray, content.Path) + '|' + name;\n if (target.regex && target.regex.enable && target.regex.search.length && target.regex.replace.length) {\n name = name.replace(new RegExp(target.regex.search), target.regex.replace);\n }\n if (isSummary) {\n var innerResults: any[] = [];\n var groups = groupBy(content.Items, (item: any) => item.Type);\n forOwn(groups, (value, key) => {\n innerResults.push({\n refId: target.refId,\n target: name + '[' + key + ']',\n datapoints: api.parsePiPointValueList(value, target, isSummary),\n });\n });\n return innerResults;\n }\n return [\n {\n refId: target.refId,\n target: name,\n datapoints: api.parsePiPointValueList(content.Items, target, isSummary),\n },\n ];\n }\n\n /** PRIVATE SECTION */\n\n /**\n * Check if all items are selected.\n *\n * @param {any} current the current variable selection\n * @return {boolean} true if all value is selected, false otherwise\n */\n private isAllSelected(current: any): boolean {\n if (!current) {\n return false;\n }\n if (Array.isArray(current.text)) {\n return current.text.indexOf('All') >= 0;\n }\n return current.text === 'All';\n }\n\n /**\n * Check if the value is a number.\n *\n * @param {any} number the value to check\n * @returns {boolean} true if the value is a number, false otherwise\n */\n private checkNumber(number: any): boolean {\n return typeof number === 'number' && !Number.isNaN(number) && Number.isFinite(number);\n }\n\n /**\n * Returns a new element path list based on the panel variables.\n *\n * @param {string} elementPathArray array of element paths\n * @param {string} variables the list of variable values\n * @param {string} allValue the all value value for the variable\n * @returns {PiwebapiElementPath[]} new element path list\n */\n private getElementPath(\n elementPathArray: PiwebapiElementPath[],\n variables: any[],\n allValue: string\n ): PiwebapiElementPath[] {\n // elementPath\n let newElementPathArray: PiwebapiElementPath[] = [];\n elementPathArray.forEach((elem: PiwebapiElementPath) => {\n if ((!!allValue && elem.path.indexOf(allValue) >= 0) || (!allValue && elem.path.match(/{[a-zA-z0-9,-_]+}/gi))) {\n const temp: PiwebapiElementPath[] = variables.map((vv: any) => {\n return {\n path: !!allValue\n ? elem.path.replace(allValue, vv.value)\n : elem.path.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value),\n variable: vv.value,\n } as PiwebapiElementPath;\n });\n newElementPathArray = newElementPathArray.concat(temp);\n }\n });\n if (newElementPathArray.length) {\n return uniq(flatten(newElementPathArray));\n }\n return elementPathArray;\n }\n\n /**\n * Returns the last item of the element path.\n *\n * @param {string} path element path\n * @returns {string} last item of the element path\n */\n private getPath(elementPathArray: PiwebapiElementPath[], path: string): string {\n let splitPath = path.split('|');\n if (splitPath.length === 0) {\n return '';\n }\n if (elementPathArray.length === 0) {\n return '';\n }\n splitPath = splitPath[0].split('\\\\');\n const splitStr = splitPath.length === 0 ? '' : splitPath.pop() ?? '';\n const foundElement = elementPathArray.find((e) => path.indexOf(e.path) >= 0)?.variable;\n return foundElement ? foundElement + '|' + splitStr : splitStr;\n }\n\n /**\n * Gets historical data from a PI Web API stream source.\n *\n * @param {any} query - Grafana query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private getStream(query: any): Array> {\n const ds = this;\n var results: Array> = [];\n\n each(query.targets, (target) => {\n target.attributes = filter(target.attributes || [], (attribute) => {\n return 1 && attribute;\n });\n var url = '';\n var isSummary = target.summary && target.summary.types && target.summary.types.length > 0;\n var isInterpolated = target.interpolate && target.interpolate.enable;\n // perhaps add a check to see if interpolate override time < query.interval\n var intervalTime = target.interpolate.interval ? target.interpolate.interval : query.interval;\n var timeRange = '?startTime=' + query.range.from.toJSON() + '&endTime=' + query.range.to.toJSON();\n var targetName = target.expression || target.elementPath;\n var displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n if (target.expression) {\n url += '/calculation';\n if (isSummary) {\n url += '/summary' + timeRange + (isInterpolated ? '&sampleType=Interval&sampleInterval=' + intervalTime : '');\n } else {\n url += '/intervals' + timeRange + '&sampleInterval=' + intervalTime;\n }\n url += '&expression=' + encodeURIComponent(target.expression);\n if (target.attributes.length > 0) {\n results.push(ds.internalStream(query, target, url));\n } else {\n results.push(\n ds.restGetWebId(target.elementPath, target.isPiPoint).then((webidresponse: any) => {\n return ds\n .restPost(url + webidresponse.WebId)\n .then((response: any) => ds.processResults(response.data, target, displayName || targetName, false))\n .catch((err: any) => (ds.error = err));\n })\n );\n }\n } else {\n url += '/streamsets';\n if (isSummary) {\n url += '/summary' + timeRange + '&intervals=' + query.maxDataPoints + this.getSummaryUrl(target.summary);\n } else if (target.interpolate && target.interpolate.enable) {\n url += '/interpolated' + timeRange + '&interval=' + intervalTime;\n } else if (target.recordedValues && target.recordedValues.enable) {\n const maxNumber =\n target.recordedValues.maxNumber && !isNaN(target.recordedValues.maxNumber)\n ? target.recordedValues.maxNumber\n : 1000;\n url += '/recorded' + timeRange + '&maxCount=' + maxNumber;\n } else {\n url += '/plot' + timeRange + '&intervals=' + query.maxDataPoints;\n }\n\n results.push(ds.internalStream(query, target, url));\n }\n });\n\n return results;\n }\n\n /**\n * Return the data points from the provided Grafana query.\n *\n * @param {any} query - Grafana query.\n * @param {any} target - Grafana query target.\n * @param {string} url - The base URL for the query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private internalStream(query: any, target: any, url: string): Promise {\n const ds = this;\n const targetName = target.expression || target.elementPath;\n const displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n const noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path;\n let promises: Promise;\n\n if (noTemplate) {\n if (target.attributes.length > 1 && !target.isPiPoint) {\n promises = ds\n .restGetWebId(target.elementPath, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n } else {\n promises = Promise.all(\n map(target.attributes, (attribute: string) =>\n ds.restGetWebId(target.elementPath + '|' + attribute, target.isPiPoint)\n )\n );\n }\n } else {\n if (target.attributes.length > 1 && !target.isPiPoint) {\n promises = Promise.all(\n target.elementPathArray.map((elementPath: PiwebapiElementPath) => {\n return ds\n .restGetWebId(elementPath.path, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n })\n );\n } else {\n promises = Promise.all(\n flatten(\n map(target.attributes, (attribute: string) => {\n return target.elementPathArray.map((elementPath: PiwebapiElementPath) =>\n ds.restGetWebId(elementPath.path + '|' + attribute, target.isPiPoint)\n );\n })\n )\n );\n }\n }\n\n return promises.then((webidresponse) => {\n const query: any = {};\n each(flatten(webidresponse), (webid, index) => {\n query[index + 1] = {\n Method: 'GET',\n Resource: ds.piwebapiurl + url + '&webid=' + webid.WebId,\n };\n });\n\n return ds\n .restBatch(query)\n .then((response: any) => {\n const targetResults: any[] = [];\n each(response.data, (value, key) => {\n if (target.expression) {\n const attribute = webidresponse[parseInt(key, 10) - 1].Name;\n each(\n ds.processResults(value.Content, target, displayName || attribute || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n } else {\n each(value.Content.Items, (item) => {\n each(\n ds.processResults(item, target, displayName || item.Name || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n });\n }\n });\n return targetResults;\n })\n .catch((err: any) => (ds.error = err));\n });\n }\n\n /**\n * Abstraction for calling the PI Web API REST endpoint\n *\n * @param {any} path - the path to append to the base server URL.\n * @returns - The full URL.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGet(path: string): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n return response as PiwebapiInternalRsp;\n });\n }\n\n /**\n * Resolve a Grafana query into a PI Web API webid. Uses client side cache when possible to reduce lookups.\n *\n * @param {string} assetPath - The AF Path or the Pi Point Path (\\\\ServerName\\piPointName) to the asset.\n * @param {boolean} isPiPoint - Flag indicating it's a PI Point\n * @returns - URL query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGetWebId(assetPath: string, isPiPoint: boolean): Promise {\n var ds = this;\n\n // check cache\n var cachedWebId = ds.webidCache.get(assetPath);\n if (cachedWebId) {\n return Promise.resolve({ Path: assetPath, WebId: cachedWebId.WebId, Name: cachedWebId.Name });\n }\n\n let path = '';\n if (isPiPoint) {\n path = '/points?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\' + assetPath.replace('|', '\\\\');\n } else {\n // no cache hit, query server\n path =\n (assetPath.indexOf('|') >= 0\n ? '/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\'\n : '/elements?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\') + assetPath;\n }\n\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n ds.webidCache.set(assetPath, response.data);\n return { Path: assetPath, WebId: response.data.WebId, Name: response.data.Name };\n });\n }\n\n /**\n * Execute a batch query on the PI Web API.\n *\n * @param {any} batch - Batch JSON query data.\n * @returns - Batch response.\n *\n * @memberOf PiWebApiDatasource\n */\n private restBatch(batch: any) {\n return this.backendSrv.datasourceRequest({\n url: this.url + '/batch',\n data: batch,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n },\n });\n }\n\n /**\n * Execute a POST on the PI Web API.\n *\n * @param {string} path - The full url of the POST.\n * @returns - POST response data.\n *\n * @memberOf PiWebApiDatasource\n */\n private restPost(path: string) {\n return this.backendSrv.datasourceRequest({\n url: this.url,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n 'X-PIWEBAPI-HTTP-METHOD': 'GET',\n 'X-PIWEBAPI-RESOURCE-ADDRESS': path,\n },\n });\n }\n\n // Get a list of all data (PI) servers\n private getDataServers(): Promise {\n return this.restGet('/dataservers').then((response) => response.data.Items ?? []);\n }\n private getDataServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/dataservers?name=' + name).then((response) => response.data);\n }\n // Get a list of all asset (AF) servers\n private getAssetServers(): Promise {\n return this.restGet('/assetservers').then((response) => response.data.Items ?? []);\n }\n private getAssetServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/assetservers?path=\\\\\\\\' + name).then((response) => response.data);\n }\n private getDatabase(path: string | undefined): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/assetdatabases?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getDatabases(serverId: string, options?: any): Promise {\n if (!serverId) {\n return Promise.resolve([]);\n }\n return this.restGet('/assetservers/' + serverId + '/assetdatabases').then((response) => response.data.Items ?? []);\n }\n getElement(path: string): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/elements?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getEventFrameTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'EventFrame');\n });\n }\n getElementTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'Element');\n });\n }\n\n /**\n * @description\n * Get the child attributes of the current resource.\n * GET attributes/{webId}/attributes\n * @param {string} elementId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.nameFilter - The name query string used for finding attributes. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned attributes must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned attributes must be members of this template. The default is no template filter.\n * @param {string} options.valueType - Specify that returned attributes' value type must be the given value type. The default is no value type filter.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include attributes nested further than the immediate attributes of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {string} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {string} options.showExcluded - Specified if the search should include attributes with the Excluded property set. The default is 'false'.\n * @param {string} options.showHidden - Specified if the search should include attributes with the Hidden property set. The default is 'false'.\n * @param {string} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getAttributes(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/attributes' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET assetdatabases/{webId}/elements\n * @param {string} databaseId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getDatabaseElements(databaseId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/assetdatabases/' + databaseId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET elements/{webId}/elements\n * @param {string} databaseId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getElements(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * Retrieve a list of points on a specified Data Server.\n *\n * @param {string} serverId - The ID of the server. See WebID for more information.\n * @param {string} nameFilter - A query string for filtering by point name. The default is no filter. *, ?, [ab], [!ab]\n */\n private piPointSearch(serverId: string, nameFilter: string): Promise {\n let filter1 = this.templateSrv.replace(nameFilter);\n let filter2 = `${filter1}`;\n let doFilter = false;\n if (filter1 !== nameFilter) {\n const regex = /\\{(\\w|,)+\\}/gs;\n let m;\n while ((m = regex.exec(filter1)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // The result can be accessed through the `m`-variable.\n m.forEach((match, groupIndex) => {\n if (groupIndex === 0) {\n filter1 = filter1.replace(match, match.replace('{', '(').replace('}', ')').replace(',', '|'));\n filter2 = filter2.replace(match, '*');\n doFilter = true;\n }\n });\n }\n }\n return this.restGet('/dataservers/' + serverId + '/points?maxCount=20&nameFilter=' + filter2).then((results) => {\n if (!!results && !!results.data?.Items) {\n return doFilter ? results.data.Items.filter((item) => item.Name?.match(filter1)) : results.data.Items;\n }\n return [];\n });\n }\n\n /**\n * Get the PI Web API webid or PI Point.\n *\n * @param {any} target - AF Path or Point name.\n * @returns - webid.\n *\n * @memberOf PiWebApiDatasource\n */\n getWebId(target: any) {\n var ds = this;\n var isAf = target.target.indexOf('\\\\') >= 0;\n var isAttribute = target.target.indexOf('|') >= 0;\n if (!isAf && target.target.indexOf('.') === -1) {\n return Promise.resolve([{ WebId: target.target, Name: target.display || target.target }]);\n }\n\n if (!isAf) {\n // pi point lookup\n return ds.piPointSearch(this.piserver.webid!, target.target).then((results) => {\n if (results === undefined || results.length === 0) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n return results;\n });\n } else if (isAf && isAttribute) {\n // af attribute lookup\n return ds.restGet('/attributes?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n } else {\n // af element lookup\n return ds.restGet('/elements?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n }\n }\n}\n","import { DataQuery, DataSourceJsonData } from '@grafana/data';\n\nexport interface PIWebAPISelectableValue {\n webId?: string;\n value?: string;\n type?: string;\n expandable?: boolean;\n}\n\nexport interface PIWebAPIAnnotationsQuery extends DataQuery {\n target: string;\n}\n\nexport interface PIWebAPIQuery extends DataQuery {\n target: string;\n elementPath: string;\n attributes: any[];\n segments: any[];\n display: any;\n interpolate: any;\n recordedValues: any;\n digitalStates: any;\n webid: string;\n webids: string[];\n regex: any;\n summary: any;\n expression: string;\n isPiPoint: boolean;\n rawQuery?: boolean;\n query?: string;\n}\n\nexport const defaultQuery: Partial = {\n target: ';',\n attributes: [],\n segments: [],\n regex: { enable: false },\n summary: { types: [], basis: 'EventWeighted', interval: '', nodata: 'Null' },\n expression: '',\n interpolate: { enable: false },\n recordedValues: { enable: false },\n digitalStates: { enable: false },\n isPiPoint: false,\n};\n\n/**\n * These are options configured for each DataSource instance\n */\nexport interface PIWebAPIDataSourceJsonData extends DataSourceJsonData {\n url?: string;\n access?: string;\n piserver?: string;\n afserver?: string;\n afdatabase?: string;\n}\n\n/**\n * Value that is used in the backend, but never sent over HTTP to the frontend\n */\nexport interface PIWebAPISecureJsonData {\n apiKey?: string;\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_data__;","module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_runtime__;","module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_ui__;","module.exports = __WEBPACK_EXTERNAL_MODULE_lodash__;","module.exports = __WEBPACK_EXTERNAL_MODULE_react__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { DataSourcePlugin } from '@grafana/data';\nimport { AnnotationsQueryCtrl } from './AnnotationsQueryCtrl';\nimport { PIWebAPIConfigEditor } from './ConfigEditor';\nimport { PIWebAPIQueryEditor } from './QueryEditor';\nimport { PiWebAPIDatasource } from './datasource';\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\nexport const plugin = new DataSourcePlugin(\n PiWebAPIDatasource\n)\n .setConfigEditor(PIWebAPIConfigEditor)\n .setQueryEditor(PIWebAPIQueryEditor)\n .setAnnotationQueryCtrl(AnnotationsQueryCtrl);\n"],"names":["AnnotationsQueryCtrl","$scope","annotation","ctrl","datasource","query","databases","templates","regex","attribute","showEndTime","getAssetServer","afserver","name","then","result","getDatabases","WebId","getEventFrames","webid","dbs","$apply","getEventFrameTemplates","database","React","PureComponent","LegacyForms","DataSourceHttpSettings","FormField","coerceOptions","options","jsonData","url","PIWebAPIConfigEditor","event","props","onOptionsChange","piserver","target","value","afdatabase","originalOptions","onMyOptionsChange","onPIServerChange","onAFServerChange","onAFDatabaseChange","each","filter","forOwn","join","reduce","map","slice","remove","defaults","Icon","InlineField","InlineFieldRow","InlineSwitch","Input","SegmentAsync","Segment","QueryInlineField","QueryRawInlineField","QueryRowTerminator","defaultQuery","QueryEditorModeSwitcher","LABEL_WIDTH","MIN_ELEM_INPUT_WIDTH","MIN_ATTR_INPUT_WIDTH","REMOVE_LABEL","CustomLabelComponent","type","label","PIWebAPIQueryEditor","isPiPoint","segments","attributes","summaries","attributeSegment","summarySegment","calculationBasisSegment","noDataReplacementSegment","setState","onChange","item","index","state","n","checkPiPointSegments","checkAttributeSegments","length","push","expandable","piServer","segmentChangeValue","currentSegment","data","findQuery","path","getSegmentPathUpTo","Promise","resolve","metricFindQuery","Object","assign","request","scopedVars","items","altSegments","selectableValue","text","webId","variables","templateSrv","getVariables","variable","unshift","err","error","message","attributeText","getSelectedPIServer","pointName","Path","availableAttributes","val","key","segmentsArray","attributesArray","splitAttributes","split","splitElements","splice","_","getElementSegments","elements","summariesArray","cb","initialLoad","scopedVarsDone","force","metricsQuery","summary","types","buildFromTarget","_segmentsArray","updateArray","e","console","checkAfServer","onRunQuery","rawQuery","elementPath","s","queryChange","expression","onSegmentChange","bind","calcBasisValueChanged","calcNoDataValueChanged","onSummaryAction","onSummaryValueChanged","onAttributeAction","onAttributeChange","summaryTypes","calculationBasis","noDataReplacement","segment","basis","nodata","isValueEmpty","stateCallback","indexOf","part","attributeChangeValue","arr","startsWith","attributesResponse","validAttributes","substring","filteredAttributes","attrib","changedValue","replace","undefined","webID","forEach","parts","match","queryProps","interpolate","digitalStates","recordedValues","display","onIsPiPointChange","textEditorChanged","onPiPointChange","getAttributeSegmentsPI","getAttributeSegmentsAF","maxNumber","parseInt","enable","interval","getNoDataSegments","getCalcBasisSegments","getSummarySegments","search","InlineFormLabel","QueryField","labelWidth","tooltip","children","QueryEditorRow","QueryRawEditorRow","useEffect","useState","Button","ConfirmModal","isRaw","isModalOpen","setModalOpen","curry","flatten","groupBy","keys","uniq","DataSourceApi","toDataFrame","getBackendSrv","getTemplateSrv","PiWebAPIDatasource","instanceSettings","Map","basicAuth","withCredentials","backendSrv","piwebapiurl","toString","isProxy","test","access","all","getDataServer","getDatabase","annotationOptions","endTime","eventFrame","attributeDataItems","Name","RegExp","attributeData","attributeValue","Value","title","time","Date","EndTime","StartTime","getTime","targets","ds","tar","elementPathArray","att","refId","hide","webids","startTime","range","from","to","varsKeys","v","isAllSelected","current","o","selected","attr","vv","allValue","getElementPath","Array","isArray","log","buildQueryParameters","t","getStream","targetResponses","flattened","tr","response","sort","a","b","d","datasourceRequest","method","status","Error","categoryName","nameFilter","templateName","template","iconColor","toJSON","resourceUrl","Method","Resource","RequestTemplate","Parameters","ParentIds","restBatch","Content","valueData","annotations","Items","eventFrameToAnnotation","ends","end","restGet","HasChildren","queryOptions","querydepth","JSON","parse","Math","max","min","r","metricQueryTransform","getAssetServers","server","db","getDatabaseElements","selectedFields","getElement","element","getElements","getAttributes","searchFullHierarchy","getDataServers","piPointSearch","reject","trim","isSummary","api","datapoints","noDataReplace","parsePiPointValue","grafanaDataPoint","previousValue","drop","num","Good","checkNumber","Number","Timestamp","noDataReplacementMode","content","noTemplate","getPath","innerResults","groups","Type","parsePiPointValueList","number","isNaN","isFinite","newElementPathArray","elem","temp","concat","splitPath","splitStr","pop","foundElement","find","results","isInterpolated","intervalTime","timeRange","targetName","displayName","encodeURIComponent","internalStream","restGetWebId","webidresponse","restPost","processResults","maxDataPoints","getSummaryUrl","promises","datarsp","datarspa","targetResults","targetResult","headers","assetPath","cachedWebId","webidCache","get","set","batch","serverId","databaseId","InstanceType","elementId","querystring","filter1","filter2","doFilter","m","exec","lastIndex","groupIndex","isAf","isAttribute","DataSourcePlugin","plugin","setConfigEditor","setQueryEditor","setAnnotationQueryCtrl"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/plugin.json b/dist/plugin.json index c011793..ae4ae0f 100644 --- a/dist/plugin.json +++ b/dist/plugin.json @@ -32,7 +32,7 @@ } ], "screenshots": [], - "version": "2.1.2", + "version": "3.0.0", "updated": "2022-09-02" }, "dependencies": { diff --git a/src/datasource.ts b/src/datasource.ts index a0fdfb5..dfbfd08 100644 --- a/src/datasource.ts +++ b/src/datasource.ts @@ -813,7 +813,7 @@ export class PiWebAPIDatasource extends DataSourceApi; if (noTemplate) { - if (target.attributes.length > 1) { + if (target.attributes.length > 1 && !target.isPiPoint) { promises = ds .restGetWebId(target.elementPath, target.isPiPoint) .then((datarsp) => @@ -837,7 +837,7 @@ export class PiWebAPIDatasource extends DataSourceApi 1) { + if (target.attributes.length > 1 && !target.isPiPoint) { promises = Promise.all( target.elementPathArray.map((elementPath: PiwebapiElementPath) => { return ds From 67a2ac52d402aee23740095ac462defa6d6cb994 Mon Sep 17 00:00:00 2001 From: Paulo Vitor Magacho Date: Fri, 2 Sep 2022 18:56:39 -0300 Subject: [PATCH 3/4] Update build --- dist/module.js | 3437 +------------------------------------------- dist/module.js.map | 2 +- 2 files changed, 3 insertions(+), 3436 deletions(-) diff --git a/dist/module.js b/dist/module.js index ec70413..df99429 100644 --- a/dist/module.js +++ b/dist/module.js @@ -1,3436 +1,3 @@ -define(["@grafana/data","@grafana/runtime","@grafana/ui","lodash","react"], (__WEBPACK_EXTERNAL_MODULE__grafana_data__, __WEBPACK_EXTERNAL_MODULE__grafana_runtime__, __WEBPACK_EXTERNAL_MODULE__grafana_ui__, __WEBPACK_EXTERNAL_MODULE_lodash__, __WEBPACK_EXTERNAL_MODULE_react__) => { return /******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./AnnotationsQueryCtrl.ts": -/*!*********************************!*\ - !*** ./AnnotationsQueryCtrl.ts ***! - \*********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "AnnotationsQueryCtrl": () => (/* binding */ AnnotationsQueryCtrl) -/* harmony export */ }); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var AnnotationsQueryCtrl = /*#__PURE__*/function () { - AnnotationsQueryCtrl.$inject = ["$scope"]; - - /** @ngInject */ - function AnnotationsQueryCtrl($scope) { - var _this = this; - - _classCallCheck(this, AnnotationsQueryCtrl); - - _defineProperty(this, "$scope", void 0); - - _defineProperty(this, "annotation", void 0); - - _defineProperty(this, "datasource", void 0); - - this.$scope = $scope; - this.annotation = $scope.ctrl.annotation; - this.datasource = $scope.ctrl.datasource; // load defaults - - this.annotation.query = this.annotation.query || {}; - this.annotation.databases = this.annotation.databases || []; - this.annotation.templates = this.annotation.templates || []; - this.annotation.regex = this.annotation.regex || {}; - this.annotation.attribute = this.annotation.attribute || {}; - this.annotation.showEndTime = this.annotation.showEndTime || false; - this.datasource.getAssetServer(this.datasource.afserver.name).then(function (result) { - return _this.getDatabases(result.WebId); - }); - } - - _createClass(AnnotationsQueryCtrl, [{ - key: "templateChanged", - value: function templateChanged() {// do nothing - } - }, { - key: "databaseChanged", - value: function databaseChanged() { - this.annotation.templates = []; - this.getEventFrames(); - } - }, { - key: "getDatabases", - value: function getDatabases(webid) { - var _this2 = this; - - var ctrl = this; - ctrl.datasource.getDatabases(webid).then(function (dbs) { - ctrl.annotation.databases = dbs; - - _this2.$scope.$apply(); - }); - } - }, { - key: "getEventFrames", - value: function getEventFrames() { - var _this3 = this; - - var ctrl = this; - ctrl.datasource.getEventFrameTemplates(this.annotation.database.WebId).then(function (templates) { - ctrl.annotation.templates = templates; - - _this3.$scope.$apply(); - }); - } - }]); - - return AnnotationsQueryCtrl; -}(); - -_defineProperty(AnnotationsQueryCtrl, "templateUrl", 'partials/annotations.editor.html'); - -/***/ }), - -/***/ "./ConfigEditor.tsx": -/*!**************************!*\ - !*** ./ConfigEditor.tsx ***! - \**************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "PIWebAPIConfigEditor": () => (/* binding */ PIWebAPIConfigEditor) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @grafana/ui */ "@grafana/ui"); -/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } - -var _h; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - - - -var FormField = _grafana_ui__WEBPACK_IMPORTED_MODULE_1__.LegacyForms.FormField; - -var coerceOptions = function coerceOptions(options) { - return _extends({}, options, { - jsonData: _extends({}, options.jsonData, { - url: options.url - }) - }); -}; - -var PIWebAPIConfigEditor = /*#__PURE__*/function (_PureComponent) { - _inherits(PIWebAPIConfigEditor, _PureComponent); - - var _super = _createSuper(PIWebAPIConfigEditor); - - function PIWebAPIConfigEditor() { - var _this; - - _classCallCheck(this, PIWebAPIConfigEditor); - - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - _this = _super.call.apply(_super, [this].concat(args)); - - _defineProperty(_assertThisInitialized(_this), "onPIServerChange", function (event) { - var _this$props = _this.props, - onOptionsChange = _this$props.onOptionsChange, - options = _this$props.options; - - var jsonData = _extends({}, options.jsonData, { - piserver: event.target.value - }); - - onOptionsChange(_extends({}, options, { - jsonData: jsonData - })); - }); - - _defineProperty(_assertThisInitialized(_this), "onAFServerChange", function (event) { - var _this$props2 = _this.props, - onOptionsChange = _this$props2.onOptionsChange, - options = _this$props2.options; - - var jsonData = _extends({}, options.jsonData, { - afserver: event.target.value - }); - - onOptionsChange(_extends({}, options, { - jsonData: jsonData - })); - }); - - _defineProperty(_assertThisInitialized(_this), "onAFDatabaseChange", function (event) { - var _this$props3 = _this.props, - onOptionsChange = _this$props3.onOptionsChange, - options = _this$props3.options; - - var jsonData = _extends({}, options.jsonData, { - afdatabase: event.target.value - }); - - onOptionsChange(_extends({}, options, { - jsonData: jsonData - })); - }); - - _defineProperty(_assertThisInitialized(_this), "onMyOptionsChange", function (options) { - var onOptionsChange = _this.props.onOptionsChange; - onOptionsChange(coerceOptions(options)); - }); - - return _this; - } - - _createClass(PIWebAPIConfigEditor, [{ - key: "render", - value: function render() { - var originalOptions = this.props.options; - var options = coerceOptions(originalOptions); - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__.DataSourceHttpSettings, { - defaultUrl: "https://server.name/piwebapi", - dataSourceConfig: options, - onChange: this.onMyOptionsChange, - showAccessOptions: true - }), _h || (_h = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", { - className: "page-heading" - }, "PI/AF Connection Details")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { - className: "gf-form-group" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { - className: "gf-form" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(FormField, { - label: "PI Server", - labelWidth: 10, - inputWidth: 25, - onChange: this.onPIServerChange, - value: options.jsonData.piserver || '', - placeholder: "Default PI Server to use for data requests" - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { - className: "gf-form" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(FormField, { - label: "AF Server", - labelWidth: 10, - inputWidth: 25, - onChange: this.onAFServerChange, - value: options.jsonData.afserver || '', - placeholder: "Default AF Server to use for data requests" - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { - className: "gf-form" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(FormField, { - label: "AF Database", - labelWidth: 10, - inputWidth: 25, - onChange: this.onAFDatabaseChange, - value: options.jsonData.afdatabase || '', - placeholder: "Default AF Database server for AF queries" - })))); - } - }]); - - return PIWebAPIConfigEditor; -}(react__WEBPACK_IMPORTED_MODULE_0__.PureComponent); - -/***/ }), - -/***/ "./QueryEditor.tsx": -/*!*************************!*\ - !*** ./QueryEditor.tsx ***! - \*************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "PIWebAPIQueryEditor": () => (/* binding */ PIWebAPIQueryEditor) -/* harmony export */ }); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @grafana/ui */ "@grafana/ui"); -/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _components_Forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/Forms */ "./components/Forms.tsx"); -/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./types */ "./types.ts"); -/* harmony import */ var components_QueryEditorModeSwitcher__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! components/QueryEditorModeSwitcher */ "./components/QueryEditorModeSwitcher.tsx"); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } - -var _a, _QueryRowTerminator; - -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - - - - - - -var LABEL_WIDTH = 24; -var MIN_ELEM_INPUT_WIDTH = 200; -var MIN_ATTR_INPUT_WIDTH = 250; -var REMOVE_LABEL = '-REMOVE-'; - -var CustomLabelComponent = function CustomLabelComponent(props) { - if (props.value) { - var _props$label; - - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { - className: "gf-form-label ".concat(props.value.type === 'template' ? 'query-keyword' : '') - }, (_props$label = props.label) !== null && _props$label !== void 0 ? _props$label : '--no label--'); - } - - return _a || (_a = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("a", { - className: "gf-form-label query-part" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Icon, { - name: "plus" - }))); -}; - -var PIWebAPIQueryEditor = /*#__PURE__*/function (_PureComponent) { - _inherits(PIWebAPIQueryEditor, _PureComponent); - - var _super = _createSuper(PIWebAPIQueryEditor); - - function PIWebAPIQueryEditor(props) { - var _this; - - _classCallCheck(this, PIWebAPIQueryEditor); - - _this = _super.call(this, props); - - _defineProperty(_assertThisInitialized(_this), "error", void 0); - - _defineProperty(_assertThisInitialized(_this), "piServer", []); - - _defineProperty(_assertThisInitialized(_this), "availableAttributes", {}); - - _defineProperty(_assertThisInitialized(_this), "summaryTypes", void 0); - - _defineProperty(_assertThisInitialized(_this), "calculationBasis", void 0); - - _defineProperty(_assertThisInitialized(_this), "noDataReplacement", void 0); - - _defineProperty(_assertThisInitialized(_this), "state", { - isPiPoint: false, - segments: [], - attributes: [], - summaries: [], - attributeSegment: {}, - summarySegment: {}, - calculationBasisSegment: {}, - noDataReplacementSegment: {} - }); - - _defineProperty(_assertThisInitialized(_this), "segmentChangeValue", function (segments) { - var query = _this.props.query; - - _this.setState({ - segments: segments - }, function () { - return _this.onChange(_extends({}, query, { - segments: segments - })); - }); - }); - - _defineProperty(_assertThisInitialized(_this), "attributeChangeValue", function (attributes) { - var query = _this.props.query; - - _this.setState({ - attributes: attributes - }, function () { - return _this.onChange(_extends({}, query, { - attributes: attributes - })); - }); - }); - - _defineProperty(_assertThisInitialized(_this), "onPiPointChange", function (item, index) { - var attributes = _this.state.attributes.slice(0); - - if (item.label === REMOVE_LABEL) { - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.remove)(attributes, function (value, n) { - return n === index; - }); - } else { - // set current value - attributes[index] = item; - } - - _this.checkPiPointSegments(item, attributes); - }); - - _defineProperty(_assertThisInitialized(_this), "onAttributeChange", function (item, index) { - var attributes = _this.state.attributes.slice(0); // set current value - - - attributes[index] = item; - - _this.checkAttributeSegments(attributes, _this.state.segments); - }); - - _defineProperty(_assertThisInitialized(_this), "onSegmentChange", function (item, index) { - var _item$value; - - var query = _this.props.query; - - var segments = _this.state.segments.slice(0); - - if (item.label === REMOVE_LABEL) { - var _segments$value; - - segments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.slice)(segments, 0, index); - - _this.checkAttributeSegments([], segments); - - if (segments.length === 0) { - segments.push({ - label: '' - }); - } else if (!!((_segments$value = segments[segments.length - 1].value) !== null && _segments$value !== void 0 && _segments$value.expandable)) { - segments.push({ - label: 'Select Element', - value: { - value: '-Select Element-' - } - }); - } - - if (query.isPiPoint) { - _this.piServer = []; - } - - _this.segmentChangeValue(segments); - - return; - } // set current value - - - segments[index] = item; // Accept only one PI server - - if (query.isPiPoint) { - _this.piServer.push(item); - - _this.segmentChangeValue(segments); - - return; - } // changed internal selection - - - if (index < segments.length - 1) { - segments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.slice)(segments, 0, index + 1); - } - - _this.checkAttributeSegments([], segments); // add new options - - - if (!!((_item$value = item.value) !== null && _item$value !== void 0 && _item$value.expandable)) { - segments.push({ - label: 'Select Element', - value: { - value: '-Select Element-' - } - }); - } - - _this.segmentChangeValue(segments); - }); - - _defineProperty(_assertThisInitialized(_this), "getElementSegments", function (index, currentSegment) { - var _data$request$scopedV, _data$request; - - var _this$props = _this.props, - datasource = _this$props.datasource, - query = _this$props.query, - data = _this$props.data; - - var ctrl = _assertThisInitialized(_this); - - var findQuery = query.isPiPoint ? { - type: 'dataserver' - } : { - path: _this.getSegmentPathUpTo(currentSegment !== null && currentSegment !== void 0 ? currentSegment : _this.state.segments.slice(0), index) - }; - - if (!query.isPiPoint) { - var _datasource$afserver, _datasource$afserver2, _datasource$afdatabas; - - if ((_datasource$afserver = datasource.afserver) !== null && _datasource$afserver !== void 0 && _datasource$afserver.name && index === 0) { - return Promise.resolve([{ - label: datasource.afserver.name, - value: { - value: datasource.afserver.name, - expandable: true - } - }]); - } - - if ((_datasource$afserver2 = datasource.afserver) !== null && _datasource$afserver2 !== void 0 && _datasource$afserver2.name && (_datasource$afdatabas = datasource.afdatabase) !== null && _datasource$afdatabas !== void 0 && _datasource$afdatabas.name && index === 1) { - return Promise.resolve([{ - label: datasource.afdatabase.name, - value: { - value: datasource.afdatabase.name, - expandable: true - } - }]); - } // if (!findQuery.path?.length) { - // return Promise.resolve([]); - // } - - } - - return datasource.metricFindQuery(findQuery, Object.assign((_data$request$scopedV = data === null || data === void 0 ? void 0 : (_data$request = data.request) === null || _data$request === void 0 ? void 0 : _data$request.scopedVars) !== null && _data$request$scopedV !== void 0 ? _data$request$scopedV : {}, { - isPiPoint: query.isPiPoint - })).then(function (items) { - var altSegments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(items, function (item) { - var selectableValue = { - label: item.text, - value: { - webId: item.WebId, - value: item.text, - expandable: !query.isPiPoint && item.expandable - } - }; - return selectableValue; - }); - - if (altSegments.length === 0) { - return altSegments; - } // add template variables - - - var variables = datasource.templateSrv.getVariables(); - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(variables, function (variable) { - var selectableValue = { - label: '${' + variable.name + '}', - value: { - type: 'template', - value: '${' + variable.name + '}', - expandable: !query.isPiPoint - } - }; - altSegments.unshift(selectableValue); - }); - altSegments.unshift({ - label: REMOVE_LABEL, - value: { - value: REMOVE_LABEL - } - }); - return altSegments; - })["catch"](function (err) { - ctrl.error = err.message || 'Failed to issue metric query'; - return []; - }); - }); - - _defineProperty(_assertThisInitialized(_this), "getAttributeSegmentsPI", function (attributeText) { - var _data$request$scopedV2, _data$request2; - - var _this$props2 = _this.props, - datasource = _this$props2.datasource, - query = _this$props2.query, - data = _this$props2.data; - - var ctrl = _assertThisInitialized(_this); - - var findQuery = { - path: '', - webId: _this.getSelectedPIServer(), - pointName: (attributeText !== null && attributeText !== void 0 ? attributeText : '') + '*', - type: 'pipoint' - }; - var segments = []; - return datasource.metricFindQuery(findQuery, Object.assign((_data$request$scopedV2 = data === null || data === void 0 ? void 0 : (_data$request2 = data.request) === null || _data$request2 === void 0 ? void 0 : _data$request2.scopedVars) !== null && _data$request$scopedV2 !== void 0 ? _data$request$scopedV2 : {}, { - isPiPoint: query.isPiPoint - })).then(function (items) { - segments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(items, function (item) { - var selectableValue = { - path: item.Path, - label: item.text, - value: { - value: item.text, - expandable: false - } - }; - return selectableValue; - }); - segments.unshift({ - label: attributeText, - value: { - value: attributeText, - expandable: false - } - }); - segments.unshift({ - label: REMOVE_LABEL, - value: { - value: REMOVE_LABEL - } - }); - return segments; - })["catch"](function (err) { - ctrl.error = err.message || 'Failed to issue metric query'; - return segments; - }); - }); - - _defineProperty(_assertThisInitialized(_this), "getAttributeSegmentsAF", function (attributeText) { - var ctrl = _assertThisInitialized(_this); - - var segments = []; - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.forOwn)(ctrl.availableAttributes, function (val, key) { - var selectableValue = { - label: key, - value: { - value: key, - expandable: true - } - }; - segments.push(selectableValue); - }); - segments.unshift({ - label: REMOVE_LABEL, - value: { - value: REMOVE_LABEL - } - }); - return segments; - }); - - _defineProperty(_assertThisInitialized(_this), "buildFromTarget", function (query, segmentsArray, attributesArray) { - var splitAttributes = query.target.split(';'); - var splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\') : []; - - if (splitElements.length > 1 || splitElements.length === 1 && splitElements[0] !== '') { - // remove element hierarchy from attribute collection - splitAttributes.splice(0, 1); - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(splitElements, function (item, _) { - segmentsArray.push({ - label: item, - value: { - value: item, - expandable: true - } - }); - }); - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(splitAttributes, function (item, _) { - if (item !== '') { - // set current value - attributesArray.push({ - label: item, - value: { - value: item, - expandable: false - } - }); - } - }); - return _this.getElementSegments(splitElements.length + 1, segmentsArray).then(function (elements) { - if (elements.length > 0) { - segmentsArray.push({ - label: 'Select Element', - value: { - value: '-Select Element-' - } - }); - } - - return segmentsArray; - }); - } - - return Promise.resolve(segmentsArray); - }); - - _defineProperty(_assertThisInitialized(_this), "checkAfServer", function () { - var _datasource$afserver3; - - var datasource = _this.props.datasource; - var segmentsArray = []; - - if ((_datasource$afserver3 = datasource.afserver) !== null && _datasource$afserver3 !== void 0 && _datasource$afserver3.name) { - var _datasource$afdatabas2; - - segmentsArray.push({ - label: datasource.afserver.name, - value: { - value: datasource.afserver.name, - expandable: true - } - }); - - if ((_datasource$afdatabas2 = datasource.afdatabase) !== null && _datasource$afdatabas2 !== void 0 && _datasource$afdatabas2.name) { - segmentsArray.push({ - label: datasource.afdatabase.name, - value: { - value: datasource.afdatabase.name, - expandable: true - } - }); - } - - segmentsArray.push({ - label: 'Select Element', - value: { - value: '-Select Element-' - } - }); - } else { - segmentsArray.push({ - label: '' - }); - } - - return segmentsArray; - }); - - _defineProperty(_assertThisInitialized(_this), "updateArray", function (segmentsArray, attributesArray, summariesArray, isPiPoint, cb) { - _this.setState({ - segments: segmentsArray, - attributes: attributesArray, - summaries: summariesArray, - isPiPoint: isPiPoint - }, function () { - return _this.checkAttributeSegments(attributesArray, _this.state.segments).then(function () { - if (cb) { - cb(); - } - }); - }); - }); - - _defineProperty(_assertThisInitialized(_this), "scopedVarsDone", false); - - _defineProperty(_assertThisInitialized(_this), "componentDidMount", function () { - _this.initialLoad(false); - }); - - _defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function () { - var _this$props$data, _this$props$data2, _this$props$data2$req; - - if (((_this$props$data = _this.props.data) === null || _this$props$data === void 0 ? void 0 : _this$props$data.state) === 'Done' && !!((_this$props$data2 = _this.props.data) !== null && _this$props$data2 !== void 0 && (_this$props$data2$req = _this$props$data2.request) !== null && _this$props$data2$req !== void 0 && _this$props$data2$req.scopedVars) && !_this.scopedVarsDone) { - _this.scopedVarsDone = true; - - _this.initialLoad(true); - } - }); - - _defineProperty(_assertThisInitialized(_this), "initialLoad", function (force) { - var _segments$slice, _attributes$slice, _summary$types; - - var query = _this.props.query; - var metricsQuery = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.defaults)(query, _types__WEBPACK_IMPORTED_MODULE_4__.defaultQuery); - var segments = metricsQuery.segments, - attributes = metricsQuery.attributes, - summary = metricsQuery.summary, - isPiPoint = metricsQuery.isPiPoint; - var segmentsArray = force ? [] : (_segments$slice = segments === null || segments === void 0 ? void 0 : segments.slice(0)) !== null && _segments$slice !== void 0 ? _segments$slice : []; - var attributesArray = force ? [] : (_attributes$slice = attributes === null || attributes === void 0 ? void 0 : attributes.slice(0)) !== null && _attributes$slice !== void 0 ? _attributes$slice : []; - var summariesArray = (_summary$types = summary === null || summary === void 0 ? void 0 : summary.types) !== null && _summary$types !== void 0 ? _summary$types : []; - - if (!isPiPoint && segmentsArray.length === 0) { - if (query.target && query.target.length > 0 && query.target !== ';') { - attributesArray = []; // Build query from target - - _this.buildFromTarget(query, segmentsArray, attributesArray).then(function (_segmentsArray) { - _this.updateArray(_segmentsArray, attributesArray, summariesArray, isPiPoint); - })["catch"](function (e) { - return console.error(e); - }); - - return; - } else { - segmentsArray = _this.checkAfServer(); - } - } else if (isPiPoint && segmentsArray.length > 0) { - _this.piServer = segmentsArray; - } - - _this.updateArray(segmentsArray, attributesArray, summariesArray, isPiPoint, function () { - _this.onChange(query); - }); - }); - - _defineProperty(_assertThisInitialized(_this), "onChange", function (query) { - var _this$props3 = _this.props, - onChange = _this$props3.onChange, - onRunQuery = _this$props3.onRunQuery; - query.summary.types = _this.state.summaries; - - if (query.rawQuery) { - var _query$query; - - query.target = (_query$query = query.query) !== null && _query$query !== void 0 ? _query$query : ''; - - if (query.target !== '') { - var splitAttributes = query.target.split(';'); - var splitElements = splitAttributes[0].split('\\'); // remove element hierarchy from attribute collection - - splitAttributes.splice(0, 1); - query.attributes = []; - - if (splitElements.length > 1 || splitElements.length === 1 && splitElements[0] !== '') { - query.elementPath = splitElements.join('\\'); - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(splitAttributes, function (item, index) { - if (item !== '') { - query.attributes.push({ - label: item, - value: { - value: item, - expandable: false - } - }); - } - }); - } - } - } else { - query.elementPath = _this.getSegmentPathUpTo(_this.state.segments, _this.state.segments.length); - query.target = query.elementPath + ';' + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.join)(query.attributes.map(function (s) { - var _s$value; - - return (_s$value = s.value) === null || _s$value === void 0 ? void 0 : _s$value.value; - }), ';'); - } - - onChange(query); - - if (query.target && query.target.length > 0 && query.attributes.length > 0) { - onRunQuery(); - } - }); - - _defineProperty(_assertThisInitialized(_this), "stateCallback", function () { - var query = _this.props.query; - - _this.onChange(query); - }); - - _defineProperty(_assertThisInitialized(_this), "onIsPiPointChange", function (event) { - var queryChange = _this.props.query; - var isPiPoint = !queryChange.isPiPoint; - - _this.setState({ - segments: isPiPoint ? [{ - label: '' - }] : _this.checkAfServer(), - attributes: [], - isPiPoint: isPiPoint - }, function () { - _this.onChange(_extends({}, queryChange, { - expression: '', - attributes: _this.state.attributes, - segments: _this.state.segments, - isPiPoint: isPiPoint - })); - }); - }); - - _this.onSegmentChange = _this.onSegmentChange.bind(_assertThisInitialized(_this)); - _this.calcBasisValueChanged = _this.calcBasisValueChanged.bind(_assertThisInitialized(_this)); - _this.calcNoDataValueChanged = _this.calcNoDataValueChanged.bind(_assertThisInitialized(_this)); - _this.onSummaryAction = _this.onSummaryAction.bind(_assertThisInitialized(_this)); - _this.onSummaryValueChanged = _this.onSummaryValueChanged.bind(_assertThisInitialized(_this)); - _this.onAttributeAction = _this.onAttributeAction.bind(_assertThisInitialized(_this)); - _this.onAttributeChange = _this.onAttributeChange.bind(_assertThisInitialized(_this)); - _this.summaryTypes = [// 'None', // A summary type is not specified. - 'Total', // A totalization over the time range. - 'Average', // The average value over the time range. - 'Minimum', // The minimum value over the time range. - 'Maximum', // The maximum value over the time range. - 'Range', // The range value over the time range (minimum-maximum). - 'StdDev', // The standard deviation over the time range. - 'PopulationStdDev', // The population standard deviation over the time range. - 'Count', // The sum of event count over the time range when calculation basis is event weighted. The sum of event time duration over the time range when calculation basis is time weighted. - 'PercentGood', // Percent of data with good value during the calculation period. For time weighted calculations, the percentage is based on time. For event weighted calculations, the percent is based on event count. - 'All', // A convenience for requesting all available summary calculations. - 'AllForNonNumeric' // A convenience for requesting all available summary calculations for non-numeric data. - ]; - _this.calculationBasis = ['TimeWeighted', // Weight the values in the calculation by the time over which they apply. Interpolation is based on whether the attribute is stepped. Interpolated events are generated at the boundaries if necessary. - 'EventWeighted', // Evaluate values with equal weighting for each event. No interpolation is done. There must be at least one event within the time range to perform a successful calculation. Two events are required for standard deviation. In handling events at the boundary of the calculation, the AFSDK uses following rules: - 'TimeWeightedContinuous', // Apply weighting as in TimeWeighted, but do all interpolation between values as if they represent continuous data, (standard interpolation) regardless of whether the attribute is stepped. - 'TimeWeightedDiscrete', // Apply weighting as in TimeWeighted but interpolation between values is performed as if they represent discrete, unrelated values (stair step plot) regardless of the attribute is stepped. - 'EventWeightedExcludeMostRecentEvent', // The calculation behaves the same as _EventWeighted_, except in the handling of events at the boundary of summary intervals in a multiple intervals calculation. Use this option to prevent events at the intervals boundary from being double count at both intervals. With this option, events at the end time (most recent time) of an interval is not used in that interval. - 'EventWeightedExcludeEarliestEvent', // Similar to the option _EventWeightedExcludeMostRecentEvent_. Events at the start time(earliest time) of an interval is not used in that interval. - 'EventWeightedIncludeBothEnds' // Events at both ends of the interval boundaries are included in the event weighted calculation. - ]; - _this.noDataReplacement = ['Null', // replace with nulls - 'Drop', // drop items - 'Previous', // use previous value if available - '0', // replace with 0 - 'Keep' // Keep value - ]; - return _this; - } // is selected segment empty - - - _createClass(PIWebAPIQueryEditor, [{ - key: "isValueEmpty", - value: function isValueEmpty(value) { - return !value || !value.value || !value.value.length || value.value === REMOVE_LABEL; - } - }, { - key: "calcBasisValueChanged", - value: // summary calculation basis change event - function calcBasisValueChanged(segment) { - var _segment$value; - - var metricsQuery = this.props.query; - var summary = metricsQuery.summary; - summary.basis = (_segment$value = segment.value) === null || _segment$value === void 0 ? void 0 : _segment$value.value; - this.onChange(_extends({}, metricsQuery, { - summary: summary - })); - } // get summary calculation basis user interface segments - - }, { - key: "getCalcBasisSegments", - value: function getCalcBasisSegments() { - var segments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(this.calculationBasis, function (item) { - var selectableValue = { - label: item, - value: { - value: item, - expandable: true - } - }; - return selectableValue; - }); - return segments; - } // no data change event - - }, { - key: "calcNoDataValueChanged", - value: function calcNoDataValueChanged(segment) { - var _segment$value2; - - var metricsQuery = this.props.query; - var summary = metricsQuery.summary; - summary.nodata = (_segment$value2 = segment.value) === null || _segment$value2 === void 0 ? void 0 : _segment$value2.value; - this.onChange(_extends({}, metricsQuery, { - summary: summary - })); - } // get no data user interface segments - - }, { - key: "getNoDataSegments", - value: function getNoDataSegments() { - var segments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(this.noDataReplacement, function (item) { - var selectableValue = { - label: item, - value: { - value: item, - expandable: true - } - }; - return selectableValue; - }); - return segments; - } // summary query change event - - }, { - key: "onSummaryValueChanged", - value: function onSummaryValueChanged(item, index) { - var summaries = this.state.summaries.slice(0); - summaries[index] = item; - - if (this.isValueEmpty(item.value)) { - summaries.splice(index, 1); - } - - this.setState({ - summaries: summaries - }, this.stateCallback); - } // get the list of summaries available - - }, { - key: "getSummarySegments", - value: function getSummarySegments() { - var _this2 = this; - - var ctrl = this; - var summaryTypes = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(ctrl.summaryTypes, function (type) { - return _this2.state.summaries.map(function (s) { - var _s$value2; - - return (_s$value2 = s.value) === null || _s$value2 === void 0 ? void 0 : _s$value2.value; - }).indexOf(type) === -1; - }); - var segments = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(summaryTypes, function (item) { - var selectableValue = { - label: item, - value: { - value: item, - expandable: true - } - }; - return selectableValue; - }); - segments.unshift({ - label: REMOVE_LABEL, - value: { - value: REMOVE_LABEL - } - }); - return segments; - } // remove a summary from the user interface and the query - - }, { - key: "removeSummary", - value: function removeSummary(part) { - var summaries = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(this.state.summaries, function (item) { - return item !== part; - }); - this.setState({ - summaries: summaries - }); - } // add a new summary to the query - - }, { - key: "onSummaryAction", - value: function onSummaryAction(item) { - var summaries = this.state.summaries.slice(0); // if value is not empty, add new attribute segment - - if (!this.isValueEmpty(item.value)) { - var _item$value2; - - var selectableValue = { - label: item.label, - value: { - value: (_item$value2 = item.value) === null || _item$value2 === void 0 ? void 0 : _item$value2.value, - expandable: true - } - }; - summaries.push(selectableValue); - } - - this.setState({ - summarySegment: {}, - summaries: summaries - }, this.stateCallback); - } // remove an attribute from the query - - }, { - key: "removeAttribute", - value: function removeAttribute(part) { - var attributes = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(this.state.attributes, function (item) { - return item !== part; - }); - this.attributeChangeValue(attributes); - } // add an attribute to the query - - }, { - key: "onAttributeAction", - value: function onAttributeAction(item) { - var query = this.props.query; - var attributes = this.state.attributes.slice(0); // if value is not empty, add new attribute segment - - if (!this.isValueEmpty(item.value)) { - var _item$value3; - - var selectableValue = { - label: item.label, - value: { - value: (_item$value3 = item.value) === null || _item$value3 === void 0 ? void 0 : _item$value3.value, - expandable: !query.isPiPoint - } - }; - attributes.push(selectableValue); - } - - this.attributeChangeValue(attributes); - } // pi point change event - - }, { - key: "getSegmentPathUpTo", - value: - /** - * Gets the segment information and parses it to a string. - * - * @param {any} index - Last index of segment to use. - * @returns - AF Path or PI Point name. - * - * @memberOf PIWebAPIQueryEditor - */ - function getSegmentPathUpTo(segments, index) { - var arr = segments.slice(0, index); - return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.reduce)(arr, function (result, segment) { - var _segment$value$value; - - if (!segment.value) { - return ''; - } - - if (!((_segment$value$value = segment.value.value) !== null && _segment$value$value !== void 0 && _segment$value$value.startsWith('-Select'))) { - return result ? result + '\\' + segment.value.value : segment.value.value; - } - - return result; - }, ''); - } - /** - * Get the current AF Element's child attributes. Validates when the element selection changes. - * - * @returns - Collection of attributes. - * - * @memberOf PIWebAPIQueryEditor - */ - - }, { - key: "checkAttributeSegments", - value: function checkAttributeSegments(attributes, segments) { - var _data$request$scopedV3, - _data$request3, - _this3 = this; - - var _this$props4 = this.props, - datasource = _this$props4.datasource, - data = _this$props4.data; - var ctrl = this; - var findQuery = { - path: this.getSegmentPathUpTo(segments.slice(0), segments.length), - type: 'attributes' - }; - return datasource.metricFindQuery(findQuery, Object.assign((_data$request$scopedV3 = data === null || data === void 0 ? void 0 : (_data$request3 = data.request) === null || _data$request3 === void 0 ? void 0 : _data$request3.scopedVars) !== null && _data$request$scopedV3 !== void 0 ? _data$request$scopedV3 : {}, { - isPiPoint: false - })).then(function (attributesResponse) { - var validAttributes = {}; - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(attributesResponse, function (attribute) { - validAttributes[attribute.Path.substring(attribute.Path.indexOf('|') + 1)] = attribute.WebId; - }); - var filteredAttributes = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(attributes, function (attrib) { - var _attrib$value; - - var changedValue = datasource.templateSrv.replace((_attrib$value = attrib.value) === null || _attrib$value === void 0 ? void 0 : _attrib$value.value); - return validAttributes[changedValue] !== undefined; - }); - ctrl.availableAttributes = validAttributes; - - _this3.attributeChangeValue(filteredAttributes); - })["catch"](function (err) { - ctrl.error = err.message || 'Failed to issue metric query'; - - _this3.attributeChangeValue(attributes); - }); - } - /** - * Get PI points from server. - * - * @returns - Collection of attributes. - * - * @memberOf PIWebAPIQueryEditor - */ - - }, { - key: "checkPiPointSegments", - value: function checkPiPointSegments(attribute, attributes) { - var _data$request$scopedV4, _data$request4; - - var _this$props5 = this.props, - datasource = _this$props5.datasource, - data = _this$props5.data; - var ctrl = this; - var findQuery = { - path: attribute.path, - webId: ctrl.getSelectedPIServer(), - pointName: attribute.label, - type: 'pipoint' - }; - return datasource.metricFindQuery(findQuery, Object.assign((_data$request$scopedV4 = data === null || data === void 0 ? void 0 : (_data$request4 = data.request) === null || _data$request4 === void 0 ? void 0 : _data$request4.scopedVars) !== null && _data$request$scopedV4 !== void 0 ? _data$request$scopedV4 : {}, { - isPiPoint: true - })).then(function () { - ctrl.attributeChangeValue(attributes); - })["catch"](function (err) { - ctrl.error = err.message || 'Failed to issue metric query'; - ctrl.attributeChangeValue([]); - }); - } - /** - * Gets the webid of the current selected pi data server. - * - * @memberOf PIWebAPIQueryEditor - */ - - }, { - key: "getSelectedPIServer", - value: function getSelectedPIServer() { - var _this4 = this, - _this$piServer$0$valu; - - var webID = ''; - this.piServer.forEach(function (s) { - var parts = _this4.props.query.target.split(';'); - - if (parts.length >= 2) { - if (parts[0] === s.text) { - webID = s.WebId; - return; - } - } - }); - return this.piServer.length > 0 ? (_this$piServer$0$valu = this.piServer[0].value) === null || _this$piServer$0$valu === void 0 ? void 0 : _this$piServer$0$valu.webId : webID; - } - /** - * Queries PI Web API for child elements and attributes when the raw query text editor is changed. - * - * @memberOf PIWebAPIQueryEditor - */ - - }, { - key: "textEditorChanged", - value: function textEditorChanged() { - var _this5 = this; - - var _this$props6 = this.props, - query = _this$props6.query, - onChange = _this$props6.onChange; - var splitAttributes = query.target.split(';'); - var splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\') : []; - var segments = []; - var attributes = []; - - if (splitElements.length > 1 || splitElements.length === 1 && splitElements[0] !== '') { - // remove element hierarchy from attribute collection - splitAttributes.splice(0, 1); - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(splitElements, function (item, _) { - segments.push({ - label: item, - value: { - type: item.match(/\${\w+}/gi) ? 'template' : undefined, - value: item, - expandable: true - } - }); - }); - this.getElementSegments(splitElements.length + 1, segments).then(function (elements) { - if (elements.length > 0) { - segments.push({ - label: 'Select Element', - value: { - value: '-Select Element-' - } - }); - } - }); - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(splitAttributes, function (item, index) { - if (item !== '') { - attributes.push({ - label: item, - value: { - value: item, - expandable: false - } - }); - } - }); - this.updateArray(segments, attributes, this.state.summaries, query.isPiPoint, function () { - onChange(_extends({}, query, { - query: undefined, - rawQuery: false - })); - }); - } else { - segments = this.checkAfServer(); - this.updateArray(segments, this.state.attributes, this.state.summaries, query.isPiPoint, function () { - _this5.onChange(_extends({}, query, { - query: undefined, - rawQuery: false, - attributes: _this5.state.attributes, - segments: _this5.state.segments - })); - }); - } - } - /** - * Check if the AF server and database are configured in the datasoure config. - * - * @returns the segments array - * - * @memberOf PIWebAPIQueryEditor - */ - - }, { - key: "render", - value: function render() { - var _this6 = this; - - var _this$props7 = this.props, - queryProps = _this$props7.query, - _onChange = _this$props7.onChange, - onRunQuery = _this$props7.onRunQuery; - var metricsQuery = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.defaults)(queryProps, _types__WEBPACK_IMPORTED_MODULE_4__.defaultQuery); - var interpolate = metricsQuery.interpolate, - query = metricsQuery.query, - rawQuery = metricsQuery.rawQuery, - digitalStates = metricsQuery.digitalStates, - recordedValues = metricsQuery.recordedValues, - expression = metricsQuery.expression, - isPiPoint = metricsQuery.isPiPoint, - summary = metricsQuery.summary, - display = metricsQuery.display, - regex = metricsQuery.regex; - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Is Pi Point?", - labelWidth: LABEL_WIDTH - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineSwitch, { - value: isPiPoint, - onChange: this.onIsPiPointChange - })), !!rawQuery && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineFieldRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Raw Query", - labelWidth: LABEL_WIDTH, - grow: true - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { - onBlur: this.stateCallback, - value: query, - onChange: function onChange(event) { - return _onChange(_extends({}, metricsQuery, { - query: event.target.value - })); - }, - placeholder: "enter query" - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(components_QueryEditorModeSwitcher__WEBPACK_IMPORTED_MODULE_5__.QueryEditorModeSwitcher, { - isRaw: true, - onChange: function onChange(value) { - return _this6.textEditorChanged(); - } - })), !rawQuery && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { - className: "gf-form-inline" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_Forms__WEBPACK_IMPORTED_MODULE_3__.QueryRawInlineField, { - label: isPiPoint ? 'PI Server' : 'AF Elements', - tooltip: isPiPoint ? 'Select PI server.' : 'Select AF Element.' - }, this.state.segments.map(function (segment, index) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.SegmentAsync, { - key: 'element-' + index, - Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { - value: segment.value, - label: segment.label - }), - onChange: function onChange(item) { - return _this6.onSegmentChange(item, index); - }, - loadOptions: function loadOptions(query) { - return _this6.getElementSegments(index); - }, - allowCustomValue: true, - inputMinWidth: MIN_ELEM_INPUT_WIDTH - }); - }), _QueryRowTerminator || (_QueryRowTerminator = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_Forms__WEBPACK_IMPORTED_MODULE_3__.QueryRowTerminator, null)), !isPiPoint && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(components_QueryEditorModeSwitcher__WEBPACK_IMPORTED_MODULE_5__.QueryEditorModeSwitcher, { - isRaw: false, - onChange: function onChange(value) { - _onChange(_extends({}, metricsQuery, { - query: metricsQuery.target, - rawQuery: value - })); - } - }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_Forms__WEBPACK_IMPORTED_MODULE_3__.QueryInlineField, { - label: isPiPoint ? 'Pi Points' : 'Attributes' - }, this.state.attributes.map(function (attribute, index) { - if (isPiPoint) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.SegmentAsync, { - key: 'attributes-' + index, - Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { - value: attribute.value, - label: attribute.label - }), - disabled: _this6.piServer.length === 0, - onChange: function onChange(item) { - return _this6.onPiPointChange(item, index); - }, - loadOptions: _this6.getAttributeSegmentsPI, - reloadOptionsOnChange: true, - allowCustomValue: true, - inputMinWidth: MIN_ATTR_INPUT_WIDTH - }); - } - - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Segment, { - key: 'attributes-' + index, - Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { - value: attribute.value, - label: attribute.label - }), - disabled: _this6.state.segments.length <= 2, - onChange: function onChange(item) { - return _this6.onAttributeChange(item, index); - }, - options: _this6.getAttributeSegmentsAF(), - allowCustomValue: true, - inputMinWidth: MIN_ATTR_INPUT_WIDTH - }); - }), isPiPoint && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.SegmentAsync, { - Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { - value: this.state.attributeSegment.value, - label: this.state.attributeSegment.label - }), - disabled: this.piServer.length === 0, - onChange: this.onAttributeAction, - loadOptions: this.getAttributeSegmentsPI, - reloadOptionsOnChange: true, - allowCustomValue: true, - inputMinWidth: MIN_ATTR_INPUT_WIDTH - }), !isPiPoint && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Segment, { - Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { - value: this.state.attributeSegment.value, - label: this.state.attributeSegment.label - }), - disabled: this.state.segments.length <= 2, - onChange: this.onAttributeAction, - options: this.getAttributeSegmentsAF(), - allowCustomValue: true, - inputMinWidth: MIN_ATTR_INPUT_WIDTH - }))), !isPiPoint && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Calculation", - labelWidth: LABEL_WIDTH, - tooltip: "Modify all attributes by an equation. Use '.' for current item. Leave Attributes empty if you wish to perform element based calculations." - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { - onBlur: onRunQuery, - value: expression, - onChange: function onChange(event) { - return _this6.onChange(_extends({}, metricsQuery, { - expression: event.target.value - })); - }, - placeholder: "'.'*2" - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineFieldRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Max Recorded Values", - labelWidth: LABEL_WIDTH, - tooltip: 'Maximum number of recorded value to retrive from the data archive, without using interpolation.' - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { - onBlur: onRunQuery, - value: recordedValues.maxNumber, - onChange: function onChange(event) { - return _this6.onChange(_extends({}, metricsQuery, { - recordedValues: _extends({}, recordedValues, { - maxNumber: parseInt(event.target.value, 10) - }) - })); - }, - type: "number", - placeholder: "1000" - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Recorded Values", - labelWidth: LABEL_WIDTH - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineSwitch, { - value: recordedValues.enable, - onChange: function onChange() { - return _this6.onChange(_extends({}, metricsQuery, { - recordedValues: _extends({}, recordedValues, { - enable: !recordedValues.enable - }) - })); - } - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Digital States", - labelWidth: LABEL_WIDTH - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineSwitch, { - value: digitalStates.enable, - onChange: function onChange() { - return _this6.onChange(_extends({}, metricsQuery, { - digitalStates: _extends({}, digitalStates, { - enable: !digitalStates.enable - }) - })); - } - }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineFieldRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Interpolate Period", - labelWidth: LABEL_WIDTH, - tooltip: "Override time between sampling, e.g. '30s'. Defaults to timespan/chart width." - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { - onBlur: onRunQuery, - value: interpolate.interval, - onChange: function onChange(event) { - return _this6.onChange(_extends({}, metricsQuery, { - interpolate: _extends({}, interpolate, { - interval: event.target.value - }) - })); - }, - placeholder: "30s" - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Interpolate", - labelWidth: LABEL_WIDTH - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineSwitch, { - value: interpolate.enable, - onChange: function onChange() { - return _this6.onChange(_extends({}, metricsQuery, { - interpolate: _extends({}, interpolate, { - enable: !interpolate.enable - }) - })); - } - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Replace Bad Data", - labelWidth: LABEL_WIDTH, - tooltip: 'Replacement for bad quality values.' - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Segment, { - Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { - value: { - value: summary.nodata - }, - label: summary.nodata - }), - onChange: this.calcNoDataValueChanged, - options: this.getNoDataSegments(), - allowCustomValue: true - }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineFieldRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Summary Period", - labelWidth: LABEL_WIDTH, - tooltip: "Override time between sampling, e.g. '30s'." - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { - onBlur: onRunQuery, - value: summary.interval, - onChange: function onChange(event) { - return _onChange(_extends({}, metricsQuery, { - summary: _extends({}, summary, { - interval: event.target.value - }) - })); - }, - placeholder: "30s" - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Basis", - labelWidth: LABEL_WIDTH, - tooltip: 'Defines the possible calculation options when performing summary calculations over time-series data.' - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Segment, { - Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { - value: { - value: summary.basis - }, - label: summary.basis - }), - onChange: this.calcBasisValueChanged, - options: this.getCalcBasisSegments(), - allowCustomValue: true - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Summaries", - labelWidth: LABEL_WIDTH, - tooltip: 'Replacement for bad quality values.' - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineFieldRow, null, this.state.summaries.map(function (s, index) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Segment, { - key: 'summaries-' + index, - Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { - value: s.value, - label: s.label - }), - onChange: function onChange(item) { - return _this6.onSummaryValueChanged(item, index); - }, - options: _this6.getSummarySegments(), - allowCustomValue: true - }); - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Segment, { - Component: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(CustomLabelComponent, { - value: this.state.summarySegment.value, - label: this.state.summarySegment.label - }), - onChange: this.onSummaryAction, - options: this.getSummarySegments(), - allowCustomValue: true - })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineFieldRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Display Name", - labelWidth: LABEL_WIDTH, - tooltip: 'If single attribute, modify display name. Otherwise use regex to modify display name.' - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { - onBlur: onRunQuery, - value: display, - onChange: function onChange(event) { - return _this6.onChange(_extends({}, metricsQuery, { - display: event.target.value - })); - }, - placeholder: "Display" - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Enable Regex Replace", - labelWidth: LABEL_WIDTH - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineSwitch, { - value: regex.enable, - onChange: function onChange() { - _this6.onChange(_extends({}, metricsQuery, { - regex: _extends({}, regex, { - enable: !regex.enable - }) - })); - } - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Search", - labelWidth: LABEL_WIDTH - 8 - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { - onBlur: onRunQuery, - value: regex.search, - onChange: function onChange(event) { - return _this6.onChange(_extends({}, metricsQuery, { - regex: _extends({}, regex, { - search: event.target.value - }) - })); - }, - placeholder: "(.*)" - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.InlineField, { - label: "Replace", - labelWidth: LABEL_WIDTH - 8 - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_2__.Input, { - onBlur: onRunQuery, - value: regex.replace, - onChange: function onChange(event) { - return _this6.onChange(_extends({}, metricsQuery, { - regex: _extends({}, regex, { - replace: event.target.value - }) - })); - }, - placeholder: "$1" - })))); - } - }]); - - return PIWebAPIQueryEditor; -}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent); - -/***/ }), - -/***/ "./components/Forms.tsx": -/*!******************************!*\ - !*** ./components/Forms.tsx ***! - \******************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "QueryEditorRow": () => (/* binding */ QueryEditorRow), -/* harmony export */ "QueryField": () => (/* binding */ QueryField), -/* harmony export */ "QueryInlineField": () => (/* binding */ QueryInlineField), -/* harmony export */ "QueryRawEditorRow": () => (/* binding */ QueryRawEditorRow), -/* harmony export */ "QueryRawInlineField": () => (/* binding */ QueryRawInlineField), -/* harmony export */ "QueryRowTerminator": () => (/* binding */ QueryRowTerminator) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @grafana/ui */ "@grafana/ui"); -/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__); -var _div, _QueryRowTerminator; - -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - - - -var QueryField = function QueryField(_ref) { - var label = _ref.label, - _ref$labelWidth = _ref.labelWidth, - labelWidth = _ref$labelWidth === void 0 ? 12 : _ref$labelWidth, - tooltip = _ref.tooltip, - children = _ref.children; - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__.InlineFormLabel, { - width: labelWidth, - tooltip: tooltip - }, label), children); -}; -var QueryRowTerminator = function QueryRowTerminator() { - return _div || (_div = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { - className: "gf-form gf-form--grow" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { - className: "gf-form-label gf-form-label--grow" - }))); -}; -var QueryInlineField = function QueryInlineField(_ref2) { - var props = _extends({}, _ref2); - - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(QueryEditorRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(QueryField, props)); -}; -var QueryEditorRow = function QueryEditorRow(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { - className: "gf-form-inline" - }, props.children, _QueryRowTerminator || (_QueryRowTerminator = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(QueryRowTerminator, null))); -}; -var QueryRawInlineField = function QueryRawInlineField(_ref3) { - var props = _extends({}, _ref3); - - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(QueryRawEditorRow, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(QueryField, props)); -}; -var QueryRawEditorRow = function QueryRawEditorRow(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, props.children); -}; - -/***/ }), - -/***/ "./components/QueryEditorModeSwitcher.tsx": -/*!************************************************!*\ - !*** ./components/QueryEditorModeSwitcher.tsx ***! - \************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "QueryEditorModeSwitcher": () => (/* binding */ QueryEditorModeSwitcher) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @grafana/ui */ "@grafana/ui"); -/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__); -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } - -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - - - -var QueryEditorModeSwitcher = function QueryEditorModeSwitcher(_ref) { - var isRaw = _ref.isRaw, - onChange = _ref.onChange; - - var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false), - _useState2 = _slicedToArray(_useState, 2), - isModalOpen = _useState2[0], - setModalOpen = _useState2[1]; - - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { - // if the isRaw changes, we hide the modal - setModalOpen(false); - }, [isRaw]); - - if (isRaw) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__.Button, { - "aria-label": "Switch to visual editor", - icon: "pen", - variant: "secondary", - type: "button", - onClick: function onClick() { - // we show the are-you-sure modal - setModalOpen(true); - } - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__.ConfirmModal, { - isOpen: isModalOpen, - title: "Switch to visual editor mode", - body: "Are you sure to switch to visual editor mode? You will lose the changes done in raw query mode.", - confirmText: "Yes, switch to editor mode", - dismissText: "No, stay in raw query mode", - onConfirm: function onConfirm() { - onChange(false); - }, - onDismiss: function onDismiss() { - setModalOpen(false); - } - })); - } else { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_1__.Button, { - "aria-label": "Switch to text editor", - icon: "pen", - variant: "secondary", - type: "button", - onClick: function onClick() { - onChange(true); - } - }); - } -}; - -/***/ }), - -/***/ "./datasource.ts": -/*!***********************!*\ - !*** ./datasource.ts ***! - \***********************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "PiWebAPIDatasource": () => (/* binding */ PiWebAPIDatasource) -/* harmony export */ }); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @grafana/data */ "@grafana/data"); -/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_grafana_data__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _grafana_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @grafana/runtime */ "@grafana/runtime"); -/* harmony import */ var _grafana_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_grafana_runtime__WEBPACK_IMPORTED_MODULE_2__); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } - -function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } - -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - - - -var PiWebAPIDatasource = /*#__PURE__*/function (_DataSourceApi) { - _inherits(PiWebAPIDatasource, _DataSourceApi); - - var _super = _createSuper(PiWebAPIDatasource); - - function PiWebAPIDatasource(instanceSettings) { - var _instanceSettings$jso; - - var _this; - - _classCallCheck(this, PiWebAPIDatasource); - - _this = _super.call(this, instanceSettings); - - _defineProperty(_assertThisInitialized(_this), "piserver", void 0); - - _defineProperty(_assertThisInitialized(_this), "afserver", void 0); - - _defineProperty(_assertThisInitialized(_this), "afdatabase", void 0); - - _defineProperty(_assertThisInitialized(_this), "basicAuth", void 0); - - _defineProperty(_assertThisInitialized(_this), "withCredentials", void 0); - - _defineProperty(_assertThisInitialized(_this), "url", void 0); - - _defineProperty(_assertThisInitialized(_this), "name", void 0); - - _defineProperty(_assertThisInitialized(_this), "isProxy", false); - - _defineProperty(_assertThisInitialized(_this), "templateSrv", void 0); - - _defineProperty(_assertThisInitialized(_this), "backendSrv", void 0); - - _defineProperty(_assertThisInitialized(_this), "piwebapiurl", void 0); - - _defineProperty(_assertThisInitialized(_this), "webidCache", new Map()); - - _defineProperty(_assertThisInitialized(_this), "error", void 0); - - _this.basicAuth = instanceSettings.basicAuth; - _this.withCredentials = instanceSettings.withCredentials; - _this.url = instanceSettings.url; - _this.name = instanceSettings.name; - _this.templateSrv = (0,_grafana_runtime__WEBPACK_IMPORTED_MODULE_2__.getTemplateSrv)(); - _this.backendSrv = (0,_grafana_runtime__WEBPACK_IMPORTED_MODULE_2__.getBackendSrv)(); - _this.piwebapiurl = (_instanceSettings$jso = instanceSettings.jsonData.url) === null || _instanceSettings$jso === void 0 ? void 0 : _instanceSettings$jso.toString(); - _this.isProxy = /^http(s)?:\/\//.test(_this.url) || instanceSettings.jsonData.access === 'proxy'; - _this.piserver = { - name: (instanceSettings.jsonData || {}).piserver, - webid: undefined - }; - _this.afserver = { - name: (instanceSettings.jsonData || {}).afserver, - webid: undefined - }; - _this.afdatabase = { - name: (instanceSettings.jsonData || {}).afdatabase, - webid: undefined - }; - Promise.all([_this.getAssetServer(_this.afserver.name).then(function (result) { - return _this.afserver.webid = result.WebId; - }), _this.getDataServer(_this.piserver.name).then(function (result) { - return _this.piserver.webid = result.WebId; - }), _this.getDatabase(_this.afserver.name ? _this.afserver.name + '\\' + _this.afdatabase.name : undefined).then(function (result) { - return _this.afdatabase.webid = result.WebId; - })]); - return _this; - } - /** - * Converts a PIWebAPI Event Frame response to a Grafana Annotation - * - * @param {any} annotationOptions - Options data from configuration panel. - * @param {any} endTime - End time of the Event Frame. - * @param {any} eventFrame - The Event Frame data. - * @returns - Grafana Annotation - * - * @memberOf PiWebApiDatasource - */ - - - _createClass(PiWebAPIDatasource, [{ - key: "eventFrameToAnnotation", - value: function eventFrameToAnnotation(annotationOptions, endTime, eventFrame, attributeDataItems) { - if (annotationOptions.regex && annotationOptions.regex.enable) { - eventFrame.Name = eventFrame.Name.replace(new RegExp(annotationOptions.regex.search), annotationOptions.regex.replace); - } - - var attributeText = ''; - - if (attributeDataItems) { - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(attributeDataItems, function (attributeData) { - var attributeValue = attributeData.Value.Value ? attributeData.Value.Value.Name || attributeData.Value.Value.Value || attributeData.Value.Value : null; - attributeText += '
' + attributeData.Name + ': ' + attributeValue; - }); - } - - return { - annotation: annotationOptions, - title: (endTime ? 'END ' : annotationOptions.showEndTime ? 'START ' : '') + annotationOptions.name, - time: new Date(endTime ? eventFrame.EndTime : eventFrame.StartTime).getTime(), - text: eventFrame.Name + attributeText + '
Start: ' + eventFrame.StartTime + '
End: ' + eventFrame.EndTime - }; - } - /** - * Builds the PIWebAPI query parameters. - * - * @param {any} options - Grafana query and panel options. - * @returns - PIWebAPI query parameters. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "buildQueryParameters", - value: function buildQueryParameters(options) { - var _this2 = this; - - options.targets = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(options.targets, function (target) { - if (!target || !target.target) { - return false; - } - - return !target.target.startsWith('Select AF'); - }); - options.targets = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(options.targets, function (target) { - var ds = _this2; - var tar = { - target: _this2.templateSrv.replace(target.elementPath, options.scopedVars), - elementPath: _this2.templateSrv.replace(target.elementPath, options.scopedVars), - elementPathArray: [{ - path: _this2.templateSrv.replace(target.elementPath, options.scopedVars), - variable: '' - }], - attributes: (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(target.attributes, function (att) { - var _att$value; - - return _this2.templateSrv.replace(((_att$value = att.value) === null || _att$value === void 0 ? void 0 : _att$value.value) || att, options.scopedVars); - }), - segments: (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(target.segments, function (att) { - var _att$value2; - - return _this2.templateSrv.replace((_att$value2 = att.value) === null || _att$value2 === void 0 ? void 0 : _att$value2.value, options.scopedVars); - }), - display: target.display, - refId: target.refId, - hide: target.hide, - interpolate: target.interpolate || { - enable: false - }, - recordedValues: target.recordedValues || { - enable: false - }, - digitalStates: target.digitalStates || { - enable: false - }, - webid: target.webid, - webids: target.webids || [], - regex: target.regex || { - enable: false - }, - expression: target.expression || '', - summary: target.summary || { - types: [] - }, - startTime: options.range.from, - endTime: options.range.to, - isPiPoint: target.isPiPoint, - scopedVars: options.scopedVars - }; - - if (tar.expression) { - tar.expression = _this2.templateSrv.replace(tar.expression, options.scopedVars); - } - - if (tar.summary.types !== undefined) { - tar.summary.types = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(tar.summary.types, function (item) { - return item !== undefined && item !== null && item !== ''; - }); - } // explode All or Multi-selection - - - var varsKeys = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.keys)(options.scopedVars); - - _this2.templateSrv.getVariables().forEach(function (v) { - if (ds.isAllSelected(v.current) && varsKeys.indexOf(v.name) < 0) { - // All selection - var variables = v.options.filter(function (o) { - return !o.selected; - }); // attributes - - tar.attributes = tar.attributes.map(function (attr) { - return variables.map(function (vv) { - return !!v.allValue ? attr.replace(v.allValue, vv.value) : attr.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value); - }); - }); - tar.attributes = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.uniq)((0,lodash__WEBPACK_IMPORTED_MODULE_0__.flatten)(tar.attributes)); // elementPath - - tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, v.allValue); - } else if (Array.isArray(v.current.text) && varsKeys.indexOf(v.name) < 0) { - // Multi-selection - var _variables = v.options.filter(function (o) { - return o.selected; - }); // attributes - - - var query = v.current.value.join(','); - tar.attributes = tar.attributes.map(function (attr) { - return _variables.map(function (vv) { - return attr.replace("{".concat(query, "}"), vv.value); - }); - }); - tar.attributes = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.uniq)((0,lodash__WEBPACK_IMPORTED_MODULE_0__.flatten)(tar.attributes)); // elementPath - - tar.elementPathArray = ds.getElementPath(tar.elementPathArray, _variables, "{".concat(query, "}")); - } - }); - - console.log('tar', tar); - return tar; - }); - return options; - } - /** - * Datasource Implementation. Primary entry point for data source. - * This takes the panel configuration and queries, sends them to PI Web API and parses the response. - * - * @param {any} options - Grafana query and panel options. - * @returns - Promise of data in the format for Grafana panels. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "query", - value: function () { - var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) { - var ds, query; - return _regeneratorRuntime().wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - ds = this; - query = this.buildQueryParameters(options); - query.targets = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(query.targets, function (t) { - return !t.hide; - }); - - if (!(query.targets.length <= 0)) { - _context.next = 7; - break; - } - - return _context.abrupt("return", Promise.resolve({ - data: [] - })); - - case 7: - return _context.abrupt("return", Promise.all(ds.getStream(query)).then(function (targetResponses) { - var flattened = []; - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(targetResponses, function (tr) { - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(tr, function (item) { - return flattened.push(item); - }); - }); - var response = { - data: flattened.sort(function (a, b) { - return +(a.target > b.target) || +(a.target === b.target) - 1; - }).map(function (d) { - return (0,_grafana_data__WEBPACK_IMPORTED_MODULE_1__.toDataFrame)(d); - }) - }; - return response; - })); - - case 8: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function query(_x) { - return _query.apply(this, arguments); - } - - return query; - }() - /** - * Datasource Implementation. - * Used for testing datasource in datasource configuration pange - * - * @returns - Success or failure message. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "testDatasource", - value: function testDatasource() { - return this.backendSrv.datasourceRequest({ - url: this.url + '/', - method: 'GET' - }).then(function (response) { - if (response.status === 200) { - return { - status: 'success', - message: 'Data source is working', - title: 'Success' - }; - } - - throw new Error('Failed'); - }); - } - /** - * Datasource Implementation. - * This queries PI Web API for Event Frames and converts them into annotations. - * - * @param {any} options - Annotation options, usually the Event Frame Category. - * @returns - A Grafana annotation. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "annotationQuery", - value: function annotationQuery(options) { - var _this3 = this; - - if (!this.afdatabase.webid) { - return Promise.resolve([]); - } - - var categoryName = options.annotation.query.categoryName ? this.templateSrv.replace(options.annotation.query.categoryName, options.scopedVars, 'glob') : null; - var nameFilter = options.annotation.query.nameFilter ? this.templateSrv.replace(options.annotation.query.nameFilter, options.scopedVars, 'glob') : null; - var templateName = options.annotation.template ? options.annotation.template.Name : null; - var annotationOptions = { - name: options.annotation.name, - datasource: options.annotation.datasource, - enable: options.annotation.enable, - iconColor: options.annotation.iconColor, - showEndTime: options.annotation.showEndTime, - regex: options.annotation.regex, - attribute: options.annotation.attribute, - categoryName: categoryName, - templateName: templateName, - nameFilter: nameFilter - }; - var filter = []; - - if (!!annotationOptions.categoryName) { - filter.push('categoryName=' + annotationOptions.categoryName); - } - - if (!!annotationOptions.nameFilter) { - filter.push('nameFilter=' + annotationOptions.nameFilter); - } - - if (!!annotationOptions.templateName) { - filter.push('templateName=' + annotationOptions.templateName); - } - - if (!filter.length) { - return Promise.resolve([]); - } - - filter.push('startTime=' + options.range.from.toJSON()); - filter.push('endTime=' + options.range.to.toJSON()); - - if (annotationOptions.attribute && annotationOptions.attribute.enable) { - var resourceUrl = this.piwebapiurl + '/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name'; - - if (!!annotationOptions.attribute.name) { - resourceUrl = this.piwebapiurl + '/streamsets/{0}/value?nameFilter=' + annotationOptions.attribute.name + '&selectedFields=Items.WebId%3BItems.Value%3BItems.Name'; - } - - var query = {}; - query['1'] = { - Method: 'GET', - Resource: this.piwebapiurl + '/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&') - }; - query['2'] = { - Method: 'GET', - RequestTemplate: { - Resource: resourceUrl - }, - Parameters: ['$.1.Content.Items[*].WebId'], - ParentIds: ['1'] - }; - return this.restBatch(query).then(function (result) { - var data = result.data['1'].Content; - var valueData = result.data['2'].Content; - var annotations = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(data.Items, function (item, index) { - return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.curry)(_this3.eventFrameToAnnotation)(annotationOptions, false, item, valueData.Items[index].Content.Items); - }); - - if (options.annotation.showEndTime) { - var ends = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(data.Items, function (item, index) { - return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.curry)(_this3.eventFrameToAnnotation)(annotationOptions, true, item, valueData.Items[index].Content.Items); - }); - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(ends, function (end) { - annotations.push(end); - }); - } - - return annotations; - }); - } else { - return this.restGet('/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&')).then(function (result) { - var annotations = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(result.data.Items, (0,lodash__WEBPACK_IMPORTED_MODULE_0__.curry)(_this3.eventFrameToAnnotation)(annotationOptions, false)); - - if (options.annotation.showEndTime) { - var ends = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(result.data.Items, (0,lodash__WEBPACK_IMPORTED_MODULE_0__.curry)(_this3.eventFrameToAnnotation)(annotationOptions, true)); - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(ends, function (end) { - annotations.push(end); - }); - } - - return annotations; - }); - } - } - /** - * Builds the Grafana metric segment for use on the query user interface. - * - * @param {any} response - response from PI Web API. - * @returns - Grafana metric segment. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "metricQueryTransform", - value: function metricQueryTransform(response) { - return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(response, function (item) { - var _item$Path, _item$Items; - - return { - text: item.Name, - expandable: item.HasChildren === undefined || item.HasChildren === true || ((_item$Path = item.Path) !== null && _item$Path !== void 0 ? _item$Path : '').split('\\').length <= 3, - HasChildren: item.HasChildren, - Items: (_item$Items = item.Items) !== null && _item$Items !== void 0 ? _item$Items : [], - Path: item.Path, - WebId: item.WebId - }; - }); - } - /** - * This method does the discovery of the AF Hierarchy and populates the query user interface segments. - * - * @param {any} query - Parses the query configuration and builds a PI Web API query. - * @returns - Segment information. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "metricFindQuery", - value: function metricFindQuery(query, queryOptions) { - var _query$filter; - - var ds = this; - var querydepth = ['servers', 'databases', 'databaseElements', 'elements']; - - if (typeof query === 'string') { - query = JSON.parse(query); - } - - if (queryOptions.isPiPoint) { - query.path = this.templateSrv.replace(query.path, queryOptions); - } else { - if (query.path === '') { - query.type = querydepth[0]; - } else if (query.type !== 'attributes') { - query.type = querydepth[Math.max(0, Math.min(query.path.split('\\').length, querydepth.length - 1))]; - } - - query.path = this.templateSrv.replace(query.path, queryOptions); - query.path = query.path.replace(/\{([^\\])*\}/gi, function (r) { - return r.substring(1, r.length - 2).split(',')[0]; - }); - } - - query.filter = (_query$filter = query.filter) !== null && _query$filter !== void 0 ? _query$filter : '*'; - - if (query.type === 'servers') { - var _ds$afserver; - - return (_ds$afserver = ds.afserver) !== null && _ds$afserver !== void 0 && _ds$afserver.name ? ds.getAssetServer(ds.afserver.name).then(function (result) { - return [result]; - }).then(ds.metricQueryTransform) : ds.getAssetServers().then(ds.metricQueryTransform); - } else if (query.type === 'databases') { - return ds.getAssetServer(query.path).then(function (server) { - var _server$WebId; - - return ds.getDatabases((_server$WebId = server.WebId) !== null && _server$WebId !== void 0 ? _server$WebId : '', {}); - }).then(ds.metricQueryTransform); - } else if (query.type === 'databaseElements') { - return ds.getDatabase(query.path).then(function (db) { - var _db$WebId; - - return ds.getDatabaseElements((_db$WebId = db.WebId) !== null && _db$WebId !== void 0 ? _db$WebId : '', { - selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren' - }); - }).then(ds.metricQueryTransform); - } else if (query.type === 'elements') { - return ds.getElement(query.path).then(function (element) { - var _element$WebId; - - return ds.getElements((_element$WebId = element.WebId) !== null && _element$WebId !== void 0 ? _element$WebId : '', { - selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren', - nameFilter: query.filter - }); - }).then(ds.metricQueryTransform); - } else if (query.type === 'attributes') { - return ds.getElement(query.path).then(function (element) { - var _element$WebId2; - - return ds.getAttributes((_element$WebId2 = element.WebId) !== null && _element$WebId2 !== void 0 ? _element$WebId2 : '', { - searchFullHierarchy: 'true', - selectedFields: 'Items.WebId%3BItems.Name%3BItems.Path', - nameFilter: query.filter - }); - }).then(ds.metricQueryTransform); - } else if (query.type === 'dataserver') { - return ds.getDataServers().then(ds.metricQueryTransform); - } else if (query.type === 'pipoint') { - return ds.piPointSearch(query.webId, query.pointName).then(ds.metricQueryTransform); - } - - return Promise.reject('Bad type'); - } - /** - * Gets the url of summary data from the query configuration. - * - * @param {any} summary - Query summary configuration. - * @returns - URL append string. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "getSummaryUrl", - value: function getSummaryUrl(summary) { - if (summary.interval.trim() === '') { - return '&summaryType=' + summary.types.map(function (s) { - var _s$value; - - return (_s$value = s.value) === null || _s$value === void 0 ? void 0 : _s$value.value; - }).join('&summaryType=') + '&calculationBasis=' + summary.basis; - } - - return '&summaryType=' + summary.types.map(function (s) { - var _s$value2; - - return (_s$value2 = s.value) === null || _s$value2 === void 0 ? void 0 : _s$value2.value; - }).join('&summaryType=') + '&calculationBasis=' + summary.basis + '&summaryDuration=' + summary.interval.trim(); - } - /** - * Resolve PIWebAPI response 'value' data to value - timestamp pairs. - * - * @param {any} value - A list of PIWebAPI values. - * @param {any} target - The target Grafana metric. - * @param {any} isSummary - Boolean for tracking if data is of summary class. - * @returns - An array of Grafana value, timestamp pairs. - * - */ - - }, { - key: "parsePiPointValueList", - value: function parsePiPointValueList(value, target, isSummary) { - var _this4 = this; - - var api = this; - var datapoints = []; - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(value, function (item) { - // @ts-ignore - var _this4$noDataReplace = _this4.noDataReplace(isSummary ? item.Value : item, target.summary.nodata, api.parsePiPointValue(isSummary ? item.Value : item, target, isSummary)), - grafanaDataPoint = _this4$noDataReplace.grafanaDataPoint, - previousValue = _this4$noDataReplace.previousValue, - drop = _this4$noDataReplace.drop; - - if (!drop) { - datapoints.push(grafanaDataPoint); - } - }); - return datapoints; - } - /** - * Convert a PI Point value to use Grafana value/timestamp. - * - * @param {any} value - PI Point value. - * @param {any} isSummary - Boolean for tracking if data is of summary class. - * @param {any} target - The target grafana metric. - * @returns - Grafana value pair. - * - */ - - }, { - key: "parsePiPointValue", - value: function parsePiPointValue(value, target, isSummary) { - var _value$Value, _target$digitalStates; - - var num = !isSummary && _typeof(value.Value) === 'object' ? (_value$Value = value.Value) === null || _value$Value === void 0 ? void 0 : _value$Value.Value : value.Value; - - if (!value.Good || !!((_target$digitalStates = target.digitalStates) !== null && _target$digitalStates !== void 0 && _target$digitalStates.enable)) { - var _ref, _value$Value2; - - num = (_ref = !isSummary && _typeof(value.Value) === 'object' ? (_value$Value2 = value.Value) === null || _value$Value2 === void 0 ? void 0 : _value$Value2.Name : value.Name) !== null && _ref !== void 0 ? _ref : ''; - return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()]; - } - - return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()]; - } - /** - * Resolve PIWebAPI response 'value' data to value - timestamp pairs. - * - * @param {any} item - 'Item' object from PIWebAPI - * @param {any} noDataReplacementMode - String state of how to replace 'No Data' - * @param {any} grafanaDataPoint - Single Grafana value pair (value, timestamp). - * @returns grafanaDataPoint - Single Grafana value pair (value, timestamp). - * @returns perviousValue - {any} Grafana value (value only). - * - */ - - }, { - key: "noDataReplace", - value: function noDataReplace(item, noDataReplacementMode, grafanaDataPoint) { - var _item$Value, _item$Value2; - - var previousValue = null; - var drop = false; - - if (!item.Good || item.Value === 'No Data' || (_item$Value = item.Value) !== null && _item$Value !== void 0 && _item$Value.Name && ((_item$Value2 = item.Value) === null || _item$Value2 === void 0 ? void 0 : _item$Value2.Name) === 'No Data') { - if (noDataReplacementMode === 'Drop') { - drop = true; - } else if (noDataReplacementMode === '0') { - grafanaDataPoint[0] = 0; - } else if (noDataReplacementMode === 'Keep') {// Do nothing keep - } else if (noDataReplacementMode === 'Null') { - grafanaDataPoint[0] = null; - } else if (noDataReplacementMode === 'Previous' && previousValue !== null) { - grafanaDataPoint[0] = previousValue; - } - } else { - previousValue = item.Value; - } - - return { - grafanaDataPoint: grafanaDataPoint, - previousValue: previousValue, - drop: drop - }; - } - /** - * Process the response from PI Web API for a single item. - * - * @param {any} content - Web response data. - * @param {any} target - The target grafana metric. - * @param {any} name - The target metric name. - * @returns - Parsed metric in target/datapoint json format. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "processResults", - value: function processResults(content, target, name, noTemplate) { - var api = this; - var isSummary = target.summary && target.summary.types && target.summary.types.length > 0; - name = noTemplate ? name : this.getPath(target.elementPathArray, content.Path) + '|' + name; - - if (target.regex && target.regex.enable && target.regex.search.length && target.regex.replace.length) { - name = name.replace(new RegExp(target.regex.search), target.regex.replace); - } - - if (isSummary) { - var innerResults = []; - var groups = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.groupBy)(content.Items, function (item) { - return item.Type; - }); - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.forOwn)(groups, function (value, key) { - innerResults.push({ - refId: target.refId, - target: name + '[' + key + ']', - datapoints: api.parsePiPointValueList(value, target, isSummary) - }); - }); - return innerResults; - } - - return [{ - refId: target.refId, - target: name, - datapoints: api.parsePiPointValueList(content.Items, target, isSummary) - }]; - } - /** PRIVATE SECTION */ - - /** - * Check if all items are selected. - * - * @param {any} current the current variable selection - * @return {boolean} true if all value is selected, false otherwise - */ - - }, { - key: "isAllSelected", - value: function isAllSelected(current) { - if (!current) { - return false; - } - - if (Array.isArray(current.text)) { - return current.text.indexOf('All') >= 0; - } - - return current.text === 'All'; - } - /** - * Check if the value is a number. - * - * @param {any} number the value to check - * @returns {boolean} true if the value is a number, false otherwise - */ - - }, { - key: "checkNumber", - value: function checkNumber(number) { - return typeof number === 'number' && !Number.isNaN(number) && Number.isFinite(number); - } - /** - * Returns a new element path list based on the panel variables. - * - * @param {string} elementPathArray array of element paths - * @param {string} variables the list of variable values - * @param {string} allValue the all value value for the variable - * @returns {PiwebapiElementPath[]} new element path list - */ - - }, { - key: "getElementPath", - value: function getElementPath(elementPathArray, variables, allValue) { - // elementPath - var newElementPathArray = []; - elementPathArray.forEach(function (elem) { - if (!!allValue && elem.path.indexOf(allValue) >= 0 || !allValue && elem.path.match(/{[a-zA-z0-9,-_]+}/gi)) { - var temp = variables.map(function (vv) { - return { - path: !!allValue ? elem.path.replace(allValue, vv.value) : elem.path.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value), - variable: vv.value - }; - }); - newElementPathArray = newElementPathArray.concat(temp); - } - }); - - if (newElementPathArray.length) { - return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.uniq)((0,lodash__WEBPACK_IMPORTED_MODULE_0__.flatten)(newElementPathArray)); - } - - return elementPathArray; - } - /** - * Returns the last item of the element path. - * - * @param {string} path element path - * @returns {string} last item of the element path - */ - - }, { - key: "getPath", - value: function getPath(elementPathArray, path) { - var _splitPath$pop, _elementPathArray$fin; - - var splitPath = path.split('|'); - - if (splitPath.length === 0) { - return ''; - } - - if (elementPathArray.length === 0) { - return ''; - } - - splitPath = splitPath[0].split('\\'); - var splitStr = splitPath.length === 0 ? '' : (_splitPath$pop = splitPath.pop()) !== null && _splitPath$pop !== void 0 ? _splitPath$pop : ''; - var foundElement = (_elementPathArray$fin = elementPathArray.find(function (e) { - return path.indexOf(e.path) >= 0; - })) === null || _elementPathArray$fin === void 0 ? void 0 : _elementPathArray$fin.variable; - return foundElement ? foundElement + '|' + splitStr : splitStr; - } - /** - * Gets historical data from a PI Web API stream source. - * - * @param {any} query - Grafana query. - * @returns - Metric data. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "getStream", - value: function getStream(query) { - var _this5 = this; - - var ds = this; - var results = []; - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(query.targets, function (target) { - target.attributes = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)(target.attributes || [], function (attribute) { - return true && attribute; - }); - var url = ''; - var isSummary = target.summary && target.summary.types && target.summary.types.length > 0; - var isInterpolated = target.interpolate && target.interpolate.enable; // perhaps add a check to see if interpolate override time < query.interval - - var intervalTime = target.interpolate.interval ? target.interpolate.interval : query.interval; - var timeRange = '?startTime=' + query.range.from.toJSON() + '&endTime=' + query.range.to.toJSON(); - var targetName = target.expression || target.elementPath; - var displayName = target.display ? _this5.templateSrv.replace(target.display, query.scopedVars) : null; - - if (target.expression) { - url += '/calculation'; - - if (isSummary) { - url += '/summary' + timeRange + (isInterpolated ? '&sampleType=Interval&sampleInterval=' + intervalTime : ''); - } else { - url += '/intervals' + timeRange + '&sampleInterval=' + intervalTime; - } - - url += '&expression=' + encodeURIComponent(target.expression); - - if (target.attributes.length > 0) { - results.push(ds.internalStream(query, target, url)); - } else { - results.push(ds.restGetWebId(target.elementPath, target.isPiPoint).then(function (webidresponse) { - return ds.restPost(url + webidresponse.WebId).then(function (response) { - return ds.processResults(response.data, target, displayName || targetName, false); - })["catch"](function (err) { - return ds.error = err; - }); - })); - } - } else { - url += '/streamsets'; - - if (isSummary) { - url += '/summary' + timeRange + '&intervals=' + query.maxDataPoints + _this5.getSummaryUrl(target.summary); - } else if (target.interpolate && target.interpolate.enable) { - url += '/interpolated' + timeRange + '&interval=' + intervalTime; - } else if (target.recordedValues && target.recordedValues.enable) { - var maxNumber = target.recordedValues.maxNumber && !isNaN(target.recordedValues.maxNumber) ? target.recordedValues.maxNumber : 1000; - url += '/recorded' + timeRange + '&maxCount=' + maxNumber; - } else { - url += '/plot' + timeRange + '&intervals=' + query.maxDataPoints; - } - - results.push(ds.internalStream(query, target, url)); - } - }); - return results; - } - /** - * Return the data points from the provided Grafana query. - * - * @param {any} query - Grafana query. - * @param {any} target - Grafana query target. - * @param {string} url - The base URL for the query. - * @returns - Metric data. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "internalStream", - value: function internalStream(query, target, url) { - var ds = this; - var targetName = target.expression || target.elementPath; - var displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null; - var noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path; - var promises; - - if (noTemplate) { - if (target.attributes.length > 1 && !target.isPiPoint) { - promises = ds.restGetWebId(target.elementPath, target.isPiPoint).then(function (datarsp) { - return ds.getAttributes(datarsp.WebId, { - searchFullHierarchy: 'true', - nameFilter: '*' - }); - }).then(function (datarspa) { - return datarspa.filter(function (d) { - var _d$Path; - - return target.attributes.indexOf(d.Name) >= 0 || target.attributes.indexOf((_d$Path = d.Path) === null || _d$Path === void 0 ? void 0 : _d$Path.split('|').splice(1).join('|')) >= 0; - }); - }); - } else { - promises = Promise.all((0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(target.attributes, function (attribute) { - return ds.restGetWebId(target.elementPath + '|' + attribute, target.isPiPoint); - })); - } - } else { - if (target.attributes.length > 1 && !target.isPiPoint) { - promises = Promise.all(target.elementPathArray.map(function (elementPath) { - return ds.restGetWebId(elementPath.path, target.isPiPoint).then(function (datarsp) { - return ds.getAttributes(datarsp.WebId, { - searchFullHierarchy: 'true', - nameFilter: '*' - }); - }).then(function (datarspa) { - return datarspa.filter(function (d) { - var _d$Path2; - - return target.attributes.indexOf(d.Name) >= 0 || target.attributes.indexOf((_d$Path2 = d.Path) === null || _d$Path2 === void 0 ? void 0 : _d$Path2.split('|').splice(1).join('|')) >= 0; - }); - }); - })); - } else { - promises = Promise.all((0,lodash__WEBPACK_IMPORTED_MODULE_0__.flatten)((0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(target.attributes, function (attribute) { - return target.elementPathArray.map(function (elementPath) { - return ds.restGetWebId(elementPath.path + '|' + attribute, target.isPiPoint); - }); - }))); - } - } - - return promises.then(function (webidresponse) { - var query = {}; - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)((0,lodash__WEBPACK_IMPORTED_MODULE_0__.flatten)(webidresponse), function (webid, index) { - query[index + 1] = { - Method: 'GET', - Resource: ds.piwebapiurl + url + '&webid=' + webid.WebId - }; - }); - return ds.restBatch(query).then(function (response) { - var targetResults = []; - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(response.data, function (value, key) { - if (target.expression) { - var attribute = webidresponse[parseInt(key, 10) - 1].Name; - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(ds.processResults(value.Content, target, displayName || attribute || targetName, noTemplate), function (targetResult) { - return targetResults.push(targetResult); - }); - } else { - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(value.Content.Items, function (item) { - (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(ds.processResults(item, target, displayName || item.Name || targetName, noTemplate), function (targetResult) { - return targetResults.push(targetResult); - }); - }); - } - }); - return targetResults; - })["catch"](function (err) { - return ds.error = err; - }); - }); - } - /** - * Abstraction for calling the PI Web API REST endpoint - * - * @param {any} path - the path to append to the base server URL. - * @returns - The full URL. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "restGet", - value: function restGet(path) { - return this.backendSrv.datasourceRequest({ - url: this.url + path, - method: 'GET', - headers: { - 'Content-Type': 'application/json' - } - }).then(function (response) { - return response; - }); - } - /** - * Resolve a Grafana query into a PI Web API webid. Uses client side cache when possible to reduce lookups. - * - * @param {string} assetPath - The AF Path or the Pi Point Path (\\ServerName\piPointName) to the asset. - * @param {boolean} isPiPoint - Flag indicating it's a PI Point - * @returns - URL query parameters. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "restGetWebId", - value: function restGetWebId(assetPath, isPiPoint) { - var ds = this; // check cache - - var cachedWebId = ds.webidCache.get(assetPath); - - if (cachedWebId) { - return Promise.resolve({ - Path: assetPath, - WebId: cachedWebId.WebId, - Name: cachedWebId.Name - }); - } - - var path = ''; - - if (isPiPoint) { - path = '/points?selectedFields=WebId%3BName%3BPath&path=\\\\' + assetPath.replace('|', '\\'); - } else { - // no cache hit, query server - path = (assetPath.indexOf('|') >= 0 ? '/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\' : '/elements?selectedFields=WebId%3BName%3BPath&path=\\\\') + assetPath; - } - - return this.backendSrv.datasourceRequest({ - url: this.url + path, - method: 'GET', - headers: { - 'Content-Type': 'application/json' - } - }).then(function (response) { - ds.webidCache.set(assetPath, response.data); - return { - Path: assetPath, - WebId: response.data.WebId, - Name: response.data.Name - }; - }); - } - /** - * Execute a batch query on the PI Web API. - * - * @param {any} batch - Batch JSON query data. - * @returns - Batch response. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "restBatch", - value: function restBatch(batch) { - return this.backendSrv.datasourceRequest({ - url: this.url + '/batch', - data: batch, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'X-Requested-With': 'message/http' - } - }); - } - /** - * Execute a POST on the PI Web API. - * - * @param {string} path - The full url of the POST. - * @returns - POST response data. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "restPost", - value: function restPost(path) { - return this.backendSrv.datasourceRequest({ - url: this.url, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'X-Requested-With': 'message/http', - 'X-PIWEBAPI-HTTP-METHOD': 'GET', - 'X-PIWEBAPI-RESOURCE-ADDRESS': path - } - }); - } // Get a list of all data (PI) servers - - }, { - key: "getDataServers", - value: function getDataServers() { - return this.restGet('/dataservers').then(function (response) { - var _response$data$Items; - - return (_response$data$Items = response.data.Items) !== null && _response$data$Items !== void 0 ? _response$data$Items : []; - }); - } - }, { - key: "getDataServer", - value: function getDataServer(name) { - if (!name) { - return Promise.resolve({}); - } - - return this.restGet('/dataservers?name=' + name).then(function (response) { - return response.data; - }); - } // Get a list of all asset (AF) servers - - }, { - key: "getAssetServers", - value: function getAssetServers() { - return this.restGet('/assetservers').then(function (response) { - var _response$data$Items2; - - return (_response$data$Items2 = response.data.Items) !== null && _response$data$Items2 !== void 0 ? _response$data$Items2 : []; - }); - } - }, { - key: "getAssetServer", - value: function getAssetServer(name) { - if (!name) { - return Promise.resolve({}); - } - - return this.restGet('/assetservers?path=\\\\' + name).then(function (response) { - return response.data; - }); - } - }, { - key: "getDatabase", - value: function getDatabase(path) { - if (!path) { - return Promise.resolve({}); - } - - return this.restGet('/assetdatabases?path=\\\\' + path).then(function (response) { - return response.data; - }); - } - }, { - key: "getDatabases", - value: function getDatabases(serverId, options) { - if (!serverId) { - return Promise.resolve([]); - } - - return this.restGet('/assetservers/' + serverId + '/assetdatabases').then(function (response) { - var _response$data$Items3; - - return (_response$data$Items3 = response.data.Items) !== null && _response$data$Items3 !== void 0 ? _response$data$Items3 : []; - }); - } - }, { - key: "getElement", - value: function getElement(path) { - if (!path) { - return Promise.resolve({}); - } - - return this.restGet('/elements?path=\\\\' + path).then(function (response) { - return response.data; - }); - } - }, { - key: "getEventFrameTemplates", - value: function getEventFrameTemplates(databaseId) { - if (!databaseId) { - return Promise.resolve([]); - } - - return this.restGet('/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId').then(function (response) { - var _response$data$Items4; - - return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)((_response$data$Items4 = response.data.Items) !== null && _response$data$Items4 !== void 0 ? _response$data$Items4 : [], function (item) { - return item.InstanceType === 'EventFrame'; - }); - }); - } - }, { - key: "getElementTemplates", - value: function getElementTemplates(databaseId) { - if (!databaseId) { - return Promise.resolve([]); - } - - return this.restGet('/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId').then(function (response) { - var _response$data$Items5; - - return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.filter)((_response$data$Items5 = response.data.Items) !== null && _response$data$Items5 !== void 0 ? _response$data$Items5 : [], function (item) { - return item.InstanceType === 'Element'; - }); - }); - } - /** - * @description - * Get the child attributes of the current resource. - * GET attributes/{webId}/attributes - * @param {string} elementId - The ID of the parent resource. See WebID for more information. - * @param {Object} options - Query Options - * @param {string} options.nameFilter - The name query string used for finding attributes. The default is no filter. See Query String for more information. - * @param {string} options.categoryName - Specify that returned attributes must have this category. The default is no category filter. - * @param {string} options.templateName - Specify that returned attributes must be members of this template. The default is no template filter. - * @param {string} options.valueType - Specify that returned attributes' value type must be the given value type. The default is no value type filter. - * @param {string} options.searchFullHierarchy - Specifies if the search should include attributes nested further than the immediate attributes of the searchRoot. The default is 'false'. - * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'. - * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'. - * @param {string} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0. - * @param {string} options.showExcluded - Specified if the search should include attributes with the Excluded property set. The default is 'false'. - * @param {string} options.showHidden - Specified if the search should include attributes with the Hidden property set. The default is 'false'. - * @param {string} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000. - * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information. - */ - - }, { - key: "getAttributes", - value: function getAttributes(elementId, options) { - var querystring = '?' + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(options, function (value, key) { - return key + '=' + value; - }).join('&'); - - if (querystring === '?') { - querystring = ''; - } - - return this.restGet('/elements/' + elementId + '/attributes' + querystring).then(function (response) { - var _response$data$Items6; - - return (_response$data$Items6 = response.data.Items) !== null && _response$data$Items6 !== void 0 ? _response$data$Items6 : []; - }); - } - /** - * @description - * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource. - * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search. - * GET assetdatabases/{webId}/elements - * @param {string} databaseId - The ID of the parent resource. See WebID for more information. - * @param {Object} options - Query Options - * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information. - * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information. - * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter. - * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter. - * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information. - * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'. - * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'. - * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'. - * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0. - * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000. - * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information. - */ - - }, { - key: "getDatabaseElements", - value: function getDatabaseElements(databaseId, options) { - var querystring = '?' + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(options, function (value, key) { - return key + '=' + value; - }).join('&'); - - if (querystring === '?') { - querystring = ''; - } - - return this.restGet('/assetdatabases/' + databaseId + '/elements' + querystring).then(function (response) { - var _response$data$Items7; - - return (_response$data$Items7 = response.data.Items) !== null && _response$data$Items7 !== void 0 ? _response$data$Items7 : []; - }); - } - /** - * @description - * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource. - * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search. - * GET elements/{webId}/elements - * @param {string} databaseId - The ID of the resource to use as the root of the search. See WebID for more information. - * @param {Object} options - Query Options - * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information. - * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information. - * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter. - * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter. - * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information. - * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'. - * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'. - * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'. - * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0. - * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000. - * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information. - */ - - }, { - key: "getElements", - value: function getElements(elementId, options) { - var querystring = '?' + (0,lodash__WEBPACK_IMPORTED_MODULE_0__.map)(options, function (value, key) { - return key + '=' + value; - }).join('&'); - - if (querystring === '?') { - querystring = ''; - } - - return this.restGet('/elements/' + elementId + '/elements' + querystring).then(function (response) { - var _response$data$Items8; - - return (_response$data$Items8 = response.data.Items) !== null && _response$data$Items8 !== void 0 ? _response$data$Items8 : []; - }); - } - /** - * Retrieve a list of points on a specified Data Server. - * - * @param {string} serverId - The ID of the server. See WebID for more information. - * @param {string} nameFilter - A query string for filtering by point name. The default is no filter. *, ?, [ab], [!ab] - */ - - }, { - key: "piPointSearch", - value: function piPointSearch(serverId, nameFilter) { - var filter1 = this.templateSrv.replace(nameFilter); - var filter2 = "".concat(filter1); - var doFilter = false; - - if (filter1 !== nameFilter) { - var regex = /\{(\w|,)+\}/g; - var m; - - while ((m = regex.exec(filter1)) !== null) { - // This is necessary to avoid infinite loops with zero-width matches - if (m.index === regex.lastIndex) { - regex.lastIndex++; - } // The result can be accessed through the `m`-variable. - - - m.forEach(function (match, groupIndex) { - if (groupIndex === 0) { - filter1 = filter1.replace(match, match.replace('{', '(').replace('}', ')').replace(',', '|')); - filter2 = filter2.replace(match, '*'); - doFilter = true; - } - }); - } - } - - return this.restGet('/dataservers/' + serverId + '/points?maxCount=20&nameFilter=' + filter2).then(function (results) { - var _results$data; - - if (!!results && !!((_results$data = results.data) !== null && _results$data !== void 0 && _results$data.Items)) { - return doFilter ? results.data.Items.filter(function (item) { - var _item$Name; - - return (_item$Name = item.Name) === null || _item$Name === void 0 ? void 0 : _item$Name.match(filter1); - }) : results.data.Items; - } - - return []; - }); - } - /** - * Get the PI Web API webid or PI Point. - * - * @param {any} target - AF Path or Point name. - * @returns - webid. - * - * @memberOf PiWebApiDatasource - */ - - }, { - key: "getWebId", - value: function getWebId(target) { - var ds = this; - var isAf = target.target.indexOf('\\') >= 0; - var isAttribute = target.target.indexOf('|') >= 0; - - if (!isAf && target.target.indexOf('.') === -1) { - return Promise.resolve([{ - WebId: target.target, - Name: target.display || target.target - }]); - } - - if (!isAf) { - // pi point lookup - return ds.piPointSearch(this.piserver.webid, target.target).then(function (results) { - if (results === undefined || results.length === 0) { - return [{ - WebId: target.target, - Name: target.display || target.target - }]; - } - - return results; - }); - } else if (isAf && isAttribute) { - // af attribute lookup - return ds.restGet('/attributes?path=\\\\' + target.target).then(function (results) { - if (results.data === undefined || results.status !== 200) { - return [{ - WebId: target.target, - Name: target.display || target.target - }]; - } // rewrite name if specified - - - results.data.Name = target.display || results.data.Name; - return [results.data]; - }); - } else { - // af element lookup - return ds.restGet('/elements?path=\\\\' + target.target).then(function (results) { - if (results.data === undefined || results.status !== 200) { - return [{ - WebId: target.target, - Name: target.display || target.target - }]; - } // rewrite name if specified - - - results.data.Name = target.display || results.data.Name; - return [results.data]; - }); - } - } - }]); - - return PiWebAPIDatasource; -}(_grafana_data__WEBPACK_IMPORTED_MODULE_1__.DataSourceApi); - -/***/ }), - -/***/ "./types.ts": -/*!******************!*\ - !*** ./types.ts ***! - \******************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "defaultQuery": () => (/* binding */ defaultQuery) -/* harmony export */ }); -var defaultQuery = { - target: ';', - attributes: [], - segments: [], - regex: { - enable: false - }, - summary: { - types: [], - basis: 'EventWeighted', - interval: '', - nodata: 'Null' - }, - expression: '', - interpolate: { - enable: false - }, - recordedValues: { - enable: false - }, - digitalStates: { - enable: false - }, - isPiPoint: false -}; -/** - * These are options configured for each DataSource instance - */ - -/***/ }), - -/***/ "@grafana/data": -/*!********************************!*\ - !*** external "@grafana/data" ***! - \********************************/ -/***/ ((module) => { - -module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_data__; - -/***/ }), - -/***/ "@grafana/runtime": -/*!***********************************!*\ - !*** external "@grafana/runtime" ***! - \***********************************/ -/***/ ((module) => { - -module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_runtime__; - -/***/ }), - -/***/ "@grafana/ui": -/*!******************************!*\ - !*** external "@grafana/ui" ***! - \******************************/ -/***/ ((module) => { - -module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_ui__; - -/***/ }), - -/***/ "lodash": -/*!*************************!*\ - !*** external "lodash" ***! - \*************************/ -/***/ ((module) => { - -module.exports = __WEBPACK_EXTERNAL_MODULE_lodash__; - -/***/ }), - -/***/ "react": -/*!************************!*\ - !*** external "react" ***! - \************************/ -/***/ ((module) => { - -module.exports = __WEBPACK_EXTERNAL_MODULE_react__; - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. -(() => { -/*!*******************!*\ - !*** ./module.ts ***! - \*******************/ -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "plugin": () => (/* binding */ plugin) -/* harmony export */ }); -/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @grafana/data */ "@grafana/data"); -/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_grafana_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _AnnotationsQueryCtrl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AnnotationsQueryCtrl */ "./AnnotationsQueryCtrl.ts"); -/* harmony import */ var _ConfigEditor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ConfigEditor */ "./ConfigEditor.tsx"); -/* harmony import */ var _QueryEditor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./QueryEditor */ "./QueryEditor.tsx"); -/* harmony import */ var _datasource__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./datasource */ "./datasource.ts"); - - - - - -var plugin = new _grafana_data__WEBPACK_IMPORTED_MODULE_0__.DataSourcePlugin(_datasource__WEBPACK_IMPORTED_MODULE_4__.PiWebAPIDatasource).setConfigEditor(_ConfigEditor__WEBPACK_IMPORTED_MODULE_2__.PIWebAPIConfigEditor).setQueryEditor(_QueryEditor__WEBPACK_IMPORTED_MODULE_3__.PIWebAPIQueryEditor).setAnnotationQueryCtrl(_AnnotationsQueryCtrl__WEBPACK_IMPORTED_MODULE_1__.AnnotationsQueryCtrl); -})(); - -/******/ return __webpack_exports__; -/******/ })() -; -});; +/*! For license information please see module.js.LICENSE.txt */ +define(["@grafana/data","@grafana/runtime","@grafana/ui","lodash","react"],((e,t,n,a,r)=>(()=>{"use strict";var i=[e=>{e.exports=r},e=>{e.exports=n},t=>{t.exports=e},e=>{e.exports=a},,e=>{e.exports=t}],o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e](n,n.exports,l),n.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{l.r(u),l.d(u,{plugin:()=>me});var e=l(2);function t(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n0?r[0].split("\\"):[];return i.length>1||1===i.length&&""!==i[0]?(r.splice(0,1),(0,C.each)(i,(function(e,t){n.push({label:e,value:{value:e,expandable:!0}})})),(0,C.each)(r,(function(e,t){""!==e&&a.push({label:e,value:{value:e,expandable:!1}})})),t.getElementSegments(i.length+1,n).then((function(e){return e.length>0&&n.push({label:"Select Element",value:{value:"-Select Element-"}}),n}))):Promise.resolve(n)})),H($(t),"checkAfServer",(function(){var e,n,a=t.props.datasource,r=[];null!==(e=a.afserver)&&void 0!==e&&e.name?(r.push({label:a.afserver.name,value:{value:a.afserver.name,expandable:!0}}),null!==(n=a.afdatabase)&&void 0!==n&&n.name&&r.push({label:a.afdatabase.name,value:{value:a.afdatabase.name,expandable:!0}}),r.push({label:"Select Element",value:{value:"-Select Element-"}})):r.push({label:""});return r})),H($(t),"updateArray",(function(e,n,a,r,i){t.setState({segments:e,attributes:n,summaries:a,isPiPoint:r},(function(){return t.checkAttributeSegments(n,t.state.segments).then((function(){i&&i()}))}))})),H($(t),"scopedVarsDone",!1),H($(t),"componentDidMount",(function(){t.initialLoad(!1)})),H($(t),"componentDidUpdate",(function(){var e,n,a;"Done"===(null===(e=t.props.data)||void 0===e?void 0:e.state)&&null!==(n=t.props.data)&&void 0!==n&&null!==(a=n.request)&&void 0!==a&&a.scopedVars&&!t.scopedVarsDone&&(t.scopedVarsDone=!0,t.initialLoad(!0))})),H($(t),"initialLoad",(function(e){var n,a,r,i=t.props.query,o=(0,C.defaults)(i,F),l=o.segments,u=o.attributes,s=o.summary,c=o.isPiPoint,m=e?[]:null!==(n=null==l?void 0:l.slice(0))&&void 0!==n?n:[],h=e?[]:null!==(a=null==u?void 0:u.slice(0))&&void 0!==a?a:[],p=null!==(r=null==s?void 0:s.types)&&void 0!==r?r:[];if(c||0!==m.length)c&&m.length>0&&(t.piServer=m);else{if(i.target&&i.target.length>0&&";"!==i.target)return h=[],void t.buildFromTarget(i,m,h).then((function(e){t.updateArray(e,h,p,c)})).catch((function(e){}));m=t.checkAfServer()}t.updateArray(m,h,p,c,(function(){t.onChange(i)}))})),H($(t),"onChange",(function(e){var n,a=t.props,r=a.onChange,i=a.onRunQuery;if(e.summary.types=t.state.summaries,e.rawQuery){if(e.target=null!==(n=e.query)&&void 0!==n?n:"",""!==e.target){var o=e.target.split(";"),l=o[0].split("\\");o.splice(0,1),e.attributes=[],(l.length>1||1===l.length&&""!==l[0])&&(e.elementPath=l.join("\\"),(0,C.each)(o,(function(t,n){""!==t&&e.attributes.push({label:t,value:{value:t,expandable:!1}})})))}}else e.elementPath=t.getSegmentPathUpTo(t.state.segments,t.state.segments.length),e.target=e.elementPath+";"+(0,C.join)(e.attributes.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})),";");r(e),e.target&&e.target.length>0&&e.attributes.length>0&&i()})),H($(t),"stateCallback",(function(){var e=t.props.query;t.onChange(e)})),H($(t),"onIsPiPointChange",(function(e){var n=t.props.query,a=!n.isPiPoint;t.setState({segments:a?[{label:""}]:t.checkAfServer(),attributes:[],isPiPoint:a},(function(){t.onChange(_({},n,{expression:"",attributes:t.state.attributes,segments:t.state.segments,isPiPoint:a}))}))})),t.onSegmentChange=t.onSegmentChange.bind($(t)),t.calcBasisValueChanged=t.calcBasisValueChanged.bind($(t)),t.calcNoDataValueChanged=t.calcNoDataValueChanged.bind($(t)),t.onSummaryAction=t.onSummaryAction.bind($(t)),t.onSummaryValueChanged=t.onSummaryValueChanged.bind($(t)),t.onAttributeAction=t.onAttributeAction.bind($(t)),t.onAttributeChange=t.onAttributeChange.bind($(t)),t.summaryTypes=["Total","Average","Minimum","Maximum","Range","StdDev","PopulationStdDev","Count","PercentGood","All","AllForNonNumeric"],t.calculationBasis=["TimeWeighted","EventWeighted","TimeWeightedContinuous","TimeWeightedDiscrete","EventWeightedExcludeMostRecentEvent","EventWeightedExcludeEarliestEvent","EventWeightedIncludeBothEnds"],t.noDataReplacement=["Null","Drop","Previous","0","Keep"],t}return t=i,(n=[{key:"isValueEmpty",value:function(e){return!e||!e.value||!e.value.length||e.value===X}},{key:"calcBasisValueChanged",value:function(e){var t,n=this.props.query,a=n.summary;a.basis=null===(t=e.value)||void 0===t?void 0:t.value,this.onChange(_({},n,{summary:a}))}},{key:"getCalcBasisSegments",value:function(){return(0,C.map)(this.calculationBasis,(function(e){return{label:e,value:{value:e,expandable:!0}}}))}},{key:"calcNoDataValueChanged",value:function(e){var t,n=this.props.query,a=n.summary;a.nodata=null===(t=e.value)||void 0===t?void 0:t.value,this.onChange(_({},n,{summary:a}))}},{key:"getNoDataSegments",value:function(){return(0,C.map)(this.noDataReplacement,(function(e){return{label:e,value:{value:e,expandable:!0}}}))}},{key:"onSummaryValueChanged",value:function(e,t){var n=this.state.summaries.slice(0);n[t]=e,this.isValueEmpty(e.value)&&n.splice(t,1),this.setState({summaries:n},this.stateCallback)}},{key:"getSummarySegments",value:function(){var e=this,t=(0,C.filter)(this.summaryTypes,(function(t){return-1===e.state.summaries.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).indexOf(t)})),n=(0,C.map)(t,(function(e){return{label:e,value:{value:e,expandable:!0}}}));return n.unshift({label:X,value:{value:X}}),n}},{key:"removeSummary",value:function(e){var t=(0,C.filter)(this.state.summaries,(function(t){return t!==e}));this.setState({summaries:t})}},{key:"onSummaryAction",value:function(e){var t=this.state.summaries.slice(0);if(!this.isValueEmpty(e.value)){var n,a={label:e.label,value:{value:null===(n=e.value)||void 0===n?void 0:n.value,expandable:!0}};t.push(a)}this.setState({summarySegment:{},summaries:t},this.stateCallback)}},{key:"removeAttribute",value:function(e){var t=(0,C.filter)(this.state.attributes,(function(t){return t!==e}));this.attributeChangeValue(t)}},{key:"onAttributeAction",value:function(e){var t=this.props.query,n=this.state.attributes.slice(0);if(!this.isValueEmpty(e.value)){var a,r={label:e.label,value:{value:null===(a=e.value)||void 0===a?void 0:a.value,expandable:!t.isPiPoint}};n.push(r)}this.attributeChangeValue(n)}},{key:"getSegmentPathUpTo",value:function(e,t){var n=e.slice(0,t);return(0,C.reduce)(n,(function(e,t){var n;return t.value?null!==(n=t.value.value)&&void 0!==n&&n.startsWith("-Select")?e:e?e+"\\"+t.value.value:t.value.value:""}),"")}},{key:"checkAttributeSegments",value:function(e,t){var n,a,r=this,i=this.props,o=i.datasource,l=i.data,u=this,s={path:this.getSegmentPathUpTo(t.slice(0),t.length),type:"attributes"};return o.metricFindQuery(s,Object.assign(null!==(n=null==l||null===(a=l.request)||void 0===a?void 0:a.scopedVars)&&void 0!==n?n:{},{isPiPoint:!1})).then((function(t){var n={};(0,C.each)(t,(function(e){n[e.Path.substring(e.Path.indexOf("|")+1)]=e.WebId}));var a=(0,C.filter)(e,(function(e){var t,a=o.templateSrv.replace(null===(t=e.value)||void 0===t?void 0:t.value);return void 0!==n[a]}));u.availableAttributes=n,r.attributeChangeValue(a)})).catch((function(t){u.error=t.message||"Failed to issue metric query",r.attributeChangeValue(e)}))}},{key:"checkPiPointSegments",value:function(e,t){var n,a,r=this.props,i=r.datasource,o=r.data,l=this,u={path:e.path,webId:l.getSelectedPIServer(),pointName:e.label,type:"pipoint"};return i.metricFindQuery(u,Object.assign(null!==(n=null==o||null===(a=o.request)||void 0===a?void 0:a.scopedVars)&&void 0!==n?n:{},{isPiPoint:!0})).then((function(){l.attributeChangeValue(t)})).catch((function(e){l.error=e.message||"Failed to issue metric query",l.attributeChangeValue([])}))}},{key:"getSelectedPIServer",value:function(){var e,t=this,n="";return this.piServer.forEach((function(e){var a=t.props.query.target.split(";");a.length>=2&&a[0]===e.text&&(n=e.WebId)})),this.piServer.length>0?null===(e=this.piServer[0].value)||void 0===e?void 0:e.webId:n}},{key:"textEditorChanged",value:function(){var e=this,t=this.props,n=t.query,a=t.onChange,r=n.target.split(";"),i=r.length>0?r[0].split("\\"):[],o=[],l=[];i.length>1||1===i.length&&""!==i[0]?(r.splice(0,1),(0,C.each)(i,(function(e,t){o.push({label:e,value:{type:e.match(/\${\w+}/gi)?"template":void 0,value:e,expandable:!0}})})),this.getElementSegments(i.length+1,o).then((function(e){e.length>0&&o.push({label:"Select Element",value:{value:"-Select Element-"}})})),(0,C.each)(r,(function(e,t){""!==e&&l.push({label:e,value:{value:e,expandable:!1}})})),this.updateArray(o,l,this.state.summaries,n.isPiPoint,(function(){a(_({},n,{query:void 0,rawQuery:!1}))}))):(o=this.checkAfServer(),this.updateArray(o,this.state.attributes,this.state.summaries,n.isPiPoint,(function(){e.onChange(_({},n,{query:void 0,rawQuery:!1,attributes:e.state.attributes,segments:e.state.segments}))})))}},{key:"render",value:function(){var e=this,t=this.props,n=t.query,a=t.onChange,r=t.onRunQuery,i=(0,C.defaults)(n,F),l=i.interpolate,u=i.query,c=i.rawQuery,m=i.digitalStates,h=i.recordedValues,p=i.expression,d=i.isPiPoint,f=i.summary,v=i.display,b=i.regex;return o().createElement(o().Fragment,null,o().createElement(s.InlineField,{label:"Is Pi Point?",labelWidth:z},o().createElement(s.InlineSwitch,{value:d,onChange:this.onIsPiPointChange})),!!c&&o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Raw Query",labelWidth:z,grow:!0},o().createElement(s.Input,{onBlur:this.stateCallback,value:u,onChange:function(e){return a(_({},i,{query:e.target.value}))},placeholder:"enter query"})),o().createElement(B,{isRaw:!0,onChange:function(t){return e.textEditorChanged()}})),!c&&o().createElement(o().Fragment,null,o().createElement("div",{className:"gf-form-inline"},o().createElement(j,{label:d?"PI Server":"AF Elements",tooltip:d?"Select PI server.":"Select AF Element."},this.state.segments.map((function(t,n){return o().createElement(s.SegmentAsync,{key:"element-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),onChange:function(t){return e.onSegmentChange(t,n)},loadOptions:function(t){return e.getElementSegments(n)},allowCustomValue:!0,inputMinWidth:200})})),R||(R=o().createElement(A,null)),!d&&o().createElement(B,{isRaw:!1,onChange:function(e){a(_({},i,{query:i.target,rawQuery:e}))}}))),o().createElement(k,{label:d?"Pi Points":"Attributes"},this.state.attributes.map((function(t,n){return d?o().createElement(s.SegmentAsync,{key:"attributes-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),disabled:0===e.piServer.length,onChange:function(t){return e.onPiPointChange(t,n)},loadOptions:e.getAttributeSegmentsPI,reloadOptionsOnChange:!0,allowCustomValue:!0,inputMinWidth:J}):o().createElement(s.Segment,{key:"attributes-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),disabled:e.state.segments.length<=2,onChange:function(t){return e.onAttributeChange(t,n)},options:e.getAttributeSegmentsAF(),allowCustomValue:!0,inputMinWidth:J})})),d&&o().createElement(s.SegmentAsync,{Component:o().createElement(Y,{value:this.state.attributeSegment.value,label:this.state.attributeSegment.label}),disabled:0===this.piServer.length,onChange:this.onAttributeAction,loadOptions:this.getAttributeSegmentsPI,reloadOptionsOnChange:!0,allowCustomValue:!0,inputMinWidth:J}),!d&&o().createElement(s.Segment,{Component:o().createElement(Y,{value:this.state.attributeSegment.value,label:this.state.attributeSegment.label}),disabled:this.state.segments.length<=2,onChange:this.onAttributeAction,options:this.getAttributeSegmentsAF(),allowCustomValue:!0,inputMinWidth:J}))),!d&&o().createElement(s.InlineField,{label:"Calculation",labelWidth:z,tooltip:"Modify all attributes by an equation. Use '.' for current item. Leave Attributes empty if you wish to perform element based calculations."},o().createElement(s.Input,{onBlur:r,value:p,onChange:function(t){return e.onChange(_({},i,{expression:t.target.value}))},placeholder:"'.'*2"})),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Max Recorded Values",labelWidth:z,tooltip:"Maximum number of recorded value to retrive from the data archive, without using interpolation."},o().createElement(s.Input,{onBlur:r,value:h.maxNumber,onChange:function(t){return e.onChange(_({},i,{recordedValues:_({},h,{maxNumber:parseInt(t.target.value,10)})}))},type:"number",placeholder:"1000"})),o().createElement(s.InlineField,{label:"Recorded Values",labelWidth:z},o().createElement(s.InlineSwitch,{value:h.enable,onChange:function(){return e.onChange(_({},i,{recordedValues:_({},h,{enable:!h.enable})}))}})),o().createElement(s.InlineField,{label:"Digital States",labelWidth:z},o().createElement(s.InlineSwitch,{value:m.enable,onChange:function(){return e.onChange(_({},i,{digitalStates:_({},m,{enable:!m.enable})}))}}))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Interpolate Period",labelWidth:z,tooltip:"Override time between sampling, e.g. '30s'. Defaults to timespan/chart width."},o().createElement(s.Input,{onBlur:r,value:l.interval,onChange:function(t){return e.onChange(_({},i,{interpolate:_({},l,{interval:t.target.value})}))},placeholder:"30s"})),o().createElement(s.InlineField,{label:"Interpolate",labelWidth:z},o().createElement(s.InlineSwitch,{value:l.enable,onChange:function(){return e.onChange(_({},i,{interpolate:_({},l,{enable:!l.enable})}))}})),o().createElement(s.InlineField,{label:"Replace Bad Data",labelWidth:z,tooltip:"Replacement for bad quality values."},o().createElement(s.Segment,{Component:o().createElement(Y,{value:{value:f.nodata},label:f.nodata}),onChange:this.calcNoDataValueChanged,options:this.getNoDataSegments(),allowCustomValue:!0}))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Summary Period",labelWidth:z,tooltip:"Override time between sampling, e.g. '30s'."},o().createElement(s.Input,{onBlur:r,value:f.interval,onChange:function(e){return a(_({},i,{summary:_({},f,{interval:e.target.value})}))},placeholder:"30s"})),o().createElement(s.InlineField,{label:"Basis",labelWidth:z,tooltip:"Defines the possible calculation options when performing summary calculations over time-series data."},o().createElement(s.Segment,{Component:o().createElement(Y,{value:{value:f.basis},label:f.basis}),onChange:this.calcBasisValueChanged,options:this.getCalcBasisSegments(),allowCustomValue:!0})),o().createElement(s.InlineField,{label:"Summaries",labelWidth:z,tooltip:"Replacement for bad quality values."},o().createElement(s.InlineFieldRow,null,this.state.summaries.map((function(t,n){return o().createElement(s.Segment,{key:"summaries-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),onChange:function(t){return e.onSummaryValueChanged(t,n)},options:e.getSummarySegments(),allowCustomValue:!0})})),o().createElement(s.Segment,{Component:o().createElement(Y,{value:this.state.summarySegment.value,label:this.state.summarySegment.label}),onChange:this.onSummaryAction,options:this.getSummarySegments(),allowCustomValue:!0})))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Display Name",labelWidth:z,tooltip:"If single attribute, modify display name. Otherwise use regex to modify display name."},o().createElement(s.Input,{onBlur:r,value:v,onChange:function(t){return e.onChange(_({},i,{display:t.target.value}))},placeholder:"Display"})),o().createElement(s.InlineField,{label:"Enable Regex Replace",labelWidth:z},o().createElement(s.InlineSwitch,{value:b.enable,onChange:function(){e.onChange(_({},i,{regex:_({},b,{enable:!b.enable})}))}})),o().createElement(s.InlineField,{label:"Search",labelWidth:16},o().createElement(s.Input,{onBlur:r,value:b.search,onChange:function(t){return e.onChange(_({},i,{regex:_({},b,{search:t.target.value})}))},placeholder:"(.*)"})),o().createElement(s.InlineField,{label:"Replace",labelWidth:16},o().createElement(s.Input,{onBlur:r,value:b.replace,onChange:function(t){return e.onChange(_({},i,{regex:_({},b,{replace:t.target.value})}))},placeholder:"$1"}))))}}])&&G(t.prototype,n),a&&G(t,a),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.PureComponent),Z=l(5);function ee(e){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(e)}function te(){te=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var r=t&&t.prototype instanceof m?t:m,i=Object.create(r.prototype),o=new w(a||[]);return i._invoke=function(e,t,n){var a="suspendedStart";return function(r,i){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===r)throw i;return C()}for(n.method=r,n.arg=i;;){var o=n.delegate;if(o){var l=P(o,n);if(l){if(l===c)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var u=s(e,t,n);if("normal"===u.type){if(a=n.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c={};function m(){}function h(){}function p(){}var d={};l(d,r,(function(){return this}));var f=Object.getPrototypeOf,v=f&&f(f(I([])));v&&v!==t&&n.call(v,r)&&(d=v);var b=p.prototype=m.prototype=Object.create(d);function g(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function a(r,i,o,l){var u=s(e[r],e,i);if("throw"!==u.type){var c=u.arg,m=c.value;return m&&"object"==ee(m)&&n.call(m,"__await")?t.resolve(m.__await).then((function(e){a("next",e,o,l)}),(function(e){a("throw",e,o,l)})):t.resolve(m).then((function(e){c.value=e,o(c)}),(function(e){return a("throw",e,o,l)}))}l(u.arg)}var r;this._invoke=function(e,n){function i(){return new t((function(t,r){a(e,n,t,r)}))}return r=r?r.then(i,i):i()}}function P(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,P(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,c;var r=a.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function I(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function t(){for(;++a=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if("throw"===a.type){var r=a.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:I(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function ne(e,t,n,a,r,i,o){try{var l=e[i](o),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(a,r)}function ae(e,t){for(var n=0;n"+e.Name+": "+t})),{annotation:e,title:(t?"END ":e.showEndTime?"START ":"")+e.name,time:new Date(t?n.EndTime:n.StartTime).getTime(),text:n.Name+r+"
Start: "+n.StartTime+"
End: "+n.EndTime}}},{key:"buildQueryParameters",value:function(e){var t=this;return e.targets=(0,C.filter)(e.targets,(function(e){return!(!e||!e.target||e.target.startsWith("Select AF"))})),e.targets=(0,C.map)(e.targets,(function(n){var a=t,r={target:t.templateSrv.replace(n.elementPath,e.scopedVars),elementPath:t.templateSrv.replace(n.elementPath,e.scopedVars),elementPathArray:[{path:t.templateSrv.replace(n.elementPath,e.scopedVars),variable:""}],attributes:(0,C.map)(n.attributes,(function(n){var a;return t.templateSrv.replace((null===(a=n.value)||void 0===a?void 0:a.value)||n,e.scopedVars)})),segments:(0,C.map)(n.segments,(function(n){var a;return t.templateSrv.replace(null===(a=n.value)||void 0===a?void 0:a.value,e.scopedVars)})),display:n.display,refId:n.refId,hide:n.hide,interpolate:n.interpolate||{enable:!1},recordedValues:n.recordedValues||{enable:!1},digitalStates:n.digitalStates||{enable:!1},webid:n.webid,webids:n.webids||[],regex:n.regex||{enable:!1},expression:n.expression||"",summary:n.summary||{types:[]},startTime:e.range.from,endTime:e.range.to,isPiPoint:n.isPiPoint,scopedVars:e.scopedVars};r.expression&&(r.expression=t.templateSrv.replace(r.expression,e.scopedVars)),void 0!==r.summary.types&&(r.summary.types=(0,C.filter)(r.summary.types,(function(e){return null!=e&&""!==e})));var i=(0,C.keys)(e.scopedVars);return t.templateSrv.getVariables().forEach((function(e){if(a.isAllSelected(e.current)&&i.indexOf(e.name)<0){var t=e.options.filter((function(e){return!e.selected}));r.attributes=r.attributes.map((function(n){return t.map((function(t){return e.allValue?n.replace(e.allValue,t.value):n.replace(/{[a-zA-z0-9,-_]+}/gi,t.value)}))})),r.attributes=(0,C.uniq)((0,C.flatten)(r.attributes)),r.elementPathArray=a.getElementPath(r.elementPathArray,t,e.allValue)}else if(Array.isArray(e.current.text)&&i.indexOf(e.name)<0){var n=e.options.filter((function(e){return e.selected})),o=e.current.value.join(",");r.attributes=r.attributes.map((function(e){return n.map((function(t){return e.replace("{".concat(o,"}"),t.value)}))})),r.attributes=(0,C.uniq)((0,C.flatten)(r.attributes)),r.elementPathArray=a.getElementPath(r.elementPathArray,n,"{".concat(o,"}"))}})),r})),e}},{key:"query",value:(i=te().mark((function t(n){var a,r;return te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=this,(r=this.buildQueryParameters(n)).targets=(0,C.filter)(r.targets,(function(e){return!e.hide})),!(r.targets.length<=0)){t.next=7;break}return t.abrupt("return",Promise.resolve({data:[]}));case 7:return t.abrupt("return",Promise.all(a.getStream(r)).then((function(t){var n=[];return(0,C.each)(t,(function(e){(0,C.each)(e,(function(e){return n.push(e)}))})),{data:n.sort((function(e,t){return+(e.target>t.target)||+(e.target===t.target)-1})).map((function(t){return(0,e.toDataFrame)(t)}))}})));case 8:case"end":return t.stop()}}),t,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,a){var r=i.apply(e,t);function o(e){ne(r,n,a,o,l,"next",e)}function l(e){ne(r,n,a,o,l,"throw",e)}o(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"testDatasource",value:function(){return this.backendSrv.datasourceRequest({url:this.url+"/",method:"GET"}).then((function(e){if(200===e.status)return{status:"success",message:"Data source is working",title:"Success"};throw new Error("Failed")}))}},{key:"annotationQuery",value:function(e){var t=this;if(!this.afdatabase.webid)return Promise.resolve([]);var n=e.annotation.query.categoryName?this.templateSrv.replace(e.annotation.query.categoryName,e.scopedVars,"glob"):null,a=e.annotation.query.nameFilter?this.templateSrv.replace(e.annotation.query.nameFilter,e.scopedVars,"glob"):null,r=e.annotation.template?e.annotation.template.Name:null,i={name:e.annotation.name,datasource:e.annotation.datasource,enable:e.annotation.enable,iconColor:e.annotation.iconColor,showEndTime:e.annotation.showEndTime,regex:e.annotation.regex,attribute:e.annotation.attribute,categoryName:n,templateName:r,nameFilter:a},o=[];if(i.categoryName&&o.push("categoryName="+i.categoryName),i.nameFilter&&o.push("nameFilter="+i.nameFilter),i.templateName&&o.push("templateName="+i.templateName),!o.length)return Promise.resolve([]);if(o.push("startTime="+e.range.from.toJSON()),o.push("endTime="+e.range.to.toJSON()),i.attribute&&i.attribute.enable){var l=this.piwebapiurl+"/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name";i.attribute.name&&(l=this.piwebapiurl+"/streamsets/{0}/value?nameFilter="+i.attribute.name+"&selectedFields=Items.WebId%3BItems.Value%3BItems.Name");var u={};return u[1]={Method:"GET",Resource:this.piwebapiurl+"/assetdatabases/"+this.afdatabase.webid+"/eventframes?"+o.join("&")},u[2]={Method:"GET",RequestTemplate:{Resource:l},Parameters:["$.1.Content.Items[*].WebId"],ParentIds:["1"]},this.restBatch(u).then((function(n){var a=n.data[1].Content,r=n.data[2].Content,o=(0,C.map)(a.Items,(function(e,n){return(0,C.curry)(t.eventFrameToAnnotation)(i,!1,e,r.Items[n].Content.Items)}));if(e.annotation.showEndTime){var l=(0,C.map)(a.Items,(function(e,n){return(0,C.curry)(t.eventFrameToAnnotation)(i,!0,e,r.Items[n].Content.Items)}));(0,C.each)(l,(function(e){o.push(e)}))}return o}))}return this.restGet("/assetdatabases/"+this.afdatabase.webid+"/eventframes?"+o.join("&")).then((function(n){var a=(0,C.map)(n.data.Items,(0,C.curry)(t.eventFrameToAnnotation)(i,!1));if(e.annotation.showEndTime){var r=(0,C.map)(n.data.Items,(0,C.curry)(t.eventFrameToAnnotation)(i,!0));(0,C.each)(r,(function(e){a.push(e)}))}return a}))}},{key:"metricQueryTransform",value:function(e){return(0,C.map)(e,(function(e){var t,n;return{text:e.Name,expandable:void 0===e.HasChildren||!0===e.HasChildren||(null!==(t=e.Path)&&void 0!==t?t:"").split("\\").length<=3,HasChildren:e.HasChildren,Items:null!==(n=e.Items)&&void 0!==n?n:[],Path:e.Path,WebId:e.WebId}}))}},{key:"metricFindQuery",value:function(e,t){var n,a,r=this,i=["servers","databases","databaseElements","elements"];return"string"==typeof e&&(e=JSON.parse(e)),t.isPiPoint?e.path=this.templateSrv.replace(e.path,t):(""===e.path?e.type=i[0]:"attributes"!==e.type&&(e.type=i[Math.max(0,Math.min(e.path.split("\\").length,i.length-1))]),e.path=this.templateSrv.replace(e.path,t),e.path=e.path.replace(/\{([^\\])*\}/gi,(function(e){return e.substring(1,e.length-2).split(",")[0]}))),e.filter=null!==(n=e.filter)&&void 0!==n?n:"*","servers"===e.type?null!==(a=r.afserver)&&void 0!==a&&a.name?r.getAssetServer(r.afserver.name).then((function(e){return[e]})).then(r.metricQueryTransform):r.getAssetServers().then(r.metricQueryTransform):"databases"===e.type?r.getAssetServer(e.path).then((function(e){var t;return r.getDatabases(null!==(t=e.WebId)&&void 0!==t?t:"",{})})).then(r.metricQueryTransform):"databaseElements"===e.type?r.getDatabase(e.path).then((function(e){var t;return r.getDatabaseElements(null!==(t=e.WebId)&&void 0!==t?t:"",{selectedFields:"Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren"})})).then(r.metricQueryTransform):"elements"===e.type?r.getElement(e.path).then((function(t){var n;return r.getElements(null!==(n=t.WebId)&&void 0!==n?n:"",{selectedFields:"Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren",nameFilter:e.filter})})).then(r.metricQueryTransform):"attributes"===e.type?r.getElement(e.path).then((function(t){var n;return r.getAttributes(null!==(n=t.WebId)&&void 0!==n?n:"",{searchFullHierarchy:"true",selectedFields:"Items.WebId%3BItems.Name%3BItems.Path",nameFilter:e.filter})})).then(r.metricQueryTransform):"dataserver"===e.type?r.getDataServers().then(r.metricQueryTransform):"pipoint"===e.type?r.piPointSearch(e.webId,e.pointName).then(r.metricQueryTransform):Promise.reject("Bad type")}},{key:"getSummaryUrl",value:function(e){return""===e.interval.trim()?"&summaryType="+e.types.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).join("&summaryType=")+"&calculationBasis="+e.basis:"&summaryType="+e.types.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).join("&summaryType=")+"&calculationBasis="+e.basis+"&summaryDuration="+e.interval.trim()}},{key:"parsePiPointValueList",value:function(e,t,n){var a=this,r=this,i=[];return(0,C.each)(e,(function(e){var o=a.noDataReplace(n?e.Value:e,t.summary.nodata,r.parsePiPointValue(n?e.Value:e,t,n)),l=o.grafanaDataPoint;o.previousValue,o.drop||i.push(l)})),i}},{key:"parsePiPointValue",value:function(e,t,n){var a,r,i,o,l=n||"object"!==ee(e.Value)?e.Value:null===(a=e.Value)||void 0===a?void 0:a.Value;return!e.Good||null!==(r=t.digitalStates)&&void 0!==r&&r.enable?(l=null!==(i=n||"object"!==ee(e.Value)?e.Name:null===(o=e.Value)||void 0===o?void 0:o.Name)&&void 0!==i?i:"",[this.checkNumber(l)?Number(l):l.trim(),new Date(e.Timestamp).getTime()]):[this.checkNumber(l)?Number(l):l.trim(),new Date(e.Timestamp).getTime()]}},{key:"noDataReplace",value:function(e,t,n){var a,r,i=null,o=!1;return!e.Good||"No Data"===e.Value||null!==(a=e.Value)&&void 0!==a&&a.Name&&"No Data"===(null===(r=e.Value)||void 0===r?void 0:r.Name)?"Drop"===t?o=!0:"0"===t?n[0]=0:"Keep"===t||("Null"===t?n[0]=null:"Previous"===t&&null!==i&&(n[0]=i)):i=e.Value,{grafanaDataPoint:n,previousValue:i,drop:o}}},{key:"processResults",value:function(e,t,n,a){var r=this,i=t.summary&&t.summary.types&&t.summary.types.length>0;if(n=a?n:this.getPath(t.elementPathArray,e.Path)+"|"+n,t.regex&&t.regex.enable&&t.regex.search.length&&t.regex.replace.length&&(n=n.replace(new RegExp(t.regex.search),t.regex.replace)),i){var o=[],l=(0,C.groupBy)(e.Items,(function(e){return e.Type}));return(0,C.forOwn)(l,(function(e,a){o.push({refId:t.refId,target:n+"["+a+"]",datapoints:r.parsePiPointValueList(e,t,i)})})),o}return[{refId:t.refId,target:n,datapoints:r.parsePiPointValueList(e.Items,t,i)}]}},{key:"isAllSelected",value:function(e){return!!e&&(Array.isArray(e.text)?e.text.indexOf("All")>=0:"All"===e.text)}},{key:"checkNumber",value:function(e){return"number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)}},{key:"getElementPath",value:function(e,t,n){var a=[];return e.forEach((function(e){if(n&&e.path.indexOf(n)>=0||!n&&e.path.match(/{[a-zA-z0-9,-_]+}/gi)){var r=t.map((function(t){return{path:n?e.path.replace(n,t.value):e.path.replace(/{[a-zA-z0-9,-_]+}/gi,t.value),variable:t.value}}));a=a.concat(r)}})),a.length?(0,C.uniq)((0,C.flatten)(a)):e}},{key:"getPath",value:function(e,t){var n,a,r=t.split("|");if(0===r.length)return"";if(0===e.length)return"";var i=0===(r=r[0].split("\\")).length?"":null!==(n=r.pop())&&void 0!==n?n:"",o=null===(a=e.find((function(e){return t.indexOf(e.path)>=0})))||void 0===a?void 0:a.variable;return o?o+"|"+i:i}},{key:"getStream",value:function(e){var t=this,n=this,a=[];return(0,C.each)(e.targets,(function(r){r.attributes=(0,C.filter)(r.attributes||[],(function(e){return e}));var i="",o=r.summary&&r.summary.types&&r.summary.types.length>0,l=r.interpolate&&r.interpolate.enable,u=r.interpolate.interval?r.interpolate.interval:e.interval,s="?startTime="+e.range.from.toJSON()+"&endTime="+e.range.to.toJSON(),c=r.expression||r.elementPath,m=r.display?t.templateSrv.replace(r.display,e.scopedVars):null;if(r.expression)i+="/calculation",i+=o?"/summary"+s+(l?"&sampleType=Interval&sampleInterval="+u:""):"/intervals"+s+"&sampleInterval="+u,i+="&expression="+encodeURIComponent(r.expression),r.attributes.length>0?a.push(n.internalStream(e,r,i)):a.push(n.restGetWebId(r.elementPath,r.isPiPoint).then((function(e){return n.restPost(i+e.WebId).then((function(e){return n.processResults(e.data,r,m||c,!1)})).catch((function(e){return n.error=e}))})));else{if(i+="/streamsets",o)i+="/summary"+s+"&intervals="+e.maxDataPoints+t.getSummaryUrl(r.summary);else if(r.interpolate&&r.interpolate.enable)i+="/interpolated"+s+"&interval="+u;else if(r.recordedValues&&r.recordedValues.enable){var h=r.recordedValues.maxNumber&&!isNaN(r.recordedValues.maxNumber)?r.recordedValues.maxNumber:1e3;i+="/recorded"+s+"&maxCount="+h}else i+="/plot"+s+"&intervals="+e.maxDataPoints;a.push(n.internalStream(e,r,i))}})),a}},{key:"internalStream",value:function(e,t,n){var a=this,r=t.expression||t.elementPath,i=t.display?this.templateSrv.replace(t.display,e.scopedVars):null,o=1===t.elementPathArray.length&&t.elementPath===t.elementPathArray[0].path;return(o?t.attributes.length>1&&!t.isPiPoint?a.restGetWebId(t.elementPath,t.isPiPoint).then((function(e){return a.getAttributes(e.WebId,{searchFullHierarchy:"true",nameFilter:"*"})})).then((function(e){return e.filter((function(e){var n;return t.attributes.indexOf(e.Name)>=0||t.attributes.indexOf(null===(n=e.Path)||void 0===n?void 0:n.split("|").splice(1).join("|"))>=0}))})):Promise.all((0,C.map)(t.attributes,(function(e){return a.restGetWebId(t.elementPath+"|"+e,t.isPiPoint)}))):t.attributes.length>1&&!t.isPiPoint?Promise.all(t.elementPathArray.map((function(e){return a.restGetWebId(e.path,t.isPiPoint).then((function(e){return a.getAttributes(e.WebId,{searchFullHierarchy:"true",nameFilter:"*"})})).then((function(e){return e.filter((function(e){var n;return t.attributes.indexOf(e.Name)>=0||t.attributes.indexOf(null===(n=e.Path)||void 0===n?void 0:n.split("|").splice(1).join("|"))>=0}))}))}))):Promise.all((0,C.flatten)((0,C.map)(t.attributes,(function(e){return t.elementPathArray.map((function(n){return a.restGetWebId(n.path+"|"+e,t.isPiPoint)}))}))))).then((function(e){var l={};return(0,C.each)((0,C.flatten)(e),(function(e,t){l[t+1]={Method:"GET",Resource:a.piwebapiurl+n+"&webid="+e.WebId}})),a.restBatch(l).then((function(n){var l=[];return(0,C.each)(n.data,(function(n,u){if(t.expression){var s=e[parseInt(u,10)-1].Name;(0,C.each)(a.processResults(n.Content,t,i||s||r,o),(function(e){return l.push(e)}))}else(0,C.each)(n.Content.Items,(function(e){(0,C.each)(a.processResults(e,t,i||e.Name||r,o),(function(e){return l.push(e)}))}))})),l})).catch((function(e){return a.error=e}))}))}},{key:"restGet",value:function(e){return this.backendSrv.datasourceRequest({url:this.url+e,method:"GET",headers:{"Content-Type":"application/json"}}).then((function(e){return e}))}},{key:"restGetWebId",value:function(e,t){var n=this,a=n.webidCache.get(e);if(a)return Promise.resolve({Path:e,WebId:a.WebId,Name:a.Name});var r="";return r=t?"/points?selectedFields=WebId%3BName%3BPath&path=\\\\"+e.replace("|","\\"):(e.indexOf("|")>=0?"/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\":"/elements?selectedFields=WebId%3BName%3BPath&path=\\\\")+e,this.backendSrv.datasourceRequest({url:this.url+r,method:"GET",headers:{"Content-Type":"application/json"}}).then((function(t){return n.webidCache.set(e,t.data),{Path:e,WebId:t.data.WebId,Name:t.data.Name}}))}},{key:"restBatch",value:function(e){return this.backendSrv.datasourceRequest({url:this.url+"/batch",data:e,method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"message/http"}})}},{key:"restPost",value:function(e){return this.backendSrv.datasourceRequest({url:this.url,method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"message/http","X-PIWEBAPI-HTTP-METHOD":"GET","X-PIWEBAPI-RESOURCE-ADDRESS":e}})}},{key:"getDataServers",value:function(){return this.restGet("/dataservers").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getDataServer",value:function(e){return e?this.restGet("/dataservers?name="+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getAssetServers",value:function(){return this.restGet("/assetservers").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getAssetServer",value:function(e){return e?this.restGet("/assetservers?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getDatabase",value:function(e){return e?this.restGet("/assetdatabases?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getDatabases",value:function(e,t){return e?this.restGet("/assetservers/"+e+"/assetdatabases").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]})):Promise.resolve([])}},{key:"getElement",value:function(e){return e?this.restGet("/elements?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getEventFrameTemplates",value:function(e){return e?this.restGet("/assetdatabases/"+e+"/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId").then((function(e){var t;return(0,C.filter)(null!==(t=e.data.Items)&&void 0!==t?t:[],(function(e){return"EventFrame"===e.InstanceType}))})):Promise.resolve([])}},{key:"getElementTemplates",value:function(e){return e?this.restGet("/assetdatabases/"+e+"/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId").then((function(e){var t;return(0,C.filter)(null!==(t=e.data.Items)&&void 0!==t?t:[],(function(e){return"Element"===e.InstanceType}))})):Promise.resolve([])}},{key:"getAttributes",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/elements/"+e+"/attributes"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getDatabaseElements",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/assetdatabases/"+e+"/elements"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getElements",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/elements/"+e+"/elements"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"piPointSearch",value:function(e,t){var n=this.templateSrv.replace(t),a="".concat(n),r=!1;if(n!==t)for(var i,o=/\{(\w|,)+\}/g;null!==(i=o.exec(n));)i.index===o.lastIndex&&o.lastIndex++,i.forEach((function(e,t){0===t&&(n=n.replace(e,e.replace("{","(").replace("}",")").replace(",","|")),a=a.replace(e,"*"),r=!0)}));return this.restGet("/dataservers/"+e+"/points?maxCount=20&nameFilter="+a).then((function(e){var t;return e&&null!==(t=e.data)&&void 0!==t&&t.Items?r?e.data.Items.filter((function(e){var t;return null===(t=e.Name)||void 0===t?void 0:t.match(n)})):e.data.Items:[]}))}},{key:"getWebId",value:function(e){var t=this,n=e.target.indexOf("\\")>=0,a=e.target.indexOf("|")>=0;return n||-1!==e.target.indexOf(".")?n?n&&a?t.restGet("/attributes?path=\\\\"+e.target).then((function(t){return void 0===t.data||200!==t.status?[{WebId:e.target,Name:e.display||e.target}]:(t.data.Name=e.display||t.data.Name,[t.data])})):t.restGet("/elements?path=\\\\"+e.target).then((function(t){return void 0===t.data||200!==t.status?[{WebId:e.target,Name:e.display||e.target}]:(t.data.Name=e.display||t.data.Name,[t.data])})):t.piPointSearch(this.piserver.webid,e.target).then((function(t){return void 0===t||0===t.length?[{WebId:e.target,Name:e.display||e.target}]:t})):Promise.resolve([{WebId:e.target,Name:e.display||e.target}])}}],a&&ae(n.prototype,a),r&&ae(n,r),Object.defineProperty(n,"prototype",{writable:!1}),u}(e.DataSourceApi),me=new e.DataSourcePlugin(ce).setConfigEditor(I).setQueryEditor(K).setAnnotationQueryCtrl(a)})(),u})())); //# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/dist/module.js.map b/dist/module.js.map index a74a832..e89170d 100644 --- a/dist/module.js.map +++ b/dist/module.js.map @@ -1 +1 @@ -{"version":3,"file":"module.js","mappings":";;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,oBAAb;EAAA;;EAOE;EACA,8BAAYC,MAAZ,EAAyB;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IACvB,KAAKA,MAAL,GAAcA,MAAd;IACA,KAAKC,UAAL,GAAkBD,MAAM,CAACE,IAAP,CAAYD,UAA9B;IACA,KAAKE,UAAL,GAAkBH,MAAM,CAACE,IAAP,CAAYC,UAA9B,CAHuB,CAKvB;;IACA,KAAKF,UAAL,CAAgBG,KAAhB,GAAwB,KAAKH,UAAL,CAAgBG,KAAhB,IAAyB,EAAjD;IACA,KAAKH,UA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,6DAJI,EAKnB4V,sBALmB,CAKIta,uEALJ,CAAf,C","sources":["webpack:///./AnnotationsQueryCtrl.ts","webpack:///./ConfigEditor.tsx","webpack:///./QueryEditor.tsx","webpack:///./components/Forms.tsx","webpack:///./components/QueryEditorModeSwitcher.tsx","webpack:///./datasource.ts","webpack:///./types.ts","webpack:///external amd \"@grafana/data\"","webpack:///external amd \"@grafana/runtime\"","webpack:///external amd \"@grafana/ui\"","webpack:///external amd \"lodash\"","webpack:///external amd \"react\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./module.ts"],"sourcesContent":["export class AnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n\n $scope: any;\n annotation: any;\n datasource: any;\n\n /** @ngInject */\n constructor($scope: any) {\n this.$scope = $scope;\n this.annotation = $scope.ctrl.annotation;\n this.datasource = $scope.ctrl.datasource;\n\n // load defaults\n this.annotation.query = this.annotation.query || {};\n this.annotation.databases = this.annotation.databases || [];\n this.annotation.templates = this.annotation.templates || [];\n this.annotation.regex = this.annotation.regex || {};\n this.annotation.attribute = this.annotation.attribute || {};\n this.annotation.showEndTime = this.annotation.showEndTime || false;\n\n this.datasource.getAssetServer(this.datasource.afserver.name).then((result: any) => {\n return this.getDatabases(result.WebId);\n });\n }\n templateChanged() {\n // do nothing\n }\n databaseChanged() {\n this.annotation.templates = [];\n this.getEventFrames();\n }\n getDatabases(webid: string) {\n var ctrl = this;\n ctrl.datasource.getDatabases(webid).then((dbs: any) => {\n ctrl.annotation.databases = dbs;\n this.$scope.$apply();\n });\n }\n getEventFrames() {\n var ctrl = this;\n ctrl.datasource.getEventFrameTemplates(this.annotation.database.WebId).then((templates: any) => {\n ctrl.annotation.templates = templates;\n this.$scope.$apply();\n });\n }\n}\n","import React, { ChangeEvent, PureComponent } from 'react';\nimport { LegacyForms, DataSourceHttpSettings } from '@grafana/ui';\nimport { DataSourcePluginOptionsEditorProps, DataSourceJsonData, DataSourceSettings } from '@grafana/data';\nimport { PIWebAPIDataSourceJsonData } from './types';\n\nconst { FormField } = LegacyForms;\n\ninterface Props extends DataSourcePluginOptionsEditorProps {}\n\nconst coerceOptions = (\n options: DataSourceSettings\n): DataSourceSettings => {\n return {\n ...options,\n jsonData: {\n ...options.jsonData,\n url: options.url,\n },\n };\n};\n\ninterface State {}\n\nexport class PIWebAPIConfigEditor extends PureComponent {\n onPIServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n piserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFDatabaseChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afdatabase: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onMyOptionsChange = (options: DataSourceSettings) => {\n const { onOptionsChange } = this.props;\n onOptionsChange(coerceOptions(options));\n };\n\n render() {\n const { options: originalOptions } = this.props;\n const options = coerceOptions(originalOptions);\n\n return (\n
\n \n\n

PI/AF Connection Details

\n\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n );\n }\n}\n","import { each, filter, forOwn, join, reduce, map, slice, remove, defaults } from 'lodash';\n\nimport React, { PureComponent, ChangeEvent } from 'react';\nimport { Icon, InlineField, InlineFieldRow, InlineSwitch, Input, SegmentAsync, Segment } from '@grafana/ui';\nimport { QueryEditorProps, SelectableValue, VariableModel } from '@grafana/data';\n\nimport { PiWebAPIDatasource } from './datasource';\nimport { QueryInlineField, QueryRawInlineField, QueryRowTerminator } from './components/Forms';\nimport { PIWebAPISelectableValue, PIWebAPIDataSourceJsonData, PIWebAPIQuery, defaultQuery } from './types';\nimport { QueryEditorModeSwitcher } from 'components/QueryEditorModeSwitcher';\n\nconst LABEL_WIDTH = 24;\nconst MIN_ELEM_INPUT_WIDTH = 200;\nconst MIN_ATTR_INPUT_WIDTH = 250;\n\ninterface State {\n isPiPoint: boolean;\n segments: Array>;\n attributes: Array>;\n summaries: Array>;\n attributeSegment: SelectableValue;\n summarySegment: SelectableValue;\n calculationBasisSegment: SelectableValue;\n noDataReplacementSegment: SelectableValue;\n}\n\ntype Props = QueryEditorProps;\n\nconst REMOVE_LABEL = '-REMOVE-';\n\nconst CustomLabelComponent = (props: any) => {\n if (props.value) {\n return (\n
\n {props.label ?? '--no label--'}\n
\n );\n }\n return (\n \n \n \n );\n};\n\nexport class PIWebAPIQueryEditor extends PureComponent {\n error: any;\n piServer: any[] = [];\n availableAttributes: any = {};\n summaryTypes: string[];\n calculationBasis: string[];\n noDataReplacement: string[];\n state: State = {\n isPiPoint: false,\n segments: [],\n attributes: [],\n summaries: [],\n attributeSegment: {},\n summarySegment: {},\n calculationBasisSegment: {},\n noDataReplacementSegment: {},\n };\n\n constructor(props: any) {\n super(props);\n this.onSegmentChange = this.onSegmentChange.bind(this);\n this.calcBasisValueChanged = this.calcBasisValueChanged.bind(this);\n this.calcNoDataValueChanged = this.calcNoDataValueChanged.bind(this);\n this.onSummaryAction = this.onSummaryAction.bind(this);\n this.onSummaryValueChanged = this.onSummaryValueChanged.bind(this);\n this.onAttributeAction = this.onAttributeAction.bind(this);\n this.onAttributeChange = this.onAttributeChange.bind(this);\n\n this.summaryTypes = [\n // 'None', // A summary type is not specified.\n 'Total', // A totalization over the time range.\n 'Average', // The average value over the time range.\n 'Minimum', // The minimum value over the time range.\n 'Maximum', // The maximum value over the time range.\n 'Range', // The range value over the time range (minimum-maximum).\n 'StdDev', // The standard deviation over the time range.\n 'PopulationStdDev', // The population standard deviation over the time range.\n 'Count', // The sum of event count over the time range when calculation basis is event weighted. The sum of event time duration over the time range when calculation basis is time weighted.\n 'PercentGood', // Percent of data with good value during the calculation period. For time weighted calculations, the percentage is based on time. For event weighted calculations, the percent is based on event count.\n 'All', // A convenience for requesting all available summary calculations.\n 'AllForNonNumeric', // A convenience for requesting all available summary calculations for non-numeric data.\n ];\n\n this.calculationBasis = [\n 'TimeWeighted', // Weight the values in the calculation by the time over which they apply. Interpolation is based on whether the attribute is stepped. Interpolated events are generated at the boundaries if necessary.\n 'EventWeighted', // Evaluate values with equal weighting for each event. No interpolation is done. There must be at least one event within the time range to perform a successful calculation. Two events are required for standard deviation. In handling events at the boundary of the calculation, the AFSDK uses following rules:\n 'TimeWeightedContinuous', // Apply weighting as in TimeWeighted, but do all interpolation between values as if they represent continuous data, (standard interpolation) regardless of whether the attribute is stepped.\n 'TimeWeightedDiscrete', // Apply weighting as in TimeWeighted but interpolation between values is performed as if they represent discrete, unrelated values (stair step plot) regardless of the attribute is stepped.\n 'EventWeightedExcludeMostRecentEvent', // The calculation behaves the same as _EventWeighted_, except in the handling of events at the boundary of summary intervals in a multiple intervals calculation. Use this option to prevent events at the intervals boundary from being double count at both intervals. With this option, events at the end time (most recent time) of an interval is not used in that interval.\n 'EventWeightedExcludeEarliestEvent', // Similar to the option _EventWeightedExcludeMostRecentEvent_. Events at the start time(earliest time) of an interval is not used in that interval.\n 'EventWeightedIncludeBothEnds', // Events at both ends of the interval boundaries are included in the event weighted calculation.\n ];\n\n this.noDataReplacement = [\n 'Null', // replace with nulls\n 'Drop', // drop items\n 'Previous', // use previous value if available\n '0', // replace with 0\n 'Keep', // Keep value\n ];\n }\n\n // is selected segment empty\n isValueEmpty(value: PIWebAPISelectableValue | undefined) {\n return !value || !value.value || !value.value.length || value.value === REMOVE_LABEL;\n }\n\n segmentChangeValue = (segments: Array>) => {\n const query = this.props.query;\n this.setState({ segments }, () => this.onChange({ ...query, segments }));\n };\n\n attributeChangeValue = (attributes: Array>) => {\n const query = this.props.query;\n this.setState({ attributes }, () => this.onChange({ ...query, attributes }));\n };\n\n // summary calculation basis change event\n calcBasisValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.basis = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get summary calculation basis user interface segments\n getCalcBasisSegments() {\n const segments = map(this.calculationBasis, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // no data change event\n calcNoDataValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.nodata = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get no data user interface segments\n getNoDataSegments() {\n var segments = map(this.noDataReplacement, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // summary query change event\n onSummaryValueChanged(item: SelectableValue, index: number) {\n const summaries = this.state.summaries.slice(0) as Array>;\n summaries[index] = item;\n if (this.isValueEmpty(item.value)) {\n summaries.splice(index, 1);\n }\n this.setState({ summaries }, this.stateCallback);\n }\n // get the list of summaries available\n getSummarySegments() {\n const ctrl = this;\n const summaryTypes = filter(ctrl.summaryTypes, (type) => {\n return this.state.summaries.map((s) => s.value?.value).indexOf(type) === -1;\n });\n var segments = map(summaryTypes, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n }\n\n // remove a summary from the user interface and the query\n removeSummary(part: SelectableValue) {\n const summaries = filter(this.state.summaries, (item: SelectableValue) => {\n return item !== part;\n });\n this.setState({ summaries });\n }\n // add a new summary to the query\n onSummaryAction(item: SelectableValue) {\n const summaries = this.state.summaries.slice(0) as Array>;\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: true,\n },\n };\n summaries.push(selectableValue);\n }\n this.setState({ summarySegment: {}, summaries }, this.stateCallback);\n }\n\n // remove an attribute from the query\n removeAttribute(part: SelectableValue) {\n const attributes = filter(this.state.attributes, (item: SelectableValue) => {\n return item !== part;\n });\n this.attributeChangeValue(attributes);\n }\n // add an attribute to the query\n onAttributeAction(item: SelectableValue) {\n const { query } = this.props;\n const attributes = this.state.attributes.slice(0);\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: !query.isPiPoint,\n },\n };\n attributes.push(selectableValue);\n }\n this.attributeChangeValue(attributes);\n }\n\n // pi point change event\n onPiPointChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n remove(attributes, (value, n) => n === index);\n } else {\n // set current value\n attributes[index] = item;\n }\n\n this.checkPiPointSegments(item, attributes);\n };\n // attribute change event\n onAttributeChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n // set current value\n attributes[index] = item;\n\n this.checkAttributeSegments(attributes, this.state.segments);\n };\n // segment change\n onSegmentChange = (item: SelectableValue, index: number) => {\n const { query } = this.props;\n let segments = this.state.segments.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n segments = slice(segments, 0, index);\n this.checkAttributeSegments([], segments);\n if (segments.length === 0) {\n segments.push({\n label: '',\n });\n } else if (!!segments[segments.length - 1].value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n if (query.isPiPoint) {\n this.piServer = [];\n }\n this.segmentChangeValue(segments);\n return;\n }\n\n // set current value\n segments[index] = item;\n\n // Accept only one PI server\n if (query.isPiPoint) {\n this.piServer.push(item);\n this.segmentChangeValue(segments);\n return;\n }\n\n // changed internal selection\n if (index < segments.length - 1) {\n segments = slice(segments, 0, index + 1);\n }\n this.checkAttributeSegments([], segments);\n // add new options\n if (!!item.value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n this.segmentChangeValue(segments);\n };\n\n // get a ui segment for the attributes\n getElementSegments = (\n index: number,\n currentSegment?: Array>\n ): Promise>> => {\n const { datasource, query, data } = this.props;\n var ctrl = this;\n var findQuery = query.isPiPoint\n ? { type: 'dataserver' }\n : { path: this.getSegmentPathUpTo(currentSegment ?? this.state.segments.slice(0), index) };\n\n if (!query.isPiPoint) {\n if (datasource.afserver?.name && index === 0) {\n return Promise.resolve([\n {\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n },\n ]);\n }\n if (datasource.afserver?.name && datasource.afdatabase?.name && index === 1) {\n return Promise.resolve([\n {\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n },\n ]);\n }\n\n // if (!findQuery.path?.length) {\n // return Promise.resolve([]);\n // }\n }\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n var altSegments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n label: item.text,\n value: {\n webId: item.WebId,\n value: item.text,\n expandable: !query.isPiPoint && item.expandable,\n },\n };\n return selectableValue;\n });\n\n if (altSegments.length === 0) {\n return altSegments;\n }\n\n // add template variables\n const variables = datasource.templateSrv.getVariables();\n each(variables, (variable: VariableModel) => {\n let selectableValue: SelectableValue = {\n label: '${' + variable.name + '}',\n value: {\n type: 'template',\n value: '${' + variable.name + '}',\n expandable: !query.isPiPoint,\n },\n };\n altSegments.unshift(selectableValue);\n });\n\n altSegments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return altSegments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return [];\n });\n };\n\n // get the list of attributes for the user interface - PI\n getAttributeSegmentsPI = (attributeText?: string): Promise>> => {\n const { datasource, query, data } = this.props;\n const ctrl = this;\n const findQuery = {\n path: '',\n webId: this.getSelectedPIServer(),\n pointName: (attributeText ?? '') + '*',\n type: 'pipoint',\n };\n let segments: Array> = [];\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n segments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n path: item.Path,\n label: item.text,\n value: {\n value: item.text,\n expandable: false,\n },\n };\n return selectableValue;\n });\n segments.unshift({\n label: attributeText,\n value: {\n value: attributeText,\n expandable: false,\n },\n });\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n return segments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return segments;\n });\n };\n\n // get the list of attributes for the user interface - AF\n getAttributeSegmentsAF = (attributeText?: string): Array> => {\n const ctrl = this;\n let segments: Array> = [];\n\n forOwn(ctrl.availableAttributes, (val: any, key: string) => {\n let selectableValue: SelectableValue = {\n label: key,\n value: {\n value: key,\n expandable: true,\n },\n };\n segments.push(selectableValue);\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n };\n\n // build data from target string\n buildFromTarget = (\n query: PIWebAPIQuery,\n segmentsArray: Array>,\n attributesArray: Array>\n ) => {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segmentsArray.push({\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n });\n });\n each(splitAttributes, (item, _) => {\n if (item !== '') {\n // set current value\n attributesArray.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n return this.getElementSegments(splitElements.length + 1, segmentsArray).then((elements) => {\n if (elements.length > 0) {\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n return segmentsArray;\n });\n }\n return Promise.resolve(segmentsArray);\n };\n\n /**\n * Gets the segment information and parses it to a string.\n *\n * @param {any} index - Last index of segment to use.\n * @returns - AF Path or PI Point name.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSegmentPathUpTo(segments: Array>, index: number): string {\n var arr = segments.slice(0, index);\n\n return reduce(\n arr,\n (result: any, segment: SelectableValue) => {\n if (!segment.value) {\n return '';\n }\n if (!segment.value.value?.startsWith('-Select')) {\n return result ? result + '\\\\' + segment.value.value : segment.value.value;\n }\n return result;\n },\n ''\n );\n }\n\n /**\n * Get the current AF Element's child attributes. Validates when the element selection changes.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAttributeSegments(\n attributes: Array>,\n segments: Array>\n ): Promise {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: this.getSegmentPathUpTo(segments.slice(0), segments.length),\n type: 'attributes',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: false }))\n .then((attributesResponse: any) => {\n var validAttributes: any = {};\n\n each(attributesResponse, (attribute: any) => {\n validAttributes[attribute.Path.substring(attribute.Path.indexOf('|') + 1)] = attribute.WebId;\n });\n\n var filteredAttributes = filter(attributes, (attrib: SelectableValue) => {\n const changedValue = datasource.templateSrv.replace(attrib.value?.value);\n return validAttributes[changedValue] !== undefined;\n });\n\n ctrl.availableAttributes = validAttributes;\n this.attributeChangeValue(filteredAttributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n this.attributeChangeValue(attributes);\n });\n }\n\n /**\n * Get PI points from server.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkPiPointSegments(\n attribute: SelectableValue,\n attributes: Array>\n ) {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: attribute.path,\n webId: ctrl.getSelectedPIServer(),\n pointName: attribute.label,\n type: 'pipoint',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: true }))\n .then(() => {\n ctrl.attributeChangeValue(attributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n ctrl.attributeChangeValue([]);\n });\n }\n\n /**\n * Gets the webid of the current selected pi data server.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSelectedPIServer() {\n var webID = '';\n\n this.piServer.forEach((s) => {\n var parts = this.props.query.target.split(';');\n if (parts.length >= 2) {\n if (parts[0] === s.text) {\n webID = s.WebId;\n return;\n }\n }\n });\n return this.piServer.length > 0 ? this.piServer[0].value?.webId : webID;\n }\n\n /**\n * Queries PI Web API for child elements and attributes when the raw query text editor is changed.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n textEditorChanged() {\n const { query, onChange } = this.props;\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n let segments: Array> = [];\n let attributes: Array> = [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segments.push({\n label: item,\n value: {\n type: item.match(/\\${\\w+}/gi) ? 'template' : undefined,\n value: item,\n expandable: true,\n },\n });\n });\n this.getElementSegments(splitElements.length + 1, segments).then((elements) => {\n if (elements.length > 0) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n });\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n this.updateArray(segments, attributes, this.state.summaries, query.isPiPoint, () => {\n onChange({ ...query, query: undefined, rawQuery: false });\n });\n } else {\n segments = this.checkAfServer();\n this.updateArray(segments, this.state.attributes, this.state.summaries, query.isPiPoint, () => {\n this.onChange({\n ...query,\n query: undefined,\n rawQuery: false,\n attributes: this.state.attributes,\n segments: this.state.segments,\n });\n });\n }\n }\n\n /**\n * Check if the AF server and database are configured in the datasoure config.\n *\n * @returns the segments array\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAfServer = () => {\n const { datasource } = this.props;\n const segmentsArray = [];\n if (datasource.afserver?.name) {\n segmentsArray.push({\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n });\n if (datasource.afdatabase?.name) {\n segmentsArray.push({\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n });\n }\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n } else {\n segmentsArray.push({\n label: '',\n });\n }\n return segmentsArray;\n };\n\n /**\n * Update the internal state of the datasource.\n *\n * @param segmentsArray the segments array to update\n * @param attributesArray the AF attributes array to update\n * @param summariesArray the summaries array to update\n * @param isPiPoint the is PI point flag\n * @param cb optional callback function\n *\n * @memberOf PIWebAPIQueryEditor\n */\n updateArray = (\n segmentsArray: Array>,\n attributesArray: Array>,\n summariesArray: Array>,\n isPiPoint: boolean,\n cb?: (() => void) | undefined\n ) => {\n this.setState(\n {\n segments: segmentsArray,\n attributes: attributesArray,\n summaries: summariesArray,\n isPiPoint,\n },\n () =>\n this.checkAttributeSegments(attributesArray, this.state.segments).then(() => {\n if (cb) {\n cb();\n }\n })\n );\n };\n\n // React action when component is initialized/updated\n scopedVarsDone = false;\n componentDidMount = () => {\n this.initialLoad(false);\n };\n componentDidUpdate = () => {\n if (this.props.data?.state === 'Done' && !!this.props.data?.request?.scopedVars && !this.scopedVarsDone) {\n this.scopedVarsDone = true;\n this.initialLoad(true);\n }\n };\n initialLoad = (force: boolean) => {\n const { query } = this.props;\n const metricsQuery = defaults(query, defaultQuery) as PIWebAPIQuery;\n const { segments, attributes, summary, isPiPoint } = metricsQuery;\n\n let segmentsArray: Array> = force ? [] : segments?.slice(0) ?? [];\n let attributesArray: Array> = force ? [] : attributes?.slice(0) ?? [];\n let summariesArray = summary?.types ?? [];\n\n if (!isPiPoint && segmentsArray.length === 0) {\n if (query.target && query.target.length > 0 && query.target !== ';') {\n attributesArray = [];\n // Build query from target\n this.buildFromTarget(query, segmentsArray, attributesArray)\n .then((_segmentsArray) => {\n this.updateArray(_segmentsArray, attributesArray, summariesArray, isPiPoint);\n })\n .catch((e) => console.error(e));\n return;\n } else {\n segmentsArray = this.checkAfServer();\n }\n } else if (isPiPoint && segmentsArray.length > 0) {\n this.piServer = segmentsArray;\n }\n this.updateArray(segmentsArray, attributesArray, summariesArray, isPiPoint, () => {\n this.onChange(query);\n });\n };\n\n onChange = (query: PIWebAPIQuery) => {\n const { onChange, onRunQuery } = this.props;\n\n query.summary.types = this.state.summaries;\n if (query.rawQuery) {\n query.target = query.query ?? '';\n\n if (query.target !== '') {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes[0].split('\\\\');\n\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n query.attributes = [];\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n query.elementPath = splitElements.join('\\\\');\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n query.attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n }\n }\n } else {\n query.elementPath = this.getSegmentPathUpTo(this.state.segments, this.state.segments.length);\n query.target =\n query.elementPath +\n ';' +\n join(\n query.attributes.map((s) => s.value?.value),\n ';'\n );\n }\n\n onChange(query);\n\n if (query.target && query.target.length > 0 && query.attributes.length > 0) {\n onRunQuery();\n }\n };\n\n stateCallback = () => {\n const query = this.props.query as PIWebAPIQuery;\n this.onChange(query);\n };\n\n onIsPiPointChange = (event: React.SyntheticEvent) => {\n const { query: queryChange } = this.props;\n const isPiPoint = !queryChange.isPiPoint;\n this.setState(\n {\n segments: isPiPoint ? [{ label: '' }] : this.checkAfServer(),\n attributes: [],\n isPiPoint,\n },\n () => {\n this.onChange({\n ...queryChange,\n expression: '',\n attributes: this.state.attributes,\n segments: this.state.segments,\n isPiPoint,\n });\n }\n );\n };\n\n render() {\n const { query: queryProps, onChange, onRunQuery } = this.props;\n const metricsQuery = defaults(queryProps, defaultQuery) as PIWebAPIQuery;\n const {\n interpolate,\n query,\n rawQuery,\n digitalStates,\n recordedValues,\n expression,\n isPiPoint,\n summary,\n display,\n regex,\n } = metricsQuery;\n\n return (\n <>\n \n \n \n\n {!!rawQuery && (\n \n \n ) =>\n onChange({ ...metricsQuery, query: event.target.value })\n }\n placeholder=\"enter query\"\n />\n \n this.textEditorChanged()} />\n \n )}\n\n {!rawQuery && (\n <>\n
\n \n {this.state.segments.map((segment: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSegmentChange(item, index)}\n loadOptions={(query?: string | undefined) => {\n return this.getElementSegments(index);\n }}\n allowCustomValue\n inputMinWidth={MIN_ELEM_INPUT_WIDTH}\n />\n );\n })}\n \n {!isPiPoint && (\n {\n onChange({ ...metricsQuery, query: metricsQuery.target, rawQuery: value });\n }}\n />\n )}\n \n
\n\n \n {this.state.attributes.map((attribute: SelectableValue, index: number) => {\n if (isPiPoint) {\n return (\n }\n disabled={this.piServer.length === 0}\n onChange={(item) => this.onPiPointChange(item, index)}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n }\n return (\n }\n disabled={this.state.segments.length <= 2}\n onChange={(item) => this.onAttributeChange(item, index)}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n })}\n\n {isPiPoint && (\n \n }\n disabled={this.piServer.length === 0}\n onChange={this.onAttributeAction}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n {!isPiPoint && (\n \n }\n disabled={this.state.segments.length <= 2}\n onChange={this.onAttributeAction}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n \n \n )}\n\n {!isPiPoint && (\n \n ) =>\n this.onChange({ ...metricsQuery, expression: event.target.value })\n }\n placeholder=\"'.'*2\"\n />\n \n )}\n\n \n \n ) =>\n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, maxNumber: parseInt(event.target.value, 10) },\n })\n }\n type=\"number\"\n placeholder=\"1000\"\n />\n \n \n \n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, enable: !recordedValues.enable },\n })\n }\n />\n \n \n \n this.onChange({ ...metricsQuery, digitalStates: { ...digitalStates, enable: !digitalStates.enable } })\n }\n />\n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n \n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, enable: !interpolate.enable } })\n }\n />\n \n \n }\n onChange={this.calcNoDataValueChanged}\n options={this.getNoDataSegments()}\n allowCustomValue\n />\n \n \n\n \n \n ) =>\n onChange({ ...metricsQuery, summary: { ...summary, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n }\n onChange={this.calcBasisValueChanged}\n options={this.getCalcBasisSegments()}\n allowCustomValue\n />\n \n \n \n {this.state.summaries.map((s: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSummaryValueChanged(item, index)}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n );\n })}\n \n }\n onChange={this.onSummaryAction}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n \n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, display: event.target.value })\n }\n placeholder=\"Display\"\n />\n \n \n {\n this.onChange({ ...metricsQuery, regex: { ...regex, enable: !regex.enable } });\n }}\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, search: event.target.value } })\n }\n placeholder=\"(.*)\"\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, replace: event.target.value } })\n }\n placeholder=\"$1\"\n />\n \n \n \n );\n }\n}\n","import React, { InputHTMLAttributes, FunctionComponent } from 'react';\nimport { InlineFormLabel } from '@grafana/ui';\n\nexport interface Props extends InputHTMLAttributes {\n label: string;\n tooltip?: string;\n labelWidth?: number;\n children?: React.ReactNode;\n queryEditor?: JSX.Element;\n}\n\nexport const QueryField: FunctionComponent> = ({ label, labelWidth = 12, tooltip, children }) => (\n <>\n \n {label}\n \n {children}\n \n);\n\nexport const QueryRowTerminator = () => {\n return (\n
\n
\n
\n );\n};\n\nexport const QueryInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryEditorRow = (props: Partial) => {\n return (\n
\n {props.children}\n \n
\n );\n};\n\nexport const QueryRawInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryRawEditorRow = (props: Partial) => {\n return <>{props.children};\n};\n","import React, { useEffect, useState } from 'react';\nimport { Button, ConfirmModal } from '@grafana/ui';\n\ntype Props = {\n isRaw: boolean;\n onChange: (newIsRaw: boolean) => void;\n};\n\nexport const QueryEditorModeSwitcher = ({ isRaw, onChange }: Props): JSX.Element => {\n const [isModalOpen, setModalOpen] = useState(false);\n\n useEffect(() => {\n // if the isRaw changes, we hide the modal\n setModalOpen(false);\n }, [isRaw]);\n\n if (isRaw) {\n return (\n <>\n {\n // we show the are-you-sure modal\n setModalOpen(true);\n }}\n >\n {\n onChange(false);\n }}\n onDismiss={() => {\n setModalOpen(false);\n }}\n />\n \n );\n } else {\n return (\n {\n onChange(true);\n }}\n >\n );\n }\n};\n","import { curry, each, filter, flatten, forOwn, groupBy, keys, map, uniq } from 'lodash';\n\nimport {\n DataQueryRequest,\n DataQueryResponse,\n DataSourceApi,\n DataSourceInstanceSettings,\n AnnotationEvent,\n toDataFrame,\n MetricFindValue,\n} from '@grafana/data';\nimport { BackendSrv, getBackendSrv, getTemplateSrv, TemplateSrv } from '@grafana/runtime';\n\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\ninterface PiwebapiElementPath {\n path: string;\n variable: string;\n}\n\ninterface PiwebapiInternalRsp {\n data: PiwebapiRsp;\n status: number;\n url: string;\n}\n\ninterface PiwebapTargetRsp {\n refId: string;\n target: string;\n datapoints: any[];\n}\n\ninterface PiwebapiRsp {\n Name?: string;\n InstanceType?: string;\n Items?: PiwebapiRsp[];\n WebId?: string;\n HasChildren?: boolean;\n Path?: string;\n}\n\ninterface PiDataServer {\n name: string | undefined;\n webid: string | undefined;\n}\n\nexport class PiWebAPIDatasource extends DataSourceApi {\n piserver: PiDataServer;\n afserver: PiDataServer;\n afdatabase: PiDataServer;\n\n basicAuth?: string;\n withCredentials?: boolean;\n url: string;\n name: string;\n isProxy = false;\n\n templateSrv: TemplateSrv;\n backendSrv: BackendSrv;\n\n piwebapiurl?: string;\n webidCache: Map = new Map();\n\n error: any;\n\n constructor(instanceSettings: DataSourceInstanceSettings) {\n super(instanceSettings);\n this.basicAuth = instanceSettings.basicAuth;\n this.withCredentials = instanceSettings.withCredentials;\n this.url = instanceSettings.url!;\n this.name = instanceSettings.name;\n this.templateSrv = getTemplateSrv();\n this.backendSrv = getBackendSrv();\n\n this.piwebapiurl = instanceSettings.jsonData.url?.toString();\n this.isProxy = /^http(s)?:\\/\\//.test(this.url) || instanceSettings.jsonData.access === 'proxy';\n\n this.piserver = { name: (instanceSettings.jsonData || {}).piserver, webid: undefined };\n this.afserver = { name: (instanceSettings.jsonData || {}).afserver, webid: undefined };\n this.afdatabase = { name: (instanceSettings.jsonData || {}).afdatabase, webid: undefined };\n\n Promise.all([\n this.getAssetServer(this.afserver.name).then((result: PiwebapiRsp) => (this.afserver.webid = result.WebId)),\n this.getDataServer(this.piserver.name).then((result: PiwebapiRsp) => (this.piserver.webid = result.WebId)),\n this.getDatabase(this.afserver.name ? this.afserver.name + '\\\\' + this.afdatabase.name : undefined).then(\n (result: PiwebapiRsp) => (this.afdatabase.webid = result.WebId)\n ),\n ]);\n }\n\n /**\n * Converts a PIWebAPI Event Frame response to a Grafana Annotation\n *\n * @param {any} annotationOptions - Options data from configuration panel.\n * @param {any} endTime - End time of the Event Frame.\n * @param {any} eventFrame - The Event Frame data.\n * @returns - Grafana Annotation\n *\n * @memberOf PiWebApiDatasource\n */\n private eventFrameToAnnotation(\n annotationOptions: any,\n endTime: any,\n eventFrame: any,\n attributeDataItems: any\n ): AnnotationEvent {\n if (annotationOptions.regex && annotationOptions.regex.enable) {\n eventFrame.Name = eventFrame.Name.replace(\n new RegExp(annotationOptions.regex.search),\n annotationOptions.regex.replace\n );\n }\n\n var attributeText = '';\n if (attributeDataItems) {\n each(attributeDataItems, (attributeData: any) => {\n const attributeValue = attributeData.Value.Value\n ? attributeData.Value.Value.Name || attributeData.Value.Value.Value || attributeData.Value.Value\n : null;\n attributeText += '
' + attributeData.Name + ': ' + attributeValue;\n });\n }\n return {\n annotation: annotationOptions,\n title: (endTime ? 'END ' : annotationOptions.showEndTime ? 'START ' : '') + annotationOptions.name,\n time: new Date(endTime ? eventFrame.EndTime : eventFrame.StartTime).getTime(),\n text:\n eventFrame.Name + attributeText + '
Start: ' + eventFrame.StartTime + '
End: ' + eventFrame.EndTime,\n };\n }\n\n /**\n * Builds the PIWebAPI query parameters.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - PIWebAPI query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private buildQueryParameters(options: DataQueryRequest) {\n options.targets = filter(options.targets, (target) => {\n if (!target || !target.target) {\n return false;\n }\n return !target.target.startsWith('Select AF');\n });\n\n options.targets = map(options.targets, (target) => {\n const ds = this;\n var tar = {\n target: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPath: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPathArray: [\n {\n path: this.templateSrv.replace(target.elementPath, options.scopedVars),\n variable: '',\n } as PiwebapiElementPath,\n ],\n attributes: map(target.attributes, (att) =>\n this.templateSrv.replace(att.value?.value || att, options.scopedVars)\n ),\n segments: map(target.segments, (att) => this.templateSrv.replace(att.value?.value, options.scopedVars)),\n display: target.display,\n refId: target.refId,\n hide: target.hide,\n interpolate: target.interpolate || { enable: false },\n recordedValues: target.recordedValues || { enable: false },\n digitalStates: target.digitalStates || { enable: false },\n webid: target.webid,\n webids: target.webids || [],\n regex: target.regex || { enable: false },\n expression: target.expression || '',\n summary: target.summary || { types: [] },\n startTime: options.range.from,\n endTime: options.range.to,\n isPiPoint: target.isPiPoint,\n scopedVars: options.scopedVars,\n };\n\n if (tar.expression) {\n tar.expression = this.templateSrv.replace(tar.expression, options.scopedVars);\n }\n\n if (tar.summary.types !== undefined) {\n tar.summary.types = filter(tar.summary.types, (item) => {\n return item !== undefined && item !== null && item !== '';\n });\n }\n\n // explode All or Multi-selection\n const varsKeys = keys(options.scopedVars);\n this.templateSrv.getVariables().forEach((v: any) => {\n if (ds.isAllSelected(v.current) && varsKeys.indexOf(v.name) < 0) {\n // All selection\n const variables = v.options.filter((o: any) => !o.selected);\n // attributes\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) =>\n !!v.allValue ? attr.replace(v.allValue, vv.value) : attr.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value)\n )\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, v.allValue);\n } else if (Array.isArray(v.current.text) && varsKeys.indexOf(v.name) < 0) {\n // Multi-selection\n const variables = v.options.filter((o: any) => o.selected);\n // attributes\n const query = v.current.value.join(',');\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) => attr.replace(`{${query}}`, vv.value))\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, `{${query}}`);\n }\n });\n\n console.log('tar', tar);\n\n return tar;\n });\n\n return options;\n }\n\n /**\n * Datasource Implementation. Primary entry point for data source.\n * This takes the panel configuration and queries, sends them to PI Web API and parses the response.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - Promise of data in the format for Grafana panels.\n *\n * @memberOf PiWebApiDatasource\n */\n async query(options: DataQueryRequest): Promise {\n var ds = this;\n var query = this.buildQueryParameters(options);\n query.targets = filter(query.targets, (t) => !t.hide);\n\n if (query.targets.length <= 0) {\n return Promise.resolve({ data: [] });\n } else {\n return Promise.all(ds.getStream(query)).then((targetResponses) => {\n let flattened: PiwebapTargetRsp[] = [];\n each(targetResponses, (tr) => {\n each(tr, (item) => flattened.push(item));\n });\n const response: DataQueryResponse = {\n data: flattened\n .sort((a, b) => {\n return +(a.target > b.target) || +(a.target === b.target) - 1;\n })\n .map((d) => toDataFrame(d)),\n };\n return response;\n });\n }\n }\n\n /**\n * Datasource Implementation.\n * Used for testing datasource in datasource configuration pange\n *\n * @returns - Success or failure message.\n *\n * @memberOf PiWebApiDatasource\n */\n testDatasource(): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + '/',\n method: 'GET',\n })\n .then((response: any) => {\n if (response.status === 200) {\n return { status: 'success', message: 'Data source is working', title: 'Success' };\n }\n throw new Error('Failed');\n });\n }\n\n /**\n * Datasource Implementation.\n * This queries PI Web API for Event Frames and converts them into annotations.\n *\n * @param {any} options - Annotation options, usually the Event Frame Category.\n * @returns - A Grafana annotation.\n *\n * @memberOf PiWebApiDatasource\n */\n annotationQuery(options: any): Promise {\n if (!this.afdatabase.webid) {\n return Promise.resolve([]);\n }\n\n var categoryName = options.annotation.query.categoryName\n ? this.templateSrv.replace(options.annotation.query.categoryName, options.scopedVars, 'glob')\n : null;\n var nameFilter = options.annotation.query.nameFilter\n ? this.templateSrv.replace(options.annotation.query.nameFilter, options.scopedVars, 'glob')\n : null;\n var templateName = options.annotation.template ? options.annotation.template.Name : null;\n var annotationOptions = {\n name: options.annotation.name,\n datasource: options.annotation.datasource,\n enable: options.annotation.enable,\n iconColor: options.annotation.iconColor,\n showEndTime: options.annotation.showEndTime,\n regex: options.annotation.regex,\n attribute: options.annotation.attribute,\n categoryName: categoryName,\n templateName: templateName,\n nameFilter: nameFilter,\n };\n\n var filter = [];\n if (!!annotationOptions.categoryName) {\n filter.push('categoryName=' + annotationOptions.categoryName);\n }\n if (!!annotationOptions.nameFilter) {\n filter.push('nameFilter=' + annotationOptions.nameFilter);\n }\n if (!!annotationOptions.templateName) {\n filter.push('templateName=' + annotationOptions.templateName);\n }\n if (!filter.length) {\n return Promise.resolve([]);\n }\n filter.push('startTime=' + options.range.from.toJSON());\n filter.push('endTime=' + options.range.to.toJSON());\n\n if (annotationOptions.attribute && annotationOptions.attribute.enable) {\n var resourceUrl =\n this.piwebapiurl + '/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n if (!!annotationOptions.attribute.name) {\n resourceUrl =\n this.piwebapiurl +\n '/streamsets/{0}/value?nameFilter=' +\n annotationOptions.attribute.name +\n '&selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n }\n var query: any = {};\n query['1'] = {\n Method: 'GET',\n Resource: this.piwebapiurl + '/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&'),\n };\n query['2'] = {\n Method: 'GET',\n RequestTemplate: {\n Resource: resourceUrl,\n },\n Parameters: ['$.1.Content.Items[*].WebId'],\n ParentIds: ['1'],\n };\n return this.restBatch(query).then((result: any) => {\n const data = result.data['1'].Content;\n const valueData = result.data['2'].Content;\n\n var annotations = map(data.Items, (item: any, index: any) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n false,\n item,\n valueData.Items[index].Content.Items\n );\n });\n\n if (options.annotation.showEndTime) {\n var ends = map(data.Items, (item: any, index: number) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n true,\n item,\n valueData.Items[index].Content.Items\n );\n });\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n\n return annotations;\n });\n } else {\n return this.restGet('/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&')).then(\n (result) => {\n var annotations = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, false));\n if (options.annotation.showEndTime) {\n var ends = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, true));\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n return annotations;\n }\n );\n }\n }\n\n /**\n * Builds the Grafana metric segment for use on the query user interface.\n *\n * @param {any} response - response from PI Web API.\n * @returns - Grafana metric segment.\n *\n * @memberOf PiWebApiDatasource\n */\n private metricQueryTransform(response: PiwebapiRsp[]): MetricFindValue[] {\n return map(response, (item) => {\n return {\n text: item.Name,\n expandable:\n item.HasChildren === undefined || item.HasChildren === true || (item.Path ?? '').split('\\\\').length <= 3,\n HasChildren: item.HasChildren,\n Items: item.Items ?? [],\n Path: item.Path,\n WebId: item.WebId,\n } as MetricFindValue;\n });\n }\n\n /**\n * This method does the discovery of the AF Hierarchy and populates the query user interface segments.\n *\n * @param {any} query - Parses the query configuration and builds a PI Web API query.\n * @returns - Segment information.\n *\n * @memberOf PiWebApiDatasource\n */\n metricFindQuery(query: any, queryOptions: any): Promise {\n var ds = this;\n var querydepth = ['servers', 'databases', 'databaseElements', 'elements'];\n if (typeof query === 'string') {\n query = JSON.parse(query as string);\n }\n if (queryOptions.isPiPoint) {\n query.path = this.templateSrv.replace(query.path, queryOptions);\n } else {\n if (query.path === '') {\n query.type = querydepth[0];\n } else if (query.type !== 'attributes') {\n query.type = querydepth[Math.max(0, Math.min(query.path.split('\\\\').length, querydepth.length - 1))];\n }\n query.path = this.templateSrv.replace(query.path, queryOptions);\n query.path = query.path.replace(/\\{([^\\\\])*\\}/gi, (r: string) => r.substring(1, r.length - 2).split(',')[0]);\n }\n\n query.filter = query.filter ?? '*';\n\n if (query.type === 'servers') {\n return ds.afserver?.name\n ? ds\n .getAssetServer(ds.afserver.name)\n .then((result: PiwebapiRsp) => [result])\n .then(ds.metricQueryTransform)\n : ds.getAssetServers().then(ds.metricQueryTransform);\n } else if (query.type === 'databases') {\n return ds\n .getAssetServer(query.path)\n .then((server) => ds.getDatabases(server.WebId ?? '', {}))\n .then(ds.metricQueryTransform);\n } else if (query.type === 'databaseElements') {\n return ds\n .getDatabase(query.path)\n .then((db) =>\n ds.getDatabaseElements(db.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'elements') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getElements(element.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'attributes') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getAttributes(element.WebId ?? '', {\n searchFullHierarchy: 'true',\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Path',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'dataserver') {\n return ds.getDataServers().then(ds.metricQueryTransform);\n } else if (query.type === 'pipoint') {\n return ds.piPointSearch(query.webId, query.pointName).then(ds.metricQueryTransform);\n }\n return Promise.reject('Bad type');\n }\n\n /**\n * Gets the url of summary data from the query configuration.\n *\n * @param {any} summary - Query summary configuration.\n * @returns - URL append string.\n *\n * @memberOf PiWebApiDatasource\n */\n getSummaryUrl(summary: any) {\n if (summary.interval.trim() === '') {\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis\n );\n }\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis +\n '&summaryDuration=' +\n summary.interval.trim()\n );\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} value - A list of PIWebAPI values.\n * @param {any} target - The target Grafana metric.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @returns - An array of Grafana value, timestamp pairs.\n *\n */\n parsePiPointValueList(value: any[], target: any, isSummary: boolean) {\n var api = this;\n var datapoints: any[] = [];\n each(value, (item) => {\n // @ts-ignore\n var { grafanaDataPoint, previousValue, drop } = this.noDataReplace(\n isSummary ? item.Value : item,\n target.summary.nodata,\n api.parsePiPointValue(isSummary ? item.Value : item, target, isSummary)\n );\n if (!drop) {\n datapoints.push(grafanaDataPoint);\n }\n });\n return datapoints;\n }\n\n /**\n * Convert a PI Point value to use Grafana value/timestamp.\n *\n * @param {any} value - PI Point value.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @param {any} target - The target grafana metric.\n * @returns - Grafana value pair.\n *\n */\n parsePiPointValue(value: any, target: any, isSummary: boolean) {\n let num = !isSummary && typeof value.Value === 'object' ? value.Value?.Value : value.Value;\n\n if (!value.Good || !!target.digitalStates?.enable) {\n num = (!isSummary && typeof value.Value === 'object' ? value.Value?.Name : value.Name) ?? '';\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} item - 'Item' object from PIWebAPI\n * @param {any} noDataReplacementMode - String state of how to replace 'No Data'\n * @param {any} grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns perviousValue - {any} Grafana value (value only).\n *\n */\n noDataReplace(\n item: any,\n noDataReplacementMode: any,\n grafanaDataPoint: any[]\n ): {\n grafanaDataPoint: any[];\n previousValue: any;\n drop: boolean;\n } {\n var previousValue = null;\n var drop = false;\n if (!item.Good || item.Value === 'No Data' || (item.Value?.Name && item.Value?.Name === 'No Data')) {\n if (noDataReplacementMode === 'Drop') {\n drop = true;\n } else if (noDataReplacementMode === '0') {\n grafanaDataPoint[0] = 0;\n } else if (noDataReplacementMode === 'Keep') {\n // Do nothing keep\n } else if (noDataReplacementMode === 'Null') {\n grafanaDataPoint[0] = null;\n } else if (noDataReplacementMode === 'Previous' && previousValue !== null) {\n grafanaDataPoint[0] = previousValue;\n }\n } else {\n previousValue = item.Value;\n }\n return { grafanaDataPoint, previousValue, drop };\n }\n\n /**\n * Process the response from PI Web API for a single item.\n *\n * @param {any} content - Web response data.\n * @param {any} target - The target grafana metric.\n * @param {any} name - The target metric name.\n * @returns - Parsed metric in target/datapoint json format.\n *\n * @memberOf PiWebApiDatasource\n */\n processResults(content: any, target: any, name: any, noTemplate: boolean): PiwebapTargetRsp[] {\n const api = this;\n const isSummary: boolean = target.summary && target.summary.types && target.summary.types.length > 0;\n name = noTemplate ? name : this.getPath(target.elementPathArray, content.Path) + '|' + name;\n if (target.regex && target.regex.enable && target.regex.search.length && target.regex.replace.length) {\n name = name.replace(new RegExp(target.regex.search), target.regex.replace);\n }\n if (isSummary) {\n var innerResults: any[] = [];\n var groups = groupBy(content.Items, (item: any) => item.Type);\n forOwn(groups, (value, key) => {\n innerResults.push({\n refId: target.refId,\n target: name + '[' + key + ']',\n datapoints: api.parsePiPointValueList(value, target, isSummary),\n });\n });\n return innerResults;\n }\n return [\n {\n refId: target.refId,\n target: name,\n datapoints: api.parsePiPointValueList(content.Items, target, isSummary),\n },\n ];\n }\n\n /** PRIVATE SECTION */\n\n /**\n * Check if all items are selected.\n *\n * @param {any} current the current variable selection\n * @return {boolean} true if all value is selected, false otherwise\n */\n private isAllSelected(current: any): boolean {\n if (!current) {\n return false;\n }\n if (Array.isArray(current.text)) {\n return current.text.indexOf('All') >= 0;\n }\n return current.text === 'All';\n }\n\n /**\n * Check if the value is a number.\n *\n * @param {any} number the value to check\n * @returns {boolean} true if the value is a number, false otherwise\n */\n private checkNumber(number: any): boolean {\n return typeof number === 'number' && !Number.isNaN(number) && Number.isFinite(number);\n }\n\n /**\n * Returns a new element path list based on the panel variables.\n *\n * @param {string} elementPathArray array of element paths\n * @param {string} variables the list of variable values\n * @param {string} allValue the all value value for the variable\n * @returns {PiwebapiElementPath[]} new element path list\n */\n private getElementPath(\n elementPathArray: PiwebapiElementPath[],\n variables: any[],\n allValue: string\n ): PiwebapiElementPath[] {\n // elementPath\n let newElementPathArray: PiwebapiElementPath[] = [];\n elementPathArray.forEach((elem: PiwebapiElementPath) => {\n if ((!!allValue && elem.path.indexOf(allValue) >= 0) || (!allValue && elem.path.match(/{[a-zA-z0-9,-_]+}/gi))) {\n const temp: PiwebapiElementPath[] = variables.map((vv: any) => {\n return {\n path: !!allValue\n ? elem.path.replace(allValue, vv.value)\n : elem.path.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value),\n variable: vv.value,\n } as PiwebapiElementPath;\n });\n newElementPathArray = newElementPathArray.concat(temp);\n }\n });\n if (newElementPathArray.length) {\n return uniq(flatten(newElementPathArray));\n }\n return elementPathArray;\n }\n\n /**\n * Returns the last item of the element path.\n *\n * @param {string} path element path\n * @returns {string} last item of the element path\n */\n private getPath(elementPathArray: PiwebapiElementPath[], path: string): string {\n let splitPath = path.split('|');\n if (splitPath.length === 0) {\n return '';\n }\n if (elementPathArray.length === 0) {\n return '';\n }\n splitPath = splitPath[0].split('\\\\');\n const splitStr = splitPath.length === 0 ? '' : splitPath.pop() ?? '';\n const foundElement = elementPathArray.find((e) => path.indexOf(e.path) >= 0)?.variable;\n return foundElement ? foundElement + '|' + splitStr : splitStr;\n }\n\n /**\n * Gets historical data from a PI Web API stream source.\n *\n * @param {any} query - Grafana query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private getStream(query: any): Array> {\n const ds = this;\n var results: Array> = [];\n\n each(query.targets, (target) => {\n target.attributes = filter(target.attributes || [], (attribute) => {\n return 1 && attribute;\n });\n var url = '';\n var isSummary = target.summary && target.summary.types && target.summary.types.length > 0;\n var isInterpolated = target.interpolate && target.interpolate.enable;\n // perhaps add a check to see if interpolate override time < query.interval\n var intervalTime = target.interpolate.interval ? target.interpolate.interval : query.interval;\n var timeRange = '?startTime=' + query.range.from.toJSON() + '&endTime=' + query.range.to.toJSON();\n var targetName = target.expression || target.elementPath;\n var displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n if (target.expression) {\n url += '/calculation';\n if (isSummary) {\n url += '/summary' + timeRange + (isInterpolated ? '&sampleType=Interval&sampleInterval=' + intervalTime : '');\n } else {\n url += '/intervals' + timeRange + '&sampleInterval=' + intervalTime;\n }\n url += '&expression=' + encodeURIComponent(target.expression);\n if (target.attributes.length > 0) {\n results.push(ds.internalStream(query, target, url));\n } else {\n results.push(\n ds.restGetWebId(target.elementPath, target.isPiPoint).then((webidresponse: any) => {\n return ds\n .restPost(url + webidresponse.WebId)\n .then((response: any) => ds.processResults(response.data, target, displayName || targetName, false))\n .catch((err: any) => (ds.error = err));\n })\n );\n }\n } else {\n url += '/streamsets';\n if (isSummary) {\n url += '/summary' + timeRange + '&intervals=' + query.maxDataPoints + this.getSummaryUrl(target.summary);\n } else if (target.interpolate && target.interpolate.enable) {\n url += '/interpolated' + timeRange + '&interval=' + intervalTime;\n } else if (target.recordedValues && target.recordedValues.enable) {\n const maxNumber =\n target.recordedValues.maxNumber && !isNaN(target.recordedValues.maxNumber)\n ? target.recordedValues.maxNumber\n : 1000;\n url += '/recorded' + timeRange + '&maxCount=' + maxNumber;\n } else {\n url += '/plot' + timeRange + '&intervals=' + query.maxDataPoints;\n }\n\n results.push(ds.internalStream(query, target, url));\n }\n });\n\n return results;\n }\n\n /**\n * Return the data points from the provided Grafana query.\n *\n * @param {any} query - Grafana query.\n * @param {any} target - Grafana query target.\n * @param {string} url - The base URL for the query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private internalStream(query: any, target: any, url: string): Promise {\n const ds = this;\n const targetName = target.expression || target.elementPath;\n const displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n const noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path;\n let promises: Promise;\n\n if (noTemplate) {\n if (target.attributes.length > 1 && !target.isPiPoint) {\n promises = ds\n .restGetWebId(target.elementPath, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n } else {\n promises = Promise.all(\n map(target.attributes, (attribute: string) =>\n ds.restGetWebId(target.elementPath + '|' + attribute, target.isPiPoint)\n )\n );\n }\n } else {\n if (target.attributes.length > 1 && !target.isPiPoint) {\n promises = Promise.all(\n target.elementPathArray.map((elementPath: PiwebapiElementPath) => {\n return ds\n .restGetWebId(elementPath.path, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n })\n );\n } else {\n promises = Promise.all(\n flatten(\n map(target.attributes, (attribute: string) => {\n return target.elementPathArray.map((elementPath: PiwebapiElementPath) =>\n ds.restGetWebId(elementPath.path + '|' + attribute, target.isPiPoint)\n );\n })\n )\n );\n }\n }\n\n return promises.then((webidresponse) => {\n const query: any = {};\n each(flatten(webidresponse), (webid, index) => {\n query[index + 1] = {\n Method: 'GET',\n Resource: ds.piwebapiurl + url + '&webid=' + webid.WebId,\n };\n });\n\n return ds\n .restBatch(query)\n .then((response: any) => {\n const targetResults: any[] = [];\n each(response.data, (value, key) => {\n if (target.expression) {\n const attribute = webidresponse[parseInt(key, 10) - 1].Name;\n each(\n ds.processResults(value.Content, target, displayName || attribute || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n } else {\n each(value.Content.Items, (item) => {\n each(\n ds.processResults(item, target, displayName || item.Name || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n });\n }\n });\n return targetResults;\n })\n .catch((err: any) => (ds.error = err));\n });\n }\n\n /**\n * Abstraction for calling the PI Web API REST endpoint\n *\n * @param {any} path - the path to append to the base server URL.\n * @returns - The full URL.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGet(path: string): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n return response as PiwebapiInternalRsp;\n });\n }\n\n /**\n * Resolve a Grafana query into a PI Web API webid. Uses client side cache when possible to reduce lookups.\n *\n * @param {string} assetPath - The AF Path or the Pi Point Path (\\\\ServerName\\piPointName) to the asset.\n * @param {boolean} isPiPoint - Flag indicating it's a PI Point\n * @returns - URL query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGetWebId(assetPath: string, isPiPoint: boolean): Promise {\n var ds = this;\n\n // check cache\n var cachedWebId = ds.webidCache.get(assetPath);\n if (cachedWebId) {\n return Promise.resolve({ Path: assetPath, WebId: cachedWebId.WebId, Name: cachedWebId.Name });\n }\n\n let path = '';\n if (isPiPoint) {\n path = '/points?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\' + assetPath.replace('|', '\\\\');\n } else {\n // no cache hit, query server\n path =\n (assetPath.indexOf('|') >= 0\n ? '/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\'\n : '/elements?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\') + assetPath;\n }\n\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n ds.webidCache.set(assetPath, response.data);\n return { Path: assetPath, WebId: response.data.WebId, Name: response.data.Name };\n });\n }\n\n /**\n * Execute a batch query on the PI Web API.\n *\n * @param {any} batch - Batch JSON query data.\n * @returns - Batch response.\n *\n * @memberOf PiWebApiDatasource\n */\n private restBatch(batch: any) {\n return this.backendSrv.datasourceRequest({\n url: this.url + '/batch',\n data: batch,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n },\n });\n }\n\n /**\n * Execute a POST on the PI Web API.\n *\n * @param {string} path - The full url of the POST.\n * @returns - POST response data.\n *\n * @memberOf PiWebApiDatasource\n */\n private restPost(path: string) {\n return this.backendSrv.datasourceRequest({\n url: this.url,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n 'X-PIWEBAPI-HTTP-METHOD': 'GET',\n 'X-PIWEBAPI-RESOURCE-ADDRESS': path,\n },\n });\n }\n\n // Get a list of all data (PI) servers\n private getDataServers(): Promise {\n return this.restGet('/dataservers').then((response) => response.data.Items ?? []);\n }\n private getDataServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/dataservers?name=' + name).then((response) => response.data);\n }\n // Get a list of all asset (AF) servers\n private getAssetServers(): Promise {\n return this.restGet('/assetservers').then((response) => response.data.Items ?? []);\n }\n private getAssetServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/assetservers?path=\\\\\\\\' + name).then((response) => response.data);\n }\n private getDatabase(path: string | undefined): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/assetdatabases?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getDatabases(serverId: string, options?: any): Promise {\n if (!serverId) {\n return Promise.resolve([]);\n }\n return this.restGet('/assetservers/' + serverId + '/assetdatabases').then((response) => response.data.Items ?? []);\n }\n getElement(path: string): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/elements?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getEventFrameTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'EventFrame');\n });\n }\n getElementTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'Element');\n });\n }\n\n /**\n * @description\n * Get the child attributes of the current resource.\n * GET attributes/{webId}/attributes\n * @param {string} elementId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.nameFilter - The name query string used for finding attributes. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned attributes must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned attributes must be members of this template. The default is no template filter.\n * @param {string} options.valueType - Specify that returned attributes' value type must be the given value type. The default is no value type filter.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include attributes nested further than the immediate attributes of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {string} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {string} options.showExcluded - Specified if the search should include attributes with the Excluded property set. The default is 'false'.\n * @param {string} options.showHidden - Specified if the search should include attributes with the Hidden property set. The default is 'false'.\n * @param {string} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getAttributes(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/attributes' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET assetdatabases/{webId}/elements\n * @param {string} databaseId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getDatabaseElements(databaseId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/assetdatabases/' + databaseId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET elements/{webId}/elements\n * @param {string} databaseId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getElements(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * Retrieve a list of points on a specified Data Server.\n *\n * @param {string} serverId - The ID of the server. See WebID for more information.\n * @param {string} nameFilter - A query string for filtering by point name. The default is no filter. *, ?, [ab], [!ab]\n */\n private piPointSearch(serverId: string, nameFilter: string): Promise {\n let filter1 = this.templateSrv.replace(nameFilter);\n let filter2 = `${filter1}`;\n let doFilter = false;\n if (filter1 !== nameFilter) {\n const regex = /\\{(\\w|,)+\\}/gs;\n let m;\n while ((m = regex.exec(filter1)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // The result can be accessed through the `m`-variable.\n m.forEach((match, groupIndex) => {\n if (groupIndex === 0) {\n filter1 = filter1.replace(match, match.replace('{', '(').replace('}', ')').replace(',', '|'));\n filter2 = filter2.replace(match, '*');\n doFilter = true;\n }\n });\n }\n }\n return this.restGet('/dataservers/' + serverId + '/points?maxCount=20&nameFilter=' + filter2).then((results) => {\n if (!!results && !!results.data?.Items) {\n return doFilter ? results.data.Items.filter((item) => item.Name?.match(filter1)) : results.data.Items;\n }\n return [];\n });\n }\n\n /**\n * Get the PI Web API webid or PI Point.\n *\n * @param {any} target - AF Path or Point name.\n * @returns - webid.\n *\n * @memberOf PiWebApiDatasource\n */\n getWebId(target: any) {\n var ds = this;\n var isAf = target.target.indexOf('\\\\') >= 0;\n var isAttribute = target.target.indexOf('|') >= 0;\n if (!isAf && target.target.indexOf('.') === -1) {\n return Promise.resolve([{ WebId: target.target, Name: target.display || target.target }]);\n }\n\n if (!isAf) {\n // pi point lookup\n return ds.piPointSearch(this.piserver.webid!, target.target).then((results) => {\n if (results === undefined || results.length === 0) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n return results;\n });\n } else if (isAf && isAttribute) {\n // af attribute lookup\n return ds.restGet('/attributes?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n } else {\n // af element lookup\n return ds.restGet('/elements?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n }\n }\n}\n","import { DataQuery, DataSourceJsonData } from '@grafana/data';\n\nexport interface PIWebAPISelectableValue {\n webId?: string;\n value?: string;\n type?: string;\n expandable?: boolean;\n}\n\nexport interface PIWebAPIAnnotationsQuery extends DataQuery {\n target: string;\n}\n\nexport interface PIWebAPIQuery extends DataQuery {\n target: string;\n elementPath: string;\n attributes: any[];\n segments: any[];\n display: any;\n interpolate: any;\n recordedValues: any;\n digitalStates: any;\n webid: string;\n webids: string[];\n regex: any;\n summary: any;\n expression: string;\n isPiPoint: boolean;\n rawQuery?: boolean;\n query?: string;\n}\n\nexport const defaultQuery: Partial = {\n target: ';',\n attributes: [],\n segments: [],\n regex: { enable: false },\n summary: { types: [], basis: 'EventWeighted', interval: '', nodata: 'Null' },\n expression: '',\n interpolate: { enable: false },\n recordedValues: { enable: false },\n digitalStates: { enable: false },\n isPiPoint: false,\n};\n\n/**\n * These are options configured for each DataSource instance\n */\nexport interface PIWebAPIDataSourceJsonData extends DataSourceJsonData {\n url?: string;\n access?: string;\n piserver?: string;\n afserver?: string;\n afdatabase?: string;\n}\n\n/**\n * Value that is used in the backend, but never sent over HTTP to the frontend\n */\nexport interface PIWebAPISecureJsonData {\n apiKey?: string;\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_data__;","module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_runtime__;","module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_ui__;","module.exports = __WEBPACK_EXTERNAL_MODULE_lodash__;","module.exports = __WEBPACK_EXTERNAL_MODULE_react__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { DataSourcePlugin } from '@grafana/data';\nimport { AnnotationsQueryCtrl } from './AnnotationsQueryCtrl';\nimport { PIWebAPIConfigEditor } from './ConfigEditor';\nimport { PIWebAPIQueryEditor } from './QueryEditor';\nimport { PiWebAPIDatasource } from './datasource';\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\nexport const plugin = new DataSourcePlugin(\n PiWebAPIDatasource\n)\n .setConfigEditor(PIWebAPIConfigEditor)\n .setQueryEditor(PIWebAPIQueryEditor)\n .setAnnotationQueryCtrl(AnnotationsQueryCtrl);\n"],"names":["AnnotationsQueryCtrl","$scope","annotation","ctrl","datasource","query","databases","templates","regex","attribute","showEndTime","getAssetServer","afserver","name","then","result","getDatabases","WebId","getEventFrames","webid","dbs","$apply","getEventFrameTemplates","database","React","PureComponent","LegacyForms","DataSourceHttpSettings","FormField","coerceOptions","options","jsonData","url","PIWebAPIConfigEditor","event","props","onOptionsChange","piserver","target","value","afdatabase","originalOptions","onMyOptionsChange","onPIServerChange","onAFServerChange","onAFDatabaseChange","each","filter","forOwn","join","reduce","map","slice","remove","defaults","Icon","InlineField","InlineFieldRow","InlineSwitch","Input","SegmentAsync","Segment","QueryInlineField","QueryRawInlineField","QueryRowTerminator","defaultQuery","QueryEditorModeSwitcher","LABEL_WIDTH","MIN_ELEM_INPUT_WIDTH","MIN_ATTR_INPUT_WIDTH","REMOVE_LABEL","CustomLabelComponent","type","label","PIWebAPIQueryEditor","isPiPoint","segments","attributes","summaries","attributeSegment","summarySegment","calculationBasisSegment","noDataReplacementSegment","setState","onChange","item","index","state","n","checkPiPointSegments","checkAttributeSegments","length","push","expandable","piServer","segmentChangeValue","currentSegment","data","findQuery","path","getSegmentPathUpTo","Promise","resolve","metricFindQuery","Object","assign","request","scopedVars","items","altSegments","selectableValue","text","webId","variables","templateSrv","getVariables","variable","unshift","err","error","message","attributeText","getSelectedPIServer","pointName","Path","availableAttributes","val","key","segmentsArray","attributesArray","splitAttributes","split","splitElements","splice","_","getElementSegments","elements","summariesArray","cb","initialLoad","scopedVarsDone","force","metricsQuery","summary","types","buildFromTarget","_segmentsArray","updateArray","e","console","checkAfServer","onRunQuery","rawQuery","elementPath","s","queryChange","expression","onSegmentChange","bind","calcBasisValueChanged","calcNoDataValueChanged","onSummaryAction","onSummaryValueChanged","onAttributeAction","onAttributeChange","summaryTypes","calculationBasis","noDataReplacement","segment","basis","nodata","isValueEmpty","stateCallback","indexOf","part","attributeChangeValue","arr","startsWith","attributesResponse","validAttributes","substring","filteredAttributes","attrib","changedValue","replace","undefined","webID","forEach","parts","match","queryProps","interpolate","digitalStates","recordedValues","display","onIsPiPointChange","textEditorChanged","onPiPointChange","getAttributeSegmentsPI","getAttributeSegmentsAF","maxNumber","parseInt","enable","interval","getNoDataSegments","getCalcBasisSegments","getSummarySegments","search","InlineFormLabel","QueryField","labelWidth","tooltip","children","QueryEditorRow","QueryRawEditorRow","useEffect","useState","Button","ConfirmModal","isRaw","isModalOpen","setModalOpen","curry","flatten","groupBy","keys","uniq","DataSourceApi","toDataFrame","getBackendSrv","getTemplateSrv","PiWebAPIDatasource","instanceSettings","Map","basicAuth","withCredentials","backendSrv","piwebapiurl","toString","isProxy","test","access","all","getDataServer","getDatabase","annotationOptions","endTime","eventFrame","attributeDataItems","Name","RegExp","attributeData","attributeValue","Value","title","time","Date","EndTime","StartTime","getTime","targets","ds","tar","elementPathArray","att","refId","hide","webids","startTime","range","from","to","varsKeys","v","isAllSelected","current","o","selected","attr","vv","allValue","getElementPath","Array","isArray","log","buildQueryParameters","t","getStream","targetResponses","flattened","tr","response","sort","a","b","d","datasourceRequest","method","status","Error","categoryName","nameFilter","templateName","template","iconColor","toJSON","resourceUrl","Method","Resource","RequestTemplate","Parameters","ParentIds","restBatch","Content","valueData","annotations","Items","eventFrameToAnnotation","ends","end","restGet","HasChildren","queryOptions","querydepth","JSON","parse","Math","max","min","r","metricQueryTransform","getAssetServers","server","db","getDatabaseElements","selectedFields","getElement","element","getElements","getAttributes","searchFullHierarchy","getDataServers","piPointSearch","reject","trim","isSummary","api","datapoints","noDataReplace","parsePiPointValue","grafanaDataPoint","previousValue","drop","num","Good","checkNumber","Number","Timestamp","noDataReplacementMode","content","noTemplate","getPath","innerResults","groups","Type","parsePiPointValueList","number","isNaN","isFinite","newElementPathArray","elem","temp","concat","splitPath","splitStr","pop","foundElement","find","results","isInterpolated","intervalTime","timeRange","targetName","displayName","encodeURIComponent","internalStream","restGetWebId","webidresponse","restPost","processResults","maxDataPoints","getSummaryUrl","promises","datarsp","datarspa","targetResults","targetResult","headers","assetPath","cachedWebId","webidCache","get","set","batch","serverId","databaseId","InstanceType","elementId","querystring","filter1","filter2","doFilter","m","exec","lastIndex","groupIndex","isAf","isAttribute","DataSourcePlugin","plugin","setConfigEditor","setQueryEditor","setAnnotationQueryCtrl"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"module.js","mappings":";uHAAAA,EAAOC,QAAUC,OCAjBF,EAAOC,QAAUE,OCAjBH,EAAOC,QAAUG,OCAjBJ,EAAOC,QAAUI,QCAjBL,EAAOC,QAAUK,ICCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAID,EAASO,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GA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Q,KAI9BqO,EAQMA,GAAQC,EAEV3J,EAAG4D,QAAQ,wBAA0BvS,EAAOA,QAAQrB,MAAK,SAACsX,GAC/D,YAAqB5Z,IAAjB4Z,EAAQ3Q,MAAyC,MAAnB2Q,EAAQjF,OACjC,CAAC,CAAElS,MAAOkB,EAAOA,OAAQgO,KAAMhO,EAAOkL,SAAWlL,EAAOA,UAGjEiW,EAAQ3Q,KAAK0I,KAAOhO,EAAOkL,SAAW+K,EAAQ3Q,KAAK0I,KAC5C,CAACiI,EAAQ3Q,MACjB,IAGMqJ,EAAG4D,QAAQ,sBAAwBvS,EAAOA,QAAQrB,MAAK,SAACsX,GAC7D,YAAqB5Z,IAAjB4Z,EAAQ3Q,MAAyC,MAAnB2Q,EAAQjF,OACjC,CAAC,CAAElS,MAAOkB,EAAOA,OAAQgO,KAAMhO,EAAOkL,SAAWlL,EAAOA,UAGjEiW,EAAQ3Q,KAAK0I,KAAOhO,EAAOkL,SAAW+K,EAAQ3Q,KAAK0I,KAC5C,CAACiI,EAAQ3Q,MACjB,IAzBMqJ,EAAGiF,cAAc9V,KAAKiC,SAASf,MAAQgB,EAAOA,QAAQrB,MAAK,SAACsX,GACjE,YAAgB5Z,IAAZ4Z,GAA4C,IAAnBA,EAAQjR,OAC5B,CAAC,CAAElG,MAAOkB,EAAOA,OAAQgO,KAAMhO,EAAOkL,SAAWlL,EAAOA,SAE1DiW,CACR,IAVMvQ,QAAQC,QAAQ,CAAC,CAAE7G,MAAOkB,EAAOA,OAAQgO,KAAMhO,EAAOkL,SAAWlL,EAAOA,SAgClF,uFAzrCH,GAAwCuY,EAAAA,eCvC3BC,GAAS,IAAIC,EAAAA,iBACxB7L,IAEC8L,gBAAgB/Y,GAChBgZ,eAAezU,GACf0U,uBAAuBhb","sources":["webpack:///external amd \"react\"","webpack:///external amd \"@grafana/ui\"","webpack:///external amd \"@grafana/data\"","webpack:///external amd \"lodash\"","webpack:///external amd \"@grafana/runtime\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./AnnotationsQueryCtrl.ts","webpack:///./ConfigEditor.tsx","webpack:///./components/Forms.tsx","webpack:///./types.ts","webpack:///./components/QueryEditorModeSwitcher.tsx","webpack:///./QueryEditor.tsx","webpack:///./datasource.ts","webpack:///./module.ts"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export class AnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n\n $scope: any;\n annotation: any;\n datasource: any;\n\n /** @ngInject */\n constructor($scope: any) {\n this.$scope = $scope;\n this.annotation = $scope.ctrl.annotation;\n this.datasource = $scope.ctrl.datasource;\n\n // load defaults\n this.annotation.query = this.annotation.query || {};\n this.annotation.databases = this.annotation.databases || [];\n this.annotation.templates = this.annotation.templates || [];\n this.annotation.regex = this.annotation.regex || {};\n this.annotation.attribute = this.annotation.attribute || {};\n this.annotation.showEndTime = this.annotation.showEndTime || false;\n\n this.datasource.getAssetServer(this.datasource.afserver.name).then((result: any) => {\n return this.getDatabases(result.WebId);\n });\n }\n templateChanged() {\n // do nothing\n }\n databaseChanged() {\n this.annotation.templates = [];\n this.getEventFrames();\n }\n getDatabases(webid: string) {\n var ctrl = this;\n ctrl.datasource.getDatabases(webid).then((dbs: any) => {\n ctrl.annotation.databases = dbs;\n this.$scope.$apply();\n });\n }\n getEventFrames() {\n var ctrl = this;\n ctrl.datasource.getEventFrameTemplates(this.annotation.database.WebId).then((templates: any) => {\n ctrl.annotation.templates = templates;\n this.$scope.$apply();\n });\n }\n}\n","import React, { ChangeEvent, PureComponent } from 'react';\nimport { LegacyForms, DataSourceHttpSettings } from '@grafana/ui';\nimport { DataSourcePluginOptionsEditorProps, DataSourceJsonData, DataSourceSettings } from '@grafana/data';\nimport { PIWebAPIDataSourceJsonData } from './types';\n\nconst { FormField } = LegacyForms;\n\ninterface Props extends DataSourcePluginOptionsEditorProps {}\n\nconst coerceOptions = (\n options: DataSourceSettings\n): DataSourceSettings => {\n return {\n ...options,\n jsonData: {\n ...options.jsonData,\n url: options.url,\n },\n };\n};\n\ninterface State {}\n\nexport class PIWebAPIConfigEditor extends PureComponent {\n onPIServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n piserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFDatabaseChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afdatabase: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onMyOptionsChange = (options: DataSourceSettings) => {\n const { onOptionsChange } = this.props;\n onOptionsChange(coerceOptions(options));\n };\n\n render() {\n const { options: originalOptions } = this.props;\n const options = coerceOptions(originalOptions);\n\n return (\n
\n \n\n

PI/AF Connection Details

\n\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n );\n }\n}\n","import React, { InputHTMLAttributes, FunctionComponent } from 'react';\nimport { InlineFormLabel } from '@grafana/ui';\n\nexport interface Props extends InputHTMLAttributes {\n label: string;\n tooltip?: string;\n labelWidth?: number;\n children?: React.ReactNode;\n queryEditor?: JSX.Element;\n}\n\nexport const QueryField: FunctionComponent> = ({ label, labelWidth = 12, tooltip, children }) => (\n <>\n \n {label}\n \n {children}\n \n);\n\nexport const QueryRowTerminator = () => {\n return (\n
\n
\n
\n );\n};\n\nexport const QueryInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryEditorRow = (props: Partial) => {\n return (\n
\n {props.children}\n \n
\n );\n};\n\nexport const QueryRawInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryRawEditorRow = (props: Partial) => {\n return <>{props.children};\n};\n","import { DataQuery, DataSourceJsonData } from '@grafana/data';\n\nexport interface PIWebAPISelectableValue {\n webId?: string;\n value?: string;\n type?: string;\n expandable?: boolean;\n}\n\nexport interface PIWebAPIAnnotationsQuery extends DataQuery {\n target: string;\n}\n\nexport interface PIWebAPIQuery extends DataQuery {\n target: string;\n elementPath: string;\n attributes: any[];\n segments: any[];\n display: any;\n interpolate: any;\n recordedValues: any;\n digitalStates: any;\n webid: string;\n webids: string[];\n regex: any;\n summary: any;\n expression: string;\n isPiPoint: boolean;\n rawQuery?: boolean;\n query?: string;\n}\n\nexport const defaultQuery: Partial = {\n target: ';',\n attributes: [],\n segments: [],\n regex: { enable: false },\n summary: { types: [], basis: 'EventWeighted', interval: '', nodata: 'Null' },\n expression: '',\n interpolate: { enable: false },\n recordedValues: { enable: false },\n digitalStates: { enable: false },\n isPiPoint: false,\n};\n\n/**\n * These are options configured for each DataSource instance\n */\nexport interface PIWebAPIDataSourceJsonData extends DataSourceJsonData {\n url?: string;\n access?: string;\n piserver?: string;\n afserver?: string;\n afdatabase?: string;\n}\n\n/**\n * Value that is used in the backend, but never sent over HTTP to the frontend\n */\nexport interface PIWebAPISecureJsonData {\n apiKey?: string;\n}\n","import React, { useEffect, useState } from 'react';\nimport { Button, ConfirmModal } from '@grafana/ui';\n\ntype Props = {\n isRaw: boolean;\n onChange: (newIsRaw: boolean) => void;\n};\n\nexport const QueryEditorModeSwitcher = ({ isRaw, onChange }: Props): JSX.Element => {\n const [isModalOpen, setModalOpen] = useState(false);\n\n useEffect(() => {\n // if the isRaw changes, we hide the modal\n setModalOpen(false);\n }, [isRaw]);\n\n if (isRaw) {\n return (\n <>\n {\n // we show the are-you-sure modal\n setModalOpen(true);\n }}\n >\n {\n onChange(false);\n }}\n onDismiss={() => {\n setModalOpen(false);\n }}\n />\n \n );\n } else {\n return (\n {\n onChange(true);\n }}\n >\n );\n }\n};\n","import { each, filter, forOwn, join, reduce, map, slice, remove, defaults } from 'lodash';\n\nimport React, { PureComponent, ChangeEvent } from 'react';\nimport { Icon, InlineField, InlineFieldRow, InlineSwitch, Input, SegmentAsync, Segment } from '@grafana/ui';\nimport { QueryEditorProps, SelectableValue, VariableModel } from '@grafana/data';\n\nimport { PiWebAPIDatasource } from './datasource';\nimport { QueryInlineField, QueryRawInlineField, QueryRowTerminator } from './components/Forms';\nimport { PIWebAPISelectableValue, PIWebAPIDataSourceJsonData, PIWebAPIQuery, defaultQuery } from './types';\nimport { QueryEditorModeSwitcher } from 'components/QueryEditorModeSwitcher';\n\nconst LABEL_WIDTH = 24;\nconst MIN_ELEM_INPUT_WIDTH = 200;\nconst MIN_ATTR_INPUT_WIDTH = 250;\n\ninterface State {\n isPiPoint: boolean;\n segments: Array>;\n attributes: Array>;\n summaries: Array>;\n attributeSegment: SelectableValue;\n summarySegment: SelectableValue;\n calculationBasisSegment: SelectableValue;\n noDataReplacementSegment: SelectableValue;\n}\n\ntype Props = QueryEditorProps;\n\nconst REMOVE_LABEL = '-REMOVE-';\n\nconst CustomLabelComponent = (props: any) => {\n if (props.value) {\n return (\n
\n {props.label ?? '--no label--'}\n
\n );\n }\n return (\n \n \n \n );\n};\n\nexport class PIWebAPIQueryEditor extends PureComponent {\n error: any;\n piServer: any[] = [];\n availableAttributes: any = {};\n summaryTypes: string[];\n calculationBasis: string[];\n noDataReplacement: string[];\n state: State = {\n isPiPoint: false,\n segments: [],\n attributes: [],\n summaries: [],\n attributeSegment: {},\n summarySegment: {},\n calculationBasisSegment: {},\n noDataReplacementSegment: {},\n };\n\n constructor(props: any) {\n super(props);\n this.onSegmentChange = this.onSegmentChange.bind(this);\n this.calcBasisValueChanged = this.calcBasisValueChanged.bind(this);\n this.calcNoDataValueChanged = this.calcNoDataValueChanged.bind(this);\n this.onSummaryAction = this.onSummaryAction.bind(this);\n this.onSummaryValueChanged = this.onSummaryValueChanged.bind(this);\n this.onAttributeAction = this.onAttributeAction.bind(this);\n this.onAttributeChange = this.onAttributeChange.bind(this);\n\n this.summaryTypes = [\n // 'None', // A summary type is not specified.\n 'Total', // A totalization over the time range.\n 'Average', // The average value over the time range.\n 'Minimum', // The minimum value over the time range.\n 'Maximum', // The maximum value over the time range.\n 'Range', // The range value over the time range (minimum-maximum).\n 'StdDev', // The standard deviation over the time range.\n 'PopulationStdDev', // The population standard deviation over the time range.\n 'Count', // The sum of event count over the time range when calculation basis is event weighted. The sum of event time duration over the time range when calculation basis is time weighted.\n 'PercentGood', // Percent of data with good value during the calculation period. For time weighted calculations, the percentage is based on time. For event weighted calculations, the percent is based on event count.\n 'All', // A convenience for requesting all available summary calculations.\n 'AllForNonNumeric', // A convenience for requesting all available summary calculations for non-numeric data.\n ];\n\n this.calculationBasis = [\n 'TimeWeighted', // Weight the values in the calculation by the time over which they apply. Interpolation is based on whether the attribute is stepped. Interpolated events are generated at the boundaries if necessary.\n 'EventWeighted', // Evaluate values with equal weighting for each event. No interpolation is done. There must be at least one event within the time range to perform a successful calculation. Two events are required for standard deviation. In handling events at the boundary of the calculation, the AFSDK uses following rules:\n 'TimeWeightedContinuous', // Apply weighting as in TimeWeighted, but do all interpolation between values as if they represent continuous data, (standard interpolation) regardless of whether the attribute is stepped.\n 'TimeWeightedDiscrete', // Apply weighting as in TimeWeighted but interpolation between values is performed as if they represent discrete, unrelated values (stair step plot) regardless of the attribute is stepped.\n 'EventWeightedExcludeMostRecentEvent', // The calculation behaves the same as _EventWeighted_, except in the handling of events at the boundary of summary intervals in a multiple intervals calculation. Use this option to prevent events at the intervals boundary from being double count at both intervals. With this option, events at the end time (most recent time) of an interval is not used in that interval.\n 'EventWeightedExcludeEarliestEvent', // Similar to the option _EventWeightedExcludeMostRecentEvent_. Events at the start time(earliest time) of an interval is not used in that interval.\n 'EventWeightedIncludeBothEnds', // Events at both ends of the interval boundaries are included in the event weighted calculation.\n ];\n\n this.noDataReplacement = [\n 'Null', // replace with nulls\n 'Drop', // drop items\n 'Previous', // use previous value if available\n '0', // replace with 0\n 'Keep', // Keep value\n ];\n }\n\n // is selected segment empty\n isValueEmpty(value: PIWebAPISelectableValue | undefined) {\n return !value || !value.value || !value.value.length || value.value === REMOVE_LABEL;\n }\n\n segmentChangeValue = (segments: Array>) => {\n const query = this.props.query;\n this.setState({ segments }, () => this.onChange({ ...query, segments }));\n };\n\n attributeChangeValue = (attributes: Array>) => {\n const query = this.props.query;\n this.setState({ attributes }, () => this.onChange({ ...query, attributes }));\n };\n\n // summary calculation basis change event\n calcBasisValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.basis = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get summary calculation basis user interface segments\n getCalcBasisSegments() {\n const segments = map(this.calculationBasis, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // no data change event\n calcNoDataValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.nodata = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get no data user interface segments\n getNoDataSegments() {\n var segments = map(this.noDataReplacement, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // summary query change event\n onSummaryValueChanged(item: SelectableValue, index: number) {\n const summaries = this.state.summaries.slice(0) as Array>;\n summaries[index] = item;\n if (this.isValueEmpty(item.value)) {\n summaries.splice(index, 1);\n }\n this.setState({ summaries }, this.stateCallback);\n }\n // get the list of summaries available\n getSummarySegments() {\n const ctrl = this;\n const summaryTypes = filter(ctrl.summaryTypes, (type) => {\n return this.state.summaries.map((s) => s.value?.value).indexOf(type) === -1;\n });\n var segments = map(summaryTypes, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n }\n\n // remove a summary from the user interface and the query\n removeSummary(part: SelectableValue) {\n const summaries = filter(this.state.summaries, (item: SelectableValue) => {\n return item !== part;\n });\n this.setState({ summaries });\n }\n // add a new summary to the query\n onSummaryAction(item: SelectableValue) {\n const summaries = this.state.summaries.slice(0) as Array>;\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: true,\n },\n };\n summaries.push(selectableValue);\n }\n this.setState({ summarySegment: {}, summaries }, this.stateCallback);\n }\n\n // remove an attribute from the query\n removeAttribute(part: SelectableValue) {\n const attributes = filter(this.state.attributes, (item: SelectableValue) => {\n return item !== part;\n });\n this.attributeChangeValue(attributes);\n }\n // add an attribute to the query\n onAttributeAction(item: SelectableValue) {\n const { query } = this.props;\n const attributes = this.state.attributes.slice(0);\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: !query.isPiPoint,\n },\n };\n attributes.push(selectableValue);\n }\n this.attributeChangeValue(attributes);\n }\n\n // pi point change event\n onPiPointChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n remove(attributes, (value, n) => n === index);\n } else {\n // set current value\n attributes[index] = item;\n }\n\n this.checkPiPointSegments(item, attributes);\n };\n // attribute change event\n onAttributeChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n // set current value\n attributes[index] = item;\n\n this.checkAttributeSegments(attributes, this.state.segments);\n };\n // segment change\n onSegmentChange = (item: SelectableValue, index: number) => {\n const { query } = this.props;\n let segments = this.state.segments.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n segments = slice(segments, 0, index);\n this.checkAttributeSegments([], segments);\n if (segments.length === 0) {\n segments.push({\n label: '',\n });\n } else if (!!segments[segments.length - 1].value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n if (query.isPiPoint) {\n this.piServer = [];\n }\n this.segmentChangeValue(segments);\n return;\n }\n\n // set current value\n segments[index] = item;\n\n // Accept only one PI server\n if (query.isPiPoint) {\n this.piServer.push(item);\n this.segmentChangeValue(segments);\n return;\n }\n\n // changed internal selection\n if (index < segments.length - 1) {\n segments = slice(segments, 0, index + 1);\n }\n this.checkAttributeSegments([], segments);\n // add new options\n if (!!item.value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n this.segmentChangeValue(segments);\n };\n\n // get a ui segment for the attributes\n getElementSegments = (\n index: number,\n currentSegment?: Array>\n ): Promise>> => {\n const { datasource, query, data } = this.props;\n var ctrl = this;\n var findQuery = query.isPiPoint\n ? { type: 'dataserver' }\n : { path: this.getSegmentPathUpTo(currentSegment ?? this.state.segments.slice(0), index) };\n\n if (!query.isPiPoint) {\n if (datasource.afserver?.name && index === 0) {\n return Promise.resolve([\n {\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n },\n ]);\n }\n if (datasource.afserver?.name && datasource.afdatabase?.name && index === 1) {\n return Promise.resolve([\n {\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n },\n ]);\n }\n\n // if (!findQuery.path?.length) {\n // return Promise.resolve([]);\n // }\n }\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n var altSegments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n label: item.text,\n value: {\n webId: item.WebId,\n value: item.text,\n expandable: !query.isPiPoint && item.expandable,\n },\n };\n return selectableValue;\n });\n\n if (altSegments.length === 0) {\n return altSegments;\n }\n\n // add template variables\n const variables = datasource.templateSrv.getVariables();\n each(variables, (variable: VariableModel) => {\n let selectableValue: SelectableValue = {\n label: '${' + variable.name + '}',\n value: {\n type: 'template',\n value: '${' + variable.name + '}',\n expandable: !query.isPiPoint,\n },\n };\n altSegments.unshift(selectableValue);\n });\n\n altSegments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return altSegments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return [];\n });\n };\n\n // get the list of attributes for the user interface - PI\n getAttributeSegmentsPI = (attributeText?: string): Promise>> => {\n const { datasource, query, data } = this.props;\n const ctrl = this;\n const findQuery = {\n path: '',\n webId: this.getSelectedPIServer(),\n pointName: (attributeText ?? '') + '*',\n type: 'pipoint',\n };\n let segments: Array> = [];\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n segments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n path: item.Path,\n label: item.text,\n value: {\n value: item.text,\n expandable: false,\n },\n };\n return selectableValue;\n });\n segments.unshift({\n label: attributeText,\n value: {\n value: attributeText,\n expandable: false,\n },\n });\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n return segments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return segments;\n });\n };\n\n // get the list of attributes for the user interface - AF\n getAttributeSegmentsAF = (attributeText?: string): Array> => {\n const ctrl = this;\n let segments: Array> = [];\n\n forOwn(ctrl.availableAttributes, (val: any, key: string) => {\n let selectableValue: SelectableValue = {\n label: key,\n value: {\n value: key,\n expandable: true,\n },\n };\n segments.push(selectableValue);\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n };\n\n // build data from target string\n buildFromTarget = (\n query: PIWebAPIQuery,\n segmentsArray: Array>,\n attributesArray: Array>\n ) => {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segmentsArray.push({\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n });\n });\n each(splitAttributes, (item, _) => {\n if (item !== '') {\n // set current value\n attributesArray.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n return this.getElementSegments(splitElements.length + 1, segmentsArray).then((elements) => {\n if (elements.length > 0) {\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n return segmentsArray;\n });\n }\n return Promise.resolve(segmentsArray);\n };\n\n /**\n * Gets the segment information and parses it to a string.\n *\n * @param {any} index - Last index of segment to use.\n * @returns - AF Path or PI Point name.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSegmentPathUpTo(segments: Array>, index: number): string {\n var arr = segments.slice(0, index);\n\n return reduce(\n arr,\n (result: any, segment: SelectableValue) => {\n if (!segment.value) {\n return '';\n }\n if (!segment.value.value?.startsWith('-Select')) {\n return result ? result + '\\\\' + segment.value.value : segment.value.value;\n }\n return result;\n },\n ''\n );\n }\n\n /**\n * Get the current AF Element's child attributes. Validates when the element selection changes.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAttributeSegments(\n attributes: Array>,\n segments: Array>\n ): Promise {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: this.getSegmentPathUpTo(segments.slice(0), segments.length),\n type: 'attributes',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: false }))\n .then((attributesResponse: any) => {\n var validAttributes: any = {};\n\n each(attributesResponse, (attribute: any) => {\n validAttributes[attribute.Path.substring(attribute.Path.indexOf('|') + 1)] = attribute.WebId;\n });\n\n var filteredAttributes = filter(attributes, (attrib: SelectableValue) => {\n const changedValue = datasource.templateSrv.replace(attrib.value?.value);\n return validAttributes[changedValue] !== undefined;\n });\n\n ctrl.availableAttributes = validAttributes;\n this.attributeChangeValue(filteredAttributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n this.attributeChangeValue(attributes);\n });\n }\n\n /**\n * Get PI points from server.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkPiPointSegments(\n attribute: SelectableValue,\n attributes: Array>\n ) {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: attribute.path,\n webId: ctrl.getSelectedPIServer(),\n pointName: attribute.label,\n type: 'pipoint',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: true }))\n .then(() => {\n ctrl.attributeChangeValue(attributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n ctrl.attributeChangeValue([]);\n });\n }\n\n /**\n * Gets the webid of the current selected pi data server.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSelectedPIServer() {\n var webID = '';\n\n this.piServer.forEach((s) => {\n var parts = this.props.query.target.split(';');\n if (parts.length >= 2) {\n if (parts[0] === s.text) {\n webID = s.WebId;\n return;\n }\n }\n });\n return this.piServer.length > 0 ? this.piServer[0].value?.webId : webID;\n }\n\n /**\n * Queries PI Web API for child elements and attributes when the raw query text editor is changed.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n textEditorChanged() {\n const { query, onChange } = this.props;\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n let segments: Array> = [];\n let attributes: Array> = [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segments.push({\n label: item,\n value: {\n type: item.match(/\\${\\w+}/gi) ? 'template' : undefined,\n value: item,\n expandable: true,\n },\n });\n });\n this.getElementSegments(splitElements.length + 1, segments).then((elements) => {\n if (elements.length > 0) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n });\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n this.updateArray(segments, attributes, this.state.summaries, query.isPiPoint, () => {\n onChange({ ...query, query: undefined, rawQuery: false });\n });\n } else {\n segments = this.checkAfServer();\n this.updateArray(segments, this.state.attributes, this.state.summaries, query.isPiPoint, () => {\n this.onChange({\n ...query,\n query: undefined,\n rawQuery: false,\n attributes: this.state.attributes,\n segments: this.state.segments,\n });\n });\n }\n }\n\n /**\n * Check if the AF server and database are configured in the datasoure config.\n *\n * @returns the segments array\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAfServer = () => {\n const { datasource } = this.props;\n const segmentsArray = [];\n if (datasource.afserver?.name) {\n segmentsArray.push({\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n });\n if (datasource.afdatabase?.name) {\n segmentsArray.push({\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n });\n }\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n } else {\n segmentsArray.push({\n label: '',\n });\n }\n return segmentsArray;\n };\n\n /**\n * Update the internal state of the datasource.\n *\n * @param segmentsArray the segments array to update\n * @param attributesArray the AF attributes array to update\n * @param summariesArray the summaries array to update\n * @param isPiPoint the is PI point flag\n * @param cb optional callback function\n *\n * @memberOf PIWebAPIQueryEditor\n */\n updateArray = (\n segmentsArray: Array>,\n attributesArray: Array>,\n summariesArray: Array>,\n isPiPoint: boolean,\n cb?: (() => void) | undefined\n ) => {\n this.setState(\n {\n segments: segmentsArray,\n attributes: attributesArray,\n summaries: summariesArray,\n isPiPoint,\n },\n () =>\n this.checkAttributeSegments(attributesArray, this.state.segments).then(() => {\n if (cb) {\n cb();\n }\n })\n );\n };\n\n // React action when component is initialized/updated\n scopedVarsDone = false;\n componentDidMount = () => {\n this.initialLoad(false);\n };\n componentDidUpdate = () => {\n if (this.props.data?.state === 'Done' && !!this.props.data?.request?.scopedVars && !this.scopedVarsDone) {\n this.scopedVarsDone = true;\n this.initialLoad(true);\n }\n };\n initialLoad = (force: boolean) => {\n const { query } = this.props;\n const metricsQuery = defaults(query, defaultQuery) as PIWebAPIQuery;\n const { segments, attributes, summary, isPiPoint } = metricsQuery;\n\n let segmentsArray: Array> = force ? [] : segments?.slice(0) ?? [];\n let attributesArray: Array> = force ? [] : attributes?.slice(0) ?? [];\n let summariesArray = summary?.types ?? [];\n\n if (!isPiPoint && segmentsArray.length === 0) {\n if (query.target && query.target.length > 0 && query.target !== ';') {\n attributesArray = [];\n // Build query from target\n this.buildFromTarget(query, segmentsArray, attributesArray)\n .then((_segmentsArray) => {\n this.updateArray(_segmentsArray, attributesArray, summariesArray, isPiPoint);\n })\n .catch((e) => console.error(e));\n return;\n } else {\n segmentsArray = this.checkAfServer();\n }\n } else if (isPiPoint && segmentsArray.length > 0) {\n this.piServer = segmentsArray;\n }\n this.updateArray(segmentsArray, attributesArray, summariesArray, isPiPoint, () => {\n this.onChange(query);\n });\n };\n\n onChange = (query: PIWebAPIQuery) => {\n const { onChange, onRunQuery } = this.props;\n\n query.summary.types = this.state.summaries;\n if (query.rawQuery) {\n query.target = query.query ?? '';\n\n if (query.target !== '') {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes[0].split('\\\\');\n\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n query.attributes = [];\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n query.elementPath = splitElements.join('\\\\');\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n query.attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n }\n }\n } else {\n query.elementPath = this.getSegmentPathUpTo(this.state.segments, this.state.segments.length);\n query.target =\n query.elementPath +\n ';' +\n join(\n query.attributes.map((s) => s.value?.value),\n ';'\n );\n }\n\n onChange(query);\n\n if (query.target && query.target.length > 0 && query.attributes.length > 0) {\n onRunQuery();\n }\n };\n\n stateCallback = () => {\n const query = this.props.query as PIWebAPIQuery;\n this.onChange(query);\n };\n\n onIsPiPointChange = (event: React.SyntheticEvent) => {\n const { query: queryChange } = this.props;\n const isPiPoint = !queryChange.isPiPoint;\n this.setState(\n {\n segments: isPiPoint ? [{ label: '' }] : this.checkAfServer(),\n attributes: [],\n isPiPoint,\n },\n () => {\n this.onChange({\n ...queryChange,\n expression: '',\n attributes: this.state.attributes,\n segments: this.state.segments,\n isPiPoint,\n });\n }\n );\n };\n\n render() {\n const { query: queryProps, onChange, onRunQuery } = this.props;\n const metricsQuery = defaults(queryProps, defaultQuery) as PIWebAPIQuery;\n const {\n interpolate,\n query,\n rawQuery,\n digitalStates,\n recordedValues,\n expression,\n isPiPoint,\n summary,\n display,\n regex,\n } = metricsQuery;\n\n return (\n <>\n \n \n \n\n {!!rawQuery && (\n \n \n ) =>\n onChange({ ...metricsQuery, query: event.target.value })\n }\n placeholder=\"enter query\"\n />\n \n this.textEditorChanged()} />\n \n )}\n\n {!rawQuery && (\n <>\n
\n \n {this.state.segments.map((segment: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSegmentChange(item, index)}\n loadOptions={(query?: string | undefined) => {\n return this.getElementSegments(index);\n }}\n allowCustomValue\n inputMinWidth={MIN_ELEM_INPUT_WIDTH}\n />\n );\n })}\n \n {!isPiPoint && (\n {\n onChange({ ...metricsQuery, query: metricsQuery.target, rawQuery: value });\n }}\n />\n )}\n \n
\n\n \n {this.state.attributes.map((attribute: SelectableValue, index: number) => {\n if (isPiPoint) {\n return (\n }\n disabled={this.piServer.length === 0}\n onChange={(item) => this.onPiPointChange(item, index)}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n }\n return (\n }\n disabled={this.state.segments.length <= 2}\n onChange={(item) => this.onAttributeChange(item, index)}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n })}\n\n {isPiPoint && (\n \n }\n disabled={this.piServer.length === 0}\n onChange={this.onAttributeAction}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n {!isPiPoint && (\n \n }\n disabled={this.state.segments.length <= 2}\n onChange={this.onAttributeAction}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n \n \n )}\n\n {!isPiPoint && (\n \n ) =>\n this.onChange({ ...metricsQuery, expression: event.target.value })\n }\n placeholder=\"'.'*2\"\n />\n \n )}\n\n \n \n ) =>\n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, maxNumber: parseInt(event.target.value, 10) },\n })\n }\n type=\"number\"\n placeholder=\"1000\"\n />\n \n \n \n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, enable: !recordedValues.enable },\n })\n }\n />\n \n \n \n this.onChange({ ...metricsQuery, digitalStates: { ...digitalStates, enable: !digitalStates.enable } })\n }\n />\n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n \n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, enable: !interpolate.enable } })\n }\n />\n \n \n }\n onChange={this.calcNoDataValueChanged}\n options={this.getNoDataSegments()}\n allowCustomValue\n />\n \n \n\n \n \n ) =>\n onChange({ ...metricsQuery, summary: { ...summary, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n }\n onChange={this.calcBasisValueChanged}\n options={this.getCalcBasisSegments()}\n allowCustomValue\n />\n \n \n \n {this.state.summaries.map((s: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSummaryValueChanged(item, index)}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n );\n })}\n \n }\n onChange={this.onSummaryAction}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n \n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, display: event.target.value })\n }\n placeholder=\"Display\"\n />\n \n \n {\n this.onChange({ ...metricsQuery, regex: { ...regex, enable: !regex.enable } });\n }}\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, search: event.target.value } })\n }\n placeholder=\"(.*)\"\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, replace: event.target.value } })\n }\n placeholder=\"$1\"\n />\n \n \n \n );\n }\n}\n","import { curry, each, filter, flatten, forOwn, groupBy, keys, map, uniq } from 'lodash';\n\nimport {\n DataQueryRequest,\n DataQueryResponse,\n DataSourceApi,\n DataSourceInstanceSettings,\n AnnotationEvent,\n toDataFrame,\n MetricFindValue,\n} from '@grafana/data';\nimport { BackendSrv, getBackendSrv, getTemplateSrv, TemplateSrv } from '@grafana/runtime';\n\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\ninterface PiwebapiElementPath {\n path: string;\n variable: string;\n}\n\ninterface PiwebapiInternalRsp {\n data: PiwebapiRsp;\n status: number;\n url: string;\n}\n\ninterface PiwebapTargetRsp {\n refId: string;\n target: string;\n datapoints: any[];\n}\n\ninterface PiwebapiRsp {\n Name?: string;\n InstanceType?: string;\n Items?: PiwebapiRsp[];\n WebId?: string;\n HasChildren?: boolean;\n Path?: string;\n}\n\ninterface PiDataServer {\n name: string | undefined;\n webid: string | undefined;\n}\n\nexport class PiWebAPIDatasource extends DataSourceApi {\n piserver: PiDataServer;\n afserver: PiDataServer;\n afdatabase: PiDataServer;\n\n basicAuth?: string;\n withCredentials?: boolean;\n url: string;\n name: string;\n isProxy = false;\n\n templateSrv: TemplateSrv;\n backendSrv: BackendSrv;\n\n piwebapiurl?: string;\n webidCache: Map = new Map();\n\n error: any;\n\n constructor(instanceSettings: DataSourceInstanceSettings) {\n super(instanceSettings);\n this.basicAuth = instanceSettings.basicAuth;\n this.withCredentials = instanceSettings.withCredentials;\n this.url = instanceSettings.url!;\n this.name = instanceSettings.name;\n this.templateSrv = getTemplateSrv();\n this.backendSrv = getBackendSrv();\n\n this.piwebapiurl = instanceSettings.jsonData.url?.toString();\n this.isProxy = /^http(s)?:\\/\\//.test(this.url) || instanceSettings.jsonData.access === 'proxy';\n\n this.piserver = { name: (instanceSettings.jsonData || {}).piserver, webid: undefined };\n this.afserver = { name: (instanceSettings.jsonData || {}).afserver, webid: undefined };\n this.afdatabase = { name: (instanceSettings.jsonData || {}).afdatabase, webid: undefined };\n\n Promise.all([\n this.getAssetServer(this.afserver.name).then((result: PiwebapiRsp) => (this.afserver.webid = result.WebId)),\n this.getDataServer(this.piserver.name).then((result: PiwebapiRsp) => (this.piserver.webid = result.WebId)),\n this.getDatabase(this.afserver.name ? this.afserver.name + '\\\\' + this.afdatabase.name : undefined).then(\n (result: PiwebapiRsp) => (this.afdatabase.webid = result.WebId)\n ),\n ]);\n }\n\n /**\n * Converts a PIWebAPI Event Frame response to a Grafana Annotation\n *\n * @param {any} annotationOptions - Options data from configuration panel.\n * @param {any} endTime - End time of the Event Frame.\n * @param {any} eventFrame - The Event Frame data.\n * @returns - Grafana Annotation\n *\n * @memberOf PiWebApiDatasource\n */\n private eventFrameToAnnotation(\n annotationOptions: any,\n endTime: any,\n eventFrame: any,\n attributeDataItems: any\n ): AnnotationEvent {\n if (annotationOptions.regex && annotationOptions.regex.enable) {\n eventFrame.Name = eventFrame.Name.replace(\n new RegExp(annotationOptions.regex.search),\n annotationOptions.regex.replace\n );\n }\n\n var attributeText = '';\n if (attributeDataItems) {\n each(attributeDataItems, (attributeData: any) => {\n const attributeValue = attributeData.Value.Value\n ? attributeData.Value.Value.Name || attributeData.Value.Value.Value || attributeData.Value.Value\n : null;\n attributeText += '
' + attributeData.Name + ': ' + attributeValue;\n });\n }\n return {\n annotation: annotationOptions,\n title: (endTime ? 'END ' : annotationOptions.showEndTime ? 'START ' : '') + annotationOptions.name,\n time: new Date(endTime ? eventFrame.EndTime : eventFrame.StartTime).getTime(),\n text:\n eventFrame.Name + attributeText + '
Start: ' + eventFrame.StartTime + '
End: ' + eventFrame.EndTime,\n };\n }\n\n /**\n * Builds the PIWebAPI query parameters.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - PIWebAPI query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private buildQueryParameters(options: DataQueryRequest) {\n options.targets = filter(options.targets, (target) => {\n if (!target || !target.target) {\n return false;\n }\n return !target.target.startsWith('Select AF');\n });\n\n options.targets = map(options.targets, (target) => {\n const ds = this;\n var tar = {\n target: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPath: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPathArray: [\n {\n path: this.templateSrv.replace(target.elementPath, options.scopedVars),\n variable: '',\n } as PiwebapiElementPath,\n ],\n attributes: map(target.attributes, (att) =>\n this.templateSrv.replace(att.value?.value || att, options.scopedVars)\n ),\n segments: map(target.segments, (att) => this.templateSrv.replace(att.value?.value, options.scopedVars)),\n display: target.display,\n refId: target.refId,\n hide: target.hide,\n interpolate: target.interpolate || { enable: false },\n recordedValues: target.recordedValues || { enable: false },\n digitalStates: target.digitalStates || { enable: false },\n webid: target.webid,\n webids: target.webids || [],\n regex: target.regex || { enable: false },\n expression: target.expression || '',\n summary: target.summary || { types: [] },\n startTime: options.range.from,\n endTime: options.range.to,\n isPiPoint: target.isPiPoint,\n scopedVars: options.scopedVars,\n };\n\n if (tar.expression) {\n tar.expression = this.templateSrv.replace(tar.expression, options.scopedVars);\n }\n\n if (tar.summary.types !== undefined) {\n tar.summary.types = filter(tar.summary.types, (item) => {\n return item !== undefined && item !== null && item !== '';\n });\n }\n\n // explode All or Multi-selection\n const varsKeys = keys(options.scopedVars);\n this.templateSrv.getVariables().forEach((v: any) => {\n if (ds.isAllSelected(v.current) && varsKeys.indexOf(v.name) < 0) {\n // All selection\n const variables = v.options.filter((o: any) => !o.selected);\n // attributes\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) =>\n !!v.allValue ? attr.replace(v.allValue, vv.value) : attr.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value)\n )\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, v.allValue);\n } else if (Array.isArray(v.current.text) && varsKeys.indexOf(v.name) < 0) {\n // Multi-selection\n const variables = v.options.filter((o: any) => o.selected);\n // attributes\n const query = v.current.value.join(',');\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) => attr.replace(`{${query}}`, vv.value))\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, `{${query}}`);\n }\n });\n\n return tar;\n });\n\n return options;\n }\n\n /**\n * Datasource Implementation. Primary entry point for data source.\n * This takes the panel configuration and queries, sends them to PI Web API and parses the response.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - Promise of data in the format for Grafana panels.\n *\n * @memberOf PiWebApiDatasource\n */\n async query(options: DataQueryRequest): Promise {\n var ds = this;\n var query = this.buildQueryParameters(options);\n query.targets = filter(query.targets, (t) => !t.hide);\n\n if (query.targets.length <= 0) {\n return Promise.resolve({ data: [] });\n } else {\n return Promise.all(ds.getStream(query)).then((targetResponses) => {\n let flattened: PiwebapTargetRsp[] = [];\n each(targetResponses, (tr) => {\n each(tr, (item) => flattened.push(item));\n });\n const response: DataQueryResponse = {\n data: flattened\n .sort((a, b) => {\n return +(a.target > b.target) || +(a.target === b.target) - 1;\n })\n .map((d) => toDataFrame(d)),\n };\n return response;\n });\n }\n }\n\n /**\n * Datasource Implementation.\n * Used for testing datasource in datasource configuration pange\n *\n * @returns - Success or failure message.\n *\n * @memberOf PiWebApiDatasource\n */\n testDatasource(): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + '/',\n method: 'GET',\n })\n .then((response: any) => {\n if (response.status === 200) {\n return { status: 'success', message: 'Data source is working', title: 'Success' };\n }\n throw new Error('Failed');\n });\n }\n\n /**\n * Datasource Implementation.\n * This queries PI Web API for Event Frames and converts them into annotations.\n *\n * @param {any} options - Annotation options, usually the Event Frame Category.\n * @returns - A Grafana annotation.\n *\n * @memberOf PiWebApiDatasource\n */\n annotationQuery(options: any): Promise {\n if (!this.afdatabase.webid) {\n return Promise.resolve([]);\n }\n\n var categoryName = options.annotation.query.categoryName\n ? this.templateSrv.replace(options.annotation.query.categoryName, options.scopedVars, 'glob')\n : null;\n var nameFilter = options.annotation.query.nameFilter\n ? this.templateSrv.replace(options.annotation.query.nameFilter, options.scopedVars, 'glob')\n : null;\n var templateName = options.annotation.template ? options.annotation.template.Name : null;\n var annotationOptions = {\n name: options.annotation.name,\n datasource: options.annotation.datasource,\n enable: options.annotation.enable,\n iconColor: options.annotation.iconColor,\n showEndTime: options.annotation.showEndTime,\n regex: options.annotation.regex,\n attribute: options.annotation.attribute,\n categoryName: categoryName,\n templateName: templateName,\n nameFilter: nameFilter,\n };\n\n var filter = [];\n if (!!annotationOptions.categoryName) {\n filter.push('categoryName=' + annotationOptions.categoryName);\n }\n if (!!annotationOptions.nameFilter) {\n filter.push('nameFilter=' + annotationOptions.nameFilter);\n }\n if (!!annotationOptions.templateName) {\n filter.push('templateName=' + annotationOptions.templateName);\n }\n if (!filter.length) {\n return Promise.resolve([]);\n }\n filter.push('startTime=' + options.range.from.toJSON());\n filter.push('endTime=' + options.range.to.toJSON());\n\n if (annotationOptions.attribute && annotationOptions.attribute.enable) {\n var resourceUrl =\n this.piwebapiurl + '/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n if (!!annotationOptions.attribute.name) {\n resourceUrl =\n this.piwebapiurl +\n '/streamsets/{0}/value?nameFilter=' +\n annotationOptions.attribute.name +\n '&selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n }\n var query: any = {};\n query['1'] = {\n Method: 'GET',\n Resource: this.piwebapiurl + '/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&'),\n };\n query['2'] = {\n Method: 'GET',\n RequestTemplate: {\n Resource: resourceUrl,\n },\n Parameters: ['$.1.Content.Items[*].WebId'],\n ParentIds: ['1'],\n };\n return this.restBatch(query).then((result: any) => {\n const data = result.data['1'].Content;\n const valueData = result.data['2'].Content;\n\n var annotations = map(data.Items, (item: any, index: any) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n false,\n item,\n valueData.Items[index].Content.Items\n );\n });\n\n if (options.annotation.showEndTime) {\n var ends = map(data.Items, (item: any, index: number) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n true,\n item,\n valueData.Items[index].Content.Items\n );\n });\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n\n return annotations;\n });\n } else {\n return this.restGet('/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&')).then(\n (result) => {\n var annotations = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, false));\n if (options.annotation.showEndTime) {\n var ends = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, true));\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n return annotations;\n }\n );\n }\n }\n\n /**\n * Builds the Grafana metric segment for use on the query user interface.\n *\n * @param {any} response - response from PI Web API.\n * @returns - Grafana metric segment.\n *\n * @memberOf PiWebApiDatasource\n */\n private metricQueryTransform(response: PiwebapiRsp[]): MetricFindValue[] {\n return map(response, (item) => {\n return {\n text: item.Name,\n expandable:\n item.HasChildren === undefined || item.HasChildren === true || (item.Path ?? '').split('\\\\').length <= 3,\n HasChildren: item.HasChildren,\n Items: item.Items ?? [],\n Path: item.Path,\n WebId: item.WebId,\n } as MetricFindValue;\n });\n }\n\n /**\n * This method does the discovery of the AF Hierarchy and populates the query user interface segments.\n *\n * @param {any} query - Parses the query configuration and builds a PI Web API query.\n * @returns - Segment information.\n *\n * @memberOf PiWebApiDatasource\n */\n metricFindQuery(query: any, queryOptions: any): Promise {\n var ds = this;\n var querydepth = ['servers', 'databases', 'databaseElements', 'elements'];\n if (typeof query === 'string') {\n query = JSON.parse(query as string);\n }\n if (queryOptions.isPiPoint) {\n query.path = this.templateSrv.replace(query.path, queryOptions);\n } else {\n if (query.path === '') {\n query.type = querydepth[0];\n } else if (query.type !== 'attributes') {\n query.type = querydepth[Math.max(0, Math.min(query.path.split('\\\\').length, querydepth.length - 1))];\n }\n query.path = this.templateSrv.replace(query.path, queryOptions);\n query.path = query.path.replace(/\\{([^\\\\])*\\}/gi, (r: string) => r.substring(1, r.length - 2).split(',')[0]);\n }\n\n query.filter = query.filter ?? '*';\n\n if (query.type === 'servers') {\n return ds.afserver?.name\n ? ds\n .getAssetServer(ds.afserver.name)\n .then((result: PiwebapiRsp) => [result])\n .then(ds.metricQueryTransform)\n : ds.getAssetServers().then(ds.metricQueryTransform);\n } else if (query.type === 'databases') {\n return ds\n .getAssetServer(query.path)\n .then((server) => ds.getDatabases(server.WebId ?? '', {}))\n .then(ds.metricQueryTransform);\n } else if (query.type === 'databaseElements') {\n return ds\n .getDatabase(query.path)\n .then((db) =>\n ds.getDatabaseElements(db.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'elements') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getElements(element.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'attributes') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getAttributes(element.WebId ?? '', {\n searchFullHierarchy: 'true',\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Path',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'dataserver') {\n return ds.getDataServers().then(ds.metricQueryTransform);\n } else if (query.type === 'pipoint') {\n return ds.piPointSearch(query.webId, query.pointName).then(ds.metricQueryTransform);\n }\n return Promise.reject('Bad type');\n }\n\n /**\n * Gets the url of summary data from the query configuration.\n *\n * @param {any} summary - Query summary configuration.\n * @returns - URL append string.\n *\n * @memberOf PiWebApiDatasource\n */\n getSummaryUrl(summary: any) {\n if (summary.interval.trim() === '') {\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis\n );\n }\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis +\n '&summaryDuration=' +\n summary.interval.trim()\n );\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} value - A list of PIWebAPI values.\n * @param {any} target - The target Grafana metric.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @returns - An array of Grafana value, timestamp pairs.\n *\n */\n parsePiPointValueList(value: any[], target: any, isSummary: boolean) {\n var api = this;\n var datapoints: any[] = [];\n each(value, (item) => {\n // @ts-ignore\n var { grafanaDataPoint, previousValue, drop } = this.noDataReplace(\n isSummary ? item.Value : item,\n target.summary.nodata,\n api.parsePiPointValue(isSummary ? item.Value : item, target, isSummary)\n );\n if (!drop) {\n datapoints.push(grafanaDataPoint);\n }\n });\n return datapoints;\n }\n\n /**\n * Convert a PI Point value to use Grafana value/timestamp.\n *\n * @param {any} value - PI Point value.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @param {any} target - The target grafana metric.\n * @returns - Grafana value pair.\n *\n */\n parsePiPointValue(value: any, target: any, isSummary: boolean) {\n let num = !isSummary && typeof value.Value === 'object' ? value.Value?.Value : value.Value;\n\n if (!value.Good || !!target.digitalStates?.enable) {\n num = (!isSummary && typeof value.Value === 'object' ? value.Value?.Name : value.Name) ?? '';\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} item - 'Item' object from PIWebAPI\n * @param {any} noDataReplacementMode - String state of how to replace 'No Data'\n * @param {any} grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns perviousValue - {any} Grafana value (value only).\n *\n */\n noDataReplace(\n item: any,\n noDataReplacementMode: any,\n grafanaDataPoint: any[]\n ): {\n grafanaDataPoint: any[];\n previousValue: any;\n drop: boolean;\n } {\n var previousValue = null;\n var drop = false;\n if (!item.Good || item.Value === 'No Data' || (item.Value?.Name && item.Value?.Name === 'No Data')) {\n if (noDataReplacementMode === 'Drop') {\n drop = true;\n } else if (noDataReplacementMode === '0') {\n grafanaDataPoint[0] = 0;\n } else if (noDataReplacementMode === 'Keep') {\n // Do nothing keep\n } else if (noDataReplacementMode === 'Null') {\n grafanaDataPoint[0] = null;\n } else if (noDataReplacementMode === 'Previous' && previousValue !== null) {\n grafanaDataPoint[0] = previousValue;\n }\n } else {\n previousValue = item.Value;\n }\n return { grafanaDataPoint, previousValue, drop };\n }\n\n /**\n * Process the response from PI Web API for a single item.\n *\n * @param {any} content - Web response data.\n * @param {any} target - The target grafana metric.\n * @param {any} name - The target metric name.\n * @returns - Parsed metric in target/datapoint json format.\n *\n * @memberOf PiWebApiDatasource\n */\n processResults(content: any, target: any, name: any, noTemplate: boolean): PiwebapTargetRsp[] {\n const api = this;\n const isSummary: boolean = target.summary && target.summary.types && target.summary.types.length > 0;\n name = noTemplate ? name : this.getPath(target.elementPathArray, content.Path) + '|' + name;\n if (target.regex && target.regex.enable && target.regex.search.length && target.regex.replace.length) {\n name = name.replace(new RegExp(target.regex.search), target.regex.replace);\n }\n if (isSummary) {\n var innerResults: any[] = [];\n var groups = groupBy(content.Items, (item: any) => item.Type);\n forOwn(groups, (value, key) => {\n innerResults.push({\n refId: target.refId,\n target: name + '[' + key + ']',\n datapoints: api.parsePiPointValueList(value, target, isSummary),\n });\n });\n return innerResults;\n }\n return [\n {\n refId: target.refId,\n target: name,\n datapoints: api.parsePiPointValueList(content.Items, target, isSummary),\n },\n ];\n }\n\n /** PRIVATE SECTION */\n\n /**\n * Check if all items are selected.\n *\n * @param {any} current the current variable selection\n * @return {boolean} true if all value is selected, false otherwise\n */\n private isAllSelected(current: any): boolean {\n if (!current) {\n return false;\n }\n if (Array.isArray(current.text)) {\n return current.text.indexOf('All') >= 0;\n }\n return current.text === 'All';\n }\n\n /**\n * Check if the value is a number.\n *\n * @param {any} number the value to check\n * @returns {boolean} true if the value is a number, false otherwise\n */\n private checkNumber(number: any): boolean {\n return typeof number === 'number' && !Number.isNaN(number) && Number.isFinite(number);\n }\n\n /**\n * Returns a new element path list based on the panel variables.\n *\n * @param {string} elementPathArray array of element paths\n * @param {string} variables the list of variable values\n * @param {string} allValue the all value value for the variable\n * @returns {PiwebapiElementPath[]} new element path list\n */\n private getElementPath(\n elementPathArray: PiwebapiElementPath[],\n variables: any[],\n allValue: string\n ): PiwebapiElementPath[] {\n // elementPath\n let newElementPathArray: PiwebapiElementPath[] = [];\n elementPathArray.forEach((elem: PiwebapiElementPath) => {\n if ((!!allValue && elem.path.indexOf(allValue) >= 0) || (!allValue && elem.path.match(/{[a-zA-z0-9,-_]+}/gi))) {\n const temp: PiwebapiElementPath[] = variables.map((vv: any) => {\n return {\n path: !!allValue\n ? elem.path.replace(allValue, vv.value)\n : elem.path.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value),\n variable: vv.value,\n } as PiwebapiElementPath;\n });\n newElementPathArray = newElementPathArray.concat(temp);\n }\n });\n if (newElementPathArray.length) {\n return uniq(flatten(newElementPathArray));\n }\n return elementPathArray;\n }\n\n /**\n * Returns the last item of the element path.\n *\n * @param {string} path element path\n * @returns {string} last item of the element path\n */\n private getPath(elementPathArray: PiwebapiElementPath[], path: string): string {\n let splitPath = path.split('|');\n if (splitPath.length === 0) {\n return '';\n }\n if (elementPathArray.length === 0) {\n return '';\n }\n splitPath = splitPath[0].split('\\\\');\n const splitStr = splitPath.length === 0 ? '' : splitPath.pop() ?? '';\n const foundElement = elementPathArray.find((e) => path.indexOf(e.path) >= 0)?.variable;\n return foundElement ? foundElement + '|' + splitStr : splitStr;\n }\n\n /**\n * Gets historical data from a PI Web API stream source.\n *\n * @param {any} query - Grafana query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private getStream(query: any): Array> {\n const ds = this;\n var results: Array> = [];\n\n each(query.targets, (target) => {\n target.attributes = filter(target.attributes || [], (attribute) => {\n return 1 && attribute;\n });\n var url = '';\n var isSummary = target.summary && target.summary.types && target.summary.types.length > 0;\n var isInterpolated = target.interpolate && target.interpolate.enable;\n // perhaps add a check to see if interpolate override time < query.interval\n var intervalTime = target.interpolate.interval ? target.interpolate.interval : query.interval;\n var timeRange = '?startTime=' + query.range.from.toJSON() + '&endTime=' + query.range.to.toJSON();\n var targetName = target.expression || target.elementPath;\n var displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n if (target.expression) {\n url += '/calculation';\n if (isSummary) {\n url += '/summary' + timeRange + (isInterpolated ? '&sampleType=Interval&sampleInterval=' + intervalTime : '');\n } else {\n url += '/intervals' + timeRange + '&sampleInterval=' + intervalTime;\n }\n url += '&expression=' + encodeURIComponent(target.expression);\n if (target.attributes.length > 0) {\n results.push(ds.internalStream(query, target, url));\n } else {\n results.push(\n ds.restGetWebId(target.elementPath, target.isPiPoint).then((webidresponse: any) => {\n return ds\n .restPost(url + webidresponse.WebId)\n .then((response: any) => ds.processResults(response.data, target, displayName || targetName, false))\n .catch((err: any) => (ds.error = err));\n })\n );\n }\n } else {\n url += '/streamsets';\n if (isSummary) {\n url += '/summary' + timeRange + '&intervals=' + query.maxDataPoints + this.getSummaryUrl(target.summary);\n } else if (target.interpolate && target.interpolate.enable) {\n url += '/interpolated' + timeRange + '&interval=' + intervalTime;\n } else if (target.recordedValues && target.recordedValues.enable) {\n const maxNumber =\n target.recordedValues.maxNumber && !isNaN(target.recordedValues.maxNumber)\n ? target.recordedValues.maxNumber\n : 1000;\n url += '/recorded' + timeRange + '&maxCount=' + maxNumber;\n } else {\n url += '/plot' + timeRange + '&intervals=' + query.maxDataPoints;\n }\n\n results.push(ds.internalStream(query, target, url));\n }\n });\n\n return results;\n }\n\n /**\n * Return the data points from the provided Grafana query.\n *\n * @param {any} query - Grafana query.\n * @param {any} target - Grafana query target.\n * @param {string} url - The base URL for the query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private internalStream(query: any, target: any, url: string): Promise {\n const ds = this;\n const targetName = target.expression || target.elementPath;\n const displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n const noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path;\n let promises: Promise;\n\n if (noTemplate) {\n if (target.attributes.length > 1 && !target.isPiPoint) {\n promises = ds\n .restGetWebId(target.elementPath, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n } else {\n promises = Promise.all(\n map(target.attributes, (attribute: string) =>\n ds.restGetWebId(target.elementPath + '|' + attribute, target.isPiPoint)\n )\n );\n }\n } else {\n if (target.attributes.length > 1 && !target.isPiPoint) {\n promises = Promise.all(\n target.elementPathArray.map((elementPath: PiwebapiElementPath) => {\n return ds\n .restGetWebId(elementPath.path, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n })\n );\n } else {\n promises = Promise.all(\n flatten(\n map(target.attributes, (attribute: string) => {\n return target.elementPathArray.map((elementPath: PiwebapiElementPath) =>\n ds.restGetWebId(elementPath.path + '|' + attribute, target.isPiPoint)\n );\n })\n )\n );\n }\n }\n\n return promises.then((webidresponse) => {\n const query: any = {};\n each(flatten(webidresponse), (webid, index) => {\n query[index + 1] = {\n Method: 'GET',\n Resource: ds.piwebapiurl + url + '&webid=' + webid.WebId,\n };\n });\n\n return ds\n .restBatch(query)\n .then((response: any) => {\n const targetResults: any[] = [];\n each(response.data, (value, key) => {\n if (target.expression) {\n const attribute = webidresponse[parseInt(key, 10) - 1].Name;\n each(\n ds.processResults(value.Content, target, displayName || attribute || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n } else {\n each(value.Content.Items, (item) => {\n each(\n ds.processResults(item, target, displayName || item.Name || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n });\n }\n });\n return targetResults;\n })\n .catch((err: any) => (ds.error = err));\n });\n }\n\n /**\n * Abstraction for calling the PI Web API REST endpoint\n *\n * @param {any} path - the path to append to the base server URL.\n * @returns - The full URL.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGet(path: string): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n return response as PiwebapiInternalRsp;\n });\n }\n\n /**\n * Resolve a Grafana query into a PI Web API webid. Uses client side cache when possible to reduce lookups.\n *\n * @param {string} assetPath - The AF Path or the Pi Point Path (\\\\ServerName\\piPointName) to the asset.\n * @param {boolean} isPiPoint - Flag indicating it's a PI Point\n * @returns - URL query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGetWebId(assetPath: string, isPiPoint: boolean): Promise {\n var ds = this;\n\n // check cache\n var cachedWebId = ds.webidCache.get(assetPath);\n if (cachedWebId) {\n return Promise.resolve({ Path: assetPath, WebId: cachedWebId.WebId, Name: cachedWebId.Name });\n }\n\n let path = '';\n if (isPiPoint) {\n path = '/points?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\' + assetPath.replace('|', '\\\\');\n } else {\n // no cache hit, query server\n path =\n (assetPath.indexOf('|') >= 0\n ? '/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\'\n : '/elements?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\') + assetPath;\n }\n\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n ds.webidCache.set(assetPath, response.data);\n return { Path: assetPath, WebId: response.data.WebId, Name: response.data.Name };\n });\n }\n\n /**\n * Execute a batch query on the PI Web API.\n *\n * @param {any} batch - Batch JSON query data.\n * @returns - Batch response.\n *\n * @memberOf PiWebApiDatasource\n */\n private restBatch(batch: any) {\n return this.backendSrv.datasourceRequest({\n url: this.url + '/batch',\n data: batch,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n },\n });\n }\n\n /**\n * Execute a POST on the PI Web API.\n *\n * @param {string} path - The full url of the POST.\n * @returns - POST response data.\n *\n * @memberOf PiWebApiDatasource\n */\n private restPost(path: string) {\n return this.backendSrv.datasourceRequest({\n url: this.url,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n 'X-PIWEBAPI-HTTP-METHOD': 'GET',\n 'X-PIWEBAPI-RESOURCE-ADDRESS': path,\n },\n });\n }\n\n // Get a list of all data (PI) servers\n private getDataServers(): Promise {\n return this.restGet('/dataservers').then((response) => response.data.Items ?? []);\n }\n private getDataServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/dataservers?name=' + name).then((response) => response.data);\n }\n // Get a list of all asset (AF) servers\n private getAssetServers(): Promise {\n return this.restGet('/assetservers').then((response) => response.data.Items ?? []);\n }\n private getAssetServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/assetservers?path=\\\\\\\\' + name).then((response) => response.data);\n }\n private getDatabase(path: string | undefined): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/assetdatabases?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getDatabases(serverId: string, options?: any): Promise {\n if (!serverId) {\n return Promise.resolve([]);\n }\n return this.restGet('/assetservers/' + serverId + '/assetdatabases').then((response) => response.data.Items ?? []);\n }\n getElement(path: string): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/elements?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getEventFrameTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'EventFrame');\n });\n }\n getElementTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'Element');\n });\n }\n\n /**\n * @description\n * Get the child attributes of the current resource.\n * GET attributes/{webId}/attributes\n * @param {string} elementId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.nameFilter - The name query string used for finding attributes. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned attributes must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned attributes must be members of this template. The default is no template filter.\n * @param {string} options.valueType - Specify that returned attributes' value type must be the given value type. The default is no value type filter.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include attributes nested further than the immediate attributes of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {string} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {string} options.showExcluded - Specified if the search should include attributes with the Excluded property set. The default is 'false'.\n * @param {string} options.showHidden - Specified if the search should include attributes with the Hidden property set. The default is 'false'.\n * @param {string} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getAttributes(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/attributes' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET assetdatabases/{webId}/elements\n * @param {string} databaseId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getDatabaseElements(databaseId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/assetdatabases/' + databaseId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET elements/{webId}/elements\n * @param {string} databaseId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getElements(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * Retrieve a list of points on a specified Data Server.\n *\n * @param {string} serverId - The ID of the server. See WebID for more information.\n * @param {string} nameFilter - A query string for filtering by point name. The default is no filter. *, ?, [ab], [!ab]\n */\n private piPointSearch(serverId: string, nameFilter: string): Promise {\n let filter1 = this.templateSrv.replace(nameFilter);\n let filter2 = `${filter1}`;\n let doFilter = false;\n if (filter1 !== nameFilter) {\n const regex = /\\{(\\w|,)+\\}/gs;\n let m;\n while ((m = regex.exec(filter1)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // The result can be accessed through the `m`-variable.\n m.forEach((match, groupIndex) => {\n if (groupIndex === 0) {\n filter1 = filter1.replace(match, match.replace('{', '(').replace('}', ')').replace(',', '|'));\n filter2 = filter2.replace(match, '*');\n doFilter = true;\n }\n });\n }\n }\n return this.restGet('/dataservers/' + serverId + '/points?maxCount=20&nameFilter=' + filter2).then((results) => {\n if (!!results && !!results.data?.Items) {\n return doFilter ? results.data.Items.filter((item) => item.Name?.match(filter1)) : results.data.Items;\n }\n return [];\n });\n }\n\n /**\n * Get the PI Web API webid or PI Point.\n *\n * @param {any} target - AF Path or Point name.\n * @returns - webid.\n *\n * @memberOf PiWebApiDatasource\n */\n getWebId(target: any) {\n var ds = this;\n var isAf = target.target.indexOf('\\\\') >= 0;\n var isAttribute = target.target.indexOf('|') >= 0;\n if (!isAf && target.target.indexOf('.') === -1) {\n return Promise.resolve([{ WebId: target.target, Name: target.display || target.target }]);\n }\n\n if (!isAf) {\n // pi point lookup\n return ds.piPointSearch(this.piserver.webid!, target.target).then((results) => {\n if (results === undefined || results.length === 0) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n return results;\n });\n } else if (isAf && isAttribute) {\n // af attribute lookup\n return ds.restGet('/attributes?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n } else {\n // af element lookup\n return ds.restGet('/elements?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n }\n }\n}\n","import { DataSourcePlugin } from '@grafana/data';\nimport { AnnotationsQueryCtrl } from './AnnotationsQueryCtrl';\nimport { PIWebAPIConfigEditor } from './ConfigEditor';\nimport { PIWebAPIQueryEditor } from './QueryEditor';\nimport { PiWebAPIDatasource } from './datasource';\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\nexport const plugin = new DataSourcePlugin(\n PiWebAPIDatasource\n)\n .setConfigEditor(PIWebAPIConfigEditor)\n .setQueryEditor(PIWebAPIQueryEditor)\n .setAnnotationQueryCtrl(AnnotationsQueryCtrl);\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__0__","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__3__","__WEBPACK_EXTERNAL_MODULE__5__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","AnnotationsQueryCtrl","$scope","this","annotation","ctrl","datasource","query","databases","templates","regex","attribute","showEndTime","getAssetServer","afserver","name","then","result","getDatabases","WebId","getEventFrames","webid","dbs","$apply","getEventFrameTemplates","database","FormField","LegacyForms","coerceOptions","options","jsonData","url","PIWebAPIConfigEditor","event","props","onOptionsChange","piserver","target","afdatabase","originalOptions","DataSourceHttpSettings","defaultUrl","dataSourceConfig","onChange","onMyOptionsChange","showAccessOptions","className","label","labelWidth","inputWidth","onPIServerChange","placeholder","onAFServerChange","onAFDatabaseChange","PureComponent","QueryField","tooltip","children","InlineFormLabel","width","QueryRowTerminator","QueryInlineField","QueryEditorRow","QueryRawInlineField","QueryRawEditorRow","defaultQuery","attributes","segments","enable","summary","types","basis","interval","nodata","expression","interpolate","recordedValues","digitalStates","isPiPoint","QueryEditorModeSwitcher","isRaw","useState","isModalOpen","setModalOpen","useEffect","Button","icon","variant","type","onClick","ConfirmModal","isOpen","title","body","confirmText","dismissText","onConfirm","onDismiss","LABEL_WIDTH","MIN_ATTR_INPUT_WIDTH","REMOVE_LABEL","CustomLabelComponent","Icon","PIWebAPIQueryEditor","summaries","attributeSegment","summarySegment","calculationBasisSegment","noDataReplacementSegment","setState","item","index","state","slice","remove","checkPiPointSegments","checkAttributeSegments","length","push","expandable","piServer","segmentChangeValue","currentSegment","data","findQuery","path","getSegmentPathUpTo","Promise","resolve","metricFindQuery","assign","request","scopedVars","items","altSegments","map","text","webId","variables","templateSrv","getVariables","each","variable","selectableValue","unshift","err","error","message","attributeText","getSelectedPIServer","pointName","Path","forOwn","availableAttributes","val","segmentsArray","attributesArray","splitAttributes","split","splitElements","splice","_","getElementSegments","elements","summariesArray","cb","initialLoad","scopedVarsDone","force","metricsQuery","defaults","buildFromTarget","_segmentsArray","updateArray","e","checkAfServer","onRunQuery","rawQuery","elementPath","join","s","queryChange","onSegmentChange","bind","calcBasisValueChanged","calcNoDataValueChanged","onSummaryAction","onSummaryValueChanged","onAttributeAction","onAttributeChange","summaryTypes","calculationBasis","noDataReplacement","segment","isValueEmpty","stateCallback","filter","indexOf","part","attributeChangeValue","arr","reduce","startsWith","attributesResponse","validAttributes","substring","filteredAttributes","attrib","changedValue","replace","webID","forEach","parts","match","queryProps","display","InlineField","InlineSwitch","onIsPiPointChange","InlineFieldRow","grow","Input","onBlur","textEditorChanged","SegmentAsync","Component","loadOptions","allowCustomValue","inputMinWidth","disabled","onPiPointChange","getAttributeSegmentsPI","reloadOptionsOnChange","Segment","getAttributeSegmentsAF","maxNumber","parseInt","getNoDataSegments","getCalcBasisSegments","getSummarySegments","search","PiWebAPIDatasource","instanceSettings","Map","basicAuth","withCredentials","getTemplateSrv","backendSrv","getBackendSrv","piwebapiurl","toString","isProxy","test","access","all","getDataServer","getDatabase","annotationOptions","endTime","eventFrame","attributeDataItems","Name","RegExp","attributeData","attributeValue","Value","time","Date","EndTime","StartTime","getTime","targets","ds","tar","elementPathArray","att","refId","hide","webids","startTime","range","from","to","varsKeys","keys","v","isAllSelected","current","selected","attr","vv","allValue","uniq","flatten","getElementPath","Array","isArray","buildQueryParameters","t","getStream","targetResponses","flattened","tr","sort","b","toDataFrame","datasourceRequest","method","response","status","Error","categoryName","nameFilter","templateName","template","iconColor","toJSON","resourceUrl","Method","Resource","RequestTemplate","Parameters","ParentIds","restBatch","Content","valueData","annotations","Items","curry","eventFrameToAnnotation","ends","end","restGet","HasChildren","queryOptions","querydepth","JSON","parse","Math","max","min","metricQueryTransform","getAssetServers","server","db","getDatabaseElements","selectedFields","getElement","element","getElements","getAttributes","searchFullHierarchy","getDataServers","piPointSearch","reject","trim","isSummary","api","datapoints","noDataReplace","parsePiPointValue","grafanaDataPoint","previousValue","drop","num","Good","checkNumber","Number","Timestamp","noDataReplacementMode","content","noTemplate","getPath","innerResults","groups","groupBy","Type","parsePiPointValueList","number","isNaN","isFinite","newElementPathArray","elem","temp","concat","splitPath","splitStr","pop","foundElement","find","results","isInterpolated","intervalTime","timeRange","targetName","displayName","encodeURIComponent","internalStream","restGetWebId","webidresponse","restPost","processResults","maxDataPoints","getSummaryUrl","datarsp","datarspa","targetResults","targetResult","headers","assetPath","cachedWebId","webidCache","set","batch","serverId","databaseId","InstanceType","elementId","querystring","filter1","filter2","doFilter","m","exec","lastIndex","groupIndex","isAf","isAttribute","DataSourceApi","plugin","DataSourcePlugin","setConfigEditor","setQueryEditor","setAnnotationQueryCtrl"],"sourceRoot":""} \ No newline at end of file From 9d95ad9db8f998b348bcc0754de7a0483555a06a Mon Sep 17 00:00:00 2001 From: Paulo Vitor Magacho Date: Fri, 2 Sep 2022 19:32:23 -0300 Subject: [PATCH 4/4] Fix issue with Pi Points --- dist/module.js | 2 +- dist/module.js.map | 2 +- src/QueryEditor.tsx | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dist/module.js b/dist/module.js index df99429..c00685e 100644 --- a/dist/module.js +++ b/dist/module.js @@ -1,3 +1,3 @@ /*! For license information please see module.js.LICENSE.txt */ -define(["@grafana/data","@grafana/runtime","@grafana/ui","lodash","react"],((e,t,n,a,r)=>(()=>{"use strict";var i=[e=>{e.exports=r},e=>{e.exports=n},t=>{t.exports=e},e=>{e.exports=a},,e=>{e.exports=t}],o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e](n,n.exports,l),n.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{l.r(u),l.d(u,{plugin:()=>me});var e=l(2);function t(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n0?r[0].split("\\"):[];return i.length>1||1===i.length&&""!==i[0]?(r.splice(0,1),(0,C.each)(i,(function(e,t){n.push({label:e,value:{value:e,expandable:!0}})})),(0,C.each)(r,(function(e,t){""!==e&&a.push({label:e,value:{value:e,expandable:!1}})})),t.getElementSegments(i.length+1,n).then((function(e){return e.length>0&&n.push({label:"Select Element",value:{value:"-Select Element-"}}),n}))):Promise.resolve(n)})),H($(t),"checkAfServer",(function(){var e,n,a=t.props.datasource,r=[];null!==(e=a.afserver)&&void 0!==e&&e.name?(r.push({label:a.afserver.name,value:{value:a.afserver.name,expandable:!0}}),null!==(n=a.afdatabase)&&void 0!==n&&n.name&&r.push({label:a.afdatabase.name,value:{value:a.afdatabase.name,expandable:!0}}),r.push({label:"Select Element",value:{value:"-Select Element-"}})):r.push({label:""});return r})),H($(t),"updateArray",(function(e,n,a,r,i){t.setState({segments:e,attributes:n,summaries:a,isPiPoint:r},(function(){return t.checkAttributeSegments(n,t.state.segments).then((function(){i&&i()}))}))})),H($(t),"scopedVarsDone",!1),H($(t),"componentDidMount",(function(){t.initialLoad(!1)})),H($(t),"componentDidUpdate",(function(){var e,n,a;"Done"===(null===(e=t.props.data)||void 0===e?void 0:e.state)&&null!==(n=t.props.data)&&void 0!==n&&null!==(a=n.request)&&void 0!==a&&a.scopedVars&&!t.scopedVarsDone&&(t.scopedVarsDone=!0,t.initialLoad(!0))})),H($(t),"initialLoad",(function(e){var n,a,r,i=t.props.query,o=(0,C.defaults)(i,F),l=o.segments,u=o.attributes,s=o.summary,c=o.isPiPoint,m=e?[]:null!==(n=null==l?void 0:l.slice(0))&&void 0!==n?n:[],h=e?[]:null!==(a=null==u?void 0:u.slice(0))&&void 0!==a?a:[],p=null!==(r=null==s?void 0:s.types)&&void 0!==r?r:[];if(c||0!==m.length)c&&m.length>0&&(t.piServer=m);else{if(i.target&&i.target.length>0&&";"!==i.target)return h=[],void t.buildFromTarget(i,m,h).then((function(e){t.updateArray(e,h,p,c)})).catch((function(e){}));m=t.checkAfServer()}t.updateArray(m,h,p,c,(function(){t.onChange(i)}))})),H($(t),"onChange",(function(e){var n,a=t.props,r=a.onChange,i=a.onRunQuery;if(e.summary.types=t.state.summaries,e.rawQuery){if(e.target=null!==(n=e.query)&&void 0!==n?n:"",""!==e.target){var o=e.target.split(";"),l=o[0].split("\\");o.splice(0,1),e.attributes=[],(l.length>1||1===l.length&&""!==l[0])&&(e.elementPath=l.join("\\"),(0,C.each)(o,(function(t,n){""!==t&&e.attributes.push({label:t,value:{value:t,expandable:!1}})})))}}else e.elementPath=t.getSegmentPathUpTo(t.state.segments,t.state.segments.length),e.target=e.elementPath+";"+(0,C.join)(e.attributes.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})),";");r(e),e.target&&e.target.length>0&&e.attributes.length>0&&i()})),H($(t),"stateCallback",(function(){var e=t.props.query;t.onChange(e)})),H($(t),"onIsPiPointChange",(function(e){var n=t.props.query,a=!n.isPiPoint;t.setState({segments:a?[{label:""}]:t.checkAfServer(),attributes:[],isPiPoint:a},(function(){t.onChange(_({},n,{expression:"",attributes:t.state.attributes,segments:t.state.segments,isPiPoint:a}))}))})),t.onSegmentChange=t.onSegmentChange.bind($(t)),t.calcBasisValueChanged=t.calcBasisValueChanged.bind($(t)),t.calcNoDataValueChanged=t.calcNoDataValueChanged.bind($(t)),t.onSummaryAction=t.onSummaryAction.bind($(t)),t.onSummaryValueChanged=t.onSummaryValueChanged.bind($(t)),t.onAttributeAction=t.onAttributeAction.bind($(t)),t.onAttributeChange=t.onAttributeChange.bind($(t)),t.summaryTypes=["Total","Average","Minimum","Maximum","Range","StdDev","PopulationStdDev","Count","PercentGood","All","AllForNonNumeric"],t.calculationBasis=["TimeWeighted","EventWeighted","TimeWeightedContinuous","TimeWeightedDiscrete","EventWeightedExcludeMostRecentEvent","EventWeightedExcludeEarliestEvent","EventWeightedIncludeBothEnds"],t.noDataReplacement=["Null","Drop","Previous","0","Keep"],t}return t=i,(n=[{key:"isValueEmpty",value:function(e){return!e||!e.value||!e.value.length||e.value===X}},{key:"calcBasisValueChanged",value:function(e){var t,n=this.props.query,a=n.summary;a.basis=null===(t=e.value)||void 0===t?void 0:t.value,this.onChange(_({},n,{summary:a}))}},{key:"getCalcBasisSegments",value:function(){return(0,C.map)(this.calculationBasis,(function(e){return{label:e,value:{value:e,expandable:!0}}}))}},{key:"calcNoDataValueChanged",value:function(e){var t,n=this.props.query,a=n.summary;a.nodata=null===(t=e.value)||void 0===t?void 0:t.value,this.onChange(_({},n,{summary:a}))}},{key:"getNoDataSegments",value:function(){return(0,C.map)(this.noDataReplacement,(function(e){return{label:e,value:{value:e,expandable:!0}}}))}},{key:"onSummaryValueChanged",value:function(e,t){var n=this.state.summaries.slice(0);n[t]=e,this.isValueEmpty(e.value)&&n.splice(t,1),this.setState({summaries:n},this.stateCallback)}},{key:"getSummarySegments",value:function(){var e=this,t=(0,C.filter)(this.summaryTypes,(function(t){return-1===e.state.summaries.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).indexOf(t)})),n=(0,C.map)(t,(function(e){return{label:e,value:{value:e,expandable:!0}}}));return n.unshift({label:X,value:{value:X}}),n}},{key:"removeSummary",value:function(e){var t=(0,C.filter)(this.state.summaries,(function(t){return t!==e}));this.setState({summaries:t})}},{key:"onSummaryAction",value:function(e){var t=this.state.summaries.slice(0);if(!this.isValueEmpty(e.value)){var n,a={label:e.label,value:{value:null===(n=e.value)||void 0===n?void 0:n.value,expandable:!0}};t.push(a)}this.setState({summarySegment:{},summaries:t},this.stateCallback)}},{key:"removeAttribute",value:function(e){var t=(0,C.filter)(this.state.attributes,(function(t){return t!==e}));this.attributeChangeValue(t)}},{key:"onAttributeAction",value:function(e){var t=this.props.query,n=this.state.attributes.slice(0);if(!this.isValueEmpty(e.value)){var a,r={label:e.label,value:{value:null===(a=e.value)||void 0===a?void 0:a.value,expandable:!t.isPiPoint}};n.push(r)}this.attributeChangeValue(n)}},{key:"getSegmentPathUpTo",value:function(e,t){var n=e.slice(0,t);return(0,C.reduce)(n,(function(e,t){var n;return t.value?null!==(n=t.value.value)&&void 0!==n&&n.startsWith("-Select")?e:e?e+"\\"+t.value.value:t.value.value:""}),"")}},{key:"checkAttributeSegments",value:function(e,t){var n,a,r=this,i=this.props,o=i.datasource,l=i.data,u=this,s={path:this.getSegmentPathUpTo(t.slice(0),t.length),type:"attributes"};return o.metricFindQuery(s,Object.assign(null!==(n=null==l||null===(a=l.request)||void 0===a?void 0:a.scopedVars)&&void 0!==n?n:{},{isPiPoint:!1})).then((function(t){var n={};(0,C.each)(t,(function(e){n[e.Path.substring(e.Path.indexOf("|")+1)]=e.WebId}));var a=(0,C.filter)(e,(function(e){var t,a=o.templateSrv.replace(null===(t=e.value)||void 0===t?void 0:t.value);return void 0!==n[a]}));u.availableAttributes=n,r.attributeChangeValue(a)})).catch((function(t){u.error=t.message||"Failed to issue metric query",r.attributeChangeValue(e)}))}},{key:"checkPiPointSegments",value:function(e,t){var n,a,r=this.props,i=r.datasource,o=r.data,l=this,u={path:e.path,webId:l.getSelectedPIServer(),pointName:e.label,type:"pipoint"};return i.metricFindQuery(u,Object.assign(null!==(n=null==o||null===(a=o.request)||void 0===a?void 0:a.scopedVars)&&void 0!==n?n:{},{isPiPoint:!0})).then((function(){l.attributeChangeValue(t)})).catch((function(e){l.error=e.message||"Failed to issue metric query",l.attributeChangeValue([])}))}},{key:"getSelectedPIServer",value:function(){var e,t=this,n="";return this.piServer.forEach((function(e){var a=t.props.query.target.split(";");a.length>=2&&a[0]===e.text&&(n=e.WebId)})),this.piServer.length>0?null===(e=this.piServer[0].value)||void 0===e?void 0:e.webId:n}},{key:"textEditorChanged",value:function(){var e=this,t=this.props,n=t.query,a=t.onChange,r=n.target.split(";"),i=r.length>0?r[0].split("\\"):[],o=[],l=[];i.length>1||1===i.length&&""!==i[0]?(r.splice(0,1),(0,C.each)(i,(function(e,t){o.push({label:e,value:{type:e.match(/\${\w+}/gi)?"template":void 0,value:e,expandable:!0}})})),this.getElementSegments(i.length+1,o).then((function(e){e.length>0&&o.push({label:"Select Element",value:{value:"-Select Element-"}})})),(0,C.each)(r,(function(e,t){""!==e&&l.push({label:e,value:{value:e,expandable:!1}})})),this.updateArray(o,l,this.state.summaries,n.isPiPoint,(function(){a(_({},n,{query:void 0,rawQuery:!1}))}))):(o=this.checkAfServer(),this.updateArray(o,this.state.attributes,this.state.summaries,n.isPiPoint,(function(){e.onChange(_({},n,{query:void 0,rawQuery:!1,attributes:e.state.attributes,segments:e.state.segments}))})))}},{key:"render",value:function(){var e=this,t=this.props,n=t.query,a=t.onChange,r=t.onRunQuery,i=(0,C.defaults)(n,F),l=i.interpolate,u=i.query,c=i.rawQuery,m=i.digitalStates,h=i.recordedValues,p=i.expression,d=i.isPiPoint,f=i.summary,v=i.display,b=i.regex;return o().createElement(o().Fragment,null,o().createElement(s.InlineField,{label:"Is Pi Point?",labelWidth:z},o().createElement(s.InlineSwitch,{value:d,onChange:this.onIsPiPointChange})),!!c&&o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Raw Query",labelWidth:z,grow:!0},o().createElement(s.Input,{onBlur:this.stateCallback,value:u,onChange:function(e){return a(_({},i,{query:e.target.value}))},placeholder:"enter query"})),o().createElement(B,{isRaw:!0,onChange:function(t){return e.textEditorChanged()}})),!c&&o().createElement(o().Fragment,null,o().createElement("div",{className:"gf-form-inline"},o().createElement(j,{label:d?"PI Server":"AF Elements",tooltip:d?"Select PI server.":"Select AF Element."},this.state.segments.map((function(t,n){return o().createElement(s.SegmentAsync,{key:"element-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),onChange:function(t){return e.onSegmentChange(t,n)},loadOptions:function(t){return e.getElementSegments(n)},allowCustomValue:!0,inputMinWidth:200})})),R||(R=o().createElement(A,null)),!d&&o().createElement(B,{isRaw:!1,onChange:function(e){a(_({},i,{query:i.target,rawQuery:e}))}}))),o().createElement(k,{label:d?"Pi Points":"Attributes"},this.state.attributes.map((function(t,n){return d?o().createElement(s.SegmentAsync,{key:"attributes-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),disabled:0===e.piServer.length,onChange:function(t){return e.onPiPointChange(t,n)},loadOptions:e.getAttributeSegmentsPI,reloadOptionsOnChange:!0,allowCustomValue:!0,inputMinWidth:J}):o().createElement(s.Segment,{key:"attributes-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),disabled:e.state.segments.length<=2,onChange:function(t){return e.onAttributeChange(t,n)},options:e.getAttributeSegmentsAF(),allowCustomValue:!0,inputMinWidth:J})})),d&&o().createElement(s.SegmentAsync,{Component:o().createElement(Y,{value:this.state.attributeSegment.value,label:this.state.attributeSegment.label}),disabled:0===this.piServer.length,onChange:this.onAttributeAction,loadOptions:this.getAttributeSegmentsPI,reloadOptionsOnChange:!0,allowCustomValue:!0,inputMinWidth:J}),!d&&o().createElement(s.Segment,{Component:o().createElement(Y,{value:this.state.attributeSegment.value,label:this.state.attributeSegment.label}),disabled:this.state.segments.length<=2,onChange:this.onAttributeAction,options:this.getAttributeSegmentsAF(),allowCustomValue:!0,inputMinWidth:J}))),!d&&o().createElement(s.InlineField,{label:"Calculation",labelWidth:z,tooltip:"Modify all attributes by an equation. Use '.' for current item. Leave Attributes empty if you wish to perform element based calculations."},o().createElement(s.Input,{onBlur:r,value:p,onChange:function(t){return e.onChange(_({},i,{expression:t.target.value}))},placeholder:"'.'*2"})),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Max Recorded Values",labelWidth:z,tooltip:"Maximum number of recorded value to retrive from the data archive, without using interpolation."},o().createElement(s.Input,{onBlur:r,value:h.maxNumber,onChange:function(t){return e.onChange(_({},i,{recordedValues:_({},h,{maxNumber:parseInt(t.target.value,10)})}))},type:"number",placeholder:"1000"})),o().createElement(s.InlineField,{label:"Recorded Values",labelWidth:z},o().createElement(s.InlineSwitch,{value:h.enable,onChange:function(){return e.onChange(_({},i,{recordedValues:_({},h,{enable:!h.enable})}))}})),o().createElement(s.InlineField,{label:"Digital States",labelWidth:z},o().createElement(s.InlineSwitch,{value:m.enable,onChange:function(){return e.onChange(_({},i,{digitalStates:_({},m,{enable:!m.enable})}))}}))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Interpolate Period",labelWidth:z,tooltip:"Override time between sampling, e.g. '30s'. Defaults to timespan/chart width."},o().createElement(s.Input,{onBlur:r,value:l.interval,onChange:function(t){return e.onChange(_({},i,{interpolate:_({},l,{interval:t.target.value})}))},placeholder:"30s"})),o().createElement(s.InlineField,{label:"Interpolate",labelWidth:z},o().createElement(s.InlineSwitch,{value:l.enable,onChange:function(){return e.onChange(_({},i,{interpolate:_({},l,{enable:!l.enable})}))}})),o().createElement(s.InlineField,{label:"Replace Bad Data",labelWidth:z,tooltip:"Replacement for bad quality values."},o().createElement(s.Segment,{Component:o().createElement(Y,{value:{value:f.nodata},label:f.nodata}),onChange:this.calcNoDataValueChanged,options:this.getNoDataSegments(),allowCustomValue:!0}))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Summary Period",labelWidth:z,tooltip:"Override time between sampling, e.g. '30s'."},o().createElement(s.Input,{onBlur:r,value:f.interval,onChange:function(e){return a(_({},i,{summary:_({},f,{interval:e.target.value})}))},placeholder:"30s"})),o().createElement(s.InlineField,{label:"Basis",labelWidth:z,tooltip:"Defines the possible calculation options when performing summary calculations over time-series data."},o().createElement(s.Segment,{Component:o().createElement(Y,{value:{value:f.basis},label:f.basis}),onChange:this.calcBasisValueChanged,options:this.getCalcBasisSegments(),allowCustomValue:!0})),o().createElement(s.InlineField,{label:"Summaries",labelWidth:z,tooltip:"Replacement for bad quality values."},o().createElement(s.InlineFieldRow,null,this.state.summaries.map((function(t,n){return o().createElement(s.Segment,{key:"summaries-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),onChange:function(t){return e.onSummaryValueChanged(t,n)},options:e.getSummarySegments(),allowCustomValue:!0})})),o().createElement(s.Segment,{Component:o().createElement(Y,{value:this.state.summarySegment.value,label:this.state.summarySegment.label}),onChange:this.onSummaryAction,options:this.getSummarySegments(),allowCustomValue:!0})))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Display Name",labelWidth:z,tooltip:"If single attribute, modify display name. Otherwise use regex to modify display name."},o().createElement(s.Input,{onBlur:r,value:v,onChange:function(t){return e.onChange(_({},i,{display:t.target.value}))},placeholder:"Display"})),o().createElement(s.InlineField,{label:"Enable Regex Replace",labelWidth:z},o().createElement(s.InlineSwitch,{value:b.enable,onChange:function(){e.onChange(_({},i,{regex:_({},b,{enable:!b.enable})}))}})),o().createElement(s.InlineField,{label:"Search",labelWidth:16},o().createElement(s.Input,{onBlur:r,value:b.search,onChange:function(t){return e.onChange(_({},i,{regex:_({},b,{search:t.target.value})}))},placeholder:"(.*)"})),o().createElement(s.InlineField,{label:"Replace",labelWidth:16},o().createElement(s.Input,{onBlur:r,value:b.replace,onChange:function(t){return e.onChange(_({},i,{regex:_({},b,{replace:t.target.value})}))},placeholder:"$1"}))))}}])&&G(t.prototype,n),a&&G(t,a),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.PureComponent),Z=l(5);function ee(e){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(e)}function te(){te=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var r=t&&t.prototype instanceof m?t:m,i=Object.create(r.prototype),o=new w(a||[]);return i._invoke=function(e,t,n){var a="suspendedStart";return function(r,i){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===r)throw i;return C()}for(n.method=r,n.arg=i;;){var o=n.delegate;if(o){var l=P(o,n);if(l){if(l===c)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var u=s(e,t,n);if("normal"===u.type){if(a=n.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c={};function m(){}function h(){}function p(){}var d={};l(d,r,(function(){return this}));var f=Object.getPrototypeOf,v=f&&f(f(I([])));v&&v!==t&&n.call(v,r)&&(d=v);var b=p.prototype=m.prototype=Object.create(d);function g(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function a(r,i,o,l){var u=s(e[r],e,i);if("throw"!==u.type){var c=u.arg,m=c.value;return m&&"object"==ee(m)&&n.call(m,"__await")?t.resolve(m.__await).then((function(e){a("next",e,o,l)}),(function(e){a("throw",e,o,l)})):t.resolve(m).then((function(e){c.value=e,o(c)}),(function(e){return a("throw",e,o,l)}))}l(u.arg)}var r;this._invoke=function(e,n){function i(){return new t((function(t,r){a(e,n,t,r)}))}return r=r?r.then(i,i):i()}}function P(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,P(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,c;var r=a.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function I(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function t(){for(;++a=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if("throw"===a.type){var r=a.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:I(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function ne(e,t,n,a,r,i,o){try{var l=e[i](o),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(a,r)}function ae(e,t){for(var n=0;n"+e.Name+": "+t})),{annotation:e,title:(t?"END ":e.showEndTime?"START ":"")+e.name,time:new Date(t?n.EndTime:n.StartTime).getTime(),text:n.Name+r+"
Start: "+n.StartTime+"
End: "+n.EndTime}}},{key:"buildQueryParameters",value:function(e){var t=this;return e.targets=(0,C.filter)(e.targets,(function(e){return!(!e||!e.target||e.target.startsWith("Select AF"))})),e.targets=(0,C.map)(e.targets,(function(n){var a=t,r={target:t.templateSrv.replace(n.elementPath,e.scopedVars),elementPath:t.templateSrv.replace(n.elementPath,e.scopedVars),elementPathArray:[{path:t.templateSrv.replace(n.elementPath,e.scopedVars),variable:""}],attributes:(0,C.map)(n.attributes,(function(n){var a;return t.templateSrv.replace((null===(a=n.value)||void 0===a?void 0:a.value)||n,e.scopedVars)})),segments:(0,C.map)(n.segments,(function(n){var a;return t.templateSrv.replace(null===(a=n.value)||void 0===a?void 0:a.value,e.scopedVars)})),display:n.display,refId:n.refId,hide:n.hide,interpolate:n.interpolate||{enable:!1},recordedValues:n.recordedValues||{enable:!1},digitalStates:n.digitalStates||{enable:!1},webid:n.webid,webids:n.webids||[],regex:n.regex||{enable:!1},expression:n.expression||"",summary:n.summary||{types:[]},startTime:e.range.from,endTime:e.range.to,isPiPoint:n.isPiPoint,scopedVars:e.scopedVars};r.expression&&(r.expression=t.templateSrv.replace(r.expression,e.scopedVars)),void 0!==r.summary.types&&(r.summary.types=(0,C.filter)(r.summary.types,(function(e){return null!=e&&""!==e})));var i=(0,C.keys)(e.scopedVars);return t.templateSrv.getVariables().forEach((function(e){if(a.isAllSelected(e.current)&&i.indexOf(e.name)<0){var t=e.options.filter((function(e){return!e.selected}));r.attributes=r.attributes.map((function(n){return t.map((function(t){return e.allValue?n.replace(e.allValue,t.value):n.replace(/{[a-zA-z0-9,-_]+}/gi,t.value)}))})),r.attributes=(0,C.uniq)((0,C.flatten)(r.attributes)),r.elementPathArray=a.getElementPath(r.elementPathArray,t,e.allValue)}else if(Array.isArray(e.current.text)&&i.indexOf(e.name)<0){var n=e.options.filter((function(e){return e.selected})),o=e.current.value.join(",");r.attributes=r.attributes.map((function(e){return n.map((function(t){return e.replace("{".concat(o,"}"),t.value)}))})),r.attributes=(0,C.uniq)((0,C.flatten)(r.attributes)),r.elementPathArray=a.getElementPath(r.elementPathArray,n,"{".concat(o,"}"))}})),r})),e}},{key:"query",value:(i=te().mark((function t(n){var a,r;return te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=this,(r=this.buildQueryParameters(n)).targets=(0,C.filter)(r.targets,(function(e){return!e.hide})),!(r.targets.length<=0)){t.next=7;break}return t.abrupt("return",Promise.resolve({data:[]}));case 7:return t.abrupt("return",Promise.all(a.getStream(r)).then((function(t){var n=[];return(0,C.each)(t,(function(e){(0,C.each)(e,(function(e){return n.push(e)}))})),{data:n.sort((function(e,t){return+(e.target>t.target)||+(e.target===t.target)-1})).map((function(t){return(0,e.toDataFrame)(t)}))}})));case 8:case"end":return t.stop()}}),t,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,a){var r=i.apply(e,t);function o(e){ne(r,n,a,o,l,"next",e)}function l(e){ne(r,n,a,o,l,"throw",e)}o(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"testDatasource",value:function(){return this.backendSrv.datasourceRequest({url:this.url+"/",method:"GET"}).then((function(e){if(200===e.status)return{status:"success",message:"Data source is working",title:"Success"};throw new Error("Failed")}))}},{key:"annotationQuery",value:function(e){var t=this;if(!this.afdatabase.webid)return Promise.resolve([]);var n=e.annotation.query.categoryName?this.templateSrv.replace(e.annotation.query.categoryName,e.scopedVars,"glob"):null,a=e.annotation.query.nameFilter?this.templateSrv.replace(e.annotation.query.nameFilter,e.scopedVars,"glob"):null,r=e.annotation.template?e.annotation.template.Name:null,i={name:e.annotation.name,datasource:e.annotation.datasource,enable:e.annotation.enable,iconColor:e.annotation.iconColor,showEndTime:e.annotation.showEndTime,regex:e.annotation.regex,attribute:e.annotation.attribute,categoryName:n,templateName:r,nameFilter:a},o=[];if(i.categoryName&&o.push("categoryName="+i.categoryName),i.nameFilter&&o.push("nameFilter="+i.nameFilter),i.templateName&&o.push("templateName="+i.templateName),!o.length)return Promise.resolve([]);if(o.push("startTime="+e.range.from.toJSON()),o.push("endTime="+e.range.to.toJSON()),i.attribute&&i.attribute.enable){var l=this.piwebapiurl+"/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name";i.attribute.name&&(l=this.piwebapiurl+"/streamsets/{0}/value?nameFilter="+i.attribute.name+"&selectedFields=Items.WebId%3BItems.Value%3BItems.Name");var u={};return u[1]={Method:"GET",Resource:this.piwebapiurl+"/assetdatabases/"+this.afdatabase.webid+"/eventframes?"+o.join("&")},u[2]={Method:"GET",RequestTemplate:{Resource:l},Parameters:["$.1.Content.Items[*].WebId"],ParentIds:["1"]},this.restBatch(u).then((function(n){var a=n.data[1].Content,r=n.data[2].Content,o=(0,C.map)(a.Items,(function(e,n){return(0,C.curry)(t.eventFrameToAnnotation)(i,!1,e,r.Items[n].Content.Items)}));if(e.annotation.showEndTime){var l=(0,C.map)(a.Items,(function(e,n){return(0,C.curry)(t.eventFrameToAnnotation)(i,!0,e,r.Items[n].Content.Items)}));(0,C.each)(l,(function(e){o.push(e)}))}return o}))}return this.restGet("/assetdatabases/"+this.afdatabase.webid+"/eventframes?"+o.join("&")).then((function(n){var a=(0,C.map)(n.data.Items,(0,C.curry)(t.eventFrameToAnnotation)(i,!1));if(e.annotation.showEndTime){var r=(0,C.map)(n.data.Items,(0,C.curry)(t.eventFrameToAnnotation)(i,!0));(0,C.each)(r,(function(e){a.push(e)}))}return a}))}},{key:"metricQueryTransform",value:function(e){return(0,C.map)(e,(function(e){var t,n;return{text:e.Name,expandable:void 0===e.HasChildren||!0===e.HasChildren||(null!==(t=e.Path)&&void 0!==t?t:"").split("\\").length<=3,HasChildren:e.HasChildren,Items:null!==(n=e.Items)&&void 0!==n?n:[],Path:e.Path,WebId:e.WebId}}))}},{key:"metricFindQuery",value:function(e,t){var n,a,r=this,i=["servers","databases","databaseElements","elements"];return"string"==typeof e&&(e=JSON.parse(e)),t.isPiPoint?e.path=this.templateSrv.replace(e.path,t):(""===e.path?e.type=i[0]:"attributes"!==e.type&&(e.type=i[Math.max(0,Math.min(e.path.split("\\").length,i.length-1))]),e.path=this.templateSrv.replace(e.path,t),e.path=e.path.replace(/\{([^\\])*\}/gi,(function(e){return e.substring(1,e.length-2).split(",")[0]}))),e.filter=null!==(n=e.filter)&&void 0!==n?n:"*","servers"===e.type?null!==(a=r.afserver)&&void 0!==a&&a.name?r.getAssetServer(r.afserver.name).then((function(e){return[e]})).then(r.metricQueryTransform):r.getAssetServers().then(r.metricQueryTransform):"databases"===e.type?r.getAssetServer(e.path).then((function(e){var t;return r.getDatabases(null!==(t=e.WebId)&&void 0!==t?t:"",{})})).then(r.metricQueryTransform):"databaseElements"===e.type?r.getDatabase(e.path).then((function(e){var t;return r.getDatabaseElements(null!==(t=e.WebId)&&void 0!==t?t:"",{selectedFields:"Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren"})})).then(r.metricQueryTransform):"elements"===e.type?r.getElement(e.path).then((function(t){var n;return r.getElements(null!==(n=t.WebId)&&void 0!==n?n:"",{selectedFields:"Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren",nameFilter:e.filter})})).then(r.metricQueryTransform):"attributes"===e.type?r.getElement(e.path).then((function(t){var n;return r.getAttributes(null!==(n=t.WebId)&&void 0!==n?n:"",{searchFullHierarchy:"true",selectedFields:"Items.WebId%3BItems.Name%3BItems.Path",nameFilter:e.filter})})).then(r.metricQueryTransform):"dataserver"===e.type?r.getDataServers().then(r.metricQueryTransform):"pipoint"===e.type?r.piPointSearch(e.webId,e.pointName).then(r.metricQueryTransform):Promise.reject("Bad type")}},{key:"getSummaryUrl",value:function(e){return""===e.interval.trim()?"&summaryType="+e.types.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).join("&summaryType=")+"&calculationBasis="+e.basis:"&summaryType="+e.types.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).join("&summaryType=")+"&calculationBasis="+e.basis+"&summaryDuration="+e.interval.trim()}},{key:"parsePiPointValueList",value:function(e,t,n){var a=this,r=this,i=[];return(0,C.each)(e,(function(e){var o=a.noDataReplace(n?e.Value:e,t.summary.nodata,r.parsePiPointValue(n?e.Value:e,t,n)),l=o.grafanaDataPoint;o.previousValue,o.drop||i.push(l)})),i}},{key:"parsePiPointValue",value:function(e,t,n){var a,r,i,o,l=n||"object"!==ee(e.Value)?e.Value:null===(a=e.Value)||void 0===a?void 0:a.Value;return!e.Good||null!==(r=t.digitalStates)&&void 0!==r&&r.enable?(l=null!==(i=n||"object"!==ee(e.Value)?e.Name:null===(o=e.Value)||void 0===o?void 0:o.Name)&&void 0!==i?i:"",[this.checkNumber(l)?Number(l):l.trim(),new Date(e.Timestamp).getTime()]):[this.checkNumber(l)?Number(l):l.trim(),new Date(e.Timestamp).getTime()]}},{key:"noDataReplace",value:function(e,t,n){var a,r,i=null,o=!1;return!e.Good||"No Data"===e.Value||null!==(a=e.Value)&&void 0!==a&&a.Name&&"No Data"===(null===(r=e.Value)||void 0===r?void 0:r.Name)?"Drop"===t?o=!0:"0"===t?n[0]=0:"Keep"===t||("Null"===t?n[0]=null:"Previous"===t&&null!==i&&(n[0]=i)):i=e.Value,{grafanaDataPoint:n,previousValue:i,drop:o}}},{key:"processResults",value:function(e,t,n,a){var r=this,i=t.summary&&t.summary.types&&t.summary.types.length>0;if(n=a?n:this.getPath(t.elementPathArray,e.Path)+"|"+n,t.regex&&t.regex.enable&&t.regex.search.length&&t.regex.replace.length&&(n=n.replace(new RegExp(t.regex.search),t.regex.replace)),i){var o=[],l=(0,C.groupBy)(e.Items,(function(e){return e.Type}));return(0,C.forOwn)(l,(function(e,a){o.push({refId:t.refId,target:n+"["+a+"]",datapoints:r.parsePiPointValueList(e,t,i)})})),o}return[{refId:t.refId,target:n,datapoints:r.parsePiPointValueList(e.Items,t,i)}]}},{key:"isAllSelected",value:function(e){return!!e&&(Array.isArray(e.text)?e.text.indexOf("All")>=0:"All"===e.text)}},{key:"checkNumber",value:function(e){return"number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)}},{key:"getElementPath",value:function(e,t,n){var a=[];return e.forEach((function(e){if(n&&e.path.indexOf(n)>=0||!n&&e.path.match(/{[a-zA-z0-9,-_]+}/gi)){var r=t.map((function(t){return{path:n?e.path.replace(n,t.value):e.path.replace(/{[a-zA-z0-9,-_]+}/gi,t.value),variable:t.value}}));a=a.concat(r)}})),a.length?(0,C.uniq)((0,C.flatten)(a)):e}},{key:"getPath",value:function(e,t){var n,a,r=t.split("|");if(0===r.length)return"";if(0===e.length)return"";var i=0===(r=r[0].split("\\")).length?"":null!==(n=r.pop())&&void 0!==n?n:"",o=null===(a=e.find((function(e){return t.indexOf(e.path)>=0})))||void 0===a?void 0:a.variable;return o?o+"|"+i:i}},{key:"getStream",value:function(e){var t=this,n=this,a=[];return(0,C.each)(e.targets,(function(r){r.attributes=(0,C.filter)(r.attributes||[],(function(e){return e}));var i="",o=r.summary&&r.summary.types&&r.summary.types.length>0,l=r.interpolate&&r.interpolate.enable,u=r.interpolate.interval?r.interpolate.interval:e.interval,s="?startTime="+e.range.from.toJSON()+"&endTime="+e.range.to.toJSON(),c=r.expression||r.elementPath,m=r.display?t.templateSrv.replace(r.display,e.scopedVars):null;if(r.expression)i+="/calculation",i+=o?"/summary"+s+(l?"&sampleType=Interval&sampleInterval="+u:""):"/intervals"+s+"&sampleInterval="+u,i+="&expression="+encodeURIComponent(r.expression),r.attributes.length>0?a.push(n.internalStream(e,r,i)):a.push(n.restGetWebId(r.elementPath,r.isPiPoint).then((function(e){return n.restPost(i+e.WebId).then((function(e){return n.processResults(e.data,r,m||c,!1)})).catch((function(e){return n.error=e}))})));else{if(i+="/streamsets",o)i+="/summary"+s+"&intervals="+e.maxDataPoints+t.getSummaryUrl(r.summary);else if(r.interpolate&&r.interpolate.enable)i+="/interpolated"+s+"&interval="+u;else if(r.recordedValues&&r.recordedValues.enable){var h=r.recordedValues.maxNumber&&!isNaN(r.recordedValues.maxNumber)?r.recordedValues.maxNumber:1e3;i+="/recorded"+s+"&maxCount="+h}else i+="/plot"+s+"&intervals="+e.maxDataPoints;a.push(n.internalStream(e,r,i))}})),a}},{key:"internalStream",value:function(e,t,n){var a=this,r=t.expression||t.elementPath,i=t.display?this.templateSrv.replace(t.display,e.scopedVars):null,o=1===t.elementPathArray.length&&t.elementPath===t.elementPathArray[0].path;return(o?t.attributes.length>1&&!t.isPiPoint?a.restGetWebId(t.elementPath,t.isPiPoint).then((function(e){return a.getAttributes(e.WebId,{searchFullHierarchy:"true",nameFilter:"*"})})).then((function(e){return e.filter((function(e){var n;return t.attributes.indexOf(e.Name)>=0||t.attributes.indexOf(null===(n=e.Path)||void 0===n?void 0:n.split("|").splice(1).join("|"))>=0}))})):Promise.all((0,C.map)(t.attributes,(function(e){return a.restGetWebId(t.elementPath+"|"+e,t.isPiPoint)}))):t.attributes.length>1&&!t.isPiPoint?Promise.all(t.elementPathArray.map((function(e){return a.restGetWebId(e.path,t.isPiPoint).then((function(e){return a.getAttributes(e.WebId,{searchFullHierarchy:"true",nameFilter:"*"})})).then((function(e){return e.filter((function(e){var n;return t.attributes.indexOf(e.Name)>=0||t.attributes.indexOf(null===(n=e.Path)||void 0===n?void 0:n.split("|").splice(1).join("|"))>=0}))}))}))):Promise.all((0,C.flatten)((0,C.map)(t.attributes,(function(e){return t.elementPathArray.map((function(n){return a.restGetWebId(n.path+"|"+e,t.isPiPoint)}))}))))).then((function(e){var l={};return(0,C.each)((0,C.flatten)(e),(function(e,t){l[t+1]={Method:"GET",Resource:a.piwebapiurl+n+"&webid="+e.WebId}})),a.restBatch(l).then((function(n){var l=[];return(0,C.each)(n.data,(function(n,u){if(t.expression){var s=e[parseInt(u,10)-1].Name;(0,C.each)(a.processResults(n.Content,t,i||s||r,o),(function(e){return l.push(e)}))}else(0,C.each)(n.Content.Items,(function(e){(0,C.each)(a.processResults(e,t,i||e.Name||r,o),(function(e){return l.push(e)}))}))})),l})).catch((function(e){return a.error=e}))}))}},{key:"restGet",value:function(e){return this.backendSrv.datasourceRequest({url:this.url+e,method:"GET",headers:{"Content-Type":"application/json"}}).then((function(e){return e}))}},{key:"restGetWebId",value:function(e,t){var n=this,a=n.webidCache.get(e);if(a)return Promise.resolve({Path:e,WebId:a.WebId,Name:a.Name});var r="";return r=t?"/points?selectedFields=WebId%3BName%3BPath&path=\\\\"+e.replace("|","\\"):(e.indexOf("|")>=0?"/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\":"/elements?selectedFields=WebId%3BName%3BPath&path=\\\\")+e,this.backendSrv.datasourceRequest({url:this.url+r,method:"GET",headers:{"Content-Type":"application/json"}}).then((function(t){return n.webidCache.set(e,t.data),{Path:e,WebId:t.data.WebId,Name:t.data.Name}}))}},{key:"restBatch",value:function(e){return this.backendSrv.datasourceRequest({url:this.url+"/batch",data:e,method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"message/http"}})}},{key:"restPost",value:function(e){return this.backendSrv.datasourceRequest({url:this.url,method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"message/http","X-PIWEBAPI-HTTP-METHOD":"GET","X-PIWEBAPI-RESOURCE-ADDRESS":e}})}},{key:"getDataServers",value:function(){return this.restGet("/dataservers").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getDataServer",value:function(e){return e?this.restGet("/dataservers?name="+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getAssetServers",value:function(){return this.restGet("/assetservers").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getAssetServer",value:function(e){return e?this.restGet("/assetservers?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getDatabase",value:function(e){return e?this.restGet("/assetdatabases?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getDatabases",value:function(e,t){return e?this.restGet("/assetservers/"+e+"/assetdatabases").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]})):Promise.resolve([])}},{key:"getElement",value:function(e){return e?this.restGet("/elements?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getEventFrameTemplates",value:function(e){return e?this.restGet("/assetdatabases/"+e+"/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId").then((function(e){var t;return(0,C.filter)(null!==(t=e.data.Items)&&void 0!==t?t:[],(function(e){return"EventFrame"===e.InstanceType}))})):Promise.resolve([])}},{key:"getElementTemplates",value:function(e){return e?this.restGet("/assetdatabases/"+e+"/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId").then((function(e){var t;return(0,C.filter)(null!==(t=e.data.Items)&&void 0!==t?t:[],(function(e){return"Element"===e.InstanceType}))})):Promise.resolve([])}},{key:"getAttributes",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/elements/"+e+"/attributes"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getDatabaseElements",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/assetdatabases/"+e+"/elements"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getElements",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/elements/"+e+"/elements"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"piPointSearch",value:function(e,t){var n=this.templateSrv.replace(t),a="".concat(n),r=!1;if(n!==t)for(var i,o=/\{(\w|,)+\}/g;null!==(i=o.exec(n));)i.index===o.lastIndex&&o.lastIndex++,i.forEach((function(e,t){0===t&&(n=n.replace(e,e.replace("{","(").replace("}",")").replace(",","|")),a=a.replace(e,"*"),r=!0)}));return this.restGet("/dataservers/"+e+"/points?maxCount=20&nameFilter="+a).then((function(e){var t;return e&&null!==(t=e.data)&&void 0!==t&&t.Items?r?e.data.Items.filter((function(e){var t;return null===(t=e.Name)||void 0===t?void 0:t.match(n)})):e.data.Items:[]}))}},{key:"getWebId",value:function(e){var t=this,n=e.target.indexOf("\\")>=0,a=e.target.indexOf("|")>=0;return n||-1!==e.target.indexOf(".")?n?n&&a?t.restGet("/attributes?path=\\\\"+e.target).then((function(t){return void 0===t.data||200!==t.status?[{WebId:e.target,Name:e.display||e.target}]:(t.data.Name=e.display||t.data.Name,[t.data])})):t.restGet("/elements?path=\\\\"+e.target).then((function(t){return void 0===t.data||200!==t.status?[{WebId:e.target,Name:e.display||e.target}]:(t.data.Name=e.display||t.data.Name,[t.data])})):t.piPointSearch(this.piserver.webid,e.target).then((function(t){return void 0===t||0===t.length?[{WebId:e.target,Name:e.display||e.target}]:t})):Promise.resolve([{WebId:e.target,Name:e.display||e.target}])}}],a&&ae(n.prototype,a),r&&ae(n,r),Object.defineProperty(n,"prototype",{writable:!1}),u}(e.DataSourceApi),me=new e.DataSourcePlugin(ce).setConfigEditor(I).setQueryEditor(K).setAnnotationQueryCtrl(a)})(),u})())); +define(["@grafana/data","@grafana/runtime","@grafana/ui","lodash","react"],((e,t,n,a,r)=>(()=>{"use strict";var i=[e=>{e.exports=r},e=>{e.exports=n},t=>{t.exports=e},e=>{e.exports=a},,e=>{e.exports=t}],o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e](n,n.exports,l),n.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{l.r(u),l.d(u,{plugin:()=>me});var e=l(2);function t(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n0?r[0].split("\\"):[];return i.length>1||1===i.length&&""!==i[0]?(r.splice(0,1),(0,C.each)(i,(function(e,t){n.push({label:e,value:{value:e,expandable:!0}})})),(0,C.each)(r,(function(e,t){""!==e&&a.push({label:e,value:{value:e,expandable:!1}})})),t.getElementSegments(i.length+1,n).then((function(e){return e.length>0&&n.push({label:"Select Element",value:{value:"-Select Element-"}}),n}))):Promise.resolve(n)})),H($(t),"checkAfServer",(function(){var e,n,a=t.props.datasource,r=[];null!==(e=a.afserver)&&void 0!==e&&e.name?(r.push({label:a.afserver.name,value:{value:a.afserver.name,expandable:!0}}),null!==(n=a.afdatabase)&&void 0!==n&&n.name&&r.push({label:a.afdatabase.name,value:{value:a.afdatabase.name,expandable:!0}}),r.push({label:"Select Element",value:{value:"-Select Element-"}})):r.push({label:""});return r})),H($(t),"updateArray",(function(e,n,a,r,i){t.setState({segments:e,attributes:n,summaries:a,isPiPoint:r},(function(){return t.checkAttributeSegments(n,t.state.segments).then((function(){i&&i()}))}))})),H($(t),"scopedVarsDone",!1),H($(t),"componentDidMount",(function(){t.initialLoad(!1)})),H($(t),"componentDidUpdate",(function(){var e,n,a,r=t.props.query;"Done"===(null===(e=t.props.data)||void 0===e?void 0:e.state)&&null!==(n=t.props.data)&&void 0!==n&&null!==(a=n.request)&&void 0!==a&&a.scopedVars&&!t.scopedVarsDone&&(t.scopedVarsDone=!0,t.initialLoad(!r.isPiPoint))})),H($(t),"initialLoad",(function(e){var n,a,r,i=t.props.query,o=(0,C.defaults)(i,F),l=o.segments,u=o.attributes,s=o.summary,c=o.isPiPoint,m=e?[]:null!==(n=null==l?void 0:l.slice(0))&&void 0!==n?n:[],h=e?[]:null!==(a=null==u?void 0:u.slice(0))&&void 0!==a?a:[],p=null!==(r=null==s?void 0:s.types)&&void 0!==r?r:[];if(c||0!==m.length)c&&m.length>0&&(t.piServer=m);else{if(i.target&&i.target.length>0&&";"!==i.target)return h=[],void t.buildFromTarget(i,m,h).then((function(e){t.updateArray(e,h,p,c)})).catch((function(e){}));m=t.checkAfServer()}t.updateArray(m,h,p,c,(function(){t.onChange(i)}))})),H($(t),"onChange",(function(e){var n,a=t.props,r=a.onChange,i=a.onRunQuery;if(e.summary.types=t.state.summaries,e.rawQuery){if(e.target=null!==(n=e.query)&&void 0!==n?n:"",""!==e.target){var o=e.target.split(";"),l=o[0].split("\\");o.splice(0,1),e.attributes=[],(l.length>1||1===l.length&&""!==l[0])&&(e.elementPath=l.join("\\"),(0,C.each)(o,(function(t,n){""!==t&&e.attributes.push({label:t,value:{value:t,expandable:!1}})})))}}else e.elementPath=t.getSegmentPathUpTo(t.state.segments,t.state.segments.length),e.target=e.elementPath+";"+(0,C.join)(e.attributes.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})),";");r(e),e.target&&e.target.length>0&&e.attributes.length>0&&i()})),H($(t),"stateCallback",(function(){var e=t.props.query;t.onChange(e)})),H($(t),"onIsPiPointChange",(function(e){var n=t.props.query,a=!n.isPiPoint;t.setState({segments:a?[{label:""}]:t.checkAfServer(),attributes:[],isPiPoint:a},(function(){t.onChange(_({},n,{expression:"",attributes:t.state.attributes,segments:t.state.segments,isPiPoint:a}))}))})),t.onSegmentChange=t.onSegmentChange.bind($(t)),t.calcBasisValueChanged=t.calcBasisValueChanged.bind($(t)),t.calcNoDataValueChanged=t.calcNoDataValueChanged.bind($(t)),t.onSummaryAction=t.onSummaryAction.bind($(t)),t.onSummaryValueChanged=t.onSummaryValueChanged.bind($(t)),t.onAttributeAction=t.onAttributeAction.bind($(t)),t.onAttributeChange=t.onAttributeChange.bind($(t)),t.summaryTypes=["Total","Average","Minimum","Maximum","Range","StdDev","PopulationStdDev","Count","PercentGood","All","AllForNonNumeric"],t.calculationBasis=["TimeWeighted","EventWeighted","TimeWeightedContinuous","TimeWeightedDiscrete","EventWeightedExcludeMostRecentEvent","EventWeightedExcludeEarliestEvent","EventWeightedIncludeBothEnds"],t.noDataReplacement=["Null","Drop","Previous","0","Keep"],t}return t=i,(n=[{key:"isValueEmpty",value:function(e){return!e||!e.value||!e.value.length||e.value===X}},{key:"calcBasisValueChanged",value:function(e){var t,n=this.props.query,a=n.summary;a.basis=null===(t=e.value)||void 0===t?void 0:t.value,this.onChange(_({},n,{summary:a}))}},{key:"getCalcBasisSegments",value:function(){return(0,C.map)(this.calculationBasis,(function(e){return{label:e,value:{value:e,expandable:!0}}}))}},{key:"calcNoDataValueChanged",value:function(e){var t,n=this.props.query,a=n.summary;a.nodata=null===(t=e.value)||void 0===t?void 0:t.value,this.onChange(_({},n,{summary:a}))}},{key:"getNoDataSegments",value:function(){return(0,C.map)(this.noDataReplacement,(function(e){return{label:e,value:{value:e,expandable:!0}}}))}},{key:"onSummaryValueChanged",value:function(e,t){var n=this.state.summaries.slice(0);n[t]=e,this.isValueEmpty(e.value)&&n.splice(t,1),this.setState({summaries:n},this.stateCallback)}},{key:"getSummarySegments",value:function(){var e=this,t=(0,C.filter)(this.summaryTypes,(function(t){return-1===e.state.summaries.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).indexOf(t)})),n=(0,C.map)(t,(function(e){return{label:e,value:{value:e,expandable:!0}}}));return n.unshift({label:X,value:{value:X}}),n}},{key:"removeSummary",value:function(e){var t=(0,C.filter)(this.state.summaries,(function(t){return t!==e}));this.setState({summaries:t})}},{key:"onSummaryAction",value:function(e){var t=this.state.summaries.slice(0);if(!this.isValueEmpty(e.value)){var n,a={label:e.label,value:{value:null===(n=e.value)||void 0===n?void 0:n.value,expandable:!0}};t.push(a)}this.setState({summarySegment:{},summaries:t},this.stateCallback)}},{key:"removeAttribute",value:function(e){var t=(0,C.filter)(this.state.attributes,(function(t){return t!==e}));this.attributeChangeValue(t)}},{key:"onAttributeAction",value:function(e){var t=this.props.query,n=this.state.attributes.slice(0);if(!this.isValueEmpty(e.value)){var a,r={label:e.label,value:{value:null===(a=e.value)||void 0===a?void 0:a.value,expandable:!t.isPiPoint}};n.push(r)}this.attributeChangeValue(n)}},{key:"getSegmentPathUpTo",value:function(e,t){var n=e.slice(0,t);return(0,C.reduce)(n,(function(e,t){var n;return t.value?null!==(n=t.value.value)&&void 0!==n&&n.startsWith("-Select")?e:e?e+"\\"+t.value.value:t.value.value:""}),"")}},{key:"checkAttributeSegments",value:function(e,t){var n,a,r=this,i=this.props,o=i.datasource,l=i.data,u=this,s={path:this.getSegmentPathUpTo(t.slice(0),t.length),type:"attributes"};return o.metricFindQuery(s,Object.assign(null!==(n=null==l||null===(a=l.request)||void 0===a?void 0:a.scopedVars)&&void 0!==n?n:{},{isPiPoint:!1})).then((function(t){var n={};(0,C.each)(t,(function(e){n[e.Path.substring(e.Path.indexOf("|")+1)]=e.WebId}));var a=(0,C.filter)(e,(function(e){var t,a=o.templateSrv.replace(null===(t=e.value)||void 0===t?void 0:t.value);return void 0!==n[a]}));u.availableAttributes=n,r.attributeChangeValue(a)})).catch((function(t){u.error=t.message||"Failed to issue metric query",r.attributeChangeValue(e)}))}},{key:"checkPiPointSegments",value:function(e,t){var n,a,r=this.props,i=r.datasource,o=r.data,l=this,u={path:e.path,webId:l.getSelectedPIServer(),pointName:e.label,type:"pipoint"};return i.metricFindQuery(u,Object.assign(null!==(n=null==o||null===(a=o.request)||void 0===a?void 0:a.scopedVars)&&void 0!==n?n:{},{isPiPoint:!0})).then((function(){l.attributeChangeValue(t)})).catch((function(e){l.error=e.message||"Failed to issue metric query",l.attributeChangeValue([])}))}},{key:"getSelectedPIServer",value:function(){var e,t=this,n="";return this.piServer.forEach((function(e){var a=t.props.query.target.split(";");a.length>=2&&a[0]===e.text&&(n=e.WebId)})),this.piServer.length>0?null===(e=this.piServer[0].value)||void 0===e?void 0:e.webId:n}},{key:"textEditorChanged",value:function(){var e=this,t=this.props,n=t.query,a=t.onChange,r=n.target.split(";"),i=r.length>0?r[0].split("\\"):[],o=[],l=[];i.length>1||1===i.length&&""!==i[0]?(r.splice(0,1),(0,C.each)(i,(function(e,t){o.push({label:e,value:{type:e.match(/\${\w+}/gi)?"template":void 0,value:e,expandable:!0}})})),this.getElementSegments(i.length+1,o).then((function(e){e.length>0&&o.push({label:"Select Element",value:{value:"-Select Element-"}})})),(0,C.each)(r,(function(e,t){""!==e&&l.push({label:e,value:{value:e,expandable:!1}})})),this.updateArray(o,l,this.state.summaries,n.isPiPoint,(function(){a(_({},n,{query:void 0,rawQuery:!1}))}))):(o=this.checkAfServer(),this.updateArray(o,this.state.attributes,this.state.summaries,n.isPiPoint,(function(){e.onChange(_({},n,{query:void 0,rawQuery:!1,attributes:e.state.attributes,segments:e.state.segments}))})))}},{key:"render",value:function(){var e=this,t=this.props,n=t.query,a=t.onChange,r=t.onRunQuery,i=(0,C.defaults)(n,F),l=i.interpolate,u=i.query,c=i.rawQuery,m=i.digitalStates,h=i.recordedValues,p=i.expression,d=i.isPiPoint,f=i.summary,v=i.display,b=i.regex;return o().createElement(o().Fragment,null,o().createElement(s.InlineField,{label:"Is Pi Point?",labelWidth:z},o().createElement(s.InlineSwitch,{value:d,onChange:this.onIsPiPointChange})),!!c&&o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Raw Query",labelWidth:z,grow:!0},o().createElement(s.Input,{onBlur:this.stateCallback,value:u,onChange:function(e){return a(_({},i,{query:e.target.value}))},placeholder:"enter query"})),o().createElement(B,{isRaw:!0,onChange:function(t){return e.textEditorChanged()}})),!c&&o().createElement(o().Fragment,null,o().createElement("div",{className:"gf-form-inline"},o().createElement(j,{label:d?"PI Server":"AF Elements",tooltip:d?"Select PI server.":"Select AF Element."},this.state.segments.map((function(t,n){return o().createElement(s.SegmentAsync,{key:"element-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),onChange:function(t){return e.onSegmentChange(t,n)},loadOptions:function(t){return e.getElementSegments(n)},allowCustomValue:!0,inputMinWidth:200})})),R||(R=o().createElement(A,null)),!d&&o().createElement(B,{isRaw:!1,onChange:function(e){a(_({},i,{query:i.target,rawQuery:e}))}}))),o().createElement(k,{label:d?"Pi Points":"Attributes"},this.state.attributes.map((function(t,n){return d?o().createElement(s.SegmentAsync,{key:"attributes-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),disabled:0===e.piServer.length,onChange:function(t){return e.onPiPointChange(t,n)},loadOptions:e.getAttributeSegmentsPI,reloadOptionsOnChange:!0,allowCustomValue:!0,inputMinWidth:J}):o().createElement(s.Segment,{key:"attributes-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),disabled:e.state.segments.length<=2,onChange:function(t){return e.onAttributeChange(t,n)},options:e.getAttributeSegmentsAF(),allowCustomValue:!0,inputMinWidth:J})})),d&&o().createElement(s.SegmentAsync,{Component:o().createElement(Y,{value:this.state.attributeSegment.value,label:this.state.attributeSegment.label}),disabled:0===this.piServer.length,onChange:this.onAttributeAction,loadOptions:this.getAttributeSegmentsPI,reloadOptionsOnChange:!0,allowCustomValue:!0,inputMinWidth:J}),!d&&o().createElement(s.Segment,{Component:o().createElement(Y,{value:this.state.attributeSegment.value,label:this.state.attributeSegment.label}),disabled:this.state.segments.length<=2,onChange:this.onAttributeAction,options:this.getAttributeSegmentsAF(),allowCustomValue:!0,inputMinWidth:J}))),!d&&o().createElement(s.InlineField,{label:"Calculation",labelWidth:z,tooltip:"Modify all attributes by an equation. Use '.' for current item. Leave Attributes empty if you wish to perform element based calculations."},o().createElement(s.Input,{onBlur:r,value:p,onChange:function(t){return e.onChange(_({},i,{expression:t.target.value}))},placeholder:"'.'*2"})),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Max Recorded Values",labelWidth:z,tooltip:"Maximum number of recorded value to retrive from the data archive, without using interpolation."},o().createElement(s.Input,{onBlur:r,value:h.maxNumber,onChange:function(t){return e.onChange(_({},i,{recordedValues:_({},h,{maxNumber:parseInt(t.target.value,10)})}))},type:"number",placeholder:"1000"})),o().createElement(s.InlineField,{label:"Recorded Values",labelWidth:z},o().createElement(s.InlineSwitch,{value:h.enable,onChange:function(){return e.onChange(_({},i,{recordedValues:_({},h,{enable:!h.enable})}))}})),o().createElement(s.InlineField,{label:"Digital States",labelWidth:z},o().createElement(s.InlineSwitch,{value:m.enable,onChange:function(){return e.onChange(_({},i,{digitalStates:_({},m,{enable:!m.enable})}))}}))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Interpolate Period",labelWidth:z,tooltip:"Override time between sampling, e.g. '30s'. Defaults to timespan/chart width."},o().createElement(s.Input,{onBlur:r,value:l.interval,onChange:function(t){return e.onChange(_({},i,{interpolate:_({},l,{interval:t.target.value})}))},placeholder:"30s"})),o().createElement(s.InlineField,{label:"Interpolate",labelWidth:z},o().createElement(s.InlineSwitch,{value:l.enable,onChange:function(){return e.onChange(_({},i,{interpolate:_({},l,{enable:!l.enable})}))}})),o().createElement(s.InlineField,{label:"Replace Bad Data",labelWidth:z,tooltip:"Replacement for bad quality values."},o().createElement(s.Segment,{Component:o().createElement(Y,{value:{value:f.nodata},label:f.nodata}),onChange:this.calcNoDataValueChanged,options:this.getNoDataSegments(),allowCustomValue:!0}))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Summary Period",labelWidth:z,tooltip:"Override time between sampling, e.g. '30s'."},o().createElement(s.Input,{onBlur:r,value:f.interval,onChange:function(e){return a(_({},i,{summary:_({},f,{interval:e.target.value})}))},placeholder:"30s"})),o().createElement(s.InlineField,{label:"Basis",labelWidth:z,tooltip:"Defines the possible calculation options when performing summary calculations over time-series data."},o().createElement(s.Segment,{Component:o().createElement(Y,{value:{value:f.basis},label:f.basis}),onChange:this.calcBasisValueChanged,options:this.getCalcBasisSegments(),allowCustomValue:!0})),o().createElement(s.InlineField,{label:"Summaries",labelWidth:z,tooltip:"Replacement for bad quality values."},o().createElement(s.InlineFieldRow,null,this.state.summaries.map((function(t,n){return o().createElement(s.Segment,{key:"summaries-"+n,Component:o().createElement(Y,{value:t.value,label:t.label}),onChange:function(t){return e.onSummaryValueChanged(t,n)},options:e.getSummarySegments(),allowCustomValue:!0})})),o().createElement(s.Segment,{Component:o().createElement(Y,{value:this.state.summarySegment.value,label:this.state.summarySegment.label}),onChange:this.onSummaryAction,options:this.getSummarySegments(),allowCustomValue:!0})))),o().createElement(s.InlineFieldRow,null,o().createElement(s.InlineField,{label:"Display Name",labelWidth:z,tooltip:"If single attribute, modify display name. Otherwise use regex to modify display name."},o().createElement(s.Input,{onBlur:r,value:v,onChange:function(t){return e.onChange(_({},i,{display:t.target.value}))},placeholder:"Display"})),o().createElement(s.InlineField,{label:"Enable Regex Replace",labelWidth:z},o().createElement(s.InlineSwitch,{value:b.enable,onChange:function(){e.onChange(_({},i,{regex:_({},b,{enable:!b.enable})}))}})),o().createElement(s.InlineField,{label:"Search",labelWidth:16},o().createElement(s.Input,{onBlur:r,value:b.search,onChange:function(t){return e.onChange(_({},i,{regex:_({},b,{search:t.target.value})}))},placeholder:"(.*)"})),o().createElement(s.InlineField,{label:"Replace",labelWidth:16},o().createElement(s.Input,{onBlur:r,value:b.replace,onChange:function(t){return e.onChange(_({},i,{regex:_({},b,{replace:t.target.value})}))},placeholder:"$1"}))))}}])&&G(t.prototype,n),a&&G(t,a),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.PureComponent),Z=l(5);function ee(e){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(e)}function te(){te=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var r=t&&t.prototype instanceof m?t:m,i=Object.create(r.prototype),o=new w(a||[]);return i._invoke=function(e,t,n){var a="suspendedStart";return function(r,i){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===r)throw i;return C()}for(n.method=r,n.arg=i;;){var o=n.delegate;if(o){var l=P(o,n);if(l){if(l===c)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var u=s(e,t,n);if("normal"===u.type){if(a=n.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c={};function m(){}function h(){}function p(){}var d={};l(d,r,(function(){return this}));var f=Object.getPrototypeOf,v=f&&f(f(I([])));v&&v!==t&&n.call(v,r)&&(d=v);var b=p.prototype=m.prototype=Object.create(d);function g(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function a(r,i,o,l){var u=s(e[r],e,i);if("throw"!==u.type){var c=u.arg,m=c.value;return m&&"object"==ee(m)&&n.call(m,"__await")?t.resolve(m.__await).then((function(e){a("next",e,o,l)}),(function(e){a("throw",e,o,l)})):t.resolve(m).then((function(e){c.value=e,o(c)}),(function(e){return a("throw",e,o,l)}))}l(u.arg)}var r;this._invoke=function(e,n){function i(){return new t((function(t,r){a(e,n,t,r)}))}return r=r?r.then(i,i):i()}}function P(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,P(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,c;var r=a.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function I(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function t(){for(;++a=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if("throw"===a.type){var r=a.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:I(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function ne(e,t,n,a,r,i,o){try{var l=e[i](o),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(a,r)}function ae(e,t){for(var n=0;n"+e.Name+": "+t})),{annotation:e,title:(t?"END ":e.showEndTime?"START ":"")+e.name,time:new Date(t?n.EndTime:n.StartTime).getTime(),text:n.Name+r+"
Start: "+n.StartTime+"
End: "+n.EndTime}}},{key:"buildQueryParameters",value:function(e){var t=this;return e.targets=(0,C.filter)(e.targets,(function(e){return!(!e||!e.target||e.target.startsWith("Select AF"))})),e.targets=(0,C.map)(e.targets,(function(n){var a=t,r={target:t.templateSrv.replace(n.elementPath,e.scopedVars),elementPath:t.templateSrv.replace(n.elementPath,e.scopedVars),elementPathArray:[{path:t.templateSrv.replace(n.elementPath,e.scopedVars),variable:""}],attributes:(0,C.map)(n.attributes,(function(n){var a;return t.templateSrv.replace((null===(a=n.value)||void 0===a?void 0:a.value)||n,e.scopedVars)})),segments:(0,C.map)(n.segments,(function(n){var a;return t.templateSrv.replace(null===(a=n.value)||void 0===a?void 0:a.value,e.scopedVars)})),display:n.display,refId:n.refId,hide:n.hide,interpolate:n.interpolate||{enable:!1},recordedValues:n.recordedValues||{enable:!1},digitalStates:n.digitalStates||{enable:!1},webid:n.webid,webids:n.webids||[],regex:n.regex||{enable:!1},expression:n.expression||"",summary:n.summary||{types:[]},startTime:e.range.from,endTime:e.range.to,isPiPoint:n.isPiPoint,scopedVars:e.scopedVars};r.expression&&(r.expression=t.templateSrv.replace(r.expression,e.scopedVars)),void 0!==r.summary.types&&(r.summary.types=(0,C.filter)(r.summary.types,(function(e){return null!=e&&""!==e})));var i=(0,C.keys)(e.scopedVars);return t.templateSrv.getVariables().forEach((function(e){if(a.isAllSelected(e.current)&&i.indexOf(e.name)<0){var t=e.options.filter((function(e){return!e.selected}));r.attributes=r.attributes.map((function(n){return t.map((function(t){return e.allValue?n.replace(e.allValue,t.value):n.replace(/{[a-zA-z0-9,-_]+}/gi,t.value)}))})),r.attributes=(0,C.uniq)((0,C.flatten)(r.attributes)),r.elementPathArray=a.getElementPath(r.elementPathArray,t,e.allValue)}else if(Array.isArray(e.current.text)&&i.indexOf(e.name)<0){var n=e.options.filter((function(e){return e.selected})),o=e.current.value.join(",");r.attributes=r.attributes.map((function(e){return n.map((function(t){return e.replace("{".concat(o,"}"),t.value)}))})),r.attributes=(0,C.uniq)((0,C.flatten)(r.attributes)),r.elementPathArray=a.getElementPath(r.elementPathArray,n,"{".concat(o,"}"))}})),r})),e}},{key:"query",value:(i=te().mark((function t(n){var a,r;return te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=this,(r=this.buildQueryParameters(n)).targets=(0,C.filter)(r.targets,(function(e){return!e.hide})),!(r.targets.length<=0)){t.next=7;break}return t.abrupt("return",Promise.resolve({data:[]}));case 7:return t.abrupt("return",Promise.all(a.getStream(r)).then((function(t){var n=[];return(0,C.each)(t,(function(e){(0,C.each)(e,(function(e){return n.push(e)}))})),{data:n.sort((function(e,t){return+(e.target>t.target)||+(e.target===t.target)-1})).map((function(t){return(0,e.toDataFrame)(t)}))}})));case 8:case"end":return t.stop()}}),t,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,a){var r=i.apply(e,t);function o(e){ne(r,n,a,o,l,"next",e)}function l(e){ne(r,n,a,o,l,"throw",e)}o(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"testDatasource",value:function(){return this.backendSrv.datasourceRequest({url:this.url+"/",method:"GET"}).then((function(e){if(200===e.status)return{status:"success",message:"Data source is working",title:"Success"};throw new Error("Failed")}))}},{key:"annotationQuery",value:function(e){var t=this;if(!this.afdatabase.webid)return Promise.resolve([]);var n=e.annotation.query.categoryName?this.templateSrv.replace(e.annotation.query.categoryName,e.scopedVars,"glob"):null,a=e.annotation.query.nameFilter?this.templateSrv.replace(e.annotation.query.nameFilter,e.scopedVars,"glob"):null,r=e.annotation.template?e.annotation.template.Name:null,i={name:e.annotation.name,datasource:e.annotation.datasource,enable:e.annotation.enable,iconColor:e.annotation.iconColor,showEndTime:e.annotation.showEndTime,regex:e.annotation.regex,attribute:e.annotation.attribute,categoryName:n,templateName:r,nameFilter:a},o=[];if(i.categoryName&&o.push("categoryName="+i.categoryName),i.nameFilter&&o.push("nameFilter="+i.nameFilter),i.templateName&&o.push("templateName="+i.templateName),!o.length)return Promise.resolve([]);if(o.push("startTime="+e.range.from.toJSON()),o.push("endTime="+e.range.to.toJSON()),i.attribute&&i.attribute.enable){var l=this.piwebapiurl+"/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name";i.attribute.name&&(l=this.piwebapiurl+"/streamsets/{0}/value?nameFilter="+i.attribute.name+"&selectedFields=Items.WebId%3BItems.Value%3BItems.Name");var u={};return u[1]={Method:"GET",Resource:this.piwebapiurl+"/assetdatabases/"+this.afdatabase.webid+"/eventframes?"+o.join("&")},u[2]={Method:"GET",RequestTemplate:{Resource:l},Parameters:["$.1.Content.Items[*].WebId"],ParentIds:["1"]},this.restBatch(u).then((function(n){var a=n.data[1].Content,r=n.data[2].Content,o=(0,C.map)(a.Items,(function(e,n){return(0,C.curry)(t.eventFrameToAnnotation)(i,!1,e,r.Items[n].Content.Items)}));if(e.annotation.showEndTime){var l=(0,C.map)(a.Items,(function(e,n){return(0,C.curry)(t.eventFrameToAnnotation)(i,!0,e,r.Items[n].Content.Items)}));(0,C.each)(l,(function(e){o.push(e)}))}return o}))}return this.restGet("/assetdatabases/"+this.afdatabase.webid+"/eventframes?"+o.join("&")).then((function(n){var a=(0,C.map)(n.data.Items,(0,C.curry)(t.eventFrameToAnnotation)(i,!1));if(e.annotation.showEndTime){var r=(0,C.map)(n.data.Items,(0,C.curry)(t.eventFrameToAnnotation)(i,!0));(0,C.each)(r,(function(e){a.push(e)}))}return a}))}},{key:"metricQueryTransform",value:function(e){return(0,C.map)(e,(function(e){var t,n;return{text:e.Name,expandable:void 0===e.HasChildren||!0===e.HasChildren||(null!==(t=e.Path)&&void 0!==t?t:"").split("\\").length<=3,HasChildren:e.HasChildren,Items:null!==(n=e.Items)&&void 0!==n?n:[],Path:e.Path,WebId:e.WebId}}))}},{key:"metricFindQuery",value:function(e,t){var n,a,r=this,i=["servers","databases","databaseElements","elements"];return"string"==typeof e&&(e=JSON.parse(e)),t.isPiPoint?e.path=this.templateSrv.replace(e.path,t):(""===e.path?e.type=i[0]:"attributes"!==e.type&&(e.type=i[Math.max(0,Math.min(e.path.split("\\").length,i.length-1))]),e.path=this.templateSrv.replace(e.path,t),e.path=e.path.replace(/\{([^\\])*\}/gi,(function(e){return e.substring(1,e.length-2).split(",")[0]}))),e.filter=null!==(n=e.filter)&&void 0!==n?n:"*","servers"===e.type?null!==(a=r.afserver)&&void 0!==a&&a.name?r.getAssetServer(r.afserver.name).then((function(e){return[e]})).then(r.metricQueryTransform):r.getAssetServers().then(r.metricQueryTransform):"databases"===e.type?r.getAssetServer(e.path).then((function(e){var t;return r.getDatabases(null!==(t=e.WebId)&&void 0!==t?t:"",{})})).then(r.metricQueryTransform):"databaseElements"===e.type?r.getDatabase(e.path).then((function(e){var t;return r.getDatabaseElements(null!==(t=e.WebId)&&void 0!==t?t:"",{selectedFields:"Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren"})})).then(r.metricQueryTransform):"elements"===e.type?r.getElement(e.path).then((function(t){var n;return r.getElements(null!==(n=t.WebId)&&void 0!==n?n:"",{selectedFields:"Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren",nameFilter:e.filter})})).then(r.metricQueryTransform):"attributes"===e.type?r.getElement(e.path).then((function(t){var n;return r.getAttributes(null!==(n=t.WebId)&&void 0!==n?n:"",{searchFullHierarchy:"true",selectedFields:"Items.WebId%3BItems.Name%3BItems.Path",nameFilter:e.filter})})).then(r.metricQueryTransform):"dataserver"===e.type?r.getDataServers().then(r.metricQueryTransform):"pipoint"===e.type?r.piPointSearch(e.webId,e.pointName).then(r.metricQueryTransform):Promise.reject("Bad type")}},{key:"getSummaryUrl",value:function(e){return""===e.interval.trim()?"&summaryType="+e.types.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).join("&summaryType=")+"&calculationBasis="+e.basis:"&summaryType="+e.types.map((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.value})).join("&summaryType=")+"&calculationBasis="+e.basis+"&summaryDuration="+e.interval.trim()}},{key:"parsePiPointValueList",value:function(e,t,n){var a=this,r=this,i=[];return(0,C.each)(e,(function(e){var o=a.noDataReplace(n?e.Value:e,t.summary.nodata,r.parsePiPointValue(n?e.Value:e,t,n)),l=o.grafanaDataPoint;o.previousValue,o.drop||i.push(l)})),i}},{key:"parsePiPointValue",value:function(e,t,n){var a,r,i,o,l=n||"object"!==ee(e.Value)?e.Value:null===(a=e.Value)||void 0===a?void 0:a.Value;return!e.Good||null!==(r=t.digitalStates)&&void 0!==r&&r.enable?(l=null!==(i=n||"object"!==ee(e.Value)?e.Name:null===(o=e.Value)||void 0===o?void 0:o.Name)&&void 0!==i?i:"",[this.checkNumber(l)?Number(l):l.trim(),new Date(e.Timestamp).getTime()]):[this.checkNumber(l)?Number(l):l.trim(),new Date(e.Timestamp).getTime()]}},{key:"noDataReplace",value:function(e,t,n){var a,r,i=null,o=!1;return!e.Good||"No Data"===e.Value||null!==(a=e.Value)&&void 0!==a&&a.Name&&"No Data"===(null===(r=e.Value)||void 0===r?void 0:r.Name)?"Drop"===t?o=!0:"0"===t?n[0]=0:"Keep"===t||("Null"===t?n[0]=null:"Previous"===t&&null!==i&&(n[0]=i)):i=e.Value,{grafanaDataPoint:n,previousValue:i,drop:o}}},{key:"processResults",value:function(e,t,n,a){var r=this,i=t.summary&&t.summary.types&&t.summary.types.length>0;if(n=a?n:this.getPath(t.elementPathArray,e.Path)+"|"+n,t.regex&&t.regex.enable&&t.regex.search.length&&t.regex.replace.length&&(n=n.replace(new RegExp(t.regex.search),t.regex.replace)),i){var o=[],l=(0,C.groupBy)(e.Items,(function(e){return e.Type}));return(0,C.forOwn)(l,(function(e,a){o.push({refId:t.refId,target:n+"["+a+"]",datapoints:r.parsePiPointValueList(e,t,i)})})),o}return[{refId:t.refId,target:n,datapoints:r.parsePiPointValueList(e.Items,t,i)}]}},{key:"isAllSelected",value:function(e){return!!e&&(Array.isArray(e.text)?e.text.indexOf("All")>=0:"All"===e.text)}},{key:"checkNumber",value:function(e){return"number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)}},{key:"getElementPath",value:function(e,t,n){var a=[];return e.forEach((function(e){if(n&&e.path.indexOf(n)>=0||!n&&e.path.match(/{[a-zA-z0-9,-_]+}/gi)){var r=t.map((function(t){return{path:n?e.path.replace(n,t.value):e.path.replace(/{[a-zA-z0-9,-_]+}/gi,t.value),variable:t.value}}));a=a.concat(r)}})),a.length?(0,C.uniq)((0,C.flatten)(a)):e}},{key:"getPath",value:function(e,t){var n,a,r=t.split("|");if(0===r.length)return"";if(0===e.length)return"";var i=0===(r=r[0].split("\\")).length?"":null!==(n=r.pop())&&void 0!==n?n:"",o=null===(a=e.find((function(e){return t.indexOf(e.path)>=0})))||void 0===a?void 0:a.variable;return o?o+"|"+i:i}},{key:"getStream",value:function(e){var t=this,n=this,a=[];return(0,C.each)(e.targets,(function(r){r.attributes=(0,C.filter)(r.attributes||[],(function(e){return e}));var i="",o=r.summary&&r.summary.types&&r.summary.types.length>0,l=r.interpolate&&r.interpolate.enable,u=r.interpolate.interval?r.interpolate.interval:e.interval,s="?startTime="+e.range.from.toJSON()+"&endTime="+e.range.to.toJSON(),c=r.expression||r.elementPath,m=r.display?t.templateSrv.replace(r.display,e.scopedVars):null;if(r.expression)i+="/calculation",i+=o?"/summary"+s+(l?"&sampleType=Interval&sampleInterval="+u:""):"/intervals"+s+"&sampleInterval="+u,i+="&expression="+encodeURIComponent(r.expression),r.attributes.length>0?a.push(n.internalStream(e,r,i)):a.push(n.restGetWebId(r.elementPath,r.isPiPoint).then((function(e){return n.restPost(i+e.WebId).then((function(e){return n.processResults(e.data,r,m||c,!1)})).catch((function(e){return n.error=e}))})));else{if(i+="/streamsets",o)i+="/summary"+s+"&intervals="+e.maxDataPoints+t.getSummaryUrl(r.summary);else if(r.interpolate&&r.interpolate.enable)i+="/interpolated"+s+"&interval="+u;else if(r.recordedValues&&r.recordedValues.enable){var h=r.recordedValues.maxNumber&&!isNaN(r.recordedValues.maxNumber)?r.recordedValues.maxNumber:1e3;i+="/recorded"+s+"&maxCount="+h}else i+="/plot"+s+"&intervals="+e.maxDataPoints;a.push(n.internalStream(e,r,i))}})),a}},{key:"internalStream",value:function(e,t,n){var a=this,r=t.expression||t.elementPath,i=t.display?this.templateSrv.replace(t.display,e.scopedVars):null,o=1===t.elementPathArray.length&&t.elementPath===t.elementPathArray[0].path;return(o?t.attributes.length>1&&!t.isPiPoint?a.restGetWebId(t.elementPath,t.isPiPoint).then((function(e){return a.getAttributes(e.WebId,{searchFullHierarchy:"true",nameFilter:"*"})})).then((function(e){return e.filter((function(e){var n;return t.attributes.indexOf(e.Name)>=0||t.attributes.indexOf(null===(n=e.Path)||void 0===n?void 0:n.split("|").splice(1).join("|"))>=0}))})):Promise.all((0,C.map)(t.attributes,(function(e){return a.restGetWebId(t.elementPath+"|"+e,t.isPiPoint)}))):t.attributes.length>1&&!t.isPiPoint?Promise.all(t.elementPathArray.map((function(e){return a.restGetWebId(e.path,t.isPiPoint).then((function(e){return a.getAttributes(e.WebId,{searchFullHierarchy:"true",nameFilter:"*"})})).then((function(e){return e.filter((function(e){var n;return t.attributes.indexOf(e.Name)>=0||t.attributes.indexOf(null===(n=e.Path)||void 0===n?void 0:n.split("|").splice(1).join("|"))>=0}))}))}))):Promise.all((0,C.flatten)((0,C.map)(t.attributes,(function(e){return t.elementPathArray.map((function(n){return a.restGetWebId(n.path+"|"+e,t.isPiPoint)}))}))))).then((function(e){var l={};return(0,C.each)((0,C.flatten)(e),(function(e,t){l[t+1]={Method:"GET",Resource:a.piwebapiurl+n+"&webid="+e.WebId}})),a.restBatch(l).then((function(n){var l=[];return(0,C.each)(n.data,(function(n,u){if(t.expression){var s=e[parseInt(u,10)-1].Name;(0,C.each)(a.processResults(n.Content,t,i||s||r,o),(function(e){return l.push(e)}))}else(0,C.each)(n.Content.Items,(function(e){(0,C.each)(a.processResults(e,t,i||e.Name||r,o),(function(e){return l.push(e)}))}))})),l})).catch((function(e){return a.error=e}))}))}},{key:"restGet",value:function(e){return this.backendSrv.datasourceRequest({url:this.url+e,method:"GET",headers:{"Content-Type":"application/json"}}).then((function(e){return e}))}},{key:"restGetWebId",value:function(e,t){var n=this,a=n.webidCache.get(e);if(a)return Promise.resolve({Path:e,WebId:a.WebId,Name:a.Name});var r="";return r=t?"/points?selectedFields=WebId%3BName%3BPath&path=\\\\"+e.replace("|","\\"):(e.indexOf("|")>=0?"/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\":"/elements?selectedFields=WebId%3BName%3BPath&path=\\\\")+e,this.backendSrv.datasourceRequest({url:this.url+r,method:"GET",headers:{"Content-Type":"application/json"}}).then((function(t){return n.webidCache.set(e,t.data),{Path:e,WebId:t.data.WebId,Name:t.data.Name}}))}},{key:"restBatch",value:function(e){return this.backendSrv.datasourceRequest({url:this.url+"/batch",data:e,method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"message/http"}})}},{key:"restPost",value:function(e){return this.backendSrv.datasourceRequest({url:this.url,method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"message/http","X-PIWEBAPI-HTTP-METHOD":"GET","X-PIWEBAPI-RESOURCE-ADDRESS":e}})}},{key:"getDataServers",value:function(){return this.restGet("/dataservers").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getDataServer",value:function(e){return e?this.restGet("/dataservers?name="+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getAssetServers",value:function(){return this.restGet("/assetservers").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getAssetServer",value:function(e){return e?this.restGet("/assetservers?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getDatabase",value:function(e){return e?this.restGet("/assetdatabases?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getDatabases",value:function(e,t){return e?this.restGet("/assetservers/"+e+"/assetdatabases").then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]})):Promise.resolve([])}},{key:"getElement",value:function(e){return e?this.restGet("/elements?path=\\\\"+e).then((function(e){return e.data})):Promise.resolve({})}},{key:"getEventFrameTemplates",value:function(e){return e?this.restGet("/assetdatabases/"+e+"/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId").then((function(e){var t;return(0,C.filter)(null!==(t=e.data.Items)&&void 0!==t?t:[],(function(e){return"EventFrame"===e.InstanceType}))})):Promise.resolve([])}},{key:"getElementTemplates",value:function(e){return e?this.restGet("/assetdatabases/"+e+"/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId").then((function(e){var t;return(0,C.filter)(null!==(t=e.data.Items)&&void 0!==t?t:[],(function(e){return"Element"===e.InstanceType}))})):Promise.resolve([])}},{key:"getAttributes",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/elements/"+e+"/attributes"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getDatabaseElements",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/assetdatabases/"+e+"/elements"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"getElements",value:function(e,t){var n="?"+(0,C.map)(t,(function(e,t){return t+"="+e})).join("&");return"?"===n&&(n=""),this.restGet("/elements/"+e+"/elements"+n).then((function(e){var t;return null!==(t=e.data.Items)&&void 0!==t?t:[]}))}},{key:"piPointSearch",value:function(e,t){var n=this.templateSrv.replace(t),a="".concat(n),r=!1;if(n!==t)for(var i,o=/\{(\w|,)+\}/g;null!==(i=o.exec(n));)i.index===o.lastIndex&&o.lastIndex++,i.forEach((function(e,t){0===t&&(n=n.replace(e,e.replace("{","(").replace("}",")").replace(",","|")),a=a.replace(e,"*"),r=!0)}));return this.restGet("/dataservers/"+e+"/points?maxCount=20&nameFilter="+a).then((function(e){var t;return e&&null!==(t=e.data)&&void 0!==t&&t.Items?r?e.data.Items.filter((function(e){var t;return null===(t=e.Name)||void 0===t?void 0:t.match(n)})):e.data.Items:[]}))}},{key:"getWebId",value:function(e){var t=this,n=e.target.indexOf("\\")>=0,a=e.target.indexOf("|")>=0;return n||-1!==e.target.indexOf(".")?n?n&&a?t.restGet("/attributes?path=\\\\"+e.target).then((function(t){return void 0===t.data||200!==t.status?[{WebId:e.target,Name:e.display||e.target}]:(t.data.Name=e.display||t.data.Name,[t.data])})):t.restGet("/elements?path=\\\\"+e.target).then((function(t){return void 0===t.data||200!==t.status?[{WebId:e.target,Name:e.display||e.target}]:(t.data.Name=e.display||t.data.Name,[t.data])})):t.piPointSearch(this.piserver.webid,e.target).then((function(t){return void 0===t||0===t.length?[{WebId:e.target,Name:e.display||e.target}]:t})):Promise.resolve([{WebId:e.target,Name:e.display||e.target}])}}],a&&ae(n.prototype,a),r&&ae(n,r),Object.defineProperty(n,"prototype",{writable:!1}),u}(e.DataSourceApi),me=new e.DataSourcePlugin(ce).setConfigEditor(I).setQueryEditor(K).setAnnotationQueryCtrl(a)})(),u})())); //# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/dist/module.js.map b/dist/module.js.map index e89170d..7e16ae4 100644 --- a/dist/module.js.map +++ b/dist/module.js.map @@ -1 +1 @@ -{"version":3,"file":"module.js","mappings":";uHAAAA,EAAOC,QAAUC,OCAjBF,EAAOC,QAAUE,OCAjBH,EAAOC,QAAUG,OCAjBJ,EAAOC,QAAUI,QCAjBL,EAAOC,QAA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xB7L,IAEC8L,gBAAgB/Y,GAChBgZ,eAAezU,GACf0U,uBAAuBhb","sources":["webpack:///external amd \"react\"","webpack:///external amd \"@grafana/ui\"","webpack:///external amd \"@grafana/data\"","webpack:///external amd \"lodash\"","webpack:///external amd \"@grafana/runtime\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./AnnotationsQueryCtrl.ts","webpack:///./ConfigEditor.tsx","webpack:///./components/Forms.tsx","webpack:///./types.ts","webpack:///./components/QueryEditorModeSwitcher.tsx","webpack:///./QueryEditor.tsx","webpack:///./datasource.ts","webpack:///./module.ts"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export class AnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n\n $scope: any;\n annotation: any;\n datasource: any;\n\n /** @ngInject */\n constructor($scope: any) {\n this.$scope = $scope;\n this.annotation = $scope.ctrl.annotation;\n this.datasource = $scope.ctrl.datasource;\n\n // load defaults\n this.annotation.query = this.annotation.query || {};\n this.annotation.databases = this.annotation.databases || [];\n this.annotation.templates = this.annotation.templates || [];\n this.annotation.regex = this.annotation.regex || {};\n this.annotation.attribute = this.annotation.attribute || {};\n this.annotation.showEndTime = this.annotation.showEndTime || false;\n\n this.datasource.getAssetServer(this.datasource.afserver.name).then((result: any) => {\n return this.getDatabases(result.WebId);\n });\n }\n templateChanged() {\n // do nothing\n }\n databaseChanged() {\n this.annotation.templates = [];\n this.getEventFrames();\n }\n getDatabases(webid: string) {\n var ctrl = this;\n ctrl.datasource.getDatabases(webid).then((dbs: any) => {\n ctrl.annotation.databases = dbs;\n this.$scope.$apply();\n });\n }\n getEventFrames() {\n var ctrl = this;\n ctrl.datasource.getEventFrameTemplates(this.annotation.database.WebId).then((templates: any) => {\n ctrl.annotation.templates = templates;\n this.$scope.$apply();\n });\n }\n}\n","import React, { ChangeEvent, PureComponent } from 'react';\nimport { LegacyForms, DataSourceHttpSettings } from '@grafana/ui';\nimport { DataSourcePluginOptionsEditorProps, DataSourceJsonData, DataSourceSettings } from '@grafana/data';\nimport { PIWebAPIDataSourceJsonData } from './types';\n\nconst { FormField } = LegacyForms;\n\ninterface Props extends DataSourcePluginOptionsEditorProps {}\n\nconst coerceOptions = (\n options: DataSourceSettings\n): DataSourceSettings => {\n return {\n ...options,\n jsonData: {\n ...options.jsonData,\n url: options.url,\n },\n };\n};\n\ninterface State {}\n\nexport class PIWebAPIConfigEditor extends PureComponent {\n onPIServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n piserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFDatabaseChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afdatabase: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onMyOptionsChange = (options: DataSourceSettings) => {\n const { onOptionsChange } = this.props;\n onOptionsChange(coerceOptions(options));\n };\n\n render() {\n const { options: originalOptions } = this.props;\n const options = coerceOptions(originalOptions);\n\n return (\n
\n \n\n

PI/AF Connection Details

\n\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n );\n }\n}\n","import React, { InputHTMLAttributes, FunctionComponent } from 'react';\nimport { InlineFormLabel } from '@grafana/ui';\n\nexport interface Props extends InputHTMLAttributes {\n label: string;\n tooltip?: string;\n labelWidth?: number;\n children?: React.ReactNode;\n queryEditor?: JSX.Element;\n}\n\nexport const QueryField: FunctionComponent> = ({ label, labelWidth = 12, tooltip, children }) => (\n <>\n \n {label}\n \n {children}\n \n);\n\nexport const QueryRowTerminator = () => {\n return (\n
\n
\n
\n );\n};\n\nexport const QueryInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryEditorRow = (props: Partial) => {\n return (\n
\n {props.children}\n \n
\n );\n};\n\nexport const QueryRawInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryRawEditorRow = (props: Partial) => {\n return <>{props.children};\n};\n","import { DataQuery, DataSourceJsonData } from '@grafana/data';\n\nexport interface PIWebAPISelectableValue {\n webId?: string;\n value?: string;\n type?: string;\n expandable?: boolean;\n}\n\nexport interface PIWebAPIAnnotationsQuery extends DataQuery {\n target: string;\n}\n\nexport interface PIWebAPIQuery extends DataQuery {\n target: string;\n elementPath: string;\n attributes: any[];\n segments: any[];\n display: any;\n interpolate: any;\n recordedValues: any;\n digitalStates: any;\n webid: string;\n webids: string[];\n regex: any;\n summary: any;\n expression: string;\n isPiPoint: boolean;\n rawQuery?: boolean;\n query?: string;\n}\n\nexport const defaultQuery: Partial = {\n target: ';',\n attributes: [],\n segments: [],\n regex: { enable: false },\n summary: { types: [], basis: 'EventWeighted', interval: '', nodata: 'Null' },\n expression: '',\n interpolate: { enable: false },\n recordedValues: { enable: false },\n digitalStates: { enable: false },\n isPiPoint: false,\n};\n\n/**\n * These are options configured for each DataSource instance\n */\nexport interface PIWebAPIDataSourceJsonData extends DataSourceJsonData {\n url?: string;\n access?: string;\n piserver?: string;\n afserver?: string;\n afdatabase?: string;\n}\n\n/**\n * Value that is used in the backend, but never sent over HTTP to the frontend\n */\nexport interface PIWebAPISecureJsonData {\n apiKey?: string;\n}\n","import React, { useEffect, useState } from 'react';\nimport { Button, ConfirmModal } from '@grafana/ui';\n\ntype Props = {\n isRaw: boolean;\n onChange: (newIsRaw: boolean) => void;\n};\n\nexport const QueryEditorModeSwitcher = ({ isRaw, onChange }: Props): JSX.Element => {\n const [isModalOpen, setModalOpen] = useState(false);\n\n useEffect(() => {\n // if the isRaw changes, we hide the modal\n setModalOpen(false);\n }, [isRaw]);\n\n if (isRaw) {\n return (\n <>\n {\n // we show the are-you-sure modal\n setModalOpen(true);\n }}\n >\n {\n onChange(false);\n }}\n onDismiss={() => {\n setModalOpen(false);\n }}\n />\n \n );\n } else {\n return (\n {\n onChange(true);\n }}\n >\n );\n }\n};\n","import { each, filter, forOwn, join, reduce, map, slice, remove, defaults } from 'lodash';\n\nimport React, { PureComponent, ChangeEvent } from 'react';\nimport { Icon, InlineField, InlineFieldRow, InlineSwitch, Input, SegmentAsync, Segment } from '@grafana/ui';\nimport { QueryEditorProps, SelectableValue, VariableModel } from '@grafana/data';\n\nimport { PiWebAPIDatasource } from './datasource';\nimport { QueryInlineField, QueryRawInlineField, QueryRowTerminator } from './components/Forms';\nimport { PIWebAPISelectableValue, PIWebAPIDataSourceJsonData, PIWebAPIQuery, defaultQuery } from './types';\nimport { QueryEditorModeSwitcher } from 'components/QueryEditorModeSwitcher';\n\nconst LABEL_WIDTH = 24;\nconst MIN_ELEM_INPUT_WIDTH = 200;\nconst MIN_ATTR_INPUT_WIDTH = 250;\n\ninterface State {\n isPiPoint: boolean;\n segments: Array>;\n attributes: Array>;\n summaries: Array>;\n attributeSegment: SelectableValue;\n summarySegment: SelectableValue;\n calculationBasisSegment: SelectableValue;\n noDataReplacementSegment: SelectableValue;\n}\n\ntype Props = QueryEditorProps;\n\nconst REMOVE_LABEL = '-REMOVE-';\n\nconst CustomLabelComponent = (props: any) => {\n if (props.value) {\n return (\n
\n {props.label ?? '--no label--'}\n
\n );\n }\n return (\n \n \n \n );\n};\n\nexport class PIWebAPIQueryEditor extends PureComponent {\n error: any;\n piServer: any[] = [];\n availableAttributes: any = {};\n summaryTypes: string[];\n calculationBasis: string[];\n noDataReplacement: string[];\n state: State = {\n isPiPoint: false,\n segments: [],\n attributes: [],\n summaries: [],\n attributeSegment: {},\n summarySegment: {},\n calculationBasisSegment: {},\n noDataReplacementSegment: {},\n };\n\n constructor(props: any) {\n super(props);\n this.onSegmentChange = this.onSegmentChange.bind(this);\n this.calcBasisValueChanged = this.calcBasisValueChanged.bind(this);\n this.calcNoDataValueChanged = this.calcNoDataValueChanged.bind(this);\n this.onSummaryAction = this.onSummaryAction.bind(this);\n this.onSummaryValueChanged = this.onSummaryValueChanged.bind(this);\n this.onAttributeAction = this.onAttributeAction.bind(this);\n this.onAttributeChange = this.onAttributeChange.bind(this);\n\n this.summaryTypes = [\n // 'None', // A summary type is not specified.\n 'Total', // A totalization over the time range.\n 'Average', // The average value over the time range.\n 'Minimum', // The minimum value over the time range.\n 'Maximum', // The maximum value over the time range.\n 'Range', // The range value over the time range (minimum-maximum).\n 'StdDev', // The standard deviation over the time range.\n 'PopulationStdDev', // The population standard deviation over the time range.\n 'Count', // The sum of event count over the time range when calculation basis is event weighted. The sum of event time duration over the time range when calculation basis is time weighted.\n 'PercentGood', // Percent of data with good value during the calculation period. For time weighted calculations, the percentage is based on time. For event weighted calculations, the percent is based on event count.\n 'All', // A convenience for requesting all available summary calculations.\n 'AllForNonNumeric', // A convenience for requesting all available summary calculations for non-numeric data.\n ];\n\n this.calculationBasis = [\n 'TimeWeighted', // Weight the values in the calculation by the time over which they apply. Interpolation is based on whether the attribute is stepped. Interpolated events are generated at the boundaries if necessary.\n 'EventWeighted', // Evaluate values with equal weighting for each event. No interpolation is done. There must be at least one event within the time range to perform a successful calculation. Two events are required for standard deviation. In handling events at the boundary of the calculation, the AFSDK uses following rules:\n 'TimeWeightedContinuous', // Apply weighting as in TimeWeighted, but do all interpolation between values as if they represent continuous data, (standard interpolation) regardless of whether the attribute is stepped.\n 'TimeWeightedDiscrete', // Apply weighting as in TimeWeighted but interpolation between values is performed as if they represent discrete, unrelated values (stair step plot) regardless of the attribute is stepped.\n 'EventWeightedExcludeMostRecentEvent', // The calculation behaves the same as _EventWeighted_, except in the handling of events at the boundary of summary intervals in a multiple intervals calculation. Use this option to prevent events at the intervals boundary from being double count at both intervals. With this option, events at the end time (most recent time) of an interval is not used in that interval.\n 'EventWeightedExcludeEarliestEvent', // Similar to the option _EventWeightedExcludeMostRecentEvent_. Events at the start time(earliest time) of an interval is not used in that interval.\n 'EventWeightedIncludeBothEnds', // Events at both ends of the interval boundaries are included in the event weighted calculation.\n ];\n\n this.noDataReplacement = [\n 'Null', // replace with nulls\n 'Drop', // drop items\n 'Previous', // use previous value if available\n '0', // replace with 0\n 'Keep', // Keep value\n ];\n }\n\n // is selected segment empty\n isValueEmpty(value: PIWebAPISelectableValue | undefined) {\n return !value || !value.value || !value.value.length || value.value === REMOVE_LABEL;\n }\n\n segmentChangeValue = (segments: Array>) => {\n const query = this.props.query;\n this.setState({ segments }, () => this.onChange({ ...query, segments }));\n };\n\n attributeChangeValue = (attributes: Array>) => {\n const query = this.props.query;\n this.setState({ attributes }, () => this.onChange({ ...query, attributes }));\n };\n\n // summary calculation basis change event\n calcBasisValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.basis = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get summary calculation basis user interface segments\n getCalcBasisSegments() {\n const segments = map(this.calculationBasis, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // no data change event\n calcNoDataValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.nodata = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get no data user interface segments\n getNoDataSegments() {\n var segments = map(this.noDataReplacement, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // summary query change event\n onSummaryValueChanged(item: SelectableValue, index: number) {\n const summaries = this.state.summaries.slice(0) as Array>;\n summaries[index] = item;\n if (this.isValueEmpty(item.value)) {\n summaries.splice(index, 1);\n }\n this.setState({ summaries }, this.stateCallback);\n }\n // get the list of summaries available\n getSummarySegments() {\n const ctrl = this;\n const summaryTypes = filter(ctrl.summaryTypes, (type) => {\n return this.state.summaries.map((s) => s.value?.value).indexOf(type) === -1;\n });\n var segments = map(summaryTypes, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n }\n\n // remove a summary from the user interface and the query\n removeSummary(part: SelectableValue) {\n const summaries = filter(this.state.summaries, (item: SelectableValue) => {\n return item !== part;\n });\n this.setState({ summaries });\n }\n // add a new summary to the query\n onSummaryAction(item: SelectableValue) {\n const summaries = this.state.summaries.slice(0) as Array>;\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: true,\n },\n };\n summaries.push(selectableValue);\n }\n this.setState({ summarySegment: {}, summaries }, this.stateCallback);\n }\n\n // remove an attribute from the query\n removeAttribute(part: SelectableValue) {\n const attributes = filter(this.state.attributes, (item: SelectableValue) => {\n return item !== part;\n });\n this.attributeChangeValue(attributes);\n }\n // add an attribute to the query\n onAttributeAction(item: SelectableValue) {\n const { query } = this.props;\n const attributes = this.state.attributes.slice(0);\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: !query.isPiPoint,\n },\n };\n attributes.push(selectableValue);\n }\n this.attributeChangeValue(attributes);\n }\n\n // pi point change event\n onPiPointChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n remove(attributes, (value, n) => n === index);\n } else {\n // set current value\n attributes[index] = item;\n }\n\n this.checkPiPointSegments(item, attributes);\n };\n // attribute change event\n onAttributeChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n // set current value\n attributes[index] = item;\n\n this.checkAttributeSegments(attributes, this.state.segments);\n };\n // segment change\n onSegmentChange = (item: SelectableValue, index: number) => {\n const { query } = this.props;\n let segments = this.state.segments.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n segments = slice(segments, 0, index);\n this.checkAttributeSegments([], segments);\n if (segments.length === 0) {\n segments.push({\n label: '',\n });\n } else if (!!segments[segments.length - 1].value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n if (query.isPiPoint) {\n this.piServer = [];\n }\n this.segmentChangeValue(segments);\n return;\n }\n\n // set current value\n segments[index] = item;\n\n // Accept only one PI server\n if (query.isPiPoint) {\n this.piServer.push(item);\n this.segmentChangeValue(segments);\n return;\n }\n\n // changed internal selection\n if (index < segments.length - 1) {\n segments = slice(segments, 0, index + 1);\n }\n this.checkAttributeSegments([], segments);\n // add new options\n if (!!item.value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n this.segmentChangeValue(segments);\n };\n\n // get a ui segment for the attributes\n getElementSegments = (\n index: number,\n currentSegment?: Array>\n ): Promise>> => {\n const { datasource, query, data } = this.props;\n var ctrl = this;\n var findQuery = query.isPiPoint\n ? { type: 'dataserver' }\n : { path: this.getSegmentPathUpTo(currentSegment ?? this.state.segments.slice(0), index) };\n\n if (!query.isPiPoint) {\n if (datasource.afserver?.name && index === 0) {\n return Promise.resolve([\n {\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n },\n ]);\n }\n if (datasource.afserver?.name && datasource.afdatabase?.name && index === 1) {\n return Promise.resolve([\n {\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n },\n ]);\n }\n\n // if (!findQuery.path?.length) {\n // return Promise.resolve([]);\n // }\n }\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n var altSegments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n label: item.text,\n value: {\n webId: item.WebId,\n value: item.text,\n expandable: !query.isPiPoint && item.expandable,\n },\n };\n return selectableValue;\n });\n\n if (altSegments.length === 0) {\n return altSegments;\n }\n\n // add template variables\n const variables = datasource.templateSrv.getVariables();\n each(variables, (variable: VariableModel) => {\n let selectableValue: SelectableValue = {\n label: '${' + variable.name + '}',\n value: {\n type: 'template',\n value: '${' + variable.name + '}',\n expandable: !query.isPiPoint,\n },\n };\n altSegments.unshift(selectableValue);\n });\n\n altSegments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return altSegments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return [];\n });\n };\n\n // get the list of attributes for the user interface - PI\n getAttributeSegmentsPI = (attributeText?: string): Promise>> => {\n const { datasource, query, data } = this.props;\n const ctrl = this;\n const findQuery = {\n path: '',\n webId: this.getSelectedPIServer(),\n pointName: (attributeText ?? '') + '*',\n type: 'pipoint',\n };\n let segments: Array> = [];\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n segments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n path: item.Path,\n label: item.text,\n value: {\n value: item.text,\n expandable: false,\n },\n };\n return selectableValue;\n });\n segments.unshift({\n label: attributeText,\n value: {\n value: attributeText,\n expandable: false,\n },\n });\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n return segments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return segments;\n });\n };\n\n // get the list of attributes for the user interface - AF\n getAttributeSegmentsAF = (attributeText?: string): Array> => {\n const ctrl = this;\n let segments: Array> = [];\n\n forOwn(ctrl.availableAttributes, (val: any, key: string) => {\n let selectableValue: SelectableValue = {\n label: key,\n value: {\n value: key,\n expandable: true,\n },\n };\n segments.push(selectableValue);\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n };\n\n // build data from target string\n buildFromTarget = (\n query: PIWebAPIQuery,\n segmentsArray: Array>,\n attributesArray: Array>\n ) => {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segmentsArray.push({\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n });\n });\n each(splitAttributes, (item, _) => {\n if (item !== '') {\n // set current value\n attributesArray.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n return this.getElementSegments(splitElements.length + 1, segmentsArray).then((elements) => {\n if (elements.length > 0) {\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n return segmentsArray;\n });\n }\n return Promise.resolve(segmentsArray);\n };\n\n /**\n * Gets the segment information and parses it to a string.\n *\n * @param {any} index - Last index of segment to use.\n * @returns - AF Path or PI Point name.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSegmentPathUpTo(segments: Array>, index: number): string {\n var arr = segments.slice(0, index);\n\n return reduce(\n arr,\n (result: any, segment: SelectableValue) => {\n if (!segment.value) {\n return '';\n }\n if (!segment.value.value?.startsWith('-Select')) {\n return result ? result + '\\\\' + segment.value.value : segment.value.value;\n }\n return result;\n },\n ''\n );\n }\n\n /**\n * Get the current AF Element's child attributes. Validates when the element selection changes.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAttributeSegments(\n attributes: Array>,\n segments: Array>\n ): Promise {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: this.getSegmentPathUpTo(segments.slice(0), segments.length),\n type: 'attributes',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: false }))\n .then((attributesResponse: any) => {\n var validAttributes: any = {};\n\n each(attributesResponse, (attribute: any) => {\n validAttributes[attribute.Path.substring(attribute.Path.indexOf('|') + 1)] = attribute.WebId;\n });\n\n var filteredAttributes = filter(attributes, (attrib: SelectableValue) => {\n const changedValue = datasource.templateSrv.replace(attrib.value?.value);\n return validAttributes[changedValue] !== undefined;\n });\n\n ctrl.availableAttributes = validAttributes;\n this.attributeChangeValue(filteredAttributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n this.attributeChangeValue(attributes);\n });\n }\n\n /**\n * Get PI points from server.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkPiPointSegments(\n attribute: SelectableValue,\n attributes: Array>\n ) {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: attribute.path,\n webId: ctrl.getSelectedPIServer(),\n pointName: attribute.label,\n type: 'pipoint',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: true }))\n .then(() => {\n ctrl.attributeChangeValue(attributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n ctrl.attributeChangeValue([]);\n });\n }\n\n /**\n * Gets the webid of the current selected pi data server.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSelectedPIServer() {\n var webID = '';\n\n this.piServer.forEach((s) => {\n var parts = this.props.query.target.split(';');\n if (parts.length >= 2) {\n if (parts[0] === s.text) {\n webID = s.WebId;\n return;\n }\n }\n });\n return this.piServer.length > 0 ? this.piServer[0].value?.webId : webID;\n }\n\n /**\n * Queries PI Web API for child elements and attributes when the raw query text editor is changed.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n textEditorChanged() {\n const { query, onChange } = this.props;\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n let segments: Array> = [];\n let attributes: Array> = [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segments.push({\n label: item,\n value: {\n type: item.match(/\\${\\w+}/gi) ? 'template' : undefined,\n value: item,\n expandable: true,\n },\n });\n });\n this.getElementSegments(splitElements.length + 1, segments).then((elements) => {\n if (elements.length > 0) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n });\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n this.updateArray(segments, attributes, this.state.summaries, query.isPiPoint, () => {\n onChange({ ...query, query: undefined, rawQuery: false });\n });\n } else {\n segments = this.checkAfServer();\n this.updateArray(segments, this.state.attributes, this.state.summaries, query.isPiPoint, () => {\n this.onChange({\n ...query,\n query: undefined,\n rawQuery: false,\n attributes: this.state.attributes,\n segments: this.state.segments,\n });\n });\n }\n }\n\n /**\n * Check if the AF server and database are configured in the datasoure config.\n *\n * @returns the segments array\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAfServer = () => {\n const { datasource } = this.props;\n const segmentsArray = [];\n if (datasource.afserver?.name) {\n segmentsArray.push({\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n });\n if (datasource.afdatabase?.name) {\n segmentsArray.push({\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n });\n }\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n } else {\n segmentsArray.push({\n label: '',\n });\n }\n return segmentsArray;\n };\n\n /**\n * Update the internal state of the datasource.\n *\n * @param segmentsArray the segments array to update\n * @param attributesArray the AF attributes array to update\n * @param summariesArray the summaries array to update\n * @param isPiPoint the is PI point flag\n * @param cb optional callback function\n *\n * @memberOf PIWebAPIQueryEditor\n */\n updateArray = (\n segmentsArray: Array>,\n attributesArray: Array>,\n summariesArray: Array>,\n isPiPoint: boolean,\n cb?: (() => void) | undefined\n ) => {\n this.setState(\n {\n segments: segmentsArray,\n attributes: attributesArray,\n summaries: summariesArray,\n isPiPoint,\n },\n () =>\n this.checkAttributeSegments(attributesArray, this.state.segments).then(() => {\n if (cb) {\n cb();\n }\n })\n );\n };\n\n // React action when component is initialized/updated\n scopedVarsDone = false;\n componentDidMount = () => {\n this.initialLoad(false);\n };\n componentDidUpdate = () => {\n if (this.props.data?.state === 'Done' && !!this.props.data?.request?.scopedVars && !this.scopedVarsDone) {\n this.scopedVarsDone = true;\n this.initialLoad(true);\n }\n };\n initialLoad = (force: boolean) => {\n const { query } = this.props;\n const metricsQuery = defaults(query, defaultQuery) as PIWebAPIQuery;\n const { segments, attributes, summary, isPiPoint } = metricsQuery;\n\n let segmentsArray: Array> = force ? [] : segments?.slice(0) ?? [];\n let attributesArray: Array> = force ? [] : attributes?.slice(0) ?? [];\n let summariesArray = summary?.types ?? [];\n\n if (!isPiPoint && segmentsArray.length === 0) {\n if (query.target && query.target.length > 0 && query.target !== ';') {\n attributesArray = [];\n // Build query from target\n this.buildFromTarget(query, segmentsArray, attributesArray)\n .then((_segmentsArray) => {\n this.updateArray(_segmentsArray, attributesArray, summariesArray, isPiPoint);\n })\n .catch((e) => console.error(e));\n return;\n } else {\n segmentsArray = this.checkAfServer();\n }\n } else if (isPiPoint && segmentsArray.length > 0) {\n this.piServer = segmentsArray;\n }\n this.updateArray(segmentsArray, attributesArray, summariesArray, isPiPoint, () => {\n this.onChange(query);\n });\n };\n\n onChange = (query: PIWebAPIQuery) => {\n const { onChange, onRunQuery } = this.props;\n\n query.summary.types = this.state.summaries;\n if (query.rawQuery) {\n query.target = query.query ?? '';\n\n if (query.target !== '') {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes[0].split('\\\\');\n\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n query.attributes = [];\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n query.elementPath = splitElements.join('\\\\');\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n query.attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n }\n }\n } else {\n query.elementPath = this.getSegmentPathUpTo(this.state.segments, this.state.segments.length);\n query.target =\n query.elementPath +\n ';' +\n join(\n query.attributes.map((s) => s.value?.value),\n ';'\n );\n }\n\n onChange(query);\n\n if (query.target && query.target.length > 0 && query.attributes.length > 0) {\n onRunQuery();\n }\n };\n\n stateCallback = () => {\n const query = this.props.query as PIWebAPIQuery;\n this.onChange(query);\n };\n\n onIsPiPointChange = (event: React.SyntheticEvent) => {\n const { query: queryChange } = this.props;\n const isPiPoint = !queryChange.isPiPoint;\n this.setState(\n {\n segments: isPiPoint ? [{ label: '' }] : this.checkAfServer(),\n attributes: [],\n isPiPoint,\n },\n () => {\n this.onChange({\n ...queryChange,\n expression: '',\n attributes: this.state.attributes,\n segments: this.state.segments,\n isPiPoint,\n });\n }\n );\n };\n\n render() {\n const { query: queryProps, onChange, onRunQuery } = this.props;\n const metricsQuery = defaults(queryProps, defaultQuery) as PIWebAPIQuery;\n const {\n interpolate,\n query,\n rawQuery,\n digitalStates,\n recordedValues,\n expression,\n isPiPoint,\n summary,\n display,\n regex,\n } = metricsQuery;\n\n return (\n <>\n \n \n \n\n {!!rawQuery && (\n \n \n ) =>\n onChange({ ...metricsQuery, query: event.target.value })\n }\n placeholder=\"enter query\"\n />\n \n this.textEditorChanged()} />\n \n )}\n\n {!rawQuery && (\n <>\n
\n \n {this.state.segments.map((segment: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSegmentChange(item, index)}\n loadOptions={(query?: string | undefined) => {\n return this.getElementSegments(index);\n }}\n allowCustomValue\n inputMinWidth={MIN_ELEM_INPUT_WIDTH}\n />\n );\n })}\n \n {!isPiPoint && (\n {\n onChange({ ...metricsQuery, query: metricsQuery.target, rawQuery: value });\n }}\n />\n )}\n \n
\n\n \n {this.state.attributes.map((attribute: SelectableValue, index: number) => {\n if (isPiPoint) {\n return (\n }\n disabled={this.piServer.length === 0}\n onChange={(item) => this.onPiPointChange(item, index)}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n }\n return (\n }\n disabled={this.state.segments.length <= 2}\n onChange={(item) => this.onAttributeChange(item, index)}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n })}\n\n {isPiPoint && (\n \n }\n disabled={this.piServer.length === 0}\n onChange={this.onAttributeAction}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n {!isPiPoint && (\n \n }\n disabled={this.state.segments.length <= 2}\n onChange={this.onAttributeAction}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n \n \n )}\n\n {!isPiPoint && (\n \n ) =>\n this.onChange({ ...metricsQuery, expression: event.target.value })\n }\n placeholder=\"'.'*2\"\n />\n \n )}\n\n \n \n ) =>\n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, maxNumber: parseInt(event.target.value, 10) },\n })\n }\n type=\"number\"\n placeholder=\"1000\"\n />\n \n \n \n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, enable: !recordedValues.enable },\n })\n }\n />\n \n \n \n this.onChange({ ...metricsQuery, digitalStates: { ...digitalStates, enable: !digitalStates.enable } })\n }\n />\n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n \n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, enable: !interpolate.enable } })\n }\n />\n \n \n }\n onChange={this.calcNoDataValueChanged}\n options={this.getNoDataSegments()}\n allowCustomValue\n />\n \n \n\n \n \n ) =>\n onChange({ ...metricsQuery, summary: { ...summary, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n }\n onChange={this.calcBasisValueChanged}\n options={this.getCalcBasisSegments()}\n allowCustomValue\n />\n \n \n \n {this.state.summaries.map((s: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSummaryValueChanged(item, index)}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n );\n })}\n \n }\n onChange={this.onSummaryAction}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n \n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, display: event.target.value })\n }\n placeholder=\"Display\"\n />\n \n \n {\n this.onChange({ ...metricsQuery, regex: { ...regex, enable: !regex.enable } });\n }}\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, search: event.target.value } })\n }\n placeholder=\"(.*)\"\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, replace: event.target.value } })\n }\n placeholder=\"$1\"\n />\n \n \n \n );\n }\n}\n","import { curry, each, filter, flatten, forOwn, groupBy, keys, map, uniq } from 'lodash';\n\nimport {\n DataQueryRequest,\n DataQueryResponse,\n DataSourceApi,\n DataSourceInstanceSettings,\n AnnotationEvent,\n toDataFrame,\n MetricFindValue,\n} from '@grafana/data';\nimport { BackendSrv, getBackendSrv, getTemplateSrv, TemplateSrv } from '@grafana/runtime';\n\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\ninterface PiwebapiElementPath {\n path: string;\n variable: string;\n}\n\ninterface PiwebapiInternalRsp {\n data: PiwebapiRsp;\n status: number;\n url: string;\n}\n\ninterface PiwebapTargetRsp {\n refId: string;\n target: string;\n datapoints: any[];\n}\n\ninterface PiwebapiRsp {\n Name?: string;\n InstanceType?: string;\n Items?: PiwebapiRsp[];\n WebId?: string;\n HasChildren?: boolean;\n Path?: string;\n}\n\ninterface PiDataServer {\n name: string | undefined;\n webid: string | undefined;\n}\n\nexport class PiWebAPIDatasource extends DataSourceApi {\n piserver: PiDataServer;\n afserver: PiDataServer;\n afdatabase: PiDataServer;\n\n basicAuth?: string;\n withCredentials?: boolean;\n url: string;\n name: string;\n isProxy = false;\n\n templateSrv: TemplateSrv;\n backendSrv: BackendSrv;\n\n piwebapiurl?: string;\n webidCache: Map = new Map();\n\n error: any;\n\n constructor(instanceSettings: DataSourceInstanceSettings) {\n super(instanceSettings);\n this.basicAuth = instanceSettings.basicAuth;\n this.withCredentials = instanceSettings.withCredentials;\n this.url = instanceSettings.url!;\n this.name = instanceSettings.name;\n this.templateSrv = getTemplateSrv();\n this.backendSrv = getBackendSrv();\n\n this.piwebapiurl = instanceSettings.jsonData.url?.toString();\n this.isProxy = /^http(s)?:\\/\\//.test(this.url) || instanceSettings.jsonData.access === 'proxy';\n\n this.piserver = { name: (instanceSettings.jsonData || {}).piserver, webid: undefined };\n this.afserver = { name: (instanceSettings.jsonData || {}).afserver, webid: undefined };\n this.afdatabase = { name: (instanceSettings.jsonData || {}).afdatabase, webid: undefined };\n\n Promise.all([\n this.getAssetServer(this.afserver.name).then((result: PiwebapiRsp) => (this.afserver.webid = result.WebId)),\n this.getDataServer(this.piserver.name).then((result: PiwebapiRsp) => (this.piserver.webid = result.WebId)),\n this.getDatabase(this.afserver.name ? this.afserver.name + '\\\\' + this.afdatabase.name : undefined).then(\n (result: PiwebapiRsp) => (this.afdatabase.webid = result.WebId)\n ),\n ]);\n }\n\n /**\n * Converts a PIWebAPI Event Frame response to a Grafana Annotation\n *\n * @param {any} annotationOptions - Options data from configuration panel.\n * @param {any} endTime - End time of the Event Frame.\n * @param {any} eventFrame - The Event Frame data.\n * @returns - Grafana Annotation\n *\n * @memberOf PiWebApiDatasource\n */\n private eventFrameToAnnotation(\n annotationOptions: any,\n endTime: any,\n eventFrame: any,\n attributeDataItems: any\n ): AnnotationEvent {\n if (annotationOptions.regex && annotationOptions.regex.enable) {\n eventFrame.Name = eventFrame.Name.replace(\n new RegExp(annotationOptions.regex.search),\n annotationOptions.regex.replace\n );\n }\n\n var attributeText = '';\n if (attributeDataItems) {\n each(attributeDataItems, (attributeData: any) => {\n const attributeValue = attributeData.Value.Value\n ? attributeData.Value.Value.Name || attributeData.Value.Value.Value || attributeData.Value.Value\n : null;\n attributeText += '
' + attributeData.Name + ': ' + attributeValue;\n });\n }\n return {\n annotation: annotationOptions,\n title: (endTime ? 'END ' : annotationOptions.showEndTime ? 'START ' : '') + annotationOptions.name,\n time: new Date(endTime ? eventFrame.EndTime : eventFrame.StartTime).getTime(),\n text:\n eventFrame.Name + attributeText + '
Start: ' + eventFrame.StartTime + '
End: ' + eventFrame.EndTime,\n };\n }\n\n /**\n * Builds the PIWebAPI query parameters.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - PIWebAPI query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private buildQueryParameters(options: DataQueryRequest) {\n options.targets = filter(options.targets, (target) => {\n if (!target || !target.target) {\n return false;\n }\n return !target.target.startsWith('Select AF');\n });\n\n options.targets = map(options.targets, (target) => {\n const ds = this;\n var tar = {\n target: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPath: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPathArray: [\n {\n path: this.templateSrv.replace(target.elementPath, options.scopedVars),\n variable: '',\n } as PiwebapiElementPath,\n ],\n attributes: map(target.attributes, (att) =>\n this.templateSrv.replace(att.value?.value || att, options.scopedVars)\n ),\n segments: map(target.segments, (att) => this.templateSrv.replace(att.value?.value, options.scopedVars)),\n display: target.display,\n refId: target.refId,\n hide: target.hide,\n interpolate: target.interpolate || { enable: false },\n recordedValues: target.recordedValues || { enable: false },\n digitalStates: target.digitalStates || { enable: false },\n webid: target.webid,\n webids: target.webids || [],\n regex: target.regex || { enable: false },\n expression: target.expression || '',\n summary: target.summary || { types: [] },\n startTime: options.range.from,\n endTime: options.range.to,\n isPiPoint: target.isPiPoint,\n scopedVars: options.scopedVars,\n };\n\n if (tar.expression) {\n tar.expression = this.templateSrv.replace(tar.expression, options.scopedVars);\n }\n\n if (tar.summary.types !== undefined) {\n tar.summary.types = filter(tar.summary.types, (item) => {\n return item !== undefined && item !== null && item !== '';\n });\n }\n\n // explode All or Multi-selection\n const varsKeys = keys(options.scopedVars);\n this.templateSrv.getVariables().forEach((v: any) => {\n if (ds.isAllSelected(v.current) && varsKeys.indexOf(v.name) < 0) {\n // All selection\n const variables = v.options.filter((o: any) => !o.selected);\n // attributes\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) =>\n !!v.allValue ? attr.replace(v.allValue, vv.value) : attr.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value)\n )\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, v.allValue);\n } else if (Array.isArray(v.current.text) && varsKeys.indexOf(v.name) < 0) {\n // Multi-selection\n const variables = v.options.filter((o: any) => o.selected);\n // attributes\n const query = v.current.value.join(',');\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) => attr.replace(`{${query}}`, vv.value))\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, `{${query}}`);\n }\n });\n\n return tar;\n });\n\n return options;\n }\n\n /**\n * Datasource Implementation. Primary entry point for data source.\n * This takes the panel configuration and queries, sends them to PI Web API and parses the response.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - Promise of data in the format for Grafana panels.\n *\n * @memberOf PiWebApiDatasource\n */\n async query(options: DataQueryRequest): Promise {\n var ds = this;\n var query = this.buildQueryParameters(options);\n query.targets = filter(query.targets, (t) => !t.hide);\n\n if (query.targets.length <= 0) {\n return Promise.resolve({ data: [] });\n } else {\n return Promise.all(ds.getStream(query)).then((targetResponses) => {\n let flattened: PiwebapTargetRsp[] = [];\n each(targetResponses, (tr) => {\n each(tr, (item) => flattened.push(item));\n });\n const response: DataQueryResponse = {\n data: flattened\n .sort((a, b) => {\n return +(a.target > b.target) || +(a.target === b.target) - 1;\n })\n .map((d) => toDataFrame(d)),\n };\n return response;\n });\n }\n }\n\n /**\n * Datasource Implementation.\n * Used for testing datasource in datasource configuration pange\n *\n * @returns - Success or failure message.\n *\n * @memberOf PiWebApiDatasource\n */\n testDatasource(): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + '/',\n method: 'GET',\n })\n .then((response: any) => {\n if (response.status === 200) {\n return { status: 'success', message: 'Data source is working', title: 'Success' };\n }\n throw new Error('Failed');\n });\n }\n\n /**\n * Datasource Implementation.\n * This queries PI Web API for Event Frames and converts them into annotations.\n *\n * @param {any} options - Annotation options, usually the Event Frame Category.\n * @returns - A Grafana annotation.\n *\n * @memberOf PiWebApiDatasource\n */\n annotationQuery(options: any): Promise {\n if (!this.afdatabase.webid) {\n return Promise.resolve([]);\n }\n\n var categoryName = options.annotation.query.categoryName\n ? this.templateSrv.replace(options.annotation.query.categoryName, options.scopedVars, 'glob')\n : null;\n var nameFilter = options.annotation.query.nameFilter\n ? this.templateSrv.replace(options.annotation.query.nameFilter, options.scopedVars, 'glob')\n : null;\n var templateName = options.annotation.template ? options.annotation.template.Name : null;\n var annotationOptions = {\n name: options.annotation.name,\n datasource: options.annotation.datasource,\n enable: options.annotation.enable,\n iconColor: options.annotation.iconColor,\n showEndTime: options.annotation.showEndTime,\n regex: options.annotation.regex,\n attribute: options.annotation.attribute,\n categoryName: categoryName,\n templateName: templateName,\n nameFilter: nameFilter,\n };\n\n var filter = [];\n if (!!annotationOptions.categoryName) {\n filter.push('categoryName=' + annotationOptions.categoryName);\n }\n if (!!annotationOptions.nameFilter) {\n filter.push('nameFilter=' + annotationOptions.nameFilter);\n }\n if (!!annotationOptions.templateName) {\n filter.push('templateName=' + annotationOptions.templateName);\n }\n if (!filter.length) {\n return Promise.resolve([]);\n }\n filter.push('startTime=' + options.range.from.toJSON());\n filter.push('endTime=' + options.range.to.toJSON());\n\n if (annotationOptions.attribute && annotationOptions.attribute.enable) {\n var resourceUrl =\n this.piwebapiurl + '/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n if (!!annotationOptions.attribute.name) {\n resourceUrl =\n this.piwebapiurl +\n '/streamsets/{0}/value?nameFilter=' +\n annotationOptions.attribute.name +\n '&selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n }\n var query: any = {};\n query['1'] = {\n Method: 'GET',\n Resource: this.piwebapiurl + '/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&'),\n };\n query['2'] = {\n Method: 'GET',\n RequestTemplate: {\n Resource: resourceUrl,\n },\n Parameters: ['$.1.Content.Items[*].WebId'],\n ParentIds: ['1'],\n };\n return this.restBatch(query).then((result: any) => {\n const data = result.data['1'].Content;\n const valueData = result.data['2'].Content;\n\n var annotations = map(data.Items, (item: any, index: any) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n false,\n item,\n valueData.Items[index].Content.Items\n );\n });\n\n if (options.annotation.showEndTime) {\n var ends = map(data.Items, (item: any, index: number) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n true,\n item,\n valueData.Items[index].Content.Items\n );\n });\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n\n return annotations;\n });\n } else {\n return this.restGet('/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&')).then(\n (result) => {\n var annotations = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, false));\n if (options.annotation.showEndTime) {\n var ends = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, true));\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n return annotations;\n }\n );\n }\n }\n\n /**\n * Builds the Grafana metric segment for use on the query user interface.\n *\n * @param {any} response - response from PI Web API.\n * @returns - Grafana metric segment.\n *\n * @memberOf PiWebApiDatasource\n */\n private metricQueryTransform(response: PiwebapiRsp[]): MetricFindValue[] {\n return map(response, (item) => {\n return {\n text: item.Name,\n expandable:\n item.HasChildren === undefined || item.HasChildren === true || (item.Path ?? '').split('\\\\').length <= 3,\n HasChildren: item.HasChildren,\n Items: item.Items ?? [],\n Path: item.Path,\n WebId: item.WebId,\n } as MetricFindValue;\n });\n }\n\n /**\n * This method does the discovery of the AF Hierarchy and populates the query user interface segments.\n *\n * @param {any} query - Parses the query configuration and builds a PI Web API query.\n * @returns - Segment information.\n *\n * @memberOf PiWebApiDatasource\n */\n metricFindQuery(query: any, queryOptions: any): Promise {\n var ds = this;\n var querydepth = ['servers', 'databases', 'databaseElements', 'elements'];\n if (typeof query === 'string') {\n query = JSON.parse(query as string);\n }\n if (queryOptions.isPiPoint) {\n query.path = this.templateSrv.replace(query.path, queryOptions);\n } else {\n if (query.path === '') {\n query.type = querydepth[0];\n } else if (query.type !== 'attributes') {\n query.type = querydepth[Math.max(0, Math.min(query.path.split('\\\\').length, querydepth.length - 1))];\n }\n query.path = this.templateSrv.replace(query.path, queryOptions);\n query.path = query.path.replace(/\\{([^\\\\])*\\}/gi, (r: string) => r.substring(1, r.length - 2).split(',')[0]);\n }\n\n query.filter = query.filter ?? '*';\n\n if (query.type === 'servers') {\n return ds.afserver?.name\n ? ds\n .getAssetServer(ds.afserver.name)\n .then((result: PiwebapiRsp) => [result])\n .then(ds.metricQueryTransform)\n : ds.getAssetServers().then(ds.metricQueryTransform);\n } else if (query.type === 'databases') {\n return ds\n .getAssetServer(query.path)\n .then((server) => ds.getDatabases(server.WebId ?? '', {}))\n .then(ds.metricQueryTransform);\n } else if (query.type === 'databaseElements') {\n return ds\n .getDatabase(query.path)\n .then((db) =>\n ds.getDatabaseElements(db.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'elements') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getElements(element.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'attributes') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getAttributes(element.WebId ?? '', {\n searchFullHierarchy: 'true',\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Path',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'dataserver') {\n return ds.getDataServers().then(ds.metricQueryTransform);\n } else if (query.type === 'pipoint') {\n return ds.piPointSearch(query.webId, query.pointName).then(ds.metricQueryTransform);\n }\n return Promise.reject('Bad type');\n }\n\n /**\n * Gets the url of summary data from the query configuration.\n *\n * @param {any} summary - Query summary configuration.\n * @returns - URL append string.\n *\n * @memberOf PiWebApiDatasource\n */\n getSummaryUrl(summary: any) {\n if (summary.interval.trim() === '') {\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis\n );\n }\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis +\n '&summaryDuration=' +\n summary.interval.trim()\n );\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} value - A list of PIWebAPI values.\n * @param {any} target - The target Grafana metric.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @returns - An array of Grafana value, timestamp pairs.\n *\n */\n parsePiPointValueList(value: any[], target: any, isSummary: boolean) {\n var api = this;\n var datapoints: any[] = [];\n each(value, (item) => {\n // @ts-ignore\n var { grafanaDataPoint, previousValue, drop } = this.noDataReplace(\n isSummary ? item.Value : item,\n target.summary.nodata,\n api.parsePiPointValue(isSummary ? item.Value : item, target, isSummary)\n );\n if (!drop) {\n datapoints.push(grafanaDataPoint);\n }\n });\n return datapoints;\n }\n\n /**\n * Convert a PI Point value to use Grafana value/timestamp.\n *\n * @param {any} value - PI Point value.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @param {any} target - The target grafana metric.\n * @returns - Grafana value pair.\n *\n */\n parsePiPointValue(value: any, target: any, isSummary: boolean) {\n let num = !isSummary && typeof value.Value === 'object' ? value.Value?.Value : value.Value;\n\n if (!value.Good || !!target.digitalStates?.enable) {\n num = (!isSummary && typeof value.Value === 'object' ? value.Value?.Name : value.Name) ?? '';\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} item - 'Item' object from PIWebAPI\n * @param {any} noDataReplacementMode - String state of how to replace 'No Data'\n * @param {any} grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns perviousValue - {any} Grafana value (value only).\n *\n */\n noDataReplace(\n item: any,\n noDataReplacementMode: any,\n grafanaDataPoint: any[]\n ): {\n grafanaDataPoint: any[];\n previousValue: any;\n drop: boolean;\n } {\n var previousValue = null;\n var drop = false;\n if (!item.Good || item.Value === 'No Data' || (item.Value?.Name && item.Value?.Name === 'No Data')) {\n if (noDataReplacementMode === 'Drop') {\n drop = true;\n } else if (noDataReplacementMode === '0') {\n grafanaDataPoint[0] = 0;\n } else if (noDataReplacementMode === 'Keep') {\n // Do nothing keep\n } else if (noDataReplacementMode === 'Null') {\n grafanaDataPoint[0] = null;\n } else if (noDataReplacementMode === 'Previous' && previousValue !== null) {\n grafanaDataPoint[0] = previousValue;\n }\n } else {\n previousValue = item.Value;\n }\n return { grafanaDataPoint, previousValue, drop };\n }\n\n /**\n * Process the response from PI Web API for a single item.\n *\n * @param {any} content - Web response data.\n * @param {any} target - The target grafana metric.\n * @param {any} name - The target metric name.\n * @returns - Parsed metric in target/datapoint json format.\n *\n * @memberOf PiWebApiDatasource\n */\n processResults(content: any, target: any, name: any, noTemplate: boolean): PiwebapTargetRsp[] {\n const api = this;\n const isSummary: boolean = target.summary && target.summary.types && target.summary.types.length > 0;\n name = noTemplate ? name : this.getPath(target.elementPathArray, content.Path) + '|' + name;\n if (target.regex && target.regex.enable && target.regex.search.length && target.regex.replace.length) {\n name = name.replace(new RegExp(target.regex.search), target.regex.replace);\n }\n if (isSummary) {\n var innerResults: any[] = [];\n var groups = groupBy(content.Items, (item: any) => item.Type);\n forOwn(groups, (value, key) => {\n innerResults.push({\n refId: target.refId,\n target: name + '[' + key + ']',\n datapoints: api.parsePiPointValueList(value, target, isSummary),\n });\n });\n return innerResults;\n }\n return [\n {\n refId: target.refId,\n target: name,\n datapoints: api.parsePiPointValueList(content.Items, target, isSummary),\n },\n ];\n }\n\n /** PRIVATE SECTION */\n\n /**\n * Check if all items are selected.\n *\n * @param {any} current the current variable selection\n * @return {boolean} true if all value is selected, false otherwise\n */\n private isAllSelected(current: any): boolean {\n if (!current) {\n return false;\n }\n if (Array.isArray(current.text)) {\n return current.text.indexOf('All') >= 0;\n }\n return current.text === 'All';\n }\n\n /**\n * Check if the value is a number.\n *\n * @param {any} number the value to check\n * @returns {boolean} true if the value is a number, false otherwise\n */\n private checkNumber(number: any): boolean {\n return typeof number === 'number' && !Number.isNaN(number) && Number.isFinite(number);\n }\n\n /**\n * Returns a new element path list based on the panel variables.\n *\n * @param {string} elementPathArray array of element paths\n * @param {string} variables the list of variable values\n * @param {string} allValue the all value value for the variable\n * @returns {PiwebapiElementPath[]} new element path list\n */\n private getElementPath(\n elementPathArray: PiwebapiElementPath[],\n variables: any[],\n allValue: string\n ): PiwebapiElementPath[] {\n // elementPath\n let newElementPathArray: PiwebapiElementPath[] = [];\n elementPathArray.forEach((elem: PiwebapiElementPath) => {\n if ((!!allValue && elem.path.indexOf(allValue) >= 0) || (!allValue && elem.path.match(/{[a-zA-z0-9,-_]+}/gi))) {\n const temp: PiwebapiElementPath[] = variables.map((vv: any) => {\n return {\n path: !!allValue\n ? elem.path.replace(allValue, vv.value)\n : elem.path.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value),\n variable: vv.value,\n } as PiwebapiElementPath;\n });\n newElementPathArray = newElementPathArray.concat(temp);\n }\n });\n if (newElementPathArray.length) {\n return uniq(flatten(newElementPathArray));\n }\n return elementPathArray;\n }\n\n /**\n * Returns the last item of the element path.\n *\n * @param {string} path element path\n * @returns {string} last item of the element path\n */\n private getPath(elementPathArray: PiwebapiElementPath[], path: string): string {\n let splitPath = path.split('|');\n if (splitPath.length === 0) {\n return '';\n }\n if (elementPathArray.length === 0) {\n return '';\n }\n splitPath = splitPath[0].split('\\\\');\n const splitStr = splitPath.length === 0 ? '' : splitPath.pop() ?? '';\n const foundElement = elementPathArray.find((e) => path.indexOf(e.path) >= 0)?.variable;\n return foundElement ? foundElement + '|' + splitStr : splitStr;\n }\n\n /**\n * Gets historical data from a PI Web API stream source.\n *\n * @param {any} query - Grafana query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private getStream(query: any): Array> {\n const ds = this;\n var results: Array> = [];\n\n each(query.targets, (target) => {\n target.attributes = filter(target.attributes || [], (attribute) => {\n return 1 && attribute;\n });\n var url = '';\n var isSummary = target.summary && target.summary.types && target.summary.types.length > 0;\n var isInterpolated = target.interpolate && target.interpolate.enable;\n // perhaps add a check to see if interpolate override time < query.interval\n var intervalTime = target.interpolate.interval ? target.interpolate.interval : query.interval;\n var timeRange = '?startTime=' + query.range.from.toJSON() + '&endTime=' + query.range.to.toJSON();\n var targetName = target.expression || target.elementPath;\n var displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n if (target.expression) {\n url += '/calculation';\n if (isSummary) {\n url += '/summary' + timeRange + (isInterpolated ? '&sampleType=Interval&sampleInterval=' + intervalTime : '');\n } else {\n url += '/intervals' + timeRange + '&sampleInterval=' + intervalTime;\n }\n url += '&expression=' + encodeURIComponent(target.expression);\n if (target.attributes.length > 0) {\n results.push(ds.internalStream(query, target, url));\n } else {\n results.push(\n ds.restGetWebId(target.elementPath, target.isPiPoint).then((webidresponse: any) => {\n return ds\n .restPost(url + webidresponse.WebId)\n .then((response: any) => ds.processResults(response.data, target, displayName || targetName, false))\n .catch((err: any) => (ds.error = err));\n })\n );\n }\n } else {\n url += '/streamsets';\n if (isSummary) {\n url += '/summary' + timeRange + '&intervals=' + query.maxDataPoints + this.getSummaryUrl(target.summary);\n } else if (target.interpolate && target.interpolate.enable) {\n url += '/interpolated' + timeRange + '&interval=' + intervalTime;\n } else if (target.recordedValues && target.recordedValues.enable) {\n const maxNumber =\n target.recordedValues.maxNumber && !isNaN(target.recordedValues.maxNumber)\n ? target.recordedValues.maxNumber\n : 1000;\n url += '/recorded' + timeRange + '&maxCount=' + maxNumber;\n } else {\n url += '/plot' + timeRange + '&intervals=' + query.maxDataPoints;\n }\n\n results.push(ds.internalStream(query, target, url));\n }\n });\n\n return results;\n }\n\n /**\n * Return the data points from the provided Grafana query.\n *\n * @param {any} query - Grafana query.\n * @param {any} target - Grafana query target.\n * @param {string} url - The base URL for the query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private internalStream(query: any, target: any, url: string): Promise {\n const ds = this;\n const targetName = target.expression || target.elementPath;\n const displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n const noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path;\n let promises: Promise;\n\n if (noTemplate) {\n if (target.attributes.length > 1 && !target.isPiPoint) {\n promises = ds\n .restGetWebId(target.elementPath, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n } else {\n promises = Promise.all(\n map(target.attributes, (attribute: string) =>\n ds.restGetWebId(target.elementPath + '|' + attribute, target.isPiPoint)\n )\n );\n }\n } else {\n if (target.attributes.length > 1 && !target.isPiPoint) {\n promises = Promise.all(\n target.elementPathArray.map((elementPath: PiwebapiElementPath) => {\n return ds\n .restGetWebId(elementPath.path, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n })\n );\n } else {\n promises = Promise.all(\n flatten(\n map(target.attributes, (attribute: string) => {\n return target.elementPathArray.map((elementPath: PiwebapiElementPath) =>\n ds.restGetWebId(elementPath.path + '|' + attribute, target.isPiPoint)\n );\n })\n )\n );\n }\n }\n\n return promises.then((webidresponse) => {\n const query: any = {};\n each(flatten(webidresponse), (webid, index) => {\n query[index + 1] = {\n Method: 'GET',\n Resource: ds.piwebapiurl + url + '&webid=' + webid.WebId,\n };\n });\n\n return ds\n .restBatch(query)\n .then((response: any) => {\n const targetResults: any[] = [];\n each(response.data, (value, key) => {\n if (target.expression) {\n const attribute = webidresponse[parseInt(key, 10) - 1].Name;\n each(\n ds.processResults(value.Content, target, displayName || attribute || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n } else {\n each(value.Content.Items, (item) => {\n each(\n ds.processResults(item, target, displayName || item.Name || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n });\n }\n });\n return targetResults;\n })\n .catch((err: any) => (ds.error = err));\n });\n }\n\n /**\n * Abstraction for calling the PI Web API REST endpoint\n *\n * @param {any} path - the path to append to the base server URL.\n * @returns - The full URL.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGet(path: string): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n return response as PiwebapiInternalRsp;\n });\n }\n\n /**\n * Resolve a Grafana query into a PI Web API webid. Uses client side cache when possible to reduce lookups.\n *\n * @param {string} assetPath - The AF Path or the Pi Point Path (\\\\ServerName\\piPointName) to the asset.\n * @param {boolean} isPiPoint - Flag indicating it's a PI Point\n * @returns - URL query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGetWebId(assetPath: string, isPiPoint: boolean): Promise {\n var ds = this;\n\n // check cache\n var cachedWebId = ds.webidCache.get(assetPath);\n if (cachedWebId) {\n return Promise.resolve({ Path: assetPath, WebId: cachedWebId.WebId, Name: cachedWebId.Name });\n }\n\n let path = '';\n if (isPiPoint) {\n path = '/points?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\' + assetPath.replace('|', '\\\\');\n } else {\n // no cache hit, query server\n path =\n (assetPath.indexOf('|') >= 0\n ? '/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\'\n : '/elements?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\') + assetPath;\n }\n\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n ds.webidCache.set(assetPath, response.data);\n return { Path: assetPath, WebId: response.data.WebId, Name: response.data.Name };\n });\n }\n\n /**\n * Execute a batch query on the PI Web API.\n *\n * @param {any} batch - Batch JSON query data.\n * @returns - Batch response.\n *\n * @memberOf PiWebApiDatasource\n */\n private restBatch(batch: any) {\n return this.backendSrv.datasourceRequest({\n url: this.url + '/batch',\n data: batch,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n },\n });\n }\n\n /**\n * Execute a POST on the PI Web API.\n *\n * @param {string} path - The full url of the POST.\n * @returns - POST response data.\n *\n * @memberOf PiWebApiDatasource\n */\n private restPost(path: string) {\n return this.backendSrv.datasourceRequest({\n url: this.url,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n 'X-PIWEBAPI-HTTP-METHOD': 'GET',\n 'X-PIWEBAPI-RESOURCE-ADDRESS': path,\n },\n });\n }\n\n // Get a list of all data (PI) servers\n private getDataServers(): Promise {\n return this.restGet('/dataservers').then((response) => response.data.Items ?? []);\n }\n private getDataServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/dataservers?name=' + name).then((response) => response.data);\n }\n // Get a list of all asset (AF) servers\n private getAssetServers(): Promise {\n return this.restGet('/assetservers').then((response) => response.data.Items ?? []);\n }\n private getAssetServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/assetservers?path=\\\\\\\\' + name).then((response) => response.data);\n }\n private getDatabase(path: string | undefined): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/assetdatabases?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getDatabases(serverId: string, options?: any): Promise {\n if (!serverId) {\n return Promise.resolve([]);\n }\n return this.restGet('/assetservers/' + serverId + '/assetdatabases').then((response) => response.data.Items ?? []);\n }\n getElement(path: string): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/elements?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getEventFrameTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'EventFrame');\n });\n }\n getElementTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'Element');\n });\n }\n\n /**\n * @description\n * Get the child attributes of the current resource.\n * GET attributes/{webId}/attributes\n * @param {string} elementId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.nameFilter - The name query string used for finding attributes. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned attributes must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned attributes must be members of this template. The default is no template filter.\n * @param {string} options.valueType - Specify that returned attributes' value type must be the given value type. The default is no value type filter.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include attributes nested further than the immediate attributes of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {string} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {string} options.showExcluded - Specified if the search should include attributes with the Excluded property set. The default is 'false'.\n * @param {string} options.showHidden - Specified if the search should include attributes with the Hidden property set. The default is 'false'.\n * @param {string} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getAttributes(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/attributes' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET assetdatabases/{webId}/elements\n * @param {string} databaseId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getDatabaseElements(databaseId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/assetdatabases/' + databaseId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET elements/{webId}/elements\n * @param {string} databaseId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getElements(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * Retrieve a list of points on a specified Data Server.\n *\n * @param {string} serverId - The ID of the server. See WebID for more information.\n * @param {string} nameFilter - A query string for filtering by point name. The default is no filter. *, ?, [ab], [!ab]\n */\n private piPointSearch(serverId: string, nameFilter: string): Promise {\n let filter1 = this.templateSrv.replace(nameFilter);\n let filter2 = `${filter1}`;\n let doFilter = false;\n if (filter1 !== nameFilter) {\n const regex = /\\{(\\w|,)+\\}/gs;\n let m;\n while ((m = regex.exec(filter1)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // The result can be accessed through the `m`-variable.\n m.forEach((match, groupIndex) => {\n if (groupIndex === 0) {\n filter1 = filter1.replace(match, match.replace('{', '(').replace('}', ')').replace(',', '|'));\n filter2 = filter2.replace(match, '*');\n doFilter = true;\n }\n });\n }\n }\n return this.restGet('/dataservers/' + serverId + '/points?maxCount=20&nameFilter=' + filter2).then((results) => {\n if (!!results && !!results.data?.Items) {\n return doFilter ? results.data.Items.filter((item) => item.Name?.match(filter1)) : results.data.Items;\n }\n return [];\n });\n }\n\n /**\n * Get the PI Web API webid or PI Point.\n *\n * @param {any} target - AF Path or Point name.\n * @returns - webid.\n *\n * @memberOf PiWebApiDatasource\n */\n getWebId(target: any) {\n var ds = this;\n var isAf = target.target.indexOf('\\\\') >= 0;\n var isAttribute = target.target.indexOf('|') >= 0;\n if (!isAf && target.target.indexOf('.') === -1) {\n return Promise.resolve([{ WebId: target.target, Name: target.display || target.target }]);\n }\n\n if (!isAf) {\n // pi point lookup\n return ds.piPointSearch(this.piserver.webid!, target.target).then((results) => {\n if (results === undefined || results.length === 0) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n return results;\n });\n } else if (isAf && isAttribute) {\n // af attribute lookup\n return ds.restGet('/attributes?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n } else {\n // af element lookup\n return ds.restGet('/elements?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n }\n }\n}\n","import { DataSourcePlugin } from '@grafana/data';\nimport { AnnotationsQueryCtrl } from './AnnotationsQueryCtrl';\nimport { PIWebAPIConfigEditor } from './ConfigEditor';\nimport { PIWebAPIQueryEditor } from './QueryEditor';\nimport { PiWebAPIDatasource } from './datasource';\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\nexport const plugin = new DataSourcePlugin(\n PiWebAPIDatasource\n)\n .setConfigEditor(PIWebAPIConfigEditor)\n .setQueryEditor(PIWebAPIQueryEditor)\n .setAnnotationQueryCtrl(AnnotationsQueryCtrl);\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__0__","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__3__","__WEBPACK_EXTERNAL_MODULE__5__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","AnnotationsQueryCtrl","$scope","this","annotation","ctrl","datasource","query","databases","templates","regex","attribute","showEndTime","getAssetServer","afserver","name","then","result","getDatabases","WebId","getEventFrames","webid","dbs","$apply","getEventFrameTemplates","database","FormField","LegacyForms","coerceOptions","options","jsonData","url","PIWebAPIConfigEditor","event","props","onOptionsChange","piserver","target","afdatabase","originalOptions","DataSourceHttpSettings","defaultUrl","dataSourceConfig","onChange","onMyOptionsChange","showAccessOptions","className","label","labelWidth","inputWidth","onPIServerChange","placeholder","onAFServerChange","onAFDatabaseChange","PureComponent","QueryField","tooltip","children","InlineFormLabel","width","QueryRowTerminator","QueryInlineField","QueryEditorRow","QueryRawInlineField","QueryRawEditorRow","defaultQuery","attributes","segments","enable","summary","types","basis","interval","nodata","expression","interpolate","recordedValues","digitalStates","isPiPoint","QueryEditorModeSwitcher","isRaw","useState","isModalOpen","setModalOpen","useEffect","Button","icon","variant","type","onClick","ConfirmModal","isOpen","title","body","confirmText","dismissText","onConfirm","onDismiss","LABEL_WIDTH","MIN_ATTR_INPUT_WIDTH","REMOVE_LABEL","CustomLabelComponent","Icon","PIWebAPIQueryEditor","summaries","attributeSegment","summarySegment","calculationBasisSegment","noDataReplacementSegment","setState","item","index","state","slice","remove","checkPiPointSegments","checkAttributeSegments","length","push","expandable","piServer","segmentChangeValue","currentSegment","data","findQuery","path","getSegmentPathUpTo","Promise","resolve","metricFindQuery","assign","request","scopedVars","items","altSegments","map","text","webId","variables","templateSrv","getVariables","each","variable","selectableValue","unshift","err","error","message","attributeText","getSelectedPIServer","pointName","Path","forOwn","availableAttributes","val","segmentsArray","attributesArray","splitAttributes","split","splitElements","splice","_","getElementSegments","elements","summariesArray","cb","initialLoad","scopedVarsDone","force","metricsQuery","defaults","buildFromTarget","_segmentsArray","updateArray","e","checkAfServer","onRunQuery","rawQuery","elementPath","join","s","queryChange","onSegmentChange","bind","calcBasisValueChanged","calcNoDataValueChanged","onSummaryAction","onSummaryValueChanged","onAttributeAction","onAttributeChange","summaryTypes","calculationBasis","noDataReplacement","segment","isValueEmpty","stateCallback","filter","indexOf","part","attributeChangeValue","arr","reduce","startsWith","attributesResponse","validAttributes","substring","filteredAttributes","attrib","changedValue","replace","webID","forEach","parts","match","queryProps","display","InlineField","InlineSwitch","onIsPiPointChange","InlineFieldRow","grow","Input","onBlur","textEditorChanged","SegmentAsync","Component","loadOptions","allowCustomValue","inputMinWidth","disabled","onPiPointChange","getAttributeSegmentsPI","reloadOptionsOnChange","Segment","getAttributeSegmentsAF","maxNumber","parseInt","getNoDataSegments","getCalcBasisSegments","getSummarySegments","search","PiWebAPIDatasource","instanceSettings","Map","basicAuth","withCredentials","getTemplateSrv","backendSrv","getBackendSrv","piwebapiurl","toString","isProxy","test","access","all","getDataServer","getDatabase","annotationOptions","endTime","eventFrame","attributeDataItems","Name","RegExp","attributeData","attributeValue","Value","time","Date","EndTime","StartTime","getTime","targets","ds","tar","elementPathArray","att","refId","hide","webids","startTime","range","from","to","varsKeys","keys","v","isAllSelected","current","selected","attr","vv","allValue","uniq","flatten","getElementPath","Array","isArray","buildQueryParameters","t","getStream","targetResponses","flattened","tr","sort","b","toDataFrame","datasourceRequest","method","response","status","Error","categoryName","nameFilter","templateName","template","iconColor","toJSON","resourceUrl","Method","Resource","RequestTemplate","Parameters","ParentIds","restBatch","Content","valueData","annotations","Items","curry","eventFrameToAnnotation","ends","end","restGet","HasChildren","queryOptions","querydepth","JSON","parse","Math","max","min","metricQueryTransform","getAssetServers","server","db","getDatabaseElements","selectedFields","getElement","element","getElements","getAttributes","searchFullHierarchy","getDataServers","piPointSearch","reject","trim","isSummary","api","datapoints","noDataReplace","parsePiPointValue","grafanaDataPoint","previousValue","drop","num","Good","checkNumber","Number","Timestamp","noDataReplacementMode","content","noTemplate","getPath","innerResults","groups","groupBy","Type","parsePiPointValueList","number","isNaN","isFinite","newElementPathArray","elem","temp","concat","splitPath","splitStr","pop","foundElement","find","results","isInterpolated","intervalTime","timeRange","targetName","displayName","encodeURIComponent","internalStream","restGetWebId","webidresponse","restPost","processResults","maxDataPoints","getSummaryUrl","datarsp","datarspa","targetResults","targetResult","headers","assetPath","cachedWebId","webidCache","set","batch","serverId","databaseId","InstanceType","elementId","querystring","filter1","filter2","doFilter","m","exec","lastIndex","groupIndex","isAf","isAttribute","DataSourceApi","plugin","DataSourcePlugin","setConfigEditor","setQueryEditor","setAnnotationQueryCtrl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AAMhO,EAAOkL,SAAWlL,EAAOA,SAE1DiW,CACR,IAVMvQ,QAAQC,QAAQ,CAAC,CAAE7G,MAAOkB,EAAOA,OAAQgO,KAAMhO,EAAOkL,SAAWlL,EAAOA,SAgClF,uFAzrCH,GAAwCuY,EAAAA,eCvC3BC,GAAS,IAAIC,EAAAA,iBACxB7L,IAEC8L,gBAAgB/Y,GAChBgZ,eAAezU,GACf0U,uBAAuBhb","sources":["webpack:///external amd \"react\"","webpack:///external amd \"@grafana/ui\"","webpack:///external amd \"@grafana/data\"","webpack:///external amd \"lodash\"","webpack:///external amd \"@grafana/runtime\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./AnnotationsQueryCtrl.ts","webpack:///./ConfigEditor.tsx","webpack:///./components/Forms.tsx","webpack:///./types.ts","webpack:///./components/QueryEditorModeSwitcher.tsx","webpack:///./QueryEditor.tsx","webpack:///./datasource.ts","webpack:///./module.ts"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export class AnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n\n $scope: any;\n annotation: any;\n datasource: any;\n\n /** @ngInject */\n constructor($scope: any) {\n this.$scope = $scope;\n this.annotation = $scope.ctrl.annotation;\n this.datasource = $scope.ctrl.datasource;\n\n // load defaults\n this.annotation.query = this.annotation.query || {};\n this.annotation.databases = this.annotation.databases || [];\n this.annotation.templates = this.annotation.templates || [];\n this.annotation.regex = this.annotation.regex || {};\n this.annotation.attribute = this.annotation.attribute || {};\n this.annotation.showEndTime = this.annotation.showEndTime || false;\n\n this.datasource.getAssetServer(this.datasource.afserver.name).then((result: any) => {\n return this.getDatabases(result.WebId);\n });\n }\n templateChanged() {\n // do nothing\n }\n databaseChanged() {\n this.annotation.templates = [];\n this.getEventFrames();\n }\n getDatabases(webid: string) {\n var ctrl = this;\n ctrl.datasource.getDatabases(webid).then((dbs: any) => {\n ctrl.annotation.databases = dbs;\n this.$scope.$apply();\n });\n }\n getEventFrames() {\n var ctrl = this;\n ctrl.datasource.getEventFrameTemplates(this.annotation.database.WebId).then((templates: any) => {\n ctrl.annotation.templates = templates;\n this.$scope.$apply();\n });\n }\n}\n","import React, { ChangeEvent, PureComponent } from 'react';\nimport { LegacyForms, DataSourceHttpSettings } from '@grafana/ui';\nimport { DataSourcePluginOptionsEditorProps, DataSourceJsonData, DataSourceSettings } from '@grafana/data';\nimport { PIWebAPIDataSourceJsonData } from './types';\n\nconst { FormField } = LegacyForms;\n\ninterface Props extends DataSourcePluginOptionsEditorProps {}\n\nconst coerceOptions = (\n options: DataSourceSettings\n): DataSourceSettings => {\n return {\n ...options,\n jsonData: {\n ...options.jsonData,\n url: options.url,\n },\n };\n};\n\ninterface State {}\n\nexport class PIWebAPIConfigEditor extends PureComponent {\n onPIServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n piserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFServerChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afserver: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onAFDatabaseChange = (event: ChangeEvent) => {\n const { onOptionsChange, options } = this.props;\n const jsonData = {\n ...options.jsonData,\n afdatabase: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n\n onMyOptionsChange = (options: DataSourceSettings) => {\n const { onOptionsChange } = this.props;\n onOptionsChange(coerceOptions(options));\n };\n\n render() {\n const { options: originalOptions } = this.props;\n const options = coerceOptions(originalOptions);\n\n return (\n
\n \n\n

PI/AF Connection Details

\n\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n );\n }\n}\n","import React, { InputHTMLAttributes, FunctionComponent } from 'react';\nimport { InlineFormLabel } from '@grafana/ui';\n\nexport interface Props extends InputHTMLAttributes {\n label: string;\n tooltip?: string;\n labelWidth?: number;\n children?: React.ReactNode;\n queryEditor?: JSX.Element;\n}\n\nexport const QueryField: FunctionComponent> = ({ label, labelWidth = 12, tooltip, children }) => (\n <>\n \n {label}\n \n {children}\n \n);\n\nexport const QueryRowTerminator = () => {\n return (\n
\n
\n
\n );\n};\n\nexport const QueryInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryEditorRow = (props: Partial) => {\n return (\n
\n {props.children}\n \n
\n );\n};\n\nexport const QueryRawInlineField = ({ ...props }) => {\n return (\n \n \n \n );\n};\n\nexport const QueryRawEditorRow = (props: Partial) => {\n return <>{props.children};\n};\n","import { DataQuery, DataSourceJsonData } from '@grafana/data';\n\nexport interface PIWebAPISelectableValue {\n webId?: string;\n value?: string;\n type?: string;\n expandable?: boolean;\n}\n\nexport interface PIWebAPIAnnotationsQuery extends DataQuery {\n target: string;\n}\n\nexport interface PIWebAPIQuery extends DataQuery {\n target: string;\n elementPath: string;\n attributes: any[];\n segments: any[];\n display: any;\n interpolate: any;\n recordedValues: any;\n digitalStates: any;\n webid: string;\n webids: string[];\n regex: any;\n summary: any;\n expression: string;\n isPiPoint: boolean;\n rawQuery?: boolean;\n query?: string;\n}\n\nexport const defaultQuery: Partial = {\n target: ';',\n attributes: [],\n segments: [],\n regex: { enable: false },\n summary: { types: [], basis: 'EventWeighted', interval: '', nodata: 'Null' },\n expression: '',\n interpolate: { enable: false },\n recordedValues: { enable: false },\n digitalStates: { enable: false },\n isPiPoint: false,\n};\n\n/**\n * These are options configured for each DataSource instance\n */\nexport interface PIWebAPIDataSourceJsonData extends DataSourceJsonData {\n url?: string;\n access?: string;\n piserver?: string;\n afserver?: string;\n afdatabase?: string;\n}\n\n/**\n * Value that is used in the backend, but never sent over HTTP to the frontend\n */\nexport interface PIWebAPISecureJsonData {\n apiKey?: string;\n}\n","import React, { useEffect, useState } from 'react';\nimport { Button, ConfirmModal } from '@grafana/ui';\n\ntype Props = {\n isRaw: boolean;\n onChange: (newIsRaw: boolean) => void;\n};\n\nexport const QueryEditorModeSwitcher = ({ isRaw, onChange }: Props): JSX.Element => {\n const [isModalOpen, setModalOpen] = useState(false);\n\n useEffect(() => {\n // if the isRaw changes, we hide the modal\n setModalOpen(false);\n }, [isRaw]);\n\n if (isRaw) {\n return (\n <>\n {\n // we show the are-you-sure modal\n setModalOpen(true);\n }}\n >\n {\n onChange(false);\n }}\n onDismiss={() => {\n setModalOpen(false);\n }}\n />\n \n );\n } else {\n return (\n {\n onChange(true);\n }}\n >\n );\n }\n};\n","import { each, filter, forOwn, join, reduce, map, slice, remove, defaults } from 'lodash';\n\nimport React, { PureComponent, ChangeEvent } from 'react';\nimport { Icon, InlineField, InlineFieldRow, InlineSwitch, Input, SegmentAsync, Segment } from '@grafana/ui';\nimport { QueryEditorProps, SelectableValue, VariableModel } from '@grafana/data';\n\nimport { PiWebAPIDatasource } from './datasource';\nimport { QueryInlineField, QueryRawInlineField, QueryRowTerminator } from './components/Forms';\nimport { PIWebAPISelectableValue, PIWebAPIDataSourceJsonData, PIWebAPIQuery, defaultQuery } from './types';\nimport { QueryEditorModeSwitcher } from 'components/QueryEditorModeSwitcher';\n\nconst LABEL_WIDTH = 24;\nconst MIN_ELEM_INPUT_WIDTH = 200;\nconst MIN_ATTR_INPUT_WIDTH = 250;\n\ninterface State {\n isPiPoint: boolean;\n segments: Array>;\n attributes: Array>;\n summaries: Array>;\n attributeSegment: SelectableValue;\n summarySegment: SelectableValue;\n calculationBasisSegment: SelectableValue;\n noDataReplacementSegment: SelectableValue;\n}\n\ntype Props = QueryEditorProps;\n\nconst REMOVE_LABEL = '-REMOVE-';\n\nconst CustomLabelComponent = (props: any) => {\n if (props.value) {\n return (\n
\n {props.label ?? '--no label--'}\n
\n );\n }\n return (\n \n \n \n );\n};\n\nexport class PIWebAPIQueryEditor extends PureComponent {\n error: any;\n piServer: any[] = [];\n availableAttributes: any = {};\n summaryTypes: string[];\n calculationBasis: string[];\n noDataReplacement: string[];\n state: State = {\n isPiPoint: false,\n segments: [],\n attributes: [],\n summaries: [],\n attributeSegment: {},\n summarySegment: {},\n calculationBasisSegment: {},\n noDataReplacementSegment: {},\n };\n\n constructor(props: any) {\n super(props);\n this.onSegmentChange = this.onSegmentChange.bind(this);\n this.calcBasisValueChanged = this.calcBasisValueChanged.bind(this);\n this.calcNoDataValueChanged = this.calcNoDataValueChanged.bind(this);\n this.onSummaryAction = this.onSummaryAction.bind(this);\n this.onSummaryValueChanged = this.onSummaryValueChanged.bind(this);\n this.onAttributeAction = this.onAttributeAction.bind(this);\n this.onAttributeChange = this.onAttributeChange.bind(this);\n\n this.summaryTypes = [\n // 'None', // A summary type is not specified.\n 'Total', // A totalization over the time range.\n 'Average', // The average value over the time range.\n 'Minimum', // The minimum value over the time range.\n 'Maximum', // The maximum value over the time range.\n 'Range', // The range value over the time range (minimum-maximum).\n 'StdDev', // The standard deviation over the time range.\n 'PopulationStdDev', // The population standard deviation over the time range.\n 'Count', // The sum of event count over the time range when calculation basis is event weighted. The sum of event time duration over the time range when calculation basis is time weighted.\n 'PercentGood', // Percent of data with good value during the calculation period. For time weighted calculations, the percentage is based on time. For event weighted calculations, the percent is based on event count.\n 'All', // A convenience for requesting all available summary calculations.\n 'AllForNonNumeric', // A convenience for requesting all available summary calculations for non-numeric data.\n ];\n\n this.calculationBasis = [\n 'TimeWeighted', // Weight the values in the calculation by the time over which they apply. Interpolation is based on whether the attribute is stepped. Interpolated events are generated at the boundaries if necessary.\n 'EventWeighted', // Evaluate values with equal weighting for each event. No interpolation is done. There must be at least one event within the time range to perform a successful calculation. Two events are required for standard deviation. In handling events at the boundary of the calculation, the AFSDK uses following rules:\n 'TimeWeightedContinuous', // Apply weighting as in TimeWeighted, but do all interpolation between values as if they represent continuous data, (standard interpolation) regardless of whether the attribute is stepped.\n 'TimeWeightedDiscrete', // Apply weighting as in TimeWeighted but interpolation between values is performed as if they represent discrete, unrelated values (stair step plot) regardless of the attribute is stepped.\n 'EventWeightedExcludeMostRecentEvent', // The calculation behaves the same as _EventWeighted_, except in the handling of events at the boundary of summary intervals in a multiple intervals calculation. Use this option to prevent events at the intervals boundary from being double count at both intervals. With this option, events at the end time (most recent time) of an interval is not used in that interval.\n 'EventWeightedExcludeEarliestEvent', // Similar to the option _EventWeightedExcludeMostRecentEvent_. Events at the start time(earliest time) of an interval is not used in that interval.\n 'EventWeightedIncludeBothEnds', // Events at both ends of the interval boundaries are included in the event weighted calculation.\n ];\n\n this.noDataReplacement = [\n 'Null', // replace with nulls\n 'Drop', // drop items\n 'Previous', // use previous value if available\n '0', // replace with 0\n 'Keep', // Keep value\n ];\n }\n\n // is selected segment empty\n isValueEmpty(value: PIWebAPISelectableValue | undefined) {\n return !value || !value.value || !value.value.length || value.value === REMOVE_LABEL;\n }\n\n segmentChangeValue = (segments: Array>) => {\n const query = this.props.query;\n this.setState({ segments }, () => this.onChange({ ...query, segments }));\n };\n\n attributeChangeValue = (attributes: Array>) => {\n const query = this.props.query;\n this.setState({ attributes }, () => this.onChange({ ...query, attributes }));\n };\n\n // summary calculation basis change event\n calcBasisValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.basis = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get summary calculation basis user interface segments\n getCalcBasisSegments() {\n const segments = map(this.calculationBasis, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // no data change event\n calcNoDataValueChanged(segment: SelectableValue) {\n const metricsQuery = this.props.query as PIWebAPIQuery;\n const summary = metricsQuery.summary;\n summary.nodata = segment.value?.value;\n this.onChange({ ...metricsQuery, summary });\n }\n // get no data user interface segments\n getNoDataSegments() {\n var segments = map(this.noDataReplacement, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n return segments;\n }\n\n // summary query change event\n onSummaryValueChanged(item: SelectableValue, index: number) {\n const summaries = this.state.summaries.slice(0) as Array>;\n summaries[index] = item;\n if (this.isValueEmpty(item.value)) {\n summaries.splice(index, 1);\n }\n this.setState({ summaries }, this.stateCallback);\n }\n // get the list of summaries available\n getSummarySegments() {\n const ctrl = this;\n const summaryTypes = filter(ctrl.summaryTypes, (type) => {\n return this.state.summaries.map((s) => s.value?.value).indexOf(type) === -1;\n });\n var segments = map(summaryTypes, (item: string) => {\n let selectableValue: SelectableValue = {\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n };\n return selectableValue;\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n }\n\n // remove a summary from the user interface and the query\n removeSummary(part: SelectableValue) {\n const summaries = filter(this.state.summaries, (item: SelectableValue) => {\n return item !== part;\n });\n this.setState({ summaries });\n }\n // add a new summary to the query\n onSummaryAction(item: SelectableValue) {\n const summaries = this.state.summaries.slice(0) as Array>;\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: true,\n },\n };\n summaries.push(selectableValue);\n }\n this.setState({ summarySegment: {}, summaries }, this.stateCallback);\n }\n\n // remove an attribute from the query\n removeAttribute(part: SelectableValue) {\n const attributes = filter(this.state.attributes, (item: SelectableValue) => {\n return item !== part;\n });\n this.attributeChangeValue(attributes);\n }\n // add an attribute to the query\n onAttributeAction(item: SelectableValue) {\n const { query } = this.props;\n const attributes = this.state.attributes.slice(0);\n // if value is not empty, add new attribute segment\n if (!this.isValueEmpty(item.value)) {\n let selectableValue: SelectableValue = {\n label: item.label,\n value: {\n value: item.value?.value,\n expandable: !query.isPiPoint,\n },\n };\n attributes.push(selectableValue);\n }\n this.attributeChangeValue(attributes);\n }\n\n // pi point change event\n onPiPointChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n remove(attributes, (value, n) => n === index);\n } else {\n // set current value\n attributes[index] = item;\n }\n\n this.checkPiPointSegments(item, attributes);\n };\n // attribute change event\n onAttributeChange = (item: SelectableValue, index: number) => {\n let attributes = this.state.attributes.slice(0);\n\n // set current value\n attributes[index] = item;\n\n this.checkAttributeSegments(attributes, this.state.segments);\n };\n // segment change\n onSegmentChange = (item: SelectableValue, index: number) => {\n const { query } = this.props;\n let segments = this.state.segments.slice(0);\n\n if (item.label === REMOVE_LABEL) {\n segments = slice(segments, 0, index);\n this.checkAttributeSegments([], segments);\n if (segments.length === 0) {\n segments.push({\n label: '',\n });\n } else if (!!segments[segments.length - 1].value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n if (query.isPiPoint) {\n this.piServer = [];\n }\n this.segmentChangeValue(segments);\n return;\n }\n\n // set current value\n segments[index] = item;\n\n // Accept only one PI server\n if (query.isPiPoint) {\n this.piServer.push(item);\n this.segmentChangeValue(segments);\n return;\n }\n\n // changed internal selection\n if (index < segments.length - 1) {\n segments = slice(segments, 0, index + 1);\n }\n this.checkAttributeSegments([], segments);\n // add new options\n if (!!item.value?.expandable) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n this.segmentChangeValue(segments);\n };\n\n // get a ui segment for the attributes\n getElementSegments = (\n index: number,\n currentSegment?: Array>\n ): Promise>> => {\n const { datasource, query, data } = this.props;\n var ctrl = this;\n var findQuery = query.isPiPoint\n ? { type: 'dataserver' }\n : { path: this.getSegmentPathUpTo(currentSegment ?? this.state.segments.slice(0), index) };\n\n if (!query.isPiPoint) {\n if (datasource.afserver?.name && index === 0) {\n return Promise.resolve([\n {\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n },\n ]);\n }\n if (datasource.afserver?.name && datasource.afdatabase?.name && index === 1) {\n return Promise.resolve([\n {\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n },\n ]);\n }\n\n // if (!findQuery.path?.length) {\n // return Promise.resolve([]);\n // }\n }\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n var altSegments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n label: item.text,\n value: {\n webId: item.WebId,\n value: item.text,\n expandable: !query.isPiPoint && item.expandable,\n },\n };\n return selectableValue;\n });\n\n if (altSegments.length === 0) {\n return altSegments;\n }\n\n // add template variables\n const variables = datasource.templateSrv.getVariables();\n each(variables, (variable: VariableModel) => {\n let selectableValue: SelectableValue = {\n label: '${' + variable.name + '}',\n value: {\n type: 'template',\n value: '${' + variable.name + '}',\n expandable: !query.isPiPoint,\n },\n };\n altSegments.unshift(selectableValue);\n });\n\n altSegments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return altSegments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return [];\n });\n };\n\n // get the list of attributes for the user interface - PI\n getAttributeSegmentsPI = (attributeText?: string): Promise>> => {\n const { datasource, query, data } = this.props;\n const ctrl = this;\n const findQuery = {\n path: '',\n webId: this.getSelectedPIServer(),\n pointName: (attributeText ?? '') + '*',\n type: 'pipoint',\n };\n let segments: Array> = [];\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: query.isPiPoint }))\n .then((items: any[]) => {\n segments = map(items, (item: any) => {\n let selectableValue: SelectableValue = {\n path: item.Path,\n label: item.text,\n value: {\n value: item.text,\n expandable: false,\n },\n };\n return selectableValue;\n });\n segments.unshift({\n label: attributeText,\n value: {\n value: attributeText,\n expandable: false,\n },\n });\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n return segments;\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n return segments;\n });\n };\n\n // get the list of attributes for the user interface - AF\n getAttributeSegmentsAF = (attributeText?: string): Array> => {\n const ctrl = this;\n let segments: Array> = [];\n\n forOwn(ctrl.availableAttributes, (val: any, key: string) => {\n let selectableValue: SelectableValue = {\n label: key,\n value: {\n value: key,\n expandable: true,\n },\n };\n segments.push(selectableValue);\n });\n\n segments.unshift({\n label: REMOVE_LABEL,\n value: {\n value: REMOVE_LABEL,\n },\n });\n\n return segments;\n };\n\n // build data from target string\n buildFromTarget = (\n query: PIWebAPIQuery,\n segmentsArray: Array>,\n attributesArray: Array>\n ) => {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segmentsArray.push({\n label: item,\n value: {\n value: item,\n expandable: true,\n },\n });\n });\n each(splitAttributes, (item, _) => {\n if (item !== '') {\n // set current value\n attributesArray.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n return this.getElementSegments(splitElements.length + 1, segmentsArray).then((elements) => {\n if (elements.length > 0) {\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n return segmentsArray;\n });\n }\n return Promise.resolve(segmentsArray);\n };\n\n /**\n * Gets the segment information and parses it to a string.\n *\n * @param {any} index - Last index of segment to use.\n * @returns - AF Path or PI Point name.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSegmentPathUpTo(segments: Array>, index: number): string {\n var arr = segments.slice(0, index);\n\n return reduce(\n arr,\n (result: any, segment: SelectableValue) => {\n if (!segment.value) {\n return '';\n }\n if (!segment.value.value?.startsWith('-Select')) {\n return result ? result + '\\\\' + segment.value.value : segment.value.value;\n }\n return result;\n },\n ''\n );\n }\n\n /**\n * Get the current AF Element's child attributes. Validates when the element selection changes.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAttributeSegments(\n attributes: Array>,\n segments: Array>\n ): Promise {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: this.getSegmentPathUpTo(segments.slice(0), segments.length),\n type: 'attributes',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: false }))\n .then((attributesResponse: any) => {\n var validAttributes: any = {};\n\n each(attributesResponse, (attribute: any) => {\n validAttributes[attribute.Path.substring(attribute.Path.indexOf('|') + 1)] = attribute.WebId;\n });\n\n var filteredAttributes = filter(attributes, (attrib: SelectableValue) => {\n const changedValue = datasource.templateSrv.replace(attrib.value?.value);\n return validAttributes[changedValue] !== undefined;\n });\n\n ctrl.availableAttributes = validAttributes;\n this.attributeChangeValue(filteredAttributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n this.attributeChangeValue(attributes);\n });\n }\n\n /**\n * Get PI points from server.\n *\n * @returns - Collection of attributes.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkPiPointSegments(\n attribute: SelectableValue,\n attributes: Array>\n ) {\n const { datasource, data } = this.props;\n var ctrl = this;\n var findQuery = {\n path: attribute.path,\n webId: ctrl.getSelectedPIServer(),\n pointName: attribute.label,\n type: 'pipoint',\n };\n return datasource\n .metricFindQuery(findQuery, Object.assign(data?.request?.scopedVars ?? {}, { isPiPoint: true }))\n .then(() => {\n ctrl.attributeChangeValue(attributes);\n })\n .catch((err: any) => {\n ctrl.error = err.message || 'Failed to issue metric query';\n ctrl.attributeChangeValue([]);\n });\n }\n\n /**\n * Gets the webid of the current selected pi data server.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n getSelectedPIServer() {\n var webID = '';\n\n this.piServer.forEach((s) => {\n var parts = this.props.query.target.split(';');\n if (parts.length >= 2) {\n if (parts[0] === s.text) {\n webID = s.WebId;\n return;\n }\n }\n });\n return this.piServer.length > 0 ? this.piServer[0].value?.webId : webID;\n }\n\n /**\n * Queries PI Web API for child elements and attributes when the raw query text editor is changed.\n *\n * @memberOf PIWebAPIQueryEditor\n */\n textEditorChanged() {\n const { query, onChange } = this.props;\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes.length > 0 ? splitAttributes[0].split('\\\\') : [];\n\n let segments: Array> = [];\n let attributes: Array> = [];\n\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n each(splitElements, (item, _) => {\n segments.push({\n label: item,\n value: {\n type: item.match(/\\${\\w+}/gi) ? 'template' : undefined,\n value: item,\n expandable: true,\n },\n });\n });\n this.getElementSegments(splitElements.length + 1, segments).then((elements) => {\n if (elements.length > 0) {\n segments.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n }\n });\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n this.updateArray(segments, attributes, this.state.summaries, query.isPiPoint, () => {\n onChange({ ...query, query: undefined, rawQuery: false });\n });\n } else {\n segments = this.checkAfServer();\n this.updateArray(segments, this.state.attributes, this.state.summaries, query.isPiPoint, () => {\n this.onChange({\n ...query,\n query: undefined,\n rawQuery: false,\n attributes: this.state.attributes,\n segments: this.state.segments,\n });\n });\n }\n }\n\n /**\n * Check if the AF server and database are configured in the datasoure config.\n *\n * @returns the segments array\n *\n * @memberOf PIWebAPIQueryEditor\n */\n checkAfServer = () => {\n const { datasource } = this.props;\n const segmentsArray = [];\n if (datasource.afserver?.name) {\n segmentsArray.push({\n label: datasource.afserver.name,\n value: {\n value: datasource.afserver.name,\n expandable: true,\n },\n });\n if (datasource.afdatabase?.name) {\n segmentsArray.push({\n label: datasource.afdatabase.name,\n value: {\n value: datasource.afdatabase.name,\n expandable: true,\n },\n });\n }\n segmentsArray.push({\n label: 'Select Element',\n value: {\n value: '-Select Element-',\n },\n });\n } else {\n segmentsArray.push({\n label: '',\n });\n }\n return segmentsArray;\n };\n\n /**\n * Update the internal state of the datasource.\n *\n * @param segmentsArray the segments array to update\n * @param attributesArray the AF attributes array to update\n * @param summariesArray the summaries array to update\n * @param isPiPoint the is PI point flag\n * @param cb optional callback function\n *\n * @memberOf PIWebAPIQueryEditor\n */\n updateArray = (\n segmentsArray: Array>,\n attributesArray: Array>,\n summariesArray: Array>,\n isPiPoint: boolean,\n cb?: (() => void) | undefined\n ) => {\n this.setState(\n {\n segments: segmentsArray,\n attributes: attributesArray,\n summaries: summariesArray,\n isPiPoint,\n },\n () =>\n this.checkAttributeSegments(attributesArray, this.state.segments).then(() => {\n if (cb) {\n cb();\n }\n })\n );\n };\n\n // React action when component is initialized/updated\n scopedVarsDone = false;\n componentDidMount = () => {\n this.initialLoad(false);\n };\n\n componentDidUpdate = () => {\n const { query } = this.props;\n if (this.props.data?.state === 'Done' && !!this.props.data?.request?.scopedVars && !this.scopedVarsDone) {\n this.scopedVarsDone = true;\n this.initialLoad(!query.isPiPoint);\n }\n };\n\n initialLoad = (force: boolean) => {\n const { query } = this.props;\n const metricsQuery = defaults(query, defaultQuery) as PIWebAPIQuery;\n const { segments, attributes, summary, isPiPoint } = metricsQuery;\n\n let segmentsArray: Array> = force ? [] : segments?.slice(0) ?? [];\n let attributesArray: Array> = force ? [] : attributes?.slice(0) ?? [];\n let summariesArray = summary?.types ?? [];\n\n if (!isPiPoint && segmentsArray.length === 0) {\n if (query.target && query.target.length > 0 && query.target !== ';') {\n attributesArray = [];\n // Build query from target\n this.buildFromTarget(query, segmentsArray, attributesArray)\n .then((_segmentsArray) => {\n this.updateArray(_segmentsArray, attributesArray, summariesArray, isPiPoint);\n })\n .catch((e) => console.error(e));\n return;\n } else {\n segmentsArray = this.checkAfServer();\n }\n } else if (isPiPoint && segmentsArray.length > 0) {\n this.piServer = segmentsArray;\n }\n this.updateArray(segmentsArray, attributesArray, summariesArray, isPiPoint, () => {\n this.onChange(query);\n });\n };\n\n onChange = (query: PIWebAPIQuery) => {\n const { onChange, onRunQuery } = this.props;\n\n query.summary.types = this.state.summaries;\n if (query.rawQuery) {\n query.target = query.query ?? '';\n\n if (query.target !== '') {\n const splitAttributes = query.target.split(';');\n const splitElements = splitAttributes[0].split('\\\\');\n\n // remove element hierarchy from attribute collection\n splitAttributes.splice(0, 1);\n\n query.attributes = [];\n if (splitElements.length > 1 || (splitElements.length === 1 && splitElements[0] !== '')) {\n query.elementPath = splitElements.join('\\\\');\n each(splitAttributes, function (item, index) {\n if (item !== '') {\n query.attributes.push({\n label: item,\n value: {\n value: item,\n expandable: false,\n },\n });\n }\n });\n }\n }\n\n console.log(query.elementPath);\n } else {\n query.elementPath = this.getSegmentPathUpTo(this.state.segments, this.state.segments.length);\n query.target =\n query.elementPath +\n ';' +\n join(\n query.attributes.map((s) => s.value?.value),\n ';'\n );\n\n console.log(query.elementPath);\n }\n\n onChange(query);\n\n if (query.target && query.target.length > 0 && query.attributes.length > 0) {\n onRunQuery();\n }\n };\n\n stateCallback = () => {\n const query = this.props.query as PIWebAPIQuery;\n this.onChange(query);\n };\n\n onIsPiPointChange = (event: React.SyntheticEvent) => {\n const { query: queryChange } = this.props;\n const isPiPoint = !queryChange.isPiPoint;\n this.setState(\n {\n segments: isPiPoint ? [{ label: '' }] : this.checkAfServer(),\n attributes: [],\n isPiPoint,\n },\n () => {\n this.onChange({\n ...queryChange,\n expression: '',\n attributes: this.state.attributes,\n segments: this.state.segments,\n isPiPoint,\n });\n }\n );\n };\n\n render() {\n const { query: queryProps, onChange, onRunQuery } = this.props;\n const metricsQuery = defaults(queryProps, defaultQuery) as PIWebAPIQuery;\n const {\n interpolate,\n query,\n rawQuery,\n digitalStates,\n recordedValues,\n expression,\n isPiPoint,\n summary,\n display,\n regex,\n } = metricsQuery;\n\n return (\n <>\n \n \n \n\n {!!rawQuery && (\n \n \n ) =>\n onChange({ ...metricsQuery, query: event.target.value })\n }\n placeholder=\"enter query\"\n />\n \n this.textEditorChanged()} />\n \n )}\n\n {!rawQuery && (\n <>\n
\n \n {this.state.segments.map((segment: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSegmentChange(item, index)}\n loadOptions={(query?: string | undefined) => {\n return this.getElementSegments(index);\n }}\n allowCustomValue\n inputMinWidth={MIN_ELEM_INPUT_WIDTH}\n />\n );\n })}\n \n {!isPiPoint && (\n {\n onChange({ ...metricsQuery, query: metricsQuery.target, rawQuery: value });\n }}\n />\n )}\n \n
\n\n \n {this.state.attributes.map((attribute: SelectableValue, index: number) => {\n if (isPiPoint) {\n return (\n }\n disabled={this.piServer.length === 0}\n onChange={(item) => this.onPiPointChange(item, index)}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n }\n return (\n }\n disabled={this.state.segments.length <= 2}\n onChange={(item) => this.onAttributeChange(item, index)}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n );\n })}\n\n {isPiPoint && (\n \n }\n disabled={this.piServer.length === 0}\n onChange={this.onAttributeAction}\n loadOptions={this.getAttributeSegmentsPI}\n reloadOptionsOnChange\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n {!isPiPoint && (\n \n }\n disabled={this.state.segments.length <= 2}\n onChange={this.onAttributeAction}\n options={this.getAttributeSegmentsAF()}\n allowCustomValue\n inputMinWidth={MIN_ATTR_INPUT_WIDTH}\n />\n )}\n \n \n )}\n\n {!isPiPoint && (\n \n ) =>\n this.onChange({ ...metricsQuery, expression: event.target.value })\n }\n placeholder=\"'.'*2\"\n />\n \n )}\n\n \n \n ) =>\n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, maxNumber: parseInt(event.target.value, 10) },\n })\n }\n type=\"number\"\n placeholder=\"1000\"\n />\n \n \n \n this.onChange({\n ...metricsQuery,\n recordedValues: { ...recordedValues, enable: !recordedValues.enable },\n })\n }\n />\n \n \n \n this.onChange({ ...metricsQuery, digitalStates: { ...digitalStates, enable: !digitalStates.enable } })\n }\n />\n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n \n this.onChange({ ...metricsQuery, interpolate: { ...interpolate, enable: !interpolate.enable } })\n }\n />\n \n \n }\n onChange={this.calcNoDataValueChanged}\n options={this.getNoDataSegments()}\n allowCustomValue\n />\n \n \n\n \n \n ) =>\n onChange({ ...metricsQuery, summary: { ...summary, interval: event.target.value } })\n }\n placeholder=\"30s\"\n />\n \n \n }\n onChange={this.calcBasisValueChanged}\n options={this.getCalcBasisSegments()}\n allowCustomValue\n />\n \n \n \n {this.state.summaries.map((s: SelectableValue, index: number) => {\n return (\n }\n onChange={(item) => this.onSummaryValueChanged(item, index)}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n );\n })}\n \n }\n onChange={this.onSummaryAction}\n options={this.getSummarySegments()}\n allowCustomValue\n />\n \n \n \n\n \n \n ) =>\n this.onChange({ ...metricsQuery, display: event.target.value })\n }\n placeholder=\"Display\"\n />\n \n \n {\n this.onChange({ ...metricsQuery, regex: { ...regex, enable: !regex.enable } });\n }}\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, search: event.target.value } })\n }\n placeholder=\"(.*)\"\n />\n \n \n ) =>\n this.onChange({ ...metricsQuery, regex: { ...regex, replace: event.target.value } })\n }\n placeholder=\"$1\"\n />\n \n \n \n );\n }\n}\n","import { curry, each, filter, flatten, forOwn, groupBy, keys, map, uniq } from 'lodash';\n\nimport {\n DataQueryRequest,\n DataQueryResponse,\n DataSourceApi,\n DataSourceInstanceSettings,\n AnnotationEvent,\n toDataFrame,\n MetricFindValue,\n} from '@grafana/data';\nimport { BackendSrv, getBackendSrv, getTemplateSrv, TemplateSrv } from '@grafana/runtime';\n\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\ninterface PiwebapiElementPath {\n path: string;\n variable: string;\n}\n\ninterface PiwebapiInternalRsp {\n data: PiwebapiRsp;\n status: number;\n url: string;\n}\n\ninterface PiwebapTargetRsp {\n refId: string;\n target: string;\n datapoints: any[];\n}\n\ninterface PiwebapiRsp {\n Name?: string;\n InstanceType?: string;\n Items?: PiwebapiRsp[];\n WebId?: string;\n HasChildren?: boolean;\n Path?: string;\n}\n\ninterface PiDataServer {\n name: string | undefined;\n webid: string | undefined;\n}\n\nexport class PiWebAPIDatasource extends DataSourceApi {\n piserver: PiDataServer;\n afserver: PiDataServer;\n afdatabase: PiDataServer;\n\n basicAuth?: string;\n withCredentials?: boolean;\n url: string;\n name: string;\n isProxy = false;\n\n templateSrv: TemplateSrv;\n backendSrv: BackendSrv;\n\n piwebapiurl?: string;\n webidCache: Map = new Map();\n\n error: any;\n\n constructor(instanceSettings: DataSourceInstanceSettings) {\n super(instanceSettings);\n this.basicAuth = instanceSettings.basicAuth;\n this.withCredentials = instanceSettings.withCredentials;\n this.url = instanceSettings.url!;\n this.name = instanceSettings.name;\n this.templateSrv = getTemplateSrv();\n this.backendSrv = getBackendSrv();\n\n this.piwebapiurl = instanceSettings.jsonData.url?.toString();\n this.isProxy = /^http(s)?:\\/\\//.test(this.url) || instanceSettings.jsonData.access === 'proxy';\n\n this.piserver = { name: (instanceSettings.jsonData || {}).piserver, webid: undefined };\n this.afserver = { name: (instanceSettings.jsonData || {}).afserver, webid: undefined };\n this.afdatabase = { name: (instanceSettings.jsonData || {}).afdatabase, webid: undefined };\n\n Promise.all([\n this.getAssetServer(this.afserver.name).then((result: PiwebapiRsp) => (this.afserver.webid = result.WebId)),\n this.getDataServer(this.piserver.name).then((result: PiwebapiRsp) => (this.piserver.webid = result.WebId)),\n this.getDatabase(this.afserver.name ? this.afserver.name + '\\\\' + this.afdatabase.name : undefined).then(\n (result: PiwebapiRsp) => (this.afdatabase.webid = result.WebId)\n ),\n ]);\n }\n\n /**\n * Converts a PIWebAPI Event Frame response to a Grafana Annotation\n *\n * @param {any} annotationOptions - Options data from configuration panel.\n * @param {any} endTime - End time of the Event Frame.\n * @param {any} eventFrame - The Event Frame data.\n * @returns - Grafana Annotation\n *\n * @memberOf PiWebApiDatasource\n */\n private eventFrameToAnnotation(\n annotationOptions: any,\n endTime: any,\n eventFrame: any,\n attributeDataItems: any\n ): AnnotationEvent {\n if (annotationOptions.regex && annotationOptions.regex.enable) {\n eventFrame.Name = eventFrame.Name.replace(\n new RegExp(annotationOptions.regex.search),\n annotationOptions.regex.replace\n );\n }\n\n var attributeText = '';\n if (attributeDataItems) {\n each(attributeDataItems, (attributeData: any) => {\n const attributeValue = attributeData.Value.Value\n ? attributeData.Value.Value.Name || attributeData.Value.Value.Value || attributeData.Value.Value\n : null;\n attributeText += '
' + attributeData.Name + ': ' + attributeValue;\n });\n }\n return {\n annotation: annotationOptions,\n title: (endTime ? 'END ' : annotationOptions.showEndTime ? 'START ' : '') + annotationOptions.name,\n time: new Date(endTime ? eventFrame.EndTime : eventFrame.StartTime).getTime(),\n text:\n eventFrame.Name + attributeText + '
Start: ' + eventFrame.StartTime + '
End: ' + eventFrame.EndTime,\n };\n }\n\n /**\n * Builds the PIWebAPI query parameters.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - PIWebAPI query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private buildQueryParameters(options: DataQueryRequest) {\n options.targets = filter(options.targets, (target) => {\n if (!target || !target.target) {\n return false;\n }\n return !target.target.startsWith('Select AF');\n });\n\n options.targets = map(options.targets, (target) => {\n const ds = this;\n var tar = {\n target: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPath: this.templateSrv.replace(target.elementPath, options.scopedVars),\n elementPathArray: [\n {\n path: this.templateSrv.replace(target.elementPath, options.scopedVars),\n variable: '',\n } as PiwebapiElementPath,\n ],\n attributes: map(target.attributes, (att) =>\n this.templateSrv.replace(att.value?.value || att, options.scopedVars)\n ),\n segments: map(target.segments, (att) => this.templateSrv.replace(att.value?.value, options.scopedVars)),\n display: target.display,\n refId: target.refId,\n hide: target.hide,\n interpolate: target.interpolate || { enable: false },\n recordedValues: target.recordedValues || { enable: false },\n digitalStates: target.digitalStates || { enable: false },\n webid: target.webid,\n webids: target.webids || [],\n regex: target.regex || { enable: false },\n expression: target.expression || '',\n summary: target.summary || { types: [] },\n startTime: options.range.from,\n endTime: options.range.to,\n isPiPoint: target.isPiPoint,\n scopedVars: options.scopedVars,\n };\n\n if (tar.expression) {\n tar.expression = this.templateSrv.replace(tar.expression, options.scopedVars);\n }\n\n if (tar.summary.types !== undefined) {\n tar.summary.types = filter(tar.summary.types, (item) => {\n return item !== undefined && item !== null && item !== '';\n });\n }\n\n // explode All or Multi-selection\n const varsKeys = keys(options.scopedVars);\n this.templateSrv.getVariables().forEach((v: any) => {\n if (ds.isAllSelected(v.current) && varsKeys.indexOf(v.name) < 0) {\n // All selection\n const variables = v.options.filter((o: any) => !o.selected);\n // attributes\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) =>\n !!v.allValue ? attr.replace(v.allValue, vv.value) : attr.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value)\n )\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, v.allValue);\n } else if (Array.isArray(v.current.text) && varsKeys.indexOf(v.name) < 0) {\n // Multi-selection\n const variables = v.options.filter((o: any) => o.selected);\n // attributes\n const query = v.current.value.join(',');\n tar.attributes = tar.attributes.map((attr: string) =>\n variables.map((vv: any) => attr.replace(`{${query}}`, vv.value))\n );\n tar.attributes = uniq(flatten(tar.attributes));\n // elementPath\n tar.elementPathArray = ds.getElementPath(tar.elementPathArray, variables, `{${query}}`);\n }\n });\n\n return tar;\n });\n\n return options;\n }\n\n /**\n * Datasource Implementation. Primary entry point for data source.\n * This takes the panel configuration and queries, sends them to PI Web API and parses the response.\n *\n * @param {any} options - Grafana query and panel options.\n * @returns - Promise of data in the format for Grafana panels.\n *\n * @memberOf PiWebApiDatasource\n */\n async query(options: DataQueryRequest): Promise {\n var ds = this;\n var query = this.buildQueryParameters(options);\n query.targets = filter(query.targets, (t) => !t.hide);\n\n if (query.targets.length <= 0) {\n return Promise.resolve({ data: [] });\n } else {\n return Promise.all(ds.getStream(query)).then((targetResponses) => {\n let flattened: PiwebapTargetRsp[] = [];\n each(targetResponses, (tr) => {\n each(tr, (item) => flattened.push(item));\n });\n const response: DataQueryResponse = {\n data: flattened\n .sort((a, b) => {\n return +(a.target > b.target) || +(a.target === b.target) - 1;\n })\n .map((d) => toDataFrame(d)),\n };\n return response;\n });\n }\n }\n\n /**\n * Datasource Implementation.\n * Used for testing datasource in datasource configuration pange\n *\n * @returns - Success or failure message.\n *\n * @memberOf PiWebApiDatasource\n */\n testDatasource(): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + '/',\n method: 'GET',\n })\n .then((response: any) => {\n if (response.status === 200) {\n return { status: 'success', message: 'Data source is working', title: 'Success' };\n }\n throw new Error('Failed');\n });\n }\n\n /**\n * Datasource Implementation.\n * This queries PI Web API for Event Frames and converts them into annotations.\n *\n * @param {any} options - Annotation options, usually the Event Frame Category.\n * @returns - A Grafana annotation.\n *\n * @memberOf PiWebApiDatasource\n */\n annotationQuery(options: any): Promise {\n if (!this.afdatabase.webid) {\n return Promise.resolve([]);\n }\n\n var categoryName = options.annotation.query.categoryName\n ? this.templateSrv.replace(options.annotation.query.categoryName, options.scopedVars, 'glob')\n : null;\n var nameFilter = options.annotation.query.nameFilter\n ? this.templateSrv.replace(options.annotation.query.nameFilter, options.scopedVars, 'glob')\n : null;\n var templateName = options.annotation.template ? options.annotation.template.Name : null;\n var annotationOptions = {\n name: options.annotation.name,\n datasource: options.annotation.datasource,\n enable: options.annotation.enable,\n iconColor: options.annotation.iconColor,\n showEndTime: options.annotation.showEndTime,\n regex: options.annotation.regex,\n attribute: options.annotation.attribute,\n categoryName: categoryName,\n templateName: templateName,\n nameFilter: nameFilter,\n };\n\n var filter = [];\n if (!!annotationOptions.categoryName) {\n filter.push('categoryName=' + annotationOptions.categoryName);\n }\n if (!!annotationOptions.nameFilter) {\n filter.push('nameFilter=' + annotationOptions.nameFilter);\n }\n if (!!annotationOptions.templateName) {\n filter.push('templateName=' + annotationOptions.templateName);\n }\n if (!filter.length) {\n return Promise.resolve([]);\n }\n filter.push('startTime=' + options.range.from.toJSON());\n filter.push('endTime=' + options.range.to.toJSON());\n\n if (annotationOptions.attribute && annotationOptions.attribute.enable) {\n var resourceUrl =\n this.piwebapiurl + '/streamsets/{0}/value?selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n if (!!annotationOptions.attribute.name) {\n resourceUrl =\n this.piwebapiurl +\n '/streamsets/{0}/value?nameFilter=' +\n annotationOptions.attribute.name +\n '&selectedFields=Items.WebId%3BItems.Value%3BItems.Name';\n }\n var query: any = {};\n query['1'] = {\n Method: 'GET',\n Resource: this.piwebapiurl + '/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&'),\n };\n query['2'] = {\n Method: 'GET',\n RequestTemplate: {\n Resource: resourceUrl,\n },\n Parameters: ['$.1.Content.Items[*].WebId'],\n ParentIds: ['1'],\n };\n return this.restBatch(query).then((result: any) => {\n const data = result.data['1'].Content;\n const valueData = result.data['2'].Content;\n\n var annotations = map(data.Items, (item: any, index: any) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n false,\n item,\n valueData.Items[index].Content.Items\n );\n });\n\n if (options.annotation.showEndTime) {\n var ends = map(data.Items, (item: any, index: number) => {\n return curry(this.eventFrameToAnnotation)(\n annotationOptions,\n true,\n item,\n valueData.Items[index].Content.Items\n );\n });\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n\n return annotations;\n });\n } else {\n return this.restGet('/assetdatabases/' + this.afdatabase.webid + '/eventframes?' + filter.join('&')).then(\n (result) => {\n var annotations = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, false));\n if (options.annotation.showEndTime) {\n var ends = map(result.data.Items, curry(this.eventFrameToAnnotation)(annotationOptions, true));\n each(ends, (end) => {\n annotations.push(end);\n });\n }\n return annotations;\n }\n );\n }\n }\n\n /**\n * Builds the Grafana metric segment for use on the query user interface.\n *\n * @param {any} response - response from PI Web API.\n * @returns - Grafana metric segment.\n *\n * @memberOf PiWebApiDatasource\n */\n private metricQueryTransform(response: PiwebapiRsp[]): MetricFindValue[] {\n return map(response, (item) => {\n return {\n text: item.Name,\n expandable:\n item.HasChildren === undefined || item.HasChildren === true || (item.Path ?? '').split('\\\\').length <= 3,\n HasChildren: item.HasChildren,\n Items: item.Items ?? [],\n Path: item.Path,\n WebId: item.WebId,\n } as MetricFindValue;\n });\n }\n\n /**\n * This method does the discovery of the AF Hierarchy and populates the query user interface segments.\n *\n * @param {any} query - Parses the query configuration and builds a PI Web API query.\n * @returns - Segment information.\n *\n * @memberOf PiWebApiDatasource\n */\n metricFindQuery(query: any, queryOptions: any): Promise {\n var ds = this;\n var querydepth = ['servers', 'databases', 'databaseElements', 'elements'];\n if (typeof query === 'string') {\n query = JSON.parse(query as string);\n }\n if (queryOptions.isPiPoint) {\n query.path = this.templateSrv.replace(query.path, queryOptions);\n } else {\n if (query.path === '') {\n query.type = querydepth[0];\n } else if (query.type !== 'attributes') {\n query.type = querydepth[Math.max(0, Math.min(query.path.split('\\\\').length, querydepth.length - 1))];\n }\n query.path = this.templateSrv.replace(query.path, queryOptions);\n query.path = query.path.replace(/\\{([^\\\\])*\\}/gi, (r: string) => r.substring(1, r.length - 2).split(',')[0]);\n }\n\n query.filter = query.filter ?? '*';\n\n if (query.type === 'servers') {\n return ds.afserver?.name\n ? ds\n .getAssetServer(ds.afserver.name)\n .then((result: PiwebapiRsp) => [result])\n .then(ds.metricQueryTransform)\n : ds.getAssetServers().then(ds.metricQueryTransform);\n } else if (query.type === 'databases') {\n return ds\n .getAssetServer(query.path)\n .then((server) => ds.getDatabases(server.WebId ?? '', {}))\n .then(ds.metricQueryTransform);\n } else if (query.type === 'databaseElements') {\n return ds\n .getDatabase(query.path)\n .then((db) =>\n ds.getDatabaseElements(db.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'elements') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getElements(element.WebId ?? '', {\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Items%3BItems.Path%3BItems.HasChildren',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'attributes') {\n return ds\n .getElement(query.path)\n .then((element) =>\n ds.getAttributes(element.WebId ?? '', {\n searchFullHierarchy: 'true',\n selectedFields: 'Items.WebId%3BItems.Name%3BItems.Path',\n nameFilter: query.filter,\n })\n )\n .then(ds.metricQueryTransform);\n } else if (query.type === 'dataserver') {\n return ds.getDataServers().then(ds.metricQueryTransform);\n } else if (query.type === 'pipoint') {\n return ds.piPointSearch(query.webId, query.pointName).then(ds.metricQueryTransform);\n }\n return Promise.reject('Bad type');\n }\n\n /**\n * Gets the url of summary data from the query configuration.\n *\n * @param {any} summary - Query summary configuration.\n * @returns - URL append string.\n *\n * @memberOf PiWebApiDatasource\n */\n getSummaryUrl(summary: any) {\n if (summary.interval.trim() === '') {\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis\n );\n }\n return (\n '&summaryType=' +\n summary.types.map((s: any) => s.value?.value).join('&summaryType=') +\n '&calculationBasis=' +\n summary.basis +\n '&summaryDuration=' +\n summary.interval.trim()\n );\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} value - A list of PIWebAPI values.\n * @param {any} target - The target Grafana metric.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @returns - An array of Grafana value, timestamp pairs.\n *\n */\n parsePiPointValueList(value: any[], target: any, isSummary: boolean) {\n var api = this;\n var datapoints: any[] = [];\n each(value, (item) => {\n // @ts-ignore\n var { grafanaDataPoint, previousValue, drop } = this.noDataReplace(\n isSummary ? item.Value : item,\n target.summary.nodata,\n api.parsePiPointValue(isSummary ? item.Value : item, target, isSummary)\n );\n if (!drop) {\n datapoints.push(grafanaDataPoint);\n }\n });\n return datapoints;\n }\n\n /**\n * Convert a PI Point value to use Grafana value/timestamp.\n *\n * @param {any} value - PI Point value.\n * @param {any} isSummary - Boolean for tracking if data is of summary class.\n * @param {any} target - The target grafana metric.\n * @returns - Grafana value pair.\n *\n */\n parsePiPointValue(value: any, target: any, isSummary: boolean) {\n let num = !isSummary && typeof value.Value === 'object' ? value.Value?.Value : value.Value;\n\n if (!value.Good || !!target.digitalStates?.enable) {\n num = (!isSummary && typeof value.Value === 'object' ? value.Value?.Name : value.Name) ?? '';\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n return [this.checkNumber(num) ? Number(num) : num.trim(), new Date(value.Timestamp).getTime()];\n }\n\n /**\n * Resolve PIWebAPI response 'value' data to value - timestamp pairs.\n *\n * @param {any} item - 'Item' object from PIWebAPI\n * @param {any} noDataReplacementMode - String state of how to replace 'No Data'\n * @param {any} grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns grafanaDataPoint - Single Grafana value pair (value, timestamp).\n * @returns perviousValue - {any} Grafana value (value only).\n *\n */\n noDataReplace(\n item: any,\n noDataReplacementMode: any,\n grafanaDataPoint: any[]\n ): {\n grafanaDataPoint: any[];\n previousValue: any;\n drop: boolean;\n } {\n var previousValue = null;\n var drop = false;\n if (!item.Good || item.Value === 'No Data' || (item.Value?.Name && item.Value?.Name === 'No Data')) {\n if (noDataReplacementMode === 'Drop') {\n drop = true;\n } else if (noDataReplacementMode === '0') {\n grafanaDataPoint[0] = 0;\n } else if (noDataReplacementMode === 'Keep') {\n // Do nothing keep\n } else if (noDataReplacementMode === 'Null') {\n grafanaDataPoint[0] = null;\n } else if (noDataReplacementMode === 'Previous' && previousValue !== null) {\n grafanaDataPoint[0] = previousValue;\n }\n } else {\n previousValue = item.Value;\n }\n return { grafanaDataPoint, previousValue, drop };\n }\n\n /**\n * Process the response from PI Web API for a single item.\n *\n * @param {any} content - Web response data.\n * @param {any} target - The target grafana metric.\n * @param {any} name - The target metric name.\n * @returns - Parsed metric in target/datapoint json format.\n *\n * @memberOf PiWebApiDatasource\n */\n processResults(content: any, target: any, name: any, noTemplate: boolean): PiwebapTargetRsp[] {\n const api = this;\n const isSummary: boolean = target.summary && target.summary.types && target.summary.types.length > 0;\n name = noTemplate ? name : this.getPath(target.elementPathArray, content.Path) + '|' + name;\n if (target.regex && target.regex.enable && target.regex.search.length && target.regex.replace.length) {\n name = name.replace(new RegExp(target.regex.search), target.regex.replace);\n }\n if (isSummary) {\n var innerResults: any[] = [];\n var groups = groupBy(content.Items, (item: any) => item.Type);\n forOwn(groups, (value, key) => {\n innerResults.push({\n refId: target.refId,\n target: name + '[' + key + ']',\n datapoints: api.parsePiPointValueList(value, target, isSummary),\n });\n });\n return innerResults;\n }\n return [\n {\n refId: target.refId,\n target: name,\n datapoints: api.parsePiPointValueList(content.Items, target, isSummary),\n },\n ];\n }\n\n /** PRIVATE SECTION */\n\n /**\n * Check if all items are selected.\n *\n * @param {any} current the current variable selection\n * @return {boolean} true if all value is selected, false otherwise\n */\n private isAllSelected(current: any): boolean {\n if (!current) {\n return false;\n }\n if (Array.isArray(current.text)) {\n return current.text.indexOf('All') >= 0;\n }\n return current.text === 'All';\n }\n\n /**\n * Check if the value is a number.\n *\n * @param {any} number the value to check\n * @returns {boolean} true if the value is a number, false otherwise\n */\n private checkNumber(number: any): boolean {\n return typeof number === 'number' && !Number.isNaN(number) && Number.isFinite(number);\n }\n\n /**\n * Returns a new element path list based on the panel variables.\n *\n * @param {string} elementPathArray array of element paths\n * @param {string} variables the list of variable values\n * @param {string} allValue the all value value for the variable\n * @returns {PiwebapiElementPath[]} new element path list\n */\n private getElementPath(\n elementPathArray: PiwebapiElementPath[],\n variables: any[],\n allValue: string\n ): PiwebapiElementPath[] {\n // elementPath\n let newElementPathArray: PiwebapiElementPath[] = [];\n elementPathArray.forEach((elem: PiwebapiElementPath) => {\n if ((!!allValue && elem.path.indexOf(allValue) >= 0) || (!allValue && elem.path.match(/{[a-zA-z0-9,-_]+}/gi))) {\n const temp: PiwebapiElementPath[] = variables.map((vv: any) => {\n return {\n path: !!allValue\n ? elem.path.replace(allValue, vv.value)\n : elem.path.replace(/{[a-zA-z0-9,-_]+}/gi, vv.value),\n variable: vv.value,\n } as PiwebapiElementPath;\n });\n newElementPathArray = newElementPathArray.concat(temp);\n }\n });\n if (newElementPathArray.length) {\n return uniq(flatten(newElementPathArray));\n }\n return elementPathArray;\n }\n\n /**\n * Returns the last item of the element path.\n *\n * @param {string} path element path\n * @returns {string} last item of the element path\n */\n private getPath(elementPathArray: PiwebapiElementPath[], path: string): string {\n let splitPath = path.split('|');\n if (splitPath.length === 0) {\n return '';\n }\n if (elementPathArray.length === 0) {\n return '';\n }\n splitPath = splitPath[0].split('\\\\');\n const splitStr = splitPath.length === 0 ? '' : splitPath.pop() ?? '';\n const foundElement = elementPathArray.find((e) => path.indexOf(e.path) >= 0)?.variable;\n return foundElement ? foundElement + '|' + splitStr : splitStr;\n }\n\n /**\n * Gets historical data from a PI Web API stream source.\n *\n * @param {any} query - Grafana query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private getStream(query: any): Array> {\n const ds = this;\n var results: Array> = [];\n\n each(query.targets, (target) => {\n target.attributes = filter(target.attributes || [], (attribute) => {\n return 1 && attribute;\n });\n var url = '';\n var isSummary = target.summary && target.summary.types && target.summary.types.length > 0;\n var isInterpolated = target.interpolate && target.interpolate.enable;\n // perhaps add a check to see if interpolate override time < query.interval\n var intervalTime = target.interpolate.interval ? target.interpolate.interval : query.interval;\n var timeRange = '?startTime=' + query.range.from.toJSON() + '&endTime=' + query.range.to.toJSON();\n var targetName = target.expression || target.elementPath;\n var displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n if (target.expression) {\n url += '/calculation';\n if (isSummary) {\n url += '/summary' + timeRange + (isInterpolated ? '&sampleType=Interval&sampleInterval=' + intervalTime : '');\n } else {\n url += '/intervals' + timeRange + '&sampleInterval=' + intervalTime;\n }\n url += '&expression=' + encodeURIComponent(target.expression);\n if (target.attributes.length > 0) {\n results.push(ds.internalStream(query, target, url));\n } else {\n results.push(\n ds.restGetWebId(target.elementPath, target.isPiPoint).then((webidresponse: any) => {\n return ds\n .restPost(url + webidresponse.WebId)\n .then((response: any) => ds.processResults(response.data, target, displayName || targetName, false))\n .catch((err: any) => (ds.error = err));\n })\n );\n }\n } else {\n url += '/streamsets';\n if (isSummary) {\n url += '/summary' + timeRange + '&intervals=' + query.maxDataPoints + this.getSummaryUrl(target.summary);\n } else if (target.interpolate && target.interpolate.enable) {\n url += '/interpolated' + timeRange + '&interval=' + intervalTime;\n } else if (target.recordedValues && target.recordedValues.enable) {\n const maxNumber =\n target.recordedValues.maxNumber && !isNaN(target.recordedValues.maxNumber)\n ? target.recordedValues.maxNumber\n : 1000;\n url += '/recorded' + timeRange + '&maxCount=' + maxNumber;\n } else {\n url += '/plot' + timeRange + '&intervals=' + query.maxDataPoints;\n }\n\n results.push(ds.internalStream(query, target, url));\n }\n });\n\n return results;\n }\n\n /**\n * Return the data points from the provided Grafana query.\n *\n * @param {any} query - Grafana query.\n * @param {any} target - Grafana query target.\n * @param {string} url - The base URL for the query.\n * @returns - Metric data.\n *\n * @memberOf PiWebApiDatasource\n */\n private internalStream(query: any, target: any, url: string): Promise {\n const ds = this;\n const targetName = target.expression || target.elementPath;\n const displayName = target.display ? this.templateSrv.replace(target.display, query.scopedVars) : null;\n const noTemplate = target.elementPathArray.length === 1 && target.elementPath === target.elementPathArray[0].path;\n let promises: Promise;\n\n if (noTemplate) {\n if (target.attributes.length > 1 && !target.isPiPoint) {\n promises = ds\n .restGetWebId(target.elementPath, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n } else {\n promises = Promise.all(\n map(target.attributes, (attribute: string) =>\n ds.restGetWebId(target.elementPath + '|' + attribute, target.isPiPoint)\n )\n );\n }\n } else {\n if (target.attributes.length > 1 && !target.isPiPoint) {\n promises = Promise.all(\n target.elementPathArray.map((elementPath: PiwebapiElementPath) => {\n return ds\n .restGetWebId(elementPath.path, target.isPiPoint)\n .then((datarsp) =>\n ds.getAttributes(datarsp.WebId!, {\n searchFullHierarchy: 'true',\n nameFilter: '*',\n })\n )\n .then((datarspa) =>\n datarspa.filter(\n (d) =>\n target.attributes.indexOf(d.Name) >= 0 ||\n target.attributes.indexOf(d.Path?.split('|').splice(1).join('|')) >= 0\n )\n );\n })\n );\n } else {\n promises = Promise.all(\n flatten(\n map(target.attributes, (attribute: string) => {\n return target.elementPathArray.map((elementPath: PiwebapiElementPath) =>\n ds.restGetWebId(elementPath.path + '|' + attribute, target.isPiPoint)\n );\n })\n )\n );\n }\n }\n\n return promises.then((webidresponse) => {\n const query: any = {};\n each(flatten(webidresponse), (webid, index) => {\n query[index + 1] = {\n Method: 'GET',\n Resource: ds.piwebapiurl + url + '&webid=' + webid.WebId,\n };\n });\n\n return ds\n .restBatch(query)\n .then((response: any) => {\n const targetResults: any[] = [];\n each(response.data, (value, key) => {\n if (target.expression) {\n const attribute = webidresponse[parseInt(key, 10) - 1].Name;\n each(\n ds.processResults(value.Content, target, displayName || attribute || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n } else {\n each(value.Content.Items, (item) => {\n each(\n ds.processResults(item, target, displayName || item.Name || targetName, noTemplate),\n (targetResult) => targetResults.push(targetResult)\n );\n });\n }\n });\n return targetResults;\n })\n .catch((err: any) => (ds.error = err));\n });\n }\n\n /**\n * Abstraction for calling the PI Web API REST endpoint\n *\n * @param {any} path - the path to append to the base server URL.\n * @returns - The full URL.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGet(path: string): Promise {\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n return response as PiwebapiInternalRsp;\n });\n }\n\n /**\n * Resolve a Grafana query into a PI Web API webid. Uses client side cache when possible to reduce lookups.\n *\n * @param {string} assetPath - The AF Path or the Pi Point Path (\\\\ServerName\\piPointName) to the asset.\n * @param {boolean} isPiPoint - Flag indicating it's a PI Point\n * @returns - URL query parameters.\n *\n * @memberOf PiWebApiDatasource\n */\n private restGetWebId(assetPath: string, isPiPoint: boolean): Promise {\n var ds = this;\n\n // check cache\n var cachedWebId = ds.webidCache.get(assetPath);\n if (cachedWebId) {\n return Promise.resolve({ Path: assetPath, WebId: cachedWebId.WebId, Name: cachedWebId.Name });\n }\n\n let path = '';\n if (isPiPoint) {\n path = '/points?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\' + assetPath.replace('|', '\\\\');\n } else {\n // no cache hit, query server\n path =\n (assetPath.indexOf('|') >= 0\n ? '/attributes?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\'\n : '/elements?selectedFields=WebId%3BName%3BPath&path=\\\\\\\\') + assetPath;\n }\n\n return this.backendSrv\n .datasourceRequest({\n url: this.url + path,\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n })\n .then((response: any) => {\n ds.webidCache.set(assetPath, response.data);\n return { Path: assetPath, WebId: response.data.WebId, Name: response.data.Name };\n });\n }\n\n /**\n * Execute a batch query on the PI Web API.\n *\n * @param {any} batch - Batch JSON query data.\n * @returns - Batch response.\n *\n * @memberOf PiWebApiDatasource\n */\n private restBatch(batch: any) {\n return this.backendSrv.datasourceRequest({\n url: this.url + '/batch',\n data: batch,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n },\n });\n }\n\n /**\n * Execute a POST on the PI Web API.\n *\n * @param {string} path - The full url of the POST.\n * @returns - POST response data.\n *\n * @memberOf PiWebApiDatasource\n */\n private restPost(path: string) {\n return this.backendSrv.datasourceRequest({\n url: this.url,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'message/http',\n 'X-PIWEBAPI-HTTP-METHOD': 'GET',\n 'X-PIWEBAPI-RESOURCE-ADDRESS': path,\n },\n });\n }\n\n // Get a list of all data (PI) servers\n private getDataServers(): Promise {\n return this.restGet('/dataservers').then((response) => response.data.Items ?? []);\n }\n private getDataServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/dataservers?name=' + name).then((response) => response.data);\n }\n // Get a list of all asset (AF) servers\n private getAssetServers(): Promise {\n return this.restGet('/assetservers').then((response) => response.data.Items ?? []);\n }\n private getAssetServer(name: string | undefined): Promise {\n if (!name) {\n return Promise.resolve({});\n }\n return this.restGet('/assetservers?path=\\\\\\\\' + name).then((response) => response.data);\n }\n private getDatabase(path: string | undefined): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/assetdatabases?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getDatabases(serverId: string, options?: any): Promise {\n if (!serverId) {\n return Promise.resolve([]);\n }\n return this.restGet('/assetservers/' + serverId + '/assetdatabases').then((response) => response.data.Items ?? []);\n }\n getElement(path: string): Promise {\n if (!path) {\n return Promise.resolve({});\n }\n return this.restGet('/elements?path=\\\\\\\\' + path).then((response) => response.data);\n }\n getEventFrameTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'EventFrame');\n });\n }\n getElementTemplates(databaseId: string): Promise {\n if (!databaseId) {\n return Promise.resolve([]);\n }\n return this.restGet(\n '/assetdatabases/' + databaseId + '/elementtemplates?selectedFields=Items.InstanceType%3BItems.Name%3BItems.WebId'\n ).then((response) => {\n return filter(response.data.Items ?? [], (item) => item.InstanceType === 'Element');\n });\n }\n\n /**\n * @description\n * Get the child attributes of the current resource.\n * GET attributes/{webId}/attributes\n * @param {string} elementId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.nameFilter - The name query string used for finding attributes. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned attributes must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned attributes must be members of this template. The default is no template filter.\n * @param {string} options.valueType - Specify that returned attributes' value type must be the given value type. The default is no value type filter.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include attributes nested further than the immediate attributes of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {string} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {string} options.showExcluded - Specified if the search should include attributes with the Excluded property set. The default is 'false'.\n * @param {string} options.showHidden - Specified if the search should include attributes with the Hidden property set. The default is 'false'.\n * @param {string} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getAttributes(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/attributes' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET assetdatabases/{webId}/elements\n * @param {string} databaseId - The ID of the parent resource. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getDatabaseElements(databaseId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/assetdatabases/' + databaseId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * @description\n * Retrieve elements based on the specified conditions. By default, this method selects immediate children of the current resource.\n * Users can search for the elements based on specific search parameters. If no parameters are specified in the search, the default values for each parameter will be used and will return the elements that match the default search.\n * GET elements/{webId}/elements\n * @param {string} databaseId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {Object} options - Query Options\n * @param {string} options.webId - The ID of the resource to use as the root of the search. See WebID for more information.\n * @param {string} options.nameFilter - The name query string used for finding objects. The default is no filter. See Query String for more information.\n * @param {string} options.categoryName - Specify that returned elements must have this category. The default is no category filter.\n * @param {string} options.templateName - Specify that returned elements must have this template or a template derived from this template. The default is no template filter.\n * @param {string} options.elementType - Specify that returned elements must have this type. The default type is 'Any'. See Element Type for more information.\n * @param {string} options.searchFullHierarchy - Specifies if the search should include objects nested further than the immediate children of the searchRoot. The default is 'false'.\n * @param {string} options.sortField - The field or property of the object used to sort the returned collection. The default is 'Name'.\n * @param {string} options.sortOrder - The order that the returned collection is sorted. The default is 'Ascending'.\n * @param {number} options.startIndex - The starting index (zero based) of the items to be returned. The default is 0.\n * @param {number} options.maxCount - The maximum number of objects to be returned per call (page size). The default is 1000.\n * @param {string} options.selectedFields - List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.\n */\n private getElements(elementId: string, options: any): Promise {\n var querystring =\n '?' +\n map(options, (value, key) => {\n return key + '=' + value;\n }).join('&');\n\n if (querystring === '?') {\n querystring = '';\n }\n\n return this.restGet('/elements/' + elementId + '/elements' + querystring).then(\n (response) => response.data.Items ?? []\n );\n }\n\n /**\n * Retrieve a list of points on a specified Data Server.\n *\n * @param {string} serverId - The ID of the server. See WebID for more information.\n * @param {string} nameFilter - A query string for filtering by point name. The default is no filter. *, ?, [ab], [!ab]\n */\n private piPointSearch(serverId: string, nameFilter: string): Promise {\n let filter1 = this.templateSrv.replace(nameFilter);\n let filter2 = `${filter1}`;\n let doFilter = false;\n if (filter1 !== nameFilter) {\n const regex = /\\{(\\w|,)+\\}/gs;\n let m;\n while ((m = regex.exec(filter1)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // The result can be accessed through the `m`-variable.\n m.forEach((match, groupIndex) => {\n if (groupIndex === 0) {\n filter1 = filter1.replace(match, match.replace('{', '(').replace('}', ')').replace(',', '|'));\n filter2 = filter2.replace(match, '*');\n doFilter = true;\n }\n });\n }\n }\n return this.restGet('/dataservers/' + serverId + '/points?maxCount=20&nameFilter=' + filter2).then((results) => {\n if (!!results && !!results.data?.Items) {\n return doFilter ? results.data.Items.filter((item) => item.Name?.match(filter1)) : results.data.Items;\n }\n return [];\n });\n }\n\n /**\n * Get the PI Web API webid or PI Point.\n *\n * @param {any} target - AF Path or Point name.\n * @returns - webid.\n *\n * @memberOf PiWebApiDatasource\n */\n getWebId(target: any) {\n var ds = this;\n var isAf = target.target.indexOf('\\\\') >= 0;\n var isAttribute = target.target.indexOf('|') >= 0;\n if (!isAf && target.target.indexOf('.') === -1) {\n return Promise.resolve([{ WebId: target.target, Name: target.display || target.target }]);\n }\n\n if (!isAf) {\n // pi point lookup\n return ds.piPointSearch(this.piserver.webid!, target.target).then((results) => {\n if (results === undefined || results.length === 0) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n return results;\n });\n } else if (isAf && isAttribute) {\n // af attribute lookup\n return ds.restGet('/attributes?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n } else {\n // af element lookup\n return ds.restGet('/elements?path=\\\\\\\\' + target.target).then((results) => {\n if (results.data === undefined || results.status !== 200) {\n return [{ WebId: target.target, Name: target.display || target.target }];\n }\n // rewrite name if specified\n results.data.Name = target.display || results.data.Name;\n return [results.data];\n });\n }\n }\n}\n","import { DataSourcePlugin } from '@grafana/data';\nimport { AnnotationsQueryCtrl } from './AnnotationsQueryCtrl';\nimport { PIWebAPIConfigEditor } from './ConfigEditor';\nimport { PIWebAPIQueryEditor } from './QueryEditor';\nimport { PiWebAPIDatasource } from './datasource';\nimport { PIWebAPIQuery, PIWebAPIDataSourceJsonData } from './types';\n\nexport const plugin = new DataSourcePlugin(\n PiWebAPIDatasource\n)\n .setConfigEditor(PIWebAPIConfigEditor)\n .setQueryEditor(PIWebAPIQueryEditor)\n .setAnnotationQueryCtrl(AnnotationsQueryCtrl);\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__0__","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__3__","__WEBPACK_EXTERNAL_MODULE__5__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","AnnotationsQueryCtrl","$scope","this","annotation","ctrl","datasource","query","databases","templates","regex","attribute","showEndTime","getAssetServer","afserver","name","then","result","getDatabases","WebId","getEventFrames","webid","dbs","$apply","getEventFrameTemplates","database","FormField","LegacyForms","coerceOptions","options","jsonData","url","PIWebAPIConfigEditor","event","props","onOptionsChange","piserver","target","afdatabase","originalOptions","DataSourceHttpSettings","defaultUrl","dataSourceConfig","onChange","onMyOptionsChange","showAccessOptions","className","label","labelWidth","inputWidth","onPIServerChange","placeholder","onAFServerChange","onAFDatabaseChange","PureComponent","QueryField","tooltip","children","InlineFormLabel","width","QueryRowTerminator","QueryInlineField","QueryEditorRow","QueryRawInlineField","QueryRawEditorRow","defaultQuery","attributes","segments","enable","summary","types","basis","interval","nodata","expression","interpolate","recordedValues","digitalStates","isPiPoint","QueryEditorModeSwitcher","isRaw","useState","isModalOpen","setModalOpen","useEffect","Button","icon","variant","type","onClick","ConfirmModal","isOpen","title","body","confirmText","dismissText","onConfirm","onDismiss","LABEL_WIDTH","MIN_ATTR_INPUT_WIDTH","REMOVE_LABEL","CustomLabelComponent","Icon","PIWebAPIQueryEditor","summaries","attributeSegment","summarySegment","calculationBasisSegment","noDataReplacementSegment","setState","item","index","state","slice","remove","checkPiPointSegments","checkAttributeSegments","length","push","expandable","piServer","segmentChangeValue","currentSegment","data","findQuery","path","getSegmentPathUpTo","Promise","resolve","metricFindQuery","assign","request","scopedVars","items","altSegments","map","text","webId","variables","templateSrv","getVariables","each","variable","selectableValue","unshift","err","error","message","attributeText","getSelectedPIServer","pointName","Path","forOwn","availableAttributes","val","segmentsArray","attributesArray","splitAttributes","split","splitElements","splice","_","getElementSegments","elements","summariesArray","cb","initialLoad","scopedVarsDone","force","metricsQuery","defaults","buildFromTarget","_segmentsArray","updateArray","e","checkAfServer","onRunQuery","rawQuery","elementPath","join","s","queryChange","onSegmentChange","bind","calcBasisValueChanged","calcNoDataValueChanged","onSummaryAction","onSummaryValueChanged","onAttributeAction","onAttributeChange","summaryTypes","calculationBasis","noDataReplacement","segment","isValueEmpty","stateCallback","filter","indexOf","part","attributeChangeValue","arr","reduce","startsWith","attributesResponse","validAttributes","substring","filteredAttributes","attrib","changedValue","replace","webID","forEach","parts","match","queryProps","display","InlineField","InlineSwitch","onIsPiPointChange","InlineFieldRow","grow","Input","onBlur","textEditorChanged","SegmentAsync","Component","loadOptions","allowCustomValue","inputMinWidth","disabled","onPiPointChange","getAttributeSegmentsPI","reloadOptionsOnChange","Segment","getAttributeSegmentsAF","maxNumber","parseInt","getNoDataSegments","getCalcBasisSegments","getSummarySegments","search","PiWebAPIDatasource","instanceSettings","Map","basicAuth","withCredentials","getTemplateSrv","backendSrv","getBackendSrv","piwebapiurl","toString","isProxy","test","access","all","getDataServer","getDatabase","annotationOptions","endTime","eventFrame","attributeDataItems","Name","RegExp","attributeData","attributeValue","Value","time","Date","EndTime","StartTime","getTime","targets","ds","tar","elementPathArray","att","refId","hide","webids","startTime","range","from","to","varsKeys","keys","v","isAllSelected","current","selected","attr","vv","allValue","uniq","flatten","getElementPath","Array","isArray","buildQueryParameters","t","getStream","targetResponses","flattened","tr","sort","b","toDataFrame","datasourceRequest","method","response","status","Error","categoryName","nameFilter","templateName","template","iconColor","toJSON","resourceUrl","Method","Resource","RequestTemplate","Parameters","ParentIds","restBatch","Content","valueData","annotations","Items","curry","eventFrameToAnnotation","ends","end","restGet","HasChildren","queryOptions","querydepth","JSON","parse","Math","max","min","metricQueryTransform","getAssetServers","server","db","getDatabaseElements","selectedFields","getElement","element","getElements","getAttributes","searchFullHierarchy","getDataServers","piPointSearch","reject","trim","isSummary","api","datapoints","noDataReplace","parsePiPointValue","grafanaDataPoint","previousValue","drop","num","Good","checkNumber","Number","Timestamp","noDataReplacementMode","content","noTemplate","getPath","innerResults","groups","groupBy","Type","parsePiPointValueList","number","isNaN","isFinite","newElementPathArray","elem","temp","concat","splitPath","splitStr","pop","foundElement","find","results","isInterpolated","intervalTime","timeRange","targetName","displayName","encodeURIComponent","internalStream","restGetWebId","webidresponse","restPost","processResults","maxDataPoints","getSummaryUrl","datarsp","datarspa","targetResults","targetResult","headers","assetPath","cachedWebId","webidCache","set","batch","serverId","databaseId","InstanceType","elementId","querystring","filter1","filter2","doFilter","m","exec","lastIndex","groupIndex","isAf","isAttribute","DataSourceApi","plugin","DataSourcePlugin","setConfigEditor","setQueryEditor","setAnnotationQueryCtrl"],"sourceRoot":""} \ No newline at end of file diff --git a/src/QueryEditor.tsx b/src/QueryEditor.tsx index 72dd918..abd4eb4 100644 --- a/src/QueryEditor.tsx +++ b/src/QueryEditor.tsx @@ -794,12 +794,15 @@ export class PIWebAPIQueryEditor extends PureComponent { componentDidMount = () => { this.initialLoad(false); }; + componentDidUpdate = () => { + const { query } = this.props; if (this.props.data?.state === 'Done' && !!this.props.data?.request?.scopedVars && !this.scopedVarsDone) { this.scopedVarsDone = true; - this.initialLoad(true); + this.initialLoad(!query.isPiPoint); } }; + initialLoad = (force: boolean) => { const { query } = this.props; const metricsQuery = defaults(query, defaultQuery) as PIWebAPIQuery; @@ -860,6 +863,8 @@ export class PIWebAPIQueryEditor extends PureComponent { }); } } + + console.log(query.elementPath); } else { query.elementPath = this.getSegmentPathUpTo(this.state.segments, this.state.segments.length); query.target = @@ -869,6 +874,8 @@ export class PIWebAPIQueryEditor extends PureComponent { query.attributes.map((s) => s.value?.value), ';' ); + + console.log(query.elementPath); } onChange(query);