Skip to content
Sarj Workspace Sync

operations/schemas

@sarj-ai/workspace-sync/operations/schemas ยท Source

import { z } from "zod";
export declare const JsonValueSchema: z.ZodJSONSchema;
export type JsonValue = z.output<typeof JsonValueSchema>;
export declare const OperationActorSchema: z.ZodObject<{
authorizationScope: z.ZodString;
id: z.ZodString;
}, z.core.$strict>;
export type OperationActor = z.output<typeof OperationActorSchema>;
export declare const OperationHttpErrorSchema: z.ZodObject<{
error: z.ZodString;
message: z.ZodString;
}, z.core.$strict>;
export declare const OperationIdentifierSchema: z.ZodString;
export declare const OperationDiscoveryMetadataSchema: z.ZodObject<{
destructive: z.ZodBoolean;
execution: z.ZodEnum<{
sync: "sync";
workflow: "workflow";
}>;
requiredRole: z.ZodString;
requiredScope: z.ZodString;
risk: z.ZodEnum<{
high: "high";
low: "low";
medium: "medium";
}>;
sourceSystems: z.ZodArray<z.ZodString>;
summary: z.ZodString;
supportsApply: z.ZodBoolean;
supportsPlan: z.ZodLiteral<true>;
targetSystems: z.ZodArray<z.ZodString>;
}, z.core.$strict>;
export type OperationDiscoveryMetadata = z.output<typeof OperationDiscoveryMetadataSchema>;
export declare const OperationDescriptorSchema: z.ZodObject<{
destructive: z.ZodBoolean;
execution: z.ZodEnum<{
sync: "sync";
workflow: "workflow";
}>;
requiredRole: z.ZodString;
requiredScope: z.ZodString;
risk: z.ZodEnum<{
high: "high";
low: "low";
medium: "medium";
}>;
sourceSystems: z.ZodArray<z.ZodString>;
summary: z.ZodString;
supportsApply: z.ZodBoolean;
supportsPlan: z.ZodLiteral<true>;
targetSystems: z.ZodArray<z.ZodString>;
operationId: z.ZodString;
}, z.core.$strict>;
export type OperationDescriptor = z.output<typeof OperationDescriptorSchema>;
export declare const OperationDiscoveryResponseSchema: z.ZodObject<{
operations: z.ZodArray<z.ZodObject<{
destructive: z.ZodBoolean;
execution: z.ZodEnum<{
sync: "sync";
workflow: "workflow";
}>;
requiredRole: z.ZodString;
requiredScope: z.ZodString;
risk: z.ZodEnum<{
high: "high";
low: "low";
medium: "medium";
}>;
sourceSystems: z.ZodArray<z.ZodString>;
summary: z.ZodString;
supportsApply: z.ZodBoolean;
supportsPlan: z.ZodLiteral<true>;
targetSystems: z.ZodArray<z.ZodString>;
operationId: z.ZodString;
}, z.core.$strict>>;
}, z.core.$strict>;
export declare const OperationDiagnosticSchema: z.ZodObject<{
actionId: z.ZodOptional<z.ZodString>;
code: z.ZodString;
context: z.ZodOptional<z.ZodObject<{
error_code: z.ZodEnum<{
linear_organization_id_mismatch: "linear_organization_id_mismatch";
linear_organization_id_unpinned: "linear_organization_id_unpinned";
linear_organization_url_key_mismatch: "linear_organization_url_key_mismatch";
}>;
kind: z.ZodLiteral<"linear_tenant">;
observed_organization_id: z.ZodUUID;
observed_url_key: z.ZodString;
}, z.core.$strict>>;
message: z.ZodString;
severity: z.ZodEnum<{
blocker: "blocker";
info: "info";
warning: "warning";
}>;
}, z.core.$strict>;
export type OperationDiagnostic = z.output<typeof OperationDiagnosticSchema>;
export declare const SourceFingerprintSchema: z.ZodObject<{
authority: z.ZodString;
resourceId: z.ZodString;
resourceType: z.ZodString;
version: z.ZodString;
}, z.core.$strict>;
export type SourceFingerprint = z.output<typeof SourceFingerprintSchema>;
export declare const OperationConfirmationCountsSchema: z.ZodRecord<z.ZodString, z.ZodNumber>;
export declare const ManagedChangeSchema: z.ZodObject<{
actionId: z.ZodString;
after: z.ZodNullable<z.ZodJSONSchema>;
before: z.ZodNullable<z.ZodJSONSchema>;
confirmationCounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
details: z.ZodJSONSchema;
display: z.ZodString;
kind: z.ZodEnum<{
add: "add";
change: "change";
invoke: "invoke";
remove: "remove";
}>;
reason: z.ZodString;
resource: z.ZodObject<{
id: z.ZodString;
type: z.ZodString;
}, z.core.$strict>;
risk: z.ZodEnum<{
high: "high";
low: "low";
medium: "medium";
}>;
}, z.core.$strict>;
export type ManagedChange = z.output<typeof ManagedChangeSchema>;
export declare const PlanSummarySchema: z.ZodObject<{
add: z.ZodNumber;
change: z.ZodNumber;
invoke: z.ZodNumber;
remove: z.ZodNumber;
total: z.ZodNumber;
}, z.core.$strict>;
export type PlanSummary = z.output<typeof PlanSummarySchema>;
export declare const OperationPlanEnvelopeSchema: z.ZodObject<{
actor: z.ZodObject<{
authorizationScope: z.ZodString;
id: z.ZodString;
}, z.core.$strict>;
applicable: z.ZodBoolean;
applyAuthorized: z.ZodBoolean;
changes: z.ZodArray<z.ZodObject<{
actionId: z.ZodString;
after: z.ZodNullable<z.ZodJSONSchema>;
before: z.ZodNullable<z.ZodJSONSchema>;
confirmationCounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
details: z.ZodJSONSchema;
display: z.ZodString;
kind: z.ZodEnum<{
add: "add";
change: "change";
invoke: "invoke";
remove: "remove";
}>;
reason: z.ZodString;
resource: z.ZodObject<{
id: z.ZodString;
type: z.ZodString;
}, z.core.$strict>;
risk: z.ZodEnum<{
high: "high";
low: "low";
medium: "medium";
}>;
}, z.core.$strict>>;
diagnostics: z.ZodArray<z.ZodObject<{
actionId: z.ZodOptional<z.ZodString>;
code: z.ZodString;
context: z.ZodOptional<z.ZodObject<{
error_code: z.ZodEnum<{
linear_organization_id_mismatch: "linear_organization_id_mismatch";
linear_organization_id_unpinned: "linear_organization_id_unpinned";
linear_organization_url_key_mismatch: "linear_organization_url_key_mismatch";
}>;
kind: z.ZodLiteral<"linear_tenant">;
observed_organization_id: z.ZodUUID;
observed_url_key: z.ZodString;
}, z.core.$strict>>;
message: z.ZodString;
severity: z.ZodEnum<{
blocker: "blocker";
info: "info";
warning: "warning";
}>;
}, z.core.$strict>>;
environment: z.ZodString;
expiresAt: z.ZodISODateTime;
generatedAt: z.ZodISODateTime;
input: z.ZodJSONSchema;
operation: z.ZodString;
planHash: z.ZodString;
policyVersion: z.ZodString;
schemaVersion: z.ZodLiteral<2>;
sourceFingerprints: z.ZodArray<z.ZodObject<{
authority: z.ZodString;
resourceId: z.ZodString;
resourceType: z.ZodString;
version: z.ZodString;
}, z.core.$strict>>;
summary: z.ZodObject<{
add: z.ZodNumber;
change: z.ZodNumber;
invoke: z.ZodNumber;
remove: z.ZodNumber;
total: z.ZodNumber;
}, z.core.$strict>;
}, z.core.$strict>;
export type OperationPlanEnvelope = z.output<typeof OperationPlanEnvelopeSchema>;
export declare const SignedOperationPlanSchema: z.ZodObject<{
plan: z.ZodObject<{
actor: z.ZodObject<{
authorizationScope: z.ZodString;
id: z.ZodString;
}, z.core.$strict>;
applicable: z.ZodBoolean;
applyAuthorized: z.ZodBoolean;
changes: z.ZodArray<z.ZodObject<{
actionId: z.ZodString;
after: z.ZodNullable<z.ZodJSONSchema>;
before: z.ZodNullable<z.ZodJSONSchema>;
confirmationCounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
details: z.ZodJSONSchema;
display: z.ZodString;
kind: z.ZodEnum<{
add: "add";
change: "change";
invoke: "invoke";
remove: "remove";
}>;
reason: z.ZodString;
resource: z.ZodObject<{
id: z.ZodString;
type: z.ZodString;
}, z.core.$strict>;
risk: z.ZodEnum<{
high: "high";
low: "low";
medium: "medium";
}>;
}, z.core.$strict>>;
diagnostics: z.ZodArray<z.ZodObject<{
actionId: z.ZodOptional<z.ZodString>;
code: z.ZodString;
context: z.ZodOptional<z.ZodObject<{
error_code: z.ZodEnum<{
linear_organization_id_mismatch: "linear_organization_id_mismatch";
linear_organization_id_unpinned: "linear_organization_id_unpinned";
linear_organization_url_key_mismatch: "linear_organization_url_key_mismatch";
}>;
kind: z.ZodLiteral<"linear_tenant">;
observed_organization_id: z.ZodUUID;
observed_url_key: z.ZodString;
}, z.core.$strict>>;
message: z.ZodString;
severity: z.ZodEnum<{
blocker: "blocker";
info: "info";
warning: "warning";
}>;
}, z.core.$strict>>;
environment: z.ZodString;
expiresAt: z.ZodISODateTime;
generatedAt: z.ZodISODateTime;
input: z.ZodJSONSchema;
operation: z.ZodString;
planHash: z.ZodString;
policyVersion: z.ZodString;
schemaVersion: z.ZodLiteral<2>;
sourceFingerprints: z.ZodArray<z.ZodObject<{
authority: z.ZodString;
resourceId: z.ZodString;
resourceType: z.ZodString;
version: z.ZodString;
}, z.core.$strict>>;
summary: z.ZodObject<{
add: z.ZodNumber;
change: z.ZodNumber;
invoke: z.ZodNumber;
remove: z.ZodNumber;
total: z.ZodNumber;
}, z.core.$strict>;
}, z.core.$strict>;
signature: z.ZodString;
}, z.core.$strict>;
export type SignedOperationPlan = z.output<typeof SignedOperationPlanSchema>;
export declare const ApplyOperationRequestSchema: z.ZodObject<{
confirmPlanHash: z.ZodString;
confirmations: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
allowed: z.ZodBoolean;
expectedCount: z.ZodNumber;
}, z.core.$strict>>>>;
expectedActionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
riskAcknowledged: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
signedPlan: z.ZodObject<{
plan: z.ZodObject<{
actor: z.ZodObject<{
authorizationScope: z.ZodString;
id: z.ZodString;
}, z.core.$strict>;
applicable: z.ZodBoolean;
applyAuthorized: z.ZodBoolean;
changes: z.ZodArray<z.ZodObject<{
actionId: z.ZodString;
after: z.ZodNullable<z.ZodJSONSchema>;
before: z.ZodNullable<z.ZodJSONSchema>;
confirmationCounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
details: z.ZodJSONSchema;
display: z.ZodString;
kind: z.ZodEnum<{
add: "add";
change: "change";
invoke: "invoke";
remove: "remove";
}>;
reason: z.ZodString;
resource: z.ZodObject<{
id: z.ZodString;
type: z.ZodString;
}, z.core.$strict>;
risk: z.ZodEnum<{
high: "high";
low: "low";
medium: "medium";
}>;
}, z.core.$strict>>;
diagnostics: z.ZodArray<z.ZodObject<{
actionId: z.ZodOptional<z.ZodString>;
code: z.ZodString;
context: z.ZodOptional<z.ZodObject<{
error_code: z.ZodEnum<{
linear_organization_id_mismatch: "linear_organization_id_mismatch";
linear_organization_id_unpinned: "linear_organization_id_unpinned";
linear_organization_url_key_mismatch: "linear_organization_url_key_mismatch";
}>;
kind: z.ZodLiteral<"linear_tenant">;
observed_organization_id: z.ZodUUID;
observed_url_key: z.ZodString;
}, z.core.$strict>>;
message: z.ZodString;
severity: z.ZodEnum<{
blocker: "blocker";
info: "info";
warning: "warning";
}>;
}, z.core.$strict>>;
environment: z.ZodString;
expiresAt: z.ZodISODateTime;
generatedAt: z.ZodISODateTime;
input: z.ZodJSONSchema;
operation: z.ZodString;
planHash: z.ZodString;
policyVersion: z.ZodString;
schemaVersion: z.ZodLiteral<2>;
sourceFingerprints: z.ZodArray<z.ZodObject<{
authority: z.ZodString;
resourceId: z.ZodString;
resourceType: z.ZodString;
version: z.ZodString;
}, z.core.$strict>>;
summary: z.ZodObject<{
add: z.ZodNumber;
change: z.ZodNumber;
invoke: z.ZodNumber;
remove: z.ZodNumber;
total: z.ZodNumber;
}, z.core.$strict>;
}, z.core.$strict>;
signature: z.ZodString;
}, z.core.$strict>;
}, z.core.$strict>;
export type ApplyOperationRequest = z.output<typeof ApplyOperationRequestSchema>;
export declare const ApplyActionResultSchema: z.ZodObject<{
actionId: z.ZodString;
message: z.ZodOptional<z.ZodString>;
state: z.ZodEnum<{
applied: "applied";
failed: "failed";
skipped: "skipped";
}>;
}, z.core.$strict>;
export type ApplyActionResult = z.output<typeof ApplyActionResultSchema>;
export declare const ApplyOperationResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
actions: z.ZodArray<z.ZodObject<{
actionId: z.ZodString;
message: z.ZodOptional<z.ZodString>;
state: z.ZodEnum<{
applied: "applied";
failed: "failed";
skipped: "skipped";
}>;
}, z.core.$strict>>;
planHash: z.ZodString;
state: z.ZodLiteral<"applied">;
}, z.core.$strict>, z.ZodObject<{
actions: z.ZodArray<z.ZodObject<{
actionId: z.ZodString;
message: z.ZodOptional<z.ZodString>;
state: z.ZodEnum<{
applied: "applied";
failed: "failed";
skipped: "skipped";
}>;
}, z.core.$strict>>;
planHash: z.ZodString;
state: z.ZodLiteral<"noop">;
}, z.core.$strict>, z.ZodObject<{
actions: z.ZodArray<z.ZodObject<{
actionId: z.ZodString;
message: z.ZodOptional<z.ZodString>;
state: z.ZodEnum<{
applied: "applied";
failed: "failed";
skipped: "skipped";
}>;
}, z.core.$strict>>;
planHash: z.ZodString;
code: z.ZodLiteral<"plan_expired">;
message: z.ZodString;
state: z.ZodLiteral<"expired">;
}, z.core.$strict>, z.ZodObject<{
actions: z.ZodArray<z.ZodObject<{
actionId: z.ZodString;
message: z.ZodOptional<z.ZodString>;
state: z.ZodEnum<{
applied: "applied";
failed: "failed";
skipped: "skipped";
}>;
}, z.core.$strict>>;
planHash: z.ZodString;
actionId: z.ZodOptional<z.ZodString>;
code: z.ZodEnum<{
source_drift: "source_drift";
target_drift: "target_drift";
}>;
message: z.ZodString;
state: z.ZodLiteral<"stale">;
}, z.core.$strict>, z.ZodObject<{
actions: z.ZodArray<z.ZodObject<{
actionId: z.ZodString;
message: z.ZodOptional<z.ZodString>;
state: z.ZodEnum<{
applied: "applied";
failed: "failed";
skipped: "skipped";
}>;
}, z.core.$strict>>;
planHash: z.ZodString;
code: z.ZodEnum<{
apply_not_supported: "apply_not_supported";
mutation_confirmation_mismatch: "mutation_confirmation_mismatch";
mutation_confirmation_required: "mutation_confirmation_required";
plan_blocked: "plan_blocked";
risk_acknowledgement_required: "risk_acknowledgement_required";
}>;
message: z.ZodString;
state: z.ZodLiteral<"blocked">;
}, z.core.$strict>, z.ZodObject<{
actions: z.ZodArray<z.ZodObject<{
actionId: z.ZodString;
message: z.ZodOptional<z.ZodString>;
state: z.ZodEnum<{
applied: "applied";
failed: "failed";
skipped: "skipped";
}>;
}, z.core.$strict>>;
planHash: z.ZodString;
code: z.ZodEnum<{
read_failed: "read_failed";
readback_failed: "readback_failed";
target_drift: "target_drift";
write_failed: "write_failed";
}>;
message: z.ZodString;
state: z.ZodEnum<{
failed: "failed";
failed_partial: "failed_partial";
}>;
}, z.core.$strict>], "state">;
export type ApplyOperationResult = z.output<typeof ApplyOperationResultSchema>;