@eyepop.ai/eyepop 1.11.6 → 1.11.7

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.
@@ -18,11 +18,11 @@ interface Box {
18
18
  readonly bottomRight: Point2d;
19
19
  }
20
20
  interface Roi {
21
- readonly points: Point2d[] | undefined;
22
- readonly boxes: Box[] | undefined;
21
+ readonly points?: Point2d[];
22
+ readonly boxes?: Box[];
23
23
  }
24
24
  interface SourceParams {
25
- readonly roi: Roi | undefined;
25
+ readonly roi?: Roi;
26
26
  }
27
27
  interface StreamTime {
28
28
  timestamp?: number;
@@ -455,7 +455,7 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
455
455
  onIngressEvent(handler: (event: IngressEvent) => void): WorkerEndpoint;
456
456
  liveIngress(stream: MediaStream): Promise<LiveMedia>;
457
457
  liveEgress(ingressId: string): Promise<LiveMedia>;
458
- process(source: Source, params?: SourceParams | undefined): Promise<ResultStream>;
458
+ process(source: Source, params?: SourceParams): Promise<ResultStream>;
459
459
  private startIngressWs;
460
460
  private uploadFile;
461
461
  private uploadStream;
@@ -825,7 +825,7 @@ declare class UploadJob extends AbstractJob {
825
825
  private readonly _mimeType;
826
826
  private readonly _needsFullDuplex;
827
827
  get [Symbol.toStringTag](): string;
828
- constructor(stream: any, mimeType: string, params: SourceParams | undefined, getSession: () => Promise<WorkerSession>, client: HttpClient, requestLogger: Logger);
828
+ constructor(stream: ReadableStream<Uint8Array>, mimeType: string, params: SourceParams | undefined, getSession: () => Promise<WorkerSession>, client: HttpClient, requestLogger: Logger);
829
829
  protected onEvent(event: StreamEvent): Promise<void>;
830
830
  protected startJob(): Promise<Response>;
831
831
  }
@@ -18,11 +18,11 @@ interface Box {
18
18
  readonly bottomRight: Point2d;
19
19
  }
20
20
  interface Roi {
21
- readonly points: Point2d[] | undefined;
22
- readonly boxes: Box[] | undefined;
21
+ readonly points?: Point2d[];
22
+ readonly boxes?: Box[];
23
23
  }
24
24
  interface SourceParams {
25
- readonly roi: Roi | undefined;
25
+ readonly roi?: Roi;
26
26
  }
27
27
  interface StreamTime {
28
28
  timestamp?: number;
@@ -455,7 +455,7 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
455
455
  onIngressEvent(handler: (event: IngressEvent) => void): WorkerEndpoint;
456
456
  liveIngress(stream: MediaStream): Promise<LiveMedia>;
457
457
  liveEgress(ingressId: string): Promise<LiveMedia>;
458
- process(source: Source, params?: SourceParams | undefined): Promise<ResultStream>;
458
+ process(source: Source, params?: SourceParams): Promise<ResultStream>;
459
459
  private startIngressWs;
460
460
  private uploadFile;
461
461
  private uploadStream;
@@ -825,7 +825,7 @@ declare class UploadJob extends AbstractJob {
825
825
  private readonly _mimeType;
826
826
  private readonly _needsFullDuplex;
827
827
  get [Symbol.toStringTag](): string;
828
- constructor(stream: any, mimeType: string, params: SourceParams | undefined, getSession: () => Promise<WorkerSession>, client: HttpClient, requestLogger: Logger);
828
+ constructor(stream: ReadableStream<Uint8Array>, mimeType: string, params: SourceParams | undefined, getSession: () => Promise<WorkerSession>, client: HttpClient, requestLogger: Logger);
829
829
  protected onEvent(event: StreamEvent): Promise<void>;
830
830
  protected startJob(): Promise<Response>;
831
831
  }
@@ -8987,8 +8987,9 @@ var UploadJob = class extends AbstractJob {
8987
8987
  const params = JSON.stringify(this._params);
8988
8988
  const paramBlob = new Blob([params], { type: "application/json" });
8989
8989
  const formData = new FormData();
8990
+ const fileBlob = await new Response(this._uploadStream).blob();
8990
8991
  formData.append("params", paramBlob);
8991
- formData.append("file", this._uploadStream);
8992
+ formData.append("file", fileBlob);
8992
8993
  const headers = {
8993
8994
  ...session.authenticationHeaders(),
8994
8995
  Accept: "application/jsonl"
@@ -9057,8 +9058,9 @@ var UploadJob = class extends AbstractJob {
9057
9058
  const params = JSON.stringify(this._params);
9058
9059
  const paramBlob = new Blob([params], { type: "application/json" });
9059
9060
  const formData = new FormData();
9061
+ const fileBlob = await new Response(this._uploadStream).blob();
9060
9062
  formData.append("params", paramBlob);
9061
- formData.append("file", this._uploadStream);
9063
+ formData.append("file", fileBlob);
9062
9064
  const headers = {
9063
9065
  ...session.authenticationHeaders(),
9064
9066
  Accept: "application/jsonl"
@@ -9640,7 +9642,6 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
9640
9642
  }
9641
9643
  }
9642
9644
  createHttpClient = async () => {
9643
- console.debug("EyePop: creating HttpClient in browser");
9644
9645
  return new BrowserHttpClient();
9645
9646
  };
9646
9647
  } else if (typeof navigator !== "undefined" && navigator.product === "ReactNative") {
@@ -9656,7 +9657,6 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
9656
9657
  }
9657
9658
  }
9658
9659
  createHttpClient = async () => {
9659
- console.debug("EyePop: creating HttpClient in ReactNative");
9660
9660
  return new ReactNativeHttpClient();
9661
9661
  };
9662
9662
  } else {
@@ -9674,7 +9674,6 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
9674
9674
  }
9675
9675
  }
9676
9676
  createHttpClient = async () => {
9677
- console.debug("EyePop: creating HttpClient with undici agent in Node");
9678
9677
  const undici = require("undici");
9679
9678
  const agent = new undici.Agent({
9680
9679
  keepAliveTimeout: 1e4,
@@ -10329,7 +10328,7 @@ var WorkerEndpoint = class extends Endpoint {
10329
10328
  );
10330
10329
  return whep.start();
10331
10330
  }
10332
- async process(source, params = void 0) {
10331
+ async process(source, params) {
10333
10332
  if (source.file !== void 0) {
10334
10333
  return this.uploadFile(source, params);
10335
10334
  } else if (source.stream !== void 0) {
@@ -10383,7 +10382,7 @@ var WorkerEndpoint = class extends Endpoint {
10383
10382
  try {
10384
10383
  this.updateState();
10385
10384
  const job = new UploadJob(
10386
- source.file,
10385
+ source.file.stream(),
10387
10386
  source.file.type,
10388
10387
  params,
10389
10388
  async () => {