Skip to content

Commit

Permalink
refactor(core): Map out pubsub messages (no-changelog) (#10566)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov authored Aug 28, 2024
1 parent 6017bf5 commit acfd60a
Showing 1 changed file with 104 additions and 0 deletions.
104 changes: 104 additions & 0 deletions packages/cli/src/services/orchestration/pubsub/pubsub-message-map.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import type { IPushDataType, IWorkflowDb } from '@/Interfaces';
import type { RunningJobSummary } from '@/scaling/scaling.types';

export type PubSubMessageMap = {
// #region Lifecycle

'reload-license': never;

'restart-event-bus': {
result: 'success' | 'error';
error?: string;
};

'reload-external-secrets-providers': {
result: 'success' | 'error';
error?: string;
};

'stop-worker': never;

// #endregion

// #region Community packages

'community-package-install': {
packageName: string;
packageVersion: string;
};

'community-package-update': {
packageName: string;
packageVersion: string;
};

'community-package-uninstall': {
packageName: string;
packageVersion: string;
};

// #endregion

// #region Worker view

'get-worker-id': never;

'get-worker-status': {
workerId: string;
runningJobsSummary: RunningJobSummary[];
freeMem: number;
totalMem: number;
uptime: number;
loadAvg: number[];
cpus: string;
arch: string;
platform: NodeJS.Platform;
hostname: string;
interfaces: Array<{
family: 'IPv4' | 'IPv6';
address: string;
internal: boolean;
}>;
version: string;
};

// #endregion

// #region Multi-main setup

'add-webhooks-triggers-and-pollers': {
workflowId: string;
};

'remove-triggers-and-pollers': {
workflowId: string;
};

'display-workflow-activation': {
workflowId: string;
};

'display-workflow-deactivation': {
workflowId: string;
};

// currently 'workflow-failed-to-activate'
'display-workflow-activation-error': {
workflowId: string;
errorMessage: string;
};

'relay-execution-lifecycle-event': {
type: IPushDataType;
args: Record<string, unknown>;
pushRef: string;
};

'clear-test-webhooks': {
webhookKey: string;
workflowEntity: IWorkflowDb;
pushRef: string;
};

// #endregion
};

0 comments on commit acfd60a

Please sign in to comment.