@eyepop.ai/eyepop 1.6.1 → 1.6.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/dist/eyepop.index.d.mts +20 -0
- package/dist/eyepop.index.d.ts +20 -0
- package/dist/eyepop.index.js +89 -0
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +89 -0
- package/dist/eyepop.index.mjs.map +1 -1
- package/dist/eyepop.min.js +1 -1
- package/package.json +1 -1
package/dist/eyepop.index.mjs
CHANGED
|
@@ -10210,6 +10210,95 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10210
10210
|
this._pipeline.pop = pop;
|
|
10211
10211
|
}
|
|
10212
10212
|
}
|
|
10213
|
+
/**
|
|
10214
|
+
* @deprecated use pop() instead
|
|
10215
|
+
*/
|
|
10216
|
+
popComp() {
|
|
10217
|
+
if (this._pipeline) {
|
|
10218
|
+
return this._pipeline.inferPipeline ?? null;
|
|
10219
|
+
} else {
|
|
10220
|
+
return null;
|
|
10221
|
+
}
|
|
10222
|
+
}
|
|
10223
|
+
/**
|
|
10224
|
+
* @deprecated use changePop() instead
|
|
10225
|
+
*/
|
|
10226
|
+
async changePopComp(popComp, modelRefs = []) {
|
|
10227
|
+
const client = this._client;
|
|
10228
|
+
const baseUrl = this._baseUrl;
|
|
10229
|
+
if (!baseUrl || !client) {
|
|
10230
|
+
return Promise.reject("endpoint not connected, use connect() before changePopComp()");
|
|
10231
|
+
}
|
|
10232
|
+
const body = {
|
|
10233
|
+
"pipeline": popComp,
|
|
10234
|
+
"modelRefs": modelRefs
|
|
10235
|
+
};
|
|
10236
|
+
let response = await this.fetchWithRetry(async () => {
|
|
10237
|
+
const session = await this.session();
|
|
10238
|
+
let headers = {
|
|
10239
|
+
"Authorization": `Bearer ${session.accessToken}`,
|
|
10240
|
+
"Content-Type": "application/json"
|
|
10241
|
+
};
|
|
10242
|
+
const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/inferencePipeline`;
|
|
10243
|
+
return client.fetch(patch_url, {
|
|
10244
|
+
method: "PATCH",
|
|
10245
|
+
body: JSON.stringify(body),
|
|
10246
|
+
headers
|
|
10247
|
+
});
|
|
10248
|
+
});
|
|
10249
|
+
if (response.status != 204) {
|
|
10250
|
+
const message = await response.text();
|
|
10251
|
+
console.error(message);
|
|
10252
|
+
return Promise.reject(`Unexpected status ${response.status}: ${message}`);
|
|
10253
|
+
}
|
|
10254
|
+
if (this._pipeline) {
|
|
10255
|
+
this._pipeline.inferPipeline = popComp;
|
|
10256
|
+
this._pipeline.modelRefs = modelRefs;
|
|
10257
|
+
}
|
|
10258
|
+
}
|
|
10259
|
+
/**
|
|
10260
|
+
* @deprecated use pop() instead
|
|
10261
|
+
*/
|
|
10262
|
+
postTransform() {
|
|
10263
|
+
if (this._pipeline) {
|
|
10264
|
+
return this._pipeline.postTransform;
|
|
10265
|
+
} else {
|
|
10266
|
+
return null;
|
|
10267
|
+
}
|
|
10268
|
+
}
|
|
10269
|
+
/**
|
|
10270
|
+
* @deprecated use changePop() instead
|
|
10271
|
+
*/
|
|
10272
|
+
async changePostTransform(postTransform) {
|
|
10273
|
+
const client = this._client;
|
|
10274
|
+
const baseUrl = this._baseUrl;
|
|
10275
|
+
if (!baseUrl || !client) {
|
|
10276
|
+
return Promise.reject("endpoint not connected, use connect() before changePopComp()");
|
|
10277
|
+
}
|
|
10278
|
+
const body = {
|
|
10279
|
+
"transform": postTransform
|
|
10280
|
+
};
|
|
10281
|
+
let response = await this.fetchWithRetry(async () => {
|
|
10282
|
+
const session = await this.session();
|
|
10283
|
+
let headers = {
|
|
10284
|
+
"Authorization": `Bearer ${session.accessToken}`,
|
|
10285
|
+
"Content-Type": "application/json"
|
|
10286
|
+
};
|
|
10287
|
+
const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/postTransform`;
|
|
10288
|
+
return client.fetch(patch_url, {
|
|
10289
|
+
method: "PATCH",
|
|
10290
|
+
body: JSON.stringify(body),
|
|
10291
|
+
headers
|
|
10292
|
+
});
|
|
10293
|
+
});
|
|
10294
|
+
if (response.status != 204) {
|
|
10295
|
+
const message = await response.text();
|
|
10296
|
+
return Promise.reject(`Unexpected status ${response.status}: ${message}`);
|
|
10297
|
+
}
|
|
10298
|
+
if (this._pipeline) {
|
|
10299
|
+
this._pipeline.postTransform = postTransform;
|
|
10300
|
+
}
|
|
10301
|
+
}
|
|
10213
10302
|
popId() {
|
|
10214
10303
|
return this.options().popId || null;
|
|
10215
10304
|
}
|