Creates an ArvoContract with standardized naming conventions and a simplified event pattern. Use this to create contracts with one emit type only.
If any of the validations in ArvoContract or createArvoContract fail
const contract = createSimpleArvoContract({ uri: 'api.example/contracts/user', type: 'user.create', description: 'User creation contract', versions: { '1.0.0': { accepts: z.object({ name: z.string(), email: z.string().email() }), emits: z.object({ userId: z.string(), timestamp: z.date() }) } }}); Copy
const contract = createSimpleArvoContract({ uri: 'api.example/contracts/user', type: 'user.create', description: 'User creation contract', versions: { '1.0.0': { accepts: z.object({ name: z.string(), email: z.string().email() }), emits: z.object({ userId: z.string(), timestamp: z.date() }) } }});
Provides a simplified contract creation pattern with standardized conventions:
Contract configuration
Optional
Optional contract description
Optional metadata for the contract
Base event type (will be prefixed with "com.")
Contract identifier URI
Version-specific schema definitions
ArvoContract with standardized type formatting and metadata
Creates an ArvoContract with standardized naming conventions and a simplified event pattern. Use this to create contracts with one emit type only.
Throws
If any of the validations in ArvoContract or createArvoContract fail
Example
Remarks
Provides a simplified contract creation pattern with standardized conventions: