mindsdb-js-sdk
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -1,1 +0,1 @@ | ||
"use strict";const l=async(e,t="https://alpha.mindsdb.com")=>{const o=require("axios");let r=require("../utils/saveData");const{email:s,password:a}=e;if(!s||!a)return{error:!0,message:"Please add email or password"};try{const i=await o.post(`${t}/cloud/login`,e),n=i.headers["set-cookie"],c=await o.get(`${t}/cloud/status`,{headers:{Cookie:n}});return r.setItem("auth",JSON.stringify(i.data)),r.setItem("requestCookie",n[4]),c.data}catch(i){console.log(i)}},u=async()=>{let e=require("../utils/saveData");try{return console.log("post",e.getItem("requestCookie")),e.getItem("requestCookie")}catch(t){console.log(t)}},d=async()=>{let e=require("../utils/saveData");const t=require("axios"),o="https://alpha.mindsdb.com",r={query:"SHOW TABLES FROM files;",context:{db:"mindsdb"}};try{const s=e.getItem("requestCookie");return(await t.post(`${o}/api/sql/query`,r,{withCredentials:!0,headers:{Cookie:s}})).data}catch(s){console.log(s)}},g=async(e="")=>{let t=require("../utils/saveData");const o=require("axios"),r="https://alpha.mindsdb.com",s={query:e,context:{db:"mindsdb"}};try{const a=t.getItem("requestCookie");return(await o.post(`${r}/api/sql/query`,s,{withCredentials:!0,headers:{Cookie:a}})).data}catch(a){console.log(a)}};var q={connect:l,getStatus:u,getFiles:d,setQuery:g};module.exports=q; | ||
"use strict";const l=async(e,t="https://alpha.mindsdb.com")=>{const o=require("axios");let r=require("../utils/saveData");const{email:s,password:a}=e;if(!s||!a)return{error:!0,message:"Please add email or password"};try{const i=await o.post(`${t}/cloud/login`,e),n=i.headers["set-cookie"],c=await o.get(`${t}/cloud/status`,{headers:{Cookie:n}});return r.setItem("auth",JSON.stringify(i.data)),r.setItem("requestCookie",n[4]),c.data}catch(i){console.log(i)}},u=async()=>{let e=require("../utils/saveData");try{return console.log("post",e.getItem("requestCookie")),e.getItem("requestCookie")}catch(t){console.log(t)}},d=async()=>{let e=require("../utils/saveData");const t=require("axios"),o="https://alpha.mindsdb.com",r={query:"SHOW TABLES FROM files;",context:{db:"mindsdb"}};try{const s=e.getItem("requestCookie");return(await t.post(`${o}/api/sql/query`,r,{withCredentials:!0,headers:{Cookie:s}})).data}catch(s){console.log(s)}},g=async(e="")=>{let t=require("../utils/saveData");const o=require("axios"),r="https://alpha.mindsdb.com",s={query:e,context:{db:"mindsdb"}};try{const a=t.getItem("requestCookie");return(await o.post(`${r}/api/sql/query`,s,{withCredentials:!0,headers:{Cookie:a}})).data}catch(a){console.log(a)}},q={connect:l,getStatus:u,getFiles:d,setQuery:g};module.exports=q; |
@@ -8,3 +8,3 @@ { | ||
"license": "MIT", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"homepage": "https://github.com/mindsdb/mindsdb_js_sdk#readme", | ||
@@ -35,2 +35,3 @@ "repository": { | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^24.0.1", | ||
"prettier": "2.6.2", | ||
@@ -37,0 +38,0 @@ "vite": "^2.9.9" |
@@ -6,2 +6,3 @@ import { connect } from './connect'; | ||
export { connect, getStatus, getFiles, setQuery }; | ||
const MindsDB = { connect, getStatus, getFiles, setQuery } | ||
export default MindsDB; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43546
8
113
3
2