import { SmrtCollection } from '@happyvertical/smrt-core'; import { Asset } from './asset'; export declare class AssetCollection extends SmrtCollection { static readonly _itemClass: typeof Asset; /** * Find all assets belonging to a specific tenant * * @param tenantId - The tenant ID to filter by * @returns Array of assets belonging to this tenant */ findByTenant(tenantId: string): Promise; /** * Find all global assets (assets without a tenant). * * Routes through the shared tenant-global helper so it does not throw under * an active tenant context (an explicit `tenant_id IS NULL` filter would be * flagged as an isolation violation). (#1600) * * @returns Array of global assets */ findGlobal(): Promise; /** * Find assets belonging to a tenant plus all global assets. * * Fails closed if an active tenant context requests a different tenant's * rows; the admin/system path keeps the cross-tenant capability. (#1600) * * @param tenantId - The tenant ID to include * @returns Array of tenant-specific and global assets */ findWithGlobals(tenantId: string): Promise; /** * Add a tag to an asset (uses @smrt/tags) * * @param assetId - The asset ID to tag * @param tagSlug - The tag slug from @smrt/tags */ addTag(assetId: string, tagSlug: string): Promise; /** * Remove a tag from an asset * * @param assetId - The asset ID * @param tagSlug - The tag slug to remove */ removeTag(assetId: string, tagSlug: string): Promise; /** * Get all assets with a specific tag * * @param tagSlug - The tag slug to filter by * @returns Array of assets with this tag */ getByTag(tagSlug: string): Promise; /** * Get assets by type * * @param typeSlug - The asset type slug (e.g., 'image', 'video') * @returns Array of assets matching the type */ getByType(typeSlug: string): Promise; /** * Get assets by status * * @param statusSlug - The asset status slug (e.g., 'published', 'draft') * @returns Array of assets matching the status */ getByStatus(statusSlug: string): Promise; /** * Get assets by owner * * @param ownerProfileId - The profile ID of the owner * @returns Array of assets owned by this profile */ getByOwner(ownerProfileId: string): Promise; /** * Create a new version of an existing asset * * @param primaryVersionId - The primary version ID (first version's ID) * @param newSourceUri - The new source URI for this version * @param updates - Optional additional updates * @returns The newly created asset version */ createNewVersion(primaryVersionId: string, newSourceUri: string, updates?: Partial): Promise; /** * Get the latest version of an asset * * @param primaryVersionId - The primary version ID * @returns The latest version or null */ getLatestVersion(primaryVersionId: string): Promise; /** * List all versions of an asset * * @param primaryVersionId - The primary version ID * @returns Array of all asset versions, ordered by version number */ listVersions(primaryVersionId: string): Promise; /** * Get derivative assets of a source asset. * * Renamed from `getChildren(parentId)` in R3-D to match the rename of * the underlying column (`parent_id` → `source_asset_id`) and method * (`Asset.getChildren` → `Asset.getDerivatives`). * * @param sourceAssetId - The source asset ID * @returns Array of derivative assets */ getDerivatives(sourceAssetId: string): Promise; /** * Get assets by MIME type pattern * * @param mimePattern - MIME type pattern (e.g., 'image/*', 'video/mp4') * @returns Array of matching assets */ getByMimeType(mimePattern: string): Promise; /** * Rollback to a previous version by creating a new version with the target's content. * Does NOT delete intermediate versions (safe rollback). * * @param primaryVersionId - The primary version ID of the version chain * @param targetVersion - The version number to rollback to * @returns The newly created asset version with content copied from target */ rollbackToVersion(primaryVersionId: string, targetVersion: number): Promise; /** * Get assets in a specific folder * * @param folderId - The folder ID to list contents for * @returns Array of assets in this folder */ getByFolder(folderId: string): Promise; } //# sourceMappingURL=assets.d.ts.map