diff --git a/lib/data.test.ts b/lib/data.test.ts index 4a518df..624b3b1 100644 --- a/lib/data.test.ts +++ b/lib/data.test.ts @@ -3,100 +3,100 @@ import { describe, expect, test } from "bun:test"; import type { DetectedTechnology } from "./parsers/types"; const DOMAIN_TO_UNEXPECTED_DATA: Record = { - "changelog.com": [ - { - identifier: "subdomain", - metadata: { - value: "op3.dev", - }, - }, - ], + "changelog.com": [ + { + identifier: "subdomain", + metadata: { + value: "op3.dev", + }, + }, + ], }; const DOMAIN_TO_EXPECTED_DATA: Record = { - "lastwatchdog.com": [ - { - identifier: "rss", - metadata: { - url: "https://www.lastwatchdog.com/feed/", - }, - }, - ], - "formkeep.com": [ - { - identifier: "github", - metadata: { - username: "formkeep.js", - }, - }, - { - identifier: "linkedin", - metadata: { username: "formkeep" }, - }, - ], - "savvycal.com": [ - { - identifier: "twitter", - metadata: { username: "savvycal" }, - }, - { - identifier: "rss", - metadata: { url: "https://savvycal.com/feed.xml" }, - }, - { - identifier: "rewardful", - metadata: { value: "rewardful", via: "URL" }, - }, - ], - "buttondown.email": [ - { - identifier: "github", - metadata: { username: "buttondown" }, - }, - ], - "zed.dev": [ - { - identifier: "twitter", - metadata: { username: "zeddotdev" }, - }, - ], - "bytereview.co.uk": [ - { - identifier: "tiktok", - metadata: { username: "@bytereview" }, - }, - { - identifier: "twitter", - metadata: { username: "bytereview" }, - }, - ], + "lastwatchdog.com": [ + { + identifier: "rss", + metadata: { + url: "https://www.lastwatchdog.com/feed/", + }, + }, + ], + "formkeep.com": [ + { + identifier: "github", + metadata: { + username: "formkeep.js", + }, + }, + { + identifier: "linkedin", + metadata: { username: "formkeep" }, + }, + ], + "savvycal.com": [ + { + identifier: "rewardful", + metadata: { value: "rewardful", via: "URL" }, + }, + { + identifier: "google_workspace", + metadata: { genre: "Mailserver" }, + }, + ], + "buttondown.email": [ + { + identifier: "github", + metadata: { username: "buttondown" }, + }, + { + identifier: "google_workspace", + metadata: { genre: "Mailserver" }, + }, + ], + "zed.dev": [ + { + identifier: "twitter", + metadata: { username: "zeddotdev" }, + }, + ], + "bytereview.co.uk": [ + { + identifier: "tiktok", + metadata: { username: "@bytereview" }, + }, + { + identifier: "twitter", + metadata: { username: "bytereview" }, + }, + ], }; describe("fetching", () => { - Object.entries(DOMAIN_TO_EXPECTED_DATA).forEach(([domain, expectedData]) => { - expectedData.forEach((data) => { - test(`fetches ${data.identifier} for ${domain}`, async () => { - const { detected_technologies } = await fetch(domain); - expect(detected_technologies).toContainEqual(data); - }); - }); - }); + Object.entries(DOMAIN_TO_EXPECTED_DATA).forEach(([domain, expectedData]) => { + expectedData.forEach((data) => { + test(`fetches ${data.identifier} for ${domain}`, async () => { + const { detected_technologies } = await fetch(domain); + expect(detected_technologies).toContainEqual(data); + }); + }); + }); - Object.entries(DOMAIN_TO_UNEXPECTED_DATA).forEach( - ([domain, unexpectedData]) => { - unexpectedData.forEach((data) => { - test(`does not fetch ${data.identifier} for ${domain}`, async () => { - const { detected_technologies } = await fetch(domain); - expect(detected_technologies).not.toContainEqual(data); - }); - }); - }, - ); + Object.entries(DOMAIN_TO_UNEXPECTED_DATA).forEach( + ([domain, unexpectedData]) => { + unexpectedData.forEach((data) => { + test(`does not fetch ${data.identifier} for ${domain}`, async () => { + const { detected_technologies } = await fetch(domain); + expect(detected_technologies).not.toContainEqual(data); + }); + }); + }, + ); - test("deduping identical records", async () => { - const { detected_technologies } = await fetch("zed.dev"); - expect( - detected_technologies.filter((tech) => tech.identifier === "twitter"), - ).toHaveLength(1); - }); + test("deduping identical records", async () => { + const { detected_technologies } = await fetch("zed.dev"); + expect( + detected_technologies.filter((tech) => tech.identifier === "twitter"), + ).toHaveLength(1); + }); }); diff --git a/lib/services.tsx b/lib/services.tsx index 1ee160c..f177670 100644 --- a/lib/services.tsx +++ b/lib/services.tsx @@ -1442,6 +1442,20 @@ export const REGISTRY: { [key in string]: Service } = { "spf2.mailgun.org", ], }, + google_workspace: { + identifier: "google_workspace", + name: "Google Workspace", + url: "https://workspace.google.com", + genre: "email", + mx_values: [ + "aspmx.l.google.com", + "alt1.aspmx.l.google.com", + "alt2.aspmx.l.google.com", + "alt3.aspmx.l.google.com", + "alt4.aspmx.l.google.com", + ], + spf_values: ["_spf.google.com"], + }, campaign_monitor: { identifier: "campaign_monitor", name: "Campaign Monitor",