Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz Source: /opt/alga-psa on psa.joliet.tech
73 lines
2.4 KiB
TypeScript
73 lines
2.4 KiB
TypeScript
import type { WorkflowBundleDependencySummaryV1 } from './dependencySummaryV1';
|
|
|
|
export const WORKFLOW_BUNDLE_FORMAT = 'alga-psa.workflow-bundle' as const;
|
|
export const WORKFLOW_BUNDLE_FORMAT_VERSION_V1 = 1 as const;
|
|
|
|
export type WorkflowBundleHeaderV1 = {
|
|
format: typeof WORKFLOW_BUNDLE_FORMAT;
|
|
formatVersion: typeof WORKFLOW_BUNDLE_FORMAT_VERSION_V1;
|
|
exportedAt: string; // ISO-8601 timestamp
|
|
};
|
|
|
|
export type WorkflowBundleWorkflowMetadataV1 = {
|
|
name: string;
|
|
description: string | null;
|
|
payloadSchemaRef: string;
|
|
payloadSchemaMode: 'inferred' | 'pinned' | string | null;
|
|
pinnedPayloadSchemaRef: string | null;
|
|
trigger: Record<string, unknown> | null;
|
|
|
|
// Operational settings (mirrors workflow_definitions columns; see exporter/importer for fidelity rules).
|
|
isSystem: boolean;
|
|
isVisible: boolean;
|
|
isPaused: boolean;
|
|
concurrencyLimit: number | null;
|
|
autoPauseOnFailure: boolean;
|
|
failureRateThreshold: number | string | null;
|
|
failureRateMinRuns: number | null;
|
|
retentionPolicyOverride: Record<string, unknown> | null;
|
|
};
|
|
|
|
export type WorkflowBundleDraftV1 = {
|
|
draftVersion: number;
|
|
definition: Record<string, unknown>;
|
|
};
|
|
|
|
export type WorkflowBundlePublishedVersionV1 = {
|
|
version: number;
|
|
definition: Record<string, unknown>;
|
|
payloadSchemaJson: Record<string, unknown> | null;
|
|
};
|
|
|
|
export type WorkflowBundleWorkflowV1 = {
|
|
key: string;
|
|
metadata: WorkflowBundleWorkflowMetadataV1;
|
|
dependencies: WorkflowBundleDependencySummaryV1;
|
|
draft: WorkflowBundleDraftV1;
|
|
publishedVersions: WorkflowBundlePublishedVersionV1[];
|
|
};
|
|
|
|
export type WorkflowBundleV1 = WorkflowBundleHeaderV1 & {
|
|
workflows: WorkflowBundleWorkflowV1[];
|
|
};
|
|
|
|
export const WORKFLOW_BUNDLE_WORKFLOW_KEY_PATTERN = /^[a-z0-9][a-z0-9._-]*$/;
|
|
|
|
export function assertWorkflowBundleWorkflowKey(value: unknown): asserts value is string {
|
|
if (typeof value !== 'string' || !value.trim()) {
|
|
throw new Error('Workflow bundle workflow.key must be a non-empty string.');
|
|
}
|
|
const key = value.trim();
|
|
if (!WORKFLOW_BUNDLE_WORKFLOW_KEY_PATTERN.test(key)) {
|
|
throw new Error(
|
|
`Invalid workflow bundle workflow.key "${value}". Expected pattern: ${WORKFLOW_BUNDLE_WORKFLOW_KEY_PATTERN}`
|
|
);
|
|
}
|
|
}
|
|
|
|
export const createWorkflowBundleHeaderV1 = (exportedAt: Date = new Date()): WorkflowBundleHeaderV1 => ({
|
|
format: WORKFLOW_BUNDLE_FORMAT,
|
|
formatVersion: WORKFLOW_BUNDLE_FORMAT_VERSION_V1,
|
|
exportedAt: exportedAt.toISOString()
|
|
});
|