@eyepop.ai/eyepop 0.10.0 → 0.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.
@@ -1,3 +1,17 @@
1
+ /*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
5
+ * @license MIT
6
+ */
7
+
8
+ /*!
9
+ * The buffer module from node.js, for the browser.
10
+ *
11
+ * @author Feross Aboukhadijeh <https://feross.org>
12
+ * @license MIT
13
+ */
14
+
1
15
  /*! Bundled license information:
2
16
 
3
17
  mime-db/index.js:
@@ -16,3 +30,7 @@ mime-types/index.js:
16
30
  * MIT Licensed
17
31
  *)
18
32
  */
33
+
34
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
35
+
36
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
package/dist/index.d.mts CHANGED
@@ -19,6 +19,14 @@ declare enum EndpointState {
19
19
  StartingPop = "StartingPop",
20
20
  Error = "Error"
21
21
  }
22
+ interface LiveIngress {
23
+ ingressId(): string;
24
+ close(): Promise<void>;
25
+ }
26
+ interface IngressEvent {
27
+ readonly ingressId?: string;
28
+ readonly event?: "stream-ready" | "stream-ready";
29
+ }
22
30
  interface UploadParams {
23
31
  readonly filePath?: string | undefined;
24
32
  readonly file?: File | undefined;
@@ -74,6 +82,9 @@ interface PredictedKeyPoints {
74
82
  }
75
83
  interface PredictedKeyPoint extends Point3d, PredictedClass {
76
84
  }
85
+ interface ResultStream extends AsyncIterable<Prediction> {
86
+ cancel(): void;
87
+ }
77
88
 
78
89
  interface Authentication {
79
90
  /**
@@ -109,10 +120,6 @@ interface Options {
109
120
  logger?: Logger | undefined;
110
121
  }
111
122
 
112
- interface ResultStream extends AsyncIterable<Prediction> {
113
- cancel(): void;
114
- }
115
-
116
123
  declare class Endpoint {
117
124
  private _options;
118
125
  private _token;
@@ -124,17 +131,23 @@ declare class Endpoint {
124
131
  private _limit;
125
132
  private _state;
126
133
  private _stateChangeHandler;
134
+ private _ingressEventHandler;
135
+ private _ingressEventWs;
127
136
  private _logger;
128
137
  private readonly _requestLogger;
129
138
  constructor(options: Options);
130
139
  onStateChanged(handler: (fromState: EndpointState, toState: EndpointState) => void): Endpoint;
140
+ private startIngressWs;
141
+ onIngressEvent(handler: (event: IngressEvent) => void): Endpoint;
131
142
  state(): EndpointState;
132
143
  pendingJobs(): number;
133
144
  popName(): string | null;
134
145
  popId(): string | null;
135
146
  session(): Promise<SessionPlus>;
147
+ liveIngress(stream: MediaStream): Promise<LiveIngress>;
136
148
  upload(params: UploadParams): Promise<ResultStream>;
137
149
  loadFrom(location: string): Promise<ResultStream>;
150
+ loadLiveIngress(ingressId: string): Promise<ResultStream>;
138
151
  connect(): Promise<Endpoint>;
139
152
  private jobDone;
140
153
  private updateState;
@@ -161,7 +174,7 @@ declare class EyePopPlot {
161
174
  blank_color: string;
162
175
  };
163
176
  prediction(p: Prediction): void;
164
- object(obj: PredictedObject, x_scale: number, y_scale: number): void;
177
+ object(obj: PredictedObject, x_scale?: number, y_scale?: number): void;
165
178
  static toTitleCase(str: string): string;
166
179
  }
167
180
 
@@ -173,4 +186,4 @@ declare class EyePopSdk {
173
186
  static plot(context: CanvasRenderingContext2D): EyePopPlot;
174
187
  }
175
188
 
176
- export { EndpointState, EyePopSdk, type Point2d, type Point3d, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type Prediction, type Session, type UploadParams, EyePopSdk as default };
189
+ export { EndpointState, EyePopSdk, type IngressEvent, type LiveIngress, type Point2d, type Point3d, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type Prediction, type ResultStream, type Session, type UploadParams, EyePopSdk as default };
package/dist/index.d.ts CHANGED
@@ -19,6 +19,14 @@ declare enum EndpointState {
19
19
  StartingPop = "StartingPop",
20
20
  Error = "Error"
21
21
  }
22
+ interface LiveIngress {
23
+ ingressId(): string;
24
+ close(): Promise<void>;
25
+ }
26
+ interface IngressEvent {
27
+ readonly ingressId?: string;
28
+ readonly event?: "stream-ready" | "stream-ready";
29
+ }
22
30
  interface UploadParams {
23
31
  readonly filePath?: string | undefined;
24
32
  readonly file?: File | undefined;
@@ -74,6 +82,9 @@ interface PredictedKeyPoints {
74
82
  }
75
83
  interface PredictedKeyPoint extends Point3d, PredictedClass {
76
84
  }
85
+ interface ResultStream extends AsyncIterable<Prediction> {
86
+ cancel(): void;
87
+ }
77
88
 
78
89
  interface Authentication {
79
90
  /**
@@ -109,10 +120,6 @@ interface Options {
109
120
  logger?: Logger | undefined;
110
121
  }
111
122
 
112
- interface ResultStream extends AsyncIterable<Prediction> {
113
- cancel(): void;
114
- }
115
-
116
123
  declare class Endpoint {
117
124
  private _options;
118
125
  private _token;
@@ -124,17 +131,23 @@ declare class Endpoint {
124
131
  private _limit;
125
132
  private _state;
126
133
  private _stateChangeHandler;
134
+ private _ingressEventHandler;
135
+ private _ingressEventWs;
127
136
  private _logger;
128
137
  private readonly _requestLogger;
129
138
  constructor(options: Options);
130
139
  onStateChanged(handler: (fromState: EndpointState, toState: EndpointState) => void): Endpoint;
140
+ private startIngressWs;
141
+ onIngressEvent(handler: (event: IngressEvent) => void): Endpoint;
131
142
  state(): EndpointState;
132
143
  pendingJobs(): number;
133
144
  popName(): string | null;
134
145
  popId(): string | null;
135
146
  session(): Promise<SessionPlus>;
147
+ liveIngress(stream: MediaStream): Promise<LiveIngress>;
136
148
  upload(params: UploadParams): Promise<ResultStream>;
137
149
  loadFrom(location: string): Promise<ResultStream>;
150
+ loadLiveIngress(ingressId: string): Promise<ResultStream>;
138
151
  connect(): Promise<Endpoint>;
139
152
  private jobDone;
140
153
  private updateState;
@@ -161,7 +174,7 @@ declare class EyePopPlot {
161
174
  blank_color: string;
162
175
  };
163
176
  prediction(p: Prediction): void;
164
- object(obj: PredictedObject, x_scale: number, y_scale: number): void;
177
+ object(obj: PredictedObject, x_scale?: number, y_scale?: number): void;
165
178
  static toTitleCase(str: string): string;
166
179
  }
167
180
 
@@ -173,4 +186,4 @@ declare class EyePopSdk {
173
186
  static plot(context: CanvasRenderingContext2D): EyePopPlot;
174
187
  }
175
188
 
176
- export { EndpointState, EyePopSdk, type Point2d, type Point3d, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type Prediction, type Session, type UploadParams, EyePopSdk as default };
189
+ export { EndpointState, EyePopSdk, type IngressEvent, type LiveIngress, type Point2d, type Point3d, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type Prediction, type ResultStream, type Session, type UploadParams, EyePopSdk as default };