@cubejs-backend/server-core 0.28.62 → 0.28.66
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.
- package/CHANGELOG.md +32 -0
- package/package.json +7 -7
- package/playground/asset-manifest.json +15 -10
- package/playground/index.html +1 -1
- package/playground/static/css/2.b984234c.chunk.css +2 -0
- package/playground/static/css/2.b984234c.chunk.css.map +1 -0
- package/playground/static/css/3.fe75100a.chunk.css +2 -0
- package/playground/static/css/3.fe75100a.chunk.css.map +1 -0
- package/playground/static/js/2.6ac8a5b0.chunk.js +2 -0
- package/playground/static/js/{2.bab8a269.chunk.js.LICENSE.txt → 2.6ac8a5b0.chunk.js.LICENSE.txt} +0 -0
- package/playground/static/js/3.403b864e.chunk.js +2 -0
- package/playground/static/js/3.403b864e.chunk.js.LICENSE.txt +25 -0
- package/playground/static/js/4.bb73bd6d.chunk.js +1 -0
- package/playground/static/js/main.17c7498d.chunk.js +1 -0
- package/playground/static/js/runtime-main.e445ab40.js +1 -0
- package/playground/static/css/2.0cbd68b6.chunk.css +0 -2
- package/playground/static/css/2.0cbd68b6.chunk.css.map +0 -1
- package/playground/static/js/2.bab8a269.chunk.js +0 -2
- package/playground/static/js/main.f333ced7.chunk.js +0 -1
- package/playground/static/js/runtime-main.52c0f2e3.js +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* escape-html
|
|
3
|
+
* Copyright(c) 2012-2013 TJ Holowaychuk
|
|
4
|
+
* Copyright(c) 2015 Andreas Lubbe
|
|
5
|
+
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|
6
|
+
* MIT Licensed
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @license
|
|
13
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
14
|
+
*
|
|
15
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
16
|
+
* found in the LICENSE file at https://angular.io/license
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
22
|
+
*
|
|
23
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
24
|
+
* found in the LICENSE file at https://angular.io/license
|
|
25
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(this["webpackJsonp@cubejs-client/playground"]=this["webpackJsonp@cubejs-client/playground"]||[]).push([[4],{1161:function(e,n,t){"use strict";t.r(n),t.d(n,"default",(function(){return I}));var r,a=t(14),i=t(1151),u=t(1152),o=t(1134),l=t.n(o),c=t(1135),s=t(0),d=(t(1150),t(108)),b=t(61),f=t(52),v=t(7),h=t(10),k=t(83),E=t(84),m=t(907),O=t(913),p=["gt","gte","lt","lte"],y={equals:"in",notEquals:"notIn",notSet:"set"};!function(e){e.AND="AND",e.OR="OR",e.PLAIN="PLAIN"}(r||(r={}));var j,g=function(){function e(n,t){Object(k.a)(this,e),this.cubeQuery=n,this.types=t,this.cubes={},this.prepareCubes()}return Object(E.a)(e,[{key:"convert",value:function(){return O.a(function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"CubeQuery";return{kind:m.a.DOCUMENT,definitions:[{kind:m.a.OPERATION_DEFINITION,name:{kind:m.a.NAME,value:t},operation:"query",selectionSet:{kind:m.a.SELECTION_SET,selections:[{kind:m.a.FIELD,name:{kind:m.a.NAME,value:"cube"},arguments:e,selectionSet:{kind:m.a.SELECTION_SET,selections:n}}]}}]}}(this.getCubeArgs(),this.getFieldsSelections()))}},{key:"resolveFilter",value:function(e,n){var t=this,a=Object.values(e.reduce((function(e,n){if(n.or||n.and)return e;var t=(n.member||n.dimension).split("."),a=Object(h.a)(t,2),i=a[0],u=a[1];return e[i]||(e[i]={kind:r.PLAIN,cubeName:i,fields:[],filters:[]}),e[i].fields.push(u),e[i].filters.push(n),e}),{})),i=e.map((function(e){return!(!e.and&&!e.or)&&{kind:e.and?r.AND:r.OR,filters:e.and||e.or}})).filter(Boolean);return a.concat(i).map((function(e){return e.kind!==r.PLAIN?n?t.objectValue([t.booleanFilter(e.kind,t.resolveFilter(e.filters,e))]):t.booleanFilter(e.kind,t.resolveFilter(e.filters,e)):e.fields.length===Object(b.i)(e.fields).length?n?t.objectValue(t.objectFieldFilter(e.filters),Object(b.h)(e.cubeName)):t.objectFieldFilter(e.filters,Object(b.h)(e.cubeName)):t.objectField(t.booleanFilter((null===n||void 0===n?void 0:n.kind)||"AND",e.filters.map((function(n){return(n.and||n.or)&&t.resolveFilter(e.filters,e.kind),t.objectValue(t.objectFieldFilter(n))}))),Object(b.h)(e.cubeName))}))}},{key:"objectValue",value:function(e,n){return n?{kind:m.a.OBJECT,fields:[{kind:m.a.OBJECT_FIELD,name:{kind:m.a.NAME,value:n},value:{kind:m.a.OBJECT,fields:Array.isArray(e)?e:[e]}}]}:{kind:m.a.OBJECT,fields:Array.isArray(e)?e:[e]}}},{key:"objectFieldFilter",value:function(e,n){var t=this,r=Array.isArray(e)?e:[e],a=function(e){var n="number"===t.types[e.member||e.dimension]?m.a.FLOAT:m.a.STRING;return["set","notSet"].includes(e.operator)?{kind:m.a.BOOLEAN,value:"set"===e.operator}:"string"===typeof e.values?{kind:n,value:e.values}:1===e.values.length?{kind:n,value:e.values[0].toString()}:{kind:m.a.LIST,values:e.values.map((function(e){return{kind:n,value:e}}))}},i=r.map((function(e){var n=e.member||e.dimension;if(!t.types[n])throw new Error('Unknown member type for "'.concat(n,'". Make sure "').concat(n,'" exists in the schema.'));if(p.includes(e.operator)&&(e.values||[]).length>1)throw new Error('Filter operator "'.concat(e.operator,'" must have a single value'));return{kind:m.a.OBJECT_FIELD,name:{kind:m.a.NAME,value:n.split(".")[1]},value:{kind:m.a.OBJECT,fields:void 0!==e.values||["set","notSet"].includes(e.operator)?[{kind:m.a.OBJECT_FIELD,name:{kind:m.a.NAME,value:"equals"===e.operator&&(e.values||[]).length<=1?e.operator:y[e.operator]||e.operator},value:a(e)}]:[]}}}));return n?[{kind:m.a.OBJECT_FIELD,name:{kind:m.a.NAME,value:n},value:{kind:m.a.OBJECT,fields:i}}]:i}},{key:"objectField",value:function(e,n){return{kind:m.a.OBJECT_FIELD,name:{kind:m.a.NAME,value:n},value:{kind:m.a.OBJECT,fields:Array.isArray(e)?e:[e]}}}},{key:"booleanFilter",value:function(e,n){return{kind:m.a.OBJECT_FIELD,name:{kind:m.a.NAME,value:e},value:{kind:m.a.LIST,values:n}}}},{key:"orderByArg",value:function(e){return{kind:m.a.ARGUMENT,name:{kind:m.a.NAME,value:"orderBy"},value:{kind:m.a.OBJECT,fields:e.map((function(e){var n=Object(h.a)(e,2),t=n[0],r=n[1];return{kind:m.a.OBJECT_FIELD,name:{kind:m.a.NAME,value:t},value:{kind:m.a.ENUM,value:r}}}))}}}},{key:"getFieldsSelections",value:function(){var e=this,n=[];return Object.entries(this.cubes).forEach((function(t){var r=Object(h.a)(t,2),a=r[0],i=r[1],u=i.fields,o=i.orderBy;n.push({kind:m.a.FIELD,name:{kind:m.a.NAME,value:a},arguments:o.length?[e.orderByArg(o)]:[],selectionSet:{kind:m.a.SELECTION_SET,selections:u.map((function(e){var n=null;return e.granularities&&(n={selectionSet:{kind:m.a.SELECTION_SET,selections:e.granularities.map((function(e){return{kind:m.a.FIELD,name:{kind:m.a.NAME,value:e}}}))}}),Object(v.a)({kind:m.a.FIELD,name:{kind:m.a.NAME,value:e.name}},n)}))}})})),n}},{key:"getCubeArgs",value:function(){var e=this,n=[["timezone",m.a.STRING],["limit",m.a.INT],["offset",m.a.INT]],t=[];n.forEach((function(n){var r=Object(h.a)(n,2),a=r[0],i=r[1];e.cubeQuery[a]&&t.push({kind:m.a.ARGUMENT,name:{kind:m.a.NAME,value:a},value:{kind:i,value:e.cubeQuery[a]}})}));var r=Object(f.a)(this.cubeQuery.filters||[]);return(this.cubeQuery.timeDimensions||[]).forEach((function(e){e.dateRange&&r.push({member:e.dimension,operator:"inDateRange",values:e.dateRange})})),r.length&&t.push({kind:m.a.ARGUMENT,name:{kind:m.a.NAME,value:"where"},value:{kind:m.a.OBJECT,fields:this.resolveFilter(r)}}),t}},{key:"prepareCubes",value:function(){var e,n=this,t=function(e){n.cubes[e]||(n.cubes[e]={fields:[],filters:[],orderBy:[]})};["measures","dimensions","segments"].forEach((function(e){n.cubeQuery[e]&&n.cubeQuery[e].forEach((function(e){var r=e.split("."),a=Object(h.a)(r,3),i=a[0],u=a[1],o=a[2],l=Object(b.h)(i),c=o;"time"===n.types["".concat(i,".").concat(u)]&&(c="value"),t(l);var s=n.cubes[l].fields.find((function(e){return e.name===u}));n.cubes[l].fields.push(Object(v.a)({name:u},c?{granularities:[].concat(Object(f.a)((null===s||void 0===s?void 0:s.granularities)||[]),[c])}:null))}))}));var r={};(null===(e=this.cubeQuery.timeDimensions)||void 0===e||e.forEach((function(e){var n=e.dimension.split("."),t=Object(h.a)(n,2),a=t[0],i=t[1],u="".concat(a,".").concat(i);e.granularity&&(r[u]=(r[u]||[]).concat([e.granularity]))})),Object.entries(r).forEach((function(e){var r=Object(h.a)(e,2),a=r[0],i=r[1],u=a.split("."),o=Object(h.a)(u,2),l=o[0],c=o[1],s=Object(b.h)(l);t(s);var d=n.cubes[s].fields.find((function(e){return e.name===c}));d?d.granularities=Object(b.i)([].concat(Object(f.a)(d.granularities||[]),Object(f.a)(i))):n.cubes[s].fields.push({name:c,granularities:i})})),this.cubeQuery.order)&&(Array.isArray(this.cubeQuery.order)?this.cubeQuery.order:Object.entries(this.cubeQuery.order)).forEach((function(e){var t=Object(h.a)(e,2),r=t[0],a=t[1],i=r.split("."),u=Object(h.a)(i,2),o=u[0],l=u[1],c=Object(b.h)(o);if(!n.cubes[c])throw new Error('Order without selecting the cube is not allowed. Did you forget to include the "'.concat(o,'" cube?'));if(!n.cubes[c].fields.find((function(e){return e.name===l})))throw new Error('Order without selecting the member is not allowed. Did you forget to include the "'.concat(l,'" member?'));n.cubes[c].orderBy.push([l,a])}))}}]),e}(),N=t(13),A=t(35),T=t(1),F=N.d.div(j||(j=Object(a.a)(["\n margin-top: -15px;\n height: 400px;\n border-radius: 8px;\n overflow: hidden;\n\n .graphiql-container {\n .topBar {\n background: none;\n padding: 24px 0 24px;\n }\n\n .docExplorerShow {\n border-left: none;\n background: none;\n }\n \n .CodeMirror-scroll, .CodeMirror-lines {\n background: white;\n }\n }\n"])));function I(e){var n=e.apiUrl,t=e.query,r=e.meta,a=Object(A.k)(),o=Object(s.useMemo)((function(){return Object(i.a)({url:n.replace("/v1","/graphql"),headers:a?{authorization:a}:{}})}),[n,a]),f=Object(s.useMemo)((function(){return Object(b.f)(r)}),[r]),v=Object(d.a)((function(){if(!f)return"";try{var e=new g(t,f).convert();try{return Object(c.format)(e,{parser:"graphql",plugins:[l.a]})}catch(n){return e}}catch(r){return"# ".concat(r,"\n")}}),[t,f]);return Object(T.jsx)(F,{children:Object(T.jsx)(u.a,{query:v,fetcher:o})})}}}]);
|