@eyepop.ai/eyepop 1.17.2 → 1.17.4
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.d.mts +13 -2
- package/dist/eyepop.index.d.ts +13 -2
- package/dist/eyepop.index.js +67 -0
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +67 -1
- package/dist/eyepop.index.mjs.map +1 -1
- package/dist/eyepop.min.js +1 -1
- package/dist/eyepop.min.js.LICENSE.txt +0 -19
- package/package.json +1 -1
package/dist/eyepop.index.mjs
CHANGED
|
@@ -9148,6 +9148,40 @@ var LoadFromJob = class extends AbstractJob {
|
|
|
9148
9148
|
});
|
|
9149
9149
|
}
|
|
9150
9150
|
};
|
|
9151
|
+
var LoadFromAssetUuidJob = class extends AbstractJob {
|
|
9152
|
+
constructor(assetUuid, params, getSession, client, requestLogger) {
|
|
9153
|
+
super(params, getSession, client, requestLogger);
|
|
9154
|
+
this._assetUuid = assetUuid;
|
|
9155
|
+
}
|
|
9156
|
+
get [Symbol.toStringTag]() {
|
|
9157
|
+
return "loadFromAssetUuidJob";
|
|
9158
|
+
}
|
|
9159
|
+
async startJob() {
|
|
9160
|
+
const session = await this._getSession();
|
|
9161
|
+
if (!session.baseUrl) {
|
|
9162
|
+
return Promise.reject("session.baseUrl must not ne null");
|
|
9163
|
+
}
|
|
9164
|
+
const body = {
|
|
9165
|
+
sourceType: "ASSET_UUID",
|
|
9166
|
+
assetUuid: this._assetUuid,
|
|
9167
|
+
params: this._params
|
|
9168
|
+
};
|
|
9169
|
+
const headers = {
|
|
9170
|
+
...session.authenticationHeaders(),
|
|
9171
|
+
Accept: "application/jsonl",
|
|
9172
|
+
"Content-Type": "application/json"
|
|
9173
|
+
};
|
|
9174
|
+
const patchUrl = `${session.baseUrl.replace(/\/+$/, "")}/pipelines/${session.pipelineId}/source?mode=queue&processing=sync`;
|
|
9175
|
+
return await this._client.fetch(patchUrl, {
|
|
9176
|
+
headers,
|
|
9177
|
+
method: "PATCH",
|
|
9178
|
+
body: JSON.stringify(body),
|
|
9179
|
+
signal: this._controller.signal,
|
|
9180
|
+
// @ts-ignore
|
|
9181
|
+
eyepop: { responseStreaming: true }
|
|
9182
|
+
});
|
|
9183
|
+
}
|
|
9184
|
+
};
|
|
9151
9185
|
var LoadLiveIngressJob = class extends AbstractJob {
|
|
9152
9186
|
constructor(ingressId, params, getSession, client, requestLogger) {
|
|
9153
9187
|
super(params, getSession, client, requestLogger);
|
|
@@ -9625,7 +9659,7 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
|
|
|
9625
9659
|
}
|
|
9626
9660
|
resolvePath = async (source, logger) => {
|
|
9627
9661
|
const mime = require_mime_types();
|
|
9628
|
-
const filehandle = __require("
|
|
9662
|
+
const filehandle = __require("fs/promises");
|
|
9629
9663
|
const fd = await filehandle.open(source.path, "r");
|
|
9630
9664
|
const stream = fd.createReadStream();
|
|
9631
9665
|
const iterator = nodeStreamToIterator(stream);
|
|
@@ -10355,6 +10389,8 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10355
10389
|
return this.loadFrom(source, params);
|
|
10356
10390
|
} else if (source.ingressId !== void 0) {
|
|
10357
10391
|
return this.loadLiveIngress(source, params);
|
|
10392
|
+
} else if (source.assetUuid !== void 0) {
|
|
10393
|
+
return this.loadFromAssetUuid(source, params);
|
|
10358
10394
|
} else {
|
|
10359
10395
|
return Promise.reject("unknown source type");
|
|
10360
10396
|
}
|
|
@@ -10526,6 +10562,35 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10526
10562
|
throw e;
|
|
10527
10563
|
}
|
|
10528
10564
|
}
|
|
10565
|
+
async loadFromAssetUuid(source, params) {
|
|
10566
|
+
if (!this._baseUrl || !this._pipelineId || !this._client || !this._limit) {
|
|
10567
|
+
throw new Error("endpoint not connected, use connect()");
|
|
10568
|
+
}
|
|
10569
|
+
await this._limit.acquire();
|
|
10570
|
+
try {
|
|
10571
|
+
this.updateState();
|
|
10572
|
+
const job = new LoadFromAssetUuidJob(
|
|
10573
|
+
source.assetUuid,
|
|
10574
|
+
params,
|
|
10575
|
+
async () => {
|
|
10576
|
+
return this.session();
|
|
10577
|
+
},
|
|
10578
|
+
this._client,
|
|
10579
|
+
this._requestLogger
|
|
10580
|
+
);
|
|
10581
|
+
return job.start(
|
|
10582
|
+
() => {
|
|
10583
|
+
this.jobDone(job);
|
|
10584
|
+
},
|
|
10585
|
+
(statusCode) => {
|
|
10586
|
+
this.jobStatus(job, statusCode);
|
|
10587
|
+
}
|
|
10588
|
+
);
|
|
10589
|
+
} catch (e) {
|
|
10590
|
+
this._limit.release();
|
|
10591
|
+
throw e;
|
|
10592
|
+
}
|
|
10593
|
+
}
|
|
10529
10594
|
async loadLiveIngress(source, params) {
|
|
10530
10595
|
if (!this._baseUrl || !this._pipelineId || !this._client || !this._limit) {
|
|
10531
10596
|
throw new Error("endpoint not connected, use connect()");
|
|
@@ -11724,6 +11789,7 @@ export {
|
|
|
11724
11789
|
EyepopLineDecoder,
|
|
11725
11790
|
ForwardOperatorType,
|
|
11726
11791
|
InferenceType,
|
|
11792
|
+
LoadFromAssetUuidJob,
|
|
11727
11793
|
LoadFromJob,
|
|
11728
11794
|
LoadLiveIngressJob,
|
|
11729
11795
|
ModelExportStatus,
|