import { type AssetProps, type CollectionProp, type ContentTypeProps, type EntryProps } from 'contentful-management'; import type { SpaceConfig } from '../config/types.js'; export interface UploadResult { sys: { id: string; }; } /** * A restricted CMA client that deliberately does NOT expose publish, unpublish, * archive, or delete methods on entries. Only safe read/write draft operations * are exposed. * * Safety is enforced at both the Contentful Role level (no publish permissions on * the token) and here at the application level (no publish methods on this interface). * * Under contentful-management v12+, this is backed by the plain client (scoped with * space/environment defaults). Entry and collection types are plain props * (`EntryProps`, `CollectionProp`, …), not legacy entity instances. */ export interface SafeEnvironment { getEntry(entryId: string): Promise; getEntries(query: Record): Promise>; createEntry(contentTypeId: string, fields: Record>): Promise; getAsset(assetId: string): Promise; getAssets(query?: Record): Promise>; getContentType(contentTypeId: string): Promise; getContentTypes(): Promise>; /** Saves entry fields as draft (plain `entry.update`). */ saveDraft(entry: EntryProps): Promise; /** Deletes a draft entry (never published). */ deleteEntry(entryId: string): Promise; /** Uploads a raw file binary to Contentful's upload API. Returns the upload ID. */ uploadFile(fileBuffer: Buffer, mimeType: string): Promise; /** Creates a new asset entry referencing an upload ID. */ createAsset(fields: { title: string; description: string; fileName: string; contentType: string; uploadId: string; locale: string; }): Promise; /** Triggers CDN processing for an uploaded asset file on a specific locale. */ processAsset(asset: AssetProps, locale: string): Promise; /** Saves asset field changes as draft (does not publish). */ updateAsset(asset: AssetProps): Promise; /** Publishes an asset. Only use for asset metadata updates (description/alt text), not content. */ publishAsset(asset: AssetProps): Promise; } /** * Creates a safe CMA environment wrapper for the given space config. * The returned object only exposes methods that cannot publish or delete. */ export declare function createSafeEnvironment(space: SpaceConfig): Promise; //# sourceMappingURL=client.d.ts.map