@eyepop.ai/eyepop 3.17.1 → 3.17.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.
@@ -8854,8 +8854,8 @@ var ComputeSessionClient = class {
8854
8854
  if (pipelineFailure) {
8855
8855
  throw new Error(pipelineFailure);
8856
8856
  }
8857
- const accessToken = this.sessionAccessToken(session);
8858
- await this.waitUntilReady(session, accessToken);
8857
+ const authorizationHeader = await this.sessionAuthorizationHeader(session);
8858
+ await this.waitUntilReady(session, authorizationHeader);
8859
8859
  const pipelineId = pipelineIdFromSession(session);
8860
8860
  if (this.options.pop && !pipelineId) {
8861
8861
  throw new Error("Compute session did not provide a pipeline for the requested pop");
@@ -8863,7 +8863,7 @@ var ComputeSessionClient = class {
8863
8863
  return {
8864
8864
  session,
8865
8865
  pipelineId,
8866
- accessToken,
8866
+ accessToken: session.access_token || null,
8867
8867
  accessTokenValidUntil: accessTokenValidUntil(session)
8868
8868
  };
8869
8869
  }
@@ -8952,20 +8952,20 @@ var ComputeSessionClient = class {
8952
8952
  }
8953
8953
  return session;
8954
8954
  }
8955
- sessionAccessToken(session) {
8956
- if (!session.access_token) {
8957
- throw new Error(`Compute session ${session.session_uuid} did not provide an access token`);
8955
+ async sessionAuthorizationHeader(session) {
8956
+ if (session.access_token) {
8957
+ return `Bearer ${session.access_token}`;
8958
8958
  }
8959
- return session.access_token;
8959
+ return this.options.authorizationHeader();
8960
8960
  }
8961
- async waitUntilReady(session, accessToken) {
8961
+ async waitUntilReady(session, authorizationHeader) {
8962
8962
  let isReady = false;
8963
8963
  const deadline = Date.now() + this.options.readyTimeoutMs;
8964
8964
  while (!isReady) {
8965
8965
  const health_url = `${session.session_endpoint}/health`;
8966
8966
  const response = await this.options.httpClient.fetch(health_url, {
8967
8967
  headers: {
8968
- Authorization: `Bearer ${accessToken}`,
8968
+ Authorization: authorizationHeader,
8969
8969
  Accept: "application/json"
8970
8970
  }
8971
8971
  });