@gradio/client 0.12.1 → 0.12.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/CHANGELOG.md +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -18
- package/dist/upload.d.ts +0 -1
- package/dist/upload.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -6
- package/src/upload.ts +0 -16
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# @gradio/client
|
2
2
|
|
3
|
+
## 0.12.2
|
4
|
+
|
5
|
+
### Features
|
6
|
+
|
7
|
+
- [#7528](https://github.com/gradio-app/gradio/pull/7528) [`eda33b3`](https://github.com/gradio-app/gradio/commit/eda33b3763897a542acf298e523fa493dc655aee) - Refactors `get_fetchable_url_or_file()` to remove it from the frontend. Thanks [@abidlabs](https://github.com/abidlabs)!
|
8
|
+
- [#7340](https://github.com/gradio-app/gradio/pull/7340) [`4b0d589`](https://github.com/gradio-app/gradio/commit/4b0d58933057432758a54169a360eb352903d6b4) - chore(deps): update all non-major dependencies. Thanks [@renovate](https://github.com/apps/renovate)!
|
9
|
+
|
3
10
|
## 0.12.1
|
4
11
|
|
5
12
|
### Fixes
|
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
export { client, post_data, upload_files, duplicate, api_factory } from "./client.js";
|
2
2
|
export type { SpaceStatus } from "./types.js";
|
3
|
-
export { FileData, upload,
|
3
|
+
export { FileData, upload, prepare_files } from "./upload.js";
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,SAAS,EACT,YAAY,EACZ,SAAS,EACT,WAAW,EACX,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,SAAS,EACT,YAAY,EACZ,SAAS,EACT,WAAW,EACX,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
@@ -216,23 +216,6 @@ function apply_diff(obj, diff) {
|
|
216
216
|
});
|
217
217
|
return obj;
|
218
218
|
}
|
219
|
-
function is_url(str) {
|
220
|
-
try {
|
221
|
-
const url = new URL(str);
|
222
|
-
return url.protocol === "http:" || url.protocol === "https:";
|
223
|
-
} catch {
|
224
|
-
return false;
|
225
|
-
}
|
226
|
-
}
|
227
|
-
function get_fetchable_url_or_file(path, server_url, proxy_url) {
|
228
|
-
if (path == null) {
|
229
|
-
return proxy_url ? `/proxy=${proxy_url}file=` : `${server_url}/file=`;
|
230
|
-
}
|
231
|
-
if (is_url(path)) {
|
232
|
-
return path;
|
233
|
-
}
|
234
|
-
return proxy_url ? `/proxy=${proxy_url}file=${path}` : `${server_url}/file=${path}`;
|
235
|
-
}
|
236
219
|
async function upload(file_data, root, upload_id, upload_fn = upload_files) {
|
237
220
|
let files = (Array.isArray(file_data) ? file_data : [file_data]).map(
|
238
221
|
(file_data2) => file_data2.blob
|
@@ -1593,7 +1576,6 @@ export {
|
|
1593
1576
|
api_factory,
|
1594
1577
|
client,
|
1595
1578
|
duplicate,
|
1596
|
-
get_fetchable_url_or_file,
|
1597
1579
|
post_data,
|
1598
1580
|
prepare_files,
|
1599
1581
|
upload,
|
package/dist/upload.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import { upload_files } from "./client";
|
2
|
-
export declare function get_fetchable_url_or_file(path: string | null, server_url: string, proxy_url: string | null): string;
|
3
2
|
export declare function upload(file_data: FileData[], root: string, upload_id?: string, upload_fn?: typeof upload_files): Promise<(FileData | null)[] | null>;
|
4
3
|
export declare function prepare_files(files: File[], is_stream?: boolean): Promise<FileData[]>;
|
5
4
|
export declare class FileData {
|
package/dist/upload.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAWxC,
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAWxC,wBAAsB,MAAM,CAC3B,SAAS,EAAE,QAAQ,EAAE,EACrB,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,GAAE,OAAO,YAA2B,GAC3C,OAAO,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,CA2BrC;AAED,wBAAsB,aAAa,CAClC,KAAK,EAAE,IAAI,EAAE,EACb,SAAS,CAAC,EAAE,OAAO,GACjB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAYrB;AAED,qBAAa,QAAQ;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAEN,EACX,IAAI,EACJ,GAAG,EACH,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,SAAS,EACT,QAAQ,EACR,EAAE;QACF,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,IAAI,CAAC;QACZ,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB;CAUD"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@gradio/client",
|
3
|
-
"version": "0.12.
|
3
|
+
"version": "0.12.2",
|
4
4
|
"description": "Gradio API client",
|
5
5
|
"type": "module",
|
6
6
|
"main": "dist/index.js",
|
@@ -19,7 +19,7 @@
|
|
19
19
|
},
|
20
20
|
"devDependencies": {
|
21
21
|
"@types/ws": "^8.5.4",
|
22
|
-
"esbuild": "^0.
|
22
|
+
"esbuild": "^0.20.0"
|
23
23
|
},
|
24
24
|
"engines": {
|
25
25
|
"node": ">=18.0.0"
|
package/src/index.ts
CHANGED
@@ -6,9 +6,4 @@ export {
|
|
6
6
|
api_factory
|
7
7
|
} from "./client.js";
|
8
8
|
export type { SpaceStatus } from "./types.js";
|
9
|
-
export {
|
10
|
-
FileData,
|
11
|
-
upload,
|
12
|
-
get_fetchable_url_or_file,
|
13
|
-
prepare_files
|
14
|
-
} from "./upload.js";
|
9
|
+
export { FileData, upload, prepare_files } from "./upload.js";
|
package/src/upload.ts
CHANGED
@@ -9,22 +9,6 @@ function is_url(str: string): boolean {
|
|
9
9
|
}
|
10
10
|
}
|
11
11
|
|
12
|
-
export function get_fetchable_url_or_file(
|
13
|
-
path: string | null,
|
14
|
-
server_url: string,
|
15
|
-
proxy_url: string | null
|
16
|
-
): string {
|
17
|
-
if (path == null) {
|
18
|
-
return proxy_url ? `/proxy=${proxy_url}file=` : `${server_url}/file=`;
|
19
|
-
}
|
20
|
-
if (is_url(path)) {
|
21
|
-
return path;
|
22
|
-
}
|
23
|
-
return proxy_url
|
24
|
-
? `/proxy=${proxy_url}file=${path}`
|
25
|
-
: `${server_url}/file=${path}`;
|
26
|
-
}
|
27
|
-
|
28
12
|
export async function upload(
|
29
13
|
file_data: FileData[],
|
30
14
|
root: string,
|