@@ -2,6 +2,22 @@ import { z } from 'zod';
22import { FieldSchema } from './field.zod' ;
33import { ValidationRuleSchema } from './validation.zod' ;
44
5+ /**
6+ * API Operations Enum
7+ */
8+ export const ApiMethod = z . enum ( [
9+ 'get' , 'list' , // Read
10+ 'create' , 'update' , 'delete' , // Write
11+ 'upsert' , // Idempotent Write
12+ 'bulk' , // Batch operations
13+ 'aggregate' , // Analytics (count, sum)
14+ 'history' , // Audit access
15+ 'search' , // Search access
16+ 'restore' , 'purge' , // Trash management
17+ 'import' , 'export' , // Data portability
18+ ] ) ;
19+ export type ApiMethod = z . infer < typeof ApiMethod > ;
20+
521/**
622 * Capability Flags
723 * Defines what system features are enabled for this object.
@@ -26,17 +42,7 @@ export const ObjectCapabilities = z.object({
2642 * API Supported Operations
2743 * Granular control over API exposure.
2844 */
29- apiMethods : z . array ( z . enum ( [
30- 'get' , 'list' , // Read
31- 'create' , 'update' , 'delete' , // Write
32- 'upsert' , // Idempotent Write
33- 'bulk' , // Batch operations
34- 'aggregate' , // Analytics (count, sum)
35- 'history' , // Audit access
36- 'search' , // Search access
37- 'restore' , 'purge' , // Trash management
38- 'import' , 'export' , // Data portability
39- ] ) ) . optional ( ) . describe ( 'Whitelist of allowed API operations' ) ,
45+ apiMethods : z . array ( ApiMethod ) . optional ( ) . describe ( 'Whitelist of allowed API operations' ) ,
4046
4147 /** Enable standard attachments/files engine */
4248 files : z . boolean ( ) . default ( false ) . describe ( 'Enable file attachments and document management' ) ,
0 commit comments