@oya-ai/cli 1.0.70 → 1.0.72
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.js +36 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -195,6 +195,29 @@ var Browser = class {
|
|
|
195
195
|
);
|
|
196
196
|
return `${this.http.baseUrl}/api/live/${this.id}?ticket=${encodeURIComponent(ticket)}`;
|
|
197
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* A shareable link to this browser's live view, for handing to a person or
|
|
200
|
+
* embedding in your own app. The token rides in the URL fragment, so it never
|
|
201
|
+
* reaches a server log or Referer header. `control: true` lets whoever opens
|
|
202
|
+
* it take over and act in the browser; otherwise it is view-only. The link
|
|
203
|
+
* expires (default one hour) and is revocable with `revokeShare(id)`.
|
|
204
|
+
*
|
|
205
|
+
* The credential is scoped to this one browser: it cannot see or touch the
|
|
206
|
+
* rest of your project. Anyone holding the link has that access until it
|
|
207
|
+
* expires or you revoke it, so treat it like a password.
|
|
208
|
+
*/
|
|
209
|
+
async shareUrl({ control = false, expiresInSeconds = 3600 } = {}) {
|
|
210
|
+
const c = await this.http.request(
|
|
211
|
+
"POST",
|
|
212
|
+
`/api/control/sessions/${encodeURIComponent(this.id)}/share`,
|
|
213
|
+
{ control, expiresIn: expiresInSeconds }
|
|
214
|
+
);
|
|
215
|
+
return { url: `${this.http.baseUrl}/live/${encodeURIComponent(this.id)}#t=${encodeURIComponent(c.token)}`, id: c.id, expiresAt: c.expiresAt };
|
|
216
|
+
}
|
|
217
|
+
/** Revoke a link from `shareUrl()` before it expires, by the id it returned. */
|
|
218
|
+
async revokeShare(id) {
|
|
219
|
+
await this.http.request("DELETE", `/api/control/credentials/${encodeURIComponent(id)}`);
|
|
220
|
+
}
|
|
198
221
|
/** Counters, health and the last 50 things this browser did. */
|
|
199
222
|
status() {
|
|
200
223
|
return this.http.request("GET", `/api/browsers/${this.id}`);
|
|
@@ -289,6 +312,19 @@ var Oya = class {
|
|
|
289
312
|
removeWebhook: (id) => this.http.request("DELETE", `/api/control/webhooks/${encodeURIComponent(id)}`),
|
|
290
313
|
replayDelivery: (id) => this.http.request("POST", `/api/control/deliveries/${encodeURIComponent(id)}/replay`, {})
|
|
291
314
|
};
|
|
315
|
+
/**
|
|
316
|
+
* Proxy exits for your personas. A persona takes one at first connect (by its
|
|
317
|
+
* geo hint) or by `personas.pinProxy`, and keeps it.
|
|
318
|
+
*/
|
|
319
|
+
proxies = {
|
|
320
|
+
list: async () => (await this.http.request("GET", "/api/proxies")).proxies,
|
|
321
|
+
create: (proxy) => this.http.request("POST", "/api/proxies", proxy),
|
|
322
|
+
remove: async (id) => {
|
|
323
|
+
await this.http.request("DELETE", `/api/proxies/${encodeURIComponent(id)}`);
|
|
324
|
+
},
|
|
325
|
+
/** Dial each proxy and learn its real exit IP. Failing ones cool down and are skipped. */
|
|
326
|
+
check: async () => (await this.http.request("POST", "/api/proxies/check", {})).results
|
|
327
|
+
};
|
|
292
328
|
personas = {
|
|
293
329
|
list: async () => (await this.http.request("GET", "/api/personas")).personas,
|
|
294
330
|
get: (id) => this.http.request("GET", `/api/personas/${id}`),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oya-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.72",
|
|
4
4
|
"description": "Command line for the Oya browser control plane.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://browser.getoya.ai",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@oya-ai/browser": "1.0.
|
|
42
|
+
"@oya-ai/browser": "1.0.72",
|
|
43
43
|
"@types/node": "^20.19.43",
|
|
44
44
|
"tsup": "^8.0.0",
|
|
45
45
|
"typescript": "^5.4.0"
|