sampledocpayload624286 0.0.8 → 0.0.10

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 +27 -13
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30e4ced3e624c4d08b4b73ef28147a6386f17e77a52d565138fcec5e16f345b8
4
- data.tar.gz: 84fde4831718baa9b040571b66de0fc6bb5211d1a0805bf79fd0514a96488445
3
+ metadata.gz: 0d4464e2c8544ff6dd33437eabb918242d638ef74eea8d388745aaea6ae41a0c
4
+ data.tar.gz: a953ef31806de03ceae98687286a8fb5bbdd946f769dbabdc2c2c1fa826be368
5
5
  SHA512:
6
- metadata.gz: d7fc0ef1b5655094d913412e2d15fc2715ce4690390a4d7778bd8a61de2bc9a95881987b763e602901b25b6e8dd6209117264f2c6fb0bd97fa9b413952e8886c
7
- data.tar.gz: 12a2e63a2c570fafcd212c79f29665849483845d020a15e0c81da501c67a4e424fe6fd2ea54ec536bd8e1191b189d14f5136b93b3ca41a542a3e43480ff4777a
6
+ metadata.gz: f4045db9b6b0af61dbb900c4ef65d1fbd1498a25602fd88bf1034589b617ad8b2b7872ea50da09b3adbdc9265ef5a6d7f3d84122a9b107f52c9fd3c127a562e1
7
+ data.tar.gz: a5fbdf731b51dbcec9ad8bc2b9b36b3c8b662d9a0e0409404a3c01845869cc470a4a46ededc98cb22e5b0a225289dc9386a2b7448234949916e7bc1a25673dca
data/payload.html CHANGED
@@ -1,16 +1,30 @@
1
- <!doctype html><meta charset="UTF-8"><title>PB Fetch test v8</title>
2
- <style>body{font-size:16px}pre{white-space:pre-wrap;word-break:break-all}</style>
3
- <h2>Remote fetch test v8</h2><pre id="o">starting...
4
- </pre>
1
+ <!doctype html><meta charset="UTF-8"><title>PB dynamic v10</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 v10</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+'
21
+ ';
22
+ // only a few headers
23
+ r.headers.forEach((v,k)=>{out.textContent+=k+':'+v+'
24
+ '});
25
+ out.textContent+='
26
+ BODY:
27
+ '+txt.slice(offset,offset+max);
28
+ } catch(e){out.textContent='ERROR '+e+' stack '+e.stack;}
15
29
  })();
16
- </script>
30
+ </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.8
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - x