arvo-core
Version:
This core package contains all the core classes and components of the Arvo Event Driven System
18 lines (17 loc) • 1.61 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrchestrationInitEventBaseSchema = void 0;
var zod_1 = require("zod");
var utils_1 = require("../utils");
/**
* Defines the base schema for orchestrator acceptance in the context of ArvoEvents.
* This schema is used to validate and type-check the minimal required fields
* for an orchestrator to accept a task or event.
*/
exports.OrchestrationInitEventBaseSchema = zod_1.z.object({
parentSubject$$: zod_1.z
.string()
.min(1, 'The parent subject must not be an empty string')
.nullable()
.describe((0, utils_1.cleanString)("\n Identifies the subject of the parent process or event in the ArvoEvent system.\n \n Purpose:\n 1. Enables the orchestrator to return its final output to the initiating process or orchestrator.\n 2. Maintains the event chain and process hierarchy in a distributed system.\n 3. Facilitates proper event routing and traceability.\n \n Usage:\n - For non-root processes: Set to the subject of the parent process/orchestrator.\n - For root processes/orchestrations: Must be set to null.\n \n This field aligns with the ArvoEvent 'subject' field, which is a URI identifying the event's subject.\n It plays a crucial role in distributed tracing, debugging, and maintaining system coherence.\n \n Example:\n - Parent process subject: \"process/parent-id-123\"\n - Child process parentSubject$$: \"process/parent-id-123\"\n \n Note: Ensure this value is a valid URI as per ArvoEvent specifications.\n ")),
});