@eyepop.ai/eyepop 1.11.6 → 1.12.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/eyepop.index.mjs
CHANGED
|
@@ -8925,8 +8925,9 @@ var UploadJob = class extends AbstractJob {
|
|
|
8925
8925
|
const params = JSON.stringify(this._params);
|
|
8926
8926
|
const paramBlob = new Blob([params], { type: "application/json" });
|
|
8927
8927
|
const formData = new FormData();
|
|
8928
|
+
const fileBlob = await new Response(this._uploadStream).blob();
|
|
8928
8929
|
formData.append("params", paramBlob);
|
|
8929
|
-
formData.append("file",
|
|
8930
|
+
formData.append("file", fileBlob);
|
|
8930
8931
|
const headers = {
|
|
8931
8932
|
...session.authenticationHeaders(),
|
|
8932
8933
|
Accept: "application/jsonl"
|
|
@@ -8995,8 +8996,9 @@ var UploadJob = class extends AbstractJob {
|
|
|
8995
8996
|
const params = JSON.stringify(this._params);
|
|
8996
8997
|
const paramBlob = new Blob([params], { type: "application/json" });
|
|
8997
8998
|
const formData = new FormData();
|
|
8999
|
+
const fileBlob = await new Response(this._uploadStream).blob();
|
|
8998
9000
|
formData.append("params", paramBlob);
|
|
8999
|
-
formData.append("file",
|
|
9001
|
+
formData.append("file", fileBlob);
|
|
9000
9002
|
const headers = {
|
|
9001
9003
|
...session.authenticationHeaders(),
|
|
9002
9004
|
Accept: "application/jsonl"
|
|
@@ -9578,7 +9580,6 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
|
|
|
9578
9580
|
}
|
|
9579
9581
|
}
|
|
9580
9582
|
createHttpClient = async () => {
|
|
9581
|
-
console.debug("EyePop: creating HttpClient in browser");
|
|
9582
9583
|
return new BrowserHttpClient();
|
|
9583
9584
|
};
|
|
9584
9585
|
} else if (typeof navigator !== "undefined" && navigator.product === "ReactNative") {
|
|
@@ -9594,7 +9595,6 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
|
|
|
9594
9595
|
}
|
|
9595
9596
|
}
|
|
9596
9597
|
createHttpClient = async () => {
|
|
9597
|
-
console.debug("EyePop: creating HttpClient in ReactNative");
|
|
9598
9598
|
return new ReactNativeHttpClient();
|
|
9599
9599
|
};
|
|
9600
9600
|
} else {
|
|
@@ -9612,7 +9612,6 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
|
|
|
9612
9612
|
}
|
|
9613
9613
|
}
|
|
9614
9614
|
createHttpClient = async () => {
|
|
9615
|
-
console.debug("EyePop: creating HttpClient with undici agent in Node");
|
|
9616
9615
|
const undici = __require("undici");
|
|
9617
9616
|
const agent = new undici.Agent({
|
|
9618
9617
|
keepAliveTimeout: 1e4,
|
|
@@ -10267,7 +10266,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10267
10266
|
);
|
|
10268
10267
|
return whep.start();
|
|
10269
10268
|
}
|
|
10270
|
-
async process(source, params
|
|
10269
|
+
async process(source, params) {
|
|
10271
10270
|
if (source.file !== void 0) {
|
|
10272
10271
|
return this.uploadFile(source, params);
|
|
10273
10272
|
} else if (source.stream !== void 0) {
|
|
@@ -10321,7 +10320,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10321
10320
|
try {
|
|
10322
10321
|
this.updateState();
|
|
10323
10322
|
const job = new UploadJob(
|
|
10324
|
-
source.file,
|
|
10323
|
+
source.file.stream(),
|
|
10325
10324
|
source.file.type,
|
|
10326
10325
|
params,
|
|
10327
10326
|
async () => {
|