Skip to main content

CONNECTOR_EVENT_SCHEMAS_SOURCE

Constant CONNECTOR_EVENT_SCHEMAS_SOURCE 

Source
pub const CONNECTOR_EVENT_SCHEMAS_SOURCE: &str = "/**\n * Canonical normalized connector event schemas, authored as Harn types.\n *\n * This module is the SOURCE OF TRUTH for the normalized-event shapes that\n * `.harn` connectors emit and the Rust runtime deserializes. The Rust structs\n * in `crates/harn-vm/src/triggers/event/schemas_generated.rs` are GENERATED\n * from these declarations by `harn connector-schema-codegen`, so a connector\'s\n * JSON output matches the Rust struct by construction.\n *\n * Regenerate the Rust structs with:  make gen-connector-schemas\n * Verify they are not stale with:     make check-connector-schemas\n *\n * Type mapping applied by the generator:\n *   string      -> String\n *   int         -> i64\n *   bool        -> bool\n *   any         -> serde_json::Value      (untyped JSON subtree)\n *   T?          -> Option<T>              (+ serde default + skip_serializing_if)\n *   list<T>     -> Vec<T>                 (+ serde default)\n *   dict<K, V>  -> BTreeMap<K, V>         (+ serde default)\n *   { ... }     -> a `#[serde(flatten)]` field named `common` when the field is\n *                  spelled `common: <Record>`; otherwise a nested struct.\n *\n * GIT FORGE. Provider packages for GitHub, GitLab, Gitea, Forgejo, and other\n * forges can emit these records onto the shared forge event-log topic while\n * still preserving their native payload in `raw_payload`.\n */\ntype GitForgeRepositoryRef = {provider: string, full_name?: string, id?: string, web_url?: string}\n\ntype GitForgePullRequestRef = {\n  number: int,\n  id?: string,\n  title?: string,\n  author?: string,\n  web_url?: string,\n  head_ref?: string,\n  head_sha?: string,\n  base_ref?: string,\n  base_sha?: string,\n  state?: string,\n  draft?: bool,\n  merged?: bool,\n}\n\ntype GitForgeWritebackTarget = {\n  provider: string,\n  repository_full_name?: string,\n  repository_id?: string,\n  pull_request_number: int,\n  web_url?: string,\n}\n\ntype GitForgePullRequestEvent = {\n  topic: string,\n  event: string,\n  kind: string,\n  provider: string,\n  lifecycle: string,\n  repository: GitForgeRepositoryRef,\n  pull_request: GitForgePullRequestRef,\n  writeback: GitForgeWritebackTarget,\n  delivery_id?: string,\n  signature_status?: any,\n  provider_metadata: dict<string, any>,\n  raw_payload: any,\n}\n\n// GITHUB. The provider-schema generator is exercised end-to-end for GitHub,\n// alongside the forge-agnostic records above. Keep the GitHub records a\n// faithful mirror of the `GitHubEventPayload` family in\n// `crates/harn-vm/src/triggers/event/payloads.rs`.\n/**\n * Stable common block shared by every GitHub normalized event. The generator\n * recognizes a field named `common` whose type is a record and emits it as a\n * `#[serde(flatten)]` field, matching the hand-written `GitHubEventCommon`.\n */\ntype GitHubEventCommon = {\n  event: string,\n  action?: string,\n  delivery_id?: string,\n  installation_id?: int,\n  topic?: string,\n  repository?: any,\n  repo?: any,\n  raw: any,\n}\n\ntype GitHubIssuesEventPayload = {common: GitHubEventCommon, issue: any}\n\ntype GitHubPullRequestEventPayload = {common: GitHubEventCommon, pull_request: any}\n\ntype GitHubIssueCommentEventPayload = {common: GitHubEventCommon, issue: any, comment: any}\n\ntype GitHubPullRequestReviewEventPayload = {\n  common: GitHubEventCommon,\n  pull_request: any,\n  review: any,\n}\n\ntype GitHubPushEventPayload = {common: GitHubEventCommon, commits: list<any>, distinct_size?: int}\n\ntype GitHubWorkflowRunEventPayload = {common: GitHubEventCommon, workflow_run: any}\n\ntype GitHubDeploymentStatusEventPayload = {\n  common: GitHubEventCommon,\n  deployment_status: any,\n  deployment: any,\n}\n\ntype GitHubCheckRunEventPayload = {common: GitHubEventCommon, check_run: any}\n\ntype GitHubCheckSuiteEventPayload = {\n  common: GitHubEventCommon,\n  check_suite: any,\n  check_suite_id?: int,\n  pull_request_number?: int,\n  head_sha?: string,\n  head_ref?: string,\n  base_ref?: string,\n  status?: string,\n  conclusion?: string,\n}\n\ntype GitHubStatusEventPayload = {\n  common: GitHubEventCommon,\n  commit_status?: any,\n  status_id?: int,\n  head_sha?: string,\n  head_ref?: string,\n  base_ref?: string,\n  state?: string,\n  context?: string,\n  target_url?: string,\n}\n\ntype GitHubMergeGroupEventPayload = {\n  common: GitHubEventCommon,\n  merge_group: any,\n  merge_group_id?: any,\n  head_sha?: string,\n  head_ref?: string,\n  base_sha?: string,\n  base_ref?: string,\n  pull_requests: list<any>,\n  pull_request_numbers: list<int>,\n}\n\ntype GitHubInstallationEventPayload = {\n  common: GitHubEventCommon,\n  installation?: any,\n  account?: any,\n  installation_state?: string,\n  suspended?: bool,\n  revoked?: bool,\n  repositories: list<any>,\n}\n\ntype GitHubInstallationRepositoriesEventPayload = {\n  common: GitHubEventCommon,\n  installation?: any,\n  account?: any,\n  installation_state?: string,\n  suspended?: bool,\n  revoked?: bool,\n  repository_selection?: string,\n  repositories_added: list<any>,\n  repositories_removed: list<any>,\n}\n\n/**\n * The dispatched GitHub event union, mirroring the hand-written\n * `GitHubEventPayload` enum (an untagged-on-the-wire, `event`-dispatched enum).\n *\n * The generator emits one Rust enum variant per union member; the trailing\n * `GitHubEventCommon` member is the catch-all `Other` variant the manual\n * `Deserialize` falls back to when the `event` discriminator is unrecognized.\n * Referencing every payload record here also keeps this schema module free of\n * `unused-type` lint noise.\n */\ntype GitHubEventPayload = GitHubIssuesEventPayload | GitHubPullRequestEventPayload | GitHubIssueCommentEventPayload | GitHubPullRequestReviewEventPayload | GitHubPushEventPayload | GitHubWorkflowRunEventPayload | GitHubDeploymentStatusEventPayload | GitHubCheckRunEventPayload | GitHubCheckSuiteEventPayload | GitHubStatusEventPayload | GitHubMergeGroupEventPayload | GitHubInstallationEventPayload | GitHubInstallationRepositoriesEventPayload | GitHubEventCommon\n";
Expand description

Canonical normalized connector event schemas, authored as Harn type declarations. This is the SOURCE OF TRUTH for the Rust event-payload structs in crates/harn-vm/src/triggers/event/schemas_generated.rs, which are generated from these declarations by harn connector-schema-codegen.

It is intentionally NOT registered in STDLIB_SOURCES: it is a codegen input (like spec/openapi.yaml), not a module loaded into every program. Exposing it as an embedded string keeps the generator independent of the current working directory.