@dbt-tools/web 0.3.7 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- (function(){let e={accent:`#635BFF`,text:`#171C28`,textSoft:`#6B7385`,bg:`#F6F7FB`,bgSoft:`#FFFFFF`,borderDefault:`#D7DCE7`,borderSubtle:`#E6E9F0`,slate:`#64748B`,rose:`#C0352B`,mint:`#0F8A4B`,amber:`#A56315`},t={accent:`#8A7CFF`,text:`#F3F6FC`,textSoft:`#98A3BC`,bg:`#0D1120`,bgSoft:`#151A2E`,borderDefault:`#313A58`,borderSubtle:`#262E47`,slate:`#8690AA`,rose:`#FF8D86`,mint:`#59D38C`,amber:`#F5B95C`};function n(n){return n===`dark`?t:e}e.mint,e.rose,e.slate,e.rose,e.mint,e.rose,e.amber,e.slate,t.mint,t.rose,t.slate,t.rose,t.mint,t.rose,t.amber,t.slate,e.text,e.textSoft,e.slate,e.accent,t.text,t.textSoft,t.slate,t.accent;function r(e){let t=n(e);return{positive:t.mint,warning:t.amber,danger:t.rose,neutral:t.slate}}r(`light`);let i=new Set([`test`,`unit_test`]);function a(){return{all:0,positive:0,warning:0,danger:0}}function o(){return{all:0,models:0,tests:0,seeds:0,snapshots:0,operations:0,healthy:0,warnings:0,errors:0}}function s(e){return[e.name,e.resourceType,e.packageName,e.path??``,e.uniqueId,e.status,e.threadId??``].join(` `).toLowerCase()}function c(e){return e.trim().toLowerCase()}function l(e,t){return t===`all`||e.statusTone===t}function u(e){return i.has(e.resourceType)?`tests`:e.resourceType===`seed`?`seeds`:e.resourceType===`snapshot`?`snapshots`:e.resourceType===`operation`||e.resourceType===`sql_operation`||e.resourceType===`macro`?`operations`:`models`}function d(e,t){return t===`all`||u(e)===t}function f(e,t){return t===`all`?!0:t===`fast`?e.executionTime<1:t===`medium`?e.executionTime>=1&&e.executionTime<5:e.executionTime>=5}function p(e,t,n){switch(n){case`duration`:return t.executionTime-e.executionTime;case`name`:return e.name.localeCompare(t.name);case`status`:return e.status.localeCompare(t.status);case`start`:return(t.start??0)-(e.start??0);default:{let n={danger:0,warning:1,positive:2,neutral:3},r=n[e.statusTone]-n[t.statusTone];return r===0?t.executionTime-e.executionTime:r}}}function m(e){let t=a(),n=o(),r={},i={};t.all=e.length,n.all=e.length;for(let a of e){let{row:e}=a;e.statusTone===`positive`?(t.positive+=1,n.healthy+=1):e.statusTone===`warning`?(t.warning+=1,n.warnings+=1):e.statusTone===`danger`&&(t.danger+=1,n.errors+=1),n[u(e)]+=1,r[e.resourceType]=(r[e.resourceType]??0)+1,e.threadId&&(i[e.threadId]=(i[e.threadId]??0)+1)}return{status:t,facets:n,resourceTypes:r,threadIds:i}}function h(e){let t=e.map(e=>({row:e,searchText:s(e)}));return{entries:t,summary:m(t)}}function g(e,t){let n=c(t.query),r=new Set(t.resourceTypes),i=new Set(t.threadIds),a=e.entries.filter(e=>{let{row:a}=e;return!(!d(a,t.kind)||!l(a,t.status)||n!==``&&!e.searchText.includes(n)||r.size>0&&!r.has(a.resourceType)||i.size>0&&!i.has(a.threadId??``)||!f(a,t.durationBand))}),o=t.sortBy??`attention`;return[...a].sort((e,t)=>p(e.row,t.row,o))}let _=null,v=null,y=[];function b(e){self.postMessage({type:`error`,message:e})}self.onmessage=e=>{let t=e.data;if(t.type===`init`){_=h(t.rows),v=null,y=[],self.postMessage({type:`ready`,summary:_.summary});return}if(_==null){b(`Results worker queried before initialization.`);return}let n=[t.kind,t.status,t.query.trim().toLowerCase(),t.resourceTypes.sort().join(`,`),t.threadIds.sort().join(`,`),t.durationBand,t.sortBy].join(`::`);n!==v&&(y=g(_,{kind:t.kind,status:t.status,query:t.query,resourceTypes:t.resourceTypes,threadIds:t.threadIds,durationBand:t.durationBand,sortBy:t.sortBy}),v=n);let r=y.slice(0,t.limit);self.postMessage({type:`query-result`,requestId:t.requestId,rows:r.map(e=>e.row),totalMatches:y.length,summary:{status:{all:y.length,positive:y.filter(e=>e.row.statusTone===`positive`).length,warning:y.filter(e=>e.row.statusTone===`warning`).length,danger:y.filter(e=>e.row.statusTone===`danger`).length},facets:{all:y.length,models:y.filter(e=>{let t=e.row.resourceType;return t!==`test`&&t!==`unit_test`&&t!==`seed`&&t!==`snapshot`&&t!==`operation`&&t!==`sql_operation`&&t!==`macro`}).length,tests:y.filter(e=>e.row.resourceType===`test`||e.row.resourceType===`unit_test`).length,seeds:y.filter(e=>e.row.resourceType===`seed`).length,snapshots:y.filter(e=>e.row.resourceType===`snapshot`).length,operations:y.filter(e=>[`operation`,`sql_operation`,`macro`].includes(e.row.resourceType)).length,healthy:y.filter(e=>e.row.statusTone===`positive`).length,warnings:y.filter(e=>e.row.statusTone===`warning`).length,errors:y.filter(e=>e.row.statusTone===`danger`).length},resourceTypes:Object.fromEntries(Object.entries(r.reduce((e,t)=>(e[t.row.resourceType]=(e[t.row.resourceType]??0)+1,e),{}))),threadIds:Object.fromEntries(Object.entries(r.reduce((e,t)=>(t.row.threadId&&(e[t.row.threadId]=(e[t.row.threadId]??0)+1),e),{})))}})}})();