Skip to content

RegenerateResult

type RegenerateResult =
| {
kind: "image";
newVariants: AssetDTO[];
ok: true;
sourceUsed: AssetDTO | "raw";
variants: AssetDTO[];
}
| {
dispatch: unknown;
kind: "video";
ok: true;
regenerated: string[] | "default";
};

Defined in: packages/sdk/src/index.ts:353

Returned by aq.assets.regenerate(...). The shape varies by kind — images return immediately with the merged variant list; videos return a dispatch handle (the actual transcode runs in a Cloud Run Job and finishes async).

{
kind: "image";
newVariants: AssetDTO[];
ok: true;
sourceUsed: AssetDTO | "raw";
variants: AssetDTO[];
}
kind: "image";
newVariants: AssetDTO[];

Presets newly written this run. Useful for showing “added X”.

ok: true;
sourceUsed: AssetDTO | "raw";

Which source the server read to derive the new variants:

  • "original" / "raw" → lossless source bytes (best)
  • "xl" / "lg" / "md" / "sm" / "thumb" → a previously encoded WebP variant was used as the source. Output is re-encoded WebP — fine for thumb/sm from lg, lossier when working from already-small sources.

The no-upscale clamp still applies: deriving lg (1920) from a 640 sm source produces a 640-side lg variant, not a stretched 1920.

variants: AssetDTO[];

Full variant set after the merge.


{
dispatch: unknown;
kind: "video";
ok: true;
regenerated: string[] | "default";
}