/** * media-service client — upload and delete only. * * Docs: https://github.com/feedmepos/media-service/blob/main/docs/integration.md * * Settings stores plain photographs: no aspect-ratio variants, no AI. Every call * here passes `aspectRatios: []`, which media-service reads as "store the original * and queue nothing" — the billing precheck runs only when that list is non-empty, * so these uploads cost the business nothing. Anything ratio- or AI-related lives * in mf-menu's richer client (`apps/mf-menu/src/api/media.ts`); do not grow this one * into a copy of it. */ /** * The four key segments identify an image: `{businessId}/{refType}/{refId}/{imageId}`. * `refType` is caller-owned — the service takes whatever string it is given — so the * values used here (`restaurant`, `business`) are ours to define. * * Segments are capped at 64 characters and must match `[A-Za-z0-9_.:-]+`; a Mongo id * and the timestamps built in `mediaStorage` both satisfy that. */ export interface MediaImageRef { refType: string; refId: string; imageId: string; } export interface UploadIntentRes { prefix: string; objectKey: string; uploadUrl: string; method: string; expiresAt: string; } export interface ConfirmRes { prefix: string; original: { url: string; width: number; height: number; }; } export declare function currentBusinessId(): string; export declare const mediaApi: { uploadIntent(businessId: string, ref: MediaImageRef, file: File, restaurantId?: string): Promise; /** * Sends the bytes straight to object storage, so they never pass through a service * pod. Deliberately a bare axios call: the signed URL must not carry our * Authorization header, and `Content-Type` has to match what `uploadIntent` was told * because the signature is bound to it. */ putBytes(uploadUrl: string, file: File): Promise; confirm(businessId: string, ref: MediaImageRef, meta: { width: number; height: number; fileName: string; restaurantId?: string; }): Promise; /** * Deletes the whole set for one image id, original included. * * `aspectRatios: null` is what means "everything"; `[]` is rejected as a likely * caller bug. Deleting something that no longer exists comes back as `not_found`, * which the service counts as success, so this is safe to call twice. */ deleteImage(businessId: string, ref: MediaImageRef): Promise; };