ObjectStackObjectStack

Object

Object protocol schemas

API Operations Enum

Source: packages/spec/src/data/object.zod.ts

TypeScript Usage

import { ApiMethod, CDCConfig, Index, ObjectCapabilities, ObjectExtension, ObjectOwnershipEnum, PartitioningConfig, SoftDeleteConfig, TenancyConfig, VersioningConfig } from '@objectstack/spec/data';
import type { ApiMethod, CDCConfig, Index, ObjectCapabilities, ObjectExtension, ObjectOwnershipEnum, PartitioningConfig, SoftDeleteConfig, TenancyConfig, VersioningConfig } from '@objectstack/spec/data';

// Validate data
const result = ApiMethod.parse(data);

ApiMethod

Allowed Values

  • get
  • list
  • create
  • update
  • delete
  • upsert
  • bulk
  • aggregate
  • history
  • search
  • restore
  • purge
  • import
  • export

CDCConfig

Properties

PropertyTypeRequiredDescription
enabledbooleanEnable Change Data Capture
eventsEnum<'insert' | 'update' | 'delete'>[]Event types to capture
destinationstringDestination endpoint (e.g., "kafka://topic", "webhook://url")

Index

Properties

PropertyTypeRequiredDescription
namestringoptionalIndex name (auto-generated if not provided)
fieldsstring[]Fields included in the index
typeEnum<'btree' | 'hash' | 'gin' | 'gist' | 'fulltext'>Index algorithm type
uniquebooleanWhether the index enforces uniqueness
partialstringoptionalPartial index condition (SQL WHERE clause for conditional indexes)

ObjectCapabilities

Properties

PropertyTypeRequiredDescription
trackHistorybooleanEnable field history tracking for audit compliance
searchablebooleanIndex records for global search
apiEnabledbooleanExpose object via automatic APIs
apiMethodsEnum<'get' | 'list' | 'create' | 'update' | 'delete' | 'upsert' | 'bulk' | 'aggregate' | 'history' | 'search' | 'restore' | 'purge' | 'import' | 'export'>[]optionalWhitelist of allowed API operations
filesbooleanEnable file attachments and document management
feedsbooleanEnable social feed, comments, and mentions (Chatter-like)
activitiesbooleanEnable standard tasks and events tracking
trashbooleanEnable soft-delete with restore capability
mrubooleanTrack Most Recently Used (MRU) list for users
clonebooleanAllow record deep cloning

ObjectExtension

Properties

PropertyTypeRequiredDescription
extendstringTarget object name (FQN) to extend
fieldsRecord<string, Object>optionalFields to add/override
labelstringoptionalOverride label for the extended object
pluralLabelstringoptionalOverride plural label for the extended object
descriptionstringoptionalOverride description for the extended object
validations[__schema0](./__schema0)[]optionalAdditional validation rules to merge into the target object
indexesObject[]optionalAdditional indexes to merge into the target object
priorityintegerMerge priority (higher = applied later)

ObjectOwnershipEnum

Allowed Values

  • own
  • extend

PartitioningConfig

Properties

PropertyTypeRequiredDescription
enabledbooleanEnable table partitioning
strategyEnum<'range' | 'hash' | 'list'>Partitioning strategy: range (date ranges), hash (consistent hashing), list (predefined values)
keystringField name to partition by
intervalstringoptionalPartition interval for range strategy (e.g., "1 month", "1 year")

SoftDeleteConfig

Properties

PropertyTypeRequiredDescription
enabledbooleanEnable soft delete (trash/recycle bin)
fieldstringField name for soft delete timestamp
cascadeDeletebooleanCascade soft delete to related records

TenancyConfig

Properties

PropertyTypeRequiredDescription
enabledbooleanEnable multi-tenancy for this object
strategyEnum<'shared' | 'isolated' | 'hybrid'>Tenant isolation strategy: shared (single DB, row-level), isolated (separate DB per tenant), hybrid (mix)
tenantFieldstringField name for tenant identifier
crossTenantAccessbooleanAllow cross-tenant data access (with explicit permission)

VersioningConfig

Properties

PropertyTypeRequiredDescription
enabledbooleanEnable record versioning
strategyEnum<'snapshot' | 'delta' | 'event-sourcing'>Versioning strategy: snapshot (full copy), delta (changes only), event-sourcing (event log)
retentionDaysnumberoptionalNumber of days to retain old versions (undefined = infinite)
versionFieldstringField name for version number/timestamp

On this page