@phpsandbox/sdk 0.0.66 → 0.0.67

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.
@@ -678,8 +678,8 @@ var PHPSandbox = (() => {
678
678
  logout() {
679
679
  this.okra.dispose();
680
680
  }
681
- login(okraUrl) {
682
- const runtimeTicket = new URL(okraUrl).searchParams.get("ticket");
681
+ login(runtimeUrl) {
682
+ const runtimeTicket = new URL(runtimeUrl).searchParams.get("ticket");
683
683
  if (runtimeTicket === null || runtimeTicket === "") {
684
684
  throw new TypeError("The notebook connection does not contain a runtime ticket.");
685
685
  }
@@ -19535,8 +19535,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19535
19535
  if (this.started) {
19536
19536
  return this;
19537
19537
  }
19538
- if (!this.initial.data.okraUrl) {
19539
- throw new Error(`Deployment ${this.initial.data.id} has no okraUrl for SSE streaming`);
19538
+ const eventStreamUrl = this.initial.data.eventStreamUrl ?? this.initial.data.okraUrl;
19539
+ if (!eventStreamUrl) {
19540
+ throw new Error(`Deployment ${this.initial.data.id} has no eventStreamUrl for SSE streaming`);
19540
19541
  }
19541
19542
  this.started = true;
19542
19543
  this.resultPromise = new Promise((resolve, reject) => {
@@ -19544,7 +19545,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19544
19545
  this.rejectResult = reject;
19545
19546
  });
19546
19547
  this.resultPromise.catch(() => void 0);
19547
- void this.consumeStream(this.initial.data.okraUrl);
19548
+ void this.consumeStream(eventStreamUrl);
19548
19549
  return this;
19549
19550
  }
19550
19551
  subscribe() {
@@ -19561,9 +19562,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19561
19562
  }
19562
19563
  return queue;
19563
19564
  }
19564
- async consumeStream(okraUrl) {
19565
+ async consumeStream(eventStreamUrl) {
19565
19566
  try {
19566
- const stream = await this.client.sse(okraUrl);
19567
+ const stream = await this.client.sse(eventStreamUrl);
19567
19568
  for await (const event of readDeployStreamEvents(stream)) {
19568
19569
  this.publish(event);
19569
19570
  if (event.type === "result") {
@@ -19962,20 +19963,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19962
19963
  this.refresh = refresh;
19963
19964
  this.refreshPromise = null;
19964
19965
  this.notebookId = data.id;
19965
- this.configure(data.okraUrl);
19966
+ this.configure(data.runtimeUrl ?? data.okraUrl);
19966
19967
  }
19967
- configure(connectionUrl) {
19968
- const okraUrl = new URL(connectionUrl);
19969
- const ticket = okraUrl.searchParams.get("ticket") ?? "";
19968
+ configure(runtimeUrl) {
19969
+ const actionUrl = new URL(runtimeUrl);
19970
+ const ticket = actionUrl.searchParams.get("ticket") ?? "";
19970
19971
  if (ticket === "") {
19971
19972
  throw new UnsupportedRuntimeTransportError("The notebook connection does not contain a runtime ticket.");
19972
19973
  }
19973
19974
  this.ticket = ticket;
19974
- okraUrl.protocol = okraUrl.protocol === "wss:" ? "https:" : "http:";
19975
- okraUrl.pathname = `/api/v1/notebooks/${encodeURIComponent(this.notebookId)}`;
19976
- okraUrl.searchParams.delete("ticket");
19977
- okraUrl.hash = "";
19978
- this.actionUrl = okraUrl;
19975
+ actionUrl.protocol = actionUrl.protocol === "wss:" ? "https:" : "http:";
19976
+ actionUrl.pathname = `/api/v1/notebooks/${encodeURIComponent(this.notebookId)}`;
19977
+ actionUrl.searchParams.delete("ticket");
19978
+ actionUrl.hash = "";
19979
+ this.actionUrl = actionUrl;
19979
19980
  }
19980
19981
  ready() {
19981
19982
  return this.invokeRaw("runtime.ready", {}, {});
@@ -20033,7 +20034,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
20033
20034
  }
20034
20035
  async refreshAuthorization() {
20035
20036
  if (this.refreshPromise === null) {
20036
- this.refreshPromise = this.refresh().then((okraUrl) => this.configure(okraUrl));
20037
+ this.refreshPromise = this.refresh().then((runtimeUrl) => this.configure(runtimeUrl));
20037
20038
  }
20038
20039
  try {
20039
20040
  await this.refreshPromise;
@@ -20429,23 +20430,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
20429
20430
  this.initialized = false;
20430
20431
  __privateAdd(this, _initPromise, null);
20431
20432
  this.disposables = [];
20433
+ const runtimeUrl = data.runtimeUrl ?? data.okraUrl;
20434
+ const runtimeUrlProvider = client.options.runtimeUrlProvider ?? client.options.okraUrlProvider;
20432
20435
  this.emitter = EventManager.createInstance();
20433
20436
  if (client.runtimeTransport === "rest") {
20434
20437
  this.socket = null;
20435
20438
  this.restInvoker = new RestRuntimeInvoker(
20436
20439
  data,
20437
20440
  client.options.fetch ?? globalThis.fetch,
20438
- client.options.okraUrlProvider === void 0 ? void 0 : () => client.options.okraUrlProvider(data.id)
20441
+ runtimeUrlProvider === void 0 ? void 0 : () => runtimeUrlProvider(data.id)
20439
20442
  );
20440
20443
  } else {
20441
20444
  this.restInvoker = null;
20442
20445
  let initialConnection = true;
20443
- const connectionUrl = client.options.okraUrlProvider === void 0 ? data.okraUrl : async () => {
20446
+ const connectionUrl = runtimeUrlProvider === void 0 ? runtimeUrl : async () => {
20444
20447
  if (initialConnection) {
20445
20448
  initialConnection = false;
20446
- return data.okraUrl;
20449
+ return runtimeUrl;
20447
20450
  }
20448
- return client.options.okraUrlProvider(data.id);
20451
+ return runtimeUrlProvider(data.id);
20449
20452
  };
20450
20453
  this.socket = new Transport(connectionUrl, this.emitter, {
20451
20454
  debug: client.options.debug,