@colabo-flow/s-go 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { IColaboFlowClientData } from "./vos";
1
+ import { IClientExecuteTaskOptions, IColaboFlowClientData } from "../vos";
2
2
  export declare const clientRun: (client: IColaboFlowClientData) => Promise<void>;
3
- export declare const clientExecuteTask: (client: IColaboFlowClientData, taskId: string, taskInput?: any) => Promise<any>;
3
+ export declare const clientExecuteTask: (client: IColaboFlowClientData, taskId: string, taskInput?: any, options?: IClientExecuteTaskOptions) => Promise<any>;
4
4
  export declare const clientClose: (client: IColaboFlowClientData) => Promise<boolean>;
@@ -1,6 +1,7 @@
1
- import { IFlowTask, ITaskExecutor } from "@colabo-flow/i-core";
2
- import { IColaboFlowHostData } from "./vos";
1
+ import { IFlowTask } from "@colabo-flow/i-core";
2
+ import { IColaboFlowHostData } from "../vos";
3
+ import { THostRegisterTaskExecutor } from "./vos";
3
4
  export declare const hostSetTitles: (host: IColaboFlowHostData) => void;
4
- export declare const hostRegisterTaskExecutor: (host: IColaboFlowHostData, executor: ITaskExecutor) => void;
5
+ export declare const hostRegisterTaskExecutor: THostRegisterTaskExecutor;
5
6
  export declare const hostRegisterTask: (host: IColaboFlowHostData, task: IFlowTask) => void;
6
7
  export declare const hostRun: (host: IColaboFlowHostData) => Promise<void>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Here are the tasks that are embeded in any host
3
+ *
4
+ */
5
+ import { IColaboFlowHostData } from "../vos";
6
+ import { THostRegisterTask, THostRegisterTaskExecutor } from "./vos";
7
+ /**
8
+ * Adds all the omnipresent tasks for each host
9
+ * @param host the host to which we are adding tasks
10
+ * @param hostRegisterTaskExecutor function that registers executors
11
+ * @param hostRegisterTask function that registers task
12
+ */
13
+ export declare const addOmnipresentTasks: (host: IColaboFlowHostData, hostRegisterTaskExecutor: THostRegisterTaskExecutor, hostRegisterTask: THostRegisterTask) => Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { IFlowTask, ITaskExecutor } from "@colabo-flow/i-core";
2
+ import { IColaboFlowHostData } from "lib/vos";
3
+ export declare type THostRegisterTaskExecutor = (host: IColaboFlowHostData, executor: ITaskExecutor) => void;
4
+ export declare type THostRegisterTask = (host: IColaboFlowHostData, task: IFlowTask) => void;
@@ -1,2 +1,2 @@
1
- import { IColaboFlowOrchestratorData } from "./vos";
1
+ import { IColaboFlowOrchestratorData } from "../vos";
2
2
  export declare const orchestratorRun: (orchestrator: IColaboFlowOrchestratorData) => Promise<void>;
@@ -65,6 +65,8 @@ export interface IColaboFlowGoMsgExtension_TaskExecute_Request {
65
65
  taskId: string;
66
66
  /** input to the task we want to execute */
67
67
  taskInput: unknown;
68
+ /** task execution options */
69
+ options: IClientExecuteTaskOptions;
68
70
  }
69
71
  export declare enum ETaskExecute_Progress_Status {
70
72
  INITIALIZED = "INITIALIZED"
@@ -102,7 +104,12 @@ export interface IColaboFlowGoTaskInstanceInfo {
102
104
  taskInstance: IFlowTaskInstance;
103
105
  }
104
106
  export interface IReportsConfig {
105
- showHeartbeatMsgs: boolean;
107
+ /**
108
+ * Should we report ColaboFlow heartbeat messages
109
+ * 0 - no,
110
+ * n>0 - yes, each n-th message of each identified worker
111
+ */
112
+ showHeartbeatMsgs: number;
106
113
  showReportsMsgs: boolean;
107
114
  showExecutionMsgs: boolean;
108
115
  }
@@ -141,6 +148,19 @@ export interface IColaboFlowClientData {
141
148
  channel?: Channel;
142
149
  taskInstances: Record<string, IFlowTaskInstance>;
143
150
  }
151
+ /**
152
+ * Options that are provided when requesting task execution from a ColaboFlow client
153
+ */
154
+ export interface IClientExecuteTaskOptions {
155
+ /** host-executing-task related options */
156
+ hosts: {
157
+ /** list of hostnames that should be used for the task execution */
158
+ hostNames?: string[];
159
+ /** if set to true it will run task only if it is implemented on any of the provided hosts in `hostNames`
160
+ * otherwise it will treat the `hostNames` as recomendations and run on any other available host */
161
+ runOnlyOnEnlistedHosts?: boolean;
162
+ };
163
+ }
144
164
  /** Contains all the data that are necessary for a ColaboFlow.Go orchestrator to handle a node */
145
165
  export interface IColaboFlowOrchestratorHostData {
146
166
  /** the name of the host */
@@ -1,4 +1,4 @@
1
- import { IReportsConfig } from "./vos";
1
+ import { IReportsConfig } from "../lib/vos";
2
2
  export declare const reportsConfig: IReportsConfig;
3
3
  export declare const connectConfig: {
4
4
  APP_NAME: string;
@@ -1,4 +1,4 @@
1
- export * from "./lib/go.amqp.client";
2
- export * from "./lib/go.amqp.orchestrator";
3
- export * from "./lib/go.amqp.host";
1
+ export * from "./lib/client";
2
+ export * from "./lib/orchestrator";
3
+ export * from "./lib/host";
4
4
  export * from "./lib/vos";