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.
- checksums.yaml +4 -4
- data/payload.html +27 -13
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0d4464e2c8544ff6dd33437eabb918242d638ef74eea8d388745aaea6ae41a0c
|
|
4
|
+
data.tar.gz: a953ef31806de03ceae98687286a8fb5bbdd946f769dbabdc2c2c1fa826be368
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
2
|
-
<style>body{font
|
|
3
|
-
<
|
|
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
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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>
|