@eyepop.ai/eyepop 0.18.1 → 0.18.2

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.
@@ -9864,16 +9864,16 @@ var Endpoint = class {
9864
9864
  if (!baseUrl || !client) {
9865
9865
  return Promise.reject("endpoint not connected, use connect() before changePopComp()");
9866
9866
  }
9867
- const patch_url = `${this._baseUrl}/pipelines/${this._pipelineId}/inferencePipeline`;
9868
9867
  const body = {
9869
9868
  "pipeline": popComp
9870
9869
  };
9871
- this._requestLogger.debug("before PATCH %s", patch_url);
9872
9870
  let response = await this.fetchWithRetry(async () => {
9871
+ const session = await this.session();
9873
9872
  let headers = {
9874
- "Authorization": await this.authorizationHeader(),
9873
+ "Authorization": session.accessToken,
9875
9874
  "Content-Type": "application/json"
9876
9875
  };
9876
+ const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/inferencePipeline`;
9877
9877
  return client.fetch(patch_url, {
9878
9878
  method: "PATCH",
9879
9879
  body: JSON.stringify(body),
@@ -9884,7 +9884,6 @@ var Endpoint = class {
9884
9884
  const message = await response.text();
9885
9885
  return Promise.reject(`Unexpected status ${response.status}: ${message}`);
9886
9886
  }
9887
- this._requestLogger.debug("after PATCH %s", patch_url);
9888
9887
  if (this._pipeline) {
9889
9888
  this._pipeline.inferPipeline = popComp;
9890
9889
  }
@@ -9930,14 +9929,14 @@ var Endpoint = class {
9930
9929
  const client = this._client;
9931
9930
  let result = await this.reconnect();
9932
9931
  if (this._baseUrl && this._options.stopJobs) {
9933
- const stop_url = `${this._baseUrl}/pipelines/${this._pipelineId}/source?mode=preempt&processing=sync`;
9934
9932
  const body = { "sourceType": "NONE" };
9935
- this._requestLogger.debug("before PATCH %s", stop_url);
9936
9933
  let response = await this.fetchWithRetry(async () => {
9934
+ const session = await this.session();
9937
9935
  const headers = {
9938
- "Authorization": await this.authorizationHeader(),
9936
+ "Authorization": session.accessToken,
9939
9937
  "Content-Type": "application/json"
9940
9938
  };
9939
+ const stop_url = `${session.baseUrl}/pipelines/${session.pipelineId}/source?mode=preempt&processing=sync`;
9941
9940
  return client.fetch(stop_url, {
9942
9941
  method: "PATCH",
9943
9942
  headers,
@@ -9948,7 +9947,6 @@ var Endpoint = class {
9948
9947
  const message = await response.text();
9949
9948
  return Promise.reject(`Unexpected status ${response.status}: ${message}`);
9950
9949
  }
9951
- this._requestLogger.debug("after PATCH %s", stop_url);
9952
9950
  }
9953
9951
  if (!this._ingressEventWs && this._ingressEventHandler) {
9954
9952
  await this.startIngressWs();
@@ -10028,12 +10026,12 @@ var Endpoint = class {
10028
10026
  return;
10029
10027
  }
10030
10028
  try {
10031
- const getTokenUrl = `${this._baseUrl}/liveIngress/events/token`;
10032
- this._requestLogger.debug("before GET %s", getTokenUrl);
10029
+ const session = await this.session();
10033
10030
  let response = await this.fetchWithRetry(async () => {
10034
10031
  const headers = {
10035
- "Authorization": await this.authorizationHeader()
10032
+ "Authorization": session.accessToken
10036
10033
  };
10034
+ const getTokenUrl = `${session.baseUrl}/liveIngress/events/token`;
10037
10035
  return client.fetch(getTokenUrl, { headers });
10038
10036
  });
10039
10037
  if (response.status != 200) {