@colabo-flow/s-go 0.2.10 → 0.3.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,8 +1,5 @@
1
- export declare const reportsConfig: {
2
- showHeartbeatMsgs: boolean;
3
- showReportsMsgs: boolean;
4
- showExecutionMsgs: boolean;
5
- };
1
+ import { IReportsConfig } from "./vos";
2
+ export declare const reportsConfig: IReportsConfig;
6
3
  export declare const connectConfig: {
7
4
  APP_NAME: string;
8
5
  AMQP_URL: string;
@@ -0,0 +1,2 @@
1
+ import { IColaboFlowOrchestratorData } from "./vos";
2
+ export declare const orchestratorRun: (orchestrator: IColaboFlowOrchestratorData) => Promise<void>;
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * I (@mPrinS) do not want that we depend on `react-native` as a solution for UUID crypto mismatch ...
3
+ * and there is also this erro: `https://github.com/rollup/plugins/issues/1065`
3
4
  */
4
5
  declare class TypeMismatchError extends Error {
5
6
  }
@@ -9,6 +9,8 @@ export declare enum EColaboFlowGoMsgType {
9
9
  TASK_INSTANCES_REPORT__RESPONSE = "TASK_INSTANCES_REPORT__RESPONSE",
10
10
  HEARTBEAT = "HEARTBEAT"
11
11
  }
12
+ /** time (in milliseconds) between two heartbeat pulses */
13
+ export declare const HEARTBEAT_TIME = 3000;
12
14
  /**
13
15
  * An interface describing messages exchanged between ColaboFlow.GO peers
14
16
  */
@@ -54,15 +56,15 @@ export interface IColaboFlowGoMsgExtension_Heartbeat {
54
56
  export interface IColaboFlowGoMsgExtension_Heartbeat_Response {
55
57
  /** the id of the heartbeat pulse message */
56
58
  id: number;
57
- /** the name of the service responding */
58
- serviceName: string;
59
+ /** the name of the orchestrator responding */
60
+ orchestratorName: string;
59
61
  }
60
62
  /** Message extension for the task execution request */
61
63
  export interface IColaboFlowGoMsgExtension_TaskExecute_Request {
62
64
  /** the id of the task we want to execute */
63
65
  taskId: string;
64
66
  /** input to the task we want to execute */
65
- taskInput: any;
67
+ taskInput: unknown;
66
68
  }
67
69
  export declare enum ETaskExecute_Progress_Status {
68
70
  INITIALIZED = "INITIALIZED"
@@ -99,13 +101,21 @@ export interface IColaboFlowGoTaskInstanceInfo {
99
101
  /** task instance */
100
102
  taskInstance: IFlowTaskInstance;
101
103
  }
104
+ export interface IReportsConfig {
105
+ showHeartbeatMsgs: boolean;
106
+ showReportsMsgs: boolean;
107
+ showExecutionMsgs: boolean;
108
+ }
102
109
  /** contains all the data that are necessary for a ColaboFlow.Go host to operate */
103
110
  export interface IColaboFlowHostData {
111
+ /** reporting config data */
112
+ reportsConfig: IReportsConfig;
104
113
  hostname: string;
105
114
  appNameText?: string;
106
115
  amqpUrl: string;
107
116
  queueHost: string;
108
117
  queueHostHeartbeat: string;
118
+ connection?: ChannelModel;
109
119
  chHostHeartbeat?: Channel;
110
120
  taskExecutorsAvailable: Record<string, ITaskExecutor>;
111
121
  tasksAvailable: Record<string, IFlowTask>;
@@ -126,13 +136,13 @@ export interface IColaboFlowClientData {
126
136
  clientName: string;
127
137
  appNameText?: string;
128
138
  amqpUrl: string;
129
- queueServiceOrchestrator: string;
139
+ queueOrchestrator: string;
130
140
  connection?: ChannelModel;
131
141
  channel?: Channel;
132
142
  taskInstances: Record<string, IFlowTaskInstance>;
133
143
  }
134
- /** Contains all the data that are necessary for a ColaboFlow.Go service to handle a node */
135
- export interface IColaboFlowServiceHostData {
144
+ /** Contains all the data that are necessary for a ColaboFlow.Go orchestrator to handle a node */
145
+ export interface IColaboFlowOrchestratorHostData {
136
146
  /** the name of the host */
137
147
  hostName: string;
138
148
  /** the name of the queue host listens on */
@@ -142,22 +152,24 @@ export interface IColaboFlowServiceHostData {
142
152
  /** tasks instances' ids available for a specific host */
143
153
  taskInstanceIds: string[];
144
154
  }
145
- /** contains all the data that are necessary for a ColaboFlow.Go service to operate */
146
- export interface IColaboFlowServiceData {
147
- serviceName: string;
155
+ /** contains all the data that are necessary for a ColaboFlow.Go orchestrator to operate */
156
+ export interface IColaboFlowOrchestratorData {
157
+ /** reporting config data */
158
+ reportsConfig: IReportsConfig;
159
+ orchestratorName: string;
148
160
  amqpUrl: string;
149
- /** the heartbeat queue that the service uses to listens heartbeat (registration) for the hosts */
161
+ /** the heartbeat queue that the orchestrator uses to listens heartbeat (registration) for the hosts */
150
162
  queueHostHeartbeat: string;
151
- /** the orchestrator queue that the service uses to listens from the clients */
163
+ /** the orchestrator queue that the orchestrator uses to listens from the clients */
152
164
  queueOrchestrator: string;
153
165
  /** the channel for the clients communication */
154
166
  clientsChannel?: Channel;
155
167
  /** the channel for the hosts communication */
156
168
  hostsChannel?: Channel;
157
- /** infos about each host known to the service
169
+ /** infos about each host known to the orchestrator
158
170
  * currently hosts are discovered by receiving heartbeat messages from the hosts
159
171
  */
160
- hosts: Record<string, IColaboFlowServiceHostData>;
172
+ hosts: Record<string, IColaboFlowOrchestratorHostData>;
161
173
  /** Provides all required info about the task execution requests (except the executed ones) coming for this particular host and its progress, etc
162
174
  * Provides all required info about the task execution request and its progress, etc
163
175
  * ***record key*** is the `id` of the `taskInstance`
package/dist/index.d.ts CHANGED
@@ -10,6 +10,8 @@ declare enum EColaboFlowGoMsgType {
10
10
  TASK_INSTANCES_REPORT__RESPONSE = "TASK_INSTANCES_REPORT__RESPONSE",
11
11
  HEARTBEAT = "HEARTBEAT"
12
12
  }
13
+ /** time (in milliseconds) between two heartbeat pulses */
14
+ declare const HEARTBEAT_TIME = 3000;
13
15
  /**
14
16
  * An interface describing messages exchanged between ColaboFlow.GO peers
15
17
  */
@@ -55,15 +57,15 @@ interface IColaboFlowGoMsgExtension_Heartbeat {
55
57
  interface IColaboFlowGoMsgExtension_Heartbeat_Response {
56
58
  /** the id of the heartbeat pulse message */
57
59
  id: number;
58
- /** the name of the service responding */
59
- serviceName: string;
60
+ /** the name of the orchestrator responding */
61
+ orchestratorName: string;
60
62
  }
61
63
  /** Message extension for the task execution request */
62
64
  interface IColaboFlowGoMsgExtension_TaskExecute_Request {
63
65
  /** the id of the task we want to execute */
64
66
  taskId: string;
65
67
  /** input to the task we want to execute */
66
- taskInput: any;
68
+ taskInput: unknown;
67
69
  }
68
70
  declare enum ETaskExecute_Progress_Status {
69
71
  INITIALIZED = "INITIALIZED"
@@ -100,13 +102,21 @@ interface IColaboFlowGoTaskInstanceInfo {
100
102
  /** task instance */
101
103
  taskInstance: IFlowTaskInstance;
102
104
  }
105
+ interface IReportsConfig {
106
+ showHeartbeatMsgs: boolean;
107
+ showReportsMsgs: boolean;
108
+ showExecutionMsgs: boolean;
109
+ }
103
110
  /** contains all the data that are necessary for a ColaboFlow.Go host to operate */
104
111
  interface IColaboFlowHostData {
112
+ /** reporting config data */
113
+ reportsConfig: IReportsConfig;
105
114
  hostname: string;
106
115
  appNameText?: string;
107
116
  amqpUrl: string;
108
117
  queueHost: string;
109
118
  queueHostHeartbeat: string;
119
+ connection?: ChannelModel;
110
120
  chHostHeartbeat?: Channel;
111
121
  taskExecutorsAvailable: Record<string, ITaskExecutor>;
112
122
  tasksAvailable: Record<string, IFlowTask>;
@@ -127,13 +137,13 @@ interface IColaboFlowClientData {
127
137
  clientName: string;
128
138
  appNameText?: string;
129
139
  amqpUrl: string;
130
- queueServiceOrchestrator: string;
140
+ queueOrchestrator: string;
131
141
  connection?: ChannelModel;
132
142
  channel?: Channel;
133
143
  taskInstances: Record<string, IFlowTaskInstance>;
134
144
  }
135
- /** Contains all the data that are necessary for a ColaboFlow.Go service to handle a node */
136
- interface IColaboFlowServiceHostData {
145
+ /** Contains all the data that are necessary for a ColaboFlow.Go orchestrator to handle a node */
146
+ interface IColaboFlowOrchestratorHostData {
137
147
  /** the name of the host */
138
148
  hostName: string;
139
149
  /** the name of the queue host listens on */
@@ -143,22 +153,24 @@ interface IColaboFlowServiceHostData {
143
153
  /** tasks instances' ids available for a specific host */
144
154
  taskInstanceIds: string[];
145
155
  }
146
- /** contains all the data that are necessary for a ColaboFlow.Go service to operate */
147
- interface IColaboFlowServiceData {
148
- serviceName: string;
156
+ /** contains all the data that are necessary for a ColaboFlow.Go orchestrator to operate */
157
+ interface IColaboFlowOrchestratorData {
158
+ /** reporting config data */
159
+ reportsConfig: IReportsConfig;
160
+ orchestratorName: string;
149
161
  amqpUrl: string;
150
- /** the heartbeat queue that the service uses to listens heartbeat (registration) for the hosts */
162
+ /** the heartbeat queue that the orchestrator uses to listens heartbeat (registration) for the hosts */
151
163
  queueHostHeartbeat: string;
152
- /** the orchestrator queue that the service uses to listens from the clients */
164
+ /** the orchestrator queue that the orchestrator uses to listens from the clients */
153
165
  queueOrchestrator: string;
154
166
  /** the channel for the clients communication */
155
167
  clientsChannel?: Channel;
156
168
  /** the channel for the hosts communication */
157
169
  hostsChannel?: Channel;
158
- /** infos about each host known to the service
170
+ /** infos about each host known to the orchestrator
159
171
  * currently hosts are discovered by receiving heartbeat messages from the hosts
160
172
  */
161
- hosts: Record<string, IColaboFlowServiceHostData>;
173
+ hosts: Record<string, IColaboFlowOrchestratorHostData>;
162
174
  /** Provides all required info about the task execution requests (except the executed ones) coming for this particular host and its progress, etc
163
175
  * Provides all required info about the task execution request and its progress, etc
164
176
  * ***record key*** is the `id` of the `taskInstance`
@@ -176,9 +188,11 @@ declare const clientRun: (client: IColaboFlowClientData) => Promise<void>;
176
188
  declare const clientExecuteTask: (client: IColaboFlowClientData, taskId: string, taskInput?: any) => Promise<any>;
177
189
  declare const clientClose: (client: IColaboFlowClientData) => Promise<boolean>;
178
190
 
191
+ declare const orchestratorRun: (orchestrator: IColaboFlowOrchestratorData) => Promise<void>;
192
+
179
193
  declare const hostSetTitles: (host: IColaboFlowHostData) => void;
180
194
  declare const hostRegisterTaskExecutor: (host: IColaboFlowHostData, executor: ITaskExecutor) => void;
181
195
  declare const hostRegisterTask: (host: IColaboFlowHostData, task: IFlowTask) => void;
182
196
  declare const hostRun: (host: IColaboFlowHostData) => Promise<void>;
183
197
 
184
- export { EColaboFlowGoMsgType, EProgrammingLanguageSupported, ETaskExecute_Progress_Status, IColaboFlowClientData, IColaboFlowGoMsg, IColaboFlowGoMsgExtension_Heartbeat, IColaboFlowGoMsgExtension_Heartbeat_Response, IColaboFlowGoMsgExtension_TaskExecute_Progress, IColaboFlowGoMsgExtension_TaskExecute_Request, IColaboFlowGoMsgExtension_TaskExecute_Response, IColaboFlowGoMsgExtension_TaskInstancesReport_Request, IColaboFlowGoMsgExtension_TaskInstancesReport_Response, IColaboFlowGoTaskInstanceInfo, IColaboFlowHostData, IColaboFlowServiceData, IColaboFlowServiceHostData, clientClose, clientExecuteTask, clientRun, hostRegisterTask, hostRegisterTaskExecutor, hostRun, hostSetTitles };
198
+ export { EColaboFlowGoMsgType, EProgrammingLanguageSupported, ETaskExecute_Progress_Status, HEARTBEAT_TIME, IColaboFlowClientData, IColaboFlowGoMsg, IColaboFlowGoMsgExtension_Heartbeat, IColaboFlowGoMsgExtension_Heartbeat_Response, IColaboFlowGoMsgExtension_TaskExecute_Progress, IColaboFlowGoMsgExtension_TaskExecute_Request, IColaboFlowGoMsgExtension_TaskExecute_Response, IColaboFlowGoMsgExtension_TaskInstancesReport_Request, IColaboFlowGoMsgExtension_TaskInstancesReport_Response, IColaboFlowGoTaskInstanceInfo, IColaboFlowHostData, IColaboFlowOrchestratorData, IColaboFlowOrchestratorHostData, IReportsConfig, clientClose, clientExecuteTask, clientRun, hostRegisterTask, hostRegisterTaskExecutor, hostRun, hostSetTitles, orchestratorRun };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colabo-flow/s-go",
3
- "version": "0.2.10",
3
+ "version": "0.3.1",
4
4
  "description": "ColaboFlow.Go Puzzle implementing Colabo Flow.Go service",
5
5
  "private": false,
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};