@eyepop.ai/eyepop 0.18.7 → 0.19.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.
@@ -204,7 +204,9 @@ declare class Endpoint {
204
204
  pendingJobs(): number;
205
205
  popName(): string | null;
206
206
  popComp(): string | null;
207
+ postTransform(): string | null;
207
208
  changePopComp(popComp: string): Promise<void>;
209
+ changePostTransform(postTransform: string | null): Promise<void>;
208
210
  popId(): string | null;
209
211
  onStateChanged(handler: (fromState: EndpointState, toState: EndpointState) => void): Endpoint;
210
212
  onIngressEvent(handler: (event: IngressEvent) => void): Endpoint;
@@ -204,7 +204,9 @@ declare class Endpoint {
204
204
  pendingJobs(): number;
205
205
  popName(): string | null;
206
206
  popComp(): string | null;
207
+ postTransform(): string | null;
207
208
  changePopComp(popComp: string): Promise<void>;
209
+ changePostTransform(postTransform: string | null): Promise<void>;
208
210
  popId(): string | null;
209
211
  onStateChanged(handler: (fromState: EndpointState, toState: EndpointState) => void): Endpoint;
210
212
  onIngressEvent(handler: (event: IngressEvent) => void): Endpoint;
@@ -9866,6 +9866,13 @@ var Endpoint = class {
9866
9866
  return null;
9867
9867
  }
9868
9868
  }
9869
+ postTransform() {
9870
+ if (this._pipeline) {
9871
+ return this._pipeline.postTransform;
9872
+ } else {
9873
+ return null;
9874
+ }
9875
+ }
9869
9876
  async changePopComp(popComp) {
9870
9877
  const client = this._client;
9871
9878
  const baseUrl = this._baseUrl;
@@ -9896,6 +9903,37 @@ var Endpoint = class {
9896
9903
  this._pipeline.inferPipeline = popComp;
9897
9904
  }
9898
9905
  }
9906
+ async changePostTransform(postTransform) {
9907
+ const client = this._client;
9908
+ const baseUrl = this._baseUrl;
9909
+ if (!baseUrl || !client) {
9910
+ return Promise.reject("endpoint not connected, use connect() before changePopComp()");
9911
+ }
9912
+ postTransform = postTransform ? postTransform : null;
9913
+ const body = {
9914
+ "transform": postTransform
9915
+ };
9916
+ let response = await this.fetchWithRetry(async () => {
9917
+ const session = await this.session();
9918
+ let headers = {
9919
+ "Authorization": `Bearer ${session.accessToken}`,
9920
+ "Content-Type": "application/json"
9921
+ };
9922
+ const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/postTransform`;
9923
+ return client.fetch(patch_url, {
9924
+ method: "PATCH",
9925
+ body: JSON.stringify(body),
9926
+ headers
9927
+ });
9928
+ });
9929
+ if (response.status != 204) {
9930
+ const message = await response.text();
9931
+ return Promise.reject(`Unexpected status ${response.status}: ${message}`);
9932
+ }
9933
+ if (this._pipeline) {
9934
+ this._pipeline.postTransform = postTransform;
9935
+ }
9936
+ }
9899
9937
  popId() {
9900
9938
  return this._options.popId || null;
9901
9939
  }
@@ -10368,10 +10406,19 @@ var Endpoint = class {
10368
10406
  } else {
10369
10407
  pipeline = "identity";
10370
10408
  }
10409
+ let postTransform;
10410
+ if (this._pipeline && this._pipeline.postTransform) {
10411
+ postTransform = this._pipeline.postTransform;
10412
+ } else {
10413
+ postTransform = null;
10414
+ }
10371
10415
  const body = {
10372
10416
  "inferPipelineDef": {
10373
10417
  "pipeline": pipeline
10374
10418
  },
10419
+ "postTransformDef": {
10420
+ "transform": postTransform
10421
+ },
10375
10422
  "source": {
10376
10423
  "sourceType": "NONE"
10377
10424
  },