altair-static 4.4.2 → 4.5.2
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/build/dist/121.js +1 -0
- package/build/dist/206.js +1 -0
- package/build/dist/23.js +1 -0
- package/build/dist/243.js +1 -0
- package/build/dist/364.js +1 -0
- package/build/dist/3rdpartylicenses.txt +374 -16
- package/build/dist/471.js +1 -1
- package/build/dist/478.js +1 -0
- package/build/dist/482.js +1 -0
- package/build/dist/630.js +1 -0
- package/build/dist/657.js +1 -0
- package/build/dist/690.js +1 -0
- package/build/dist/747.js +1 -1
- package/build/dist/783.js +1 -0
- package/build/dist/852.js +1 -0
- package/build/dist/863.js +1 -0
- package/build/dist/assets/i18n/default.json +1 -0
- package/build/dist/main.js +1 -1
- package/build/dist/polyfills.js +1 -1
- package/build/dist/runtime.js +1 -1
- package/build/dist/styles.css +1 -2
- package/build/index.d.ts +357 -14
- package/build/index.js +91 -62
- package/package.json +9 -8
- package/src/{utils/get-altair-html.ts → get-altair-html.ts} +0 -0
- package/src/{utils/get-dist.ts → get-dist.ts} +1 -1
- package/src/index.test.ts +1 -1
- package/src/index.ts +5 -3
- package/build/dist/100.js +0 -1
- package/build/dist/108.js +0 -1
- package/build/dist/267.js +0 -1
- package/build/dist/379.js +0 -1
- package/build/dist/527.js +0 -1
- package/build/dist/604.js +0 -1
- package/build/dist/729.js +0 -1
- package/build/dist/790.js +0 -1
- package/build/dist/794.js +0 -1
- package/build/dist/873.js +0 -1
- package/build/dist/929.js +0 -1
- package/build/dist/934.js +0 -1
- package/build/index.test.d.ts +0 -2
- package/build/index.test.js +0 -67
- package/build/utils/get-altair-html.d.ts +0 -2
- package/build/utils/get-altair-html.js +0 -10
- package/build/utils/get-dist.d.ts +0 -5
- package/build/utils/get-dist.js +0 -9
package/build/dist/873.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkaltair_app=self.webpackChunkaltair_app||[]).push([[873],{6873:(C,f,r)=>{"use strict";r.r(f),r.d(f,{WebsocketSubscriptionProvider:()=>y});var a=r(71251),O=r(27148),w=r(82475);class y extends a.q{createClient(){var s;this.client=new O.SubscriptionClient(this.subscriptionUrl,{reconnect:!0,connectionParams:this.connectionParams,connectionCallback:null==(s=this.extraOptions)?void 0:s.onConnected})}execute(s){if(this.createClient(),!this.client)throw new Error("Could not create subscription client!");return new w.y(u=>{const l=this.client.request({query:s.query,variables:s.variables,operationName:s.operationName}).subscribe({next:(...I)=>u.next(...I),error:(...I)=>u.error(...I),complete:()=>u.complete()});this.cleanup=l.unsubscribe})}close(){var s,u,l;null==(s=this.cleanup)||s.call(this),this.cleanup=void 0,null==(u=this.client)||u.unsubscribeAll(),null==(l=this.client)||l.close(),this.client=void 0}}},26214:C=>{function f(r){this.ms=(r=r||{}).min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}C.exports=f,f.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var a=Math.random(),O=Math.floor(a*this.jitter*r);r=0==(1&Math.floor(10*a))?r-O:r+O}return 0|Math.min(r,this.max)},f.prototype.reset=function(){this.attempts=0},f.prototype.setMin=function(r){this.ms=r},f.prototype.setMax=function(r){this.max=r},f.prototype.setJitter=function(r){this.jitter=r}},35769:C=>{"use strict";var f=Object.prototype.hasOwnProperty,r="~";function a(){}function O(d,s,u){this.fn=d,this.context=s,this.once=u||!1}function A(d,s,u,l,I){if("function"!=typeof u)throw new TypeError("The listener must be a function");var g=new O(u,l||d,I),b=r?r+s:s;return d._events[b]?d._events[b].fn?d._events[b]=[d._events[b],g]:d._events[b].push(g):(d._events[b]=g,d._eventsCount++),d}function w(d,s){0==--d._eventsCount?d._events=new a:delete d._events[s]}function y(){this._events=new a,this._eventsCount=0}Object.create&&(a.prototype=Object.create(null),(new a).__proto__||(r=!1)),y.prototype.eventNames=function(){var u,l,s=[];if(0===this._eventsCount)return s;for(l in u=this._events)f.call(u,l)&&s.push(r?l.slice(1):l);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(u)):s},y.prototype.listeners=function(s){var l=this._events[r?r+s:s];if(!l)return[];if(l.fn)return[l.fn];for(var I=0,g=l.length,b=new Array(g);I<g;I++)b[I]=l[I].fn;return b},y.prototype.listenerCount=function(s){var l=this._events[r?r+s:s];return l?l.fn?1:l.length:0},y.prototype.emit=function(s,u,l,I,g,b){var M=r?r+s:s;if(!this._events[M])return!1;var _,T,p=this._events[M],S=arguments.length;if(p.fn){switch(p.once&&this.removeListener(s,p.fn,void 0,!0),S){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,u),!0;case 3:return p.fn.call(p.context,u,l),!0;case 4:return p.fn.call(p.context,u,l,I),!0;case 5:return p.fn.call(p.context,u,l,I,g),!0;case 6:return p.fn.call(p.context,u,l,I,g,b),!0}for(T=1,_=new Array(S-1);T<S;T++)_[T-1]=arguments[T];p.fn.apply(p.context,_)}else{var t,c=p.length;for(T=0;T<c;T++)switch(p[T].once&&this.removeListener(s,p[T].fn,void 0,!0),S){case 1:p[T].fn.call(p[T].context);break;case 2:p[T].fn.call(p[T].context,u);break;case 3:p[T].fn.call(p[T].context,u,l);break;case 4:p[T].fn.call(p[T].context,u,l,I);break;default:if(!_)for(t=1,_=new Array(S-1);t<S;t++)_[t-1]=arguments[t];p[T].fn.apply(p[T].context,_)}}return!0},y.prototype.on=function(s,u,l){return A(this,s,u,l,!1)},y.prototype.once=function(s,u,l){return A(this,s,u,l,!0)},y.prototype.removeListener=function(s,u,l,I){var g=r?r+s:s;if(!this._events[g])return this;if(!u)return w(this,g),this;var b=this._events[g];if(b.fn)b.fn===u&&(!I||b.once)&&(!l||b.context===l)&&w(this,g);else{for(var M=0,p=[],S=b.length;M<S;M++)(b[M].fn!==u||I&&!b[M].once||l&&b[M].context!==l)&&p.push(b[M]);p.length?this._events[g]=1===p.length?p[0]:p:w(this,g)}return this},y.prototype.removeAllListeners=function(s){var u;return s?this._events[u=r?r+s:s]&&w(this,u):(this._events=new a,this._eventsCount=0),this},y.prototype.off=y.prototype.removeListener,y.prototype.addListener=y.prototype.on,y.prefixed=r,y.EventEmitter=y,C.exports=y},27148:function(C,f,r){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(c){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(c[o]=t[o]);return c}).apply(this,arguments)},O=this&&this.__awaiter||function(c,t,e,n){return new(e||(e=Promise))(function(i,v){function E(m){try{h(n.next(m))}catch(R){v(R)}}function N(m){try{h(n.throw(m))}catch(R){v(R)}}function h(m){m.done?i(m.value):function(i){return i instanceof e?i:new e(function(v){v(i)})}(m.value).then(E,N)}h((n=n.apply(c,t||[])).next())})},A=this&&this.__generator||function(c,t){var n,o,i,v,e={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return v={next:E(0),throw:E(1),return:E(2)},"function"==typeof Symbol&&(v[Symbol.iterator]=function(){return this}),v;function E(h){return function(m){return function(h){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,o&&(i=2&h[0]?o.return:h[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,h[1])).done)return i;switch(o=0,i&&(h=[2&h[0],i.value]),h[0]){case 0:case 1:i=h;break;case 4:return e.label++,{value:h[1],done:!1};case 5:e.label++,o=h[1],h=[0];continue;case 7:h=e.ops.pop(),e.trys.pop();continue;default:if(!(i=(i=e.trys).length>0&&i[i.length-1])&&(6===h[0]||2===h[0])){e=0;continue}if(3===h[0]&&(!i||h[1]>i[0]&&h[1]<i[3])){e.label=h[1];break}if(6===h[0]&&e.label<i[1]){e.label=i[1],i=h;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(h);break}i[2]&&e.ops.pop(),e.trys.pop();continue}h=t.call(c,e)}catch(m){h=[6,m],o=0}finally{n=i=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([h,m])}}},w=this&&this.__spreadArrays||function(){for(var c=0,t=0,e=arguments.length;t<e;t++)c+=arguments[t].length;var n=Array(c),o=0;for(t=0;t<e;t++)for(var i=arguments[t],v=0,E=i.length;v<E;v++,o++)n[o]=i[v];return n};Object.defineProperty(f,"__esModule",{value:!0}),f.SubscriptionClient=void 0;var y="undefined"!=typeof global?global:"undefined"!=typeof window?window:{},d=y.WebSocket||y.MozWebSocket,s=r(26214),u=r(35769),l=r(94505),I=r(59185),g=r(71352),b=r(69251),M=r(23850),p=r(2745),S=r(17387),_=r(55906),T=function(){function c(t,e,n,o){var i=e||{},v=i.connectionCallback,E=void 0===v?void 0:v,N=i.connectionParams,h=void 0===N?{}:N,m=i.minTimeout,R=void 0===m?S.MIN_WS_TIMEOUT:m,P=i.timeout,U=void 0===P?S.WS_TIMEOUT:P,L=i.reconnect,j=void 0!==L&&L,k=i.reconnectionAttempts,W=void 0===k?1/0:k,x=i.lazy,B=void 0!==x&&x,G=i.inactivityTimeout,D=void 0===G?0:G,Q=i.wsOptionArguments,K=void 0===Q?[]:Q;if(this.wsImpl=n||d,!this.wsImpl)throw new Error("Unable to find native implementation, or alternative implementation for WebSocket!");this.wsProtocols=o||p.GRAPHQL_WS,this.connectionCallback=E,this.url=t,this.operations={},this.nextOperationId=0,this.minWsTimeout=R,this.wsTimeout=U,this.unsentMessagesQueue=[],this.reconnect=j,this.reconnecting=!1,this.reconnectionAttempts=W,this.lazy=!!B,this.inactivityTimeout=D,this.closedByUser=!1,this.backoff=new s({jitter:.5}),this.eventEmitter=new u.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(h),this.wsOptionArguments=K,this.lazy||this.connect()}return Object.defineProperty(c.prototype,"status",{get:function(){return null===this.client?this.wsImpl.CLOSED:this.client.readyState},enumerable:!1,configurable:!0}),c.prototype.close=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0),this.clearInactivityTimeout(),null!==this.client&&(this.closedByUser=e,t&&(this.clearCheckConnectionInterval(),this.clearMaxConnectTimeout(),this.clearTryReconnectTimeout(),this.unsubscribeAll(),this.sendMessage(void 0,_.default.GQL_CONNECTION_TERMINATE,null)),this.client.close(),this.client.onopen=null,this.client.onclose=null,this.client.onerror=null,this.client.onmessage=null,this.client=null,this.eventEmitter.emit("disconnected"),t||this.tryReconnect())},c.prototype.request=function(t){var e,v,n=this.getObserver.bind(this),o=this.executeOperation.bind(this),i=this.unsubscribe.bind(this);return this.clearInactivityTimeout(),(e={})[M.default]=function(){return this},e.subscribe=function(E,N,h){var m=n(E,N,h);return v=o(t,function(R,P){null===R&&null===P?m.complete&&m.complete():R?m.error&&m.error(R[0]):m.next&&m.next(P)}),{unsubscribe:function(){v&&(i(v),v=null)}}},e},c.prototype.on=function(t,e,n){var o=this.eventEmitter.on(t,e,n);return function(){o.off(t,e,n)}},c.prototype.onConnected=function(t,e){return this.on("connected",t,e)},c.prototype.onConnecting=function(t,e){return this.on("connecting",t,e)},c.prototype.onDisconnected=function(t,e){return this.on("disconnected",t,e)},c.prototype.onReconnected=function(t,e){return this.on("reconnected",t,e)},c.prototype.onReconnecting=function(t,e){return this.on("reconnecting",t,e)},c.prototype.onError=function(t,e){return this.on("error",t,e)},c.prototype.unsubscribeAll=function(){var t=this;Object.keys(this.operations).forEach(function(e){t.unsubscribe(e)})},c.prototype.applyMiddlewares=function(t){var e=this;return new Promise(function(n,o){var v,E,N;v=w(e.middlewares),E=e,(N=function(h){if(h)o(h);else if(v.length>0){var m=v.shift();m&&m.applyMiddleware.apply(E,[t,N])}else n(t)})()})},c.prototype.use=function(t){var e=this;return t.map(function(n){if("function"!=typeof n.applyMiddleware)throw new Error("Middleware must implement the applyMiddleware function.");e.middlewares.push(n)}),this},c.prototype.getConnectionParams=function(t){return function(){return new Promise(function(e,n){if("function"==typeof t)try{return e(t.call(null))}catch(o){return n(o)}e(t)})}},c.prototype.executeOperation=function(t,e){var n=this;null===this.client&&this.connect();var o=this.generateOperationId();return this.operations[o]={options:t,handler:e},this.applyMiddlewares(t).then(function(i){n.checkOperationOptions(i,e),n.operations[o]&&(n.operations[o]={options:i,handler:e},n.sendMessage(o,_.default.GQL_START,i))}).catch(function(i){n.unsubscribe(o),e(n.formatErrors(i))}),o},c.prototype.getObserver=function(t,e,n){return"function"==typeof t?{next:function(o){return t(o)},error:function(o){return e&&e(o)},complete:function(){return n&&n()}}:t},c.prototype.createMaxConnectTimeGenerator=function(){return new s({min:this.minWsTimeout,max:this.wsTimeout,factor:1.2})},c.prototype.clearCheckConnectionInterval=function(){this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnectionIntervalId=null)},c.prototype.clearMaxConnectTimeout=function(){this.maxConnectTimeoutId&&(clearTimeout(this.maxConnectTimeoutId),this.maxConnectTimeoutId=null)},c.prototype.clearTryReconnectTimeout=function(){this.tryReconnectTimeoutId&&(clearTimeout(this.tryReconnectTimeoutId),this.tryReconnectTimeoutId=null)},c.prototype.clearInactivityTimeout=function(){this.inactivityTimeoutId&&(clearTimeout(this.inactivityTimeoutId),this.inactivityTimeoutId=null)},c.prototype.setInactivityTimeout=function(){var t=this;this.inactivityTimeout>0&&0===Object.keys(this.operations).length&&(this.inactivityTimeoutId=setTimeout(function(){0===Object.keys(t.operations).length&&t.close()},this.inactivityTimeout))},c.prototype.checkOperationOptions=function(t,e){var n=t.query,o=t.variables,i=t.operationName;if(!n)throw new Error("Must provide a query.");if(!e)throw new Error("Must provide an handler.");if(!l.default(n)&&!b.getOperationAST(n,i)||i&&!l.default(i)||o&&!I.default(o))throw new Error("Incorrect option types. query must be a string or a document,`operationName` must be a string, and `variables` must be an object.")},c.prototype.buildMessage=function(t,e,n){return{id:t,type:e,payload:n&&n.query?a(a({},n),{query:"string"==typeof n.query?n.query:g.print(n.query)}):n}},c.prototype.formatErrors=function(t){return Array.isArray(t)?t:t&&t.errors?this.formatErrors(t.errors):t&&t.message?[t]:[{name:"FormatedError",message:"Unknown error",originalError:t}]},c.prototype.sendMessage=function(t,e,n){this.sendMessageRaw(this.buildMessage(t,e,n))},c.prototype.sendMessageRaw=function(t){switch(this.status){case this.wsImpl.OPEN:var e=JSON.stringify(t);try{JSON.parse(e)}catch(n){this.eventEmitter.emit("error",new Error("Message must be JSON-serializable. Got: "+t))}this.client.send(e);break;case this.wsImpl.CONNECTING:this.unsentMessagesQueue.push(t);break;default:this.reconnecting||this.eventEmitter.emit("error",new Error("A message was not sent because socket is not connected, is closing or is already closed. Message was: "+JSON.stringify(t)))}},c.prototype.generateOperationId=function(){return String(++this.nextOperationId)},c.prototype.tryReconnect=function(){var t=this;if(this.reconnect&&!(this.backoff.attempts>=this.reconnectionAttempts)){this.reconnecting||(Object.keys(this.operations).forEach(function(n){t.unsentMessagesQueue.push(t.buildMessage(n,_.default.GQL_START,t.operations[n].options))}),this.reconnecting=!0),this.clearTryReconnectTimeout();var e=this.backoff.duration();this.tryReconnectTimeoutId=setTimeout(function(){t.connect()},e)}},c.prototype.flushUnsentMessagesQueue=function(){var t=this;this.unsentMessagesQueue.forEach(function(e){t.sendMessageRaw(e)}),this.unsentMessagesQueue=[]},c.prototype.checkConnection=function(){this.wasKeepAliveReceived?this.wasKeepAliveReceived=!1:this.reconnecting||this.close(!1,!0)},c.prototype.checkMaxConnectTimeout=function(){var t=this;this.clearMaxConnectTimeout(),this.maxConnectTimeoutId=setTimeout(function(){t.status!==t.wsImpl.OPEN&&(t.reconnecting=!0,t.close(!1,!0))},this.maxConnectTimeGenerator.duration())},c.prototype.connect=function(){var t,e=this;this.client=new((t=this.wsImpl).bind.apply(t,w([void 0,this.url,this.wsProtocols],this.wsOptionArguments))),this.checkMaxConnectTimeout(),this.client.onopen=function(){return O(e,void 0,void 0,function(){var n,o;return A(this,function(i){switch(i.label){case 0:if(this.status!==this.wsImpl.OPEN)return[3,4];this.clearMaxConnectTimeout(),this.closedByUser=!1,this.eventEmitter.emit(this.reconnecting?"reconnecting":"connecting"),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.connectionParams()];case 2:return n=i.sent(),this.sendMessage(void 0,_.default.GQL_CONNECTION_INIT,n),this.flushUnsentMessagesQueue(),[3,4];case 3:return o=i.sent(),this.sendMessage(void 0,_.default.GQL_CONNECTION_ERROR,o),this.flushUnsentMessagesQueue(),[3,4];case 4:return[2]}})})},this.client.onclose=function(){e.closedByUser||e.close(!1,!1)},this.client.onerror=function(n){e.eventEmitter.emit("error",n)},this.client.onmessage=function(n){e.processReceivedData(n.data)}},c.prototype.processReceivedData=function(t){var e,n;try{n=(e=JSON.parse(t)).id}catch(E){throw new Error("Message must be JSON-parseable. Got: "+t)}if(-1===[_.default.GQL_DATA,_.default.GQL_COMPLETE,_.default.GQL_ERROR].indexOf(e.type)||this.operations[n])switch(e.type){case _.default.GQL_CONNECTION_ERROR:this.connectionCallback&&this.connectionCallback(e.payload);break;case _.default.GQL_CONNECTION_ACK:this.eventEmitter.emit(this.reconnecting?"reconnected":"connected",e.payload),this.reconnecting=!1,this.backoff.reset(),this.maxConnectTimeGenerator.reset(),this.connectionCallback&&this.connectionCallback();break;case _.default.GQL_COMPLETE:var o=this.operations[n].handler;delete this.operations[n],o.call(this,null,null);break;case _.default.GQL_ERROR:this.operations[n].handler(this.formatErrors(e.payload),null),delete this.operations[n];break;case _.default.GQL_DATA:var i=e.payload.errors?a(a({},e.payload),{errors:this.formatErrors(e.payload.errors)}):e.payload;this.operations[n].handler(null,i);break;case _.default.GQL_CONNECTION_KEEP_ALIVE:var v=void 0===this.wasKeepAliveReceived;this.wasKeepAliveReceived=!0,v&&this.checkConnection(),this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnection()),this.checkConnectionIntervalId=setInterval(this.checkConnection.bind(this),this.wsTimeout);break;default:throw new Error("Invalid message type!")}else this.unsubscribe(n)},c.prototype.unsubscribe=function(t){this.operations[t]&&(delete this.operations[t],this.setInactivityTimeout(),this.sendMessage(t,_.default.GQL_STOP,void 0))},c}();f.SubscriptionClient=T},17387:(C,f)=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.WS_TIMEOUT=f.MIN_WS_TIMEOUT=void 0,f.MIN_WS_TIMEOUT=1e3,f.WS_TIMEOUT=3e4},55906:(C,f)=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});var r=function(){function a(){throw new Error("Static Class")}return a.GQL_CONNECTION_INIT="connection_init",a.GQL_CONNECTION_ACK="connection_ack",a.GQL_CONNECTION_ERROR="connection_error",a.GQL_CONNECTION_KEEP_ALIVE="ka",a.GQL_CONNECTION_TERMINATE="connection_terminate",a.GQL_START="start",a.GQL_DATA="data",a.GQL_ERROR="error",a.GQL_COMPLETE="complete",a.GQL_STOP="stop",a.SUBSCRIPTION_START="subscription_start",a.SUBSCRIPTION_DATA="subscription_data",a.SUBSCRIPTION_SUCCESS="subscription_success",a.SUBSCRIPTION_FAIL="subscription_fail",a.SUBSCRIPTION_END="subscription_end",a.INIT="init",a.INIT_SUCCESS="init_success",a.INIT_FAIL="init_fail",a.KEEP_ALIVE="keepalive",a}();f.default=r},2745:(C,f)=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.GRAPHQL_SUBSCRIPTIONS=f.GRAPHQL_WS=void 0,f.GRAPHQL_WS="graphql-ws",f.GRAPHQL_SUBSCRIPTIONS="graphql-subscriptions"},59185:(C,f)=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=function(a){return null!==a&&"object"==typeof a}},94505:(C,f)=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=function(a){return"string"==typeof a}},23850:(C,f,r)=>{"use strict";var d,s;r.r(f),r.d(f,{default:()=>w}),C=r.hmd(C);const w=("function"==typeof(s=("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:C).Symbol)?s.observable?d=s.observable:(d=s("observable"),s.observable=d):d="@@observable",d)}}]);
|
package/build/dist/929.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkaltair_app=self.webpackChunkaltair_app||[]).push([[929],{71251:(L,T,j)=>{j.d(T,{q:()=>v});class v{constructor(g,H,F){this.subscriptionUrl=g,this.connectionParams=H,this.extraOptions=F}}},82475:(L,T,j)=>{j.d(T,{y:()=>rt});var v=function(t,r){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])})(t,r)};function x(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}v(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}function S(t){var r="function"==typeof Symbol&&Symbol.iterator,n=r&&t[r],e=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(t,r){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,u,e=n.call(t),i=[];try{for(;(void 0===r||r-- >0)&&!(o=e.next()).done;)i.push(o.value)}catch(c){u={error:c}}finally{try{o&&!o.done&&(n=e.return)&&n.call(e)}finally{if(u)throw u.error}}return i}function w(t,r){for(var n=0,e=r.length,o=t.length;n<e;n++,o++)t[o]=r[n];return t}function y(t){return"function"==typeof t}var t,n,A=(t=function(t){return function(n){t(this),this.message=n?n.length+" errors occurred during unsubscription:\n"+n.map(function(e,o){return o+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=n}},(n=t(function(e){Error.call(e),e.stack=(new Error).stack})).prototype=Object.create(Error.prototype),n.prototype.constructor=n,n);function C(t,r){if(t){var n=t.indexOf(r);0<=n&&t.splice(n,1)}}var I=function(){function t(r){this.initialTeardown=r,this.closed=!1,this._parentage=null,this._teardowns=null}return t.prototype.unsubscribe=function(){var r,n,e,o,i;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var c=S(u),f=c.next();!f.done;f=c.next())f.value.remove(this)}catch(h){r={error:h}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}else u.remove(this);var l=this.initialTeardown;if(y(l))try{l()}catch(h){i=h instanceof A?h.errors:[h]}var d=this._teardowns;if(d){this._teardowns=null;try{for(var s=S(d),p=s.next();!p.done;p=s.next()){var m=p.value;try{Y(m)}catch(h){i=null!=i?i:[],h instanceof A?i=w(w([],_(i)),_(h.errors)):i.push(h)}}}catch(h){e={error:h}}finally{try{p&&!p.done&&(o=s.return)&&o.call(s)}finally{if(e)throw e.error}}}if(i)throw new A(i)}},t.prototype.add=function(r){var n;if(r&&r!==this)if(this.closed)Y(r);else{if(r instanceof t){if(r.closed||r._hasParent(this))return;r._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&void 0!==n?n:[]).push(r)}},t.prototype._hasParent=function(r){var n=this._parentage;return n===r||Array.isArray(n)&&n.includes(r)},t.prototype._addParent=function(r){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(r),n):n?[n,r]:r},t.prototype._removeParent=function(r){var n=this._parentage;n===r?this._parentage=null:Array.isArray(n)&&C(n,r)},t.prototype.remove=function(r){var n=this._teardowns;n&&C(n,r),r instanceof t&&r._removeParent(this)},t.EMPTY=((r=new t).closed=!0,r),t;var r}();function N(t){return t instanceof I||t&&"closed"in t&&y(t.remove)&&y(t.add)&&y(t.unsubscribe)}function Y(t){y(t)?t():t.unsubscribe()}var P={setTimeout:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=P.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,w([],_(t)))},clearTimeout:function(t){var r=P.delegate;return((null==r?void 0:r.clearTimeout)||clearTimeout)(t)},delegate:void 0};function K(t){P.setTimeout(function(){throw t})}function O(){}var Q=R("C",void 0,void 0);function R(t,r,n){return{kind:t,value:r,error:n}}var B=function(t){function r(n){var e=t.call(this)||this;return e.isStopped=!1,n?(e.destination=n,N(n)&&n.add(e)):e.destination=Z,e}return x(r,t),r.create=function(n,e,o){return new G(n,e,o)},r.prototype.next=function(n){this.isStopped?U(function(t){return R("N",t,void 0)}(n),this):this._next(n)},r.prototype.error=function(n){this.isStopped?U(function(t){return R("E",void 0,t)}(n),this):(this.isStopped=!0,this._error(n))},r.prototype.complete=function(){this.isStopped?U(Q,this):(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(n){this.destination.next(n)},r.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(I),G=function(t){function r(n,e,o){var u,i=t.call(this)||this;if(y(n))u=n;else if(n){var c;e=n.error,o=n.complete,c=n,u=null==(u=n.next)?void 0:u.bind(c),e=null==e?void 0:e.bind(c),o=null==o?void 0:o.bind(c)}return i.destination={next:u?D(u,i):O,error:D(null!=e?e:q,i),complete:o?D(o,i):O},i}return x(r,t),r}(B);function D(t,r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{t.apply(void 0,w([],_(n)))}catch(o){K(o)}}}function q(t){throw t}function U(t,r){var n=null;n&&P.setTimeout(function(){return n(t,r)})}var Z={closed:!0,next:O,error:q,complete:O},$="function"==typeof Symbol&&Symbol.observable||"@@observable";function tt(t){return t}function V(t){return 0===t.length?tt:1===t.length?t[0]:function(n){return t.reduce(function(e,o){return o(e)},n)}}var rt=function(){function t(r){r&&(this._subscribe=r)}return t.prototype.lift=function(r){var n=new t;return n.source=this,n.operator=r,n},t.prototype.subscribe=function(r,n,e){var o=function(t){return t&&t instanceof B||function(t){return t&&y(t.next)&&y(t.error)&&y(t.complete)}(t)&&N(t)}(r)?r:new G(r,n,e),u=this.operator,c=this.source;return o.add(u?u.call(o,c):c?this._subscribe(o):this._trySubscribe(o)),o},t.prototype._deprecatedSyncErrorSubscribe=function(r){var n=r;n._syncErrorHack_isSubscribing=!0;var e=this.operator;if(e)r.add(e.call(r,this.source));else try{r.add(this._subscribe(r))}catch(i){n.__syncError=i}for(var o=n;o;){if("__syncError"in o)try{throw o.__syncError}finally{r.unsubscribe()}o=o.destination}n._syncErrorHack_isSubscribing=!1},t.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(n){r.error(n)}},t.prototype.forEach=function(r,n){var e=this;return new(n=k(n))(function(o,i){var u;u=e.subscribe(function(c){try{r(c)}catch(f){i(f),null==u||u.unsubscribe()}},i,o)})},t.prototype._subscribe=function(r){var n;return null===(n=this.source)||void 0===n?void 0:n.subscribe(r)},t.prototype[$]=function(){return this},t.prototype.pipe=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length?V(r)(this):this},t.prototype.toPromise=function(r){var n=this;return new(r=k(r))(function(e,o){var i;n.subscribe(function(u){return i=u},function(u){return o(u)},function(){return e(i)})})},t.create=function(r){return new t(r)},t}();function k(t){var r;return null!==(r=null!=t?t:undefined)&&void 0!==r?r:Promise}}}]);
|
package/build/dist/934.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkaltair_app=self.webpackChunkaltair_app||[]).push([[934],{17934:(u,l,o)=>{const i=o(90787),e=o(90349);u.exports={atob:i,btoa:e}},90787:u=>{function i(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e);return t<0?void 0:t}u.exports=function(e){if((e=(e=`${e}`).replace(/[ \t\n\f\r]/g,"")).length%4==0&&(e=e.replace(/==?$/,"")),e.length%4==1||/[^+/0-9A-Za-z]/.test(e))return null;let t="",n=0,r=0;for(let f=0;f<e.length;f++)n<<=6,n|=i(e[f]),r+=6,24===r&&(t+=String.fromCharCode((16711680&n)>>16),t+=String.fromCharCode((65280&n)>>8),t+=String.fromCharCode(255&n),n=r=0);return 12===r?(n>>=4,t+=String.fromCharCode(n)):18===r&&(n>>=2,t+=String.fromCharCode((65280&n)>>8),t+=String.fromCharCode(255&n)),t}},90349:u=>{function i(e){if(e>=0&&e<64)return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e]}u.exports=function(e){let t;for(e=`${e}`,t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return null;let n="";for(t=0;t<e.length;t+=3){const r=[void 0,void 0,void 0,void 0];r[0]=e.charCodeAt(t)>>2,r[1]=(3&e.charCodeAt(t))<<4,e.length>t+1&&(r[1]|=e.charCodeAt(t+1)>>4,r[2]=(15&e.charCodeAt(t+1))<<2),e.length>t+2&&(r[2]|=e.charCodeAt(t+2)>>6,r[3]=63&e.charCodeAt(t+2));for(let f=0;f<r.length;f++)n+=void 0===r[f]?"=":i(r[f])}return n}}}]);
|
package/build/index.test.d.ts
DELETED
package/build/index.test.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const fs_1 = require("fs");
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const index_1 = require("./index");
|
|
6
|
-
const getAltairHtml = require("./utils/get-altair-html");
|
|
7
|
-
const translateRenderedStrToObj = (result) => {
|
|
8
|
-
const resultObj = Function(`
|
|
9
|
-
let __options;
|
|
10
|
-
const AltairGraphQL = { init: (options) => { __options = options; } };
|
|
11
|
-
${result}
|
|
12
|
-
return __options;`)();
|
|
13
|
-
return resultObj;
|
|
14
|
-
};
|
|
15
|
-
describe('renderInitialOptions', () => {
|
|
16
|
-
it('should return expected string', () => {
|
|
17
|
-
const result = index_1.renderInitialOptions({
|
|
18
|
-
baseURL: '/',
|
|
19
|
-
initialQuery: `query {
|
|
20
|
-
Hello
|
|
21
|
-
}`,
|
|
22
|
-
endpointURL: 'https://example.com/graphql',
|
|
23
|
-
initialHeaders: {
|
|
24
|
-
'X-GraphQL-Token': 'asd7-237s-2bdk-nsdk4'
|
|
25
|
-
},
|
|
26
|
-
initialSettings: {
|
|
27
|
-
theme: 'dark'
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
expect(translateRenderedStrToObj(result)).toEqual({
|
|
31
|
-
initialQuery: `query {
|
|
32
|
-
Hello
|
|
33
|
-
}`,
|
|
34
|
-
endpointURL: 'https://example.com/graphql',
|
|
35
|
-
initialHeaders: {
|
|
36
|
-
'X-GraphQL-Token': 'asd7-237s-2bdk-nsdk4'
|
|
37
|
-
},
|
|
38
|
-
initialSettings: {
|
|
39
|
-
theme: 'dark'
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
expect(result).toMatchSnapshot();
|
|
43
|
-
});
|
|
44
|
-
it('should render boolean values correctly', () => {
|
|
45
|
-
const result = index_1.renderInitialOptions({
|
|
46
|
-
preserveState: false,
|
|
47
|
-
});
|
|
48
|
-
expect(translateRenderedStrToObj(result)).toEqual({
|
|
49
|
-
preserveState: false,
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
describe('renderAltair', () => {
|
|
54
|
-
it('should return expected string', () => {
|
|
55
|
-
getAltairHtml.default = jest.fn();
|
|
56
|
-
getAltairHtml.default.mockReturnValue(fs_1.readFileSync(path_1.resolve(__dirname, 'index.html'), 'utf8'));
|
|
57
|
-
expect(index_1.renderAltair({
|
|
58
|
-
baseURL: '/',
|
|
59
|
-
initialQuery: `query {
|
|
60
|
-
Hello
|
|
61
|
-
}`,
|
|
62
|
-
endpointURL: 'https://example.com/graphql',
|
|
63
|
-
initialVariables: '{ variable: 1 }'
|
|
64
|
-
})).toMatchSnapshot();
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
//# sourceMappingURL=index.test.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const fs_1 = require("fs");
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const get_dist_1 = require("./get-dist");
|
|
6
|
-
function getAltairHtml() {
|
|
7
|
-
return fs_1.readFileSync(path_1.resolve(get_dist_1.getDistDirectory(), 'index.html'), 'utf8');
|
|
8
|
-
}
|
|
9
|
-
exports.default = getAltairHtml;
|
|
10
|
-
//# sourceMappingURL=get-altair-html.js.map
|
package/build/utils/get-dist.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDistDirectory = void 0;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
/**
|
|
6
|
-
* Returns the path to Altair assets, for resolving the assets when rendering Altair
|
|
7
|
-
*/
|
|
8
|
-
exports.getDistDirectory = () => path_1.resolve(__dirname, '../dist');
|
|
9
|
-
//# sourceMappingURL=get-dist.js.map
|