@oya-ai/browser 1.0.71 → 1.0.73

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/README.md CHANGED
@@ -244,6 +244,23 @@ const oya = new Oya({
244
244
  | `setMfa(id, config)` | Store TOTP secret (sealed at rest with AES-256-GCM) |
245
245
  | `clearMfa(id)` | Remove MFA secret from persona |
246
246
 
247
+ ### Proxies (`oya.proxies`)
248
+
249
+ | Method | Description |
250
+ |:---|:---|
251
+ | `create({ url, label?, geo?, kind?, maxPersonas? })` | Add a proxy from your vendor. Credentials are encrypted and never returned |
252
+ | `list()` | Your proxies and shared ones, with exit IP, health and how many personas use each |
253
+ | `check()` | Dial every proxy and record its real exit IP |
254
+ | `remove(id)` | Delete a proxy and unpin the personas on it |
255
+
256
+ ```ts
257
+ const proxy = await oya.proxies.create({
258
+ url: "http://user:pass_session-shopper1@gate.vendor.com:7000", // one sticky session per persona
259
+ label: "us-shopper-1", geo: "US", kind: "residential", maxPersonas: 1,
260
+ });
261
+ await oya.personas.pinProxy(persona.id, proxy.id);
262
+ ```
263
+
247
264
  ### Durable Governance & Control (`oya.control`)
248
265
 
249
266
  | Method | Description |
package/dist/index.cjs CHANGED
@@ -342,6 +342,19 @@ var Oya = class {
342
342
  removeWebhook: (id) => this.http.request("DELETE", `/api/control/webhooks/${encodeURIComponent(id)}`),
343
343
  replayDelivery: (id) => this.http.request("POST", `/api/control/deliveries/${encodeURIComponent(id)}/replay`, {})
344
344
  };
345
+ /**
346
+ * Proxy exits for your personas. A persona takes one at first connect (by its
347
+ * geo hint) or by `personas.pinProxy`, and keeps it.
348
+ */
349
+ proxies = {
350
+ list: async () => (await this.http.request("GET", "/api/proxies")).proxies,
351
+ create: (proxy) => this.http.request("POST", "/api/proxies", proxy),
352
+ remove: async (id) => {
353
+ await this.http.request("DELETE", `/api/proxies/${encodeURIComponent(id)}`);
354
+ },
355
+ /** Dial each proxy and learn its real exit IP. Failing ones cool down and are skipped. */
356
+ check: async () => (await this.http.request("POST", "/api/proxies/check", {})).results
357
+ };
345
358
  personas = {
346
359
  list: async () => (await this.http.request("GET", "/api/personas")).personas,
347
360
  get: (id) => this.http.request("GET", `/api/personas/${id}`),
package/dist/index.d.cts CHANGED
@@ -126,6 +126,35 @@ interface PersonaPrefs {
126
126
  timezone?: string;
127
127
  locale?: string;
128
128
  }
129
+ /** A proxy exit. Credentials go in on create and never come back out. */
130
+ interface ProxyInfo {
131
+ id: string;
132
+ label: string;
133
+ kind: 'residential' | 'datacenter';
134
+ /** Two-letter country, optionally a region: "US", "US-CA". */
135
+ geo: string | null;
136
+ /** Provided by the host rather than this key. Cannot be removed. */
137
+ shared: boolean;
138
+ healthy: boolean;
139
+ /** Healthy and not cooling down after a failure. */
140
+ available: boolean;
141
+ /** Where traffic actually leaves, as of the last check. */
142
+ exitIp: string | null;
143
+ lastCheckedAt: string | null;
144
+ /** Personas on it now, out of `maxPersonas`. */
145
+ assigned: number;
146
+ maxPersonas: number;
147
+ cooldownMsRemaining: number;
148
+ }
149
+ interface ProxyCreate {
150
+ /** http(s)://user:pass@host:port from your vendor. Chromium cannot use SOCKS5 with a password. */
151
+ url: string;
152
+ label?: string;
153
+ geo?: string;
154
+ kind?: 'residential' | 'datacenter';
155
+ /** Personas that may share it. Keep 1 for a sticky-session URL so each keeps its own IP. */
156
+ maxPersonas?: number;
157
+ }
129
158
  interface PersonaInfo {
130
159
  id: string;
131
160
  name: string;
@@ -467,6 +496,22 @@ declare class Oya {
467
496
  ok: boolean;
468
497
  }>;
469
498
  };
499
+ /**
500
+ * Proxy exits for your personas. A persona takes one at first connect (by its
501
+ * geo hint) or by `personas.pinProxy`, and keeps it.
502
+ */
503
+ readonly proxies: {
504
+ list: () => Promise<ProxyInfo[]>;
505
+ create: (proxy: ProxyCreate) => Promise<ProxyInfo>;
506
+ remove: (id: string) => Promise<void>;
507
+ /** Dial each proxy and learn its real exit IP. Failing ones cool down and are skipped. */
508
+ check: () => Promise<Array<{
509
+ id: string;
510
+ ok: boolean;
511
+ exitIp?: string | null;
512
+ error?: string;
513
+ }>>;
514
+ };
470
515
  readonly personas: {
471
516
  list: () => Promise<PersonaInfo[]>;
472
517
  get: (id: string) => Promise<PersonaInfo>;
@@ -579,4 +624,4 @@ declare class Oya {
579
624
  private waitUntilConnected;
580
625
  }
581
626
 
582
- export { type Activity, type Analysis, Browser, type BrowserDetail, type BrowserInfo, type CaptchaResult, type ControlCredential, type ControlEvent, type ControlOverview, type ControlRole, type ControlSession, type Element, type Fingerprint, type Health, type HumanInputAction, type MfaConfig, type MfaResult, Oya, OyaError, type OyaOptions, type PersonaInfo, type PersonaPrefs, type ProjectSettings, type Provider, type StartOptions, type StartResult, type StopResult, Oya as default };
627
+ export { type Activity, type Analysis, Browser, type BrowserDetail, type BrowserInfo, type CaptchaResult, type ControlCredential, type ControlEvent, type ControlOverview, type ControlRole, type ControlSession, type Element, type Fingerprint, type Health, type HumanInputAction, type MfaConfig, type MfaResult, Oya, OyaError, type OyaOptions, type PersonaInfo, type PersonaPrefs, type ProjectSettings, type Provider, type ProxyCreate, type ProxyInfo, type StartOptions, type StartResult, type StopResult, Oya as default };
package/dist/index.d.ts CHANGED
@@ -126,6 +126,35 @@ interface PersonaPrefs {
126
126
  timezone?: string;
127
127
  locale?: string;
128
128
  }
129
+ /** A proxy exit. Credentials go in on create and never come back out. */
130
+ interface ProxyInfo {
131
+ id: string;
132
+ label: string;
133
+ kind: 'residential' | 'datacenter';
134
+ /** Two-letter country, optionally a region: "US", "US-CA". */
135
+ geo: string | null;
136
+ /** Provided by the host rather than this key. Cannot be removed. */
137
+ shared: boolean;
138
+ healthy: boolean;
139
+ /** Healthy and not cooling down after a failure. */
140
+ available: boolean;
141
+ /** Where traffic actually leaves, as of the last check. */
142
+ exitIp: string | null;
143
+ lastCheckedAt: string | null;
144
+ /** Personas on it now, out of `maxPersonas`. */
145
+ assigned: number;
146
+ maxPersonas: number;
147
+ cooldownMsRemaining: number;
148
+ }
149
+ interface ProxyCreate {
150
+ /** http(s)://user:pass@host:port from your vendor. Chromium cannot use SOCKS5 with a password. */
151
+ url: string;
152
+ label?: string;
153
+ geo?: string;
154
+ kind?: 'residential' | 'datacenter';
155
+ /** Personas that may share it. Keep 1 for a sticky-session URL so each keeps its own IP. */
156
+ maxPersonas?: number;
157
+ }
129
158
  interface PersonaInfo {
130
159
  id: string;
131
160
  name: string;
@@ -467,6 +496,22 @@ declare class Oya {
467
496
  ok: boolean;
468
497
  }>;
469
498
  };
499
+ /**
500
+ * Proxy exits for your personas. A persona takes one at first connect (by its
501
+ * geo hint) or by `personas.pinProxy`, and keeps it.
502
+ */
503
+ readonly proxies: {
504
+ list: () => Promise<ProxyInfo[]>;
505
+ create: (proxy: ProxyCreate) => Promise<ProxyInfo>;
506
+ remove: (id: string) => Promise<void>;
507
+ /** Dial each proxy and learn its real exit IP. Failing ones cool down and are skipped. */
508
+ check: () => Promise<Array<{
509
+ id: string;
510
+ ok: boolean;
511
+ exitIp?: string | null;
512
+ error?: string;
513
+ }>>;
514
+ };
470
515
  readonly personas: {
471
516
  list: () => Promise<PersonaInfo[]>;
472
517
  get: (id: string) => Promise<PersonaInfo>;
@@ -579,4 +624,4 @@ declare class Oya {
579
624
  private waitUntilConnected;
580
625
  }
581
626
 
582
- export { type Activity, type Analysis, Browser, type BrowserDetail, type BrowserInfo, type CaptchaResult, type ControlCredential, type ControlEvent, type ControlOverview, type ControlRole, type ControlSession, type Element, type Fingerprint, type Health, type HumanInputAction, type MfaConfig, type MfaResult, Oya, OyaError, type OyaOptions, type PersonaInfo, type PersonaPrefs, type ProjectSettings, type Provider, type StartOptions, type StartResult, type StopResult, Oya as default };
627
+ export { type Activity, type Analysis, Browser, type BrowserDetail, type BrowserInfo, type CaptchaResult, type ControlCredential, type ControlEvent, type ControlOverview, type ControlRole, type ControlSession, type Element, type Fingerprint, type Health, type HumanInputAction, type MfaConfig, type MfaResult, Oya, OyaError, type OyaOptions, type PersonaInfo, type PersonaPrefs, type ProjectSettings, type Provider, type ProxyCreate, type ProxyInfo, type StartOptions, type StartResult, type StopResult, Oya as default };
package/dist/index.js CHANGED
@@ -313,6 +313,19 @@ var Oya = class {
313
313
  removeWebhook: (id) => this.http.request("DELETE", `/api/control/webhooks/${encodeURIComponent(id)}`),
314
314
  replayDelivery: (id) => this.http.request("POST", `/api/control/deliveries/${encodeURIComponent(id)}/replay`, {})
315
315
  };
316
+ /**
317
+ * Proxy exits for your personas. A persona takes one at first connect (by its
318
+ * geo hint) or by `personas.pinProxy`, and keeps it.
319
+ */
320
+ proxies = {
321
+ list: async () => (await this.http.request("GET", "/api/proxies")).proxies,
322
+ create: (proxy) => this.http.request("POST", "/api/proxies", proxy),
323
+ remove: async (id) => {
324
+ await this.http.request("DELETE", `/api/proxies/${encodeURIComponent(id)}`);
325
+ },
326
+ /** Dial each proxy and learn its real exit IP. Failing ones cool down and are skipped. */
327
+ check: async () => (await this.http.request("POST", "/api/proxies/check", {})).results
328
+ };
316
329
  personas = {
317
330
  list: async () => (await this.http.request("GET", "/api/personas")).personas,
318
331
  get: (id) => this.http.request("GET", `/api/personas/${id}`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oya-ai/browser",
3
- "version": "1.0.71",
3
+ "version": "1.0.73",
4
4
  "description": "Rotate thousands of browsers behind one API — personas, proxies, stealth, CAPTCHA and MFA.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://browser.getoya.ai",