@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.
@@ -8769,8 +8769,8 @@ var ComputeSessionClient = class {
8769
8769
  if (pipelineFailure) {
8770
8770
  throw new Error(pipelineFailure);
8771
8771
  }
8772
- const accessToken = this.sessionAccessToken(session);
8773
- await this.waitUntilReady(session, accessToken);
8772
+ const authorizationHeader = await this.sessionAuthorizationHeader(session);
8773
+ await this.waitUntilReady(session, authorizationHeader);
8774
8774
  const pipelineId = pipelineIdFromSession(session);
8775
8775
  if (this.options.pop && !pipelineId) {
8776
8776
  throw new Error("Compute session did not provide a pipeline for the requested pop");
@@ -8778,7 +8778,7 @@ var ComputeSessionClient = class {
8778
8778
  return {
8779
8779
  session,
8780
8780
  pipelineId,
8781
- accessToken,
8781
+ accessToken: session.access_token || null,
8782
8782
  accessTokenValidUntil: accessTokenValidUntil(session)
8783
8783
  };
8784
8784
  }
@@ -8867,20 +8867,20 @@ var ComputeSessionClient = class {
8867
8867
  }
8868
8868
  return session;
8869
8869
  }
8870
- sessionAccessToken(session) {
8871
- if (!session.access_token) {
8872
- throw new Error(`Compute session ${session.session_uuid} did not provide an access token`);
8870
+ async sessionAuthorizationHeader(session) {
8871
+ if (session.access_token) {
8872
+ return `Bearer ${session.access_token}`;
8873
8873
  }
8874
- return session.access_token;
8874
+ return this.options.authorizationHeader();
8875
8875
  }
8876
- async waitUntilReady(session, accessToken) {
8876
+ async waitUntilReady(session, authorizationHeader) {
8877
8877
  let isReady = false;
8878
8878
  const deadline = Date.now() + this.options.readyTimeoutMs;
8879
8879
  while (!isReady) {
8880
8880
  const health_url = `${session.session_endpoint}/health`;
8881
8881
  const response = await this.options.httpClient.fetch(health_url, {
8882
8882
  headers: {
8883
- Authorization: `Bearer ${accessToken}`,
8883
+ Authorization: authorizationHeader,
8884
8884
  Accept: "application/json"
8885
8885
  }
8886
8886
  });