@tnf-dev/core 1.0.1 → 1.0.3-0
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/cjs/client/http.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var R=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var
|
1
|
+
"use strict";var R=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var $=Object.prototype.hasOwnProperty;var h=t=>{throw TypeError(t)};var q=(t,e)=>{for(var s in e)R(t,s,{get:e[s],enumerable:!0})},x=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of B(e))!$.call(t,r)&&r!==s&&R(t,r,{get:()=>e[r],enumerable:!(n=l(e,r))||n.enumerable});return t};var P=t=>x(R({},"__esModule",{value:!0}),t);var c=(t,e,s)=>e.has(t)||h("Cannot "+s);var a=(t,e,s)=>(c(t,e,"read from private field"),s?s.call(t):e.get(t)),g=(t,e,s)=>e.has(t)?h("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),m=(t,e,s,n)=>(c(t,e,"write to private field"),n?n.call(t,s):e.set(t,s),s),p=(t,e,s)=>(c(t,e,"access private method"),s);var f={};q(f,{HttpClient:()=>T});module.exports=P(f);var y=t=>new URLSearchParams(Object.keys(t).reduce((e,s)=>(t[s]!==void 0&&(e[s]=`${t[s]}`),e),{})).toString();var i,o,O,u,T=class{constructor(e){g(this,o);g(this,i);m(this,i,e.baseUrl)}get baseUrl(){return a(this,i)}get(e,s){return p(this,o,u).call(this,`${a(this,i)}${e}`,s)}post(e,s,n){return p(this,o,u).call(this,`${a(this,i)}${e}`,{...n,method:"POST",body:s})}put(e,s,n){return p(this,o,u).call(this,`${a(this,i)}${e}`,{...n,method:"PUT",body:s})}patch(e,s,n={}){return p(this,o,u).call(this,`${a(this,i)}${e}`,{...n,method:"PATCH",body:s})}delete(e,s){return p(this,o,u).call(this,`${a(this,i)}${e}`,{...s,method:"DELETE"})}};i=new WeakMap,o=new WeakSet,O=async function(e,{body:s,params:n,...r}={}){let d=e;n&&(d=`${e}?${y(n||{})}`);let b={...r,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...r.headers}};return[d,b]},u=async function(e,s){let[n,r]=await p(this,o,O).call(this,e,s),d=await fetch(n,r);if(!d.ok)throw{status:"error",error_message:await d.text()};return{...await d.json(),status:"success"}};0&&(module.exports={HttpClient});
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";var R=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var
|
1
|
+
"use strict";var R=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var h=t=>{throw TypeError(t)};var $=(t,e)=>{for(var s in e)R(t,s,{get:e[s],enumerable:!0})},q=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of x(e))!B.call(t,r)&&r!==s&&R(t,r,{get:()=>e[r],enumerable:!(n=l(e,r))||n.enumerable});return t};var f=t=>q(R({},"__esModule",{value:!0}),t);var c=(t,e,s)=>e.has(t)||h("Cannot "+s);var a=(t,e,s)=>(c(t,e,"read from private field"),s?s.call(t):e.get(t)),g=(t,e,s)=>e.has(t)?h("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),m=(t,e,s,n)=>(c(t,e,"write to private field"),n?n.call(t,s):e.set(t,s),s),p=(t,e,s)=>(c(t,e,"access private method"),s);var P={};$(P,{HttpClient:()=>T});module.exports=f(P);var y=t=>new URLSearchParams(Object.keys(t).reduce((e,s)=>(t[s]!==void 0&&(e[s]=`${t[s]}`),e),{})).toString();var o,i,O,u,T=class{constructor(e){g(this,i);g(this,o);m(this,o,e.baseUrl)}get baseUrl(){return a(this,o)}get(e,s){return p(this,i,u).call(this,`${a(this,o)}${e}`,s)}post(e,s,n){return p(this,i,u).call(this,`${a(this,o)}${e}`,{...n,method:"POST",body:s})}put(e,s,n){return p(this,i,u).call(this,`${a(this,o)}${e}`,{...n,method:"PUT",body:s})}patch(e,s,n={}){return p(this,i,u).call(this,`${a(this,o)}${e}`,{...n,method:"PATCH",body:s})}delete(e,s){return p(this,i,u).call(this,`${a(this,o)}${e}`,{...s,method:"DELETE"})}};o=new WeakMap,i=new WeakSet,O=async function(e,{body:s,params:n,...r}={}){let d=e;n&&(d=`${e}?${y(n||{})}`);let b={...r,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...r.headers}};return[d,b]},u=async function(e,s){let[n,r]=await p(this,i,O).call(this,e,s),d=await fetch(n,r);if(!d.ok)throw{status:"error",error_message:await d.text()};return{...await d.json(),status:"success"}};0&&(module.exports={HttpClient});
|
package/dist/cjs/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var R=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var
|
1
|
+
"use strict";var R=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var h=t=>{throw TypeError(t)};var $=(t,e)=>{for(var s in e)R(t,s,{get:e[s],enumerable:!0})},f=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!B.call(t,r)&&r!==s&&R(t,r,{get:()=>e[r],enumerable:!(n=x(e,r))||n.enumerable});return t};var q=t=>f(R({},"__esModule",{value:!0}),t);var c=(t,e,s)=>e.has(t)||h("Cannot "+s);var a=(t,e,s)=>(c(t,e,"read from private field"),s?s.call(t):e.get(t)),g=(t,e,s)=>e.has(t)?h("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),m=(t,e,s,n)=>(c(t,e,"write to private field"),n?n.call(t,s):e.set(t,s),s),p=(t,e,s)=>(c(t,e,"access private method"),s);var P={};$(P,{HttpClient:()=>T});module.exports=q(P);var y=t=>new URLSearchParams(Object.keys(t).reduce((e,s)=>(t[s]!==void 0&&(e[s]=`${t[s]}`),e),{})).toString();var o,i,O,u,T=class{constructor(e){g(this,i);g(this,o);m(this,o,e.baseUrl)}get baseUrl(){return a(this,o)}get(e,s){return p(this,i,u).call(this,`${a(this,o)}${e}`,s)}post(e,s,n){return p(this,i,u).call(this,`${a(this,o)}${e}`,{...n,method:"POST",body:s})}put(e,s,n){return p(this,i,u).call(this,`${a(this,o)}${e}`,{...n,method:"PUT",body:s})}patch(e,s,n={}){return p(this,i,u).call(this,`${a(this,o)}${e}`,{...n,method:"PATCH",body:s})}delete(e,s){return p(this,i,u).call(this,`${a(this,o)}${e}`,{...s,method:"DELETE"})}};o=new WeakMap,i=new WeakSet,O=async function(e,{body:s,params:n,...r}={}){let d=e;n&&(d=`${e}?${y(n||{})}`);let b={...r,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...r.headers}};return[d,b]},u=async function(e,s){let[n,r]=await p(this,i,O).call(this,e,s),d=await fetch(n,r);if(!d.ok)throw{status:"error",error_message:await d.text()};return{...await d.json(),status:"success"}};0&&(module.exports={HttpClient});
|
package/dist/esm/client/http.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var
|
1
|
+
var o=r=>new URLSearchParams(Object.keys(r).reduce((e,s)=>(r[s]!==void 0&&(e[s]=`${r[s]}`),e),{})).toString();var a=class{#e;constructor(e){this.#e=e.baseUrl}get baseUrl(){return this.#e}async#t(e,{body:s,params:t,...i}={}){let n=e;t&&(n=`${e}?${o(t||{})}`);let p={...i,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...i.headers}};return[n,p]}async#s(e,s){let[t,i]=await this.#t(e,s),n=await fetch(t,i);if(!n.ok)throw{status:"error",error_message:await n.text()};return{...await n.json(),status:"success"}}get(e,s){return this.#s(`${this.#e}${e}`,s)}post(e,s,t){return this.#s(`${this.#e}${e}`,{...t,method:"POST",body:s})}put(e,s,t){return this.#s(`${this.#e}${e}`,{...t,method:"PUT",body:s})}patch(e,s,t={}){return this.#s(`${this.#e}${e}`,{...t,method:"PATCH",body:s})}delete(e,s){return this.#s(`${this.#e}${e}`,{...s,method:"DELETE"})}};export{a as HttpClient};
|
package/dist/esm/client/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var i=r=>new URLSearchParams(Object.keys(r).reduce((e,s)=>(r[s]!==void 0&&(e[s]=`${r[s]}`),e),{})).toString();var a=class{#e;constructor(e){this.#e=e.baseUrl}get baseUrl(){return this.#e}async#t(e,{body:s,params:t,...o}={}){let n=e;t&&(n=`${e}?${i(t||{})}`);let p={...o,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...o.headers}};return[n,p]}async#s(e,s){let[t,o]=await this.#t(e,s),n=await fetch(t,o);if(!n.ok)throw{status:"error",error_message:await n.text()};
|
1
|
+
var i=r=>new URLSearchParams(Object.keys(r).reduce((e,s)=>(r[s]!==void 0&&(e[s]=`${r[s]}`),e),{})).toString();var a=class{#e;constructor(e){this.#e=e.baseUrl}get baseUrl(){return this.#e}async#t(e,{body:s,params:t,...o}={}){let n=e;t&&(n=`${e}?${i(t||{})}`);let p={...o,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...o.headers}};return[n,p]}async#s(e,s){let[t,o]=await this.#t(e,s),n=await fetch(t,o);if(!n.ok)throw{status:"error",error_message:await n.text()};return{...await n.json(),status:"success"}}get(e,s){return this.#s(`${this.#e}${e}`,s)}post(e,s,t){return this.#s(`${this.#e}${e}`,{...t,method:"POST",body:s})}put(e,s,t){return this.#s(`${this.#e}${e}`,{...t,method:"PUT",body:s})}patch(e,s,t={}){return this.#s(`${this.#e}${e}`,{...t,method:"PATCH",body:s})}delete(e,s){return this.#s(`${this.#e}${e}`,{...s,method:"DELETE"})}};export{a as HttpClient};
|
package/dist/esm/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var i=r=>new URLSearchParams(Object.keys(r).reduce((e,s)=>(r[s]!==void 0&&(e[s]=`${r[s]}`),e),{})).toString();var a=class{#e;constructor(e){this.#e=e.baseUrl}get baseUrl(){return this.#e}async#t(e,{body:s,params:t,...o}={}){let n=e;t&&(n=`${e}?${i(t||{})}`);let p={...o,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...o.headers}};return[n,p]}async#s(e,s){let[t,o]=await this.#t(e,s),n=await fetch(t,o);if(!n.ok)throw{status:"error",error_message:await n.text()};
|
1
|
+
var i=r=>new URLSearchParams(Object.keys(r).reduce((e,s)=>(r[s]!==void 0&&(e[s]=`${r[s]}`),e),{})).toString();var a=class{#e;constructor(e){this.#e=e.baseUrl}get baseUrl(){return this.#e}async#t(e,{body:s,params:t,...o}={}){let n=e;t&&(n=`${e}?${i(t||{})}`);let p={...o,...s?{body:JSON.stringify(s)}:{},headers:{"Content-Type":"application/json",...o.headers}};return[n,p]}async#s(e,s){let[t,o]=await this.#t(e,s),n=await fetch(t,o);if(!n.ok)throw{status:"error",error_message:await n.text()};return{...await n.json(),status:"success"}}get(e,s){return this.#s(`${this.#e}${e}`,s)}post(e,s,t){return this.#s(`${this.#e}${e}`,{...t,method:"POST",body:s})}put(e,s,t){return this.#s(`${this.#e}${e}`,{...t,method:"PUT",body:s})}patch(e,s,t={}){return this.#s(`${this.#e}${e}`,{...t,method:"PATCH",body:s})}delete(e,s){return this.#s(`${this.#e}${e}`,{...s,method:"DELETE"})}};export{a as HttpClient};
|
package/package.json
CHANGED