@eyepop.ai/eyepop 1.8.3 → 1.9.1

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.
@@ -610,6 +610,10 @@ declare enum ExportedBy {
610
610
  eyepop = "eyepop",
611
611
  qc_ai_hub = "qc_ai_hub"
612
612
  }
613
+ declare enum ArtifactType {
614
+ eyepop_bundle = "eyepop_bundle",
615
+ weights_file = "weights_file"
616
+ }
613
617
  interface QcAiHubExportParams {
614
618
  device_name: string;
615
619
  }
@@ -742,6 +746,7 @@ declare class DataEndpoint extends Endpoint<DataEndpoint> {
742
746
  trainModel(model_uuid: string): Promise<Model>;
743
747
  publishModel(model_uuid: string): Promise<Model>;
744
748
  exportModel(model_uuid: string, export_by: ExportedBy, params: QcAiHubExportParams[]): Promise<void>;
749
+ downloadModelArtifacts(model_uuid: string, model_formats?: ModelFormat[], device_name?: string, artifact_type?: ArtifactType): Promise<any>;
745
750
  addAccountEventHandler(eventHandler: OnChangeEvent): void;
746
751
  removeAccountEventHandler(eventHandler: OnChangeEvent): void;
747
752
  addDatasetEventHandler(dataset_uuid: string, eventHandler: OnChangeEvent): void;
@@ -878,4 +883,4 @@ declare namespace EyePop {
878
883
  function dataEndpoint(opts?: DataOptions): DataEndpoint;
879
884
  }
880
885
 
881
- export { AbstractJob, type Annotation, AnnotationType, type Asset, type AssetImport, AssetStatus, type Auth0Options, type Authentication, type AutoAnnotateParams, type BaseComponent, type Box, type ChangeEvent, ChangeType, type ComponentFinderComponent, type Contour, type ContourFinderComponent, ContourType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, type FileSource, type ForwardComponent, ForwardOperatorType, type InferenceComponent, InferenceType, type IngressEvent, type LiveMedia, type LiveSource, LoadFromJob, LoadLiveIngressJob, type Mask, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelInstanceDef, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type PredictedText, type Prediction, type QcAiHubExportParams, type ResultStream, type Roi, type SecretKeyAuth, Semaphore, type Session, type SessionAuth, type Source, type SourceParams, type SourcesEntry, Stream, type StreamEvent, type StreamSource, type StreamTime, type TracingComponent, TranscodeMode, TransientPopId, UploadJob, type UrlSource, UserReview, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, EyePop as default };
886
+ export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type Auth0Options, type Authentication, type AutoAnnotateParams, type BaseComponent, type Box, type ChangeEvent, ChangeType, type ComponentFinderComponent, type Contour, type ContourFinderComponent, ContourType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, type FileSource, type ForwardComponent, ForwardOperatorType, type InferenceComponent, InferenceType, type IngressEvent, type LiveMedia, type LiveSource, LoadFromJob, LoadLiveIngressJob, type Mask, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelInstanceDef, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type PredictedText, type Prediction, type QcAiHubExportParams, type ResultStream, type Roi, type SecretKeyAuth, Semaphore, type Session, type SessionAuth, type Source, type SourceParams, type SourcesEntry, Stream, type StreamEvent, type StreamSource, type StreamTime, type TracingComponent, TranscodeMode, TransientPopId, UploadJob, type UrlSource, UserReview, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, EyePop as default };
@@ -610,6 +610,10 @@ declare enum ExportedBy {
610
610
  eyepop = "eyepop",
611
611
  qc_ai_hub = "qc_ai_hub"
612
612
  }
613
+ declare enum ArtifactType {
614
+ eyepop_bundle = "eyepop_bundle",
615
+ weights_file = "weights_file"
616
+ }
613
617
  interface QcAiHubExportParams {
614
618
  device_name: string;
615
619
  }
@@ -742,6 +746,7 @@ declare class DataEndpoint extends Endpoint<DataEndpoint> {
742
746
  trainModel(model_uuid: string): Promise<Model>;
743
747
  publishModel(model_uuid: string): Promise<Model>;
744
748
  exportModel(model_uuid: string, export_by: ExportedBy, params: QcAiHubExportParams[]): Promise<void>;
749
+ downloadModelArtifacts(model_uuid: string, model_formats?: ModelFormat[], device_name?: string, artifact_type?: ArtifactType): Promise<any>;
745
750
  addAccountEventHandler(eventHandler: OnChangeEvent): void;
746
751
  removeAccountEventHandler(eventHandler: OnChangeEvent): void;
747
752
  addDatasetEventHandler(dataset_uuid: string, eventHandler: OnChangeEvent): void;
@@ -878,4 +883,4 @@ declare namespace EyePop {
878
883
  function dataEndpoint(opts?: DataOptions): DataEndpoint;
879
884
  }
880
885
 
881
- export { AbstractJob, type Annotation, AnnotationType, type Asset, type AssetImport, AssetStatus, type Auth0Options, type Authentication, type AutoAnnotateParams, type BaseComponent, type Box, type ChangeEvent, ChangeType, type ComponentFinderComponent, type Contour, type ContourFinderComponent, ContourType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, type FileSource, type ForwardComponent, ForwardOperatorType, type InferenceComponent, InferenceType, type IngressEvent, type LiveMedia, type LiveSource, LoadFromJob, LoadLiveIngressJob, type Mask, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelInstanceDef, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type PredictedText, type Prediction, type QcAiHubExportParams, type ResultStream, type Roi, type SecretKeyAuth, Semaphore, type Session, type SessionAuth, type Source, type SourceParams, type SourcesEntry, Stream, type StreamEvent, type StreamSource, type StreamTime, type TracingComponent, TranscodeMode, TransientPopId, UploadJob, type UrlSource, UserReview, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, EyePop as default };
886
+ export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type Auth0Options, type Authentication, type AutoAnnotateParams, type BaseComponent, type Box, type ChangeEvent, ChangeType, type ComponentFinderComponent, type Contour, type ContourFinderComponent, ContourType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, type FileSource, type ForwardComponent, ForwardOperatorType, type InferenceComponent, InferenceType, type IngressEvent, type LiveMedia, type LiveSource, LoadFromJob, LoadLiveIngressJob, type Mask, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelInstanceDef, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type PredictedText, type Prediction, type QcAiHubExportParams, type ResultStream, type Roi, type SecretKeyAuth, Semaphore, type Session, type SessionAuth, type Source, type SourceParams, type SourcesEntry, Stream, type StreamEvent, type StreamSource, type StreamTime, type TracingComponent, TranscodeMode, TransientPopId, UploadJob, type UrlSource, UserReview, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, EyePop as default };
@@ -8658,6 +8658,7 @@ var index_exports = {};
8658
8658
  __export(index_exports, {
8659
8659
  AbstractJob: () => AbstractJob,
8660
8660
  AnnotationType: () => AnnotationType,
8661
+ ArtifactType: () => ArtifactType,
8661
8662
  AssetStatus: () => AssetStatus,
8662
8663
  ChangeType: () => ChangeType,
8663
8664
  ContourType: () => ContourType,
@@ -11000,6 +11001,11 @@ var ExportedBy = /* @__PURE__ */ ((ExportedBy2) => {
11000
11001
  ExportedBy2["qc_ai_hub"] = "qc_ai_hub";
11001
11002
  return ExportedBy2;
11002
11003
  })(ExportedBy || {});
11004
+ var ArtifactType = /* @__PURE__ */ ((ArtifactType3) => {
11005
+ ArtifactType3["eyepop_bundle"] = "eyepop_bundle";
11006
+ ArtifactType3["weights_file"] = "weights_file";
11007
+ return ArtifactType3;
11008
+ })(ArtifactType || {});
11003
11009
  var ModelTrainingStage = /* @__PURE__ */ ((ModelTrainingStage2) => {
11004
11010
  ModelTrainingStage2["waiting"] = "waiting";
11005
11011
  ModelTrainingStage2["scheduling"] = "scheduling";
@@ -11212,17 +11218,19 @@ var DataEndpoint = class extends Endpoint {
11212
11218
  if (response.status === 204) {
11213
11219
  return null;
11214
11220
  }
11221
+ const contentType = response.headers.get("Content-Type");
11222
+ this._requestLogger.debug("Response - " + response.status + " " + response.statusText);
11215
11223
  if (!response.ok) {
11216
- const errorData = await response.json();
11217
- throw new Error(errorData.detail || "Request failed");
11224
+ if (contentType && (contentType.toLowerCase().startsWith("application/json") || contentType.toLowerCase().startsWith("text/"))) {
11225
+ throw new Error(`Request failed with ${response.status} ${response.statusText}: ${await response.text()}`);
11226
+ } else {
11227
+ throw new Error(`Request failed with ${response.status} ${response.statusText}`);
11228
+ }
11218
11229
  }
11219
- const contentType = response.headers.get("Content-Type");
11220
- if (contentType && contentType.startsWith("image/")) {
11221
- const blob = await response.blob();
11222
- return blob;
11230
+ if (contentType && contentType.toLowerCase().startsWith("application/json")) {
11231
+ return await response.json();
11223
11232
  }
11224
- this._requestLogger.debug("Response - " + response.status + " " + response.statusText);
11225
- return response.json();
11233
+ return await response.blob();
11226
11234
  }
11227
11235
  async listDatasets(include_stats = true, modifiable_version_only) {
11228
11236
  const modifiableVersionQuery = typeof modifiable_version_only !== "undefined" ? `&modifiable_version_only=${modifiable_version_only}` : "";
@@ -11451,6 +11459,19 @@ var DataEndpoint = class extends Endpoint {
11451
11459
  body: JSON.stringify(params)
11452
11460
  });
11453
11461
  }
11462
+ async downloadModelArtifacts(model_uuid, model_formats, device_name, artifact_type) {
11463
+ const artifactTypeQuery = artifact_type ? `artifact_type=${artifact_type}&` : "";
11464
+ const deviceNameQuery = device_name ? `device_name=${encodeURIComponent(device_name)}&` : "";
11465
+ let modelFormatQuery = "";
11466
+ if (model_formats) {
11467
+ for (const model_format of model_formats) {
11468
+ modelFormatQuery += `model_format=${model_format}&`;
11469
+ }
11470
+ }
11471
+ return this.request(`/exports/model_artifacts/?model_uuid=${model_uuid}&${artifactTypeQuery}${deviceNameQuery}${modelFormatQuery}`, {
11472
+ method: "GET"
11473
+ });
11474
+ }
11454
11475
  addAccountEventHandler(eventHandler) {
11455
11476
  this._account_event_handlers.push(eventHandler);
11456
11477
  }
@@ -11686,6 +11707,7 @@ var index_default = EyePop;
11686
11707
  0 && (module.exports = {
11687
11708
  AbstractJob,
11688
11709
  AnnotationType,
11710
+ ArtifactType,
11689
11711
  AssetStatus,
11690
11712
  ChangeType,
11691
11713
  ContourType,