@tauri-apps/plugin-http 2.0.0-alpha.4 → 2.0.0-alpha.5
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-js/index.cjs +5 -5
- package/dist-js/index.js +1 -1
- package/package.json +2 -2
package/dist-js/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var core = require('@tauri-apps/api/core');
|
|
4
4
|
|
|
5
5
|
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
|
6
6
|
// SPDX-License-Identifier: Apache-2.0
|
|
@@ -51,7 +51,7 @@ async function fetch(input, init) {
|
|
|
51
51
|
const req = new Request(input, init);
|
|
52
52
|
const buffer = await req.arrayBuffer();
|
|
53
53
|
const reqData = buffer.byteLength ? Array.from(new Uint8Array(buffer)) : null;
|
|
54
|
-
const rid = await
|
|
54
|
+
const rid = await core.invoke("plugin:http|fetch", {
|
|
55
55
|
method: req.method,
|
|
56
56
|
url: req.url,
|
|
57
57
|
headers: Array.from(req.headers.entries()),
|
|
@@ -60,14 +60,14 @@ async function fetch(input, init) {
|
|
|
60
60
|
connectTimeout,
|
|
61
61
|
});
|
|
62
62
|
req.signal.addEventListener("abort", () => {
|
|
63
|
-
|
|
63
|
+
core.invoke("plugin:http|fetch_cancel", {
|
|
64
64
|
rid,
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
|
-
const { status, statusText, url, headers } = await
|
|
67
|
+
const { status, statusText, url, headers } = await core.invoke("plugin:http|fetch_send", {
|
|
68
68
|
rid,
|
|
69
69
|
});
|
|
70
|
-
const body = await
|
|
70
|
+
const body = await core.invoke("plugin:http|fetch_read_body", {
|
|
71
71
|
rid,
|
|
72
72
|
});
|
|
73
73
|
const res = new Response(new Uint8Array(body), {
|
package/dist-js/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tauri-apps/plugin-http",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.5",
|
|
4
4
|
"license": "MIT or APACHE-2.0",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Tauri Programme within The Commons Conservancy"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"LICENSE"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@tauri-apps/api": "2.0.0-alpha.
|
|
23
|
+
"@tauri-apps/api": "2.0.0-alpha.13"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "rollup -c"
|