@eyepop.ai/eyepop 1.9.2 → 1.11.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/README.md +152 -107
- package/dist/eyepop.index.d.mts +37 -6
- package/dist/eyepop.index.d.ts +37 -6
- package/dist/eyepop.index.js +288 -229
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +286 -229
- package/dist/eyepop.index.mjs.map +1 -1
- package/dist/eyepop.min.js +1 -1
- package/dist/eyepop.min.js.LICENSE.txt +0 -9
- package/package.json +45 -43
package/dist/eyepop.index.js
CHANGED
|
@@ -8660,6 +8660,7 @@ __export(index_exports, {
|
|
|
8660
8660
|
AnnotationType: () => AnnotationType,
|
|
8661
8661
|
ArtifactType: () => ArtifactType,
|
|
8662
8662
|
AssetStatus: () => AssetStatus,
|
|
8663
|
+
AutoAnnotateTask: () => AutoAnnotateTask,
|
|
8663
8664
|
ChangeType: () => ChangeType,
|
|
8664
8665
|
ContourType: () => ContourType,
|
|
8665
8666
|
DataEndpoint: () => DataEndpoint,
|
|
@@ -8675,6 +8676,7 @@ __export(index_exports, {
|
|
|
8675
8676
|
ModelFormat: () => ModelFormat,
|
|
8676
8677
|
ModelPrecisionType: () => ModelPrecisionType,
|
|
8677
8678
|
ModelStatus: () => ModelStatus,
|
|
8679
|
+
ModelTask: () => ModelTask,
|
|
8678
8680
|
ModelTrainingStage: () => ModelTrainingStage,
|
|
8679
8681
|
ModelType: () => ModelType,
|
|
8680
8682
|
PopComponentType: () => PopComponentType,
|
|
@@ -8815,10 +8817,7 @@ var Stream = class _Stream {
|
|
|
8815
8817
|
}
|
|
8816
8818
|
};
|
|
8817
8819
|
};
|
|
8818
|
-
return [
|
|
8819
|
-
new _Stream(() => teeIterator(left), this.controller),
|
|
8820
|
-
new _Stream(() => teeIterator(right), this.controller)
|
|
8821
|
-
];
|
|
8820
|
+
return [new _Stream(() => teeIterator(left), this.controller), new _Stream(() => teeIterator(right), this.controller)];
|
|
8822
8821
|
}
|
|
8823
8822
|
/**
|
|
8824
8823
|
* Converts this stream to a newline-separated ReadableStream of
|
|
@@ -8902,13 +8901,9 @@ var _LineDecoder = class _LineDecoder {
|
|
|
8902
8901
|
this.textDecoder ?? (this.textDecoder = new TextDecoder("utf8"));
|
|
8903
8902
|
return this.textDecoder.decode(bytes);
|
|
8904
8903
|
}
|
|
8905
|
-
throw new Error(
|
|
8906
|
-
`Unexpected: received non-Uint8Array/ArrayBuffer (${bytes.constructor.name}) in a web platform. Please report this error.`
|
|
8907
|
-
);
|
|
8904
|
+
throw new Error(`Unexpected: received non-Uint8Array/ArrayBuffer (${bytes.constructor.name}) in a web platform. Please report this error.`);
|
|
8908
8905
|
}
|
|
8909
|
-
throw new Error(
|
|
8910
|
-
`Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.`
|
|
8911
|
-
);
|
|
8906
|
+
throw new Error(`Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.`);
|
|
8912
8907
|
}
|
|
8913
8908
|
flush() {
|
|
8914
8909
|
if (!this.buffer.length && !this.trailingCR) {
|
|
@@ -8964,13 +8959,9 @@ var AbstractJob = class {
|
|
|
8964
8959
|
if (!this._responseStream) {
|
|
8965
8960
|
throw Error("logical bug");
|
|
8966
8961
|
}
|
|
8967
|
-
return Stream.iterFromReadableStream(
|
|
8968
|
-
this.
|
|
8969
|
-
|
|
8970
|
-
async (event) => {
|
|
8971
|
-
return await this.onEvent(event);
|
|
8972
|
-
}
|
|
8973
|
-
);
|
|
8962
|
+
return Stream.iterFromReadableStream(this._responseStream, this._controller, async (event) => {
|
|
8963
|
+
return await this.onEvent(event);
|
|
8964
|
+
});
|
|
8974
8965
|
}
|
|
8975
8966
|
async startJob() {
|
|
8976
8967
|
return Promise.reject("abstract class");
|
|
@@ -9064,8 +9055,8 @@ var UploadJob = class extends AbstractJob {
|
|
|
9064
9055
|
formData.append("params", paramBlob);
|
|
9065
9056
|
formData.append("file", this._uploadStream);
|
|
9066
9057
|
const headers = {
|
|
9067
|
-
|
|
9068
|
-
|
|
9058
|
+
...session.authenticationHeaders(),
|
|
9059
|
+
Accept: "application/jsonl"
|
|
9069
9060
|
};
|
|
9070
9061
|
request = this._client.fetch(postUrl, {
|
|
9071
9062
|
headers,
|
|
@@ -9078,8 +9069,8 @@ var UploadJob = class extends AbstractJob {
|
|
|
9078
9069
|
} else {
|
|
9079
9070
|
this._requestLogger.debug("before POST %s with stream as body", postUrl);
|
|
9080
9071
|
const headers = {
|
|
9081
|
-
|
|
9082
|
-
|
|
9072
|
+
...session.authenticationHeaders(),
|
|
9073
|
+
Accept: "application/jsonl",
|
|
9083
9074
|
"Content-Type": this._mimeType
|
|
9084
9075
|
};
|
|
9085
9076
|
request = this._client.fetch(postUrl, {
|
|
@@ -9112,8 +9103,8 @@ var UploadJob = class extends AbstractJob {
|
|
|
9112
9103
|
if (this._needsFullDuplex) {
|
|
9113
9104
|
const prepareUrl = `${session.baseUrl.replace(/\/+$/, "")}/pipelines/${session.pipelineId}/prepareSource?timeout=10s`;
|
|
9114
9105
|
const headers = {
|
|
9115
|
-
|
|
9116
|
-
|
|
9106
|
+
...session.authenticationHeaders(),
|
|
9107
|
+
Accept: "application/jsonl"
|
|
9117
9108
|
};
|
|
9118
9109
|
this._requestLogger.debug("before POST %s to prepare full duplex upload", prepareUrl);
|
|
9119
9110
|
response = await this._client.fetch(prepareUrl, {
|
|
@@ -9134,8 +9125,8 @@ var UploadJob = class extends AbstractJob {
|
|
|
9134
9125
|
formData.append("params", paramBlob);
|
|
9135
9126
|
formData.append("file", this._uploadStream);
|
|
9136
9127
|
const headers = {
|
|
9137
|
-
|
|
9138
|
-
|
|
9128
|
+
...session.authenticationHeaders(),
|
|
9129
|
+
Accept: "application/jsonl"
|
|
9139
9130
|
};
|
|
9140
9131
|
response = await this._client.fetch(postUrl, {
|
|
9141
9132
|
headers,
|
|
@@ -9149,8 +9140,8 @@ var UploadJob = class extends AbstractJob {
|
|
|
9149
9140
|
} else {
|
|
9150
9141
|
this._requestLogger.debug("before POST %s with stream as body", postUrl);
|
|
9151
9142
|
const headers = {
|
|
9152
|
-
|
|
9153
|
-
|
|
9143
|
+
...session.authenticationHeaders(),
|
|
9144
|
+
Accept: "application/jsonl",
|
|
9154
9145
|
"Content-Type": this._mimeType
|
|
9155
9146
|
};
|
|
9156
9147
|
response = await this._client.fetch(postUrl, {
|
|
@@ -9181,13 +9172,13 @@ var LoadFromJob = class extends AbstractJob {
|
|
|
9181
9172
|
return Promise.reject("session.baseUrl must not ne null");
|
|
9182
9173
|
}
|
|
9183
9174
|
const body = {
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9175
|
+
sourceType: "URL",
|
|
9176
|
+
url: this._location,
|
|
9177
|
+
params: this._params
|
|
9187
9178
|
};
|
|
9188
9179
|
const headers = {
|
|
9189
|
-
|
|
9190
|
-
|
|
9180
|
+
...session.authenticationHeaders(),
|
|
9181
|
+
Accept: "application/jsonl",
|
|
9191
9182
|
"Content-Type": "application/json"
|
|
9192
9183
|
};
|
|
9193
9184
|
const patchUrl = `${session.baseUrl.replace(/\/+$/, "")}/pipelines/${session.pipelineId}/source?mode=queue&processing=sync`;
|
|
@@ -9216,13 +9207,13 @@ var LoadLiveIngressJob = class extends AbstractJob {
|
|
|
9216
9207
|
return Promise.reject("session.baseUrl must not ne null");
|
|
9217
9208
|
}
|
|
9218
9209
|
const body = {
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9210
|
+
sourceType: "LIVE_INGRESS",
|
|
9211
|
+
liveIngressId: this._ingressId,
|
|
9212
|
+
params: this._params
|
|
9222
9213
|
};
|
|
9223
9214
|
const headers = {
|
|
9224
|
-
|
|
9225
|
-
|
|
9215
|
+
...session.authenticationHeaders(),
|
|
9216
|
+
Accept: "application/jsonl",
|
|
9226
9217
|
"Content-Type": "application/json"
|
|
9227
9218
|
};
|
|
9228
9219
|
const patchUrl = `${session.baseUrl.replace(/\/+$/, "")}/pipelines/${session.pipelineId}/source?mode=preempt&processing=sync`;
|
|
@@ -9238,52 +9229,8 @@ var LoadLiveIngressJob = class extends AbstractJob {
|
|
|
9238
9229
|
}
|
|
9239
9230
|
};
|
|
9240
9231
|
|
|
9241
|
-
//
|
|
9242
|
-
var
|
|
9243
|
-
var rnds8Pool = new Uint8Array(256);
|
|
9244
|
-
var poolPtr = rnds8Pool.length;
|
|
9245
|
-
function rng() {
|
|
9246
|
-
if (poolPtr > rnds8Pool.length - 16) {
|
|
9247
|
-
import_crypto.default.randomFillSync(rnds8Pool);
|
|
9248
|
-
poolPtr = 0;
|
|
9249
|
-
}
|
|
9250
|
-
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
9251
|
-
}
|
|
9252
|
-
|
|
9253
|
-
// ../../node_modules/uuid/dist/esm-node/stringify.js
|
|
9254
|
-
var byteToHex = [];
|
|
9255
|
-
for (let i = 0; i < 256; ++i) {
|
|
9256
|
-
byteToHex.push((i + 256).toString(16).slice(1));
|
|
9257
|
-
}
|
|
9258
|
-
function unsafeStringify(arr, offset = 0) {
|
|
9259
|
-
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
9260
|
-
}
|
|
9261
|
-
|
|
9262
|
-
// ../../node_modules/uuid/dist/esm-node/native.js
|
|
9263
|
-
var import_crypto2 = __toESM(require("crypto"));
|
|
9264
|
-
var native_default = {
|
|
9265
|
-
randomUUID: import_crypto2.default.randomUUID
|
|
9266
|
-
};
|
|
9267
|
-
|
|
9268
|
-
// ../../node_modules/uuid/dist/esm-node/v4.js
|
|
9269
|
-
function v4(options, buf, offset) {
|
|
9270
|
-
if (native_default.randomUUID && !buf && !options) {
|
|
9271
|
-
return native_default.randomUUID();
|
|
9272
|
-
}
|
|
9273
|
-
options = options || {};
|
|
9274
|
-
const rnds = options.random || (options.rng || rng)();
|
|
9275
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
9276
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
9277
|
-
if (buf) {
|
|
9278
|
-
offset = offset || 0;
|
|
9279
|
-
for (let i = 0; i < 16; ++i) {
|
|
9280
|
-
buf[offset + i] = rnds[i];
|
|
9281
|
-
}
|
|
9282
|
-
return buf;
|
|
9283
|
-
}
|
|
9284
|
-
return unsafeStringify(rnds);
|
|
9285
|
-
}
|
|
9286
|
-
var v4_default = v4;
|
|
9232
|
+
// worker/webrtc_whip.ts
|
|
9233
|
+
var import_uuid = require("uuid");
|
|
9287
9234
|
|
|
9288
9235
|
// worker/webrtc_base.ts
|
|
9289
9236
|
var import_path = __toESM(require("path"));
|
|
@@ -9323,7 +9270,7 @@ var WebrtcBase = class _WebrtcBase {
|
|
|
9323
9270
|
const ingressUrl = new URL(this._urlPath, session.baseUrl);
|
|
9324
9271
|
this._requestLogger.debug("before POST: %s", ingressUrl);
|
|
9325
9272
|
const headers = {
|
|
9326
|
-
|
|
9273
|
+
...session.authenticationHeaders(),
|
|
9327
9274
|
"Content-Type": "application/sdp"
|
|
9328
9275
|
};
|
|
9329
9276
|
const response = await this._client.fetch(ingressUrl, {
|
|
@@ -9336,10 +9283,12 @@ var WebrtcBase = class _WebrtcBase {
|
|
|
9336
9283
|
}
|
|
9337
9284
|
this._eTag = response.headers.get("ETag") ?? "";
|
|
9338
9285
|
this._location = response.headers.get("Location");
|
|
9339
|
-
return this.onRemoteAnswer(
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9286
|
+
return this.onRemoteAnswer(
|
|
9287
|
+
new RTCSessionDescription({
|
|
9288
|
+
type: "answer",
|
|
9289
|
+
sdp: await response.text()
|
|
9290
|
+
})
|
|
9291
|
+
);
|
|
9343
9292
|
}
|
|
9344
9293
|
async sendLocalCandidates(candidates) {
|
|
9345
9294
|
if (!this._offerData) {
|
|
@@ -9355,7 +9304,7 @@ var WebrtcBase = class _WebrtcBase {
|
|
|
9355
9304
|
const ingressUrl = new URL(urlPath, session.baseUrl);
|
|
9356
9305
|
this._requestLogger.debug("before PATCH: %s", ingressUrl);
|
|
9357
9306
|
const headers = {
|
|
9358
|
-
|
|
9307
|
+
...session.authenticationHeaders(),
|
|
9359
9308
|
"Content-Type": "application/trickle-ice-sdpfrag",
|
|
9360
9309
|
"If-Match": this._eTag
|
|
9361
9310
|
};
|
|
@@ -9529,18 +9478,15 @@ var WebrtcBase = class _WebrtcBase {
|
|
|
9529
9478
|
// worker/webrtc_whip.ts
|
|
9530
9479
|
var WebrtcWhip = class extends WebrtcBase {
|
|
9531
9480
|
constructor(stream, getSession, client, requestLogger) {
|
|
9532
|
-
super(getSession, client,
|
|
9481
|
+
super(getSession, client, (0, import_uuid.v4)().toString(), "/liveIngress/whip", requestLogger);
|
|
9533
9482
|
this._stream = stream;
|
|
9534
9483
|
}
|
|
9535
9484
|
async start() {
|
|
9536
9485
|
const session = await this._getSession();
|
|
9537
9486
|
const ingressUrl = new URL(this._urlPath, session.baseUrl);
|
|
9538
9487
|
this._requestLogger.debug("before GET: %s", ingressUrl);
|
|
9539
|
-
const headers = {
|
|
9540
|
-
"Authorization": `Bearer ${session.accessToken}`
|
|
9541
|
-
};
|
|
9542
9488
|
const response = await this._client.fetch(ingressUrl, {
|
|
9543
|
-
headers,
|
|
9489
|
+
headers: session.authenticationHeaders(),
|
|
9544
9490
|
method: "GET"
|
|
9545
9491
|
});
|
|
9546
9492
|
if (response.status >= 300) {
|
|
@@ -9640,11 +9586,8 @@ var WebrtcWhep = class extends WebrtcBase {
|
|
|
9640
9586
|
const session = await this._getSession();
|
|
9641
9587
|
const egressUrl = new URL(this._urlPath, session.baseUrl);
|
|
9642
9588
|
this._requestLogger.debug("before GET: %s", egressUrl);
|
|
9643
|
-
const headers = {
|
|
9644
|
-
"Authorization": `Bearer ${session.accessToken}`
|
|
9645
|
-
};
|
|
9646
9589
|
const response = await this._client.fetch(egressUrl, {
|
|
9647
|
-
headers,
|
|
9590
|
+
headers: session.authenticationHeaders(),
|
|
9648
9591
|
method: "GET"
|
|
9649
9592
|
});
|
|
9650
9593
|
if (response.status >= 300) {
|
|
@@ -9746,7 +9689,7 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
|
|
|
9746
9689
|
constructor() {
|
|
9747
9690
|
}
|
|
9748
9691
|
async fetch(input, init) {
|
|
9749
|
-
return fetch(input, init);
|
|
9692
|
+
return await fetch(input, init);
|
|
9750
9693
|
}
|
|
9751
9694
|
async close() {
|
|
9752
9695
|
}
|
|
@@ -9762,7 +9705,7 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
|
|
|
9762
9705
|
async fetch(input, init) {
|
|
9763
9706
|
init || (init = {});
|
|
9764
9707
|
init.dispatcher = this.agent;
|
|
9765
|
-
return fetch(input, init);
|
|
9708
|
+
return await fetch(input, init);
|
|
9766
9709
|
}
|
|
9767
9710
|
async close() {
|
|
9768
9711
|
return this.agent.close();
|
|
@@ -10040,6 +9983,7 @@ var Endpoint = class {
|
|
|
10040
9983
|
this._expire_token_time = this._options.auth.session.validUntil / 1e3;
|
|
10041
9984
|
} else if (this._options.auth.oAuth2 !== void 0) {
|
|
10042
9985
|
} else if (this._options.auth.secretKey !== void 0) {
|
|
9986
|
+
} else if (this._options.auth.isLocal !== void 0) {
|
|
10043
9987
|
} else {
|
|
10044
9988
|
return Promise.reject("option secretKey or environment variable EYEPOP_SECRET_KEY is required");
|
|
10045
9989
|
}
|
|
@@ -10077,7 +10021,7 @@ var Endpoint = class {
|
|
|
10077
10021
|
while (true) {
|
|
10078
10022
|
try {
|
|
10079
10023
|
const response = await fetcher();
|
|
10080
|
-
if (response.
|
|
10024
|
+
if (response.ok) {
|
|
10081
10025
|
return response;
|
|
10082
10026
|
} else {
|
|
10083
10027
|
const handler = this._statusRetryHandlers.get(response.status);
|
|
@@ -10086,10 +10030,10 @@ var Endpoint = class {
|
|
|
10086
10030
|
if (retries--) {
|
|
10087
10031
|
this._requestLogger.info("received %d response, retry", response.status);
|
|
10088
10032
|
} else {
|
|
10089
|
-
return
|
|
10033
|
+
return response;
|
|
10090
10034
|
}
|
|
10091
10035
|
} else {
|
|
10092
|
-
return
|
|
10036
|
+
return response;
|
|
10093
10037
|
}
|
|
10094
10038
|
}
|
|
10095
10039
|
} catch (error) {
|
|
@@ -10111,6 +10055,9 @@ var Endpoint = class {
|
|
|
10111
10055
|
throw new Error("reconnect() not implemented");
|
|
10112
10056
|
}
|
|
10113
10057
|
async authorizationHeader() {
|
|
10058
|
+
if (this._options.auth.isLocal !== void 0) {
|
|
10059
|
+
return `Implicit`;
|
|
10060
|
+
}
|
|
10114
10061
|
return `Bearer ${await this.currentAccessToken()}`;
|
|
10115
10062
|
}
|
|
10116
10063
|
async currentAccessToken() {
|
|
@@ -10120,6 +10067,9 @@ var Endpoint = class {
|
|
|
10120
10067
|
try {
|
|
10121
10068
|
if (!this._client) {
|
|
10122
10069
|
return Promise.reject("endpoint not connected");
|
|
10070
|
+
} else if (this._options.auth.isLocal !== void 0) {
|
|
10071
|
+
this._token = "implicit";
|
|
10072
|
+
this._expire_token_time = Number.MAX_VALUE;
|
|
10123
10073
|
} else if (this._options.auth.session !== void 0) {
|
|
10124
10074
|
return Promise.reject("temporary access token expired");
|
|
10125
10075
|
} else if (this._options.auth.oAuth2 !== void 0 && this._options.eyepopUrl) {
|
|
@@ -10128,7 +10078,7 @@ var Endpoint = class {
|
|
|
10128
10078
|
this._expire_token_time = session.validUntil / 1e3;
|
|
10129
10079
|
} else if (this._options.auth.secretKey !== void 0 && this._options.eyepopUrl) {
|
|
10130
10080
|
const secretKeyAuth = this._options.auth;
|
|
10131
|
-
const body = {
|
|
10081
|
+
const body = { secret_key: secretKeyAuth.secretKey };
|
|
10132
10082
|
const headers = { "Content-Type": "application/json" };
|
|
10133
10083
|
const post_url = `${this.eyepopUrl()}/authentication/token`;
|
|
10134
10084
|
this._requestLogger.debug("before POST %s", post_url);
|
|
@@ -10177,7 +10127,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10177
10127
|
this._ingressEventWs = null;
|
|
10178
10128
|
this._sandboxId = null;
|
|
10179
10129
|
const sessionAuth = options.auth;
|
|
10180
|
-
if (sessionAuth.session !== void 0) {
|
|
10130
|
+
if (sessionAuth !== void 0 && sessionAuth.session !== void 0) {
|
|
10181
10131
|
const workerSession = sessionAuth.session;
|
|
10182
10132
|
if (workerSession.sandboxId) {
|
|
10183
10133
|
this._sandboxId = workerSession.sandboxId;
|
|
@@ -10189,10 +10139,26 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10189
10139
|
return this._options;
|
|
10190
10140
|
}
|
|
10191
10141
|
async disconnect(wait = true) {
|
|
10142
|
+
if (this.options().popId == "transient" /* Transient */ && this._pipelineId) {
|
|
10143
|
+
const deleteUrl = `${this._baseUrl}/pipelines/${this._pipelineId}`;
|
|
10144
|
+
const headers = {
|
|
10145
|
+
Authorization: await this.authorizationHeader()
|
|
10146
|
+
};
|
|
10147
|
+
this._requestLogger.debug("before DELETE %s", deleteUrl);
|
|
10148
|
+
let response = await this._client?.fetch(deleteUrl, {
|
|
10149
|
+
method: "DELETE",
|
|
10150
|
+
headers
|
|
10151
|
+
});
|
|
10152
|
+
this._requestLogger.debug("after DELETE %s", deleteUrl);
|
|
10153
|
+
if (response?.status != 204) {
|
|
10154
|
+
const message = await response?.text();
|
|
10155
|
+
this._logger.info(`stoppping pipeline failed, status ${response?.status}: ${message}`);
|
|
10156
|
+
}
|
|
10157
|
+
}
|
|
10192
10158
|
if (this._sandboxId && this._baseUrl) {
|
|
10193
10159
|
const sandboxUrl = `${this._baseUrl}/sandboxes/${this._sandboxId}`;
|
|
10194
10160
|
const headers = {
|
|
10195
|
-
|
|
10161
|
+
Authorization: await this.authorizationHeader()
|
|
10196
10162
|
};
|
|
10197
10163
|
this._requestLogger.debug("before DELETE %s", sandboxUrl);
|
|
10198
10164
|
let response = await this._client?.fetch(sandboxUrl, {
|
|
@@ -10202,7 +10168,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10202
10168
|
this._requestLogger.debug("after DELETE %s", sandboxUrl);
|
|
10203
10169
|
if (response?.status != 204) {
|
|
10204
10170
|
const message = await response?.text();
|
|
10205
|
-
|
|
10171
|
+
this._logger.info(`disconnecting sandbox failed, status ${response?.status}: ${message}`);
|
|
10206
10172
|
}
|
|
10207
10173
|
this._sandboxId = null;
|
|
10208
10174
|
}
|
|
@@ -10227,7 +10193,8 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10227
10193
|
popId: this.options().popId,
|
|
10228
10194
|
baseUrl: this._baseUrl,
|
|
10229
10195
|
pipelineId: this._pipelineId,
|
|
10230
|
-
sandboxId: this._sandboxId ?? void 0
|
|
10196
|
+
sandboxId: this._sandboxId ?? void 0,
|
|
10197
|
+
authenticationHeaders: () => this._authenticationHeaders(session)
|
|
10231
10198
|
};
|
|
10232
10199
|
}
|
|
10233
10200
|
popName() {
|
|
@@ -10249,12 +10216,12 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10249
10216
|
let response = await this.fetchWithRetry(async () => {
|
|
10250
10217
|
const session = await this.session();
|
|
10251
10218
|
let headers = {
|
|
10252
|
-
"
|
|
10253
|
-
|
|
10219
|
+
"Content-Type": "application/json",
|
|
10220
|
+
...this._authenticationHeaders(session)
|
|
10254
10221
|
};
|
|
10255
10222
|
const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/pop`;
|
|
10256
10223
|
this._requestLogger.debug("before PATCH %s - %s", patch_url, JSON.stringify(pop));
|
|
10257
|
-
return client.fetch(patch_url, {
|
|
10224
|
+
return await client.fetch(patch_url, {
|
|
10258
10225
|
method: "PATCH",
|
|
10259
10226
|
body: JSON.stringify(pop),
|
|
10260
10227
|
headers
|
|
@@ -10262,7 +10229,6 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10262
10229
|
});
|
|
10263
10230
|
if (response.status != 204) {
|
|
10264
10231
|
const message = await response.text();
|
|
10265
|
-
console.error(message);
|
|
10266
10232
|
return Promise.reject(`Unexpected status ${response.status}: ${message}`);
|
|
10267
10233
|
}
|
|
10268
10234
|
this._requestLogger.debug("after PATCH pop");
|
|
@@ -10270,6 +10236,9 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10270
10236
|
this._pipeline.pop = pop;
|
|
10271
10237
|
}
|
|
10272
10238
|
}
|
|
10239
|
+
_authenticationHeaders(session) {
|
|
10240
|
+
return this._options.auth.isLocal !== void 0 ? {} : { Authorization: `Bearer ${session.accessToken}` };
|
|
10241
|
+
}
|
|
10273
10242
|
/**
|
|
10274
10243
|
* @deprecated use pop() instead
|
|
10275
10244
|
*/
|
|
@@ -10290,13 +10259,13 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10290
10259
|
return Promise.reject("endpoint not connected, use connect() before changePopComp()");
|
|
10291
10260
|
}
|
|
10292
10261
|
const body = {
|
|
10293
|
-
|
|
10294
|
-
|
|
10262
|
+
pipeline: popComp,
|
|
10263
|
+
modelRefs
|
|
10295
10264
|
};
|
|
10296
10265
|
let response = await this.fetchWithRetry(async () => {
|
|
10297
10266
|
const session = await this.session();
|
|
10298
10267
|
let headers = {
|
|
10299
|
-
|
|
10268
|
+
...this._authenticationHeaders(session),
|
|
10300
10269
|
"Content-Type": "application/json"
|
|
10301
10270
|
};
|
|
10302
10271
|
const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/inferencePipeline`;
|
|
@@ -10308,7 +10277,6 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10308
10277
|
});
|
|
10309
10278
|
if (response.status != 204) {
|
|
10310
10279
|
const message = await response.text();
|
|
10311
|
-
console.error(message);
|
|
10312
10280
|
return Promise.reject(`Unexpected status ${response.status}: ${message}`);
|
|
10313
10281
|
}
|
|
10314
10282
|
if (this._pipeline) {
|
|
@@ -10336,12 +10304,12 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10336
10304
|
return Promise.reject("endpoint not connected, use connect() before changePopComp()");
|
|
10337
10305
|
}
|
|
10338
10306
|
const body = {
|
|
10339
|
-
|
|
10307
|
+
transform: postTransform
|
|
10340
10308
|
};
|
|
10341
10309
|
let response = await this.fetchWithRetry(async () => {
|
|
10342
10310
|
const session = await this.session();
|
|
10343
10311
|
let headers = {
|
|
10344
|
-
|
|
10312
|
+
...this._authenticationHeaders(session),
|
|
10345
10313
|
"Content-Type": "application/json"
|
|
10346
10314
|
};
|
|
10347
10315
|
const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/postTransform`;
|
|
@@ -10374,18 +10342,28 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10374
10342
|
if (!this._baseUrl || !this._client) {
|
|
10375
10343
|
return Promise.reject("endpoint not connected, use connect() before ingress()");
|
|
10376
10344
|
}
|
|
10377
|
-
const whip = new WebrtcWhip(
|
|
10378
|
-
|
|
10379
|
-
|
|
10345
|
+
const whip = new WebrtcWhip(
|
|
10346
|
+
stream,
|
|
10347
|
+
async () => {
|
|
10348
|
+
return this.session();
|
|
10349
|
+
},
|
|
10350
|
+
this._client,
|
|
10351
|
+
this._requestLogger
|
|
10352
|
+
);
|
|
10380
10353
|
return whip.start();
|
|
10381
10354
|
}
|
|
10382
10355
|
async liveEgress(ingressId) {
|
|
10383
10356
|
if (!this._baseUrl || !this._client) {
|
|
10384
10357
|
return Promise.reject("endpoint not connected, use connect() before ingress()");
|
|
10385
10358
|
}
|
|
10386
|
-
const whep = new WebrtcWhep(
|
|
10387
|
-
|
|
10388
|
-
|
|
10359
|
+
const whep = new WebrtcWhep(
|
|
10360
|
+
ingressId,
|
|
10361
|
+
async () => {
|
|
10362
|
+
return this.session();
|
|
10363
|
+
},
|
|
10364
|
+
this._client,
|
|
10365
|
+
this._requestLogger
|
|
10366
|
+
);
|
|
10389
10367
|
return whep.start();
|
|
10390
10368
|
}
|
|
10391
10369
|
async process(source, params = void 0) {
|
|
@@ -10412,7 +10390,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10412
10390
|
const session = await this.session();
|
|
10413
10391
|
let response = await this.fetchWithRetry(async () => {
|
|
10414
10392
|
const headers = {
|
|
10415
|
-
|
|
10393
|
+
...this._authenticationHeaders(session)
|
|
10416
10394
|
};
|
|
10417
10395
|
const getTokenUrl = `${session.baseUrl}/liveIngress/events/token`;
|
|
10418
10396
|
return client.fetch(getTokenUrl, { headers });
|
|
@@ -10441,14 +10419,24 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10441
10419
|
await this._limit.acquire();
|
|
10442
10420
|
try {
|
|
10443
10421
|
this.updateState();
|
|
10444
|
-
const job = new UploadJob(
|
|
10445
|
-
|
|
10446
|
-
|
|
10447
|
-
|
|
10448
|
-
|
|
10449
|
-
|
|
10450
|
-
|
|
10451
|
-
|
|
10422
|
+
const job = new UploadJob(
|
|
10423
|
+
source.file,
|
|
10424
|
+
source.file.type,
|
|
10425
|
+
params,
|
|
10426
|
+
async () => {
|
|
10427
|
+
return this.session();
|
|
10428
|
+
},
|
|
10429
|
+
this._client,
|
|
10430
|
+
this._requestLogger
|
|
10431
|
+
);
|
|
10432
|
+
return job.start(
|
|
10433
|
+
() => {
|
|
10434
|
+
this.jobDone(job);
|
|
10435
|
+
},
|
|
10436
|
+
(statusCode) => {
|
|
10437
|
+
this.jobStatus(job, statusCode);
|
|
10438
|
+
}
|
|
10439
|
+
);
|
|
10452
10440
|
} catch (e) {
|
|
10453
10441
|
this._limit.release();
|
|
10454
10442
|
throw e;
|
|
@@ -10461,14 +10449,24 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10461
10449
|
await this._limit.acquire();
|
|
10462
10450
|
try {
|
|
10463
10451
|
this.updateState();
|
|
10464
|
-
const job = new UploadJob(
|
|
10465
|
-
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
|
|
10470
|
-
|
|
10471
|
-
|
|
10452
|
+
const job = new UploadJob(
|
|
10453
|
+
source.stream,
|
|
10454
|
+
source.mimeType,
|
|
10455
|
+
params,
|
|
10456
|
+
async () => {
|
|
10457
|
+
return this.session();
|
|
10458
|
+
},
|
|
10459
|
+
this._client,
|
|
10460
|
+
this._requestLogger
|
|
10461
|
+
);
|
|
10462
|
+
return job.start(
|
|
10463
|
+
() => {
|
|
10464
|
+
this.jobDone(job);
|
|
10465
|
+
},
|
|
10466
|
+
(statusCode) => {
|
|
10467
|
+
this.jobStatus(job, statusCode);
|
|
10468
|
+
}
|
|
10469
|
+
);
|
|
10472
10470
|
} catch (e) {
|
|
10473
10471
|
this._limit.release();
|
|
10474
10472
|
throw e;
|
|
@@ -10482,14 +10480,24 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10482
10480
|
try {
|
|
10483
10481
|
this.updateState();
|
|
10484
10482
|
const streamSource = await resolvePath(source);
|
|
10485
|
-
const job = new UploadJob(
|
|
10486
|
-
|
|
10487
|
-
|
|
10488
|
-
|
|
10489
|
-
|
|
10490
|
-
|
|
10491
|
-
|
|
10492
|
-
|
|
10483
|
+
const job = new UploadJob(
|
|
10484
|
+
streamSource.stream,
|
|
10485
|
+
streamSource.mimeType,
|
|
10486
|
+
params,
|
|
10487
|
+
async () => {
|
|
10488
|
+
return this.session();
|
|
10489
|
+
},
|
|
10490
|
+
this._client,
|
|
10491
|
+
this._requestLogger
|
|
10492
|
+
);
|
|
10493
|
+
return job.start(
|
|
10494
|
+
() => {
|
|
10495
|
+
this.jobDone(job);
|
|
10496
|
+
},
|
|
10497
|
+
(statusCode) => {
|
|
10498
|
+
this.jobStatus(job, statusCode);
|
|
10499
|
+
}
|
|
10500
|
+
);
|
|
10493
10501
|
} catch (e) {
|
|
10494
10502
|
this._limit.release();
|
|
10495
10503
|
throw e;
|
|
@@ -10502,14 +10510,23 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10502
10510
|
await this._limit.acquire();
|
|
10503
10511
|
try {
|
|
10504
10512
|
this.updateState();
|
|
10505
|
-
const job = new LoadFromJob(
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
this.
|
|
10512
|
-
|
|
10513
|
+
const job = new LoadFromJob(
|
|
10514
|
+
source.url,
|
|
10515
|
+
params,
|
|
10516
|
+
async () => {
|
|
10517
|
+
return this.session();
|
|
10518
|
+
},
|
|
10519
|
+
this._client,
|
|
10520
|
+
this._requestLogger
|
|
10521
|
+
);
|
|
10522
|
+
return job.start(
|
|
10523
|
+
() => {
|
|
10524
|
+
this.jobDone(job);
|
|
10525
|
+
},
|
|
10526
|
+
(statusCode) => {
|
|
10527
|
+
this.jobStatus(job, statusCode);
|
|
10528
|
+
}
|
|
10529
|
+
);
|
|
10513
10530
|
} catch (e) {
|
|
10514
10531
|
this._limit.release();
|
|
10515
10532
|
throw e;
|
|
@@ -10522,14 +10539,23 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10522
10539
|
await this._limit.acquire();
|
|
10523
10540
|
try {
|
|
10524
10541
|
this.updateState();
|
|
10525
|
-
const job = new LoadLiveIngressJob(
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
this.
|
|
10532
|
-
|
|
10542
|
+
const job = new LoadLiveIngressJob(
|
|
10543
|
+
source.ingressId,
|
|
10544
|
+
params,
|
|
10545
|
+
async () => {
|
|
10546
|
+
return this.session();
|
|
10547
|
+
},
|
|
10548
|
+
this._client,
|
|
10549
|
+
this._requestLogger
|
|
10550
|
+
);
|
|
10551
|
+
return job.start(
|
|
10552
|
+
() => {
|
|
10553
|
+
this.jobDone(job);
|
|
10554
|
+
},
|
|
10555
|
+
(statusCode) => {
|
|
10556
|
+
this.jobStatus(job, statusCode);
|
|
10557
|
+
}
|
|
10558
|
+
);
|
|
10533
10559
|
} catch (e) {
|
|
10534
10560
|
this._limit.release();
|
|
10535
10561
|
throw e;
|
|
@@ -10557,7 +10583,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10557
10583
|
config_url = `${this.eyepopUrl()}/pops/${this.options().popId}/config?auto_start=false`;
|
|
10558
10584
|
}
|
|
10559
10585
|
const headers = {
|
|
10560
|
-
|
|
10586
|
+
Authorization: await this.authorizationHeader()
|
|
10561
10587
|
};
|
|
10562
10588
|
this.updateState("FetchConfig" /* FetchConfig */);
|
|
10563
10589
|
this._requestLogger.debug("before GET %s", config_url);
|
|
@@ -10566,7 +10592,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10566
10592
|
this._requestLogger.debug("after GET %s: 401, about to retry with fresh access token", config_url);
|
|
10567
10593
|
this.statusHandler401(response.status);
|
|
10568
10594
|
const headers2 = {
|
|
10569
|
-
|
|
10595
|
+
Authorization: await this.authorizationHeader()
|
|
10570
10596
|
};
|
|
10571
10597
|
this.updateState("FetchConfig" /* FetchConfig */);
|
|
10572
10598
|
response = await this._client.fetch(config_url, {
|
|
@@ -10588,7 +10614,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10588
10614
|
const auto_start_config_url = `${this.eyepopUrl()}/pops/${this.options().popId}/config?auto_start=true`;
|
|
10589
10615
|
this._requestLogger.debug("pop was not running, trying to autostart with: %s", auto_start_config_url);
|
|
10590
10616
|
const headers2 = {
|
|
10591
|
-
|
|
10617
|
+
Authorization: await this.authorizationHeader()
|
|
10592
10618
|
};
|
|
10593
10619
|
response = await this._client.fetch(auto_start_config_url, {
|
|
10594
10620
|
headers: headers2
|
|
@@ -10606,7 +10632,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10606
10632
|
this._baseUrl = this._baseUrl.replace(/\/+$/, "");
|
|
10607
10633
|
if (this.options().isSandbox && this._sandboxId === null) {
|
|
10608
10634
|
const headers3 = {
|
|
10609
|
-
|
|
10635
|
+
Authorization: await this.authorizationHeader()
|
|
10610
10636
|
};
|
|
10611
10637
|
const createSandboxUrl = `${this._baseUrl}/sandboxes`;
|
|
10612
10638
|
this._requestLogger.debug("before POST %s", createSandboxUrl);
|
|
@@ -10637,7 +10663,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10637
10663
|
this._baseUrl = this._baseUrl.replace(/\/+$/, "");
|
|
10638
10664
|
const get_url = `${this._baseUrl}/pipelines/${this._pipelineId}`;
|
|
10639
10665
|
const headers2 = {
|
|
10640
|
-
|
|
10666
|
+
Authorization: await this.authorizationHeader()
|
|
10641
10667
|
};
|
|
10642
10668
|
this._requestLogger.debug("before GET %s", get_url);
|
|
10643
10669
|
let response2 = await this._client.fetch(get_url, {
|
|
@@ -10651,9 +10677,9 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10651
10677
|
this._requestLogger.debug("after GET %s", get_url);
|
|
10652
10678
|
this._pipeline = await response2.json();
|
|
10653
10679
|
if (this.options().stopJobs) {
|
|
10654
|
-
const body = {
|
|
10680
|
+
const body = { sourceType: "NONE" };
|
|
10655
10681
|
const headers3 = {
|
|
10656
|
-
|
|
10682
|
+
Authorization: await this.authorizationHeader()
|
|
10657
10683
|
};
|
|
10658
10684
|
const stop_url = `${this._baseUrl}/pipelines/${this._pipeline.id}/source?mode=preempt&processing=sync`;
|
|
10659
10685
|
let response3 = await this._client.fetch(stop_url, {
|
|
@@ -10689,13 +10715,13 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10689
10715
|
};
|
|
10690
10716
|
}
|
|
10691
10717
|
const body = {
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10718
|
+
pop,
|
|
10719
|
+
source: {
|
|
10720
|
+
sourceType: "NONE"
|
|
10695
10721
|
},
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10722
|
+
idleTimeoutSeconds: 30,
|
|
10723
|
+
logging: ["out_meta"],
|
|
10724
|
+
videoOutput: "no_output"
|
|
10699
10725
|
};
|
|
10700
10726
|
let post_url;
|
|
10701
10727
|
if (sandboxId) {
|
|
@@ -10706,7 +10732,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10706
10732
|
let response = await this.fetchWithRetry(async () => {
|
|
10707
10733
|
let headers = {
|
|
10708
10734
|
"Content-Type": "application/json",
|
|
10709
|
-
|
|
10735
|
+
Authorization: await this.authorizationHeader()
|
|
10710
10736
|
};
|
|
10711
10737
|
this._requestLogger.debug("before POST %s", post_url);
|
|
10712
10738
|
return client.fetch(post_url, {
|
|
@@ -10739,7 +10765,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10739
10765
|
let response = await this.fetchWithRetry(async () => {
|
|
10740
10766
|
const session = await this.session();
|
|
10741
10767
|
let headers = {
|
|
10742
|
-
|
|
10768
|
+
...this._authenticationHeaders(session),
|
|
10743
10769
|
"Content-Type": "application/json"
|
|
10744
10770
|
};
|
|
10745
10771
|
this._requestLogger.debug("before GET %s", get_path);
|
|
@@ -10769,7 +10795,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10769
10795
|
let response = await this.fetchWithRetry(async () => {
|
|
10770
10796
|
const session = await this.session();
|
|
10771
10797
|
let headers = {
|
|
10772
|
-
|
|
10798
|
+
...this._authenticationHeaders(session),
|
|
10773
10799
|
"Content-Type": "application/json"
|
|
10774
10800
|
};
|
|
10775
10801
|
this._requestLogger.debug("before GET %s", get_path);
|
|
@@ -10799,7 +10825,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10799
10825
|
let response = await this.fetchWithRetry(async () => {
|
|
10800
10826
|
const session = await this.session();
|
|
10801
10827
|
let headers = {
|
|
10802
|
-
|
|
10828
|
+
...this._authenticationHeaders(session),
|
|
10803
10829
|
"Content-Type": "application/json"
|
|
10804
10830
|
};
|
|
10805
10831
|
this._requestLogger.debug("before PUT %s", put_url);
|
|
@@ -10831,7 +10857,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10831
10857
|
let response = await this.fetchWithRetry(async () => {
|
|
10832
10858
|
const session = await this.session();
|
|
10833
10859
|
let headers = {
|
|
10834
|
-
|
|
10860
|
+
...this._authenticationHeaders(session),
|
|
10835
10861
|
"Content-Type": "application/json"
|
|
10836
10862
|
};
|
|
10837
10863
|
this._requestLogger.debug("before POST %s", post_url);
|
|
@@ -10865,7 +10891,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10865
10891
|
let response = await this.fetchWithRetry(async () => {
|
|
10866
10892
|
const session = await this.session();
|
|
10867
10893
|
let headers = {
|
|
10868
|
-
|
|
10894
|
+
...this._authenticationHeaders(session),
|
|
10869
10895
|
"Content-Type": "application/json"
|
|
10870
10896
|
};
|
|
10871
10897
|
this._requestLogger.debug("before DELETE %s", delete_url);
|
|
@@ -10966,6 +10992,11 @@ var UserReview = /* @__PURE__ */ ((UserReview2) => {
|
|
|
10966
10992
|
UserReview2["unknown"] = "unknown";
|
|
10967
10993
|
return UserReview2;
|
|
10968
10994
|
})(UserReview || {});
|
|
10995
|
+
var AutoAnnotateTask = /* @__PURE__ */ ((AutoAnnotateTask2) => {
|
|
10996
|
+
AutoAnnotateTask2["object_detection"] = "object_detection";
|
|
10997
|
+
AutoAnnotateTask2["image_classification"] = "image_classification";
|
|
10998
|
+
return AutoAnnotateTask2;
|
|
10999
|
+
})(AutoAnnotateTask || {});
|
|
10969
11000
|
var TranscodeMode = /* @__PURE__ */ ((TranscodeMode2) => {
|
|
10970
11001
|
TranscodeMode2["original"] = "original";
|
|
10971
11002
|
TranscodeMode2["image_original_size"] = "image_original_size";
|
|
@@ -10981,6 +11012,11 @@ var ModelType = /* @__PURE__ */ ((ModelType2) => {
|
|
|
10981
11012
|
ModelType2["epdet_b1"] = "epdet_b1";
|
|
10982
11013
|
return ModelType2;
|
|
10983
11014
|
})(ModelType || {});
|
|
11015
|
+
var ModelTask = /* @__PURE__ */ ((ModelTask2) => {
|
|
11016
|
+
ModelTask2["object_detection"] = "object_detection";
|
|
11017
|
+
ModelTask2["image_classification"] = "image_classification";
|
|
11018
|
+
return ModelTask2;
|
|
11019
|
+
})(ModelTask || {});
|
|
10984
11020
|
var ModelStatus = /* @__PURE__ */ ((ModelStatus2) => {
|
|
10985
11021
|
ModelStatus2["error"] = "error";
|
|
10986
11022
|
ModelStatus2["draft"] = "draft";
|
|
@@ -11080,7 +11116,7 @@ var DataEndpoint = class extends Endpoint {
|
|
|
11080
11116
|
}
|
|
11081
11117
|
const config_url = `${this.eyepopUrl()}/data/config?account_uuid=${this._accountId}`;
|
|
11082
11118
|
let headers = {
|
|
11083
|
-
|
|
11119
|
+
Authorization: await this.authorizationHeader()
|
|
11084
11120
|
};
|
|
11085
11121
|
this.updateState("FetchConfig" /* FetchConfig */);
|
|
11086
11122
|
this._requestLogger.debug("before GET %s", config_url);
|
|
@@ -11089,7 +11125,7 @@ var DataEndpoint = class extends Endpoint {
|
|
|
11089
11125
|
this._requestLogger.debug("after GET %s: 401, about to retry with fresh access token", config_url);
|
|
11090
11126
|
this.statusHandler401(response.status);
|
|
11091
11127
|
headers = {
|
|
11092
|
-
|
|
11128
|
+
Authorization: await this.authorizationHeader()
|
|
11093
11129
|
};
|
|
11094
11130
|
this.updateState("FetchConfig" /* FetchConfig */);
|
|
11095
11131
|
response = await this._client.fetch(config_url, {
|
|
@@ -11114,7 +11150,7 @@ var DataEndpoint = class extends Endpoint {
|
|
|
11114
11150
|
const client = this._client;
|
|
11115
11151
|
const url = urlJoin(this._baseUrl, "security", "check?set_cookie=true");
|
|
11116
11152
|
const headers2 = {
|
|
11117
|
-
|
|
11153
|
+
Authorization: await this.authorizationHeader()
|
|
11118
11154
|
};
|
|
11119
11155
|
response = await client.fetch(url, {
|
|
11120
11156
|
headers: headers2
|
|
@@ -11201,7 +11237,7 @@ var DataEndpoint = class extends Endpoint {
|
|
|
11201
11237
|
const session = await this.session();
|
|
11202
11238
|
const headers = {
|
|
11203
11239
|
"Content-Type": "application/json",
|
|
11204
|
-
...disableAuth ? {} : {
|
|
11240
|
+
...disableAuth ? {} : { Authorization: `Bearer ${session.accessToken}` },
|
|
11205
11241
|
...options.headers || {}
|
|
11206
11242
|
};
|
|
11207
11243
|
if (!options.body) {
|
|
@@ -11616,6 +11652,13 @@ var readEnv = (env) => {
|
|
|
11616
11652
|
}
|
|
11617
11653
|
return void 0;
|
|
11618
11654
|
};
|
|
11655
|
+
var stringToBooleanSafe = (str) => {
|
|
11656
|
+
if (typeof str == "undefined") {
|
|
11657
|
+
return false;
|
|
11658
|
+
}
|
|
11659
|
+
const loweCaseStr = str.toLowerCase();
|
|
11660
|
+
return loweCaseStr == "true" || loweCaseStr == "yes";
|
|
11661
|
+
};
|
|
11619
11662
|
var EyePop;
|
|
11620
11663
|
((EyePop2) => {
|
|
11621
11664
|
const envSecretKey = readEnv("EYEPOP_SECRET_KEY");
|
|
@@ -11624,20 +11667,32 @@ var EyePop;
|
|
|
11624
11667
|
} : void 0;
|
|
11625
11668
|
EyePop2.endpoint = workerEndpoint;
|
|
11626
11669
|
function workerEndpoint(opts = {}) {
|
|
11627
|
-
|
|
11628
|
-
|
|
11629
|
-
|
|
11670
|
+
if (opts.isLocalMode === void 0) {
|
|
11671
|
+
opts.isLocalMode = stringToBooleanSafe(readEnv("EYEPOP_LOCAL_MODE"));
|
|
11672
|
+
}
|
|
11673
|
+
_fill_default_options(opts, opts.isLocalMode ? "http://127.0.0.1:8080/standalone" : void 0);
|
|
11674
|
+
if (opts.auth === void 0) {
|
|
11675
|
+
if (opts.isLocalMode) {
|
|
11676
|
+
opts.auth = { isLocal: true };
|
|
11677
|
+
} else {
|
|
11678
|
+
throw new Error("auth option or EYEPOP_SECRET_KEY environment variable is required");
|
|
11679
|
+
}
|
|
11630
11680
|
}
|
|
11631
|
-
if (
|
|
11681
|
+
if (opts.popId === void 0) {
|
|
11682
|
+
opts.popId = readEnv("EYEPOP_POP_ID") || "transient" /* Transient */;
|
|
11683
|
+
}
|
|
11684
|
+
if (opts.autoStart === void 0) {
|
|
11632
11685
|
opts.autoStart = true;
|
|
11633
11686
|
}
|
|
11634
|
-
if (
|
|
11687
|
+
if (opts.stopJobs === void 0) {
|
|
11635
11688
|
opts.stopJobs = true;
|
|
11636
11689
|
}
|
|
11637
|
-
if (opts.auth
|
|
11690
|
+
if (opts.auth !== void 0) {
|
|
11638
11691
|
if (opts.auth.session !== void 0) {
|
|
11639
|
-
if (opts.auth.session
|
|
11640
|
-
|
|
11692
|
+
if (opts.auth.session !== void 0) {
|
|
11693
|
+
if (opts.auth.session.popId) {
|
|
11694
|
+
opts.popId = opts.auth.session.popId;
|
|
11695
|
+
}
|
|
11641
11696
|
}
|
|
11642
11697
|
}
|
|
11643
11698
|
}
|
|
@@ -11646,7 +11701,10 @@ var EyePop;
|
|
|
11646
11701
|
EyePop2.workerEndpoint = workerEndpoint;
|
|
11647
11702
|
function dataEndpoint(opts = {}) {
|
|
11648
11703
|
_fill_default_options(opts);
|
|
11649
|
-
if (
|
|
11704
|
+
if (opts.auth === void 0) {
|
|
11705
|
+
throw new Error("auth option or EYEPOP_SECRET_KEY environment variable is required");
|
|
11706
|
+
}
|
|
11707
|
+
if (opts.accountId === void 0) {
|
|
11650
11708
|
opts.accountId = readEnv("EYEPOP_ACCOUNT_ID");
|
|
11651
11709
|
}
|
|
11652
11710
|
if (opts.auth.session !== void 0) {
|
|
@@ -11659,45 +11717,44 @@ var EyePop;
|
|
|
11659
11717
|
return new DataEndpoint(opts);
|
|
11660
11718
|
}
|
|
11661
11719
|
EyePop2.dataEndpoint = dataEndpoint;
|
|
11662
|
-
function _fill_default_options(opts) {
|
|
11663
|
-
if (
|
|
11664
|
-
if (typeof defaultAuth == "undefined") {
|
|
11665
|
-
throw new Error("auth option or EYEPOP_SECRET_KEY environment variable is required");
|
|
11666
|
-
}
|
|
11720
|
+
function _fill_default_options(opts, default_eyepop_url = "https://api.eyepop.ai") {
|
|
11721
|
+
if (opts.auth === void 0) {
|
|
11667
11722
|
opts.auth = defaultAuth;
|
|
11668
11723
|
}
|
|
11669
|
-
if (
|
|
11670
|
-
opts.eyepopUrl = readEnv("EYEPOP_URL") ||
|
|
11724
|
+
if (opts.eyepopUrl === void 0) {
|
|
11725
|
+
opts.eyepopUrl = readEnv("EYEPOP_URL") || default_eyepop_url;
|
|
11671
11726
|
}
|
|
11672
|
-
if (
|
|
11727
|
+
if (opts.jobQueueLength === void 0) {
|
|
11673
11728
|
opts.jobQueueLength = 1024;
|
|
11674
11729
|
}
|
|
11675
|
-
if (
|
|
11676
|
-
if (
|
|
11677
|
-
if (opts.
|
|
11678
|
-
opts.
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
|
|
11694
|
-
|
|
11730
|
+
if (opts.auth !== void 0) {
|
|
11731
|
+
if (opts.auth.oAuth2 !== void 0) {
|
|
11732
|
+
if (typeof opts.auth.oAuth2 === "boolean") {
|
|
11733
|
+
if (opts.eyepopUrl.startsWith("https://web-api.staging.eyepop.xyz")) {
|
|
11734
|
+
opts.auth = {
|
|
11735
|
+
oAuth2: {
|
|
11736
|
+
domain: "dev-eyepop.us.auth0.com",
|
|
11737
|
+
clientId: "jktx3YO2UnbkNPvr05PQWf26t1kNTJyg",
|
|
11738
|
+
audience: "https://dev-app.eyepop.ai",
|
|
11739
|
+
scope: "admin:clouds access:inference-api access:datasets"
|
|
11740
|
+
}
|
|
11741
|
+
};
|
|
11742
|
+
} else {
|
|
11743
|
+
opts.auth = {
|
|
11744
|
+
oAuth2: {
|
|
11745
|
+
domain: "eyepop.us.auth0.com",
|
|
11746
|
+
clientId: "Lb9ubA9Hf3jlaqWLUx8XgA0zvotgViCl",
|
|
11747
|
+
audience: "https://api.eyepop.ai",
|
|
11748
|
+
scope: "admin:clouds access:inference-api access:datasets"
|
|
11749
|
+
}
|
|
11750
|
+
};
|
|
11751
|
+
}
|
|
11695
11752
|
}
|
|
11696
11753
|
}
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
|
|
11754
|
+
if (opts.auth.session !== void 0) {
|
|
11755
|
+
if (opts.auth.session.eyepopUrl) {
|
|
11756
|
+
opts.eyepopUrl = opts.auth.session.eyepopUrl;
|
|
11757
|
+
}
|
|
11701
11758
|
}
|
|
11702
11759
|
}
|
|
11703
11760
|
}
|
|
@@ -11709,6 +11766,7 @@ var index_default = EyePop;
|
|
|
11709
11766
|
AnnotationType,
|
|
11710
11767
|
ArtifactType,
|
|
11711
11768
|
AssetStatus,
|
|
11769
|
+
AutoAnnotateTask,
|
|
11712
11770
|
ChangeType,
|
|
11713
11771
|
ContourType,
|
|
11714
11772
|
DataEndpoint,
|
|
@@ -11724,6 +11782,7 @@ var index_default = EyePop;
|
|
|
11724
11782
|
ModelFormat,
|
|
11725
11783
|
ModelPrecisionType,
|
|
11726
11784
|
ModelStatus,
|
|
11785
|
+
ModelTask,
|
|
11727
11786
|
ModelTrainingStage,
|
|
11728
11787
|
ModelType,
|
|
11729
11788
|
PopComponentType,
|