@estuary-ai/sdk 0.2.1 → 0.4.0

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.
package/dist/index.mjs CHANGED
@@ -30878,6 +30878,9 @@ var SocketManager = class extends TypedEventEmitter {
30878
30878
  } else if (this.config.apiKey) {
30879
30879
  authPayload.api_key = this.config.apiKey;
30880
30880
  }
30881
+ if (this.config.capabilities) {
30882
+ authPayload.capabilities = { version: "1", ...this.config.capabilities };
30883
+ }
30881
30884
  this.socket.emit("authenticate", authPayload);
30882
30885
  };
30883
30886
  const onSessionInfo = (data) => {
@@ -31509,6 +31512,26 @@ var EstuaryClient = class extends TypedEventEmitter {
31509
31512
  }
31510
31513
  return this._character.getCharacter(characterId ?? this.config.characterId);
31511
31514
  }
31515
+ /**
31516
+ * Open a permanent share link. Calls the backend's /open endpoint to mint a
31517
+ * fresh session token and resolve character metadata (including modelUrl).
31518
+ * Use the returned fields to construct an EstuaryClient with sessionToken auth.
31519
+ */
31520
+ static async openShare(serverUrl, shareId) {
31521
+ const url2 = `${serverUrl.replace(/\/+$/, "")}/api/v1/share/${shareId}/open`;
31522
+ const res = await fetch(url2, {
31523
+ method: "POST",
31524
+ headers: { "Content-Type": "application/json" }
31525
+ });
31526
+ if (!res.ok) {
31527
+ const detail = await res.text().catch(() => "");
31528
+ throw new EstuaryError(
31529
+ "REST_ERROR" /* REST_ERROR */,
31530
+ `Share open failed (${res.status}): ${detail}`
31531
+ );
31532
+ }
31533
+ return res.json();
31534
+ }
31512
31535
  /** Current session info (null if not connected) */
31513
31536
  get session() {
31514
31537
  return this._sessionInfo;