Mirror the Composio project's auth configs as the connector catalog with logo.dev icons

This commit is contained in:
ZacharyZhang-NY committed 2026-07-07 11:06:07 -04:00
1 parent dde449d226
commit 00e05054ca
18 files changed
+269 -175

No files matched your search

@@ -0,0 +1,31 @@
import { randomUUID } from "node:crypto";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { describe, expect, test } from "vitest";
import { DatabaseConnection } from "../../src/main/database/connection";
import { authConfigPurgeSchema } from "../../src/main/database/migrations/047-auth-config-purge";
import { OrganizationService } from "../../src/main/services/organization-service";
describe("auth config purge migration", () => {
test("removes cached auth_config rows but keeps the entity id", () => {
const connection = new DatabaseConnection(join(tmpdir(), `ac-authconfig-purge-${randomUUID()}.db`));
const organization = new OrganizationService(connection.db);
let orgId = "";
connection.transaction(() => {
orgId = organization.createOrganization({ organizationName: "OrbitOps", employeeName: "Yang", mission: "m", goal: "g" });
});
const now = new Date().toISOString();
const insert = connection.db.prepare(
"insert into composio_settings(org_id, key, value, updated_at) values (?, ?, ?, ?)",
);
insert.run(orgId, "entity_id", orgId, now);
insert.run(orgId, "auth_config:github", "ac_123", now);
insert.run(orgId, "auth_config:stripe", "ac_456", now);
connection.db.exec(authConfigPurgeSchema);
const keys = (connection.db.prepare("select key from composio_settings where org_id = ? order by key asc").all(orgId) as Array<{ key: string }>)
.map((row) => row.key);
expect(keys).toEqual(["entity_id"]);
});
});
+18
View File
@@ -0,0 +1,18 @@
import { describe, expect, test } from "vitest";
import { connectorDisplayName, connectorLogoUrl } from "../../src/main/services/composio/connector-brands";
describe("connector brands", () => {
test("known toolkits resolve a display name and a logo.dev URL", () => {
expect(connectorDisplayName("google_analytics")).toBe("Google Analytics");
expect(connectorLogoUrl("google_analytics")).toBe(
"https://img.logo.dev/analytics.google.com?token=***REMOVED***",
);
expect(connectorDisplayName("share_point")).toBe("SharePoint");
expect(connectorLogoUrl("stripe")).toContain("img.logo.dev/stripe.com");
});
test("unknown toolkits prettify the slug and carry no logo", () => {
expect(connectorDisplayName("acme_billing")).toBe("Acme Billing");
expect(connectorLogoUrl("acme_billing")).toBeNull();
});
});
+1 -1
View File
@@ -24,7 +24,7 @@ describe("domain services", () => {
const connection = createConnection();
const rows = connection.db.prepare("select version from schema_migrations order by version asc").all() as Array<{ version: number }>;
expect(rows.map((row) => row.version)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46]);
expect(rows.map((row) => row.version)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]);
connection.close();
});