@eyepop.ai/eyepop 1.0.3 → 1.1.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.
@@ -10814,6 +10814,21 @@ var DataEndpoint = class extends Endpoint {
10814
10814
  } else {
10815
10815
  await this.reconnect_ws();
10816
10816
  }
10817
+ if (this.options().useCookie) {
10818
+ const client = this._client;
10819
+ const url = urlJoin(this._baseUrl, "security", "check?set_cookie=true");
10820
+ const headers2 = {
10821
+ "Authorization": await this.authorizationHeader()
10822
+ };
10823
+ response = await client.fetch(url, {
10824
+ headers: headers2
10825
+ });
10826
+ if (response.status != 204) {
10827
+ this.updateState("Error" /* Error */);
10828
+ const message = await response.text();
10829
+ return Promise.reject(`Unexpected status ${response.status}: ${message}`);
10830
+ }
10831
+ }
10817
10832
  this.updateState();
10818
10833
  return Promise.resolve(this);
10819
10834
  }
@@ -10886,6 +10901,9 @@ var DataEndpoint = class extends Endpoint {
10886
10901
  if (!baseUrl || !client) {
10887
10902
  return Promise.reject("endpoint not connected");
10888
10903
  }
10904
+ if (!disableAuth && this.options().useCookie) {
10905
+ disableAuth = true;
10906
+ }
10889
10907
  let response = await this.fetchWithRetry(async () => {
10890
10908
  const session = await this.session();
10891
10909
  const headers = {
@@ -11010,12 +11028,13 @@ var DataEndpoint = class extends Endpoint {
11010
11028
  body: JSON.stringify(prediction)
11011
11029
  });
11012
11030
  }
11013
- async updateAutoAnnotationStatus(asset_uuid, auto_annotate, user_review) {
11031
+ async updateAutoAnnotationStatus(asset_uuid, auto_annotate, user_review, approved_threshold) {
11014
11032
  const validStatuses = ["approved", "rejected", "unknown"];
11015
11033
  if (!validStatuses.includes(user_review)) {
11016
11034
  throw new Error("Invalid status");
11017
11035
  }
11018
- return this.request(`/assets/${asset_uuid}/auto_annotations/${auto_annotate}/user_review/${user_review}`, {
11036
+ const thresholdQuery = approved_threshold ? `?approved_threshold=${approved_threshold}` : "";
11037
+ return this.request(`/assets/${asset_uuid}/auto_annotations/${auto_annotate}/user_review/${user_review}${thresholdQuery}`, {
11019
11038
  method: "PATCH"
11020
11039
  });
11021
11040
  }
@@ -11272,7 +11291,7 @@ var EyePop;
11272
11291
  domain: "dev-eyepop.us.auth0.com",
11273
11292
  clientId: "jktx3YO2UnbkNPvr05PQWf26t1kNTJyg",
11274
11293
  audience: "https://dev-app.eyepop.ai",
11275
- scope: "admin:clouds"
11294
+ scope: "admin:clouds access:inference-api access:datasets"
11276
11295
  }
11277
11296
  };
11278
11297
  } else {
@@ -11281,7 +11300,7 @@ var EyePop;
11281
11300
  domain: "eyepop.us.auth0.com",
11282
11301
  clientId: "Lb9ubA9Hf3jlaqWLUx8XgA0zvotgViCl",
11283
11302
  audience: "https://api.eyepop.ai",
11284
- scope: "admin:clouds"
11303
+ scope: "admin:clouds access:inference-api access:datasets"
11285
11304
  }
11286
11305
  };
11287
11306
  }