ObjectStackObjectStack

Recycle Bin schema — Data Protocol reference

Recycle Bin schemas of the ObjectStack Data Protocol: RecycleBinClearedReference and 5 more — each property with its type, default and a TypeScript example.

Source: packages/spec/src/data/recycle-bin.zod.ts

TypeScript Usage

import { RecycleBinClearedReferenceSchema, RecycleBinEntrySchema, RecycleBinRetentionDaysSchema, RecycleBinRetentionDaysEnvSchema, RecycleBinSnapshotSchema, RecycleBinSnapshotRowSchema } from '@objectstack/spec/data';
import type { RecycleBinClearedReference, RecycleBinEntry, RecycleBinRetentionDays, RecycleBinRetentionDaysEnv, RecycleBinSnapshot, RecycleBinSnapshotRow } from '@objectstack/spec/data';

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

RecycleBinClearedReference

A set_null reference the delete cleared, re-linked on restore when still empty

Properties

PropertyTypeRequiredDescription
objectstring✅Object of the live row whose reference was cleared
idstring✅Id of the live row whose reference was cleared
fieldstring✅The lookup field the delete cleared
valuestring✅The id the field held, a row in this entry

RecycleBinEntry

One recycle-bin entry: one delete operation

Properties

PropertyTypeRequiredDescription
idstringoptionalEntry id
object_namestring✅The object the delete operation targeted
record_idstring✅The id of the record the delete operation targeted
record_countinteger✅How many rows the snapshot holds
snapshot{ rows: object[]; clearedReferences: object[] }✅The cascade set a recycle-bin entry holds
deleted_bystringoptionalThe deleting principal (a sys_user id)
deleted_atstring✅When the delete operation committed
retention_daysinteger✅The retention in days applied at delete time
purge_afterstring✅The purge deadline, stamped at delete time

Nested Shape: RecycleBinEntry.snapshot

PropertyTypeRequiredDescription
rows{ object: string; id: string; values: Record<string, any> }[]✅The removed rows, the master first, then its details in cascade order
clearedReferences{ object: string; id: string; field: string; value: string }[]✅The set_null references the delete cleared

RecycleBinRetentionDays

Recycle-bin retention in days: a positive whole number

Type: integer


RecycleBinRetentionDaysEnv

OS_RECYCLE_BIN_RETENTION_DAYS: the decimal digits of a positive whole number of days

Type: string


RecycleBinSnapshot

The cascade set a recycle-bin entry holds

Properties

PropertyTypeRequiredDescription
rows{ object: string; id: string; values: Record<string, any> }[]✅The removed rows, the master first, then its details in cascade order
clearedReferences{ object: string; id: string; field: string; value: string }[]✅The set_null references the delete cleared

Nested Shape: RecycleBinSnapshot.rows[number]

One snapshotted row of a recycle-bin entry

PropertyTypeRequiredDescription
objectstring✅Object name of the deleted row
idstring✅The row id, restored unchanged
valuesRecord<string, any>✅The row as it stood at delete time, secret-channel refs left out

Nested Shape: RecycleBinSnapshot.clearedReferences[number]

A set_null reference the delete cleared, re-linked on restore when still empty

PropertyTypeRequiredDescription
objectstring✅Object of the live row whose reference was cleared
idstring✅Id of the live row whose reference was cleared
fieldstring✅The lookup field the delete cleared
valuestring✅The id the field held, a row in this entry

RecycleBinSnapshotRow

One snapshotted row of a recycle-bin entry

Properties

PropertyTypeRequiredDescription
objectstring✅Object name of the deleted row
idstring✅The row id, restored unchanged
valuesRecord<string, any>✅The row as it stood at delete time, secret-channel refs left out

On this page