yirlo 1.3.3 → 1.3.4

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
@@ -4,7 +4,7 @@ Run Yirlo, the AI outbound agent for B2B companies, from code or an AI agent: pr
4
4
 
5
5
  Get an API key in the Yirlo app: Connect your other apps > API > Create API key (shown once, starts yk_live_). Full API docs: https://yirlo.com/api-docs
6
6
 
7
- Another address (a test server): `new Yirlo(key, { baseUrl: "https://..." })`; the default is https://yirlo.com.
7
+ Another address (a test server): `new Yirlo(key, { baseUrl: "https://..." })`, or set `YIRLO_BASE` in the environment; the default is https://yirlo.com.
8
8
 
9
9
  ## SDK
10
10
 
package/dash.js CHANGED
@@ -27,7 +27,7 @@ Key: YIRLO_API_KEY=yk_live_... (https://yirlo.com/app/api-keys), or ~/.yirlo/das
27
27
  process.exit(0);
28
28
  }
29
29
  const PLAIN = flag("plain") || !!process.env.NO_COLOR || !process.stdout.isTTY && !flag("color");
30
- const BASE = process.env.YIRLO_BASE_URL || "https://yirlo.com";
30
+ const BASE = process.env.YIRLO_BASE || process.env.YIRLO_BASE_URL || "https://yirlo.com";
31
31
  const HOME = path.join(os.homedir(), ".yirlo");
32
32
  const CONF = process.env.YIRLO_DASH_CONFIG || path.join(HOME, "dash.json");
33
33
  const SEEN = path.join(HOME, "dash-seen.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yirlo",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Yirlo SDK, MCP server and terminal dashboard: run your AI cold email outreach (projects, campaigns, inbox, hot leads, budgets) from code, an AI agent or your terminal.",
5
5
  "type": "module",
6
6
  "main": "yirlo.js",
package/yirlo.js CHANGED
@@ -1,10 +1,10 @@
1
1
  // Yirlo SDK for JavaScript (Node 18+ and browsers with fetch). https://yirlo.com/sdk/yirlo.js
2
2
  // Generated from https://yirlo.com/api-docs/openapi.json: every call there that is not deprecated is a method here (docs: https://yirlo.com/api-docs).
3
3
  // Usage: import { Yirlo } from "yirlo"; const y = new Yirlo(process.env.YIRLO_API_KEY); console.log(await y.getAccount());
4
- // Another address (a test server): new Yirlo(key, { baseUrl: "https://..." }). The default is https://yirlo.com.
4
+ // Another address (a test server): new Yirlo(key, { baseUrl: "https://..." }), or set YIRLO_BASE in the environment. The default is https://yirlo.com.
5
5
  export class YirloError extends Error { constructor(status, body) { super((body && body.detail) || `HTTP ${status}`); this.status = status; this.body = body; } }
6
6
  export class Yirlo {
7
- constructor(apiKey, { baseUrl = "https://yirlo.com" } = {}) { if (!apiKey) throw new Error("Pass your Yirlo API key (make one in the Yirlo app: Connect your other apps > API > Create API key)"); this.apiKey = apiKey; this.baseUrl = baseUrl.replace(/\/$/, ""); }
7
+ constructor(apiKey, { baseUrl = (typeof process !== "undefined" && process.env && process.env.YIRLO_BASE) || "https://yirlo.com" } = {}) { if (!apiKey) throw new Error("Pass your Yirlo API key (make one in the Yirlo app: Connect your other apps > API > Create API key)"); this.apiKey = apiKey; this.baseUrl = baseUrl.replace(/\/$/, ""); }
8
8
  async request(method, path, { query, body, headers } = {}) {
9
9
  const qs = query && Object.keys(query).length ? "?" + new URLSearchParams(Object.entries(query).filter(([, v]) => v != null)) : "";
10
10
  if (!path.startsWith("/public/") && !path.startsWith("/px/")) path = "/public/api/v1" + path;