@eyepop.ai/eyepop 1.13.1 → 1.14.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 CHANGED
@@ -6,16 +6,27 @@ TypeScript or JavaScript language.
6
6
  ## Installation
7
7
 
8
8
  ### Node
9
-
9
+ EyePop Sdk is tested with the LTS versions `node v20.11.0` and `npm v10.2.4`. Getting started with:
10
10
  ```shell
11
11
  npm install --save @eyepop.ai/eyepop
12
12
  ```
13
+ See the [Node example folder](https://github.com/eyepop-ai/eyepop-sdk-node/blob/main/examples/node) for code examples.
13
14
 
14
15
  ### Browser
15
-
16
+ EyePop Sdk supports all model browsers and can be used with Javascript w/o any additional dependencies:
16
17
  ```html
17
18
  <script src="https://cdn.jsdelivr.net/npm/@eyepop.ai/eyepop/dist/eyepop.min.js"></script>
18
19
  ```
20
+ See the [Web example folder](https://github.com/eyepop-ai/eyepop-sdk-node/tree/main/examples/web/static) for code examples.
21
+
22
+ ### React Native
23
+ ```shell
24
+ npm install --save @eyepop.ai/eyepop
25
+ ```
26
+
27
+ See the [ReactNative example folder](https://github.com/eyepop-ai/eyepop-sdk-node/tree/main/examples/react_native/upload-example) for code
28
+ examples and tips for to debug your configuration.
29
+
19
30
 
20
31
  ## Configuration
21
32
 
@@ -286,21 +286,22 @@ declare enum VideoMode {
286
286
  }
287
287
  interface IngressEvent {
288
288
  readonly ingressId: string;
289
- readonly event: 'stream-ready' | 'stream-ready';
289
+ readonly event: 'stream-ready' | 'stream-not-ready';
290
290
  }
291
291
  interface FileSource {
292
292
  readonly file: File;
293
- readonly videoMode?: VideoMode;
293
+ readonly videoMode?: VideoMode | undefined;
294
294
  }
295
295
  interface StreamSource {
296
296
  readonly stream: ReadableStream<Uint8Array> | Blob | BufferSource;
297
297
  readonly mimeType: string;
298
- readonly videoMode?: VideoMode;
298
+ readonly size?: number | undefined;
299
+ readonly videoMode?: VideoMode | undefined;
299
300
  }
300
301
  interface PathSource {
301
302
  readonly path: string;
302
- readonly mimeType?: string;
303
- readonly videoMode?: VideoMode;
303
+ readonly mimeType?: string | undefined;
304
+ readonly videoMode?: VideoMode | undefined;
304
305
  }
305
306
  interface LiveSource {
306
307
  readonly ingressId: string;
@@ -801,6 +802,7 @@ declare class DataEndpoint extends Endpoint<DataEndpoint> {
801
802
  private dispatchChangeEvent;
802
803
  }
803
804
 
805
+ type Bytes = string | ArrayBuffer | Uint8Array | Buffer | null | undefined;
804
806
  interface StreamEvent {
805
807
  type: string;
806
808
  source_id?: string;
@@ -818,6 +820,23 @@ declare class Stream<Prediction> implements AsyncIterable<Prediction> {
818
820
  */
819
821
  tee(): [Stream<Prediction>, Stream<Prediction>];
820
822
  }
823
+ /**
824
+ * A re-implementation of httpx's `LineDecoder` in Python that handles incrementally
825
+ * reading lines from text.
826
+ *
827
+ * https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258
828
+ */
829
+ declare class EyepopLineDecoder {
830
+ static NEWLINE_CHARS: Set<string>;
831
+ static NEWLINE_REGEXP: RegExp;
832
+ buffer: string[];
833
+ trailingCR: boolean;
834
+ textDecoder: any;
835
+ constructor();
836
+ decode(chunk: Bytes): string[];
837
+ decodeText(bytes: Bytes): string;
838
+ flush(): string[];
839
+ }
821
840
 
822
841
  declare class AbstractJob implements ResultStream {
823
842
  protected _getSession: () => Promise<WorkerSession>;
@@ -837,10 +856,11 @@ declare class AbstractJob implements ResultStream {
837
856
  declare class UploadJob extends AbstractJob {
838
857
  private readonly _uploadStream;
839
858
  private readonly _mimeType;
859
+ private readonly _size;
840
860
  private readonly _needsFullDuplex;
841
861
  private readonly _videoMode;
842
862
  get [Symbol.toStringTag](): string;
843
- constructor(stream: ReadableStream<Uint8Array> | Blob | BufferSource, mimeType: string, videoMode: VideoMode | undefined, params: SourceParams | undefined, getSession: () => Promise<WorkerSession>, client: HttpClient, requestLogger: Logger);
863
+ constructor(stream: ReadableStream<Uint8Array> | Blob | BufferSource, mimeType: string, size: number | undefined, videoMode: VideoMode | undefined, params: SourceParams | undefined, getSession: () => Promise<WorkerSession>, client: HttpClient, requestLogger: Logger);
844
864
  protected onEvent(event: StreamEvent): Promise<void>;
845
865
  protected startJob(): Promise<Response>;
846
866
  }
@@ -920,4 +940,4 @@ declare namespace EyePop {
920
940
  function dataEndpoint(opts?: DataOptions): DataEndpoint;
921
941
  }
922
942
 
923
- export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type Auth0Options, type Authentication, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateTask, 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 DatasetParent, 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 LocalAuth, type Mask, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelInstanceDef, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, ModelTask, 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, VideoMode, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, EyePop as default };
943
+ export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type Auth0Options, type Authentication, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateTask, 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 DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type InferenceComponent, InferenceType, type IngressEvent, type LiveMedia, type LiveSource, LoadFromJob, LoadLiveIngressJob, type LocalAuth, type Mask, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelInstanceDef, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, ModelTask, 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, VideoMode, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, EyePop as default };
@@ -286,21 +286,22 @@ declare enum VideoMode {
286
286
  }
287
287
  interface IngressEvent {
288
288
  readonly ingressId: string;
289
- readonly event: 'stream-ready' | 'stream-ready';
289
+ readonly event: 'stream-ready' | 'stream-not-ready';
290
290
  }
291
291
  interface FileSource {
292
292
  readonly file: File;
293
- readonly videoMode?: VideoMode;
293
+ readonly videoMode?: VideoMode | undefined;
294
294
  }
295
295
  interface StreamSource {
296
296
  readonly stream: ReadableStream<Uint8Array> | Blob | BufferSource;
297
297
  readonly mimeType: string;
298
- readonly videoMode?: VideoMode;
298
+ readonly size?: number | undefined;
299
+ readonly videoMode?: VideoMode | undefined;
299
300
  }
300
301
  interface PathSource {
301
302
  readonly path: string;
302
- readonly mimeType?: string;
303
- readonly videoMode?: VideoMode;
303
+ readonly mimeType?: string | undefined;
304
+ readonly videoMode?: VideoMode | undefined;
304
305
  }
305
306
  interface LiveSource {
306
307
  readonly ingressId: string;
@@ -801,6 +802,7 @@ declare class DataEndpoint extends Endpoint<DataEndpoint> {
801
802
  private dispatchChangeEvent;
802
803
  }
803
804
 
805
+ type Bytes = string | ArrayBuffer | Uint8Array | Buffer | null | undefined;
804
806
  interface StreamEvent {
805
807
  type: string;
806
808
  source_id?: string;
@@ -818,6 +820,23 @@ declare class Stream<Prediction> implements AsyncIterable<Prediction> {
818
820
  */
819
821
  tee(): [Stream<Prediction>, Stream<Prediction>];
820
822
  }
823
+ /**
824
+ * A re-implementation of httpx's `LineDecoder` in Python that handles incrementally
825
+ * reading lines from text.
826
+ *
827
+ * https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258
828
+ */
829
+ declare class EyepopLineDecoder {
830
+ static NEWLINE_CHARS: Set<string>;
831
+ static NEWLINE_REGEXP: RegExp;
832
+ buffer: string[];
833
+ trailingCR: boolean;
834
+ textDecoder: any;
835
+ constructor();
836
+ decode(chunk: Bytes): string[];
837
+ decodeText(bytes: Bytes): string;
838
+ flush(): string[];
839
+ }
821
840
 
822
841
  declare class AbstractJob implements ResultStream {
823
842
  protected _getSession: () => Promise<WorkerSession>;
@@ -837,10 +856,11 @@ declare class AbstractJob implements ResultStream {
837
856
  declare class UploadJob extends AbstractJob {
838
857
  private readonly _uploadStream;
839
858
  private readonly _mimeType;
859
+ private readonly _size;
840
860
  private readonly _needsFullDuplex;
841
861
  private readonly _videoMode;
842
862
  get [Symbol.toStringTag](): string;
843
- constructor(stream: ReadableStream<Uint8Array> | Blob | BufferSource, mimeType: string, videoMode: VideoMode | undefined, params: SourceParams | undefined, getSession: () => Promise<WorkerSession>, client: HttpClient, requestLogger: Logger);
863
+ constructor(stream: ReadableStream<Uint8Array> | Blob | BufferSource, mimeType: string, size: number | undefined, videoMode: VideoMode | undefined, params: SourceParams | undefined, getSession: () => Promise<WorkerSession>, client: HttpClient, requestLogger: Logger);
844
864
  protected onEvent(event: StreamEvent): Promise<void>;
845
865
  protected startJob(): Promise<Response>;
846
866
  }
@@ -920,4 +940,4 @@ declare namespace EyePop {
920
940
  function dataEndpoint(opts?: DataOptions): DataEndpoint;
921
941
  }
922
942
 
923
- export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type Auth0Options, type Authentication, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateTask, 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 DatasetParent, 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 LocalAuth, type Mask, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelInstanceDef, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, ModelTask, 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, VideoMode, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, EyePop as default };
943
+ export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type Auth0Options, type Authentication, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateTask, 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 DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type InferenceComponent, InferenceType, type IngressEvent, type LiveMedia, type LiveSource, LoadFromJob, LoadLiveIngressJob, type LocalAuth, type Mask, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelInstanceDef, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, ModelTask, 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, VideoMode, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, EyePop as default };