diff --git a/dist/MANIFEST.txt b/dist/MANIFEST.txt index 194b997..314fc30 100644 --- a/dist/MANIFEST.txt +++ b/dist/MANIFEST.txt @@ -8,18 +8,18 @@ Hash: SHA512 "signedByOrg": "parseable", "signedByOrgName": "parseable", "plugin": "parseable-parseable-datasource", - "version": "1.2.0", - "time": 1713515757716, + "version": "1.2.1", + "time": 1718097507460, "keyId": "7e4d0c6a708866e7", "files": { "go_plugin_build_manifest": "bd96702838c93bfecd7156340bdb08bc33ad823ac54251c7371d8f4ba13c9888", - "gpx_datasource_http_backend_darwin_arm64": "a8a6ce9aa0d13ec5b55138ee5eacc4eb8e3833242b69613c04f94d8dbe48f5f9", - "gpx_datasource_http_backend_linux_amd64": "58c256263d8eafb3dbc8d70079b7a5555655efe6a76596a16b27774e2cc24f71", - "gpx_datasource_http_backend_linux_arm": "486561c33e3746d16382282c6f7a9d8380aa5f781efd0a99c13ef49283bcc76b", + "gpx_datasource_http_backend_darwin_arm64": "b5190c7d8201b96cd535c0b5d91ed7328ffdc724fa4783abf229c4319677d44d", + "gpx_datasource_http_backend_linux_amd64": "8582ab938c3db7b3ac8ba05cc2a280995470269e3fee316387f9e827dd798b05", + "gpx_datasource_http_backend_linux_arm": "dacdf1a23fa722032ed71fd77cf48cdad3ba0a6426fe3c6454aa2f34af34ca1d", "LICENSE": "20b067f86de375aae6db0f283ab2e65de24d537733b89bd58432c101259d84cf", "CHANGELOG.md": "ba613d6f914b27dce9ace4d8c0cb074273c9eb6c536d8e7ac24c5ce6ae941fd0", - "module.js.map": "2afbdc0f3ff3d429fd9b6faa4d0d8b919805404cedb6f64b9f495d01fa592b9c", - "plugin.json": "eb1f658887d1a97d01b1b7754e885feb70d08655a526adcbb5c3e3fbb0eaaa18", + "module.js.map": "96bb630fe1eae375cdf3eaa7490fb296c16fbc73eb69672a63ce943f80a52a9f", + "plugin.json": "124cb2b833179c4d60896883171f06d9ef8c7b2d7611bfa87313344d162768e7", "README.md": "10e900bf3eb640cd3a0467ba807899bc6945360378c38780337f9a51e0b406eb", "img/configuration.png": "c545a51bcc88809b2b4f87aac517a7d27ad61281344b0485c9826370b915b4d8", "img/log-view-text.png": "8c6555af9c391cb1a8368c79b9bcc7386887beeea061e3483b0e020feec9d73d", @@ -34,21 +34,21 @@ Hash: SHA512 "stories/assets/code-brackets.svg": "9ef6443ebd43351be1a6edbab492003b84f2e30c8f80207ec8c4138fa440f7f4", "stories/assets/flow.svg": "275142c67bb630246cbdfb0fc3493f17dd695544777ec8da852dbbe94976d323", "stories/assets/repo.svg": "fb4ece472009833a03b9f1fbc775f13a010d9432cae3844e8b05710ba028100d", - "module.js": "fbb5399ccd3c69b32bea34d60b7107efdfcc4c175a81c00f6fd6ef1e7e65b827", + "module.js": "9b4e91d68838fceddc3997fb02adaa8979ea8942692cf2ca6df2fd7217779d3c", "dashboards/log-view.json": "224d921c8a5a4c3ed426de83f8f70ddb6406690687423b15e6e5822190bcb64c", - "gpx_datasource_http_backend_linux_arm64": "9d73bf2c30dd95eb78034f3b4b03f8122ed6634e8604d0e8734fa2d4b171d28c", - "gpx_datasource_http_backend_darwin_amd64": "424508f224f83a755c8392663ab7c1e5b6e2761f4ea5ff92d10c009af45b8521", - "gpx_datasource_http_backend_windows_amd64.exe": "c36d72a7ccbc395aa5940080f3f7b3edc494400f4e359c0155e4493a3ae3d38a" + "gpx_datasource_http_backend_linux_arm64": "c2df609bf3ef2d70b09623f1e7ef94e5f1b23268fe326eac0ba49f5a29c86876", + "gpx_datasource_http_backend_darwin_amd64": "c617d04c62d0e43bf1f8beb91d6e4a5289e2495c6cdf62258229434da68b8c00", + "gpx_datasource_http_backend_windows_amd64.exe": "796397fe0473122605b302ca56a1768f6509ec05d14b2151fe2f6daad9264194" } } -----BEGIN PGP SIGNATURE----- Version: OpenPGP.js v4.10.11 Comment: https://openpgpjs.org -wrkEARMKAAYFAmYiLO0AIQkQfk0ManCIZucWIQTzOyW2kQdOhGNlcPN+TQxq -cIhm5w2VAgkBgNNuNS2JuOuI0UbVA+AZYwIo5J+FSeE/hN7C0eAFqRKBP7VY -Z53UE9oryBNWj1u+ixP1oZNrVAoVv09yd7CbYZcCCQDBp5tUqC+/5uOA666v -rG0zdI1EhANR+MWtxUrIjoS0KAlU4zIliIW9lFRD4cvwagPcFYOTLF5hGd0e -ZAMH3OTetQ== -=6wJc +wrkEARMKAAYFAmZoFmMAIQkQfk0ManCIZucWIQTzOyW2kQdOhGNlcPN+TQxq +cIhm53I3AgkA2BAIehEYlsZO/OK4e7+vAvC0/L5ObmLC1wf/Me49tl0rValz +6QL9mmqYMswLCYy1BZiQjmFrfvTFiblCWlmFuJACCQB16QxM6gN9jB+O8YgM +6cGp+Ay95jCVPJc3omWxgbmTmpdx8fpVXtm3y/QUA782mAnl30fqwIcQ6rsD +2rCw1uwnYQ== +=3aaY -----END PGP SIGNATURE----- diff --git a/dist/gpx_datasource_http_backend_darwin_amd64 b/dist/gpx_datasource_http_backend_darwin_amd64 index e542641..491e2a1 100755 Binary files a/dist/gpx_datasource_http_backend_darwin_amd64 and b/dist/gpx_datasource_http_backend_darwin_amd64 differ diff --git a/dist/gpx_datasource_http_backend_darwin_arm64 b/dist/gpx_datasource_http_backend_darwin_arm64 index 678c928..225d3e6 100755 Binary files a/dist/gpx_datasource_http_backend_darwin_arm64 and b/dist/gpx_datasource_http_backend_darwin_arm64 differ diff --git a/dist/gpx_datasource_http_backend_linux_amd64 b/dist/gpx_datasource_http_backend_linux_amd64 index 3b1fadc..eb2829f 100755 Binary files a/dist/gpx_datasource_http_backend_linux_amd64 and b/dist/gpx_datasource_http_backend_linux_amd64 differ diff --git a/dist/gpx_datasource_http_backend_linux_arm b/dist/gpx_datasource_http_backend_linux_arm index e0d8e58..3203cf3 100755 Binary files a/dist/gpx_datasource_http_backend_linux_arm and b/dist/gpx_datasource_http_backend_linux_arm differ diff --git a/dist/gpx_datasource_http_backend_linux_arm64 b/dist/gpx_datasource_http_backend_linux_arm64 index 9a4d415..3633824 100755 Binary files a/dist/gpx_datasource_http_backend_linux_arm64 and b/dist/gpx_datasource_http_backend_linux_arm64 differ diff --git a/dist/gpx_datasource_http_backend_windows_amd64.exe b/dist/gpx_datasource_http_backend_windows_amd64.exe index 70b5c09..128cabf 100755 Binary files a/dist/gpx_datasource_http_backend_windows_amd64.exe and b/dist/gpx_datasource_http_backend_windows_amd64.exe differ diff --git a/dist/module.js b/dist/module.js index 942f55a..b539cc3 100644 --- a/dist/module.js +++ b/dist/module.js @@ -1,2 +1,2 @@ -define(["@grafana/data","@grafana/runtime","rxjs","lodash","react","@grafana/ui"],((e,t,r,n,o,i)=>(()=>{"use strict";var a={781:t=>{t.exports=e},531:e=>{e.exports=t},7:e=>{e.exports=i},241:e=>{e.exports=n},959:e=>{e.exports=o},269:e=>{e.exports=r}},u={};function s(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}};return a[e](r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return(()=>{s.r(c),s.d(c,{plugin:()=>oe});var e=s(781),t=s(531),r=s(269);function n(e){return"function"==typeof e}function o(e){return function(t){if(function(e){return n(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)};function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function u(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function p(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o1||u(e,t)}))})}function u(e,t){try{(r=o[e](t)).value instanceof d?Promise.resolve(r.value.v).then(s,c):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}(this,arguments,(function(){var t,r,n;return u(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,d(t.read())];case 3:return r=o.sent(),n=r.value,r.done?[4,d(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,d(n)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}(e))}var t,r,o,i,a;throw function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}(e)}function Y(e){return new R((function(t){(function(e,t){var r,n,o,i,a,s,c,f;return a=this,s=void 0,f=function(){var a,s;return u(this,(function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),r=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=l(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,o,(t=e[r](t)).done,t.value)}))}}}(e),u.label=1;case 1:return[4,r.next()];case 2:if((n=u.sent()).done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),o={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),n&&!n.done&&(i=r.return)?[4,i.call(r)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))},new((c=void 0)||(c=Promise))((function(e,t){function r(e){try{o(f.next(e))}catch(e){t(e)}}function n(e){try{o(f.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof c?o:new c((function(e){e(o)}))).then(r,n)}o((f=f.apply(a,s||[])).next())}))})(e,t).catch((function(e){return t.error(e)}))}))}function H(e){return o((function(t,r){var n,o=null,i=!1;o=t.subscribe(q(r,void 0,void 0,(function(a){n=L(e(a,H(e)(t))),o?(o.unsubscribe(),o=null,n.subscribe(r)):i=!0}))),i&&(o.unsubscribe(),o=null,n.subscribe(r))}))}var B=s(241);function $(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function W(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){$(i,n,o,a,u,"next",e)}function u(e){$(i,n,o,a,u,"throw",e)}a(void 0)}))}}function J(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class K extends t.DataSourceWithBackend{doRequest(e){var r=this;return W((function*(){return yield(0,t.getBackendSrv)().datasourceRequest({method:"GET",url:r.url+"/api/v1/readiness",params:e})}))()}query(e){return new r.Observable((n=>{if(e.targets=e.targets.filter((e=>!e.hide)),0===e.targets.length)return n.next({data:[]}),void n.complete();const{range:o}=e;if(!o)return n.next({data:[]}),void n.complete();const i=o.from,a=o.to,u=e.targets.map((n=>{const o={query:(0,t.getTemplateSrv)().replace(n.queryText,e.scopedVars,this.formatter),startTime:i.toISOString(),endTime:a.toISOString(),send_null:!0};return(0,r.lastValueFrom)(this.doFetch({url:this.url+"/api/v1/query",data:o,method:"POST"}).pipe(N((e=>this.arrayToDataFrame(e.data))),H((e=>{throw new Error(e.data.message)}))))}));Promise.all(u).then((e=>{n.next({data:e}),n.complete()})).catch((e=>{n.error(e)}))}))}formatter(e,t){return t.multi&&Array.isArray(e)?e.map((e=>`'${e}'`)).join(","):t.multi?`'${e}'`:e}metricFindQuery(e,t){var r=this;return W((function*(){const n=new Date,o=new Date;return o.setFullYear(n.getFullYear()-1),(t=t||{}).range=t.range||{from:o,to:n},t.targets=[],t.targets.push({queryText:e,scopedVars:{}}),new Promise(((e,n)=>{r.query(t).subscribe({next:t=>{const r=t.data.map((e=>e.fields[0].values.toArray())).flat().map((e=>({text:e})));e(r)},error:e=>{n(e)}})}))}))()}arrayToDataFrame(t){let r=new e.MutableDataFrame;if(t.length>0){const n=Object.keys(t[0]).map((r=>{let n=(0,e.guessFieldTypeFromValue)(t[0][r]);return"p_timestamp"===r.toLowerCase()&&(n=e.FieldType.time),{name:r,type:n}}));r=new e.MutableDataFrame({fields:n})}return t.forEach((e=>{r.appendRow(Object.values(e))})),r}doFetch(e){return e.withCredentials=this.withCredentials,e.headers=this.headers,(0,t.getBackendSrv)().fetch(e)}listStreams(){var e=this;return W((function*(){return(0,r.lastValueFrom)(e.doFetch({url:e.url+"/api/v1/logstream",method:"GET"}).pipe(N((e=>(0,B.isArray)(e.data)?e.data:[])),H((e=>(0,r.of)([])))))}))()}streamStats(e){var t=this;return W((function*(){return e?(0,r.lastValueFrom)(t.doFetch({url:t.url+"/api/v1/logstream/"+e.value+"/stats",method:"GET"}).pipe(N((e=>"object"!=typeof e.data||(0,B.isNull)(e.data)?{}:e.data)),H((e=>(0,r.of)({status:"error",message:e.statusText}))))):{}}))()}streamSchema(e){var t=this;return W((function*(){return e?(0,r.lastValueFrom)(t.doFetch({url:t.url+"/api/v1/logstream/"+e.value+"/schema",method:"GET"}).pipe(N((e=>"object"!=typeof e.data||(0,B.isNull)(e.data)?{}:e.data)),H((e=>(0,r.of)({status:"error",message:e.statusText}))))):{fields:[]}}))()}testDatasource(){var e=this;return W((function*(){const t="Parseable server is not reachable. Verify that your basic authentication credentials are accurate.";try{const n=yield(0,r.lastValueFrom)(e.doFetch({url:e.url+"/api/v1/logstream",method:"GET"}).pipe(N((e=>e))));return 200===n.status?{status:"success",message:"Parseable server is reachable",title:"Success"}:{message:400!==n.status&&n.statusText?n.statusText:t,status:"error",title:"Error"}}catch(e){var n,o;if("string"==typeof e)return{status:"error",message:e};let r=e;var i;let a=null!==(i=r.statusText)&&void 0!==i?i:t;return void 0!==(null===(o=r.data)||void 0===o||null===(n=o.error)||void 0===n?void 0:n.code)&&(a+=`: ${r.data.error.code}. ${r.data.error.message}`),{status:"error",message:a,title:"Error"}}}))()}constructor(e){var t,r;super(e),J(this,"url",void 0),J(this,"withCredentials",void 0),J(this,"headers",void 0),J(this,"defaultEditorMode",void 0),this.url=void 0===e.url?"":e.url,this.withCredentials=void 0!==e.withCredentials,this.defaultEditorMode=null!==(r=null===(t=e.jsonData)||void 0===t?void 0:t.defaultEditorMode)&&void 0!==r?r:"code"}}var X=s(959),Z=s.n(X),ee=s(7);class te extends X.PureComponent{render(){const{onOptionsChange:e,options:t}=this.props;return Z().createElement("div",{className:"gf-form-group"},Z().createElement(ee.DataSourceHttpSettings,{defaultUrl:"https://demo.parseable.com",dataSourceConfig:t,showAccessOptions:!0,onChange:e}))}}function re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{FormField:ne}=ee.LegacyForms,oe=new e.DataSourcePlugin(K).setConfigEditor(te).setQueryEditor((({datasource:e,onChange:t,onRunQuery:r,query:n})=>{const{queryText:o}=n,i=Z().useCallback((()=>e.listStreams().then((e=>e.map((e=>({label:e.name,value:e.name})))),(e=>{throw new Error(e.statusText)}))),[e]),[a,u]=(0,X.useState)(),[s="",c]=Z().useState(),[l="",f]=Z().useState(),[p="",d]=Z().useState(),[h="",v]=Z().useState(),[y="",b]=Z().useState(),[m="",g]=Z().useState(),w=Z().useCallback((t=>t?e.streamSchema(t).then((e=>{if(e.fields){const t=e.fields.map((e=>e.name)),r=t.join(", ");return c(r),t}return s}),(e=>{throw new Error(e.statusText)})):""),[e,s]),S=Z().useCallback((t=>t?e.streamStats(t).then((e=>{if(e.ingestion){var t;const r=e.ingestion.count,n=e.ingestion.size,o=null===(t=e.storage)||void 0===t?void 0:t.size,i=e.stream,a=e.time;return d(n),v(o),b(i),f(r),g(a),r}return l}),(e=>{throw new Error(e.statusText)})):""),[e,l]);return Z().useEffect((()=>{const e=setTimeout((()=>{r()}),2e3);return()=>clearTimeout(e)}),[r,o]),Z().useEffect((()=>{w(a)}),[w,a]),Z().useEffect((()=>{S(a)}),[S,a]),Z().createElement(Z().Fragment,null,Z().createElement(ee.InlineFieldRow,null,Z().createElement(ee.InlineField,null,Z().createElement(ee.Label,null,"Select a log stream:")),Z().createElement(ee.InlineField,null,Z().createElement(ee.AsyncSelect,{loadOptions:i,defaultOptions:!0,value:a,onChange:e=>{u(e)}}))),Z().createElement(ee.InlineFieldRow,null,Z().createElement(ee.InlineField,null,Z().createElement(ee.SeriesTable,{series:[{color:"#299c46",isActive:!0,label:"Stream name",value:y},{color:"#299c46",isActive:!1,label:"Column names",value:s},{color:"#299c46",isActive:!1,label:"Total ingested event count",value:l},{color:"#299c46",isActive:!1,label:"Total ingested json size",value:p},{color:"#299c46",isActive:!1,label:"Total stored data size",value:h}],timestamp:m}))),Z().createElement("br",null),Z().createElement(ne,{labelWidth:12,inputWidth:100,value:o||"",onChange:e=>{var r,o;t((r=function(e){for(var t=1;t{const[r,n]=(0,X.useState)(t);return Z().createElement(Z().Fragment,null,Z().createElement("div",{className:"gf-form"},Z().createElement("span",{className:"gf-form-label width-10"},"Query"),Z().createElement("input",{name:"rawQuery",className:"gf-form-input",onBlur:()=>{e(r,r)},onChange:e=>n(e.currentTarget.value),value:r})))}))})(),c})())); +define(["@grafana/data","@grafana/runtime","rxjs","lodash","react","@grafana/ui"],((e,t,r,n,o,i)=>(()=>{"use strict";var a={781:t=>{t.exports=e},531:e=>{e.exports=t},7:e=>{e.exports=i},241:e=>{e.exports=n},959:e=>{e.exports=o},269:e=>{e.exports=r}},u={};function s(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}};return a[e](r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return(()=>{s.r(c),s.d(c,{plugin:()=>ce});var e=s(781),t=s(531),r=s(269);function n(e){return"function"==typeof e}function o(e){return function(t){if(function(e){return n(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)};function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function u(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function p(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o1||u(e,t)}))})}function u(e,t){try{(r=o[e](t)).value instanceof d?Promise.resolve(r.value.v).then(s,c):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}(this,arguments,(function(){var t,r,n;return u(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,d(t.read())];case 3:return r=o.sent(),n=r.value,r.done?[4,d(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,d(n)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}(e))}var t,r,o,i,a;throw function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}(e)}function Y(e){return new V((function(t){(function(e,t){var r,n,o,i,a,s,c,f;return a=this,s=void 0,f=function(){var a,s;return u(this,(function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),r=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=l(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,o,(t=e[r](t)).done,t.value)}))}}}(e),u.label=1;case 1:return[4,r.next()];case 2:if((n=u.sent()).done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),o={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),n&&!n.done&&(i=r.return)?[4,i.call(r)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))},new((c=void 0)||(c=Promise))((function(e,t){function r(e){try{o(f.next(e))}catch(e){t(e)}}function n(e){try{o(f.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof c?o:new c((function(e){e(o)}))).then(r,n)}o((f=f.apply(a,s||[])).next())}))})(e,t).catch((function(e){return t.error(e)}))}))}function B(e,t,r){return void 0===r&&(r=1/0),n(t)?B((function(r,n){return N((function(e,o){return t(r,e,n,o)}))(G(e(r,n)))}),r):("number"==typeof t&&(r=t),o((function(t,n){return function(e,t,r,n,o,i,a,u){var s=[],c=0,l=0,f=!1,p=function(){!f||s.length||c||t.complete()},d=function(e){return c{if(e.targets=e.targets.filter((e=>!e.hide)),0===e.targets.length)return n.next({data:[]}),void n.complete();const{range:o}=e;if(!o)return n.next({data:[]}),void n.complete();const i=o.from,a=o.to,u=e.targets.map((n=>{const o=(0,t.getTemplateSrv)().replace(n.queryText,e.scopedVars,this.formatter),u={query:o,startTime:i.toISOString(),endTime:a.toISOString(),send_null:!0},s=this.extractStreamName(o);var c,l=this;return(0,r.lastValueFrom)(this.doFetch({url:this.url+"/api/v1/query",data:u,method:"POST"}).pipe(B((c=J((function*(e){return l.arrayToDataFrame(e.data,s,u.query)})),function(e){return c.apply(this,arguments)})),H((e=>{throw new Error(e.data.message)}))))}));Promise.all(u).then((e=>{n.next({data:e}),n.complete()})).catch((e=>{n.error(e)}))}))}formatter(e,t){return t.multi&&Array.isArray(e)?e.map((e=>`'${e}'`)).join(","):t.multi?`'${e}'`:e}metricFindQuery(e,t){var r=this;return J((function*(){const n=new Date,o=new Date;return o.setFullYear(n.getFullYear()-1),(t=t||{}).range=t.range||{from:o,to:n},t.targets=[],t.targets.push({queryText:e,scopedVars:{}}),new Promise(((e,n)=>{r.query(t).subscribe({next:t=>{const r=t.data.map((e=>e.fields[0].values.toArray())).flat().map((e=>({text:e})));e(r)},error:e=>{n(e)}})}))}))()}arrayToDataFrame(t,r,n){var o=this;return J((function*(){let i=new e.MutableDataFrame,a=!1;const u=()=>{if(t.length>0){const r=Object.keys(t[0]).map((r=>{let n=(0,e.guessFieldTypeFromValue)(t[0][r]);return"p_timestamp"===r.toLowerCase()&&(n=e.FieldType.time),{name:r,type:n}}));i=new e.MutableDataFrame({fields:r}),a=!0}},s=/^SELECT\s+\*/i.test(n||"");if(r&&s){const t=(yield o.getStreamSchema(r)).fields;if(t&&t.length>0){const r=t.map((t=>{const r="p_timestamp"===t.name?e.FieldType.time:(null==t?void 0:t.data_type)?"Boolean"===t.data_type?e.FieldType.boolean:-1!==Z.indexOf(t.data_type)?e.FieldType.number:-1!==ee.indexOf(t.data_type)?e.FieldType.string:-1!==te.indexOf(t.data_type)?e.FieldType.time:e.FieldType.other:e.FieldType.other;return{name:t.name,type:r}}));i=new e.MutableDataFrame({fields:r})}else u()}else u();return t.forEach((e=>{if(a)i.appendRow(Object.values(e));else{const t=i.fields.map((e=>e.name)).reduce(((e,t)=>{return r=X({},e),n=null!=(n={[t]:null})?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))})),r;var r,n}),{}),r=X({},t,e);i.appendRow(Object.values(r))}})),i}))()}doFetch(e){return e.withCredentials=this.withCredentials,e.headers=this.headers,(0,t.getBackendSrv)().fetch(e)}listStreams(){var e=this;return J((function*(){return(0,r.lastValueFrom)(e.doFetch({url:e.url+"/api/v1/logstream",method:"GET"}).pipe(N((e=>(0,$.isArray)(e.data)?e.data:[])),H((e=>(0,r.of)([])))))}))()}getStreamStats(e){var t=this;return J((function*(){return e?(0,r.lastValueFrom)(t.doFetch({url:t.url+"/api/v1/logstream/"+e+"/stats",method:"GET"}).pipe(N((e=>"object"!=typeof e.data||(0,$.isNull)(e.data)?{}:e.data)),H((e=>(0,r.of)({status:"error",message:e.statusText}))))):{}}))()}getStreamSchema(e){var t=this;return J((function*(){return e?(0,r.lastValueFrom)(t.doFetch({url:t.url+"/api/v1/logstream/"+e+"/schema",method:"GET"}).pipe(N((e=>"object"!=typeof e.data||(0,$.isNull)(e.data)?{}:e.data)),H((e=>(0,r.of)({status:"error",message:e.statusText}))))):{fields:[]}}))()}testDatasource(){var e=this;return J((function*(){const t="Parseable server is not reachable. Verify that your basic authentication credentials are accurate.";try{const n=yield(0,r.lastValueFrom)(e.doFetch({url:e.url+"/api/v1/logstream",method:"GET"}).pipe(N((e=>e))));return 200===n.status?{status:"success",message:"Parseable server is reachable",title:"Success"}:{message:400!==n.status&&n.statusText?n.statusText:t,status:"error",title:"Error"}}catch(e){var n,o;if("string"==typeof e)return{status:"error",message:e};let r=e;var i;let a=null!==(i=r.statusText)&&void 0!==i?i:t;return void 0!==(null===(o=r.data)||void 0===o||null===(n=o.error)||void 0===n?void 0:n.code)&&(a+=`: ${r.data.error.code}. ${r.data.error.message}`),{status:"error",message:a,title:"Error"}}}))()}constructor(e){var t,r;super(e),K(this,"url",void 0),K(this,"withCredentials",void 0),K(this,"headers",void 0),K(this,"defaultEditorMode",void 0),K(this,"extractStreamName",(e=>{const t=e.match(/from\s+([\w\.]+)/i);return t?t[1]:null})),this.url=void 0===e.url?"":e.url,this.withCredentials=void 0!==e.withCredentials,this.defaultEditorMode=null!==(r=null===(t=e.jsonData)||void 0===t?void 0:t.defaultEditorMode)&&void 0!==r?r:"code"}}var ne=s(959),oe=s.n(ne),ie=s(7);class ae extends ne.PureComponent{render(){const{onOptionsChange:e,options:t}=this.props;return oe().createElement("div",{className:"gf-form-group"},oe().createElement(ie.DataSourceHttpSettings,{defaultUrl:"https://demo.parseable.com",dataSourceConfig:t,showAccessOptions:!0,onChange:e}))}}function ue(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{FormField:se}=ie.LegacyForms,ce=new e.DataSourcePlugin(re).setConfigEditor(ae).setQueryEditor((({datasource:e,onChange:t,onRunQuery:r,query:n})=>{const{queryText:o}=n,i=oe().useCallback((()=>e.listStreams().then((e=>e.map((e=>({label:e.name,value:e.name})))),(e=>{throw new Error(e.statusText)}))),[e]),[a,u]=(0,ne.useState)(),[s="",c]=oe().useState(),[l="",f]=oe().useState(),[p="",d]=oe().useState(),[h="",y]=oe().useState(),[v="",b]=oe().useState(),[m="",g]=oe().useState(),w=oe().useCallback((t=>t&&"string"==typeof t?e.getStreamSchema(t).then((e=>{if(e.fields){const t=e.fields.map((e=>e.name)),r=t.join(", ");return c(r),t}return s}),(e=>{throw new Error(e.statusText)})):""),[e,s]),S=oe().useCallback((t=>t?e.getStreamStats(t).then((e=>{if(e.ingestion){var t;const r=e.ingestion.count,n=e.ingestion.size,o=null===(t=e.storage)||void 0===t?void 0:t.size,i=e.stream,a=e.time;return d(n),y(o),b(i),f(r),g(a),r}return l}),(e=>{throw new Error(e.statusText)})):""),[e,l]);return oe().useEffect((()=>{const e=setTimeout((()=>{r()}),2e3);return()=>clearTimeout(e)}),[r,o]),oe().useEffect((()=>{w(null==a?void 0:a.value)}),[w,a]),oe().useEffect((()=>{S(null==a?void 0:a.value)}),[S,a]),oe().createElement(oe().Fragment,null,oe().createElement(ie.InlineFieldRow,null,oe().createElement(ie.InlineField,null,oe().createElement(ie.Label,null,"Select a log stream:")),oe().createElement(ie.InlineField,null,oe().createElement(ie.AsyncSelect,{loadOptions:i,defaultOptions:!0,value:a,onChange:e=>{u(e)}}))),oe().createElement(ie.InlineFieldRow,null,oe().createElement(ie.InlineField,null,oe().createElement(ie.SeriesTable,{series:[{color:"#299c46",isActive:!0,label:"Stream name",value:v},{color:"#299c46",isActive:!1,label:"Column names",value:s},{color:"#299c46",isActive:!1,label:"Total ingested event count",value:l},{color:"#299c46",isActive:!1,label:"Total ingested json size",value:p},{color:"#299c46",isActive:!1,label:"Total stored data size",value:h}],timestamp:m}))),oe().createElement("br",null),oe().createElement(se,{labelWidth:12,inputWidth:100,value:o||"",onChange:e=>{var r,o;t((r=function(e){for(var t=1;t{const[r,n]=(0,ne.useState)(t);return oe().createElement(oe().Fragment,null,oe().createElement("div",{className:"gf-form"},oe().createElement("span",{className:"gf-form-label width-10"},"Query"),oe().createElement("input",{name:"rawQuery",className:"gf-form-input",onBlur:()=>{e(r,r)},onChange:e=>n(e.currentTarget.value),value:r})))}))})(),c})())); //# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/dist/module.js.map b/dist/module.js.map index ccec896..4972e2d 100644 --- a/dist/module.js.map +++ b/dist/module.js.map @@ -1 +1 @@ -{"version":3,"file":"module.js","mappings":"oIAAAA,EAAOC,QAAUC,C,UCAjBF,EAAOC,QAAUE,C,QCAjBH,EAAOC,QAAUG,C,UCAjBJ,EAAOC,QAAUI,C,UCAjBL,EAAOC,QAAUK,C,UCAjBN,EAAOC,QAAUM,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaV,QAGrB,IAAID,EAASQ,EAAyBE,GAAY,CAGjDT,QAAS,CAAC,GAOX,OAHAY,EAAoBH,GAAUV,EAAQA,EAAOC,QAASQ,GAG/CT,EAAOC,OACf,CCrBAQ,EAAoBK,EAAKd,IACxB,IAAIe,EAASf,GAAUA,EAAOgB,WAC7B,IAAOhB,EAAiB,QACxB,IAAM,EAEP,OADAS,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdN,EAAoBQ,EAAI,CAAChB,EAASkB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEpB,EAASmB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A,eAAcA,KACb,kBAACC,GAAAA,YAAWA,KACV,kBAACC,GAAAA,MAAKA,KAAC,yBAIT,kBAACD,GAAAA,YAAWA,KACV,kBAACE,GAAAA,YAAWA,CACVC,YAAa1B,EACb2B,gBAAAA,EACApW,MAAOA,EACPgU,SAAU1R,IACRqS,EAASrS,EAAE,MAcnB,kBAACyT,GAAAA,eAAcA,KACf,kBAACC,GAAAA,YAAWA,KACV,kBAACK,GAAAA,YAAWA,CACVC,OAAQ,CACJ,CACEC,MAAO,UACPC,UAAU,EACVzU,MAAO,cACP/B,MAAOwS,GAET,CACE+D,MAAO,UACPC,UAAU,EACVzU,MAAO,eACP/B,MAAO6U,GAET,CACE0B,MAAO,UACPC,UAAU,EACVzU,MAAO,6BACP/B,MAAO+U,GAET,CACEwB,MAAO,UACPC,UAAU,EACVzU,MAAO,2BACP/B,MAAOiV,GAET,CACEsB,MAAO,UACPC,UAAU,EACVzU,MAAO,yBACP/B,MAAOmV,IAGXsB,UAAW3E,MAKjB,kBAAC4E,KAAAA,MACD,kBAACzC,GAAAA,CACC0C,WAAY,GACZC,WAAY,IACZ5W,MAAOmQ,GAAa,GACpB6D,SA7FqB6C,I,QACzB7C,G,yUAAS,IAAKjF,G,WAAAA,CAAOoB,UAAW0G,EAAM9G,OAAO/P,Q,mVA6FzC+B,MAAM,YACN+U,QAAQ,yD,IC3KbC,wBCHgC,EAAG/C,WAAUjF,YAC9C,MAAOiI,EAAOC,IAAYrC,EAAAA,EAAAA,UAAS7F,GASnC,OACE,oCACE,kBAAC2E,MAAAA,CAAIC,UAAU,WACb,kBAACuD,OAAAA,CAAKvD,UAAU,0BAAyB,SACzC,kBAAC/H,QAAAA,CACCrH,KAAK,WACLoP,UAAU,gBACVwD,OAdU,KAChBnD,EAASgD,EAAOA,EAAM,EAchBhD,SAXc6C,GACpBI,EAASJ,EAAMO,cAAcpX,OAWvBA,MAAOgX,K","sources":["webpack://parseable-parseable-datasource/external amd \"@grafana/data\"","webpack://parseable-parseable-datasource/external amd \"@grafana/runtime\"","webpack://parseable-parseable-datasource/external amd \"@grafana/ui\"","webpack://parseable-parseable-datasource/external amd \"lodash\"","webpack://parseable-parseable-datasource/external amd \"react\"","webpack://parseable-parseable-datasource/external amd \"rxjs\"","webpack://parseable-parseable-datasource/webpack/bootstrap","webpack://parseable-parseable-datasource/webpack/runtime/compat get default export","webpack://parseable-parseable-datasource/webpack/runtime/define property getters","webpack://parseable-parseable-datasource/webpack/runtime/hasOwnProperty shorthand","webpack://parseable-parseable-datasource/webpack/runtime/make namespace object","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isFunction.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/lift.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/node_modules/tslib/tslib.es6.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/Subscription.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/config.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/noop.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/NotificationFactories.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/errorContext.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/Subscriber.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/operators/map.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/symbol/observable.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/identity.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/Observable.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/pipe.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/symbol/iterator.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isPromise.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isIterable.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/operators/catchError.js","webpack://parseable-parseable-datasource/./datasource.ts","webpack://parseable-parseable-datasource/./components/ConfigEditor.tsx","webpack://parseable-parseable-datasource/./components/QueryEditor.tsx","webpack://parseable-parseable-datasource/./module.ts","webpack://parseable-parseable-datasource/./components/VariableQueryEditor.tsx"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__781__;","module.exports = __WEBPACK_EXTERNAL_MODULE__531__;","module.exports = __WEBPACK_EXTERNAL_MODULE__7__;","module.exports = __WEBPACK_EXTERNAL_MODULE__241__;","module.exports = __WEBPACK_EXTERNAL_MODULE__959__;","module.exports = __WEBPACK_EXTERNAL_MODULE__269__;","// 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 function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return function (source) {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n }\n catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n//# sourceMappingURL=lift.js.map","/******************************************************************************\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 var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\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\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","export var COMPLETE_NOTIFICATION = (function () { return createNotification('C', undefined, undefined); })();\nexport function errorNotification(error) {\n return createNotification('E', undefined, error);\n}\nexport function nextNotification(value) {\n return createNotification('N', value, undefined);\n}\nexport function createNotification(kind, value, error) {\n return {\n kind: kind,\n value: value,\n error: error,\n };\n}\n//# sourceMappingURL=NotificationFactories.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","import { __extends } from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nvar OperatorSubscriber = (function (_super) {\n __extends(OperatorSubscriber, _super);\n function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n var _this = _super.call(this, destination) || this;\n _this.onFinalize = onFinalize;\n _this.shouldUnsubscribe = shouldUnsubscribe;\n _this._next = onNext\n ? function (value) {\n try {\n onNext(value);\n }\n catch (err) {\n destination.error(err);\n }\n }\n : _super.prototype._next;\n _this._error = onError\n ? function (err) {\n try {\n onError(err);\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._error;\n _this._complete = onComplete\n ? function () {\n try {\n onComplete();\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._complete;\n return _this;\n }\n OperatorSubscriber.prototype.unsubscribe = function () {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var closed_1 = this.closed;\n _super.prototype.unsubscribe.call(this);\n !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n };\n return OperatorSubscriber;\n}(Subscriber));\nexport { OperatorSubscriber };\n//# sourceMappingURL=OperatorSubscriber.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n//# sourceMappingURL=map.js.map","export var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });\n//# sourceMappingURL=isArrayLike.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","export function getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}\nexport var iterator = getSymbolIterator();\n//# sourceMappingURL=iterator.js.map","import { __asyncValues, __awaiter, __generator, __values } from \"tslib\";\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isPromise } from '../util/isPromise';\nimport { Observable } from '../Observable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isIterable } from '../util/isIterable';\nimport { isReadableStreamLike, readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nimport { isFunction } from '../util/isFunction';\nimport { reportUnhandledError } from '../util/reportUnhandledError';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function innerFrom(input) {\n if (input instanceof Observable) {\n return input;\n }\n if (input != null) {\n if (isInteropObservable(input)) {\n return fromInteropObservable(input);\n }\n if (isArrayLike(input)) {\n return fromArrayLike(input);\n }\n if (isPromise(input)) {\n return fromPromise(input);\n }\n if (isAsyncIterable(input)) {\n return fromAsyncIterable(input);\n }\n if (isIterable(input)) {\n return fromIterable(input);\n }\n if (isReadableStreamLike(input)) {\n return fromReadableStreamLike(input);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\nexport function fromInteropObservable(obj) {\n return new Observable(function (subscriber) {\n var obs = obj[Symbol_observable]();\n if (isFunction(obs.subscribe)) {\n return obs.subscribe(subscriber);\n }\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n });\n}\nexport function fromArrayLike(array) {\n return new Observable(function (subscriber) {\n for (var i = 0; i < array.length && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n });\n}\nexport function fromPromise(promise) {\n return new Observable(function (subscriber) {\n promise\n .then(function (value) {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) { return subscriber.error(err); })\n .then(null, reportUnhandledError);\n });\n}\nexport function fromIterable(iterable) {\n return new Observable(function (subscriber) {\n var e_1, _a;\n try {\n for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {\n var value = iterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n subscriber.complete();\n });\n}\nexport function fromAsyncIterable(asyncIterable) {\n return new Observable(function (subscriber) {\n process(asyncIterable, subscriber).catch(function (err) { return subscriber.error(err); });\n });\n}\nexport function fromReadableStreamLike(readableStream) {\n return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));\n}\nfunction process(asyncIterable, subscriber) {\n var asyncIterable_1, asyncIterable_1_1;\n var e_2, _a;\n return __awaiter(this, void 0, void 0, function () {\n var value, e_2_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 5, 6, 11]);\n asyncIterable_1 = __asyncValues(asyncIterable);\n _b.label = 1;\n case 1: return [4, asyncIterable_1.next()];\n case 2:\n if (!(asyncIterable_1_1 = _b.sent(), !asyncIterable_1_1.done)) return [3, 4];\n value = asyncIterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return [2];\n }\n _b.label = 3;\n case 3: return [3, 1];\n case 4: return [3, 11];\n case 5:\n e_2_1 = _b.sent();\n e_2 = { error: e_2_1 };\n return [3, 11];\n case 6:\n _b.trys.push([6, , 9, 10]);\n if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return))) return [3, 8];\n return [4, _a.call(asyncIterable_1)];\n case 7:\n _b.sent();\n _b.label = 8;\n case 8: return [3, 10];\n case 9:\n if (e_2) throw e_2.error;\n return [7];\n case 10: return [7];\n case 11:\n subscriber.complete();\n return [2];\n }\n });\n });\n}\n//# sourceMappingURL=innerFrom.js.map","import { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\nexport function isInteropObservable(input) {\n return isFunction(input[Symbol_observable]);\n}\n//# sourceMappingURL=isInteropObservable.js.map","import { isFunction } from \"./isFunction\";\nexport function isPromise(value) {\n return isFunction(value === null || value === void 0 ? void 0 : value.then);\n}\n//# sourceMappingURL=isPromise.js.map","import { isFunction } from './isFunction';\nexport function isAsyncIterable(obj) {\n return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);\n}\n//# sourceMappingURL=isAsyncIterable.js.map","import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\nexport function isIterable(input) {\n return isFunction(input === null || input === void 0 ? void 0 : input[Symbol_iterator]);\n}\n//# sourceMappingURL=isIterable.js.map","import { __asyncGenerator, __await, __generator } from \"tslib\";\nimport { isFunction } from './isFunction';\nexport function readableStreamLikeToAsyncGenerator(readableStream) {\n return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {\n var reader, _a, value, done;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n reader = readableStream.getReader();\n _b.label = 1;\n case 1:\n _b.trys.push([1, , 9, 10]);\n _b.label = 2;\n case 2:\n if (!true) return [3, 8];\n return [4, __await(reader.read())];\n case 3:\n _a = _b.sent(), value = _a.value, done = _a.done;\n if (!done) return [3, 5];\n return [4, __await(void 0)];\n case 4: return [2, _b.sent()];\n case 5: return [4, __await(value)];\n case 6: return [4, _b.sent()];\n case 7:\n _b.sent();\n return [3, 2];\n case 8: return [3, 10];\n case 9:\n reader.releaseLock();\n return [7];\n case 10: return [2];\n }\n });\n });\n}\nexport function isReadableStreamLike(obj) {\n return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);\n}\n//# sourceMappingURL=isReadableStreamLike.js.map","export function createInvalidObservableTypeError(input) {\n return new TypeError(\"You provided \" + (input !== null && typeof input === 'object' ? 'an invalid object' : \"'\" + input + \"'\") + \" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.\");\n}\n//# sourceMappingURL=throwUnobservableError.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { operate } from '../util/lift';\nexport function catchError(selector) {\n return operate(function (source, subscriber) {\n var innerSub = null;\n var syncUnsub = false;\n var handledResult;\n innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, undefined, function (err) {\n handledResult = innerFrom(selector(err, catchError(selector)(source)));\n if (innerSub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n else {\n syncUnsub = true;\n }\n }));\n if (syncUnsub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n });\n}\n//# sourceMappingURL=catchError.js.map","import { getBackendSrv, getTemplateSrv, BackendSrvRequest, FetchResponse, DataSourceWithBackend } from \"@grafana/runtime\";\nimport {\n DataQueryRequest,\n DataQueryResponse,\n DataSourceInstanceSettings,\n MutableDataFrame,\n DataFrame,\n FieldType,\n guessFieldTypeFromValue,\n MetricFindValue\n} from '@grafana/data';\nimport { lastValueFrom, of, Observable } from 'rxjs';\nimport { catchError, map } from 'rxjs/operators';\nimport { isArray, isNull } from \"lodash\";\n\nimport {\n MyQuery,\n MyDataSourceOptions,\n QueryEditorMode,\n StreamName,\n StreamList,\n StreamSchemaResponse,\n StreamStatsResponse\n} from './types';\nexport class DataSource extends DataSourceWithBackend {\n url: string;\n withCredentials: boolean;\n headers: any;\n defaultEditorMode: QueryEditorMode;\n constructor(instanceSettings: DataSourceInstanceSettings) {\n super(instanceSettings);\n this.url = instanceSettings.url === undefined ? '' : instanceSettings.url;\n this.withCredentials = instanceSettings.withCredentials !== undefined;\n this.defaultEditorMode = instanceSettings.jsonData?.defaultEditorMode ?? \"code\"\n }\n\n async doRequest(query: MyQuery) {\n const routePath = '/api/v1'\n const result = await getBackendSrv().datasourceRequest({\n method: \"GET\",\n url: this.url + routePath + '/readiness',\n params: query,\n })\n return result;\n }\n\n query(options: DataQueryRequest): Observable{\n return new Observable(observer => {\n options.targets = options.targets.filter((t) => !t.hide);\n if (options.targets.length === 0) {\n observer.next({ data: [] });\n observer.complete();\n return;\n }\n\n const { range } = options;\n if (!range) {\n observer.next({ data: [] });\n observer.complete();\n return;\n }\n const start = range!.from;\n const end = range!.to;\n\n const calls = options.targets.map(target => {\n const query = getTemplateSrv().replace(target.queryText, options.scopedVars, this.formatter);\n\n const request = {\n \"query\": query,\n \"startTime\": start.toISOString(),\n \"endTime\": end.toISOString(),\n \"send_null\": true\n };\n\n return lastValueFrom(\n this.doFetch({\n url: this.url + '/api/v1/query',\n data: request,\n method: 'POST',\n }).pipe(\n map((response) => {\n return this.arrayToDataFrame(response.data);\n }),\n catchError((err) => {\n throw new Error(err.data.message);\n })\n )\n );\n });\n\n Promise.all(calls).then(data => {\n observer.next({ data });\n observer.complete();\n }).catch(error => {\n observer.error(error);\n });\n });\n }\n\n private formatter(value: string | string[], options: any): string {\n if (options.multi && Array.isArray(value)) {\n return (value as string[]).map(v => `'${v}'`).join(',');\n } else if (options.multi) {\n return `'${value}'`;\n }\n return value as string;\n }\n\n async metricFindQuery(query: string, options?: any): Promise {\n const to = new Date();\n const from = new Date();\n from.setFullYear(to.getFullYear() - 1);\n\n options = options || {};\n options.range = options.range || { \n from: from,\n to: to\n }\n\n options.targets = [];\n options.targets.push({ queryText: query, scopedVars: {} });\n\n return new Promise((resolve, reject) => {\n this.query(options).subscribe({\n next: (response: DataQueryResponse) => {\n const values: MetricFindValue[] = response.data\n .map((dataFrame: DataFrame) => dataFrame.fields[0].values.toArray())\n .flat()\n .map((value: any) => ({ text: value }));\n \n resolve(values);\n },\n error: (error: any) => {\n reject(error);\n },\n });\n })\n }\n\n arrayToDataFrame(array: any[]): DataFrame {\n let dataFrame: MutableDataFrame = new MutableDataFrame();\n\n if (array.length > 0) {\n const fields = Object.keys(array[0]).map(field => {\n let fieldType = guessFieldTypeFromValue(array[0][field])\n // p_timestamp is always a time field present in the log\n // stream as parseable adds it to the log event\n if (field.toLowerCase() === 'p_timestamp') {\n fieldType = FieldType.time;\n }\n return { name: field, type: fieldType};\n });\n dataFrame = new MutableDataFrame({ fields });\n }\n\n array.forEach((row) => {\n dataFrame.appendRow(Object.values(row));\n });\n\n return dataFrame;\n }\n\n doFetch(options: BackendSrvRequest) {\n options.withCredentials = this.withCredentials;\n options.headers = this.headers;\n\n return getBackendSrv().fetch(options);\n }\n\n async listStreams(): Promise {\n return lastValueFrom(\n this.doFetch({\n url: this.url + '/api/v1/logstream',\n method: 'GET',\n }).pipe(\n map((response) =>\n isArray(response.data)\n ? response.data\n : []\n ),\n catchError((err) => {\n return of([]);\n }))\n );\n }\n\n async streamStats(streamname: StreamName): Promise {\n if (streamname) {\n return lastValueFrom(\n this.doFetch({\n url: this.url + '/api/v1/logstream/' + streamname.value + '/stats',\n method: 'GET',\n }).pipe(\n map((response) =>\n (typeof response.data === 'object' && !isNull(response.data))\n ? response.data\n : {}\n ),\n catchError((err) => {\n return of({\n status: 'error',\n message: err.statusText\n })\n\n }))\n )\n }\n return {}\n }\n\n async streamSchema(streamname: StreamName): Promise {\n if (streamname) {\n return lastValueFrom(\n this.doFetch({\n url: this.url + '/api/v1/logstream/' + streamname.value + '/schema',\n method: 'GET',\n }).pipe(\n map((response) =>\n (typeof response.data === 'object' && !isNull(response.data))\n ? response.data\n : {}\n ),\n catchError((err) => {\n return of({\n status: 'error',\n message: err.statusText\n })\n\n }))\n )\n }\n return { fields: [] }\n }\n\n async testDatasource() {\n const errorMessageBase = 'Parseable server is not reachable. Verify that your basic authentication credentials are accurate.';\n try {\n const response = await lastValueFrom(\n this.doFetch({\n url: this.url + '/api/v1/logstream',\n method: 'GET',\n }).pipe(map((response) => response))\n );\n\n if (response.status === 200) {\n return { status: 'success', message: 'Parseable server is reachable', title: 'Success' };\n }\n\n return {\n message: response.status === 400 || !response.statusText ? errorMessageBase : response.statusText,\n status: 'error',\n title: 'Error',\n };\n } catch (err) {\n if (typeof err === 'string') {\n return {\n status: 'error',\n message: err,\n };\n }\n\n let error = err as FetchResponse;\n let message = error.statusText ?? errorMessageBase;\n if (error.data?.error?.code !== undefined) {\n message += `: ${error.data.error.code}. ${error.data.error.message}`;\n }\n\n return { status: 'error', message, title: 'Error' };\n }\n }\n}\n","import React, { PureComponent } from 'react';\nimport { DataSourceHttpSettings } from '@grafana/ui';\nimport { DataSourcePluginOptionsEditorProps } from '@grafana/data';\nimport { MyDataSourceOptions, MySecureJsonData } from '../types';\n\n//const { SecretFormField, FormField } = LegacyForms;\n\ninterface Props extends DataSourcePluginOptionsEditorProps {}\n\ninterface State {}\n\nexport class ConfigEditor extends PureComponent {\n render() {\n const { onOptionsChange, options } = this.props;\n return (\n
\n \n
\n );\n }\n}\n","import React, { ComponentType, ChangeEvent, useState } from 'react';\nimport { LegacyForms, AsyncSelect, InlineField, InlineFieldRow, SeriesTable, Label} from '@grafana/ui';\nimport { QueryEditorProps, SelectableValue, GraphSeriesValue } from '@grafana/data';\nimport { DataSource } from '../datasource';\nimport { SchemaFields, MyDataSourceOptions, MyQuery } from '../types';\n\nconst { FormField } = LegacyForms;\n\ninterface Props extends QueryEditorProps {\n payload?: string;\n}\n\nexport const QueryEditor: ComponentType = ({ datasource, onChange, onRunQuery, query }) => {\n\n const { queryText } = query;\n //const [stream, setStream] = React.useState>();\n\n const loadAsyncOptions = React.useCallback(() => {\n return datasource.listStreams().then(\n (result) => {\n const stream = result.map((data) => ({ label: data.name, value: data.name }));\n return stream;\n },\n (response) => {\n //setStream({ label: '', value: '' });\n throw new Error(response.statusText);\n }\n );\n }, [datasource]);\n\n const [value, setValue] = useState>();\n const [schema = '', setSchema] = React.useState();\n const [count = '', setEventCount] = React.useState();\n const [jsonsize = '', setJsonSize] = React.useState();\n const [parquetsize = '', setParquetSize] = React.useState();\n const [streamname = '', setStreamName] = React.useState();\n const [time = '', setTime] = React.useState();\n //const [fielder, setFielder] = React.useState();\n\n const loadStreamSchema = React.useCallback((value) => {\n if (value) {\n return datasource.streamSchema(value).then(\n (result) => {\n if (result.fields) {\n const schema = result.fields.map((data: SchemaFields) => (data.name));\n const schemaToText = schema.join(\", \")\n setSchema(schemaToText);\n return schema;\n }\n return schema;\n },\n (response) => {\n throw new Error(response.statusText);\n }\n );\n }\n return '';\n }, [datasource, schema]);\n\n const loadStreamStats = React.useCallback((value) => {\n if (value) {\n return datasource.streamStats(value).then(\n (result) => {\n if (result.ingestion) {\n const count = result.ingestion.count;\n const jsonsize = result.ingestion.size;\n const parquetsize = result.storage?.size;\n const streamname = result.stream;\n const time = result.time;\n setJsonSize(jsonsize);\n setParquetSize(parquetsize);\n setStreamName(streamname);\n setEventCount(count);\n setTime(time);\n return count;\n }\n return count;\n },\n (response) => {\n throw new Error(response.statusText);\n }\n );\n }\n return '';\n }, [datasource, count]);\n\n const onQueryTextChange = (event: ChangeEvent) => {\n onChange({ ...query, queryText: event.target.value });\n };\n\n React.useEffect(() => {\n const getData = setTimeout(() => {\n onRunQuery()\n },\n 2000)\n return () => clearTimeout(getData)\n }, [onRunQuery, queryText])\n\n React.useEffect(() => {\n loadStreamSchema(value)\n }, [loadStreamSchema, value]);\n\n React.useEffect(() => {\n loadStreamStats(value)\n }, [loadStreamStats, value]);\n\n return (\n <>\n \n \n \n \n \n {\n setValue(v);\n }}/>\n \n {/* \n \n */}\n \n\n \n \n \n \n \n\n

\n \n \n );\n};\n","import { DataSourcePlugin } from '@grafana/data';\nimport { DataSource } from './datasource';\nimport { ConfigEditor } from './components/ConfigEditor';\nimport { QueryEditor } from './components/QueryEditor';\nimport { VariableQueryEditor } from './components/VariableQueryEditor';\nimport { MyQuery, MyDataSourceOptions } from './types';\n\nexport const plugin = new DataSourcePlugin(DataSource)\n .setConfigEditor(ConfigEditor)\n .setQueryEditor(QueryEditor)\n .setVariableQueryEditor(VariableQueryEditor);\n","import React, { useState } from 'react';\n\ninterface VariableQueryProps {\n query: string;\n onChange: (query: string, definition: string) => void;\n}\n\nexport const VariableQueryEditor = ({ onChange, query }: VariableQueryProps) => {\n const [state, setState] = useState(query);\n\n const saveQuery = () => {\n onChange(state, state);\n };\n\n const handleChange = (event: React.FormEvent) =>\n setState(event.currentTarget.value);\n\n return (\n <>\n
\n Query\n \n
\n \n );\n};\n\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__781__","__WEBPACK_EXTERNAL_MODULE__531__","__WEBPACK_EXTERNAL_MODULE__7__","__WEBPACK_EXTERNAL_MODULE__241__","__WEBPACK_EXTERNAL_MODULE__959__","__WEBPACK_EXTERNAL_MODULE__269__","__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","isFunction","operate","init","source","lift","hasLift","liftedSource","this","err","error","TypeError","extendStatics","b","setPrototypeOf","__proto__","Array","p","__extends","String","__","constructor","create","__generator","thisArg","body","f","y","t","g","_","label","sent","trys","ops","next","verb","iterator","v","op","done","pop","length","push","e","step","__values","s","m","i","__read","ar","__spreadArray","to","from","pack","arguments","l","slice","concat","__await","ctorFunc","UnsubscriptionError","errors","instance","Error","stack","message","map","toString","join","name","arrRemove","arr","item","index","indexOf","splice","Subscription","initialTeardown","closed","_parentage","_finalizers","empty","unsubscribe","e_1","_a","e_2","_b","isArray","_parentage_1","_parentage_1_1","remove","e_1_1","return","initialFinalizer","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","add","teardown","_hasParent","_addParent","parent","includes","_removeParent","EMPTY","isSubscription","config","onUnhandledError","onStoppedNotification","Promise","useDeprecatedSynchronousErrorHandling","useDeprecatedNextContext","timeoutProvider","setTimeout","handler","timeout","args","_i","delegate","apply","clearTimeout","handle","reportUnhandledError","noop","COMPLETE_NOTIFICATION","createNotification","kind","context","Subscriber","_super","destination","_this","isStopped","EMPTY_OBSERVER","complete","SafeSubscriber","handleStoppedNotification","nextNotification","_next","_error","_complete","_bind","Function","bind","fn","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","context_1","errorThrown","notification","subscriber","createOperatorSubscriber","onNext","onComplete","onError","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","project","subscribe","isArrayLike","x","observable","identity","Observable","_subscribe","operator","isObserver","cb","isRoot","errorContext","_trySubscribe","sink","forEach","promiseCtor","getPromiseCtor","resolve","reject","pipe","operations","fns","input","reduce","prev","toPromise","innerFrom","isInteropObservable","obs","array","then","promise","asyncIterator","isAsyncIterable","fromAsyncIterable","isIterable","iterable","iterable_1","iterable_1_1","getReader","isReadableStreamLike","readableStream","_arguments","generator","q","resume","fulfill","settle","shift","__asyncGenerator","reader","read","releaseLock","readableStreamLikeToAsyncGenerator","createInvalidObservableTypeError","asyncIterable","asyncIterable_1","asyncIterable_1_1","P","__asyncValues","fulfilled","rejected","result","process","catch","catchError","selector","handledResult","innerSub","syncUnsub","DataSource","DataSourceWithBackend","doRequest","query","getBackendSrv","datasourceRequest","method","url","params","options","observer","targets","filter","hide","data","range","start","end","calls","target","request","getTemplateSrv","replace","queryText","scopedVars","formatter","toISOString","lastValueFrom","doFetch","response","arrayToDataFrame","all","multi","metricFindQuery","Date","setFullYear","getFullYear","values","dataFrame","fields","toArray","flat","text","MutableDataFrame","keys","field","fieldType","guessFieldTypeFromValue","toLowerCase","FieldType","time","type","row","appendRow","withCredentials","headers","fetch","listStreams","of","streamStats","streamname","isNull","status","statusText","streamSchema","testDatasource","errorMessageBase","title","code","instanceSettings","super","defaultEditorMode","jsonData","ConfigEditor","PureComponent","render","onOptionsChange","props","div","className","DataSourceHttpSettings","defaultUrl","dataSourceConfig","showAccessOptions","onChange","FormField","LegacyForms","plugin","DataSourcePlugin","setConfigEditor","setQueryEditor","datasource","onRunQuery","loadAsyncOptions","React","setValue","useState","schema","setSchema","count","setEventCount","jsonsize","setJsonSize","parquetsize","setParquetSize","setStreamName","setTime","loadStreamSchema","schemaToText","loadStreamStats","ingestion","size","storage","stream","getData","InlineFieldRow","InlineField","Label","AsyncSelect","loadOptions","defaultOptions","SeriesTable","series","color","isActive","timestamp","br","labelWidth","inputWidth","event","tooltip","setVariableQueryEditor","state","setState","span","onBlur","currentTarget"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"module.js","mappings":"oIAAAA,EAAOC,QAAUC,C,UCA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wX,GAET,CACE2B,MAAO,UACPC,UAAU,EACVrX,MAAO,6BACP/B,MAAO0X,GAET,CACEyB,MAAO,UACPC,UAAU,EACVrX,MAAO,2BACP/B,MAAO4X,GAET,CACEuB,MAAO,UACPC,UAAU,EACVrX,MAAO,yBACP/B,MAAO8X,IAGXuB,UAAWzF,MAKjB,mBAAC0F,KAAAA,MACD,mBAAC3C,GAAAA,CACC4C,WAAY,GACZC,WAAY,IACZxZ,MAAOyR,GAAa,GACpBiF,SA3FqB+C,I,QACzB/C,G,yUAAS,IAAKpG,G,WAAAA,CAAOmB,UAAWgI,EAAMnI,OAAOtR,Q,mVA2FzC+B,MAAM,YACN2X,QAAQ,yD,IC9KbC,wBCHgC,EAAGjD,WAAUpG,YAC9C,MAAOsJ,EAAOC,IAAYtC,EAAAA,GAAAA,UAASjH,GASnC,OACE,sCACE,mBAAC8F,MAAAA,CAAIC,UAAU,WACb,mBAACyD,OAAAA,CAAKzD,UAAU,0BAAyB,SACzC,mBAACzK,QAAAA,CACCrH,KAAK,WACL8R,UAAU,gBACV0D,OAdU,KAChBrD,EAASkD,EAAOA,EAAM,EAchBlD,SAXc+C,GACpBI,EAASJ,EAAMO,cAAcha,OAWvBA,MAAO4Z,K","sources":["webpack://parseable-parseable-datasource/external amd \"@grafana/data\"","webpack://parseable-parseable-datasource/external amd \"@grafana/runtime\"","webpack://parseable-parseable-datasource/external amd \"@grafana/ui\"","webpack://parseable-parseable-datasource/external amd \"lodash\"","webpack://parseable-parseable-datasource/external amd \"react\"","webpack://parseable-parseable-datasource/external amd \"rxjs\"","webpack://parseable-parseable-datasource/webpack/bootstrap","webpack://parseable-parseable-datasource/webpack/runtime/compat get default export","webpack://parseable-parseable-datasource/webpack/runtime/define property getters","webpack://parseable-parseable-datasource/webpack/runtime/hasOwnProperty shorthand","webpack://parseable-parseable-datasource/webpack/runtime/make namespace object","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isFunction.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/lift.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/node_modules/tslib/tslib.es6.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/Subscription.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/config.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/noop.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/NotificationFactories.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/errorContext.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/Subscriber.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/operators/map.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/symbol/observable.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/identity.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/Observable.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/pipe.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/symbol/iterator.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isPromise.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isIterable.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js","webpack://parseable-parseable-datasource/../node_modules/rxjs/dist/esm5/internal/operators/catchError.js","webpack://parseable-parseable-datasource/./datasource.ts","webpack://parseable-parseable-datasource/./components/ConfigEditor.tsx","webpack://parseable-parseable-datasource/./components/QueryEditor.tsx","webpack://parseable-parseable-datasource/./module.ts","webpack://parseable-parseable-datasource/./components/VariableQueryEditor.tsx"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__781__;","module.exports = __WEBPACK_EXTERNAL_MODULE__531__;","module.exports = __WEBPACK_EXTERNAL_MODULE__7__;","module.exports = __WEBPACK_EXTERNAL_MODULE__241__;","module.exports = __WEBPACK_EXTERNAL_MODULE__959__;","module.exports = __WEBPACK_EXTERNAL_MODULE__269__;","// 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 function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return function (source) {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n }\n catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n//# sourceMappingURL=lift.js.map","/******************************************************************************\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 var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\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\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","export var COMPLETE_NOTIFICATION = (function () { return createNotification('C', undefined, undefined); })();\nexport function errorNotification(error) {\n return createNotification('E', undefined, error);\n}\nexport function nextNotification(value) {\n return createNotification('N', value, undefined);\n}\nexport function createNotification(kind, value, error) {\n return {\n kind: kind,\n value: value,\n error: error,\n };\n}\n//# sourceMappingURL=NotificationFactories.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","import { __extends } from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nvar OperatorSubscriber = (function (_super) {\n __extends(OperatorSubscriber, _super);\n function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n var _this = _super.call(this, destination) || this;\n _this.onFinalize = onFinalize;\n _this.shouldUnsubscribe = shouldUnsubscribe;\n _this._next = onNext\n ? function (value) {\n try {\n onNext(value);\n }\n catch (err) {\n destination.error(err);\n }\n }\n : _super.prototype._next;\n _this._error = onError\n ? function (err) {\n try {\n onError(err);\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._error;\n _this._complete = onComplete\n ? function () {\n try {\n onComplete();\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._complete;\n return _this;\n }\n OperatorSubscriber.prototype.unsubscribe = function () {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var closed_1 = this.closed;\n _super.prototype.unsubscribe.call(this);\n !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n };\n return OperatorSubscriber;\n}(Subscriber));\nexport { OperatorSubscriber };\n//# sourceMappingURL=OperatorSubscriber.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n//# sourceMappingURL=map.js.map","export var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });\n//# sourceMappingURL=isArrayLike.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","export function getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}\nexport var iterator = getSymbolIterator();\n//# sourceMappingURL=iterator.js.map","import { __asyncValues, __awaiter, __generator, __values } from \"tslib\";\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isPromise } from '../util/isPromise';\nimport { Observable } from '../Observable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isIterable } from '../util/isIterable';\nimport { isReadableStreamLike, readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nimport { isFunction } from '../util/isFunction';\nimport { reportUnhandledError } from '../util/reportUnhandledError';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function innerFrom(input) {\n if (input instanceof Observable) {\n return input;\n }\n if (input != null) {\n if (isInteropObservable(input)) {\n return fromInteropObservable(input);\n }\n if (isArrayLike(input)) {\n return fromArrayLike(input);\n }\n if (isPromise(input)) {\n return fromPromise(input);\n }\n if (isAsyncIterable(input)) {\n return fromAsyncIterable(input);\n }\n if (isIterable(input)) {\n return fromIterable(input);\n }\n if (isReadableStreamLike(input)) {\n return fromReadableStreamLike(input);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\nexport function fromInteropObservable(obj) {\n return new Observable(function (subscriber) {\n var obs = obj[Symbol_observable]();\n if (isFunction(obs.subscribe)) {\n return obs.subscribe(subscriber);\n }\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n });\n}\nexport function fromArrayLike(array) {\n return new Observable(function (subscriber) {\n for (var i = 0; i < array.length && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n });\n}\nexport function fromPromise(promise) {\n return new Observable(function (subscriber) {\n promise\n .then(function (value) {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) { return subscriber.error(err); })\n .then(null, reportUnhandledError);\n });\n}\nexport function fromIterable(iterable) {\n return new Observable(function (subscriber) {\n var e_1, _a;\n try {\n for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {\n var value = iterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n subscriber.complete();\n });\n}\nexport function fromAsyncIterable(asyncIterable) {\n return new Observable(function (subscriber) {\n process(asyncIterable, subscriber).catch(function (err) { return subscriber.error(err); });\n });\n}\nexport function fromReadableStreamLike(readableStream) {\n return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));\n}\nfunction process(asyncIterable, subscriber) {\n var asyncIterable_1, asyncIterable_1_1;\n var e_2, _a;\n return __awaiter(this, void 0, void 0, function () {\n var value, e_2_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 5, 6, 11]);\n asyncIterable_1 = __asyncValues(asyncIterable);\n _b.label = 1;\n case 1: return [4, asyncIterable_1.next()];\n case 2:\n if (!(asyncIterable_1_1 = _b.sent(), !asyncIterable_1_1.done)) return [3, 4];\n value = asyncIterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return [2];\n }\n _b.label = 3;\n case 3: return [3, 1];\n case 4: return [3, 11];\n case 5:\n e_2_1 = _b.sent();\n e_2 = { error: e_2_1 };\n return [3, 11];\n case 6:\n _b.trys.push([6, , 9, 10]);\n if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return))) return [3, 8];\n return [4, _a.call(asyncIterable_1)];\n case 7:\n _b.sent();\n _b.label = 8;\n case 8: return [3, 10];\n case 9:\n if (e_2) throw e_2.error;\n return [7];\n case 10: return [7];\n case 11:\n subscriber.complete();\n return [2];\n }\n });\n });\n}\n//# sourceMappingURL=innerFrom.js.map","import { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\nexport function isInteropObservable(input) {\n return isFunction(input[Symbol_observable]);\n}\n//# sourceMappingURL=isInteropObservable.js.map","import { isFunction } from \"./isFunction\";\nexport function isPromise(value) {\n return isFunction(value === null || value === void 0 ? void 0 : value.then);\n}\n//# sourceMappingURL=isPromise.js.map","import { isFunction } from './isFunction';\nexport function isAsyncIterable(obj) {\n return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);\n}\n//# sourceMappingURL=isAsyncIterable.js.map","import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\nexport function isIterable(input) {\n return isFunction(input === null || input === void 0 ? void 0 : input[Symbol_iterator]);\n}\n//# sourceMappingURL=isIterable.js.map","import { __asyncGenerator, __await, __generator } from \"tslib\";\nimport { isFunction } from './isFunction';\nexport function readableStreamLikeToAsyncGenerator(readableStream) {\n return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {\n var reader, _a, value, done;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n reader = readableStream.getReader();\n _b.label = 1;\n case 1:\n _b.trys.push([1, , 9, 10]);\n _b.label = 2;\n case 2:\n if (!true) return [3, 8];\n return [4, __await(reader.read())];\n case 3:\n _a = _b.sent(), value = _a.value, done = _a.done;\n if (!done) return [3, 5];\n return [4, __await(void 0)];\n case 4: return [2, _b.sent()];\n case 5: return [4, __await(value)];\n case 6: return [4, _b.sent()];\n case 7:\n _b.sent();\n return [3, 2];\n case 8: return [3, 10];\n case 9:\n reader.releaseLock();\n return [7];\n case 10: return [2];\n }\n });\n });\n}\nexport function isReadableStreamLike(obj) {\n return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);\n}\n//# sourceMappingURL=isReadableStreamLike.js.map","export function createInvalidObservableTypeError(input) {\n return new TypeError(\"You provided \" + (input !== null && typeof input === 'object' ? 'an invalid object' : \"'\" + input + \"'\") + \" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.\");\n}\n//# sourceMappingURL=throwUnobservableError.js.map","import { map } from './map';\nimport { innerFrom } from '../observable/innerFrom';\nimport { operate } from '../util/lift';\nimport { mergeInternals } from './mergeInternals';\nimport { isFunction } from '../util/isFunction';\nexport function mergeMap(project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Infinity; }\n if (isFunction(resultSelector)) {\n return mergeMap(function (a, i) { return map(function (b, ii) { return resultSelector(a, b, i, ii); })(innerFrom(project(a, i))); }, concurrent);\n }\n else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return operate(function (source, subscriber) { return mergeInternals(source, subscriber, project, concurrent); });\n}\n//# sourceMappingURL=mergeMap.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { executeSchedule } from '../util/executeSchedule';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {\n var buffer = [];\n var active = 0;\n var index = 0;\n var isComplete = false;\n var checkComplete = function () {\n if (isComplete && !buffer.length && !active) {\n subscriber.complete();\n }\n };\n var outerNext = function (value) { return (active < concurrent ? doInnerSub(value) : buffer.push(value)); };\n var doInnerSub = function (value) {\n expand && subscriber.next(value);\n active++;\n var innerComplete = false;\n innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, function (innerValue) {\n onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);\n if (expand) {\n outerNext(innerValue);\n }\n else {\n subscriber.next(innerValue);\n }\n }, function () {\n innerComplete = true;\n }, undefined, function () {\n if (innerComplete) {\n try {\n active--;\n var _loop_1 = function () {\n var bufferedValue = buffer.shift();\n if (innerSubScheduler) {\n executeSchedule(subscriber, innerSubScheduler, function () { return doInnerSub(bufferedValue); });\n }\n else {\n doInnerSub(bufferedValue);\n }\n };\n while (buffer.length && active < concurrent) {\n _loop_1();\n }\n checkComplete();\n }\n catch (err) {\n subscriber.error(err);\n }\n }\n }));\n };\n source.subscribe(createOperatorSubscriber(subscriber, outerNext, function () {\n isComplete = true;\n checkComplete();\n }));\n return function () {\n additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();\n };\n}\n//# sourceMappingURL=mergeInternals.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { operate } from '../util/lift';\nexport function catchError(selector) {\n return operate(function (source, subscriber) {\n var innerSub = null;\n var syncUnsub = false;\n var handledResult;\n innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, undefined, function (err) {\n handledResult = innerFrom(selector(err, catchError(selector)(source)));\n if (innerSub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n else {\n syncUnsub = true;\n }\n }));\n if (syncUnsub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n });\n}\n//# sourceMappingURL=catchError.js.map","import {\n getBackendSrv,\n getTemplateSrv,\n BackendSrvRequest,\n FetchResponse,\n DataSourceWithBackend,\n} from '@grafana/runtime';\nimport {\n DataQueryRequest,\n DataQueryResponse,\n DataSourceInstanceSettings,\n MutableDataFrame,\n DataFrame,\n FieldType,\n guessFieldTypeFromValue,\n MetricFindValue,\n} from '@grafana/data';\nimport { lastValueFrom, of, Observable } from 'rxjs';\nimport { catchError, map, mergeMap } from 'rxjs/operators';\nimport { isArray, isNull } from 'lodash';\n\nimport {\n MyQuery,\n MyDataSourceOptions,\n QueryEditorMode,\n StreamList,\n StreamSchemaResponse,\n StreamStatsResponse,\n SchemaFields,\n} from './types';\n\nconst numberType = [\n 'Int8',\n 'Int16',\n 'Int32',\n 'Int64',\n 'UInt8',\n 'UInt16',\n 'UInt32',\n 'UInt64',\n 'Float16',\n 'Float32',\n 'Float64',\n];\nconst stringType = ['Utf8', 'LargeUtf8'];\nconst timeType = ['Date32', 'Date64', 'Timestamp', 'Time32', 'Time64'];\n\nexport class DataSource extends DataSourceWithBackend {\n url: string;\n withCredentials: boolean;\n headers: any;\n defaultEditorMode: QueryEditorMode;\n constructor(instanceSettings: DataSourceInstanceSettings) {\n super(instanceSettings);\n this.url = instanceSettings.url === undefined ? '' : instanceSettings.url;\n this.withCredentials = instanceSettings.withCredentials !== undefined;\n this.defaultEditorMode = instanceSettings.jsonData?.defaultEditorMode ?? 'code';\n }\n\n async doRequest(query: MyQuery) {\n const routePath = '/api/v1';\n const result = await getBackendSrv().datasourceRequest({\n method: 'GET',\n url: this.url + routePath + '/readiness',\n params: query,\n });\n return result;\n }\n\n extractStreamName = (sqlQuery: string): string | null => {\n const tableRegex = /from\\s+([\\w\\.]+)/i;\n const match = sqlQuery.match(tableRegex);\n if (match) {\n return match[1];\n }\n\n return null;\n };\n\n query(options: DataQueryRequest): Observable {\n return new Observable((observer) => {\n options.targets = options.targets.filter((t) => !t.hide);\n if (options.targets.length === 0) {\n observer.next({ data: [] });\n observer.complete();\n return;\n }\n\n const { range } = options;\n if (!range) {\n observer.next({ data: [] });\n observer.complete();\n return;\n }\n const start = range!.from;\n const end = range!.to;\n\n const calls = options.targets.map((target) => {\n const query = getTemplateSrv().replace(target.queryText, options.scopedVars, this.formatter);\n\n const request = {\n query,\n startTime: start.toISOString(),\n endTime: end.toISOString(),\n send_null: true,\n };\n\n const streamName = this.extractStreamName(query);\n return lastValueFrom(\n this.doFetch({\n url: this.url + '/api/v1/query',\n data: request,\n method: 'POST',\n }).pipe(\n mergeMap(async (response) => {\n return this.arrayToDataFrame(response.data, streamName, request.query);\n }),\n catchError((err) => {\n throw new Error(err.data.message);\n })\n )\n );\n });\n\n Promise.all(calls)\n .then((data) => {\n observer.next({ data });\n observer.complete();\n })\n .catch((error) => {\n observer.error(error);\n });\n });\n }\n\n private formatter(value: string | string[], options: any): string {\n if (options.multi && Array.isArray(value)) {\n return (value as string[]).map((v) => `'${v}'`).join(',');\n } else if (options.multi) {\n return `'${value}'`;\n }\n return value as string;\n }\n\n async metricFindQuery(query: string, options?: any): Promise {\n const to = new Date();\n const from = new Date();\n from.setFullYear(to.getFullYear() - 1);\n\n options = options || {};\n options.range = options.range || {\n from: from,\n to: to,\n };\n\n options.targets = [];\n options.targets.push({ queryText: query, scopedVars: {} });\n\n return new Promise((resolve, reject) => {\n this.query(options).subscribe({\n next: (response: DataQueryResponse) => {\n const values: MetricFindValue[] = response.data\n .map((dataFrame: DataFrame) => dataFrame.fields[0].values.toArray())\n .flat()\n .map((value: any) => ({ text: value }));\n\n resolve(values);\n },\n error: (error: any) => {\n reject(error);\n },\n });\n });\n }\n\n async arrayToDataFrame(array: any[], streamName?: string | null, query?: string): Promise {\n let dataFrame: MutableDataFrame = new MutableDataFrame();\n let isHeadersMadeFromData = false;\n\n const setHeadersFromData = () => {\n if (array.length > 0) {\n const fields = Object.keys(array[0]).map((field) => {\n let fieldType = guessFieldTypeFromValue(array[0][field]);\n // p_timestamp is always a time field present in the log\n // stream as parseable adds it to the log event\n if (field.toLowerCase() === 'p_timestamp') {\n fieldType = FieldType.time;\n }\n return { name: field, type: fieldType };\n });\n dataFrame = new MutableDataFrame({ fields });\n isHeadersMadeFromData = true;\n }\n };\n\n const selectAllRegex = /^SELECT\\s+\\*/i;\n const containsSelectAll = selectAllRegex.test(query || '');\n if (streamName && containsSelectAll) {\n const streamSchema = await this.getStreamSchema(streamName);\n const schemaFields: SchemaFields[] | undefined = streamSchema.fields;\n if (schemaFields && schemaFields.length > 0) {\n const headers = schemaFields.map((field) => {\n const grafanaDatatype = (() => {\n if (field.name === 'p_timestamp') {\n return FieldType.time;\n } else if (!field?.data_type) {\n return FieldType.other;\n } else if (field.data_type === 'Boolean') {\n return FieldType.boolean;\n } else if (numberType.indexOf(field.data_type) !== -1) {\n return FieldType.number;\n } else if (stringType.indexOf(field.data_type) !== -1) {\n return FieldType.string;\n } else if (timeType.indexOf(field.data_type) !== -1) {\n return FieldType.time;\n } else {\n return FieldType.other;\n }\n })();\n return { name: field.name, type: grafanaDatatype };\n });\n dataFrame = new MutableDataFrame({ fields: headers });\n } else {\n setHeadersFromData();\n }\n } else {\n setHeadersFromData();\n }\n\n array.forEach((row) => {\n if (isHeadersMadeFromData) {\n dataFrame.appendRow(Object.values(row));\n } else {\n const keys = dataFrame.fields.map((field) => field.name);\n const defaultObj = keys.reduce((obj, key) => ({ ...obj, [key]: null }), {});\n const sanitizedObj = { ...defaultObj, ...row };\n dataFrame.appendRow(Object.values(sanitizedObj));\n }\n });\n\n return dataFrame;\n }\n\n doFetch(options: BackendSrvRequest) {\n options.withCredentials = this.withCredentials;\n options.headers = this.headers;\n\n return getBackendSrv().fetch(options);\n }\n\n async listStreams(): Promise {\n return lastValueFrom(\n this.doFetch({\n url: this.url + '/api/v1/logstream',\n method: 'GET',\n }).pipe(\n map((response) => (isArray(response.data) ? response.data : [])),\n catchError((err) => {\n return of([]);\n })\n )\n );\n }\n\n async getStreamStats(streamName: string): Promise {\n if (streamName) {\n return lastValueFrom(\n this.doFetch({\n url: this.url + '/api/v1/logstream/' + streamName + '/stats',\n method: 'GET',\n }).pipe(\n map((response) => (typeof response.data === 'object' && !isNull(response.data) ? response.data : {})),\n catchError((err) => {\n return of({\n status: 'error',\n message: err.statusText,\n });\n })\n )\n );\n }\n return {};\n }\n\n async getStreamSchema(streamName: string): Promise {\n if (streamName) {\n return lastValueFrom(\n this.doFetch({\n url: this.url + '/api/v1/logstream/' + streamName + '/schema',\n method: 'GET',\n }).pipe(\n map((response) => (typeof response.data === 'object' && !isNull(response.data) ? response.data : {})),\n catchError((err) => {\n return of({\n status: 'error',\n message: err.statusText,\n });\n })\n )\n );\n }\n return { fields: [] };\n }\n\n async testDatasource() {\n const errorMessageBase =\n 'Parseable server is not reachable. Verify that your basic authentication credentials are accurate.';\n try {\n const response = await lastValueFrom(\n this.doFetch({\n url: this.url + '/api/v1/logstream',\n method: 'GET',\n }).pipe(map((response) => response))\n );\n\n if (response.status === 200) {\n return { status: 'success', message: 'Parseable server is reachable', title: 'Success' };\n }\n\n return {\n message: response.status === 400 || !response.statusText ? errorMessageBase : response.statusText,\n status: 'error',\n title: 'Error',\n };\n } catch (err) {\n if (typeof err === 'string') {\n return {\n status: 'error',\n message: err,\n };\n }\n\n let error = err as FetchResponse;\n let message = error.statusText ?? errorMessageBase;\n if (error.data?.error?.code !== undefined) {\n message += `: ${error.data.error.code}. ${error.data.error.message}`;\n }\n\n return { status: 'error', message, title: 'Error' };\n }\n }\n}\n","import React, { PureComponent } from 'react';\nimport { DataSourceHttpSettings } from '@grafana/ui';\nimport { DataSourcePluginOptionsEditorProps } from '@grafana/data';\nimport { MyDataSourceOptions, MySecureJsonData } from '../types';\n\n//const { SecretFormField, FormField } = LegacyForms;\n\ninterface Props extends DataSourcePluginOptionsEditorProps {}\n\ninterface State {}\n\nexport class ConfigEditor extends PureComponent {\n render() {\n const { onOptionsChange, options } = this.props;\n return (\n
\n \n
\n );\n }\n}\n","import React, { ComponentType, ChangeEvent, useState } from 'react';\nimport { LegacyForms, AsyncSelect, InlineField, InlineFieldRow, SeriesTable, Label } from '@grafana/ui';\nimport { QueryEditorProps, SelectableValue, GraphSeriesValue } from '@grafana/data';\nimport { DataSource } from '../datasource';\nimport { SchemaFields, MyDataSourceOptions, MyQuery } from '../types';\n\nconst { FormField } = LegacyForms;\n\ninterface Props extends QueryEditorProps {\n payload?: string;\n}\n\nexport const QueryEditor: ComponentType = ({ datasource, onChange, onRunQuery, query }) => {\n const { queryText } = query;\n //const [stream, setStream] = React.useState>();\n\n const loadAsyncOptions = React.useCallback(() => {\n return datasource.listStreams().then(\n (result) => {\n const stream = result.map((data) => ({ label: data.name, value: data.name }));\n return stream;\n },\n (response) => {\n //setStream({ label: '', value: '' });\n throw new Error(response.statusText);\n }\n );\n }, [datasource]);\n\n const [selectedStream, setSelectedStream] = useState>();\n const [schema = '', setSchema] = React.useState();\n const [count = '', setEventCount] = React.useState();\n const [jsonsize = '', setJsonSize] = React.useState();\n const [parquetsize = '', setParquetSize] = React.useState();\n const [streamname = '', setStreamName] = React.useState();\n const [time = '', setTime] = React.useState();\n //const [fielder, setFielder] = React.useState();\n\n const loadStreamSchema = React.useCallback(\n (streamName) => {\n if (streamName && typeof streamName === 'string') {\n return datasource.getStreamSchema(streamName).then(\n (result) => {\n if (result.fields) {\n const schema = result.fields.map((data: SchemaFields) => data.name);\n const schemaToText = schema.join(', ');\n setSchema(schemaToText);\n return schema;\n }\n return schema;\n },\n (response) => {\n throw new Error(response.statusText);\n }\n );\n }\n return '';\n },\n [datasource, schema]\n );\n\n const loadStreamStats = React.useCallback(\n (streamName) => {\n if (streamName) {\n return datasource.getStreamStats(streamName).then(\n (result) => {\n if (result.ingestion) {\n const count = result.ingestion.count;\n const jsonsize = result.ingestion.size;\n const parquetsize = result.storage?.size;\n const streamname = result.stream;\n const time = result.time;\n setJsonSize(jsonsize);\n setParquetSize(parquetsize);\n setStreamName(streamname);\n setEventCount(count);\n setTime(time);\n return count;\n }\n return count;\n },\n (response) => {\n throw new Error(response.statusText);\n }\n );\n }\n return '';\n },\n [datasource, count]\n );\n\n const onQueryTextChange = (event: ChangeEvent) => {\n onChange({ ...query, queryText: event.target.value });\n };\n\n React.useEffect(() => {\n const getData = setTimeout(() => {\n onRunQuery();\n }, 2000);\n return () => clearTimeout(getData);\n }, [onRunQuery, queryText]);\n\n React.useEffect(() => {\n loadStreamSchema(selectedStream?.value);\n }, [loadStreamSchema, selectedStream]);\n\n React.useEffect(() => {\n loadStreamStats(selectedStream?.value);\n }, [loadStreamStats, selectedStream]);\n\n return (\n <>\n \n \n \n \n \n {\n setSelectedStream(v);\n }}\n />\n \n {/* \n \n */}\n \n\n \n \n \n \n \n\n

\n \n \n );\n};\n","import { DataSourcePlugin } from '@grafana/data';\nimport { DataSource } from './datasource';\nimport { ConfigEditor } from './components/ConfigEditor';\nimport { QueryEditor } from './components/QueryEditor';\nimport { VariableQueryEditor } from './components/VariableQueryEditor';\nimport { MyQuery, MyDataSourceOptions } from './types';\n\nexport const plugin = new DataSourcePlugin(DataSource)\n .setConfigEditor(ConfigEditor)\n .setQueryEditor(QueryEditor)\n .setVariableQueryEditor(VariableQueryEditor);\n","import React, { useState } from 'react';\n\ninterface VariableQueryProps {\n query: string;\n onChange: (query: string, definition: string) => void;\n}\n\nexport const VariableQueryEditor = ({ onChange, query }: VariableQueryProps) => {\n const [state, setState] = useState(query);\n\n const saveQuery = () => {\n onChange(state, state);\n };\n\n const handleChange = (event: React.FormEvent) =>\n setState(event.currentTarget.value);\n\n return (\n <>\n
\n Query\n \n
\n \n );\n};\n\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__781__","__WEBPACK_EXTERNAL_MODULE__531__","__WEBPACK_EXTERNAL_MODULE__7__","__WEBPACK_EXTERNAL_MODULE__241__","__WEBPACK_EXTERNAL_MODULE__959__","__WEBPACK_EXTERNAL_MODULE__269__","__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","isFunction","operate","init","source","lift","hasLift","liftedSource","this","err","error","TypeError","extendStatics","b","setPrototypeOf","__proto__","Array","p","__extends","String","__","constructor","create","__generator","thisArg","body","f","y","t","g","_","label","sent","trys","ops","next","verb","iterator","v","op","done","pop","length","push","e","step","__values","s","m","i","__read","ar","__spreadArray","to","from","pack","arguments","l","slice","concat","__await","ctorFunc","UnsubscriptionError","errors","instance","Error","stack","message","map","toString","join","name","arrRemove","arr","item","index","indexOf","splice","Subscription","initialTeardown","closed","_parentage","_finalizers","empty","unsubscribe","e_1","_a","e_2","_b","isArray","_parentage_1","_parentage_1_1","remove","e_1_1","return","initialFinalizer","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","add","teardown","_hasParent","_addParent","parent","includes","_removeParent","EMPTY","isSubscription","config","onUnhandledError","onStoppedNotification","Promise","useDeprecatedSynchronousErrorHandling","useDeprecatedNextContext","timeoutProvider","setTimeout","handler","timeout","args","_i","delegate","apply","clearTimeout","handle","reportUnhandledError","noop","COMPLETE_NOTIFICATION","createNotification","kind","context","Subscriber","_super","destination","_this","isStopped","EMPTY_OBSERVER","complete","SafeSubscriber","handleStoppedNotification","nextNotification","_next","_error","_complete","_bind","Function","bind","fn","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","context_1","errorThrown","notification","subscriber","createOperatorSubscriber","onNext","onComplete","onError","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","project","subscribe","isArrayLike","x","observable","identity","Observable","_subscribe","operator","isObserver","cb","isRoot","errorContext","_trySubscribe","sink","forEach","promiseCtor","getPromiseCtor","resolve","reject","pipe","operations","fns","input","reduce","prev","toPromise","innerFrom","isInteropObservable","obs","array","then","promise","asyncIterator","isAsyncIterable","fromAsyncIterable","isIterable","iterable","iterable_1","iterable_1_1","getReader","isReadableStreamLike","readableStream","_arguments","generator","q","resume","fulfill","settle","shift","__asyncGenerator","reader","read","releaseLock","readableStreamLikeToAsyncGenerator","createInvalidObservableTypeError","asyncIterable","asyncIterable_1","asyncIterable_1_1","P","__asyncValues","fulfilled","rejected","result","process","catch","mergeMap","resultSelector","concurrent","Infinity","ii","onBeforeNext","expand","innerSubScheduler","additionalFinalizer","buffer","active","isComplete","checkComplete","outerNext","doInnerSub","innerComplete","innerValue","_loop_1","bufferedValue","mergeInternals","catchError","selector","handledResult","innerSub","syncUnsub","numberType","stringType","timeType","DataSource","DataSourceWithBackend","doRequest","query","getBackendSrv","datasourceRequest","method","url","params","options","observer","targets","filter","hide","data","range","start","end","calls","target","getTemplateSrv","replace","queryText","scopedVars","formatter","request","startTime","toISOString","endTime","send_null","streamName","extractStreamName","lastValueFrom","doFetch","response","arrayToDataFrame","all","multi","metricFindQuery","Date","setFullYear","getFullYear","values","dataFrame","fields","toArray","flat","text","MutableDataFrame","isHeadersMadeFromData","setHeadersFromData","keys","field","fieldType","guessFieldTypeFromValue","toLowerCase","FieldType","time","type","containsSelectAll","test","schemaFields","getStreamSchema","headers","grafanaDatatype","data_type","boolean","number","string","other","row","appendRow","defaultObj","sanitizedObj","withCredentials","fetch","listStreams","of","getStreamStats","isNull","status","statusText","testDatasource","errorMessageBase","title","code","instanceSettings","super","defaultEditorMode","sqlQuery","match","jsonData","ConfigEditor","PureComponent","render","onOptionsChange","props","div","className","DataSourceHttpSettings","defaultUrl","dataSourceConfig","showAccessOptions","onChange","FormField","LegacyForms","plugin","DataSourcePlugin","setConfigEditor","setQueryEditor","datasource","onRunQuery","loadAsyncOptions","React","selectedStream","setSelectedStream","useState","schema","setSchema","count","setEventCount","jsonsize","setJsonSize","parquetsize","setParquetSize","streamname","setStreamName","setTime","loadStreamSchema","schemaToText","loadStreamStats","ingestion","size","storage","stream","getData","InlineFieldRow","InlineField","Label","AsyncSelect","loadOptions","defaultOptions","SeriesTable","series","color","isActive","timestamp","br","labelWidth","inputWidth","event","tooltip","setVariableQueryEditor","state","setState","span","onBlur","currentTarget"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/plugin.json b/dist/plugin.json index eab4cad..4532375 100644 --- a/dist/plugin.json +++ b/dist/plugin.json @@ -29,8 +29,8 @@ {"name": "Log Explorer", "path": "img/log-view-text.png"}, {"name": "Log Dashboard", "path": "img/log-visualisation.png"} ], - "version": "1.2.0", - "updated": "2024-04-19" + "version": "1.2.1", + "updated": "2024-06-11" }, "routes": [ { diff --git a/package.json b/package.json index 92bc5f9..336f006 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "parseable", - "version": "1.2.0", + "version": "1.2.1", "description": "Parseable is an open source, Kubernetes native, log storage and observability platform. This plugin allows you to visualize your Parseable logs in Grafana.", "scripts": { "build": "webpack -c ./.config/webpack/webpack.config.ts --env production", diff --git a/releases/parseable-datasource-1.2.1.sha1 b/releases/parseable-datasource-1.2.1.sha1 new file mode 100644 index 0000000..3c62aaa --- /dev/null +++ b/releases/parseable-datasource-1.2.1.sha1 @@ -0,0 +1 @@ +37e36e782b9a9a5ba8d16a0c65852bcdda303820 \ No newline at end of file diff --git a/releases/parseable-datasource-1.2.1.zip b/releases/parseable-datasource-1.2.1.zip new file mode 100644 index 0000000..2dd1bb9 Binary files /dev/null and b/releases/parseable-datasource-1.2.1.zip differ diff --git a/src/components/QueryEditor.tsx b/src/components/QueryEditor.tsx index 3660c8f..d992ad0 100644 --- a/src/components/QueryEditor.tsx +++ b/src/components/QueryEditor.tsx @@ -1,5 +1,5 @@ import React, { ComponentType, ChangeEvent, useState } from 'react'; -import { LegacyForms, AsyncSelect, InlineField, InlineFieldRow, SeriesTable, Label} from '@grafana/ui'; +import { LegacyForms, AsyncSelect, InlineField, InlineFieldRow, SeriesTable, Label } from '@grafana/ui'; import { QueryEditorProps, SelectableValue, GraphSeriesValue } from '@grafana/data'; import { DataSource } from '../datasource'; import { SchemaFields, MyDataSourceOptions, MyQuery } from '../types'; @@ -11,7 +11,6 @@ interface Props extends QueryEditorProps = ({ datasource, onChange, onRunQuery, query }) => { - const { queryText } = query; //const [stream, setStream] = React.useState>(); @@ -28,7 +27,7 @@ export const QueryEditor: ComponentType = ({ datasource, onChange, onRunQ ); }, [datasource]); - const [value, setValue] = useState>(); + const [selectedStream, setSelectedStream] = useState>(); const [schema = '', setSchema] = React.useState(); const [count = '', setEventCount] = React.useState(); const [jsonsize = '', setJsonSize] = React.useState(); @@ -37,52 +36,58 @@ export const QueryEditor: ComponentType = ({ datasource, onChange, onRunQ const [time = '', setTime] = React.useState(); //const [fielder, setFielder] = React.useState(); - const loadStreamSchema = React.useCallback((value) => { - if (value) { - return datasource.streamSchema(value).then( - (result) => { - if (result.fields) { - const schema = result.fields.map((data: SchemaFields) => (data.name)); - const schemaToText = schema.join(", ") - setSchema(schemaToText); + const loadStreamSchema = React.useCallback( + (streamName) => { + if (streamName && typeof streamName === 'string') { + return datasource.getStreamSchema(streamName).then( + (result) => { + if (result.fields) { + const schema = result.fields.map((data: SchemaFields) => data.name); + const schemaToText = schema.join(', '); + setSchema(schemaToText); + return schema; + } return schema; + }, + (response) => { + throw new Error(response.statusText); } - return schema; - }, - (response) => { - throw new Error(response.statusText); - } - ); - } - return ''; - }, [datasource, schema]); + ); + } + return ''; + }, + [datasource, schema] + ); - const loadStreamStats = React.useCallback((value) => { - if (value) { - return datasource.streamStats(value).then( - (result) => { - if (result.ingestion) { - const count = result.ingestion.count; - const jsonsize = result.ingestion.size; - const parquetsize = result.storage?.size; - const streamname = result.stream; - const time = result.time; - setJsonSize(jsonsize); - setParquetSize(parquetsize); - setStreamName(streamname); - setEventCount(count); - setTime(time); + const loadStreamStats = React.useCallback( + (streamName) => { + if (streamName) { + return datasource.getStreamStats(streamName).then( + (result) => { + if (result.ingestion) { + const count = result.ingestion.count; + const jsonsize = result.ingestion.size; + const parquetsize = result.storage?.size; + const streamname = result.stream; + const time = result.time; + setJsonSize(jsonsize); + setParquetSize(parquetsize); + setStreamName(streamname); + setEventCount(count); + setTime(time); + return count; + } return count; + }, + (response) => { + throw new Error(response.statusText); } - return count; - }, - (response) => { - throw new Error(response.statusText); - } - ); - } - return ''; - }, [datasource, count]); + ); + } + return ''; + }, + [datasource, count] + ); const onQueryTextChange = (event: ChangeEvent) => { onChange({ ...query, queryText: event.target.value }); @@ -90,36 +95,34 @@ export const QueryEditor: ComponentType = ({ datasource, onChange, onRunQ React.useEffect(() => { const getData = setTimeout(() => { - onRunQuery() - }, - 2000) - return () => clearTimeout(getData) - }, [onRunQuery, queryText]) + onRunQuery(); + }, 2000); + return () => clearTimeout(getData); + }, [onRunQuery, queryText]); React.useEffect(() => { - loadStreamSchema(value) - }, [loadStreamSchema, value]); + loadStreamSchema(selectedStream?.value); + }, [loadStreamSchema, selectedStream]); React.useEffect(() => { - loadStreamStats(value) - }, [loadStreamStats, value]); + loadStreamStats(selectedStream?.value); + }, [loadStreamStats, selectedStream]); return ( <> - + - + { - setValue(v); - }}/> + value={selectedStream} + onChange={(v) => { + setSelectedStream(v); + }} + /> {/*