Skip to content
Merged
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
6 changes: 1 addition & 5 deletions dev/seed/app/api-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { eq, or } from 'drizzle-orm';

import { getSeedDb } from '../lib/db';
import { normalizeSeedEmail } from '../lib/email';
import { isValidEmail } from '../lib/users';
import type { SeedResult } from '../index';

export const usage = '<email> [options]';
Expand Down Expand Up @@ -32,11 +33,6 @@ function printUsage(): void {
console.log(' pnpm dev:seed app:api-token ada@example.com --expires-days=30 --admin');
}

function isValidEmail(email: string): boolean {
// Intentionally permissive; we only guard against obvious nonsense in dev.
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
}

function parsePositiveInteger(value: string, flagName: string): number {
if (!/^\d+$/.test(value)) {
throw new Error(`${flagName} must be a positive integer`);
Expand Down
6 changes: 1 addition & 5 deletions dev/seed/app/create-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { eq } from 'drizzle-orm';

import { getSeedDb } from '../lib/db';
import { normalizeSeedEmail } from '../lib/email';
import { isValidEmail } from '../lib/users';
import { createSeedStripeCustomer, deleteSeedStripeCustomer } from '../lib/stripe';
import type { SeedResult } from '../index';

Expand All @@ -28,11 +29,6 @@ function printUsage(): void {
console.log(' pnpm dev:seed app:create-user "Evgeny" evgeny@kilocode.ai --admin');
}

function isValidEmail(email: string): boolean {
// Intentionally permissive; we only guard against obvious nonsense in dev.
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
}

export async function run(...args: string[]): Promise<SeedResult | void> {
if (args.includes('--help') || args.includes('-h')) {
printUsage();
Expand Down
5 changes: 1 addition & 4 deletions dev/seed/app/kilo-pass-stripe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Stripe from 'stripe';

import { getSeedDb } from '../lib/db';
import { normalizeSeedEmail } from '../lib/email';
import { isValidEmail } from '../lib/users';
import { createSeedStripeCustomer, deleteSeedStripeCustomer } from '../lib/stripe';
import type { SeedResult } from '../index';

Expand Down Expand Up @@ -63,10 +64,6 @@ function printUsage(): void {
console.log(' pnpm dev:seed app:kilo-pass-stripe e2e-w4b-android-stripe@example.com');
}

function isValidEmail(email: string): boolean {
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
}

async function deleteSeedStripeSubscription(subscriptionId: string): Promise<void> {
try {
await getStripe().subscriptions.cancel(subscriptionId);
Expand Down
6 changes: 1 addition & 5 deletions dev/seed/app/mobile-sheet-fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { and, eq, inArray, or } from 'drizzle-orm';

import { getSeedDb } from '../lib/db';
import { normalizeSeedEmail } from '../lib/email';
import { isValidEmail } from '../lib/users';
import {
normalizedGitHubUrl,
readFixtureIntegration,
Expand Down Expand Up @@ -57,11 +58,6 @@ function printUsage(): void {
);
}

function isValidEmail(email: string): boolean {
// Intentionally permissive; we only guard against obvious nonsense in dev.
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
}

function sleep(ms: number): Promise<void> {
return new Promise(resolve => setTimeout(resolve, ms));
}
Expand Down
5 changes: 1 addition & 4 deletions dev/seed/app/paged-history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { and, eq, or } from 'drizzle-orm';
import type { SeedResult } from '../index';
import { getSeedDb } from '../lib/db';
import { normalizeSeedEmail } from '../lib/email';
import { isValidEmail } from '../lib/users';
import {
buildAssistantMessageItem,
buildSessionItem,
Expand Down Expand Up @@ -41,10 +42,6 @@ function printUsage(): void {
console.log(' pnpm -s dev:seed app:paged-history evgeny@kilocode.ai --json');
}

function isValidEmail(email: string): boolean {
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
}

function sleep(ms: number): Promise<void> {
return new Promise(resolve => setTimeout(resolve, ms));
}
Expand Down
6 changes: 1 addition & 5 deletions dev/seed/app/session-pr-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { and, eq, like, or, sql } from 'drizzle-orm';

import { getSeedDb } from '../lib/db';
import { normalizeSeedEmail } from '../lib/email';
import { isValidEmail } from '../lib/users';
import type { SeedResult } from '../index';

export const usage =
Expand Down Expand Up @@ -69,11 +70,6 @@ function printUsage(): void {
);
}

function isValidEmail(email: string): boolean {
// Intentionally permissive; we only guard against obvious nonsense in dev.
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
}

function sessionTitleFor(sessionId: string): string {
if (sessionId.includes('e2eprhappy')) return 'E2E PR happy';
if (sessionId.includes('e2eprempty')) return 'E2E PR empty';
Expand Down
6 changes: 1 addition & 5 deletions dev/seed/app/user-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { eq, or } from 'drizzle-orm';

import { getSeedDb } from '../lib/db';
import { normalizeSeedEmail } from '../lib/email';
import { isValidEmail } from '../lib/users';
import type { SeedResult } from '../index';

export const usage = '<email>';
Expand All @@ -18,11 +19,6 @@ function printUsage(): void {
console.log(' pnpm -s dev:seed app:user-id ada@example.com --json | jq -r .userId');
}

function isValidEmail(email: string): boolean {
// Intentionally permissive; we only guard against obvious nonsense in dev.
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
}

export async function run(...args: string[]): Promise<SeedResult | void> {
if (args.includes('--help') || args.includes('-h')) {
printUsage();
Expand Down