@based/client 2.6.1 → 2.7.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/dist/Client.js +2 -3
- package/dist/Client.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/types.d.ts +3 -29
- package/dist/types.js +1 -12
- package/dist/types.js.map +1 -1
- package/docs/schema.md +32 -6
- package/docs/set.md +147 -3
- package/package.json +2 -3
package/dist/Client.js
CHANGED
|
@@ -24,7 +24,6 @@ const queue_1 = require("./queue");
|
|
|
24
24
|
const request_1 = require("./request");
|
|
25
25
|
const token_1 = __importDefault(require("./token"));
|
|
26
26
|
const auth_1 = require("./auth");
|
|
27
|
-
const auth_2 = require("./auth");
|
|
28
27
|
__exportStar(require("@based/types"), exports);
|
|
29
28
|
class BasedClient {
|
|
30
29
|
constructor(based) {
|
|
@@ -95,7 +94,7 @@ class BasedClient {
|
|
|
95
94
|
!this.retryingRenewToken) {
|
|
96
95
|
this.retryingRenewToken = true;
|
|
97
96
|
const refreshToken = this.sendTokenOptions?.refreshToken;
|
|
98
|
-
(0,
|
|
97
|
+
(0, auth_1.renewToken)(this, {
|
|
99
98
|
refreshToken,
|
|
100
99
|
})
|
|
101
100
|
.then((result) => {
|
|
@@ -131,10 +130,10 @@ class BasedClient {
|
|
|
131
130
|
}
|
|
132
131
|
}
|
|
133
132
|
catch (err) {
|
|
133
|
+
console.log(err);
|
|
134
134
|
console.error('Received incorrect data ', d);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
exports.BasedClient = BasedClient;
|
|
139
|
-
console.log('???');
|
|
140
139
|
//# sourceMappingURL=Client.js.map
|
package/dist/Client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../src/Client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,wCAcqB;AACrB,mDAOwB;AAExB,mCAAgE;AAChE,uCAAuD;AACvD,oDAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../src/Client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,wCAcqB;AACrB,mDAOwB;AAExB,mCAAgE;AAChE,uCAAuD;AACvD,oDAA+B;AAC/B,iCAAwD;AAExD,+CAA4B;AAE5B,MAAa,WAAW;IAGtB,YAAY,KAAY;QAaxB,SAAI,GAA0B,EAAE,CAAA;QAEhC,kBAAa,GAuBT,EAAE,CAAA;QAEN,UAAK,GAKD,EAAE,CAAA;QAEN,qBAAgB,GAoBZ,EAAE,CAAA;QAEN,kBAAa,GAMT,EAAE,CAAA;QAMN,cAAS,GAAY,KAAK,CAAA;QAI1B,sBAAiB,GAA0B,EAAE,CAAA;QAE7C,WAAW;QACX,UAAK,GACH,EAAE,CAAA;QAEJ,oBAAe,GAAY,KAAK,CAAA;QA1F9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IA+FD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;QACtB,IAAA,sBAAc,EAAC,IAAI,CAAC,CAAA;QACpB,IAAA,2CAA2B,EAAC,IAAI,CAAC,CAAA;QACjC,IAAA,kDAAkC,EAAC,IAAI,CAAC,CAAA;QACxC,qCAAqC;QACrC,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,EAAE;YACnC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAA;SACxD;IACH,CAAC;IAED,WAAW;QACT,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE;YAClC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAA;SACvD;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE;gBAC7B,IAAA,kBAAU,EAAC,IAAI,EAAE,CAAC,oBAAY,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;aACjD;SACF;IACH,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;QACrB,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE;YAChC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAA;SACrD;QACD,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAA,eAAS,EAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAA;SACnD;QAED,IAAA,oCAAoB,EAAC,IAAI,CAAC,CAAA;QAC1B,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAA;IAClB,CAAC;IAED,MAAM,CAAC,CAAC;QACN,IAAI;YACF,MAAM,IAAI,GAAiB,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;YAC7C,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,IAAI,CAAA;YACxC,IAAI,IAAI,KAAK,oBAAY,CAAC,KAAK,EAAE;gBAC/B,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAA;gBAC/B,qCAAqC;gBACrC,IAAI,KAAK,CAAC,MAAM,EAAE;oBAChB,IAAA,mCAAmB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAA;iBAChC;gBACD,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE;oBAC1B,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;iBACb;gBACD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;gBACtB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAA;aACf;iBAAM,IAAI,IAAI,KAAK,oBAAY,CAAC,IAAI,EAAE;gBACrC,IAAA,0BAAmB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAA;aAChC;iBAAM;gBACL,IACG,GAAkB,EAAE,IAAI,KAAK,uBAAe,CAAC,YAAY;oBAC1D,CAAC,IAAI,CAAC,kBAAkB,EACxB;oBACA,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAA;oBAC9B,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAA;oBACxD,IAAA,iBAAU,EAAC,IAAI,EAAE;wBACf,YAAY;qBACb,CAAC;yBACC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;wBACf,IAAA,eAAS,EAAC,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAA;wBACpD,IAAA,oBAAU,EACR,IAAI;wBACJ,aAAa;wBACb,IAAI,EACH,GAAmB,EAAE,OAAO,EAC7B,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,OAAO,EACpC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,MAAM,CACpC,CAAA;oBACH,CAAC,CAAC;yBACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;wBACb,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;oBAC1C,CAAC,CAAC,CAAA;iBACL;qBAAM;oBACL,IACE,IAAI,KAAK,oBAAY,CAAC,GAAG;wBACzB,IAAI,KAAK,oBAAY,CAAC,GAAG;wBACzB,IAAI,KAAK,oBAAY,CAAC,aAAa;wBACnC,IAAI,KAAK,oBAAY,CAAC,gBAAgB;wBACtC,IAAI,KAAK,oBAAY,CAAC,IAAI;wBAC1B,IAAI,KAAK,oBAAY,CAAC,MAAM;wBAC5B,IAAI,KAAK,oBAAY,CAAC,IAAI;wBAC1B,IAAI,KAAK,oBAAY,CAAC,MAAM;wBAC5B,IAAI,KAAK,oBAAY,CAAC,UAAU;wBAChC,IAAI,KAAK,oBAAY,CAAC,WAAW,EACjC;wBACA,IAAA,yBAAe,EAAC,IAAI,EAAE,IAAI,CAAC,CAAA;qBAC5B;yBAAM,IAAI,IAAI,KAAK,oBAAY,CAAC,YAAY,EAAE;wBAC7C,IAAA,oCAAoB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAA;qBACjC;yBAAM,IAAI,IAAI,KAAK,oBAAY,CAAC,gBAAgB,EAAE;wBACjD,IAAA,wCAAwB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAA;qBACrC;iBACF;aACF;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YAChB,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,CAAC,CAAC,CAAA;SAC7C;IACH,CAAC;CACF;AA1MD,kCA0MC"}
|
package/dist/index.js
CHANGED
|
@@ -12,4 +12,4 @@ Found corrupt data while applying diff to subscription need to re-fetch
|
|
|
12
12
|
`),console.warn(W(o.query,2,!1,"Query").join(`
|
|
13
13
|
`)+`
|
|
14
14
|
|
|
15
|
-
`),delete e.cache[t],f(e,[V.RequestTypes.SendSubscriptionData,t]);else{c.checksum=n;for(let u in o.subscribers){let l=o.subscribers[u];l.onInitial&&(l.onInitial(null,Number(t),Number(u),c.value),delete l.onInitial,l.onData||y(e,t,Number(u))),l.onData&&l.onData(c.value,c.checksum)}}}}};var Ge=(e,s)=>{for(let t of s[1]){delete e.cache[t];let i=e.subscriptions[t];if(i){let r={type:"AuthorizationError",name:i.name?`observe "${i.name}"`:"observe",message:"Unauthorized request",payload:i.query,auth:!0},n=C(r);i.authError={token:e.token,error:n};for(let o in i.subscribers){let c=i.subscribers[o];c.onError&&c.onError(n)}}}};var je=require("@based/types");var ot=0,k=(e,s,t,i,r,n,o)=>{let c=++ot;e.requestCallbacks[c]={resolve:i,reject:r,type:s,payload:t,name:n,isRetry:o},s===je.RequestTypes.Call?f(e,[s,n,c,t]):f(e,[s,c,t])};var $e=(e,s)=>{let[,t,i,r]=s,n=e.requestCallbacks[t];n&&(delete e.requestCallbacks[t],r?n.reject(C(r)):n.resolve(i))};var O={};Ce(O,{BasedClient:()=>D});var g=require("@based/types");var le=require("@based/types");var at=e=>typeof e!="undefined"&&e!==null,ct=(e,s,t)=>{if(e.beingAuth=!0,s)e.token=s,e.sendTokenOptions=t;else{for(let i in e.cache)e.subscriptions[i]||delete e.cache[i];delete e.token,delete e.sendTokenOptions}if(e.connected){let i=s?[le.RequestTypes.Token,s,t].filter(at):[le.RequestTypes.Token];e.connection.ws.send(JSON.stringify(i)),_(e),J(e,!0)}},w=ct;var F=require("@based/types");var pe=0,Me=(e,s)=>{let t=++pe;return f(e,[F.RequestTypes.Auth,F.AuthRequestTypes.Login,t,s]),new Promise((i,r)=>{e.authCallbacks[t]={resolve:n=>{w(e,n.token,{refreshToken:n.refreshToken}),i(n)},reject:r}})},Ne=(e,s)=>{let t=++pe;return f(e,[F.RequestTypes.Auth,F.AuthRequestTypes.RenewToken,t,s]),new Promise((i,r)=>{e.authCallbacks[t]={resolve:n=>{w(e,n.token),i(n)},reject:r}})},Le=(e,s)=>{let[,t,i,r]=s,n=e.authCallbacks[t];n&&(delete e.authCallbacks[t],r?n.reject(C(r)):n.resolve(i))},He=e=>{let s=++pe;return f(e,[F.RequestTypes.Auth,F.AuthRequestTypes.Logout,s]),new Promise((t,i)=>{e.authCallbacks[s]={resolve:r=>{w(e),t(r)},reject:i}})};d(O,require("@based/types"));var D=class{constructor(s){this.auth=[];this.subscriptions={};this.cache={};this.requestCallbacks={};this.authCallbacks={};this.connected=!1;this.subscriptionQueue=[];this.queue=[];this.drainInProgress=!1;this.based=s}onClose(){this.connected=!1,Re(this),Fe(this),xe(this),this.based.listeners.disconnect&&this.based.listeners.disconnect.forEach(s=>s())}onReconnect(){if(this.based.listeners.reconnect&&this.based.listeners.reconnect.forEach(s=>s()),this.tracking)for(let s of this.tracking)f(this,[g.RequestTypes.Track,{t:s}])}onOpen(){this.connected=!0,this.based.listeners.connect&&this.based.listeners.connect.forEach(s=>s()),this.token&&w(this,this.token,this.sendTokenOptions),J(this),ae(this)}onData(s){var t;try{let i=JSON.parse(s.data),[r,n,o,c]=i;if(r===g.RequestTypes.Token){this.retryingRenewToken=!1,n.length&&Ge(this,i);for(let a of this.auth)a(!o);this.beingAuth=!1,this.auth=[]}else if(r===g.RequestTypes.Auth)Le(this,i);else if((c==null?void 0:c.code)===g.BasedErrorCodes.TokenExpired&&!this.retryingRenewToken){this.retryingRenewToken=!0;let a=(t=this.sendTokenOptions)==null?void 0:t.refreshToken;Ne(this,{refreshToken:a}).then(u=>{w(this,u.token,this.sendTokenOptions),k(this,r,c==null?void 0:c.payload,this.requestCallbacks[n].resolve,this.requestCallbacks[n].reject)}).catch(u=>{this.requestCallbacks[n].reject(u)})}else r===g.RequestTypes.Set||r===g.RequestTypes.Get||r===g.RequestTypes.Configuration||r===g.RequestTypes.GetConfiguration||r===g.RequestTypes.Call||r===g.RequestTypes.Delete||r===g.RequestTypes.Copy||r===g.RequestTypes.Digest||r===g.RequestTypes.RemoveType||r===g.RequestTypes.RemoveField?$e(this,i):r===g.RequestTypes.Subscription?De(this,i):r===g.RequestTypes.SubscriptionDiff&&Ue(this,i)}catch(i){console.error("Received incorrect data ",s)}}};console.log("???");var de=(e,s)=>{let t;if(e.configuration&&e.configuration.schema)for(let i in e.configuration.schema){let r=e.configuration.schema[i];if(r.prefixToTypeMapping){for(let n in r.prefixToTypeMapping)if(r.prefixToTypeMapping[n]===s){t=n;break}}}return t};var ge=require("@saulx/hash");var ze=require("@based/types"),Je=require("@saulx/hash"),_e=new Set,ut=e=>{if(typeof window!="undefined"){if(_e.has(e))return!1;_e.add(e);try{let s="_ba:"+(0,Je.hashCompact)(e);return localStorage.getItem(s)?!1:(localStorage.setItem(s,"1"),!0)}catch(s){return!1}}return!1},be=(e,s)=>{if(s){let t=`${e}`,i=Object.keys(s).sort();for(let r of i)t+="_"+r+"_"+s[r];return t}else return e},M=(e,s,t,i,r,n,o)=>{let c=be(s,t),a={t:c};o&&(a.r=1),r&&(a.e=1,n&&(a.o=n)),i?(a.s=1,e.tracking.delete(c)):o||(r||(e.tracking||(e.tracking=new Set),e.tracking.add(c)),ut(c)&&(a.u=1)),f(e,[ze.RequestTypes.Track,a])};var fe=class{constructor(s,t,i){this.closed=!1;this.client=s,this.subId=i,this.subscriberId=t}unsubscribe(){this.closed=!0,y(this.client,this.subId,this.subscriberId)}},me=class{constructor(s,t){this.closed=!1;this.client=s,this.subs=t}unsubscribe(){if(!this.closed){this.closed=!0;for(let s of this.subs)s.unsubscribe()}}},X=class{constructor(s,t){this.client=s,this.components=t}subscribe(s,t,i){let r={data:{}},n=[];for(let{key:o,obs:c}of this.components){let a=c.subscribe(u=>{if(o===""){Object.assign(r.data,u),s(r);return}r.data[o]=u,s(r)},t);n.push(a)}return new me(this.client,n)}},P=class{constructor(s,t,i){this.client=s,this.subId=typeof t=="string"?q(i,t):q(t),this.name=typeof t=="string"?t:null,this.payload=typeof t=="string"?i:t}subscribe(s,t,i){let[,r]=E(this.client,this.payload,s,n=>{n&&(console.error(n),t&&t(n))},t,this.subId,this.name);return new fe(this.client,r,this.subId)}};var he={},N={},lt=(e,s)=>{he[e]||(he[e]=!0,setTimeout(()=>{console.info("Drain file q"),he[e]=!1;let t=N[e];N[e]=[];let i=new global.FormData;for(let r of t){let{raw:n,name:o,id:c,file:a,functionName:u}=r,l=`${u||""}|${n?1:0}|${c}|${a.size}${o?`|${o}`:""}`;i.append(l,a)}try{let r=new global.XMLHttpRequest;r.upload.onprogress=n=>{let o=100*(n.loaded||n.position)/(n.totalSize||n.total);console.info(o,"upload...")},r.onerror=n=>{console.error("error!",n,"flap",r.responseText)},r.timeout=1e3*60*60*24,r.onabort=n=>{console.error("abort",n)},r.ontimeout=n=>{console.error("on timeout",n)},r.onload=()=>{let n={};try{n=JSON.parse(r.response),console.info("SUCCESS",n)}catch(o){console.error("something wrong with file upload",o)}},r.open("POST",e+"/file"),r.setRequestHeader("Content-Type","multipart/form-data"),r.setRequestHeader("Authorization",s),r.send(i)}catch(r){console.error("Something wrong with xhr upload",r)}},500))},Ke=async(e,s,t,i,r,n,o)=>{N[t]||(N[t]=[]),N[t].push({file:s,id:i,url:t,raw:r,name:n,functionName:o}),lt(t,e.getToken())};var We=H(require("@based/get-service")),Y={},Z={},pt=async(e,s)=>{if(s.url)return typeof s.url=="string"?s.url:await s.url();if(!e.opts.env&&e.opts.url)return typeof e.opts.url=="string"?e.opts.url:await e.opts.url();let{env:t,project:i,org:r}=e.opts,n=t+"/"+i+"/"+r+"/"+e.opts.cluster;if(Y[n])return Y[n];if(Z[n])return(await Z[n]).url;let o=await(Z[n]=(0,We.default)({env:t,project:i,org:r,name:"@based/hub",key:"file-upload",optionalKey:!0},0,e.opts.cluster));return delete Z[n],setTimeout(()=>{delete Y[n]},2e3),Y[n]=o.url},Ve=pt;var Xe=H(require("cross-fetch")),ee=(e,s,t)=>((0,Xe.default)(s,{method:"POST",cache:"no-cache",headers:{"Content-Type":t.mimeType||"text/plain","File-Id":t.id,"File-Is-Raw":t.raw?"1":"0","File-Name":t.name||"","Function-Name":t.functionName||"",Authorization:e.getToken()},body:t.contents}).then(i=>{}).catch(i=>{console.error("Error while uploading file",i)}),{id:t.id});var I=require("./file/stream"),te=typeof window!="undefined",dt=e=>"src"in e&&typeof e.src=="string",bt=e=>"path"in e&&typeof e.path=="string",ft=e=>"contents"in e&&(0,I.isStream)(e.contents),Ye=async(e,s)=>{if(dt(s)){let r=s.id?{$id:s.id}:{type:"file"};return s.src?(r.src=s.src,r.origin=s.src,s.size&&(r.size=s.size),s.name&&(r.name=s.name),s.parents&&(r.parents=s.parents),await e.set(r)):void 0}let t=s.id;if(!t){let r={type:"file",progress:0};s.name?r.name=s.name:global.File&&"contents"in s&&s.contents instanceof global.File&&(r.name=s.contents.name),s.parents&&(r.parents=s.parents),t=(await e.set(r)).id}s.id=t;let i=(await Ve(e,s)).replace(/^ws/,"http");if(bt(s))return(0,I.uploadFilePath)(e,i,s),{id:t};if(ft(s))return(0,I.uploadFileStream)(e,i,s),{id:t};if(s.contents instanceof ArrayBuffer)return s.contents=te?new global.Blob([s.contents],{type:s.mimeType||"text/plain"}):global.Buffer.from(s.contents),ee(e,i+"/file",s);if(te&&s.contents instanceof global.Blob)return s.mimeType||(s.mimeType=s.contents.type),ee(e,i+"/file",s);if(typeof s.contents=="string"||!te&&s.contents instanceof global.Buffer)return ee(e,i+"/file",s);if(te&&s.contents instanceof File)return Ke(e,s.contents,i,s.id,s.raw||!1,s.name,s.functionName),{id:t};throw s.id||await e.delete({$id:t}),new Error(`Invalid contents for file api ${JSON.stringify(s,null,2)}`)};var re=H(require("@based/get-service")),ye=require("@saulx/utils"),S=require("@based/graphql");d(m,require("@based/types"),module.exports);var se=class extends we{constructor(t){super();this.client=new D(this),Object.defineProperty(this,"client",{enumerable:!1,writable:!0}),t&&t.url&&this.connect(t.url),this.graphql={query:this.gqlQuery.bind(this),live:this.gqlLive.bind(this)}}connect(t){!t&&this._url?this.client.connection||(this.client.connection=oe(this.client,this._url)):(this._url=t,this.client.connection=oe(this.client,t))}disconnect(){this.client.connection&&(this.client.connection.disconnected=!0,this.client.connection.destroy(),this.client.connection.ws&&this.client.connection.ws.close(),this.client.connected&&this.client.onClose(),delete this.client.connection),this.client.connected=!1}observeUntil(t,i,r){return new Promise((n,o)=>{let c,a=!1;this.observe(t,(u,l)=>{r&&r(u,l),i(u,l)&&(a=!0,c&&c(),n(u))}).then(u=>{a?c():c=u}).catch(u=>{o(u)})})}gql(t,...i){typeof t=="string"&&(t=[t]);let r=t[0];return i.forEach((n,o)=>{n&&n.kind==="Document"?r+=n.loc.source.body:r+=n,r+=t[o+1]}),(0,S.createOperations)({schemas:this.client.configuration.schema},(0,S.parseGraphql)(r))}gqlDb(t="default"){return(i,...r)=>{typeof i=="string"&&(i=[i]);let n=i[0];return r.forEach((o,c)=>{o&&o.kind==="Document"?n+=o.loc.source.body:n+=o,n+=i[c+1]}),(0,S.createOperations)({schemas:this.client.configuration.schema,db:t},(0,S.parseGraphql)(n))}}observe(t,i,r,n){return typeof t=="string"?new Promise((o,c)=>{let a=typeof i=="function",u=a?i:r,l=a?r:n;E(this.client,a?void 0:i,u,(p,b,h,T,R)=>{p&&!R?c(p):o(()=>{y(this.client,b,h)})},l,void 0,t)}):new Promise((o,c)=>{E(this.client,t,i,(a,u,l,p,b)=>{a&&!b?c(a):o(()=>{y(this.client,u,l)})},r)})}createObservable(t,i){return typeof t=="string"?new P(this.client,t,i):new P(this.client,t)}observeSchema(t,i,r){return new Promise((n,o)=>{let c=typeof t=="string"?t:"default",a=typeof t=="string"?i:t,u=typeof t=="string"?r:i;E(this.client,{$subscribe_schema:c},(l,p)=>{this.client.configuration||(this.client.configuration={dbs:[],schema:{},functions:{}}),this.client.configuration.schema[c]=l,a(l,p)},(l,p,b,h,T)=>{l&&!T?o(l):n(()=>{y(this.client,p,b)})},u)})}get(t,i){return typeof t=="string"?new Promise((r,n)=>{z(this.client,i,(o,c,a,u)=>{o?n(o):r(u)},0,t)}):new Promise((r,n)=>{k(this.client,v.RequestTypes.Get,t,r,n)})}file(t){return global.File&&t instanceof File&&(t={contents:t}),Ye(this,t)}call(t,i){return new Promise((r,n)=>{k(this.client,v.RequestTypes.Call,i,r,n,t)})}async id(t,i){let r=de(this.client,t);if(r||(await this.schema(),r=de(this.client,t)),!r)throw C({message:`Type does not exist ${t}`,type:"Invalid type",payload:i?{type:t,opts:i}:{type:t}});if(i){let n=(0,ge.hashCompact)(i,8,!0);return r+n}else return r+(0,ge.hashCompact)(Math.floor(Math.random()*99999999999)+""+Date.now())}digest(t){return new Promise((i,r)=>{k(this.client,v.RequestTypes.Digest,t,i,r)})}set(t){return new Promise((i,r)=>{k(this.client,v.RequestTypes.Set,t,i,r)})}copy(t){return new Promise((i,r)=>{k(this.client,v.RequestTypes.Copy,t,i,r)})}async gqlQuery(t,i={}){let r;typeof t=="string"?r=this.gql(t):r=t;try{if(r=(0,S.handleGraphqlVariables)(r,r,i),r.opType==="GET"){let o={$db:r.db},c=[];for(let u in r.ops){if(r.ops[u].fnObserve){let l=await this.get(r.ops[u].fnObserve.name,r.ops[u].fnObserve.payload);c.push({key:u,reply:l});continue}r.ops[u].get&&(o[u]=r.ops[u].get)}let a=await this.get(o);for(let{key:u,reply:l}of c)a[u]=l;return{data:a}}let n={};return await Promise.all(Object.entries(r.ops).map(async([o,c])=>{var p,b,h,T,R;if(c.delete){n[o]=await this.delete(c.delete);return}else if(c.fnCall){n[o]=await this.call(c.fnCall.name,c.fnCall.payload);return}let{id:a}=await this.set(c.set);if(!c.get){let A={};A.id=a;let ve=(R=(T=(h=(b=(p=this.client)==null?void 0:p.configuration)==null?void 0:b.schema)==null?void 0:h[r.db])==null?void 0:T.prefixToTypeMapping)==null?void 0:R[a.slice(0,2)];ve&&(A.type=ve),n[o]=A;return}let u=(0,ye.deepCopy)(c.get);u.$id=a;let l=await this.get(u);n[o]=l})),{data:n}}catch(n){return{errors:[{message:n.message,locations:n.locations}]}}}async gqlLive(t,i={}){let r;if(typeof t=="string"?r=this.gql(t):r=t,r=(0,S.handleGraphqlVariables)(r,r,i),r.opType==="GET"){let o=[],c={};for(let a in r.ops){if(r.ops[a].fnObserve){let{name:u,payload:l}=r.ops[a].fnObserve;o.push({key:a,fn:{name:u,payload:l}});continue}c[a]=r.ops[a].get}if(o!=null&&o.length){let a=o.map(l=>({obs:new P(this.client,l.fn.name,l.fn.payload),key:l.key})),u=new P(this.client,Oe({$db:r.db},c));return a.push({key:"",obs:u}),new X(this.client,a)}return new P(this.client,{$db:r.db,data:c})}let n={};return await Promise.all(Object.entries(r.ops).map(async([o,c])=>{if(c.delete){n[o]=await this.delete(c.delete);return}else if(c.fnCall){n[o]=await this.call(c.fnCall.name,c.fnCall.payload);return}let{id:a}=await this.set(c.set),u=(0,ye.deepCopy)(c.get);u.$id=a,n[o]=u})),new P(this.client,{$db:r.db,data:n})}analytics(t,i){return new Promise((r,n)=>{i?E(this.client,t,i,(o,c,a,u,l)=>{o&&!l?n(o):r(()=>{y(this.client,c,a)})},o=>console.error(o),void 0,"analytics"):z(this.client,t,(o,c,a,u)=>{o?n(o):((0,v.isAnalyticsHistoryOpts)(t)||(0,v.isAnalyticsTypesOpts)(t),r(u))},0,"analytics")})}track(t,i){M(this.client,t,i)}clearAnalytics(t,i){M(this.client,t,i,!1,!1,void 0,!0)}untrack(t,i){M(this.client,t,i,!0)}event(t,i,r){M(this.client,t,i,!1,!0,r)}delete(t){return new Promise((i,r)=>{k(this.client,v.RequestTypes.Delete,t,i,r)})}schema(){return new Promise((t,i)=>{let r=n=>{this.client.configuration=n,t(n)};k(this.client,v.RequestTypes.GetConfiguration,0,r,i)})}removeType(t,i="default"){return new Promise((r,n)=>{k(this.client,v.RequestTypes.RemoveType,{type:t,db:i},r,n)})}removeField(t,i,r="default"){return new Promise((n,o)=>{!i||i.length===0?o(new Error("Path cannot be empty")):(Array.isArray(i)||(i=[i]),k(this.client,v.RequestTypes.RemoveField,{type:t,db:r,path:i},n,o))})}updateSchema(t){return new Promise((i,r)=>{k(this.client,v.RequestTypes.Configuration,t,i,r)})}getToken(){return this.client.token}auth(t,i){return new Promise(r=>{this.client.auth.push(r),(t&&t!==this.client.token||t===!1&&this.client.token)&&(typeof t=="string"?w(this.client,t,i):w(this.client),this.emit("auth",t))})}async login(t){return Me(this.client,t)}logout(){return He(this.client)}},mt=(e,s)=>{if(s){let t;e+=/\?/.test(e)?"&":"?";for(let i in s){let r=s[i];e+=t?`&${i}=${r}`:`${i}=${r}`,t=!0}}return e},ht=(e,s=se)=>{let{env:t,project:i,org:r,url:n,key:o,name:c="@based/hub",cluster:a,params:u}=e;if(n||(a=e.cluster=(0,re.getClusterUrl)(a),n=async()=>{let{url:l}=await(0,re.default)({env:t,project:i,org:r,key:o,name:c},0,a);return mt(l,u)}),n){let l=new s;return l.opts=e,l.connect(n),l}},gt=ht;0&&(module.exports={Based,BasedClient,BasedGraphQL,Observable,addGetSubscriber,addRequest,addSubscriber,createGraphqlOperations,generateSubscriptionId,generateTrackingKey,handleGraphqlVariables,parseGraphql,removeSubscriber});
|
|
15
|
+
`),delete e.cache[t],f(e,[V.RequestTypes.SendSubscriptionData,t]);else{c.checksum=n;for(let u in o.subscribers){let l=o.subscribers[u];l.onInitial&&(l.onInitial(null,Number(t),Number(u),c.value),delete l.onInitial,l.onData||y(e,t,Number(u))),l.onData&&l.onData(c.value,c.checksum)}}}}};var Ge=(e,s)=>{for(let t of s[1]){delete e.cache[t];let i=e.subscriptions[t];if(i){let r={type:"AuthorizationError",name:i.name?`observe "${i.name}"`:"observe",message:"Unauthorized request",payload:i.query,auth:!0},n=C(r);i.authError={token:e.token,error:n};for(let o in i.subscribers){let c=i.subscribers[o];c.onError&&c.onError(n)}}}};var je=require("@based/types");var ot=0,k=(e,s,t,i,r,n,o)=>{let c=++ot;e.requestCallbacks[c]={resolve:i,reject:r,type:s,payload:t,name:n,isRetry:o},s===je.RequestTypes.Call?f(e,[s,n,c,t]):f(e,[s,c,t])};var $e=(e,s)=>{let[,t,i,r]=s,n=e.requestCallbacks[t];n&&(delete e.requestCallbacks[t],r?n.reject(C(r)):n.resolve(i))};var O={};Ce(O,{BasedClient:()=>D});var g=require("@based/types");var le=require("@based/types");var at=e=>typeof e!="undefined"&&e!==null,ct=(e,s,t)=>{if(e.beingAuth=!0,s)e.token=s,e.sendTokenOptions=t;else{for(let i in e.cache)e.subscriptions[i]||delete e.cache[i];delete e.token,delete e.sendTokenOptions}if(e.connected){let i=s?[le.RequestTypes.Token,s,t].filter(at):[le.RequestTypes.Token];e.connection.ws.send(JSON.stringify(i)),_(e),J(e,!0)}},w=ct;var F=require("@based/types");var pe=0,Me=(e,s)=>{let t=++pe;return f(e,[F.RequestTypes.Auth,F.AuthRequestTypes.Login,t,s]),new Promise((i,r)=>{e.authCallbacks[t]={resolve:n=>{w(e,n.token,{refreshToken:n.refreshToken}),i(n)},reject:r}})},Ne=(e,s)=>{let t=++pe;return f(e,[F.RequestTypes.Auth,F.AuthRequestTypes.RenewToken,t,s]),new Promise((i,r)=>{e.authCallbacks[t]={resolve:n=>{w(e,n.token),i(n)},reject:r}})},Le=(e,s)=>{let[,t,i,r]=s,n=e.authCallbacks[t];n&&(delete e.authCallbacks[t],r?n.reject(C(r)):n.resolve(i))},He=e=>{let s=++pe;return f(e,[F.RequestTypes.Auth,F.AuthRequestTypes.Logout,s]),new Promise((t,i)=>{e.authCallbacks[s]={resolve:r=>{w(e),t(r)},reject:i}})};d(O,require("@based/types"));var D=class{constructor(s){this.auth=[];this.subscriptions={};this.cache={};this.requestCallbacks={};this.authCallbacks={};this.connected=!1;this.subscriptionQueue=[];this.queue=[];this.drainInProgress=!1;this.based=s}onClose(){this.connected=!1,Re(this),Fe(this),xe(this),this.based.listeners.disconnect&&this.based.listeners.disconnect.forEach(s=>s())}onReconnect(){if(this.based.listeners.reconnect&&this.based.listeners.reconnect.forEach(s=>s()),this.tracking)for(let s of this.tracking)f(this,[g.RequestTypes.Track,{t:s}])}onOpen(){this.connected=!0,this.based.listeners.connect&&this.based.listeners.connect.forEach(s=>s()),this.token&&w(this,this.token,this.sendTokenOptions),J(this),ae(this)}onData(s){var t;try{let i=JSON.parse(s.data),[r,n,o,c]=i;if(r===g.RequestTypes.Token){this.retryingRenewToken=!1,n.length&&Ge(this,i);for(let a of this.auth)a(!o);this.beingAuth=!1,this.auth=[]}else if(r===g.RequestTypes.Auth)Le(this,i);else if((c==null?void 0:c.code)===g.BasedErrorCodes.TokenExpired&&!this.retryingRenewToken){this.retryingRenewToken=!0;let a=(t=this.sendTokenOptions)==null?void 0:t.refreshToken;Ne(this,{refreshToken:a}).then(u=>{w(this,u.token,this.sendTokenOptions),k(this,r,c==null?void 0:c.payload,this.requestCallbacks[n].resolve,this.requestCallbacks[n].reject)}).catch(u=>{this.requestCallbacks[n].reject(u)})}else r===g.RequestTypes.Set||r===g.RequestTypes.Get||r===g.RequestTypes.Configuration||r===g.RequestTypes.GetConfiguration||r===g.RequestTypes.Call||r===g.RequestTypes.Delete||r===g.RequestTypes.Copy||r===g.RequestTypes.Digest||r===g.RequestTypes.RemoveType||r===g.RequestTypes.RemoveField?$e(this,i):r===g.RequestTypes.Subscription?De(this,i):r===g.RequestTypes.SubscriptionDiff&&Ue(this,i)}catch(i){console.log(i),console.error("Received incorrect data ",s)}}};var de=(e,s)=>{let t;if(e.configuration&&e.configuration.schema)for(let i in e.configuration.schema){let r=e.configuration.schema[i];if(r.prefixToTypeMapping){for(let n in r.prefixToTypeMapping)if(r.prefixToTypeMapping[n]===s){t=n;break}}}return t};var ge=require("@saulx/hash");var ze=require("@based/types"),Je=require("@saulx/hash"),_e=new Set,ut=e=>{if(typeof window!="undefined"){if(_e.has(e))return!1;_e.add(e);try{let s="_ba:"+(0,Je.hashCompact)(e);return localStorage.getItem(s)?!1:(localStorage.setItem(s,"1"),!0)}catch(s){return!1}}return!1},be=(e,s)=>{if(s){let t=`${e}`,i=Object.keys(s).sort();for(let r of i)t+="_"+r+"_"+s[r];return t}else return e},M=(e,s,t,i,r,n,o)=>{let c=be(s,t),a={t:c};o&&(a.r=1),r&&(a.e=1,n&&(a.o=n)),i?(a.s=1,e.tracking.delete(c)):o||(r||(e.tracking||(e.tracking=new Set),e.tracking.add(c)),ut(c)&&(a.u=1)),f(e,[ze.RequestTypes.Track,a])};var fe=class{constructor(s,t,i){this.closed=!1;this.client=s,this.subId=i,this.subscriberId=t}unsubscribe(){this.closed=!0,y(this.client,this.subId,this.subscriberId)}},me=class{constructor(s,t){this.closed=!1;this.client=s,this.subs=t}unsubscribe(){if(!this.closed){this.closed=!0;for(let s of this.subs)s.unsubscribe()}}},X=class{constructor(s,t){this.client=s,this.components=t}subscribe(s,t,i){let r={data:{}},n=[];for(let{key:o,obs:c}of this.components){let a=c.subscribe(u=>{if(o===""){Object.assign(r.data,u),s(r);return}r.data[o]=u,s(r)},t);n.push(a)}return new me(this.client,n)}},P=class{constructor(s,t,i){this.client=s,this.subId=typeof t=="string"?q(i,t):q(t),this.name=typeof t=="string"?t:null,this.payload=typeof t=="string"?i:t}subscribe(s,t,i){let[,r]=E(this.client,this.payload,s,n=>{n&&(console.error(n),t&&t(n))},t,this.subId,this.name);return new fe(this.client,r,this.subId)}};var he={},N={},lt=(e,s)=>{he[e]||(he[e]=!0,setTimeout(()=>{console.info("Drain file q"),he[e]=!1;let t=N[e];N[e]=[];let i=new global.FormData;for(let r of t){let{raw:n,name:o,id:c,file:a,functionName:u}=r,l=`${u||""}|${n?1:0}|${c}|${a.size}${o?`|${o}`:""}`;i.append(l,a)}try{let r=new global.XMLHttpRequest;r.upload.onprogress=n=>{let o=100*(n.loaded||n.position)/(n.totalSize||n.total);console.info(o,"upload...")},r.onerror=n=>{console.error("error!",n,"flap",r.responseText)},r.timeout=1e3*60*60*24,r.onabort=n=>{console.error("abort",n)},r.ontimeout=n=>{console.error("on timeout",n)},r.onload=()=>{let n={};try{n=JSON.parse(r.response),console.info("SUCCESS",n)}catch(o){console.error("something wrong with file upload",o)}},r.open("POST",e+"/file"),r.setRequestHeader("Content-Type","multipart/form-data"),r.setRequestHeader("Authorization",s),r.send(i)}catch(r){console.error("Something wrong with xhr upload",r)}},500))},Ke=async(e,s,t,i,r,n,o)=>{N[t]||(N[t]=[]),N[t].push({file:s,id:i,url:t,raw:r,name:n,functionName:o}),lt(t,e.getToken())};var We=H(require("@based/get-service")),Y={},Z={},pt=async(e,s)=>{if(s.url)return typeof s.url=="string"?s.url:await s.url();if(!e.opts.env&&e.opts.url)return typeof e.opts.url=="string"?e.opts.url:await e.opts.url();let{env:t,project:i,org:r}=e.opts,n=t+"/"+i+"/"+r+"/"+e.opts.cluster;if(Y[n])return Y[n];if(Z[n])return(await Z[n]).url;let o=await(Z[n]=(0,We.default)({env:t,project:i,org:r,name:"@based/hub",key:"file-upload",optionalKey:!0},0,e.opts.cluster));return delete Z[n],setTimeout(()=>{delete Y[n]},2e3),Y[n]=o.url},Ve=pt;var Xe=H(require("cross-fetch")),ee=(e,s,t)=>((0,Xe.default)(s,{method:"POST",cache:"no-cache",headers:{"Content-Type":t.mimeType||"text/plain","File-Id":t.id,"File-Is-Raw":t.raw?"1":"0","File-Name":t.name||"","Function-Name":t.functionName||"",Authorization:e.getToken()},body:t.contents}).then(i=>{}).catch(i=>{console.error("Error while uploading file",i)}),{id:t.id});var I=require("./file/stream"),te=typeof window!="undefined",dt=e=>"src"in e&&typeof e.src=="string",bt=e=>"path"in e&&typeof e.path=="string",ft=e=>"contents"in e&&(0,I.isStream)(e.contents),Ye=async(e,s)=>{if(dt(s)){let r=s.id?{$id:s.id}:{type:"file"};return s.src?(r.src=s.src,r.origin=s.src,s.size&&(r.size=s.size),s.name&&(r.name=s.name),s.parents&&(r.parents=s.parents),await e.set(r)):void 0}let t=s.id;if(!t){let r={type:"file",progress:0};s.name?r.name=s.name:global.File&&"contents"in s&&s.contents instanceof global.File&&(r.name=s.contents.name),s.parents&&(r.parents=s.parents),t=(await e.set(r)).id}s.id=t;let i=(await Ve(e,s)).replace(/^ws/,"http");if(bt(s))return(0,I.uploadFilePath)(e,i,s),{id:t};if(ft(s))return(0,I.uploadFileStream)(e,i,s),{id:t};if(s.contents instanceof ArrayBuffer)return s.contents=te?new global.Blob([s.contents],{type:s.mimeType||"text/plain"}):global.Buffer.from(s.contents),ee(e,i+"/file",s);if(te&&s.contents instanceof global.Blob)return s.mimeType||(s.mimeType=s.contents.type),ee(e,i+"/file",s);if(typeof s.contents=="string"||!te&&s.contents instanceof global.Buffer)return ee(e,i+"/file",s);if(te&&s.contents instanceof File)return Ke(e,s.contents,i,s.id,s.raw||!1,s.name,s.functionName),{id:t};throw s.id||await e.delete({$id:t}),new Error(`Invalid contents for file api ${JSON.stringify(s,null,2)}`)};var re=H(require("@based/get-service")),ye=require("@saulx/utils"),S=require("@based/graphql");d(m,require("@based/types"),module.exports);var se=class extends we{constructor(t){super();this.client=new D(this),Object.defineProperty(this,"client",{enumerable:!1,writable:!0}),t&&t.url&&this.connect(t.url),this.graphql={query:this.gqlQuery.bind(this),live:this.gqlLive.bind(this)}}connect(t){!t&&this._url?this.client.connection||(this.client.connection=oe(this.client,this._url)):(this._url=t,this.client.connection=oe(this.client,t))}disconnect(){this.client.connection&&(this.client.connection.disconnected=!0,this.client.connection.destroy(),this.client.connection.ws&&this.client.connection.ws.close(),this.client.connected&&this.client.onClose(),delete this.client.connection),this.client.connected=!1}observeUntil(t,i,r){return new Promise((n,o)=>{let c,a=!1;this.observe(t,(u,l)=>{r&&r(u,l),i(u,l)&&(a=!0,c&&c(),n(u))}).then(u=>{a?c():c=u}).catch(u=>{o(u)})})}gql(t,...i){typeof t=="string"&&(t=[t]);let r=t[0];return i.forEach((n,o)=>{n&&n.kind==="Document"?r+=n.loc.source.body:r+=n,r+=t[o+1]}),(0,S.createOperations)({schemas:this.client.configuration.schema},(0,S.parseGraphql)(r))}gqlDb(t="default"){return(i,...r)=>{typeof i=="string"&&(i=[i]);let n=i[0];return r.forEach((o,c)=>{o&&o.kind==="Document"?n+=o.loc.source.body:n+=o,n+=i[c+1]}),(0,S.createOperations)({schemas:this.client.configuration.schema,db:t},(0,S.parseGraphql)(n))}}observe(t,i,r,n){return typeof t=="string"?new Promise((o,c)=>{let a=typeof i=="function",u=a?i:r,l=a?r:n;E(this.client,a?void 0:i,u,(p,b,h,T,R)=>{p&&!R?c(p):o(()=>{y(this.client,b,h)})},l,void 0,t)}):new Promise((o,c)=>{E(this.client,t,i,(a,u,l,p,b)=>{a&&!b?c(a):o(()=>{y(this.client,u,l)})},r)})}createObservable(t,i){return typeof t=="string"?new P(this.client,t,i):new P(this.client,t)}observeSchema(t,i,r){return new Promise((n,o)=>{let c=typeof t=="string"?t:"default",a=typeof t=="string"?i:t,u=typeof t=="string"?r:i;E(this.client,{$subscribe_schema:c},(l,p)=>{this.client.configuration||(this.client.configuration={dbs:[],schema:{},functions:{}}),this.client.configuration.schema[c]=l,a(l,p)},(l,p,b,h,T)=>{l&&!T?o(l):n(()=>{y(this.client,p,b)})},u)})}get(t,i){return typeof t=="string"?new Promise((r,n)=>{z(this.client,i,(o,c,a,u)=>{o?n(o):r(u)},0,t)}):new Promise((r,n)=>{k(this.client,v.RequestTypes.Get,t,r,n)})}file(t){return global.File&&t instanceof File&&(t={contents:t}),Ye(this,t)}call(t,i){return new Promise((r,n)=>{k(this.client,v.RequestTypes.Call,i,r,n,t)})}async id(t,i){let r=de(this.client,t);if(r||(await this.schema(),r=de(this.client,t)),!r)throw C({message:`Type does not exist ${t}`,type:"Invalid type",payload:i?{type:t,opts:i}:{type:t}});if(i){let n=(0,ge.hashCompact)(i,8,!0);return r+n}else return r+(0,ge.hashCompact)(Math.floor(Math.random()*99999999999)+""+Date.now())}digest(t){return new Promise((i,r)=>{k(this.client,v.RequestTypes.Digest,t,i,r)})}set(t){return new Promise((i,r)=>{k(this.client,v.RequestTypes.Set,t,i,r)})}copy(t){return new Promise((i,r)=>{k(this.client,v.RequestTypes.Copy,t,i,r)})}async gqlQuery(t,i={}){let r;typeof t=="string"?r=this.gql(t):r=t;try{if(r=(0,S.handleGraphqlVariables)(r,r,i),r.opType==="GET"){let o={$db:r.db},c=[];for(let u in r.ops){if(r.ops[u].fnObserve){let l=await this.get(r.ops[u].fnObserve.name,r.ops[u].fnObserve.payload);c.push({key:u,reply:l});continue}r.ops[u].get&&(o[u]=r.ops[u].get)}let a=await this.get(o);for(let{key:u,reply:l}of c)a[u]=l;return{data:a}}let n={};return await Promise.all(Object.entries(r.ops).map(async([o,c])=>{var p,b,h,T,R;if(c.delete){n[o]=await this.delete(c.delete);return}else if(c.fnCall){n[o]=await this.call(c.fnCall.name,c.fnCall.payload);return}let{id:a}=await this.set(c.set);if(!c.get){let A={};A.id=a;let ve=(R=(T=(h=(b=(p=this.client)==null?void 0:p.configuration)==null?void 0:b.schema)==null?void 0:h[r.db])==null?void 0:T.prefixToTypeMapping)==null?void 0:R[a.slice(0,2)];ve&&(A.type=ve),n[o]=A;return}let u=(0,ye.deepCopy)(c.get);u.$id=a;let l=await this.get(u);n[o]=l})),{data:n}}catch(n){return{errors:[{message:n.message,locations:n.locations}]}}}async gqlLive(t,i={}){let r;if(typeof t=="string"?r=this.gql(t):r=t,r=(0,S.handleGraphqlVariables)(r,r,i),r.opType==="GET"){let o=[],c={};for(let a in r.ops){if(r.ops[a].fnObserve){let{name:u,payload:l}=r.ops[a].fnObserve;o.push({key:a,fn:{name:u,payload:l}});continue}c[a]=r.ops[a].get}if(o!=null&&o.length){let a=o.map(l=>({obs:new P(this.client,l.fn.name,l.fn.payload),key:l.key})),u=new P(this.client,Oe({$db:r.db},c));return a.push({key:"",obs:u}),new X(this.client,a)}return new P(this.client,{$db:r.db,data:c})}let n={};return await Promise.all(Object.entries(r.ops).map(async([o,c])=>{if(c.delete){n[o]=await this.delete(c.delete);return}else if(c.fnCall){n[o]=await this.call(c.fnCall.name,c.fnCall.payload);return}let{id:a}=await this.set(c.set),u=(0,ye.deepCopy)(c.get);u.$id=a,n[o]=u})),new P(this.client,{$db:r.db,data:n})}analytics(t,i){return new Promise((r,n)=>{i?E(this.client,t,i,(o,c,a,u,l)=>{o&&!l?n(o):r(()=>{y(this.client,c,a)})},o=>console.error(o),void 0,"analytics"):z(this.client,t,(o,c,a,u)=>{o?n(o):((0,v.isAnalyticsHistoryOpts)(t)||(0,v.isAnalyticsTypesOpts)(t),r(u))},0,"analytics")})}track(t,i){M(this.client,t,i)}clearAnalytics(t,i){M(this.client,t,i,!1,!1,void 0,!0)}untrack(t,i){M(this.client,t,i,!0)}event(t,i,r){M(this.client,t,i,!1,!0,r)}delete(t){return new Promise((i,r)=>{k(this.client,v.RequestTypes.Delete,t,i,r)})}schema(){return new Promise((t,i)=>{let r=n=>{this.client.configuration=n,t(n)};k(this.client,v.RequestTypes.GetConfiguration,0,r,i)})}removeType(t,i="default"){return new Promise((r,n)=>{k(this.client,v.RequestTypes.RemoveType,{type:t,db:i},r,n)})}removeField(t,i,r="default"){return new Promise((n,o)=>{!i||i.length===0?o(new Error("Path cannot be empty")):(Array.isArray(i)||(i=[i]),k(this.client,v.RequestTypes.RemoveField,{type:t,db:r,path:i},n,o))})}updateSchema(t){return new Promise((i,r)=>{k(this.client,v.RequestTypes.Configuration,t,i,r)})}getToken(){return this.client.token}auth(t,i){return new Promise(r=>{this.client.auth.push(r),(t&&t!==this.client.token||t===!1&&this.client.token)&&(typeof t=="string"?w(this.client,t,i):w(this.client),this.emit("auth",t))})}async login(t){return Me(this.client,t)}logout(){return He(this.client)}},mt=(e,s)=>{if(s){let t;e+=/\?/.test(e)?"&":"?";for(let i in s){let r=s[i];e+=t?`&${i}=${r}`:`${i}=${r}`,t=!0}}return e},ht=(e,s=se)=>{let{env:t,project:i,org:r,url:n,key:o,name:c="@based/hub",cluster:a,params:u}=e;if(n||(a=e.cluster=(0,re.getClusterUrl)(a),n=async()=>{let{url:l}=await(0,re.default)({env:t,project:i,org:r,key:o,name:c},0,a);return mt(l,u)}),n){let l=new s;return l.opts=e,l.connect(n),l}},gt=ht;0&&(module.exports={Based,BasedClient,BasedGraphQL,Observable,addGetSubscriber,addRequest,addSubscriber,createGraphqlOperations,generateSubscriptionId,generateTrackingKey,handleGraphqlVariables,parseGraphql,removeSubscriber});
|
package/dist/types.d.ts
CHANGED
|
@@ -20,13 +20,7 @@ export declare enum RequestTypes {
|
|
|
20
20
|
Copy = 12,
|
|
21
21
|
Digest = 13,
|
|
22
22
|
Token = 14,
|
|
23
|
-
Track = 15
|
|
24
|
-
Auth = 16
|
|
25
|
-
}
|
|
26
|
-
export declare enum AuthRequestTypes {
|
|
27
|
-
Login = 1,
|
|
28
|
-
Logout = 2,
|
|
29
|
-
RenewToken = 3
|
|
23
|
+
Track = 15
|
|
30
24
|
}
|
|
31
25
|
export declare type Configuration = {
|
|
32
26
|
schema: {
|
|
@@ -62,12 +56,6 @@ export declare type RequestMessage<T = GenericObject> = [
|
|
|
62
56
|
T
|
|
63
57
|
];
|
|
64
58
|
export declare type TokenMessage = [RequestTypes.Token, string?, boolean?];
|
|
65
|
-
export declare type AuthMessage = [
|
|
66
|
-
RequestTypes.Auth,
|
|
67
|
-
AuthRequestTypes,
|
|
68
|
-
number,
|
|
69
|
-
GenericObject?
|
|
70
|
-
];
|
|
71
59
|
export declare type SubscribeMessage = [
|
|
72
60
|
RequestTypes.Subscription,
|
|
73
61
|
number,
|
|
@@ -93,7 +81,7 @@ export declare type UnsubscribeMessage = [
|
|
|
93
81
|
number
|
|
94
82
|
];
|
|
95
83
|
export declare type SubscriptionMessage = SubscribeMessage | SendSubscriptionDataMessage | UnsubscribeMessage | SendSubscriptionGetDataMessage;
|
|
96
|
-
export declare type Message = RequestMessage | SubscriptionMessage | FunctionCallMessage
|
|
84
|
+
export declare type Message = RequestMessage | SubscriptionMessage | FunctionCallMessage;
|
|
97
85
|
export declare type SubscriptionDiffData = [
|
|
98
86
|
RequestTypes.SubscriptionDiff,
|
|
99
87
|
number,
|
|
@@ -117,13 +105,7 @@ export declare type RequestData = [
|
|
|
117
105
|
ErrorObject?
|
|
118
106
|
];
|
|
119
107
|
export declare type AuthorizedData = [RequestTypes.Token, number[], boolean?];
|
|
120
|
-
export declare type
|
|
121
|
-
RequestTypes.Auth,
|
|
122
|
-
number,
|
|
123
|
-
GenericObject,
|
|
124
|
-
ErrorObject?
|
|
125
|
-
];
|
|
126
|
-
export declare type ResponseData = SubscriptionDiffData | SubscriptionData | RequestData | AuthorizedData | AuthData;
|
|
108
|
+
export declare type ResponseData = SubscriptionDiffData | SubscriptionData | RequestData | AuthorizedData;
|
|
127
109
|
export declare type TrackPayload = {
|
|
128
110
|
t: string;
|
|
129
111
|
u?: 1;
|
|
@@ -138,7 +120,6 @@ export declare type TrackOpts = {
|
|
|
138
120
|
export declare type SendTokenOptions = {
|
|
139
121
|
isBasedUser?: boolean;
|
|
140
122
|
isApiKey?: boolean;
|
|
141
|
-
refreshToken?: string;
|
|
142
123
|
};
|
|
143
124
|
export declare type AnalyticsResult = {
|
|
144
125
|
all: {
|
|
@@ -203,13 +184,6 @@ export declare type AnalyticsHistoryOpts = {
|
|
|
203
184
|
$geo?: string[] | boolean;
|
|
204
185
|
$history: boolean | number;
|
|
205
186
|
};
|
|
206
|
-
export declare type LoginOpts = {
|
|
207
|
-
email: string;
|
|
208
|
-
password: string;
|
|
209
|
-
};
|
|
210
|
-
export declare type RenewTokenOpts = {
|
|
211
|
-
refreshToken: string;
|
|
212
|
-
};
|
|
213
187
|
export declare type FileUploadOptions = {
|
|
214
188
|
contents: Buffer | ArrayBuffer | string | File | Blob;
|
|
215
189
|
mimeType?: string;
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isAnalyticsHistoryOpts = exports.isAnalyticsTypesOpts = exports.
|
|
3
|
+
exports.isAnalyticsHistoryOpts = exports.isAnalyticsTypesOpts = exports.RequestTypes = void 0;
|
|
4
4
|
// eslint-disable-next-line
|
|
5
5
|
var RequestTypes;
|
|
6
6
|
(function (RequestTypes) {
|
|
@@ -34,18 +34,7 @@ var RequestTypes;
|
|
|
34
34
|
RequestTypes[RequestTypes["Token"] = 14] = "Token";
|
|
35
35
|
// eslint-disable-next-line
|
|
36
36
|
RequestTypes[RequestTypes["Track"] = 15] = "Track";
|
|
37
|
-
// eslint-disable-next-line
|
|
38
|
-
RequestTypes[RequestTypes["Auth"] = 16] = "Auth";
|
|
39
37
|
})(RequestTypes = exports.RequestTypes || (exports.RequestTypes = {}));
|
|
40
|
-
var AuthRequestTypes;
|
|
41
|
-
(function (AuthRequestTypes) {
|
|
42
|
-
// eslint-disable-next-line
|
|
43
|
-
AuthRequestTypes[AuthRequestTypes["Login"] = 1] = "Login";
|
|
44
|
-
// eslint-disable-next-line
|
|
45
|
-
AuthRequestTypes[AuthRequestTypes["Logout"] = 2] = "Logout";
|
|
46
|
-
// eslint-disable-next-line
|
|
47
|
-
AuthRequestTypes[AuthRequestTypes["RenewToken"] = 3] = "RenewToken";
|
|
48
|
-
})(AuthRequestTypes = exports.AuthRequestTypes || (exports.AuthRequestTypes = {}));
|
|
49
38
|
function isAnalyticsTypesOpts(opts) {
|
|
50
39
|
return opts.$types === true;
|
|
51
40
|
}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AASA,2BAA2B;AAC3B,IAAY,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AASA,2BAA2B;AAC3B,IAAY,YA+BX;AA/BD,WAAY,YAAY;IACtB,2BAA2B;IAC3B,+DAAgB,CAAA;IAChB,2BAA2B;IAC3B,uEAAoB,CAAA;IACpB,2BAA2B;IAC3B,+EAAwB,CAAA;IACxB,2BAA2B;IAC3B,6DAAe,CAAA;IACf,2BAA2B;IAC3B,6CAAO,CAAA;IACP,2BAA2B;IAC3B,6CAAO,CAAA;IACP,2BAA2B;IAC3B,iEAAiB,CAAA;IACjB,2BAA2B;IAC3B,uEAAoB,CAAA;IACpB,2BAA2B;IAC3B,+CAAQ,CAAA;IACR,2BAA2B;IAC3B,sEAAoB,CAAA;IACpB,2BAA2B;IAC3B,oDAAW,CAAA;IACX,2BAA2B;IAC3B,gDAAS,CAAA;IACT,2BAA2B;IAC3B,oDAAW,CAAA;IACX,2BAA2B;IAC3B,kDAAU,CAAA;IACV,2BAA2B;IAC3B,kDAAU,CAAA;AACZ,CAAC,EA/BW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA+BvB;AAuND,SAAgB,oBAAoB,CAClC,IAAwC;IAExC,OAAQ,IAA2B,CAAC,MAAM,KAAK,IAAI,CAAA;AACrD,CAAC;AAJD,oDAIC;AAED,SAAgB,sBAAsB,CACpC,IAAwC;IAExC,MAAM,UAAU,GAAI,IAA6B,CAAC,QAAQ,CAAA;IAC1D,OAAO,CAAC,CAAC,UAAU,CAAA;AACrB,CAAC;AALD,wDAKC"}
|
package/docs/schema.md
CHANGED
|
@@ -110,6 +110,7 @@ The possible types and their properties are described here:
|
|
|
110
110
|
| `reference` | Holds a node ID. |
|
|
111
111
|
| `references` | Holds an array of node IDs |
|
|
112
112
|
| `object` | This type allows for nested structures, and its fields are then indexed, meaning they can then be referenced directly in a query, later. |
|
|
113
|
+
| `array` | A list of items of one type, which must be specified in the schema. Special operators such as `$push`, `$assing` `$insert`, `$remove` can be used to manipulate the array. |
|
|
113
114
|
| `record` | A record works similarly to an Hashmap, as in, the schema specify what type of value the record can take, and if the user tries to set a different one, it throws an error. See later for more examples. |
|
|
114
115
|
| `set` | A mathematical set. Holds a list of **unique** values of a single basic type (meaning it can't hold objects or arrays), specified in the `item` field. |
|
|
115
116
|
| `json` | This can hold anything and formats it to JSON, returning it in the most appropriate type when queried. Unlike the `oject` type, you can't query the fields if you decide to store a structure in it. Equivalent to storing something with `JSON.stringify()` and returning it with `JSON.parse()`. |
|
|
@@ -150,8 +151,7 @@ The text type is a structure that contains for each key the same string localize
|
|
|
150
151
|
When setting a field type to `object`, the schema must include another special field called `properties` where the values of the object are specified.
|
|
151
152
|
|
|
152
153
|
```js
|
|
153
|
-
|
|
154
|
-
{
|
|
154
|
+
types: {
|
|
155
155
|
// ...
|
|
156
156
|
movie: {
|
|
157
157
|
prefix: 'mo',
|
|
@@ -170,12 +170,38 @@ myType: {
|
|
|
170
170
|
}
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
+
#### `array` type
|
|
174
|
+
|
|
175
|
+
When setting a field type to `array`, the schema must include another special field called `items` where the type of the array is specified. This can be any other schema type, defined appropriately (i.e. `object`s must have `properties` and so on).
|
|
176
|
+
|
|
177
|
+
```js
|
|
178
|
+
types: {
|
|
179
|
+
// ...
|
|
180
|
+
thing: {
|
|
181
|
+
prefix: 'th',
|
|
182
|
+
fields: {
|
|
183
|
+
title: { type: 'text' },
|
|
184
|
+
myarray: {
|
|
185
|
+
type: 'array',
|
|
186
|
+
items: {
|
|
187
|
+
type: 'object',
|
|
188
|
+
properties: {
|
|
189
|
+
title: { type: 'text' },
|
|
190
|
+
name: { type: 'string' },
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
173
199
|
#### `set` type
|
|
174
200
|
|
|
175
|
-
When setting a field type to `set`, the schema must include another special field called `items` where the type of the set is specified.
|
|
201
|
+
When setting a field type to `set`, the schema must include another special field called `items` where the type of the set is specified.
|
|
176
202
|
|
|
177
203
|
```js
|
|
178
|
-
|
|
204
|
+
types: {
|
|
179
205
|
// ...
|
|
180
206
|
company:{
|
|
181
207
|
prefix: 'na',
|
|
@@ -194,9 +220,9 @@ myType: {
|
|
|
194
220
|
When setting a field type to `record`, the schema must include another special field called `values` where the type of value the record can hold is specified.
|
|
195
221
|
|
|
196
222
|
```js
|
|
197
|
-
|
|
223
|
+
types: {
|
|
198
224
|
// ...
|
|
199
|
-
company:{
|
|
225
|
+
company: {
|
|
200
226
|
prefix: 'na',
|
|
201
227
|
fields: {
|
|
202
228
|
employees: {
|
package/docs/set.md
CHANGED
|
@@ -25,6 +25,13 @@ Operators can act at the **node** level or at the **individual field** level.
|
|
|
25
25
|
- `$delete`
|
|
26
26
|
- [`object` and `record` type field operators](#object-and-record-type-field-operators)
|
|
27
27
|
- `$merge`
|
|
28
|
+
- [`array` type field operators](#array-type-field-operators)
|
|
29
|
+
- `$push`
|
|
30
|
+
- `$insert`
|
|
31
|
+
- `$assign`
|
|
32
|
+
- `$remove`
|
|
33
|
+
|
|
34
|
+
---
|
|
28
35
|
|
|
29
36
|
## Node level operators
|
|
30
37
|
|
|
@@ -106,9 +113,9 @@ This allows to later _get_ the node by using the alias instead of the ID.
|
|
|
106
113
|
{
|
|
107
114
|
aliases: []
|
|
108
115
|
}
|
|
109
|
-
|
|
110
|
-
or
|
|
111
|
-
|
|
116
|
+
|
|
117
|
+
// or
|
|
118
|
+
|
|
112
119
|
{
|
|
113
120
|
aliases: { $delete: true }
|
|
114
121
|
}
|
|
@@ -314,6 +321,8 @@ If the node does not exist, value of `const result`: `undefined`. In this case n
|
|
|
314
321
|
*/
|
|
315
322
|
```
|
|
316
323
|
|
|
324
|
+
---
|
|
325
|
+
|
|
317
326
|
## Field type specific operators
|
|
318
327
|
|
|
319
328
|
### Basic operators
|
|
@@ -506,3 +515,138 @@ Resulting node in database:
|
|
|
506
515
|
}
|
|
507
516
|
*/
|
|
508
517
|
```
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
### `array` type field operators
|
|
521
|
+
|
|
522
|
+
#### `$push`: _array type_
|
|
523
|
+
|
|
524
|
+
Used to append an item at the end of the array. The type of `$push` must conform to the `items` field described in the schema.
|
|
525
|
+
|
|
526
|
+
```js
|
|
527
|
+
// in the case of the `items` type being an object with name, value, and status field
|
|
528
|
+
client.set({
|
|
529
|
+
$id: ar165415,
|
|
530
|
+
myobjectarray: {
|
|
531
|
+
$push: {
|
|
532
|
+
name: 'match ' + i,
|
|
533
|
+
value: i,
|
|
534
|
+
status: i < 5 ? 100 : 300,
|
|
535
|
+
},
|
|
536
|
+
},
|
|
537
|
+
})
|
|
538
|
+
|
|
539
|
+
// in the case of the `items` type being 'number'
|
|
540
|
+
client.set({
|
|
541
|
+
$id: ar165415,
|
|
542
|
+
mynumberarray: {
|
|
543
|
+
$push: 4.2
|
|
544
|
+
},
|
|
545
|
+
})
|
|
546
|
+
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
#### `$insert`: _object_
|
|
550
|
+
|
|
551
|
+
Used to insert an item at a specific index of the array. The item at the index and after get shifted appropriately.
|
|
552
|
+
The object must have fields `$idx` and `$value`.
|
|
553
|
+
|
|
554
|
+
##### `$idx`: _integer_
|
|
555
|
+
|
|
556
|
+
Index at which to insert the item. If the index is bigger than the size of the array, `null` items get added between the last item and the `$idx`.
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
##### `$value`: _array type_
|
|
560
|
+
|
|
561
|
+
Item to insert. This must conform to the `items` type described in the schema.
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
```js
|
|
565
|
+
// in the case of the `items` type being an object with name, value, and status field
|
|
566
|
+
client.set({
|
|
567
|
+
$id: 'ar165415',
|
|
568
|
+
myobjectarray: {
|
|
569
|
+
$insert: {
|
|
570
|
+
$idx: 25,
|
|
571
|
+
$value: {
|
|
572
|
+
name: 'match ' + i,
|
|
573
|
+
value: i,
|
|
574
|
+
status: i < 5 ? 100 : 300,
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
},
|
|
578
|
+
})
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
// in the case of the `items` type being 'number'
|
|
582
|
+
client.set({
|
|
583
|
+
$id: 'ar542875421',
|
|
584
|
+
mynumberarray: {
|
|
585
|
+
$insert: {
|
|
586
|
+
$idx: 21,
|
|
587
|
+
$value: 58
|
|
588
|
+
},
|
|
589
|
+
},
|
|
590
|
+
})
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
#### `$assign`: _object_
|
|
594
|
+
|
|
595
|
+
Used to change a value at a specific index of the array. Unlike `$insert`, this does not create a new node unless the index is past the size of the array. In that case it creates `null` items between the end of the array and the new item, just like `$insert`.
|
|
596
|
+
The object must have fields `$idx` and `$value`.
|
|
597
|
+
|
|
598
|
+
##### `$idx`: _integer_
|
|
599
|
+
|
|
600
|
+
Index at which to insert the item. If the index is bigger than the size of the array, `null` items get added between the last item and the `$idx`.
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
##### `$value`: _array type_
|
|
604
|
+
|
|
605
|
+
Item to insert. This must conform to the `items` type described in the schema.
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
```js
|
|
609
|
+
// in the case of the `items` type being an object with name, value, and status field
|
|
610
|
+
client.set({
|
|
611
|
+
$id: 'ar165415',
|
|
612
|
+
myobjectarray: {
|
|
613
|
+
$assing: {
|
|
614
|
+
$idx: 25,
|
|
615
|
+
$value: {
|
|
616
|
+
name: 'match ' + i,
|
|
617
|
+
value: i,
|
|
618
|
+
status: i < 5 ? 100 : 300,
|
|
619
|
+
}
|
|
620
|
+
},
|
|
621
|
+
},
|
|
622
|
+
})
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
// in the case of the `items` type being 'number'
|
|
626
|
+
client.set({
|
|
627
|
+
$id: 'ar542875421',
|
|
628
|
+
mynumberarray: {
|
|
629
|
+
$assign: {
|
|
630
|
+
$idx: 21,
|
|
631
|
+
$value: 58
|
|
632
|
+
},
|
|
633
|
+
},
|
|
634
|
+
})
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
#### `$remove`: _object_
|
|
639
|
+
|
|
640
|
+
This removes an item from the array at the specified index.
|
|
641
|
+
This object must have the `$idx` field.
|
|
642
|
+
|
|
643
|
+
```js
|
|
644
|
+
client.set({
|
|
645
|
+
$id: 'ar654984',
|
|
646
|
+
mynumberarray: {
|
|
647
|
+
$remove: {
|
|
648
|
+
$idx: 1,
|
|
649
|
+
},
|
|
650
|
+
},
|
|
651
|
+
})
|
|
652
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@based/client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"browser": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@based/get-service": "2.4.2",
|
|
32
32
|
"@based/graphql": "2.4.2",
|
|
33
|
-
"@based/types": "2.5.0",
|
|
33
|
+
"@based/types": "^2.5.0",
|
|
34
34
|
"@saulx/diff": "^1.1.3",
|
|
35
35
|
"@saulx/hash": "^1.1.0",
|
|
36
36
|
"@saulx/utils": "^2.2.1",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"concurrently": "^7.1.0",
|
|
43
43
|
"esbuild": "^0.14.29",
|
|
44
44
|
"@saulx/hash": "^1.1.0",
|
|
45
|
-
"@based/server": "^2.6.0",
|
|
46
45
|
"@saulx/selva": "^11.0.0",
|
|
47
46
|
"@saulx/utils": "^2.2.1",
|
|
48
47
|
"@saulx/selva-server": "11.0.0",
|