UNPKG

arvo-core

Version:

The core Arvo package which provides application tier core primitives and contract system for building production-grade event-driven application. Provides ArvoEvent (CloudEvents-compliant), ArvoContract for type-safe service interfaces, event factories, O

28 lines (27 loc) 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ArvoContractValidators = void 0; var zod_1 = require("zod"); var utils_1 = require("../utils"); exports.ArvoContractValidators = { contract: { uri: zod_1.z .string() .min(1, 'URI must be a non-empty string') .refine(utils_1.validateURI, 'The URI must a valid URI string') .describe((0, utils_1.cleanString)("\n The addressable unique URI of the contract so that\n it can be located and address for reference during\n operations\n ")), domain: zod_1.z .string() .min(1, 'The domain must be non-empty string') .regex(/^[a-z0-9.]+$/, 'Domain must contain only lowercase letters, numbers, and dots') .nullable() .describe('The contract handler domian'), }, record: { type: zod_1.z .string() .min(1, 'Type must be a non-empty string') .regex(/^[a-z0-9]+(\.[a-z0-9]+)+\.[a-z0-9]+$/, 'Type should be prefixed with a reverse-DNS name') .describe((0, utils_1.cleanString)("\n The type of event related to the originating occurrence.\n Should be prefixed with a reverse-DNS name.\n ")), }, };