@estuary-ai/sdk 0.2.1 → 0.3.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/LICENSE +21 -21
- package/dist/index.d.mts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +70 -70
package/dist/index.mjs
CHANGED
|
@@ -31509,6 +31509,26 @@ var EstuaryClient = class extends TypedEventEmitter {
|
|
|
31509
31509
|
}
|
|
31510
31510
|
return this._character.getCharacter(characterId ?? this.config.characterId);
|
|
31511
31511
|
}
|
|
31512
|
+
/**
|
|
31513
|
+
* Open a permanent share link. Calls the backend's /open endpoint to mint a
|
|
31514
|
+
* fresh session token and resolve character metadata (including modelUrl).
|
|
31515
|
+
* Use the returned fields to construct an EstuaryClient with sessionToken auth.
|
|
31516
|
+
*/
|
|
31517
|
+
static async openShare(serverUrl, shareId) {
|
|
31518
|
+
const url2 = `${serverUrl.replace(/\/+$/, "")}/api/v1/share/${shareId}/open`;
|
|
31519
|
+
const res = await fetch(url2, {
|
|
31520
|
+
method: "POST",
|
|
31521
|
+
headers: { "Content-Type": "application/json" }
|
|
31522
|
+
});
|
|
31523
|
+
if (!res.ok) {
|
|
31524
|
+
const detail = await res.text().catch(() => "");
|
|
31525
|
+
throw new EstuaryError(
|
|
31526
|
+
"REST_ERROR" /* REST_ERROR */,
|
|
31527
|
+
`Share open failed (${res.status}): ${detail}`
|
|
31528
|
+
);
|
|
31529
|
+
}
|
|
31530
|
+
return res.json();
|
|
31531
|
+
}
|
|
31512
31532
|
/** Current session info (null if not connected) */
|
|
31513
31533
|
get session() {
|
|
31514
31534
|
return this._sessionInfo;
|