/** * Shared deploy artefact contract — the single source of truth for the * engine→consumer wire shapes that describe WHAT a deploy produced. * * Three coupled surfaces import from here so none can drift: * - `@fjall/deploy-core` — emits `ServiceArtefact[]` on `DeployResult` * and derives its per-service output keys via `artefactOutputKey` * - `@fjall/cli` — `commandSchemas` re-exports `ImageTagSchema` for * `--image-tag` validation * - webapp worker — parses the per-service outputs and (Phase 1b) * consumes `ServiceArtefact[]` for Release persistence * * The output-key contract (`artefactOutputKey`) reproduces the historical * inline `${serviceName}TaskDefinition` / `${serviceName}ImageTag` / … * template literals byte-identically; the regression pins in * `util/src/__tests__/deployArtefacts.test.ts` freeze that wire format. */ import { z } from "zod"; export declare const DEPLOY_MODES: readonly ["full", "code-only", "rollback", "restart"]; export declare const DeployModeSchema: z.ZodEnum<{ full: "full"; "code-only": "code-only"; rollback: "rollback"; restart: "restart"; }>; export type DeployMode = z.infer; /** * Single source for image-tag validation (previously declared 3×: CLI * commandSchemas inline regex, webapp IMAGE_TAG_PATTERN, deploymentHelpers * inline copy). Matches Docker tag grammar as fjall constrains it. */ export declare const IMAGE_TAG_PATTERN: RegExp; export declare const ImageTagSchema: z.ZodString; export type ImageTag = z.infer; /** * One rolled-out (or pushed) service image identity. * * `imageDigest` and `taskDefinitionArn` are optional for honesty, not * convenience: the code-only rollout falls back to tag pinning when ECR * digest resolution fails, and the full-deploy path resolves the live task * definition best-effort AFTER CloudFormation has rolled the service — * neither may invent placeholder values. `previousTaskDefinitionArn` exists * only where an explicit RegisterTaskDefinition rollout captured it. * `ecrRepositoryArn` is absent for non-ECR registries. * * `functionArn`/`publishedVersion` are the Lambda analogue of * `taskDefinitionArn`: present whenever a fresh version was published for a * container-image Lambda — on a full deploy via the best-effort post-deploy * `lambda:PublishVersion` step (a publish failure degrades the artefact, it * never fails an already-succeeded deploy), and on code-only rollouts AND * rollbacks via `UpdateFunctionCode`'s `Publish: true`, which publishes * alongside the update itself. */ export declare const ServiceArtefactSchema: z.ZodObject<{ serviceName: z.ZodString; imageTag: z.ZodString; imageDigest: z.ZodOptional; imageUri: z.ZodString; ecrRepositoryArn: z.ZodOptional; taskDefinitionArn: z.ZodOptional; previousTaskDefinitionArn: z.ZodOptional; functionArn: z.ZodOptional; publishedVersion: z.ZodOptional; }, z.core.$strict>; export type ServiceArtefact = z.infer; export declare const ServiceArtefactsSchema: z.ZodArray; imageUri: z.ZodString; ecrRepositoryArn: z.ZodOptional; taskDefinitionArn: z.ZodOptional; previousTaskDefinitionArn: z.ZodOptional; functionArn: z.ZodOptional; publishedVersion: z.ZodOptional; }, z.core.$strict>>; export type ServiceArtefacts = z.infer; /** * The six per-service output-key suffixes the deploy engine emits and the * webapp worker parses (`webapp/scripts/deploymentJobHandler/imageRollout.ts`). * Order matters only for readers; the VALUES are a wire contract. */ export declare const ARTEFACT_OUTPUT_FIELDS: readonly ["TaskDefinition", "PreviousTaskDefinition", "ImageTag", "ImageUri", "EcrRepositoryArn", "ImageDigest"]; export type ArtefactOutputField = (typeof ARTEFACT_OUTPUT_FIELDS)[number]; /** * Derive the per-service deploy output key — MUST stay byte-identical to the * historical `${serviceName}${field}` template literals (the worker * slices the `serviceName` back off the `TaskDefinition`-suffixed keys). */ export declare function artefactOutputKey(serviceName: string, field: ArtefactOutputField): string;