this.me 3.0.24 → 3.0.25

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class o{constructor(t="http://localhost:7777/graphql"){this.endpoint=t,this.state={status:{active:!1,error:!1,loading:!0,data:null},listUs:[]},this.subscribers=new Set,this.socket=null}async status(){const t=`
1
+ "use strict";class o{constructor(t="http://localhost:7777/graphql"){this.endpoint=t,this.state={status:{active:!1,error:!1,loading:!0,data:null},listUs:[]},this.subscribers=new Set,this.socket=null}async status(){const t=`
2
2
  query {
3
3
  monadStatus {
4
4
  active
@@ -27,8 +27,8 @@
27
27
  timestamp
28
28
  }
29
29
  }
30
- `;try{return(await this.#e(r,{username:t,password:s,filter:e})).get||[]}catch{return[]}}async#t(t,s,e,r,a,n=null){const c=`
30
+ `;try{return(await this.#e(r,{username:t,password:s,filter:e})).get||[]}catch{return[]}}async#t(t,s,e,r,n,a=null){const c=`
31
31
  mutation($username: String!, $password: String!, $key: String!, $value: String!, $context_id: String) {
32
32
  ${t}(username: $username, password: $password, key: $key, value: $value, context_id: $context_id)
33
33
  }
34
- `;try{return!!(await this.#e(c,{username:s,password:e,key:r,value:a,context_id:n}))[t]}catch{return!1}}async be(t,s,e,r,a=null){return this.#t("be",t,s,e,r,a)}async have(t,s,e,r,a=null){return this.#t("have",t,s,e,r,a)}async do(t,s,e,r,a=null){return this.#t("do",t,s,e,r,a)}async at(t,s,e,r,a=null){return this.#t("at",t,s,e,r,a)}async relate(t,s,e,r,a=null){return this.#t("relate",t,s,e,r,a)}async react(t,s,e,r,a=null){return this.#t("react",t,s,e,r,a)}async communicate(t,s,e,r,a=null){return this.#t("communicate",t,s,e,r,a)}setEndpoint(t){t.trim()&&(this.endpoint=t)}getState(){return this.state}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}#s(t){this.state={...this.state,...t},this.subscribers.forEach(s=>s(this.state))}async#e(t,s={}){const e=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:t,variables:s})});if(!e.ok)throw new Error(`GraphQL error: ${e.status}`);const{data:r,errors:a}=await e.json();if(a)throw new Error(a.map(n=>n.message).join(", "));return r}}const l=new o,i=new Proxy(l,{get(u,t,s){const e=Reflect.get(u,t,s);return typeof e!="function"?e:(...r)=>{const a=e.apply(u,r);return a instanceof Promise&&a.then(n=>console.log(`[this.me] ${String(t)} ✓`,n)).catch(n=>console.error(`[this.me] ${String(t)} ✗`,n)),a}}});typeof window<"u"&&(window.me=i,i.help=()=>console.table(Object.getOwnPropertyNames(o.prototype)));exports.default=i;exports.me=i;
34
+ `;try{return!!(await this.#e(c,{username:s,password:e,key:r,value:n,context_id:a}))[t]}catch{return!1}}async be(t,s,e,r,n=null){return this.#t("be",t,s,e,r,n)}async have(t,s,e,r,n=null){return this.#t("have",t,s,e,r,n)}async do(t,s,e,r,n=null){return this.#t("do",t,s,e,r,n)}async at(t,s,e,r,n=null){return this.#t("at",t,s,e,r,n)}async relate(t,s,e,r,n=null){return this.#t("relate",t,s,e,r,n)}async react(t,s,e,r,n=null){return this.#t("react",t,s,e,r,n)}async communicate(t,s,e,r,n=null){return this.#t("communicate",t,s,e,r,n)}setEndpoint(t){t.trim()&&(this.endpoint=t)}getState(){return this.state}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}#s(t){this.state={...this.state,...t},this.subscribers.forEach(s=>s(this.state))}async#e(t,s={}){const e=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:t,variables:s})});if(!e.ok)throw new Error(`GraphQL error: ${e.status}`);const{data:r,errors:n}=await e.json();if(n)throw new Error(n.map(a=>a.message).join(", "));return r}}const l=new o,u=new Proxy(l,{get(i,t,s){const e=Reflect.get(i,t,s);return typeof e!="function"?e:(...r)=>{const n=e.apply(i,r);return n instanceof Promise&&n.then(a=>console.log(`[this.me] ${String(t)} ✓`,a)).catch(a=>console.error(`[this.me] ${String(t)} ✗`,a)),n}}});typeof window<"u"&&(window.me=u,u.help=()=>console.table(Object.getOwnPropertyNames(o.prototype)));module.exports=u;
@@ -137,6 +137,5 @@ const l = new o(), u = new Proxy(l, {
137
137
  });
138
138
  typeof window < "u" && (window.me = u, u.help = () => console.table(Object.getOwnPropertyNames(o.prototype)));
139
139
  export {
140
- u as default,
141
- u as me
140
+ u as default
142
141
  };
@@ -1,4 +1,4 @@
1
- (function(a,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(a=typeof globalThis<"u"?globalThis:a||self,u(a.Me={}))})(this,(function(a){"use strict";class u{constructor(t="http://localhost:7777/graphql"){this.endpoint=t,this.state={status:{active:!1,error:!1,loading:!0,data:null},listUs:[]},this.subscribers=new Set,this.socket=null}async status(){const t=`
1
+ (function(i,u){typeof exports=="object"&&typeof module<"u"?module.exports=u():typeof define=="function"&&define.amd?define(u):(i=typeof globalThis<"u"?globalThis:i||self,i.Me=u())})(this,(function(){"use strict";class i{constructor(t="http://localhost:7777/graphql"){this.endpoint=t,this.state={status:{active:!1,error:!1,loading:!0,data:null},listUs:[]},this.subscribers=new Set,this.socket=null}async status(){const t=`
2
2
  query {
3
3
  monadStatus {
4
4
  active
@@ -27,8 +27,8 @@
27
27
  timestamp
28
28
  }
29
29
  }
30
- `;try{return(await this.#e(n,{username:t,password:s,filter:e})).get||[]}catch{return[]}}async#t(t,s,e,n,r,i=null){const d=`
30
+ `;try{return(await this.#e(n,{username:t,password:s,filter:e})).get||[]}catch{return[]}}async#t(t,s,e,n,r,a=null){const l=`
31
31
  mutation($username: String!, $password: String!, $key: String!, $value: String!, $context_id: String) {
32
32
  ${t}(username: $username, password: $password, key: $key, value: $value, context_id: $context_id)
33
33
  }
34
- `;try{return!!(await this.#e(d,{username:s,password:e,key:n,value:r,context_id:i}))[t]}catch{return!1}}async be(t,s,e,n,r=null){return this.#t("be",t,s,e,n,r)}async have(t,s,e,n,r=null){return this.#t("have",t,s,e,n,r)}async do(t,s,e,n,r=null){return this.#t("do",t,s,e,n,r)}async at(t,s,e,n,r=null){return this.#t("at",t,s,e,n,r)}async relate(t,s,e,n,r=null){return this.#t("relate",t,s,e,n,r)}async react(t,s,e,n,r=null){return this.#t("react",t,s,e,n,r)}async communicate(t,s,e,n,r=null){return this.#t("communicate",t,s,e,n,r)}setEndpoint(t){t.trim()&&(this.endpoint=t)}getState(){return this.state}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}#s(t){this.state={...this.state,...t},this.subscribers.forEach(s=>s(this.state))}async#e(t,s={}){const e=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:t,variables:s})});if(!e.ok)throw new Error(`GraphQL error: ${e.status}`);const{data:n,errors:r}=await e.json();if(r)throw new Error(r.map(i=>i.message).join(", "));return n}}const l=new u,o=new Proxy(l,{get(c,t,s){const e=Reflect.get(c,t,s);return typeof e!="function"?e:(...n)=>{const r=e.apply(c,n);return r instanceof Promise&&r.then(i=>console.log(`[this.me] ${String(t)} ✓`,i)).catch(i=>console.error(`[this.me] ${String(t)} ✗`,i)),r}}});typeof window<"u"&&(window.me=o,o.help=()=>console.table(Object.getOwnPropertyNames(u.prototype))),a.default=o,a.me=o,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
34
+ `;try{return!!(await this.#e(l,{username:s,password:e,key:n,value:r,context_id:a}))[t]}catch{return!1}}async be(t,s,e,n,r=null){return this.#t("be",t,s,e,n,r)}async have(t,s,e,n,r=null){return this.#t("have",t,s,e,n,r)}async do(t,s,e,n,r=null){return this.#t("do",t,s,e,n,r)}async at(t,s,e,n,r=null){return this.#t("at",t,s,e,n,r)}async relate(t,s,e,n,r=null){return this.#t("relate",t,s,e,n,r)}async react(t,s,e,n,r=null){return this.#t("react",t,s,e,n,r)}async communicate(t,s,e,n,r=null){return this.#t("communicate",t,s,e,n,r)}setEndpoint(t){t.trim()&&(this.endpoint=t)}getState(){return this.state}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}#s(t){this.state={...this.state,...t},this.subscribers.forEach(s=>s(this.state))}async#e(t,s={}){const e=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:t,variables:s})});if(!e.ok)throw new Error(`GraphQL error: ${e.status}`);const{data:n,errors:r}=await e.json();if(r)throw new Error(r.map(a=>a.message).join(", "));return n}}const u=new i,o=new Proxy(u,{get(c,t,s){const e=Reflect.get(c,t,s);return typeof e!="function"?e:(...n)=>{const r=e.apply(c,n);return r instanceof Promise&&r.then(a=>console.log(`[this.me] ${String(t)} ✓`,a)).catch(a=>console.error(`[this.me] ${String(t)} ✗`,a)),r}}});return typeof window<"u"&&(window.me=o,o.help=()=>console.table(Object.getOwnPropertyNames(i.prototype))),o}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "this.me",
3
- "version": "3.0.24",
3
+ "version": "3.0.25",
4
4
  "description": ".me is your identity trust through cryptographic signatures.",
5
5
  "main": "dist/me.cjs.js",
6
6
  "module": "dist/me.es.js",