@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.
@@ -9837,6 +9837,13 @@ var Endpoint = class {
9837
9837
  return null;
9838
9838
  }
9839
9839
  }
9840
+ postTransform() {
9841
+ if (this._pipeline) {
9842
+ return this._pipeline.postTransform;
9843
+ } else {
9844
+ return null;
9845
+ }
9846
+ }
9840
9847
  async changePopComp(popComp) {
9841
9848
  const client = this._client;
9842
9849
  const baseUrl = this._baseUrl;
@@ -9867,6 +9874,37 @@ var Endpoint = class {
9867
9874
  this._pipeline.inferPipeline = popComp;
9868
9875
  }
9869
9876
  }
9877
+ async changePostTransform(postTransform) {
9878
+ const client = this._client;
9879
+ const baseUrl = this._baseUrl;
9880
+ if (!baseUrl || !client) {
9881
+ return Promise.reject("endpoint not connected, use connect() before changePopComp()");
9882
+ }
9883
+ postTransform = postTransform ? postTransform : null;
9884
+ const body = {
9885
+ "transform": postTransform
9886
+ };
9887
+ let response = await this.fetchWithRetry(async () => {
9888
+ const session = await this.session();
9889
+ let headers = {
9890
+ "Authorization": `Bearer ${session.accessToken}`,
9891
+ "Content-Type": "application/json"
9892
+ };
9893
+ const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/postTransform`;
9894
+ return client.fetch(patch_url, {
9895
+ method: "PATCH",
9896
+ body: JSON.stringify(body),
9897
+ headers
9898
+ });
9899
+ });
9900
+ if (response.status != 204) {
9901
+ const message = await response.text();
9902
+ return Promise.reject(`Unexpected status ${response.status}: ${message}`);
9903
+ }
9904
+ if (this._pipeline) {
9905
+ this._pipeline.postTransform = postTransform;
9906
+ }
9907
+ }
9870
9908
  popId() {
9871
9909
  return this._options.popId || null;
9872
9910
  }
@@ -10339,10 +10377,19 @@ var Endpoint = class {
10339
10377
  } else {
10340
10378
  pipeline = "identity";
10341
10379
  }
10380
+ let postTransform;
10381
+ if (this._pipeline && this._pipeline.postTransform) {
10382
+ postTransform = this._pipeline.postTransform;
10383
+ } else {
10384
+ postTransform = null;
10385
+ }
10342
10386
  const body = {
10343
10387
  "inferPipelineDef": {
10344
10388
  "pipeline": pipeline
10345
10389
  },
10390
+ "postTransformDef": {
10391
+ "transform": postTransform
10392
+ },
10346
10393
  "source": {
10347
10394
  "sourceType": "NONE"
10348
10395
  },