altair-static 5.2.6 → 5.2.8
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/114.js +5 -0
- package/build/dist/{244.js → 176.js} +5 -1
- package/build/dist/38.js +5 -0
- package/build/dist/{679.js → 404.js} +5 -1
- package/build/dist/414.js +5 -0
- package/build/dist/425.js +5 -1
- package/build/dist/485.js +5 -0
- package/build/dist/494.js +5 -0
- package/build/dist/{751.js → 579.js} +5 -1
- package/build/dist/614.js +5 -1
- package/build/dist/629.js +5 -1
- package/build/dist/{201.js → 670.js} +5 -1
- package/build/dist/{104.js → 788.js} +5 -1
- package/build/dist/881.js +5 -0
- package/build/dist/913.js +5 -0
- package/build/dist/common.js +5 -1
- package/build/dist/main.js +6 -2
- package/build/dist/polyfills.js +5 -1
- package/build/dist/runtime.js +5 -1
- package/build/dist/styles.css +2 -0
- package/package.json +4 -4
- package/build/dist/232.js +0 -1
- package/build/dist/257.js +0 -1
- package/build/dist/521.js +0 -1
- package/build/dist/625.js +0 -1
- package/build/dist/777.js +0 -1
- package/build/dist/789.js +0 -1
- package/build/dist/829.js +0 -1
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "altair-static",
|
|
3
3
|
"description": "Static package for altair graphql client",
|
|
4
|
-
"version": "5.2.
|
|
4
|
+
"version": "5.2.8",
|
|
5
5
|
"author": "Samuel Imolorhe <altair@sirmuel.design> (https://sirmuel.design)",
|
|
6
6
|
"bugs": "https://github.com/altair-graphql/altair/issues",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@altairgraphql/app": "^5.2.
|
|
8
|
+
"@altairgraphql/app": "^5.2.8",
|
|
9
9
|
"@types/jest": "^24.0.23",
|
|
10
|
-
"altair-graphql-core": "^5.2.
|
|
10
|
+
"altair-graphql-core": "^5.2.8",
|
|
11
11
|
"dts-bundle-generator": "^6.11.0",
|
|
12
12
|
"esbuild": "^0.14.43",
|
|
13
13
|
"jest": "29.4.1",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"type": "opencollective",
|
|
22
22
|
"url": "https://opencollective.com/altair"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "1765483c881b965016a6dd50b9f5a333b684be83",
|
|
25
25
|
"homepage": "https://github.com/altair-graphql/altair#readme",
|
|
26
26
|
"keywords": [
|
|
27
27
|
"altair",
|
package/build/dist/232.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkaltair=self.webpackChunkaltair||[]).push([[232],{10232:(ie,J,R)=>{R.r(J),R.d(J,{GraphQLSSESubscriptionProvider:()=>re});var L=R(48309),$=R(43588),B=R(62503);const V="x-graphql-event-stream-token";function H(e){if("next"!==e&&"complete"!==e)throw new Error(`Invalid stream event "${e}"`);return e}function W(e,t){if(t)try{t=JSON.parse(t)}catch{throw new Error("Invalid stream data")}if("next"===e&&!t)throw new Error('Stream data must be an object for "next" events');return t||null}var O=(()=>{return(e=O||(O={}))[e.NewLine=10]="NewLine",e[e.CchunkiageReturn=13]="CchunkiageReturn",e[e.Space=32]="Space",e[e.Colon=58]="Colon",O;var e})(),K=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,t=e[Symbol.asyncIterator];return t?t.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),n={},f("next"),f("throw"),f("return"),n[Symbol.asyncIterator]=function(){return this},n);function f(y){n[y]=e[y]&&function(w){return new Promise(function(m,b){!function s(y,w,m,b){Promise.resolve(b).then(function(v){y({value:v,done:m})},w)}(m,b,(w=e[y](w)).done,w.value)})}}},Z=function(e){return this instanceof Z?(this.v=e,this):new Z(e)},Q=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,f=n.apply(e,t||[]),y=[];return s={},w("next"),w("throw"),w("return"),s[Symbol.asyncIterator]=function(){return this},s;function w(r){f[r]&&(s[r]=function(o){return new Promise(function(u,x){y.push([r,o,u,x])>1||m(r,o)})})}function m(r,o){try{!function b(r){r.value instanceof Z?Promise.resolve(r.value.v).then(v,h):l(y[0][2],r)}(f[r](o))}catch(u){l(y[0][3],u)}}function v(r){m("next",r)}function h(r){m("throw",r)}function l(r,o){r(o),y.shift(),y.length&&m(y[0][0],y[0][1])}};class I extends Error{constructor(t){let n,f;!function te(e){return function q(e){return"object"==typeof e&&null!==e}(e)&&"boolean"==typeof e.ok&&"number"==typeof e.status&&"string"==typeof e.statusText}(t)?n=t instanceof Error?t.message:String(t):(f=t,n="Server responded with "+t.status+": "+t.statusText),super(n),this.name=this.constructor.name,this.response=f}}function Y(e){return z.apply(this,arguments)}function z(){return z=(0,L.Z)(function*(e){const{signal:t,url:n,credentials:f,headers:s,body:y,fetchFn:w,onMessage:m}=e,b={},v={};let h;try{h=yield w(n,{signal:t,method:y?"POST":"GET",credentials:f,headers:Object.assign(Object.assign({},s),{accept:"text/event-stream"}),body:y})}catch(o){throw new I(o)}if(!h.ok)throw new I(h);if(!h.body)throw new Error("Missing response body");let r,l=null;return(0,L.Z)(function*(){var o,u,x;try{const E=function X(){let e,t,n,f=!1,s={event:"",data:""},y=[];const w=new TextDecoder;return function(b){if(void 0===e)e=b,t=0,n=-1;else{const l=new Uint8Array(e.length+b.length);l.set(e),l.set(b,e.length),e=l}const v=e.length;let h=0;for(;t<v;){f&&(e[t]===O.NewLine&&(h=++t),f=!1);let l=-1;for(;t<v&&-1===l;++t)switch(e[t]){case O.Colon:-1===n&&(n=t-h);break;case O.CchunkiageReturn:f=!0;case O.NewLine:l=t}if(-1===l)break;if(h===l){if(s.event||s.data){if(!s.event)throw new Error("Missing message event");const r=H(s.event),o=W(r,s.data);y.push({event:r,data:o}),s={event:"",data:""}}}else if(n>0){const r=e.subarray(h,l),o=w.decode(r.subarray(0,n)),x=w.decode(r.subarray(n+(r[n+1]===O.Space?2:1)));switch(o){case"event":s.event=x;break;case"data":s.data=s.data?s.data+"\n"+x:x}}h=t,n=-1}if(h===v){e=void 0;const l=[...y];return y=[],l}0!==h&&(e=e.subarray(h),t-=h)}}();try{for(var p,g=K(function ne(e){return"function"==typeof Object(e)[Symbol.asyncIterator]?e[Symbol.asyncIterator]():function(){return Q(this,arguments,function*(){const t=e.getReader();let n;do{n=yield Z(t.read()),void 0!==n.value&&(yield yield Z(n.value))}while(!n.done)})}()}(h.body));!(p=yield g.next()).done;){const S=p.value;if("string"==typeof S)throw new Error(`Unexpected string chunk "${S}"`);const a=E(S);if(a)for(const c of a){m?.(c);const i=c.data&&"id"in c.data?c.data.id:"";switch(i in v||(v[i]=[]),c.event){case"next":v[i].push(i?c.data.payload:c.data);break;case"complete":v[i].push("complete");break;default:throw new Error(`Unexpected message event "${c.event}"`)}null===(x=b[i])||void 0===x||x.proceed()}}}catch(S){o={error:S}}finally{try{p&&!p.done&&(u=g.return)&&(yield u.call(g))}finally{if(o)throw o.error}}}catch(E){l=/network|stream/i.test(E)?new I(E):E,r?.(l)}finally{Object.values(b).forEach(({proceed:E})=>E())}})(),{url:n,headers:s,waitForThrow:()=>new Promise((o,u)=>{if(l)return u(l);r=u}),getResults(o){var u;return Q(this,arguments,function*(){const{signal:g,operationId:p=""}=o??{};try{for(;;){for(;null!==(u=v[p])&&void 0!==u&&u.length;){const E=v[p].shift();if("complete"===E)return yield Z(void 0);yield yield Z(E)}if(l)throw l;if(g?.aborted)throw new Error("Getting results aborted by the client");yield Z(new Promise(E=>{const S=()=>{g?.removeEventListener("abort",S),delete b[p],E()};g?.addEventListener("abort",S),b[p]={proceed:S}}))}}finally{delete v[p]}})}}}),z.apply(this,arguments)}class re extends $.q{createClient(){this.client=function ee(e){const{singleConnection:t=!1,lazy:n=!0,lazyCloseTimeout:f=0,onNonLazyError:s=console.error,generateID:y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,c=>{const i=16*Math.random()|0;return("x"==c?i:3&i|8).toString(16)})},retryAttempts:w=5,retry:m=function(){var a=(0,L.Z)(function*(i){let D=1e3;for(let d=0;d<i;d++)D*=2;yield new Promise(d=>setTimeout(d,D+Math.floor(2700*Math.random()+300)))});return function c(i){return a.apply(this,arguments)}}(),credentials:b="same-origin",onMessage:v}=e,h=e.fetchFn||fetch,l=e.abortControllerImpl||AbortController,r=(()=>{let a=!1;const c=[];return{get disposed(){return a},onDispose:i=>a?(setTimeout(()=>i(),0),()=>{}):(c.push(i),()=>{c.splice(c.indexOf(i),1)}),dispose(){if(!a){a=!0;for(const i of[...c])i()}}}})();let o,u,x=0,g=null,p=0;function E(){return S.apply(this,arguments)}function S(){return(S=(0,L.Z)(function*(){try{if(r.disposed)throw new Error("Client has been disposed");return yield u??(u=(0,L.Z)(function*(){var a;if(g){if(yield m(p),o.signal.aborted)throw new Error("Connection aborted by the client");p++}o=new l;const c=r.onDispose(()=>o.abort());o.signal.addEventListener("abort",()=>{c(),u=void 0});const i="function"==typeof e.url?yield e.url():e.url;if(o.signal.aborted)throw new Error("Connection aborted by the client");const D="function"==typeof e.headers?yield e.headers():null!==(a=e.headers)&&void 0!==a?a:{};if(o.signal.aborted)throw new Error("Connection aborted by the client");let d;try{d=yield h(i,{signal:o.signal,method:"PUT",credentials:b,headers:D})}catch(C){throw new I(C)}if(201!==d.status)throw new I(d);const G=yield d.text();D[V]=G;const T=yield Y({signal:o.signal,headers:D,credentials:b,url:i,fetchFn:h,onMessage:v});return g=null,p=0,T.waitForThrow().catch(()=>u=void 0),T})())}catch(a){throw u=void 0,a}})).apply(this,arguments)}return t&&!n&&(0,L.Z)(function*(){for(x++;;)try{const{waitForThrow:a}=yield E();yield a()}catch(a){if(r.disposed)return;if(!(a instanceof I)||(u=void 0,!w||p>=w))return s?.(a);g=a}})(),{subscribe(a,c){if(!t){const d=new l,G=r.onDispose(()=>{G(),d.abort()});return(0,L.Z)(function*(){var T,C,U;let P=null,k=0;for(;;)try{if(P){if(yield m(k),d.signal.aborted)throw new Error("Connection aborted by the client");k++}const N="function"==typeof e.url?yield e.url():e.url;if(d.signal.aborted)throw new Error("Connection aborted by the client");const j="function"==typeof e.headers?yield e.headers():null!==(U=e.headers)&&void 0!==U?U:{};if(d.signal.aborted)throw new Error("Connection aborted by the client");const{getResults:A}=yield Y({signal:d.signal,headers:j,credentials:b,url:N,body:JSON.stringify(a),fetchFn:h,onMessage:v});P=null,k=0;try{for(var _,M=(T=void 0,K(A()));!(_=yield M.next()).done;)c.next(_.value)}catch(F){T={error:F}}finally{try{_&&!_.done&&(C=M.return)&&(yield C.call(M))}finally{if(T)throw T.error}}return d.abort()}catch(N){if(d.signal.aborted)return;if(!(N instanceof I)||!w||k>=w)throw N;P=N}})().then(()=>c.complete()).catch(T=>c.error(T)),()=>d.abort()}x++;const i=new l,D=r.onDispose(()=>{D(),i.abort()});return(0,L.Z)(function*(){var d,G;const T=y();a=Object.assign(Object.assign({},a),{extensions:Object.assign(Object.assign({},a.extensions),{operationId:T})});let C=null;for(;;){C=null;try{const{url:k,headers:M,getResults:_}=yield E();let N;try{N=yield h(k,{signal:i.signal,method:"POST",credentials:b,headers:M,body:JSON.stringify(a)})}catch(j){throw new I(j)}if(202!==N.status)throw new I(N);C=function(){var j=(0,L.Z)(function*(){let A;try{const F=new l,oe=r.onDispose(()=>{oe(),F.abort()});A=yield h(k+"?operationId="+T,{signal:F.signal,method:"DELETE",credentials:b,headers:M})}catch(F){throw new I(F)}if(200!==A.status)throw new I(A)});return function(){return j.apply(this,arguments)}}();try{for(var P,U=(d=void 0,K(_({signal:i.signal,operationId:T})));!(P=yield U.next()).done;)c.next(P.value)}catch(j){d={error:j}}finally{try{P&&!P.done&&(G=U.return)&&(yield G.call(U))}finally{if(d)throw d.error}}return C=null,i.abort()}catch(k){if(i.signal.aborted)return yield C?.();if(!(k instanceof I)||(n&&(u=void 0),!w||p>=w))throw k;g=k}finally{i.signal.aborted&&0==--x&&(isFinite(f)&&f>0?setTimeout(()=>{x||o.abort()},f):o.abort())}}})().then(()=>c.complete()).catch(d=>c.error(d)),()=>i.abort()},dispose(){r.dispose()}}}({url:this.subscriptionUrl,headers:this.extraOptions?.headers})}execute(t){if(this.createClient(),!this.client)throw new Error("Could not create subscription client!");return new B.y(n=>{this.cleanup=this.client.subscribe({query:t.query,variables:t.variables,operationName:t.operationName},{next:(...f)=>n.next(...f),error:(...f)=>n.error(...f),complete:()=>n.complete()})})}close(){var t=this;return(0,L.Z)(function*(){try{t.cleanup?.(),t.cleanup=void 0,yield t.client?.dispose(),t.client=void 0}catch(n){console.error(n)}})()}}}}]);
|
package/build/dist/257.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkaltair=self.webpackChunkaltair||[]).push([[257],{34257:(pe,j,I)=>{I.r(j),I.d(j,{GraphQLWsSubscriptionProvider:()=>ae});var g=I(48309),Y=I(43588),_=I(62503);const R=Object.prototype.hasOwnProperty;function x(e){return"object"==typeof e&&null!==e}function O(e,n){return R.call(e,n)}function W(e,n){return R.call(e,n)&&x(e[n])}function w(e,n){return R.call(e,n)&&"string"==typeof e[n]}function H(e,n){return e.length<124?e:n}const ne="graphql-transport-ws";var p=(()=>{return(e=p||(p={}))[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests",p;var e})(),c=(()=>{return(e=c||(c={})).ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete",c;var e})();function v(e){if(x(e)){if(!w(e,"type"))return!1;switch(e.type){case c.ConnectionInit:case c.ConnectionAck:case c.Ping:case c.Pong:return!O(e,"payload")||void 0===e.payload||x(e.payload);case c.Subscribe:return w(e,"id")&&W(e,"payload")&&(!O(e.payload,"operationName")||null==e.payload.operationName||"string"==typeof e.payload.operationName)&&w(e.payload,"query")&&(!O(e.payload,"variables")||null==e.payload.variables||W(e.payload,"variables"))&&(!O(e.payload,"extensions")||null==e.payload.extensions||W(e.payload,"extensions"));case c.Next:return w(e,"id")&&W(e,"payload");case c.Error:return w(e,"id")&&function ee(e){return Array.isArray(e)&&e.length>0&&e.every(n=>"message"in n)}(e.payload);case c.Complete:return w(e,"id");default:return!1}}return!1}function N(e,n){if(!v(e))throw new Error("Cannot stringify invalid message");return JSON.stringify(e,n)}function L(e){return x(e)&&"code"in e&&"reason"in e}class ae extends Y.q{createClient(){this.client=function re(e){const{url:n,connectionParams:y,lazy:A=!0,onNonLazyError:z=console.error,lazyCloseTimeout:B=0,keepAlive:M=0,disablePong:se,connectionAckWaitTimeout:F=0,retryAttempts:J=5,retryWait:ce=function(){var t=(0,g.Z)(function*(s){let o=1e3;for(let a=0;a<s;a++)o*=2;yield new Promise(a=>setTimeout(a,o+Math.floor(2700*Math.random()+300)))});return function l(s){return t.apply(this,arguments)}}(),shouldRetry:le=L,isFatalConnectionProblem:Z,on:r,webSocketImpl:C,generateID:ue=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,l=>{const s=16*Math.random()|0;return("x"==l?s:3&s|8).toString(16)})},jsonMessageReplacer:D,jsonMessageReviver:de}=e;let S;if(C){if(!function ie(e){return"function"==typeof e&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}(C))throw new Error("Invalid WebSocket implementation provided");S=C}else typeof WebSocket<"u"?S=WebSocket:typeof global<"u"?S=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(S=window.WebSocket||window.MozWebSocket);if(!S)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const P=S,f=(()=>{const t=(()=>{const s={};return{on:(o,a)=>(s[o]=a,()=>{delete s[o]}),emit(o){var a;"id"in o&&(null===(a=s[o.id])||void 0===a||a.call(s,o))}}})(),l={connecting:r?.connecting?[r.connecting]:[],opened:r?.opened?[r.opened]:[],connected:r?.connected?[r.connected]:[],ping:r?.ping?[r.ping]:[],pong:r?.pong?[r.pong]:[],message:r?.message?[t.emit,r.message]:[t.emit],closed:r?.closed?[r.closed]:[],error:r?.error?[r.error]:[]};return{onMessage:t.on,on(s,o){const a=l[s];return a.push(o),()=>{a.splice(a.indexOf(o),1)}},emit(s,...o){for(const a of[...l[s]])a(...o)}}})();function $(t){const l=[f.on("error",s=>{l.forEach(o=>o()),t(s)}),f.on("closed",s=>{l.forEach(o=>o()),t(s)})]}let m,h=0,U=!1,G=0,K=!1;function V(){return Q.apply(this,arguments)}function Q(){return Q=(0,g.Z)(function*(){const[t,l]=yield m??(m=new Promise((a,b)=>(0,g.Z)(function*(){if(U){if(yield ce(G),!h)return m=void 0,b({code:1e3,reason:"All Subscriptions Gone"});G++}f.emit("connecting");const i=new P("function"==typeof n?yield n():n,ne);let E,T;function q(){isFinite(M)&&M>0&&(clearTimeout(T),T=setTimeout(()=>{i.readyState===P.OPEN&&(i.send(N({type:c.Ping})),f.emit("ping",!1,void 0))},M))}$(u=>{m=void 0,clearTimeout(E),clearTimeout(T),b(u),L(u)&&4499===u.code&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=u=>f.emit("error",u),i.onclose=u=>f.emit("closed",u),i.onopen=(0,g.Z)(function*(){try{f.emit("opened",i);const u="function"==typeof y?yield y():y;if(i.readyState!==P.OPEN)return;i.send(N(u?{type:c.ConnectionInit,payload:u}:{type:c.ConnectionInit},D)),isFinite(F)&&F>0&&(E=setTimeout(()=>{i.close(p.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},F)),q()}catch(u){f.emit("error",u),i.close(p.InternalClientError,H(u instanceof Error?u.message:new Error(u).message,"Internal client error"))}});let k=!1;i.onmessage=({data:u})=>{try{const d=function te(e,n){if(v(e))return e;if("string"!=typeof e)throw new Error("Message not parsable");const y=JSON.parse(e,n);if(!v(y))throw new Error("Invalid message");return y}(u,de);if(f.emit("message",d),"ping"===d.type||"pong"===d.type)return f.emit(d.type,!0,d.payload),void("pong"===d.type?q():se||(i.send(N(d.payload?{type:c.Pong,payload:d.payload}:{type:c.Pong})),f.emit("pong",!1,d.payload)));if(k)return;if(d.type!==c.ConnectionAck)throw new Error(`First message cannot be of type ${d.type}`);clearTimeout(E),k=!0,f.emit("connected",i,d.payload),U=!1,G=0,a([i,new Promise((be,fe)=>$(fe))])}catch(d){i.onmessage=null,f.emit("error",d),i.close(p.BadResponse,H(d instanceof Error?d.message:new Error(d).message,"Bad response"))}}})()));t.readyState===P.CLOSING&&(yield l);let s=()=>{};const o=new Promise(a=>s=a);return[t,s,Promise.race([o.then(()=>{if(!h){const a=()=>t.close(1e3,"Normal Closure");isFinite(B)&&B>0?setTimeout(()=>{!h&&t.readyState===P.OPEN&&a()},B):a()}}),l])]}),Q.apply(this,arguments)}function X(t){if(L(t)&&(function oe(e){return![1e3,1001,1006,1005,1012,1013,1013].includes(e)&&e>=1e3&&e<=1999}(t.code)||[p.InternalServerError,p.InternalClientError,p.BadRequest,p.BadResponse,p.Unauthorized,p.SubprotocolNotAcceptable,p.SubscriberAlreadyExists,p.TooManyInitialisationRequests].includes(t.code)))throw t;if(K)return!1;if(L(t)&&1e3===t.code)return h>0;if(!J||G>=J||!le(t)||Z?.(t))throw t;return U=!0}return A||(0,g.Z)(function*(){for(h++;;)try{const[,,t]=yield V();yield t}catch(t){try{if(!X(t))return}catch(l){return z?.(l)}}})(),{on:f.on,subscribe(t,l){const s=ue();let o=!1,a=!1,b=()=>{h--,o=!0};return(0,g.Z)(function*(){for(h++;;)try{const[i,E,T]=yield V();if(o)return E();const q=f.onMessage(s,k=>{switch(k.type){case c.Next:return void l.next(k.payload);case c.Error:return a=!0,o=!0,l.error(k.payload),void b();case c.Complete:return o=!0,void b()}});return i.send(N({id:s,type:c.Subscribe,payload:t},D)),b=()=>{!o&&i.readyState===P.OPEN&&i.send(N({id:s,type:c.Complete},D)),h--,o=!0,E()},void(yield T.finally(q))}catch(i){if(!X(i))return}})().then(()=>{a||l.complete()}).catch(i=>{l.error(i)}),()=>{o||b()}},dispose:()=>(0,g.Z)(function*(){if(K=!0,m){const[t]=yield m;t.close(1e3,"Normal Closure")}})(),terminate(){m&&f.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}({url:this.subscriptionUrl,connectionParams:this.connectionParams,lazy:!1,onNonLazyError:n=>{this.extraOptions?.onConnected?.(n,void 0)},on:{connected:()=>{this.extraOptions?.onConnected?.(void 0,void 0)},error:n=>{this.extraOptions?.onConnected?.(n,void 0)}}})}execute(n){if(this.createClient(),!this.client)throw new Error("Could not create subscription client!");return new _.y(y=>{this.cleanup=this.client.subscribe({query:n.query,variables:n.variables,operationName:n.operationName},{next:(...A)=>y.next(...A),error:(...A)=>y.error(...A),complete:()=>y.complete()})})}close(){var n=this;return(0,g.Z)(function*(){try{n.cleanup?.(),n.cleanup=void 0,yield n.client?.dispose(),n.client=void 0}catch(y){console.error(y)}})()}}}}]);
|
package/build/dist/521.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunkaltair=self.webpackChunkaltair||[]).push([[521],{14477:C=>{function u(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=u,u.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var o=Math.random(),O=Math.floor(o*this.jitter*r);r=1&Math.floor(10*o)?r+O:r-O}return 0|Math.min(r,this.max)},u.prototype.reset=function(){this.attempts=0},u.prototype.setMin=function(r){this.ms=r},u.prototype.setMax=function(r){this.max=r},u.prototype.setJitter=function(r){this.jitter=r}},62590:function(C,u,r){"use strict";var o=this&&this.__assign||function(){return o=Object.assign||function(c){for(var t,e=1,n=arguments.length;e<n;e++)for(var s in t=arguments[e])Object.prototype.hasOwnProperty.call(t,s)&&(c[s]=t[s]);return c},o.apply(this,arguments)},O=this&&this.__awaiter||function(c,t,e,n){return new(e||(e=Promise))(function(i,v){function E(m){try{f(n.next(m))}catch(R){v(R)}}function N(m){try{f(n.throw(m))}catch(R){v(R)}}function f(m){m.done?i(m.value):function s(i){return i instanceof e?i:new e(function(v){v(i)})}(m.value).then(E,N)}f((n=n.apply(c,t||[])).next())})},A=this&&this.__generator||function(c,t){var n,s,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(f){return function(m){return function N(f){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,s&&(i=2&f[0]?s.return:f[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,f[1])).done)return i;switch(s=0,i&&(f=[2&f[0],i.value]),f[0]){case 0:case 1:i=f;break;case 4:return e.label++,{value:f[1],done:!1};case 5:e.label++,s=f[1],f=[0];continue;case 7:f=e.ops.pop(),e.trys.pop();continue;default:if(!(i=(i=e.trys).length>0&&i[i.length-1])&&(6===f[0]||2===f[0])){e=0;continue}if(3===f[0]&&(!i||f[1]>i[0]&&f[1]<i[3])){e.label=f[1];break}if(6===f[0]&&e.label<i[1]){e.label=i[1],i=f;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(f);break}i[2]&&e.ops.pop(),e.trys.pop();continue}f=t.call(c,e)}catch(m){f=[6,m],s=0}finally{n=i=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([f,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),s=0;for(t=0;t<e;t++)for(var i=arguments[t],v=0,E=i.length;v<E;v++,s++)n[s]=i[v];return n};Object.defineProperty(u,"__esModule",{value:!0}),u.SubscriptionClient=void 0;var y=typeof global<"u"?global:typeof window<"u"?window:{},d=y.WebSocket||y.MozWebSocket,a=r(14477),l=r(58895),p=r(81449),I=r(37206),g=r(94140),b=r(86992),M=r(47604),h=r(75977),S=r(18303),_=r(69773),T=function(){function c(t,e,n,s){var i=e||{},v=i.connectionCallback,E=void 0===v?void 0:v,N=i.connectionParams,f=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=s||h.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 a({jitter:.5}),this.eventEmitter=new l.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(f),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),s=this.executeOperation.bind(this),i=this.unsubscribe.bind(this);return this.clearInactivityTimeout(),(e={})[M.default]=function(){return this},e.subscribe=function(E,N,f){var m=n(E,N,f);return v=s(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 s=this.eventEmitter.on(t,e,n);return function(){s.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,s){var v,E,N;v=w(e.middlewares),E=e,(N=function(f){if(f)s(f);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(s){return n(s)}e(t)})}},c.prototype.executeOperation=function(t,e){var n=this;null===this.client&&this.connect();var s=this.generateOperationId();return this.operations[s]={options:t,handler:e},this.applyMiddlewares(t).then(function(i){n.checkOperationOptions(i,e),n.operations[s]&&(n.operations[s]={options:i,handler:e},n.sendMessage(s,_.default.GQL_START,i))}).catch(function(i){n.unsubscribe(s),e(n.formatErrors(i))}),s},c.prototype.getObserver=function(t,e,n){return"function"==typeof t?{next:function(s){return t(s)},error:function(s){return e&&e(s)},complete:function(){return n&&n()}}:t},c.prototype.createMaxConnectTimeGenerator=function(){return new a({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,s=t.variables,i=t.operationName;if(!n)throw new Error("Must provide a query.");if(!e)throw new Error("Must provide an handler.");if(!p.default(n)&&!b.getOperationAST(n,i)||i&&!p.default(i)||s&&!I.default(s))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?o(o({},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{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,s;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 s=i.sent(),this.sendMessage(void 0,_.default.GQL_CONNECTION_ERROR,s),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{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 s=this.operations[n].handler;delete this.operations[n],s.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?o(o({},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=typeof this.wasKeepAliveReceived>"u";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}();u.SubscriptionClient=T},18303:(C,u)=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0}),u.WS_TIMEOUT=u.MIN_WS_TIMEOUT=void 0,u.MIN_WS_TIMEOUT=1e3,u.WS_TIMEOUT=3e4},69773:(C,u)=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0});var r=function(){function o(){throw new Error("Static Class")}return o.GQL_CONNECTION_INIT="connection_init",o.GQL_CONNECTION_ACK="connection_ack",o.GQL_CONNECTION_ERROR="connection_error",o.GQL_CONNECTION_KEEP_ALIVE="ka",o.GQL_CONNECTION_TERMINATE="connection_terminate",o.GQL_START="start",o.GQL_DATA="data",o.GQL_ERROR="error",o.GQL_COMPLETE="complete",o.GQL_STOP="stop",o.SUBSCRIPTION_START="subscription_start",o.SUBSCRIPTION_DATA="subscription_data",o.SUBSCRIPTION_SUCCESS="subscription_success",o.SUBSCRIPTION_FAIL="subscription_fail",o.SUBSCRIPTION_END="subscription_end",o.INIT="init",o.INIT_SUCCESS="init_success",o.INIT_FAIL="init_fail",o.KEEP_ALIVE="keepalive",o}();u.default=r},75977:(C,u)=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0}),u.GRAPHQL_SUBSCRIPTIONS=u.GRAPHQL_WS=void 0,u.GRAPHQL_WS="graphql-ws",u.GRAPHQL_SUBSCRIPTIONS="graphql-subscriptions"},37206:(C,u)=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0}),u.default=function r(o){return null!==o&&"object"==typeof o}},81449:(C,u)=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0}),u.default=function r(o){return"string"==typeof o}},58895:C=>{"use strict";var u=Object.prototype.hasOwnProperty,r="~";function o(){}function O(d,a,l){this.fn=d,this.context=a,this.once=l||!1}function A(d,a,l,p,I){if("function"!=typeof l)throw new TypeError("The listener must be a function");var g=new O(l,p||d,I),b=r?r+a:a;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,a){0==--d._eventsCount?d._events=new o:delete d._events[a]}function y(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(r=!1)),y.prototype.eventNames=function(){var l,p,a=[];if(0===this._eventsCount)return a;for(p in l=this._events)u.call(l,p)&&a.push(r?p.slice(1):p);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(l)):a},y.prototype.listeners=function(a){var p=this._events[r?r+a:a];if(!p)return[];if(p.fn)return[p.fn];for(var I=0,g=p.length,b=new Array(g);I<g;I++)b[I]=p[I].fn;return b},y.prototype.listenerCount=function(a){var p=this._events[r?r+a:a];return p?p.fn?1:p.length:0},y.prototype.emit=function(a,l,p,I,g,b){var M=r?r+a:a;if(!this._events[M])return!1;var _,T,h=this._events[M],S=arguments.length;if(h.fn){switch(h.once&&this.removeListener(a,h.fn,void 0,!0),S){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,l),!0;case 3:return h.fn.call(h.context,l,p),!0;case 4:return h.fn.call(h.context,l,p,I),!0;case 5:return h.fn.call(h.context,l,p,I,g),!0;case 6:return h.fn.call(h.context,l,p,I,g,b),!0}for(T=1,_=new Array(S-1);T<S;T++)_[T-1]=arguments[T];h.fn.apply(h.context,_)}else{var t,c=h.length;for(T=0;T<c;T++)switch(h[T].once&&this.removeListener(a,h[T].fn,void 0,!0),S){case 1:h[T].fn.call(h[T].context);break;case 2:h[T].fn.call(h[T].context,l);break;case 3:h[T].fn.call(h[T].context,l,p);break;case 4:h[T].fn.call(h[T].context,l,p,I);break;default:if(!_)for(t=1,_=new Array(S-1);t<S;t++)_[t-1]=arguments[t];h[T].fn.apply(h[T].context,_)}}return!0},y.prototype.on=function(a,l,p){return A(this,a,l,p,!1)},y.prototype.once=function(a,l,p){return A(this,a,l,p,!0)},y.prototype.removeListener=function(a,l,p,I){var g=r?r+a:a;if(!this._events[g])return this;if(!l)return w(this,g),this;var b=this._events[g];if(b.fn)b.fn===l&&(!I||b.once)&&(!p||b.context===p)&&w(this,g);else{for(var M=0,h=[],S=b.length;M<S;M++)(b[M].fn!==l||I&&!b[M].once||p&&b[M].context!==p)&&h.push(b[M]);h.length?this._events[g]=1===h.length?h[0]:h:w(this,g)}return this},y.prototype.removeAllListeners=function(a){var l;return a?this._events[l=r?r+a:a]&&w(this,l):(this._events=new o,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},47604:(C,u,r)=>{"use strict";r.r(u),r.d(u,{default:()=>w}),C=r.hmd(C);const w=function o(y){var d,a=y.Symbol;return"function"==typeof a?a.observable?d=a.observable:(d=a("observable"),a.observable=d):d="@@observable",d}(typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:C)},97521:(C,u,r)=>{"use strict";r.r(u),r.d(u,{WebsocketSubscriptionProvider:()=>y});var o=r(43588),O=r(62590),w=r(62503);class y extends o.q{createClient(){this.client=new O.SubscriptionClient(this.subscriptionUrl,{reconnect:!0,connectionParams:this.connectionParams,connectionCallback:this.extraOptions?.onConnected})}execute(a){if(this.createClient(),!this.client)throw new Error("Could not create subscription client!");return new w.y(l=>{const p=this.client.request({query:a.query,variables:a.variables,operationName:a.operationName}).subscribe({next:(...I)=>l.next(...I),error:(...I)=>l.error(...I),complete:()=>l.complete()});this.cleanup=p.unsubscribe})}close(){this.cleanup?.(),this.cleanup=void 0,this.client?.unsubscribeAll(),this.client?.close(),this.client=void 0}}}}]);
|