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
43 lines (42 loc) • 2.32 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ArvoOrchestrationSubjectContentSchema = void 0;
var zod_1 = require("zod");
var schema_1 = require("../schema");
var utils_1 = require("../utils");
// Zod schema for ArvoOrchestrationSubjectContent
exports.ArvoOrchestrationSubjectContentSchema = zod_1.z
.object({
orchestrator: zod_1.z
.object({
name: zod_1.z
.string()
.regex(/^[a-z0-9]+(\.[a-z0-9]+)+\.[a-z0-9]+$/, 'Orchestrator name should be prefixed with a reverse-DNS name')
.refine(function (value) { return !value.includes(';'); }, 'Orchestrator name must not contain semicolon')
.describe('Name of the orchestrator'),
version: schema_1.ArvoSemanticVersionSchema,
})
.describe('Information about the orchestrator'),
execution: zod_1.z
.object({
id: zod_1.z
.string()
.min(1, 'ID must be a non-empty string')
.refine(function (value) { return !value.includes(';'); }, 'ID must not contain semicolon')
.describe('Unique identifier for the execution'),
initiator: zod_1.z
.string()
.regex(/^[a-z0-9]+(\.[a-z0-9]+)+\.[a-z0-9]+$/, 'Orchestration initiator should be prefixed with a reverse-DNS name')
.refine(function (value) { return !value.includes(';'); }, 'Initiator must not contain semicolon')
.describe('Entity or process that initiated the execution'),
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 domain of the orchestration init event'),
})
.describe('Details about the current execution'),
meta: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).describe((0, utils_1.cleanString)("\n Additional metadata for the orchestration process. Store essential key-value pairs \n that provide context or configuration details necessary for the orchestration. \n Use selectively to maintain clarity and avoid storing unnecessary information. \n ")),
})
.describe('Context information for Arvo orchestration');