@oya-ai/browser 1.0.70 → 1.0.71
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 +23 -0
- package/dist/index.d.cts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +23 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -223,6 +223,29 @@ var Browser = class {
|
|
|
223
223
|
);
|
|
224
224
|
return `${this.http.baseUrl}/api/live/${this.id}?ticket=${encodeURIComponent(ticket)}`;
|
|
225
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* A shareable link to this browser's live view, for handing to a person or
|
|
228
|
+
* embedding in your own app. The token rides in the URL fragment, so it never
|
|
229
|
+
* reaches a server log or Referer header. `control: true` lets whoever opens
|
|
230
|
+
* it take over and act in the browser; otherwise it is view-only. The link
|
|
231
|
+
* expires (default one hour) and is revocable with `revokeShare(id)`.
|
|
232
|
+
*
|
|
233
|
+
* The credential is scoped to this one browser: it cannot see or touch the
|
|
234
|
+
* rest of your project. Anyone holding the link has that access until it
|
|
235
|
+
* expires or you revoke it, so treat it like a password.
|
|
236
|
+
*/
|
|
237
|
+
async shareUrl({ control = false, expiresInSeconds = 3600 } = {}) {
|
|
238
|
+
const c = await this.http.request(
|
|
239
|
+
"POST",
|
|
240
|
+
`/api/control/sessions/${encodeURIComponent(this.id)}/share`,
|
|
241
|
+
{ control, expiresIn: expiresInSeconds }
|
|
242
|
+
);
|
|
243
|
+
return { url: `${this.http.baseUrl}/live/${encodeURIComponent(this.id)}#t=${encodeURIComponent(c.token)}`, id: c.id, expiresAt: c.expiresAt };
|
|
244
|
+
}
|
|
245
|
+
/** Revoke a link from `shareUrl()` before it expires, by the id it returned. */
|
|
246
|
+
async revokeShare(id) {
|
|
247
|
+
await this.http.request("DELETE", `/api/control/credentials/${encodeURIComponent(id)}`);
|
|
248
|
+
}
|
|
226
249
|
/** Counters, health and the last 50 things this browser did. */
|
|
227
250
|
status() {
|
|
228
251
|
return this.http.request("GET", `/api/browsers/${this.id}`);
|
package/dist/index.d.cts
CHANGED
|
@@ -349,6 +349,27 @@ declare class Browser {
|
|
|
349
349
|
* 60 seconds. Mint one per viewer — the first connection spends it.
|
|
350
350
|
*/
|
|
351
351
|
liveStreamUrl(): Promise<string>;
|
|
352
|
+
/**
|
|
353
|
+
* A shareable link to this browser's live view, for handing to a person or
|
|
354
|
+
* embedding in your own app. The token rides in the URL fragment, so it never
|
|
355
|
+
* reaches a server log or Referer header. `control: true` lets whoever opens
|
|
356
|
+
* it take over and act in the browser; otherwise it is view-only. The link
|
|
357
|
+
* expires (default one hour) and is revocable with `revokeShare(id)`.
|
|
358
|
+
*
|
|
359
|
+
* The credential is scoped to this one browser: it cannot see or touch the
|
|
360
|
+
* rest of your project. Anyone holding the link has that access until it
|
|
361
|
+
* expires or you revoke it, so treat it like a password.
|
|
362
|
+
*/
|
|
363
|
+
shareUrl({ control, expiresInSeconds }?: {
|
|
364
|
+
control?: boolean;
|
|
365
|
+
expiresInSeconds?: number;
|
|
366
|
+
}): Promise<{
|
|
367
|
+
url: string;
|
|
368
|
+
id: string;
|
|
369
|
+
expiresAt: number | null;
|
|
370
|
+
}>;
|
|
371
|
+
/** Revoke a link from `shareUrl()` before it expires, by the id it returned. */
|
|
372
|
+
revokeShare(id: string): Promise<void>;
|
|
352
373
|
/** Counters, health and the last 50 things this browser did. */
|
|
353
374
|
status(): Promise<BrowserDetail>;
|
|
354
375
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -349,6 +349,27 @@ declare class Browser {
|
|
|
349
349
|
* 60 seconds. Mint one per viewer — the first connection spends it.
|
|
350
350
|
*/
|
|
351
351
|
liveStreamUrl(): Promise<string>;
|
|
352
|
+
/**
|
|
353
|
+
* A shareable link to this browser's live view, for handing to a person or
|
|
354
|
+
* embedding in your own app. The token rides in the URL fragment, so it never
|
|
355
|
+
* reaches a server log or Referer header. `control: true` lets whoever opens
|
|
356
|
+
* it take over and act in the browser; otherwise it is view-only. The link
|
|
357
|
+
* expires (default one hour) and is revocable with `revokeShare(id)`.
|
|
358
|
+
*
|
|
359
|
+
* The credential is scoped to this one browser: it cannot see or touch the
|
|
360
|
+
* rest of your project. Anyone holding the link has that access until it
|
|
361
|
+
* expires or you revoke it, so treat it like a password.
|
|
362
|
+
*/
|
|
363
|
+
shareUrl({ control, expiresInSeconds }?: {
|
|
364
|
+
control?: boolean;
|
|
365
|
+
expiresInSeconds?: number;
|
|
366
|
+
}): Promise<{
|
|
367
|
+
url: string;
|
|
368
|
+
id: string;
|
|
369
|
+
expiresAt: number | null;
|
|
370
|
+
}>;
|
|
371
|
+
/** Revoke a link from `shareUrl()` before it expires, by the id it returned. */
|
|
372
|
+
revokeShare(id: string): Promise<void>;
|
|
352
373
|
/** Counters, health and the last 50 things this browser did. */
|
|
353
374
|
status(): Promise<BrowserDetail>;
|
|
354
375
|
/**
|
package/dist/index.js
CHANGED
|
@@ -194,6 +194,29 @@ var Browser = class {
|
|
|
194
194
|
);
|
|
195
195
|
return `${this.http.baseUrl}/api/live/${this.id}?ticket=${encodeURIComponent(ticket)}`;
|
|
196
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* A shareable link to this browser's live view, for handing to a person or
|
|
199
|
+
* embedding in your own app. The token rides in the URL fragment, so it never
|
|
200
|
+
* reaches a server log or Referer header. `control: true` lets whoever opens
|
|
201
|
+
* it take over and act in the browser; otherwise it is view-only. The link
|
|
202
|
+
* expires (default one hour) and is revocable with `revokeShare(id)`.
|
|
203
|
+
*
|
|
204
|
+
* The credential is scoped to this one browser: it cannot see or touch the
|
|
205
|
+
* rest of your project. Anyone holding the link has that access until it
|
|
206
|
+
* expires or you revoke it, so treat it like a password.
|
|
207
|
+
*/
|
|
208
|
+
async shareUrl({ control = false, expiresInSeconds = 3600 } = {}) {
|
|
209
|
+
const c = await this.http.request(
|
|
210
|
+
"POST",
|
|
211
|
+
`/api/control/sessions/${encodeURIComponent(this.id)}/share`,
|
|
212
|
+
{ control, expiresIn: expiresInSeconds }
|
|
213
|
+
);
|
|
214
|
+
return { url: `${this.http.baseUrl}/live/${encodeURIComponent(this.id)}#t=${encodeURIComponent(c.token)}`, id: c.id, expiresAt: c.expiresAt };
|
|
215
|
+
}
|
|
216
|
+
/** Revoke a link from `shareUrl()` before it expires, by the id it returned. */
|
|
217
|
+
async revokeShare(id) {
|
|
218
|
+
await this.http.request("DELETE", `/api/control/credentials/${encodeURIComponent(id)}`);
|
|
219
|
+
}
|
|
197
220
|
/** Counters, health and the last 50 things this browser did. */
|
|
198
221
|
status() {
|
|
199
222
|
return this.http.request("GET", `/api/browsers/${this.id}`);
|
package/package.json
CHANGED