sampledocpayload624286 0.0.9 → 0.0.11

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/payload.html +23 -13
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de3a79dada4f905f67f7508ff14e38527e8e72259ccbc859130028bdfda7721a
4
- data.tar.gz: 7d3fa0f95ea3b1245e46d5a5bb44b7c05605e3ee15974daeb7739728af354a87
3
+ metadata.gz: 5d00932445bd79c8a734952787b30dbee5db12e50b37d96b2222893bc3e3b568
4
+ data.tar.gz: 2cfa0786a4f7a6f414bc6aef564e8ba498c5d5db360d3657066aef57d11130bf
5
5
  SHA512:
6
- metadata.gz: 8610629b18b2efd4f31e50ad162d61eabdc7e99582b2e1b9d994c5f0266585607830597c0288f08e8494ef13c6456a3f2f3be7106a7d089a2fa0fb5eb793f51f
7
- data.tar.gz: e949e6ef8740a66a377367f53aa1906bce2a45c23020790d2be740d619b8b7a5344254227edf23bc04d17da46859f00f8fc98398eb769554116b7f7c83b7ba39
6
+ metadata.gz: 23eb213d62a4e9d01325da271cc1e893d79eb1c05330a5fb9c7d84c043ccf96cb243499261800dfc5fc2dabb7ffb4df8b913c58b433ed94d24af817ecb076564
7
+ data.tar.gz: 8956b4671a79a919e1439a9c17f002f964fbb59bda08d0a876d6e9ebe8f9832a19f216d5bafe2abc9904c69d9b82619a36c579d702b36aff9129c5ab279c41a9
data/payload.html CHANGED
@@ -1,16 +1,26 @@
1
- <!doctype html><meta charset="UTF-8"><title>PB Fetch test v9</title>
2
- <style>body{font-size:16px}pre{white-space:pre-wrap;word-break:break-all}</style>
3
- <h2>Remote fetch test v9</h2><pre id="o">starting...
4
- </pre>
1
+ <!doctype html><meta charset="UTF-8"><title>PB dynamic v11</title>
2
+ <style>body{font:13px monospace;width:1180px;margin:8px}pre{white-space:pre-wrap;word-break:break-all}</style>
3
+ <h3>Dynamic query v11</h3><pre id="o">starting request...</pre>
5
4
  <script>
6
5
  (async function(){
7
- const out=document.getElementById('o');
8
- const url='https://wabi-uk-south-b-primary-api.analysis.windows.net/public/reports/querydata?synchronous=true';
9
- try {
10
- out.textContent='sending...';
11
- let r=await fetch(url,{method:'POST', headers:{'Content-Type':'application/json','X-PowerBI-ResourceKey':'dbf4b088-1821-46ee-bf5e-e03d0e2d5826'}, body: '{}'});
12
- out.textContent='response status='+r.status+' '+r.statusText+'\nheaders:';r.headers.forEach((v,k)=>out.textContent+='\n'+k+':'+v);
13
- let txt=await r.text(); out.textContent+='\n\nBODY:\n'+txt;
14
- } catch(e) {out.textContent='ERROR '+ e +' stack '+e.stack;}
6
+ const out=document.getElementById('o'), params=new URLSearchParams(location.search);
7
+ const palm="{\"version\":\"1.0.0\",\"queries\":[{\"Query\":{\"Commands\":[{\"SemanticQueryDataShapeCommand\":{\"Query\":{\"Version\":2,\"From\":[{\"Name\":\"f\",\"Entity\":\"ForestViolations\",\"Type\":0},{\"Name\":\"l\",\"Entity\":\"lstMdataV2\",\"Type\":0}],\"Select\":[{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"f\"}},\"Property\":\"ViolationType\"},\"Name\":\"ForestViolations.ViolationType\",\"NativeReferenceName\":\"ViolationType\"},{\"Aggregation\":{\"Expression\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"f\"}},\"Property\":\"MID\"}},\"Function\":5},\"Name\":\"CountNonNull(ForestViolations.MID)\",\"NativeReferenceName\":\"Count of MID\"}],\"Where\":[{\"Condition\":{\"Not\":{\"Expression\":{\"Contains\":{\"Left\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"l\"}},\"Property\":\"Category\"}},\"Right\":{\"Literal\":{\"Value\":\"'gas'\"}}}}}}},{\"Condition\":{\"In\":{\"Expressions\":[{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"l\"}},\"Property\":\"Category\"}}],\"Values\":[[{\"Literal\":{\"Value\":\"'Palm oil'\"}}]]}}},{\"Condition\":{\"In\":{\"Expressions\":[{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"l\"}},\"Property\":\"Confidential\"}}],\"Values\":[[{\"Literal\":{\"Value\":\"'No'\"}}],[{\"Literal\":{\"Value\":\"'Yes - Can be mapped/remove confidential column'\"}}]]}}}],\"OrderBy\":[{\"Direction\":2,\"Expression\":{\"Aggregation\":{\"Expression\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"f\"}},\"Property\":\"MID\"}},\"Function\":5}}}]},\"Binding\":{\"Primary\":{\"Groupings\":[{\"Projections\":[0,1]}]},\"DataReduction\":{\"DataVolume\":4,\"Primary\":{\"Window\":{\"Count\":1000}}},\"Version\":1},\"ExecutionMetricsKind\":1}}]},\"CacheKey\":\"\",\"QueryId\":\"\",\"ApplicationContext\":{\"DatasetId\":\"3ee8c599-2a65-4382-8664-00e3d523fc9b\",\"Sources\":[{\"ReportId\":\"b10bc0f8-3141-4b9c-a0f0-e76a6b995d0e\"}]}}],\"cancelQueries\":[],\"modelId\":404810}"; const year="{\"version\":\"1.0.0\",\"queries\":[{\"Query\":{\"Commands\":[{\"SemanticQueryDataShapeCommand\":{\"Query\":{\"Version\":2,\"From\":[{\"Name\":\"m1\",\"Entity\":\"Metrics\",\"Type\":0},{\"Name\":\"f\",\"Entity\":\"Fiscal Calendar\",\"Type\":0},{\"Name\":\"l\",\"Entity\":\"lstMdataV2\",\"Type\":0},{\"Name\":\"l1\",\"Entity\":\"lstSpeciesDetails\",\"Type\":0}],\"Select\":[{\"HierarchyLevel\":{\"Expression\":{\"Hierarchy\":{\"Expression\":{\"PropertyVariationSource\":{\"Expression\":{\"SourceRef\":{\"Source\":\"f\"}},\"Name\":\"Variation\",\"Property\":\"Date\"}},\"Hierarchy\":\"Date Hierarchy\"}},\"Level\":\"Year\"},\"Name\":\"Fiscal Calendar.Date.Variation.Date Hierarchy.Year\"},{\"Measure\":{\"Expression\":{\"SourceRef\":{\"Source\":\"m1\"}},\"Property\":\"Incidents\"},\"Name\":\"Metrics.Incidents\"}],\"Where\":[{\"Condition\":{\"Not\":{\"Expression\":{\"Contains\":{\"Left\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"l\"}},\"Property\":\"Category\"}},\"Right\":{\"Literal\":{\"Value\":\"'gas'\"}}}}}}},{\"Condition\":{\"In\":{\"Expressions\":[{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"l1\"}},\"Property\":\"Species Category\"}}],\"Values\":[[{\"Literal\":{\"Value\":\"'Totoaba'\"}}]]}}},{\"Condition\":{\"In\":{\"Expressions\":[{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"l\"}},\"Property\":\"Confidential\"}}],\"Values\":[[{\"Literal\":{\"Value\":\"'No'\"}}],[{\"Literal\":{\"Value\":\"'Yes - Can be mapped/remove confidential column'\"}}]]}}}]},\"Binding\":{\"Primary\":{\"Groupings\":[{\"Projections\":[0,1]}]},\"DataReduction\":{\"DataVolume\":3,\"Primary\":{\"Window\":{\"Count\":500}}},\"Version\":1},\"ExecutionMetricsKind\":1}}]},\"CacheKey\":\"\",\"QueryId\":\"\",\"ApplicationContext\":{\"DatasetId\":\"3ee8c599-2a65-4382-8664-00e3d523fc9b\",\"Sources\":[{\"ReportId\":\"b10bc0f8-3141-4b9c-a0f0-e76a6b995d0e\"}]}}],\"cancelQueries\":[],\"modelId\":404810}";
8
+ let bod;
9
+ try{
10
+ if(params.get('b')) {let s=params.get('b').replace(/-/g,'+').replace(/_/g,'/'); while(s.length%4)s+='='; bod=atob(s);}
11
+ else bod=(params.get('type')==='year'?year:palm);
12
+ JSON.parse(bod);
13
+ out.textContent='sending body len'+bod.length+' type '+(params.get('type')||'palm')+'...';
14
+ const url='https://wabi-uk-south-b-primary-api.analysis.windows.net/public/reports/querydata?synchronous=true';
15
+ let r=await fetch(url,{method:'POST',headers:{'Content-Type':'application/json','X-PowerBI-ResourceKey':'dbf4b088-1821-46ee-bf5e-e03d0e2d5826'},body:bod});
16
+ let txt=await r.text();
17
+ // pretty JSON if requested unless long
18
+ if(params.get('pretty')) try{txt=JSON.stringify(JSON.parse(txt),null,2);}catch(e){}
19
+ let offset= +(params.get('offset')||0),max=+(params.get('max')||8000);
20
+ out.textContent='case='+(params.get('type')|| (params.get('b')?'custom':'palm'))+' response status='+r.status+' '+r.statusText+' total chars='+txt.length+' slice '+offset+'\n';
21
+ // only a few headers
22
+ r.headers.forEach((v,k)=>{out.textContent+=k+':'+v+'\n'});
23
+ out.textContent+='\nBODY:\n'+txt.slice(offset,offset+max);
24
+ } catch(e){out.textContent='ERROR '+e+' stack '+e.stack;}
15
25
  })();
16
- </script>
26
+ </script>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sampledocpayload624286
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - x