export type StockProviderId = 'pexels'; export interface StockCreator { id?: string; name: string; url?: string; } export interface StockLicense { name: string; url: string; usageScope: string[]; termsRestrictions: string[]; modelRelease: 'unknown'; propertyRelease: 'unknown'; } export interface StockRendition { id: string; width: number; height: number; durationSeconds: number; mimeType: string; url: string; sizeBytes?: number; } export interface StockSearchResult { provider: StockProviderId; providerAssetId: string; title?: string; sourcePageUrl: string; creator: StockCreator; license: StockLicense; durationSeconds: number; width?: number; height?: number; searchQuery: string; renditions: StockRendition[]; } export interface StockImportReceipt { schemaVersion: 1; receiptId: string; importedAt: string; projectSlug: string; provider: StockProviderId; providerAssetId: string; providerRenditionId: string; sourcePageUrl: string; creator: StockCreator; license: StockLicense; searchQuery: string; downloadedUrl: string; localAssetPath: string; contentHash: string; sizeBytes: number; mimeType: string; width: number; height: number; durationSeconds: number; usageScope: string[]; termsRestrictions: string[]; } export interface StockAssetProvenance { sourceProvider: StockProviderId; sourceAssetId: string; sourceRenditionId: string; sourcePageUrl: string; creator: StockCreator; license: StockLicense; searchQuery: string; downloadedAt: string; contentHash: string; usageScope: string[]; termsRestrictions: string[]; receipt: { id: string; path: string; sha256: string; }; } export interface StockFetchResponse { ok: boolean; status: number; headers: { get(name: string): string | null; }; body?: AsyncIterable | ReadableStream | null; text(): Promise; arrayBuffer(): Promise; } export type StockFetch = ( url: string, init?: { method?: string; headers?: Record; signal?: AbortSignal; redirect?: 'manual'; }, ) => Promise; export interface StockProvider { id: StockProviderId; searchVideos(input: { query: string; page?: number; perPage?: number; apiKey?: string; fetch?: StockFetch; timeoutMs?: number; maxJsonBytes?: number; }): Promise; }