Seed
Seed protocol schemas
Seed Import Strategy Defines how the engine handles existing records when a seed is applied.
Source: packages/spec/src/data/seed.zod.ts
TypeScript Usage
import { SeedSchema, SeedMode } from '@objectstack/spec/data';
import type { Seed } from '@objectstack/spec/data';
// Validate data
const result = SeedSchema.parse(data);Seed
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| object | string | ✅ | Target Object Name |
| externalId | string | string[] | ✅ | Field (or composite list of fields) matched for the uniqueness check |
| mode | Enum<'insert' | 'update' | 'upsert' | 'replace' | 'ignore'> | ✅ | Conflict resolution strategy |
| env | Enum<'prod' | 'dev' | 'test'>[] | ✅ | Applicable environments |
| records | Record<string, any>[] | ✅ | Data records |
| _lock | Enum<'none' | 'no-overlay' | 'no-delete' | 'full'> | optional | Item-level lock — controls overlay & delete (ADR-0010). |
| _lockReason | string | optional | Human-readable reason shown when a write is refused by _lock. |
| _lockSource | Enum<'artifact' | 'package' | 'env-forced'> | optional | Layer that set _lock (artifact | package | env-forced). |
| _provenance | Enum<'package' | 'org' | 'env-forced'> | optional | Origin of the item (package | org | env-forced). |
| _packageId | string | optional | Owning package machine id. |
| _packageVersion | string | optional | Owning package version. |
| _lockDocsUrl | string | optional | Optional documentation link surfaced next to _lockReason. |
SeedMode
Allowed Values
insertupdateupsertreplaceignore