Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/core/types/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,6 @@ export interface ProviderRawEventInput<TPayload = RawEventPayload> {
sourceVersion?: string | null;
}

const contactFieldNameSet = new Set<string>(CONTACT_FIELD_NAME_VALUES);

export function buildNormalizedRawEventSchema(
entityKind: RawEventEntityKind,
eventKind: string,
Expand Down Expand Up @@ -273,11 +271,3 @@ export function resolveRawEventNormalizedSchema(
buildNormalizedRawEventSchema(input.entityKind, input.eventKind)
);
}

export function parseConversationType(value: string): ConversationType {
return value === "group" ? "group" : "dm";
}

export function isContactFieldName(value: string): value is ContactFieldName {
return contactFieldNameSet.has(value);
}
5 changes: 0 additions & 5 deletions src/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ function textEnum<const TValues extends readonly [string, ...string[]]>(
return text(name, { enum: values });
}

export const schemaMigrations = sqliteTable("schema_migrations", {
id: text("id").primaryKey(),
appliedAt: integer("applied_at").notNull(),
});

export const sourceAccounts = sqliteTable("source_accounts", {
id: text("id").primaryKey(),
platform: textEnum("platform", PLATFORM_VALUES).notNull(),
Expand Down
7 changes: 1 addition & 6 deletions src/platforms/contacts/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { execFileSync } from "node:child_process";
import { createHash, randomUUID } from "node:crypto";
import { readFileSync } from "node:fs";
import type { ContactObservationPayload } from "../../core/types/provider.js";
import {
getMacOSNativeBinaryCandidates,
resolveMacOSNativeBinary,
} from "../../runtime/native-binary.js";
import { resolveMacOSNativeBinary } from "../../runtime/native-binary.js";
import type { SyncBundle } from "../core/sync.js";

export interface ContactRecordInput {
Expand Down Expand Up @@ -120,8 +117,6 @@ function loadContactsFromMacOS(): ContactRecordInput[] {
return JSON.parse(stdout) as ContactRecordInput[];
}

export const getNativeContactsBinaryCandidates = getMacOSNativeBinaryCandidates;

export function resolveContactsLoader(
env: NodeJS.ProcessEnv = process.env,
repoRoot?: string,
Expand Down
18 changes: 0 additions & 18 deletions src/platforms/core/state/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -875,24 +875,6 @@ export function resolveCompletedMetadata(
};
}

export function getPlatformRuntimeDefaults(platform: Platform): {
runtimeKind: IntegrationRuntimeKind;
accountKey: string;
} {
const runtimeKind =
platform === "contacts" || platform === "imessage"
? "native"
: platform === "signal" || platform === "whatsapp"
? "qr_native"
: platform === "gmail"
? "oauth"
: "chromium";
return {
runtimeKind,
accountKey: getDefaultAccountKeyForPlatform(platform),
};
}

export function buildIntegrationStatus(
db: CuedDatabase,
options: { includeLiveLocalIntegrations?: boolean; includeDiagnostics?: boolean } = {},
Expand Down
3 changes: 1 addition & 2 deletions src/platforms/core/state/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { PlatformCapabilitySummary } from "../../../core/platform-capabilities.js";
import type { AuthSessionRow, IntegrationStateRow } from "../../../db/database.js";
import type { IntegrationStateRow } from "../../../db/database.js";
import type {
AuthSessionState,
ConnectionKind,
Expand Down Expand Up @@ -98,4 +98,3 @@ export interface CompletedAuthSessionInput {
}

export type IntegrationRowLike = Pick<IntegrationStateRow, "metadata_json" | "launch_strategy">;
export type AuthSessionRowLike = AuthSessionRow;
9 changes: 0 additions & 9 deletions src/platforms/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ const adapterPlatformSet = new Set<string>(ADAPTER_PLATFORM_VALUES);
const requestableIntegrationPlatformSet = new Set<string>(REQUESTABLE_INTEGRATION_PLATFORM_VALUES);
const integrationAuthStateSet = new Set<string>(INTEGRATION_AUTH_STATE_VALUES);
const integrationRuntimeKindSet = new Set<string>(INTEGRATION_RUNTIME_KIND_VALUES);
const hostOsSet = new Set<string>(HOST_OS_VALUES);

export function isPlatform(value: string): value is Platform {
return platformSet.has(value);
Expand All @@ -385,14 +384,6 @@ export function parsePlatform(value: string): Platform | null {
return isPlatform(value) ? value : null;
}

export function isHostOS(value: string): value is HostOS {
return hostOsSet.has(value);
}

export function parseHostOS(value: string | null | undefined): HostOS | null {
return value && isHostOS(value) ? value : null;
}

export function getDefaultAccountKeyForPlatform(platform: Platform): string {
return PLATFORM_DEFINITIONS[platform].defaultAccountKey;
}
Expand Down
8 changes: 0 additions & 8 deletions src/platforms/linkedin/api/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ export const RETRY_CONFIG = {
authErrorStatusCodes: [401, 403],
} as const;

export const REALTIME_TOPICS = {
conversations: "conversationsTopic",
conversationDeletes: "conversationDeletesTopic",
messageSeenReceipts: "messageSeenReceiptsTopic",
messages: "messagesTopic",
messageReactionSummaries: "messageReactionSummariesTopic",
} as const;

export const PAGINATION_DEFAULTS = {
conversationsCount: 20,
messagesCount: 20,
Expand Down
8 changes: 0 additions & 8 deletions src/platforms/linkedin/api/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,6 @@ export function newGetRequest(
return new AuthedRequest(url, cookies, options).withMethod("GET");
}

export function newPostRequest(
url: string,
cookies: Cookie[],
options?: RequestOptions,
): AuthedRequest {
return new AuthedRequest(url, cookies, options).withMethod("POST");
}

export function newMessagingGraphQLRequest(
cookies: Cookie[],
queryId: keyof typeof GRAPHQL_QUERY_IDS,
Expand Down
4 changes: 0 additions & 4 deletions src/platforms/linkedin/sync/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,6 @@ export function isLinkedInMessageEdited(message: Message): boolean {
return message.messageBodyRenderFormat === "EDITED";
}

export function isLinkedInSystemMessage(message: Message): boolean {
return message.messageBodyRenderFormat === "SYSTEM";
}

export function conversationSourceKey(conversationUrn: string): string {
return `linkedin:${normalizeConversationUrn(conversationUrn)}`;
}
Expand Down
14 changes: 0 additions & 14 deletions src/platforms/whatsapp/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,6 @@ export type WhatsAppHelperCommand =
command: "status";
};

export interface WhatsAppHelperStatusResult {
accountJid?: string | null;
pushName?: string | null;
connected?: boolean;
helperVersion?: string | null;
lastHistorySyncAt?: number | null;
lastHistorySyncType?: string | null;
lastHistoryChunkOrder?: number | null;
lastHistoryProgress?: number | null;
queuedHistorySyncCount?: number | null;
lastHistorySyncError?: string | null;
lastHistoryNotificationAt?: number | null;
}

export interface WhatsAppHelperSendResult {
messageID: string;
chatJID: string;
Expand Down
6 changes: 0 additions & 6 deletions src/setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { existsSync } from "node:fs";
import { stdin as input, stdout as output } from "node:process";
import readline from "node:readline/promises";
import { openCuedDatabase } from "./db/database.js";
Expand Down Expand Up @@ -100,8 +99,3 @@ export async function runSetupTUI(): Promise<void> {
db.close();
}
}

export function hasInstalledAppBundle(): boolean {
const appPath = resolveInstalledAppPath();
return Boolean(appPath && existsSync(appPath));
}
9 changes: 0 additions & 9 deletions src/telemetry/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ export function durationBucket(durationMs: number): string {
return "gte_10m";
}

export function attemptBucket(attempt: number | null | undefined): string | undefined {
if (attempt == null || !Number.isFinite(attempt) || attempt < 0) {
return undefined;
}
if (attempt <= 1) return "first";
if (attempt <= 3) return "retry_2_3";
return "retry_4_plus";
}

export function errorTelemetryProperties(
error: unknown,
fallbackCode = "unknown_error",
Expand Down