@llamaindex/cloud
Advanced tools
Comparing version 2.0.12 to 2.0.13
{ | ||
"name": "@llamaindex/cloud", | ||
"version": "2.0.12", | ||
"version": "2.0.13", | ||
"type": "module", | ||
@@ -48,11 +48,11 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@hey-api/client-fetch": "^0.4.2", | ||
"@hey-api/openapi-ts": "^0.54.3", | ||
"@hey-api/client-fetch": "^0.4.4", | ||
"@hey-api/openapi-ts": "^0.56.0", | ||
"bunchee": "5.6.1", | ||
"@llamaindex/core": "0.4.12", | ||
"@llamaindex/env": "0.1.20" | ||
"@llamaindex/core": "0.4.13", | ||
"@llamaindex/env": "0.1.21" | ||
}, | ||
"peerDependencies": { | ||
"@llamaindex/core": "0.4.12", | ||
"@llamaindex/env": "0.1.20" | ||
"@llamaindex/core": "0.4.13", | ||
"@llamaindex/env": "0.1.21" | ||
}, | ||
@@ -59,0 +59,0 @@ "scripts": { |
@@ -5,8 +5,8 @@ import { FileReader, Document } from '@llamaindex/core/schema'; | ||
var T = /\{[^{}]+\}/g, h = ({ allowReserved: n, name: i, value: e })=>{ | ||
var T = /\{[^{}]+\}/g, h = ({ allowReserved: i, name: n, value: e })=>{ | ||
if (e == null) return ""; | ||
if (typeof e == "object") throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these."); | ||
return `${i}=${n ? e : encodeURIComponent(e)}`; | ||
}, U = (n)=>{ | ||
switch(n){ | ||
return `${n}=${i ? e : encodeURIComponent(e)}`; | ||
}, U = (i)=>{ | ||
switch(i){ | ||
case "label": | ||
@@ -21,4 +21,4 @@ return "."; | ||
} | ||
}, $ = (n)=>{ | ||
switch(n){ | ||
}, $ = (i)=>{ | ||
switch(i){ | ||
case "form": | ||
@@ -33,4 +33,4 @@ return ","; | ||
} | ||
}, D = (n)=>{ | ||
switch(n){ | ||
}, D = (i)=>{ | ||
switch(i){ | ||
case "label": | ||
@@ -45,5 +45,5 @@ return "."; | ||
} | ||
}, j = ({ allowReserved: n, explode: i, name: e, style: a, value: o })=>{ | ||
if (!i) { | ||
let r = (n ? o : o.map((c)=>encodeURIComponent(c))).join($(a)); | ||
}, j = ({ allowReserved: i, explode: n, name: e, style: a, value: o })=>{ | ||
if (!n) { | ||
let r = (i ? o : o.map((c)=>encodeURIComponent(c))).join($(a)); | ||
switch(a){ | ||
@@ -60,4 +60,4 @@ case "label": | ||
} | ||
let s = U(a), t = o.map((r)=>a === "label" || a === "simple" ? n ? r : encodeURIComponent(r) : h({ | ||
allowReserved: n, | ||
let s = U(a), t = o.map((r)=>a === "label" || a === "simple" ? i ? r : encodeURIComponent(r) : h({ | ||
allowReserved: i, | ||
name: e, | ||
@@ -67,5 +67,5 @@ value: r | ||
return a === "label" || a === "matrix" ? s + t : t; | ||
}, C = ({ allowReserved: n, explode: i, name: e, style: a, value: o })=>{ | ||
}, C = ({ allowReserved: i, explode: n, name: e, style: a, value: o })=>{ | ||
if (o instanceof Date) return `${e}=${o.toISOString()}`; | ||
if (a !== "deepObject" && !i) { | ||
if (a !== "deepObject" && !n) { | ||
let r = []; | ||
@@ -76,3 +76,3 @@ Object.entries(o).forEach(([u, l])=>{ | ||
u, | ||
n ? l : encodeURIComponent(l) | ||
i ? l : encodeURIComponent(l) | ||
]; | ||
@@ -93,3 +93,3 @@ }); | ||
let s = D(a), t = Object.entries(o).map(([r, c])=>h({ | ||
allowReserved: n, | ||
allowReserved: i, | ||
name: a === "deepObject" ? `${e}[${r}]` : r, | ||
@@ -99,8 +99,8 @@ value: c | ||
return a === "label" || a === "matrix" ? s + t : t; | ||
}, _ = ({ path: n, url: i })=>{ | ||
let e = i, a = i.match(T); | ||
}, _ = ({ path: i, url: n })=>{ | ||
let e = n, a = n.match(T); | ||
if (a) for (let o of a){ | ||
let s = !1, t = o.substring(1, o.length - 1), r = "simple"; | ||
t.endsWith("*") && (s = !0, t = t.substring(0, t.length - 1)), t.startsWith(".") ? (t = t.substring(1), r = "label") : t.startsWith(";") && (t = t.substring(1), r = "matrix"); | ||
let c = n[t]; | ||
let c = i[t]; | ||
if (c == null) continue; | ||
@@ -136,3 +136,3 @@ if (Array.isArray(c)) { | ||
return e; | ||
}, b = ({ allowReserved: n, array: i, object: e } = {})=>(o)=>{ | ||
}, b = ({ allowReserved: i, array: n, object: e } = {})=>(o)=>{ | ||
let s = []; | ||
@@ -146,3 +146,3 @@ if (o && typeof o == "object") for(let t in o){ | ||
j({ | ||
allowReserved: n, | ||
allowReserved: i, | ||
explode: !0, | ||
@@ -152,3 +152,3 @@ name: t, | ||
value: r, | ||
...i | ||
...n | ||
}) | ||
@@ -162,3 +162,3 @@ ]; | ||
C({ | ||
allowReserved: n, | ||
allowReserved: i, | ||
explode: !0, | ||
@@ -176,3 +176,3 @@ name: t, | ||
h({ | ||
allowReserved: n, | ||
allowReserved: i, | ||
name: t, | ||
@@ -185,18 +185,18 @@ value: r | ||
return s.join("&"); | ||
}, A = (n)=>{ | ||
if (n) { | ||
if (n.startsWith("application/json") || n.endsWith("+json")) return "json"; | ||
if (n === "multipart/form-data") return "formData"; | ||
if ([ | ||
"application/", | ||
"audio/", | ||
"image/", | ||
"video/" | ||
].some((i)=>n.startsWith(i))) return "blob"; | ||
if (n.startsWith("text/")) return "text"; | ||
} | ||
}, w = ({ baseUrl: n, path: i, query: e, querySerializer: a, url: o })=>{ | ||
let s = o.startsWith("/") ? o : `/${o}`, t = n + s; | ||
i && (t = _({ | ||
path: i, | ||
}, A = (i)=>{ | ||
if (!i) return; | ||
let n = i.split(";")[0].trim(); | ||
if (n.startsWith("application/json") || n.endsWith("+json")) return "json"; | ||
if (n === "multipart/form-data") return "formData"; | ||
if ([ | ||
"application/", | ||
"audio/", | ||
"image/", | ||
"video/" | ||
].some((e)=>n.startsWith(e))) return "blob"; | ||
if (n.startsWith("text/")) return "text"; | ||
}, w = ({ baseUrl: i, path: n, query: e, querySerializer: a, url: o })=>{ | ||
let s = o.startsWith("/") ? o : `/${o}`, t = i + s; | ||
n && (t = _({ | ||
path: n, | ||
url: t | ||
@@ -206,18 +206,18 @@ })); | ||
return r.startsWith("?") && (r = r.substring(1)), r && (t += `?${r}`), t; | ||
}, R = (n, i)=>{ | ||
}, R = (i, n)=>{ | ||
let e = { | ||
...n, | ||
...i | ||
...i, | ||
...n | ||
}; | ||
return e.baseUrl?.endsWith("/") && (e.baseUrl = e.baseUrl.substring(0, e.baseUrl.length - 1)), e.headers = O(n.headers, i.headers), e; | ||
}, O = (...n)=>{ | ||
let i = new Headers; | ||
for (let e of n){ | ||
return e.baseUrl?.endsWith("/") && (e.baseUrl = e.baseUrl.substring(0, e.baseUrl.length - 1)), e.headers = O(i.headers, n.headers), e; | ||
}, O = (...i)=>{ | ||
let n = new Headers; | ||
for (let e of i){ | ||
if (!e || typeof e != "object") continue; | ||
let a = e instanceof Headers ? e.entries() : Object.entries(e); | ||
for (let [o, s] of a)if (s === null) i.delete(o); | ||
else if (Array.isArray(s)) for (let t of s)i.append(o, t); | ||
else s !== void 0 && i.set(o, typeof s == "object" ? JSON.stringify(s) : s); | ||
for (let [o, s] of a)if (s === null) n.delete(o); | ||
else if (Array.isArray(s)) for (let t of s)n.append(o, t); | ||
else s !== void 0 && n.set(o, typeof s == "object" ? JSON.stringify(s) : s); | ||
} | ||
return i; | ||
return n; | ||
}, y = class { | ||
@@ -230,7 +230,7 @@ constructor(){ | ||
} | ||
exists(i) { | ||
return this._fns.indexOf(i) !== -1; | ||
exists(n) { | ||
return this._fns.indexOf(n) !== -1; | ||
} | ||
eject(i) { | ||
let e = this._fns.indexOf(i); | ||
eject(n) { | ||
let e = this._fns.indexOf(n); | ||
e !== -1 && (this._fns = [ | ||
@@ -241,6 +241,6 @@ ...this._fns.slice(0, e), | ||
} | ||
use(i) { | ||
use(n) { | ||
this._fns = [ | ||
...this._fns, | ||
i | ||
n | ||
]; | ||
@@ -253,3 +253,3 @@ } | ||
}), E = { | ||
bodySerializer: (n)=>JSON.stringify(n) | ||
bodySerializer: (i)=>JSON.stringify(i) | ||
}, W = b({ | ||
@@ -267,3 +267,3 @@ allowReserved: !1, | ||
"Content-Type": "application/json" | ||
}, x = (n = {})=>({ | ||
}, x = (i = {})=>({ | ||
...E, | ||
@@ -275,12 +275,12 @@ baseUrl: "", | ||
querySerializer: W, | ||
...n | ||
...i | ||
}); | ||
var J = (n = {})=>{ | ||
let i = R(x(), n), e = ()=>({ | ||
...i | ||
}), a = (t)=>(i = R(i, t), e()), o = P(), s = async (t)=>{ | ||
var J = (i = {})=>{ | ||
let n = R(x(), i), e = ()=>({ | ||
...n | ||
}), a = (t)=>(n = R(n, t), e()), o = P(), s = async (t)=>{ | ||
let r = { | ||
...i, | ||
...n, | ||
...t, | ||
headers: O(i.headers, t.headers) | ||
headers: O(n.headers, t.headers) | ||
}; | ||
@@ -287,0 +287,0 @@ r.body && r.bodySerializer && (r.body = r.bodySerializer(r.body)), r.body || r.headers.delete("Content-Type"); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
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
2349181