@sealant/sdk 0.14.0 → 0.15.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/facade/workspace.js +5 -2
- package/dist/types.d.ts +13 -6
- package/package.json +2 -2
package/dist/facade/workspace.js
CHANGED
|
@@ -189,7 +189,7 @@ export const makeWorkspace = (ctx, init) => {
|
|
|
189
189
|
...(ttl === undefined ? {} : { ttlSeconds: ttl === null ? null : parseTtlSeconds(ttl) }),
|
|
190
190
|
}));
|
|
191
191
|
},
|
|
192
|
-
forward: (port) => openForward(ctx, init.id, port),
|
|
192
|
+
forward: (port, options) => openForward(ctx, init.id, port, options),
|
|
193
193
|
};
|
|
194
194
|
return workspace;
|
|
195
195
|
};
|
|
@@ -202,11 +202,14 @@ export const makeWorkspace = (ctx, init) => {
|
|
|
202
202
|
* upgrade with a plain HTTP status when nothing listens on the port, which
|
|
203
203
|
* surfaces here as the connect rejection.
|
|
204
204
|
*/
|
|
205
|
-
const openForward = (ctx, workspaceId, port) => {
|
|
205
|
+
const openForward = (ctx, workspaceId, port, options) => {
|
|
206
206
|
const config = ctx.config;
|
|
207
207
|
const url = new URL(`/v1/workspaces/${workspaceId}/forward`, config.baseUrl);
|
|
208
208
|
url.protocol = url.protocol === "https:" ? "wss:" : "ws:";
|
|
209
209
|
url.searchParams.set("port", String(port));
|
|
210
|
+
if (options?.host !== undefined) {
|
|
211
|
+
url.searchParams.set("host", options.host);
|
|
212
|
+
}
|
|
210
213
|
if (config.apiKey === undefined) {
|
|
211
214
|
url.searchParams.set("ownerUserId", config.hostLocal.ownerUserId);
|
|
212
215
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -221,13 +221,20 @@ export interface Workspace {
|
|
|
221
221
|
readonly in?: string | null;
|
|
222
222
|
}): Promise<void>;
|
|
223
223
|
/**
|
|
224
|
-
* Open a raw TCP byte pipe
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
224
|
+
* Open a raw TCP byte pipe INSIDE the workspace — the primitive for
|
|
225
|
+
* reaching a dev server or database the workspace runs. Protocol-agnostic:
|
|
226
|
+
* nothing inspects or records the payload. One held WebSocket per forward;
|
|
227
|
+
* rejects when nothing accepts the connection. The target host is a CLOSED
|
|
228
|
+
* workspace-private set: the container's loopback (default), or `docker` —
|
|
229
|
+
* the workspace-scoped Docker sidecar's alias, where `docker compose`
|
|
230
|
+
* publishes its ports.
|
|
229
231
|
*/
|
|
230
|
-
forward(port: number): Promise<WorkspaceForward>;
|
|
232
|
+
forward(port: number, options?: WorkspaceForwardOptions): Promise<WorkspaceForward>;
|
|
233
|
+
}
|
|
234
|
+
/** Options for {@link Workspace.forward}. */
|
|
235
|
+
export interface WorkspaceForwardOptions {
|
|
236
|
+
/** Target inside the workspace: its loopback (default) or the Docker sidecar. */
|
|
237
|
+
readonly host?: "127.0.0.1" | "localhost" | "docker";
|
|
231
238
|
}
|
|
232
239
|
/**
|
|
233
240
|
* A live port forward — one WebSocket, held until `close()` or the remote
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sealant/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "The fluent public SDK for Sealant — create a workspace, run a harness, replay the record.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@sealant/api-contracts": "^0.
|
|
29
|
+
"@sealant/api-contracts": "^0.15.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@effect/vitest": "4.0.0-beta.85",
|