@llmsafespaces/sdk 0.13.1 → 0.14.1

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.cjs CHANGED
@@ -258,6 +258,18 @@ var WorkspacesAPI = class {
258
258
  deleteEnv(id, varName) {
259
259
  return this.client.request("DELETE", `/workspaces/${id}/env/${varName}`);
260
260
  }
261
+ setDevPreview(id, enabled) {
262
+ return this.client.request("PUT", `/workspaces/${id}/dev-preview`, { enabled });
263
+ }
264
+ /**
265
+ * Returns the URL to open the dev-preview proxy in a browser.
266
+ * The URL is authenticated via session cookie; no token in the URL.
267
+ * The dev server must be running on `port` inside the workspace.
268
+ */
269
+ devPreviewUrl(id, port, path = "/") {
270
+ const p = path.startsWith("/") ? path : `/${path}`;
271
+ return `${this.client.baseUrl}/api/v1/workspaces/${id}/dev-preview/${port}${p}`;
272
+ }
261
273
  };
262
274
  var SessionsAPI = class {
263
275
  constructor(client) {
package/dist/index.d.cts CHANGED
@@ -199,7 +199,7 @@ interface QueuedMessage {
199
199
  }
200
200
 
201
201
  declare class LLMSafeSpaces {
202
- private readonly baseUrl;
202
+ readonly baseUrl: string;
203
203
  private readonly timeout;
204
204
  private readonly fetchFn;
205
205
  private token;
@@ -262,6 +262,13 @@ declare class WorkspacesAPI {
262
262
  vars: string[];
263
263
  }>;
264
264
  deleteEnv(id: string, varName: string): Promise<void>;
265
+ setDevPreview(id: string, enabled: boolean): Promise<void>;
266
+ /**
267
+ * Returns the URL to open the dev-preview proxy in a browser.
268
+ * The URL is authenticated via session cookie; no token in the URL.
269
+ * The dev server must be running on `port` inside the workspace.
270
+ */
271
+ devPreviewUrl(id: string, port: number, path?: string): string;
265
272
  }
266
273
  declare class SessionsAPI {
267
274
  private client;
package/dist/index.d.ts CHANGED
@@ -199,7 +199,7 @@ interface QueuedMessage {
199
199
  }
200
200
 
201
201
  declare class LLMSafeSpaces {
202
- private readonly baseUrl;
202
+ readonly baseUrl: string;
203
203
  private readonly timeout;
204
204
  private readonly fetchFn;
205
205
  private token;
@@ -262,6 +262,13 @@ declare class WorkspacesAPI {
262
262
  vars: string[];
263
263
  }>;
264
264
  deleteEnv(id: string, varName: string): Promise<void>;
265
+ setDevPreview(id: string, enabled: boolean): Promise<void>;
266
+ /**
267
+ * Returns the URL to open the dev-preview proxy in a browser.
268
+ * The URL is authenticated via session cookie; no token in the URL.
269
+ * The dev server must be running on `port` inside the workspace.
270
+ */
271
+ devPreviewUrl(id: string, port: number, path?: string): string;
265
272
  }
266
273
  declare class SessionsAPI {
267
274
  private client;
package/dist/index.js CHANGED
@@ -225,6 +225,18 @@ var WorkspacesAPI = class {
225
225
  deleteEnv(id, varName) {
226
226
  return this.client.request("DELETE", `/workspaces/${id}/env/${varName}`);
227
227
  }
228
+ setDevPreview(id, enabled) {
229
+ return this.client.request("PUT", `/workspaces/${id}/dev-preview`, { enabled });
230
+ }
231
+ /**
232
+ * Returns the URL to open the dev-preview proxy in a browser.
233
+ * The URL is authenticated via session cookie; no token in the URL.
234
+ * The dev server must be running on `port` inside the workspace.
235
+ */
236
+ devPreviewUrl(id, port, path = "/") {
237
+ const p = path.startsWith("/") ? path : `/${path}`;
238
+ return `${this.client.baseUrl}/api/v1/workspaces/${id}/dev-preview/${port}${p}`;
239
+ }
228
240
  };
229
241
  var SessionsAPI = class {
230
242
  constructor(client) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmsafespaces/sdk",
3
- "version": "0.13.1",
3
+ "version": "0.14.1",
4
4
  "description": "TypeScript SDK for LLMSafeSpaces API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",