yirlo 1.3.19 → 1.3.20
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/package.json +1 -1
- package/yirlo.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yirlo",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.20",
|
|
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
|
@@ -4,7 +4,7 @@
|
|
|
4
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 = (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:
|
|
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: Apps and API > 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;
|