@eyepop.ai/eyepop 0.18.7 → 0.19.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.
@@ -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): 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): 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,36 @@ 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
+ const body = {
9913
+ "transform": postTransform
9914
+ };
9915
+ let response = await this.fetchWithRetry(async () => {
9916
+ const session = await this.session();
9917
+ let headers = {
9918
+ "Authorization": `Bearer ${session.accessToken}`,
9919
+ "Content-Type": "application/json"
9920
+ };
9921
+ const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/postTransform`;
9922
+ return client.fetch(patch_url, {
9923
+ method: "PATCH",
9924
+ body: JSON.stringify(body),
9925
+ headers
9926
+ });
9927
+ });
9928
+ if (response.status != 204) {
9929
+ const message = await response.text();
9930
+ return Promise.reject(`Unexpected status ${response.status}: ${message}`);
9931
+ }
9932
+ if (this._pipeline) {
9933
+ this._pipeline.postTransform = postTransform;
9934
+ }
9935
+ }
9899
9936
  popId() {
9900
9937
  return this._options.popId || null;
9901
9938
  }
@@ -10368,10 +10405,19 @@ var Endpoint = class {
10368
10405
  } else {
10369
10406
  pipeline = "identity";
10370
10407
  }
10408
+ let postTransform;
10409
+ if (this._pipeline && this._pipeline.postTransform) {
10410
+ postTransform = this._pipeline.postTransform;
10411
+ } else {
10412
+ postTransform = null;
10413
+ }
10371
10414
  const body = {
10372
10415
  "inferPipelineDef": {
10373
10416
  "pipeline": pipeline
10374
10417
  },
10418
+ "postTransformDef": {
10419
+ "transform": postTransform
10420
+ },
10375
10421
  "source": {
10376
10422
  "sourceType": "NONE"
10377
10423
  },