@colabo-flow/s-go 0.4.1 → 1.0.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.
- package/CHANGELOG.md +91 -0
- package/dist/cjs/index.js +1799 -7
- package/dist/cjs/index.js.map +7 -1
- package/dist/esm/index.js +1748 -7
- package/dist/esm/index.js.map +7 -1
- package/dist/{cjs → types}/demo/config.d.ts +10 -10
- package/dist/{esm → types}/demo/create-client.d.ts +1 -1
- package/dist/types/demo/create-host.d.ts +7 -0
- package/dist/{esm → types}/demo/create-orchestrator.d.ts +1 -1
- package/dist/{cjs → types}/demo/send.d.ts +1 -1
- package/dist/types/index.d.ts +13 -0
- package/dist/{cjs → types}/jest.config.d.ts +3 -3
- package/dist/{esm → types}/lib/client/index.d.ts +4 -4
- package/dist/{cjs/demo/create-client.d.ts → types/lib/flowchestrator/index.d.ts} +1 -1
- package/dist/types/lib/flowchestrator/store/flow.store.d.ts +57 -0
- package/dist/{cjs/demo/create-host.d.ts → types/lib/flowchestrator/store/flow.store.test.d.ts} +1 -1
- package/dist/{cjs/demo/create-orchestrator.d.ts → types/lib/flowchestrator/store/flowFlowchestrator.store.test.d.ts} +1 -1
- package/dist/types/lib/flowchestrator/store/flowchestrator.store.d.ts +82 -0
- package/dist/types/lib/flowchestrator/store/index.d.ts +42 -0
- package/dist/{esm → types}/lib/host/index.d.ts +7 -7
- package/dist/{cjs → types}/lib/host/omnipresentTasks.d.ts +13 -13
- package/dist/types/lib/host/vos.d.ts +4 -0
- package/dist/{cjs → types}/lib/operators.d.ts +5 -5
- package/dist/{esm → types}/lib/orchestrator/index.d.ts +2 -2
- package/dist/{cjs → types}/lib/params.d.ts +1 -1
- package/dist/{cjs → types}/lib/uuid_fix.d.ts +15 -15
- package/dist/{cjs → types}/lib/vos.d.ts +205 -205
- package/dist/types/vitest.config.d.ts +2 -0
- package/package.json +73 -13
- package/dist/cjs/index.d.ts +0 -4
- package/dist/cjs/lib/client/index.d.ts +0 -4
- package/dist/cjs/lib/host/index.d.ts +0 -7
- package/dist/cjs/lib/host/vos.d.ts +0 -4
- package/dist/cjs/lib/orchestrator/index.d.ts +0 -2
- package/dist/cjs/tests/units/chalk/index.d.ts +0 -21
- package/dist/cjs/tests/units/tests-vos/tasks-and-flows.vos.d.ts +0 -20
- package/dist/esm/demo/config.d.ts +0 -10
- package/dist/esm/demo/create-host.d.ts +0 -1
- package/dist/esm/demo/send.d.ts +0 -1
- package/dist/esm/index.d.ts +0 -4
- package/dist/esm/jest.config.d.ts +0 -3
- package/dist/esm/lib/host/omnipresentTasks.d.ts +0 -13
- package/dist/esm/lib/host/vos.d.ts +0 -4
- package/dist/esm/lib/operators.d.ts +0 -5
- package/dist/esm/lib/params.d.ts +0 -1
- package/dist/esm/lib/uuid_fix.d.ts +0 -15
- package/dist/esm/lib/vos.d.ts +0 -205
- package/dist/esm/tests/units/chalk/index.d.ts +0 -21
- package/dist/esm/tests/units/tests-vos/tasks-and-flows.vos.d.ts +0 -20
- package/dist/index.d.ts +0 -221
|
@@ -1,205 +1,205 @@
|
|
|
1
|
-
import { IFlowTask, IFlowTaskInstance, ITaskExecutor } from "@colabo-flow/i-core";
|
|
2
|
-
import { Channel } from "amqplib";
|
|
3
|
-
|
|
4
|
-
export declare enum EColaboFlowGoMsgType {
|
|
5
|
-
TASK_EXECUTE_REQUEST = "TASK_EXECUTE_REQUEST",
|
|
6
|
-
TASK_EXECUTE_PROGRESS = "TASK_EXECUTE_PROGRESS",
|
|
7
|
-
TASK_EXECUTE_RESPONSE = "TASK_EXECUTE_RESPONSE",
|
|
8
|
-
TASK_INSTANCES_REPORT__REQUEST = "TASK_INSTANCES_REPORT__REQUEST",
|
|
9
|
-
TASK_INSTANCES_REPORT__RESPONSE = "TASK_INSTANCES_REPORT__RESPONSE",
|
|
10
|
-
HEARTBEAT = "HEARTBEAT"
|
|
11
|
-
}
|
|
12
|
-
/** time (in milliseconds) between two heartbeat pulses */
|
|
13
|
-
export declare const HEARTBEAT_TIME = 3000;
|
|
14
|
-
/**
|
|
15
|
-
* An interface describing messages exchanged between ColaboFlow.GO peers
|
|
16
|
-
*/
|
|
17
|
-
export interface IColaboFlowGoMsg {
|
|
18
|
-
/** unique message id */
|
|
19
|
-
id: string;
|
|
20
|
-
type: EColaboFlowGoMsgType;
|
|
21
|
-
/** unique request id, should be kept the same along the course of a same single message exchange */
|
|
22
|
-
requestId: string;
|
|
23
|
-
/** the id of the message sender */
|
|
24
|
-
sender: string;
|
|
25
|
-
/** the name of the queue to reply to (if there is a reply to the message) */
|
|
26
|
-
replyTo?: string;
|
|
27
|
-
/** the list of proxies that forwarded the message */
|
|
28
|
-
proxies: string[];
|
|
29
|
-
/**
|
|
30
|
-
* list of msg ids with the history of the replying messages
|
|
31
|
-
*/
|
|
32
|
-
msgReplyChainIds: string[];
|
|
33
|
-
/** string message that can be used for human purpose mainly */
|
|
34
|
-
msg?: string;
|
|
35
|
-
/** extension for various types of messages */
|
|
36
|
-
extension?: any;
|
|
37
|
-
}
|
|
38
|
-
/** enumeration of all the languages that are supported by ColaboFlow */
|
|
39
|
-
export declare enum EProgrammingLanguageSupported {
|
|
40
|
-
/** Javascript or its extensions that will be compiled to JavaScript eventually (TypeScript, Coffeescript) */
|
|
41
|
-
JAVASCRIPT = "JAVASCRIPT",
|
|
42
|
-
PYTHON = "PYTHON",
|
|
43
|
-
NATIVE = "NATIVE"
|
|
44
|
-
}
|
|
45
|
-
/** Message extension for the heartbeat message */
|
|
46
|
-
export interface IColaboFlowGoMsgExtension_Heartbeat {
|
|
47
|
-
/** the id of the heartbeat pulse message */
|
|
48
|
-
id: number;
|
|
49
|
-
/** the programming language that the host speaks */
|
|
50
|
-
language: EProgrammingLanguageSupported;
|
|
51
|
-
/** the list of the tasks' ids that the host implements */
|
|
52
|
-
taskIds: string[];
|
|
53
|
-
/** The queue that the host listens to */
|
|
54
|
-
queueHost: string;
|
|
55
|
-
}
|
|
56
|
-
export interface IColaboFlowGoMsgExtension_Heartbeat_Response {
|
|
57
|
-
/** the id of the heartbeat pulse message */
|
|
58
|
-
id: number;
|
|
59
|
-
/** the name of the orchestrator responding */
|
|
60
|
-
orchestratorName: string;
|
|
61
|
-
}
|
|
62
|
-
/** Message extension for the task execution request */
|
|
63
|
-
export interface IColaboFlowGoMsgExtension_TaskExecute_Request {
|
|
64
|
-
/** the id of the task we want to execute */
|
|
65
|
-
taskId: string;
|
|
66
|
-
/** input to the task we want to execute */
|
|
67
|
-
taskInput: unknown;
|
|
68
|
-
/** task execution options */
|
|
69
|
-
options: IClientExecuteTaskOptions;
|
|
70
|
-
}
|
|
71
|
-
export declare enum ETaskExecute_Progress_Status {
|
|
72
|
-
INITIALIZED = "INITIALIZED"
|
|
73
|
-
}
|
|
74
|
-
/** Message extension for the task execution response */
|
|
75
|
-
export interface IColaboFlowGoMsgExtension_TaskExecute_Progress {
|
|
76
|
-
/** the id if the task executing instance */
|
|
77
|
-
taskInstanceId: string;
|
|
78
|
-
/** the current status of the task execution */
|
|
79
|
-
status: ETaskExecute_Progress_Status;
|
|
80
|
-
/** the percentage of the task executed */
|
|
81
|
-
progress: number;
|
|
82
|
-
}
|
|
83
|
-
/** Message extension for the task execution response */
|
|
84
|
-
export interface IColaboFlowGoMsgExtension_TaskExecute_Response {
|
|
85
|
-
/** output of the executed task */
|
|
86
|
-
taskOutput: any;
|
|
87
|
-
}
|
|
88
|
-
/** Message extension for the task instances report requesting */
|
|
89
|
-
export interface IColaboFlowGoMsgExtension_TaskInstancesReport_Request {
|
|
90
|
-
reportFinalizedTaskInstances: boolean;
|
|
91
|
-
reportRunningTaskInstances: boolean;
|
|
92
|
-
}
|
|
93
|
-
/** Message extension for the task instances report response */
|
|
94
|
-
export interface IColaboFlowGoMsgExtension_TaskInstancesReport_Response {
|
|
95
|
-
tasksInstanceInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Provides all required info about the task execution request and its progress, etc
|
|
99
|
-
*/
|
|
100
|
-
export interface IColaboFlowGoTaskInstanceInfo {
|
|
101
|
-
/** taskInstance id */
|
|
102
|
-
id: string;
|
|
103
|
-
/** task instance */
|
|
104
|
-
taskInstance: IFlowTaskInstance;
|
|
105
|
-
}
|
|
106
|
-
export interface IReportsConfig {
|
|
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;
|
|
113
|
-
showReportsMsgs: boolean;
|
|
114
|
-
showExecutionMsgs: boolean;
|
|
115
|
-
}
|
|
116
|
-
/** contains all the data that are necessary for a ColaboFlow.Go host to operate */
|
|
117
|
-
export interface IColaboFlowHostData {
|
|
118
|
-
/** reporting config data */
|
|
119
|
-
reportsConfig: IReportsConfig;
|
|
120
|
-
hostname: string;
|
|
121
|
-
appNameText?: string;
|
|
122
|
-
amqpUrl: string;
|
|
123
|
-
queueHost: string;
|
|
124
|
-
queueHostHeartbeat: string;
|
|
125
|
-
connection?: ChannelModel;
|
|
126
|
-
chHostHeartbeat?: Channel;
|
|
127
|
-
taskExecutorsAvailable: Record<string, ITaskExecutor>;
|
|
128
|
-
tasksAvailable: Record<string, IFlowTask>;
|
|
129
|
-
taskInstances: Record<string, IFlowTaskInstance>;
|
|
130
|
-
/** Provides all required info about the task execution requests (except the executed ones) coming for this particular host and its progress, etc
|
|
131
|
-
* Provides all required info about the task execution request and its progress, etc
|
|
132
|
-
* ***record key*** is the `id` of the `taskInstance`
|
|
133
|
-
*/
|
|
134
|
-
runningTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
135
|
-
/** Provides all required info about the finalized (finished, stopped, failed, ...) task execution requests coming for this particular host and its progress, etc
|
|
136
|
-
* Provides all required info about the task execution request and its progress, etc
|
|
137
|
-
* ***record key*** is the `id` of the `taskInstance`
|
|
138
|
-
*/
|
|
139
|
-
finalizedTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
140
|
-
}
|
|
141
|
-
/** contains all the data that are necessary for a ColaboFlow.Go client to operate */
|
|
142
|
-
export interface IColaboFlowClientData {
|
|
143
|
-
clientName: string;
|
|
144
|
-
appNameText?: string;
|
|
145
|
-
amqpUrl: string;
|
|
146
|
-
queueOrchestrator: string;
|
|
147
|
-
connection?: ChannelModel;
|
|
148
|
-
channel?: Channel;
|
|
149
|
-
taskInstances: Record<string, IFlowTaskInstance>;
|
|
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
|
-
}
|
|
164
|
-
/** Contains all the data that are necessary for a ColaboFlow.Go orchestrator to handle a node */
|
|
165
|
-
export interface IColaboFlowOrchestratorHostData {
|
|
166
|
-
/** the name of the host */
|
|
167
|
-
hostName: string;
|
|
168
|
-
/** the name of the queue host listens on */
|
|
169
|
-
queueHost: string;
|
|
170
|
-
/** tasks' ids available for a specific host */
|
|
171
|
-
taskIdsAvailable: string[];
|
|
172
|
-
/** tasks instances' ids available for a specific host */
|
|
173
|
-
taskInstanceIds: string[];
|
|
174
|
-
}
|
|
175
|
-
/** contains all the data that are necessary for a ColaboFlow.Go orchestrator to operate */
|
|
176
|
-
export interface IColaboFlowOrchestratorData {
|
|
177
|
-
/** reporting config data */
|
|
178
|
-
reportsConfig: IReportsConfig;
|
|
179
|
-
orchestratorName: string;
|
|
180
|
-
amqpUrl: string;
|
|
181
|
-
/** the heartbeat queue that the orchestrator uses to listens heartbeat (registration) for the hosts */
|
|
182
|
-
queueHostHeartbeat: string;
|
|
183
|
-
/** the orchestrator queue that the orchestrator uses to listens from the clients */
|
|
184
|
-
queueOrchestrator: string;
|
|
185
|
-
/** the channel for the clients communication */
|
|
186
|
-
clientsChannel?: Channel;
|
|
187
|
-
/** the channel for the hosts communication */
|
|
188
|
-
hostsChannel?: Channel;
|
|
189
|
-
/** infos about each host known to the orchestrator
|
|
190
|
-
* currently hosts are discovered by receiving heartbeat messages from the hosts
|
|
191
|
-
*/
|
|
192
|
-
hosts: Record<string, IColaboFlowOrchestratorHostData>;
|
|
193
|
-
/** Provides all required info about the task execution requests (except the executed ones) coming for this particular host and its progress, etc
|
|
194
|
-
* Provides all required info about the task execution request and its progress, etc
|
|
195
|
-
* ***record key*** is the `id` of the `taskInstance`
|
|
196
|
-
*/
|
|
197
|
-
runningTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
198
|
-
/** Provides all required info about the finalized (finished, stopped, failed, ...) task execution requests coming for this particular host and its progress, etc
|
|
199
|
-
* Provides all required info about the task execution request and its progress, etc
|
|
200
|
-
* ***record key*** is the `id` of the `taskInstance`
|
|
201
|
-
*/
|
|
202
|
-
finalizedTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
203
|
-
hostsForTaskIds: Record<string, string[]>;
|
|
204
|
-
}
|
|
205
|
-
export {};
|
|
1
|
+
import { IFlowTask, IFlowTaskInstance, ITaskExecutor } from "@colabo-flow/i-core";
|
|
2
|
+
import { Channel } from "amqplib";
|
|
3
|
+
type ChannelModel = any;
|
|
4
|
+
export declare enum EColaboFlowGoMsgType {
|
|
5
|
+
TASK_EXECUTE_REQUEST = "TASK_EXECUTE_REQUEST",
|
|
6
|
+
TASK_EXECUTE_PROGRESS = "TASK_EXECUTE_PROGRESS",
|
|
7
|
+
TASK_EXECUTE_RESPONSE = "TASK_EXECUTE_RESPONSE",
|
|
8
|
+
TASK_INSTANCES_REPORT__REQUEST = "TASK_INSTANCES_REPORT__REQUEST",
|
|
9
|
+
TASK_INSTANCES_REPORT__RESPONSE = "TASK_INSTANCES_REPORT__RESPONSE",
|
|
10
|
+
HEARTBEAT = "HEARTBEAT"
|
|
11
|
+
}
|
|
12
|
+
/** time (in milliseconds) between two heartbeat pulses */
|
|
13
|
+
export declare const HEARTBEAT_TIME = 3000;
|
|
14
|
+
/**
|
|
15
|
+
* An interface describing messages exchanged between ColaboFlow.GO peers
|
|
16
|
+
*/
|
|
17
|
+
export interface IColaboFlowGoMsg {
|
|
18
|
+
/** unique message id */
|
|
19
|
+
id: string;
|
|
20
|
+
type: EColaboFlowGoMsgType;
|
|
21
|
+
/** unique request id, should be kept the same along the course of a same single message exchange */
|
|
22
|
+
requestId: string;
|
|
23
|
+
/** the id of the message sender */
|
|
24
|
+
sender: string;
|
|
25
|
+
/** the name of the queue to reply to (if there is a reply to the message) */
|
|
26
|
+
replyTo?: string;
|
|
27
|
+
/** the list of proxies that forwarded the message */
|
|
28
|
+
proxies: string[];
|
|
29
|
+
/**
|
|
30
|
+
* list of msg ids with the history of the replying messages
|
|
31
|
+
*/
|
|
32
|
+
msgReplyChainIds: string[];
|
|
33
|
+
/** string message that can be used for human purpose mainly */
|
|
34
|
+
msg?: string;
|
|
35
|
+
/** extension for various types of messages */
|
|
36
|
+
extension?: any;
|
|
37
|
+
}
|
|
38
|
+
/** enumeration of all the languages that are supported by ColaboFlow */
|
|
39
|
+
export declare enum EProgrammingLanguageSupported {
|
|
40
|
+
/** Javascript or its extensions that will be compiled to JavaScript eventually (TypeScript, Coffeescript) */
|
|
41
|
+
JAVASCRIPT = "JAVASCRIPT",
|
|
42
|
+
PYTHON = "PYTHON",
|
|
43
|
+
NATIVE = "NATIVE"
|
|
44
|
+
}
|
|
45
|
+
/** Message extension for the heartbeat message */
|
|
46
|
+
export interface IColaboFlowGoMsgExtension_Heartbeat {
|
|
47
|
+
/** the id of the heartbeat pulse message */
|
|
48
|
+
id: number;
|
|
49
|
+
/** the programming language that the host speaks */
|
|
50
|
+
language: EProgrammingLanguageSupported;
|
|
51
|
+
/** the list of the tasks' ids that the host implements */
|
|
52
|
+
taskIds: string[];
|
|
53
|
+
/** The queue that the host listens to */
|
|
54
|
+
queueHost: string;
|
|
55
|
+
}
|
|
56
|
+
export interface IColaboFlowGoMsgExtension_Heartbeat_Response {
|
|
57
|
+
/** the id of the heartbeat pulse message */
|
|
58
|
+
id: number;
|
|
59
|
+
/** the name of the orchestrator responding */
|
|
60
|
+
orchestratorName: string;
|
|
61
|
+
}
|
|
62
|
+
/** Message extension for the task execution request */
|
|
63
|
+
export interface IColaboFlowGoMsgExtension_TaskExecute_Request {
|
|
64
|
+
/** the id of the task we want to execute */
|
|
65
|
+
taskId: string;
|
|
66
|
+
/** input to the task we want to execute */
|
|
67
|
+
taskInput: unknown;
|
|
68
|
+
/** task execution options */
|
|
69
|
+
options: IClientExecuteTaskOptions;
|
|
70
|
+
}
|
|
71
|
+
export declare enum ETaskExecute_Progress_Status {
|
|
72
|
+
INITIALIZED = "INITIALIZED"
|
|
73
|
+
}
|
|
74
|
+
/** Message extension for the task execution response */
|
|
75
|
+
export interface IColaboFlowGoMsgExtension_TaskExecute_Progress {
|
|
76
|
+
/** the id if the task executing instance */
|
|
77
|
+
taskInstanceId: string;
|
|
78
|
+
/** the current status of the task execution */
|
|
79
|
+
status: ETaskExecute_Progress_Status;
|
|
80
|
+
/** the percentage of the task executed */
|
|
81
|
+
progress: number;
|
|
82
|
+
}
|
|
83
|
+
/** Message extension for the task execution response */
|
|
84
|
+
export interface IColaboFlowGoMsgExtension_TaskExecute_Response {
|
|
85
|
+
/** output of the executed task */
|
|
86
|
+
taskOutput: any;
|
|
87
|
+
}
|
|
88
|
+
/** Message extension for the task instances report requesting */
|
|
89
|
+
export interface IColaboFlowGoMsgExtension_TaskInstancesReport_Request {
|
|
90
|
+
reportFinalizedTaskInstances: boolean;
|
|
91
|
+
reportRunningTaskInstances: boolean;
|
|
92
|
+
}
|
|
93
|
+
/** Message extension for the task instances report response */
|
|
94
|
+
export interface IColaboFlowGoMsgExtension_TaskInstancesReport_Response {
|
|
95
|
+
tasksInstanceInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
99
|
+
*/
|
|
100
|
+
export interface IColaboFlowGoTaskInstanceInfo {
|
|
101
|
+
/** taskInstance id */
|
|
102
|
+
id: string;
|
|
103
|
+
/** task instance */
|
|
104
|
+
taskInstance: IFlowTaskInstance;
|
|
105
|
+
}
|
|
106
|
+
export interface IReportsConfig {
|
|
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;
|
|
113
|
+
showReportsMsgs: boolean;
|
|
114
|
+
showExecutionMsgs: boolean;
|
|
115
|
+
}
|
|
116
|
+
/** contains all the data that are necessary for a ColaboFlow.Go host to operate */
|
|
117
|
+
export interface IColaboFlowHostData {
|
|
118
|
+
/** reporting config data */
|
|
119
|
+
reportsConfig: IReportsConfig;
|
|
120
|
+
hostname: string;
|
|
121
|
+
appNameText?: string;
|
|
122
|
+
amqpUrl: string;
|
|
123
|
+
queueHost: string;
|
|
124
|
+
queueHostHeartbeat: string;
|
|
125
|
+
connection?: ChannelModel;
|
|
126
|
+
chHostHeartbeat?: Channel;
|
|
127
|
+
taskExecutorsAvailable: Record<string, ITaskExecutor>;
|
|
128
|
+
tasksAvailable: Record<string, IFlowTask>;
|
|
129
|
+
taskInstances: Record<string, IFlowTaskInstance>;
|
|
130
|
+
/** Provides all required info about the task execution requests (except the executed ones) coming for this particular host and its progress, etc
|
|
131
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
132
|
+
* ***record key*** is the `id` of the `taskInstance`
|
|
133
|
+
*/
|
|
134
|
+
runningTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
135
|
+
/** Provides all required info about the finalized (finished, stopped, failed, ...) task execution requests coming for this particular host and its progress, etc
|
|
136
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
137
|
+
* ***record key*** is the `id` of the `taskInstance`
|
|
138
|
+
*/
|
|
139
|
+
finalizedTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
140
|
+
}
|
|
141
|
+
/** contains all the data that are necessary for a ColaboFlow.Go client to operate */
|
|
142
|
+
export interface IColaboFlowClientData {
|
|
143
|
+
clientName: string;
|
|
144
|
+
appNameText?: string;
|
|
145
|
+
amqpUrl: string;
|
|
146
|
+
queueOrchestrator: string;
|
|
147
|
+
connection?: ChannelModel;
|
|
148
|
+
channel?: Channel;
|
|
149
|
+
taskInstances: Record<string, IFlowTaskInstance>;
|
|
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
|
+
}
|
|
164
|
+
/** Contains all the data that are necessary for a ColaboFlow.Go orchestrator to handle a node */
|
|
165
|
+
export interface IColaboFlowOrchestratorHostData {
|
|
166
|
+
/** the name of the host */
|
|
167
|
+
hostName: string;
|
|
168
|
+
/** the name of the queue host listens on */
|
|
169
|
+
queueHost: string;
|
|
170
|
+
/** tasks' ids available for a specific host */
|
|
171
|
+
taskIdsAvailable: string[];
|
|
172
|
+
/** tasks instances' ids available for a specific host */
|
|
173
|
+
taskInstanceIds: string[];
|
|
174
|
+
}
|
|
175
|
+
/** contains all the data that are necessary for a ColaboFlow.Go orchestrator to operate */
|
|
176
|
+
export interface IColaboFlowOrchestratorData {
|
|
177
|
+
/** reporting config data */
|
|
178
|
+
reportsConfig: IReportsConfig;
|
|
179
|
+
orchestratorName: string;
|
|
180
|
+
amqpUrl: string;
|
|
181
|
+
/** the heartbeat queue that the orchestrator uses to listens heartbeat (registration) for the hosts */
|
|
182
|
+
queueHostHeartbeat: string;
|
|
183
|
+
/** the orchestrator queue that the orchestrator uses to listens from the clients */
|
|
184
|
+
queueOrchestrator: string;
|
|
185
|
+
/** the channel for the clients communication */
|
|
186
|
+
clientsChannel?: Channel;
|
|
187
|
+
/** the channel for the hosts communication */
|
|
188
|
+
hostsChannel?: Channel;
|
|
189
|
+
/** infos about each host known to the orchestrator
|
|
190
|
+
* currently hosts are discovered by receiving heartbeat messages from the hosts
|
|
191
|
+
*/
|
|
192
|
+
hosts: Record<string, IColaboFlowOrchestratorHostData>;
|
|
193
|
+
/** Provides all required info about the task execution requests (except the executed ones) coming for this particular host and its progress, etc
|
|
194
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
195
|
+
* ***record key*** is the `id` of the `taskInstance`
|
|
196
|
+
*/
|
|
197
|
+
runningTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
198
|
+
/** Provides all required info about the finalized (finished, stopped, failed, ...) task execution requests coming for this particular host and its progress, etc
|
|
199
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
200
|
+
* ***record key*** is the `id` of the `taskInstance`
|
|
201
|
+
*/
|
|
202
|
+
finalizedTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
203
|
+
hostsForTaskIds: Record<string, string[]>;
|
|
204
|
+
}
|
|
205
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colabo-flow/s-go",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "ColaboFlow.Go Puzzle implementing Colabo Flow.Go service",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -13,32 +13,61 @@
|
|
|
13
13
|
"url": "https://github.com/Cha-OS/colabo"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
16
|
+
"clean": "rm -rf dist",
|
|
17
|
+
"build": "yarn clean && yarn build:esbuild",
|
|
18
|
+
"build:rollup": "rollup -c",
|
|
19
|
+
"build:esbuild": "node esbuild.mjs",
|
|
20
|
+
"test": "vitest",
|
|
21
|
+
"test:watch": "vitest --watch",
|
|
22
|
+
"test:coverage": "vitest run --coverage",
|
|
23
|
+
"echo_name": "echo 'Paths: '; echo \"LERNA_ROOT_PATH: $LERNA_ROOT_PATH\"; echo \"LERNA_EXEC_PATH: $LERNA_EXEC_PATH\"; echo \"LERNA_PACKAGE_NAME: $LERNA_PACKAGE_NAME\"",
|
|
24
|
+
"install_deps": "yarn install",
|
|
25
|
+
"update_ver_deps": "tsx scripts/update-dependencies-versions.ts --package $LERNA_PACKAGE_NAME",
|
|
26
|
+
"deploy": "yarn install",
|
|
27
|
+
"_build": "yarn clean && yarn build:esbuild",
|
|
28
|
+
"package_build": "yarn clean && rm -rf dist && yarn build:esbuild",
|
|
29
|
+
"package_check": "tsx $COLABO_FOLDER/scripts/check-package.ts --configPath=\"$COLABO_FOLDER/scripts/config\"",
|
|
30
|
+
"package_pre_publish": "tsx $COLABO_FOLDER/scripts/pre-publish/single.ts",
|
|
31
|
+
"package_semantic_release": "npx --no-install semantic-release --no-ci --debug -e semantic-release-monorepo",
|
|
32
|
+
"package_post_publish": "tsx $COLABO_FOLDER/scripts/post-publish/single.ts",
|
|
33
|
+
"package_publish": "echo \"${npm_package_name}:package_publish ----- Publishing the package ----\"",
|
|
34
|
+
"package_update_dependencies_versions": "tsx $COLABO_FOLDER/scripts/update-dependencies-versions/single.ts",
|
|
35
|
+
"package_install": "yarn install --mutex file:/tmp/yarn-colabo.lock",
|
|
36
|
+
"package_rm_install_lock": "rm -f yarn.lock",
|
|
37
|
+
"package_install_dev": "yarn install --mutex file:/tmp/yarn-colabo.lock",
|
|
38
|
+
"package_build_dev": "yarn clean && rm -rf dist && yarn build:esbuild"
|
|
18
39
|
},
|
|
19
40
|
"main": "dist/cjs/index.js",
|
|
20
41
|
"module": "dist/esm/index.js",
|
|
21
42
|
"exports": {
|
|
22
43
|
".": {
|
|
44
|
+
"types": "./dist/types/index.d.ts",
|
|
23
45
|
"import": "./dist/esm/index.js",
|
|
24
46
|
"require": "./dist/cjs/index.js"
|
|
25
|
-
}
|
|
47
|
+
},
|
|
48
|
+
"./package.json": "./package.json"
|
|
26
49
|
},
|
|
27
|
-
"types": "dist/index.d.ts",
|
|
28
|
-
"typings": "dist/index.d.ts",
|
|
50
|
+
"types": "dist/types/index.d.ts",
|
|
51
|
+
"typings": "dist/types/index.d.ts",
|
|
29
52
|
"files": [
|
|
30
|
-
"dist"
|
|
53
|
+
"dist",
|
|
54
|
+
"README.md",
|
|
55
|
+
"LICENSE",
|
|
56
|
+
"CHANGELOG.md"
|
|
31
57
|
],
|
|
32
58
|
"dependencies": {
|
|
33
|
-
"@colabo-datatalks/i-cache": "^0.6.2",
|
|
34
|
-
"@colabo-flow/i-core": "^0.8.6",
|
|
35
|
-
"@colabo-transform/i-json": "^0.2.3",
|
|
36
|
-
"@colabo-utils/i-config": "^0.1.7",
|
|
37
|
-
"@colabo-utils/i-verify": "^0.1.7",
|
|
38
59
|
"amqplib": "^0.10.3",
|
|
39
60
|
"chalk": "4.1.2",
|
|
40
61
|
"ts-jest": "^29.0.3",
|
|
41
|
-
"uuid": "^
|
|
62
|
+
"uuid": "^11.0.5",
|
|
63
|
+
"@colabo-utils/i-register": "1.4.6",
|
|
64
|
+
"@colabo-flow/i-core": "1.1.2",
|
|
65
|
+
"@colabo-utils/i-verify": "1.3.5",
|
|
66
|
+
"@colabo-utils/i-config": "1.6.2",
|
|
67
|
+
"@colabo-knalledge/i-core": "1.4.2",
|
|
68
|
+
"@colabo-knalledge/i-core-services": "1.8.1",
|
|
69
|
+
"@colabo-utils/i-store": "1.0.1",
|
|
70
|
+
"@colabo-headless/i-core": "npm:@colabo-headless/i-core-backend@1.4.1"
|
|
42
71
|
},
|
|
43
72
|
"peerDependenciesLocal": {},
|
|
44
73
|
"devDependencies": {
|
|
@@ -66,7 +95,38 @@
|
|
|
66
95
|
"tslib": "^2.4.1",
|
|
67
96
|
"tslint": "^6.1.3",
|
|
68
97
|
"typescript": "^4.8.4",
|
|
98
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
99
|
+
"vitest": "^3.1.1",
|
|
69
100
|
"webpack": "^5.73.0",
|
|
70
101
|
"webpack-cli": "^4.10.0"
|
|
102
|
+
},
|
|
103
|
+
"liveDependencies": {
|
|
104
|
+
"@colabo-utils/i-register": "1.4.6",
|
|
105
|
+
"@colabo-flow/i-core": "1.1.2",
|
|
106
|
+
"@colabo-utils/i-verify": "1.3.5",
|
|
107
|
+
"@colabo-utils/i-config": "1.6.2",
|
|
108
|
+
"@colabo-knalledge/i-core": "1.4.2",
|
|
109
|
+
"@colabo-knalledge/i-core-services": "1.8.1",
|
|
110
|
+
"@colabo-utils/i-store": "1.0.1",
|
|
111
|
+
"@colabo-headless/i-core": "npm:@colabo-headless/i-core-backend@1.4.1"
|
|
112
|
+
},
|
|
113
|
+
"nx": {
|
|
114
|
+
"implicitDependencies": [
|
|
115
|
+
"@colabo-utils/i-register",
|
|
116
|
+
"@colabo-flow/i-core",
|
|
117
|
+
"@colabo-utils/i-verify",
|
|
118
|
+
"@colabo-utils/i-config",
|
|
119
|
+
"@colabo-knalledge/i-core",
|
|
120
|
+
"@colabo-knalledge/i-core-services",
|
|
121
|
+
"@colabo-utils/i-store",
|
|
122
|
+
"@colabo-headless/i-core-backend"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"build": {
|
|
126
|
+
"format": [
|
|
127
|
+
"cjs",
|
|
128
|
+
"esm"
|
|
129
|
+
],
|
|
130
|
+
"platform": "node"
|
|
71
131
|
}
|
|
72
132
|
}
|
package/dist/cjs/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IClientExecuteTaskOptions, IColaboFlowClientData } from "../vos";
|
|
2
|
-
export declare const clientRun: (client: IColaboFlowClientData) => Promise<void>;
|
|
3
|
-
export declare const clientExecuteTask: (client: IColaboFlowClientData, taskId: string, taskInput?: any, options?: IClientExecuteTaskOptions) => Promise<any>;
|
|
4
|
-
export declare const clientClose: (client: IColaboFlowClientData) => Promise<boolean>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IFlowTask } from "@colabo-flow/i-core";
|
|
2
|
-
import { IColaboFlowHostData } from "../vos";
|
|
3
|
-
import { THostRegisterTaskExecutor } from "./vos";
|
|
4
|
-
export declare const hostSetTitles: (host: IColaboFlowHostData) => void;
|
|
5
|
-
export declare const hostRegisterTaskExecutor: THostRegisterTaskExecutor;
|
|
6
|
-
export declare const hostRegisterTask: (host: IColaboFlowHostData, task: IFlowTask) => void;
|
|
7
|
-
export declare const hostRun: (host: IColaboFlowHostData) => Promise<void>;
|
|
@@ -1,4 +0,0 @@
|
|
|
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,21 +0,0 @@
|
|
|
1
|
-
export declare function chalk(msg: any): string;
|
|
2
|
-
export declare namespace chalk {
|
|
3
|
-
var red: typeof chalk;
|
|
4
|
-
var blue: typeof chalk;
|
|
5
|
-
var bold: typeof chalk;
|
|
6
|
-
var green: typeof chalk;
|
|
7
|
-
var yellow: typeof chalk;
|
|
8
|
-
var white: typeof chalk;
|
|
9
|
-
var grey: typeof chalk;
|
|
10
|
-
var dim: typeof chalk;
|
|
11
|
-
var italic: typeof chalk;
|
|
12
|
-
var redBright: typeof chalk;
|
|
13
|
-
var blueBright: typeof chalk;
|
|
14
|
-
var boldBright: typeof chalk;
|
|
15
|
-
var greenBright: typeof chalk;
|
|
16
|
-
var yellowBright: typeof chalk;
|
|
17
|
-
var whiteBright: typeof chalk;
|
|
18
|
-
var greyBright: typeof chalk;
|
|
19
|
-
var rgb: (r: number, g: number, b: number) => Function;
|
|
20
|
-
}
|
|
21
|
-
export default chalk;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IFlowTask, IFlow, IFlowToken, IFlowEvent, IFlowSequence } from "@colabo-flow/i-core";
|
|
2
|
-
export declare const taskId1 = "task-1-id";
|
|
3
|
-
export declare const taskId2 = "task-2-id";
|
|
4
|
-
export declare const tokenId1 = "token-1-id";
|
|
5
|
-
export declare const eventId1 = "event-1-id";
|
|
6
|
-
export declare const eventId2 = "event-2-id";
|
|
7
|
-
export declare const gatewayId1 = "gateway-1-id";
|
|
8
|
-
export declare const gatewayId2 = "gateway-2-id";
|
|
9
|
-
export declare const sequenceId1 = "sequence-1-id";
|
|
10
|
-
export declare const sequenceId2 = "sequence-2-id";
|
|
11
|
-
export declare const sequenceId3 = "sequence-3-id";
|
|
12
|
-
export declare const task1: IFlowTask;
|
|
13
|
-
export declare const task2: IFlowTask;
|
|
14
|
-
export declare const event1: IFlowEvent;
|
|
15
|
-
export declare const event2: IFlowEvent;
|
|
16
|
-
export declare const token1: IFlowToken;
|
|
17
|
-
export declare const sequence1: IFlowSequence;
|
|
18
|
-
export declare const sequence2: IFlowSequence;
|
|
19
|
-
export declare const sequence3: IFlowSequence;
|
|
20
|
-
export declare const flow: IFlow;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IReportsConfig } from "../lib/vos";
|
|
2
|
-
export declare const reportsConfig: IReportsConfig;
|
|
3
|
-
export declare const connectConfig: {
|
|
4
|
-
APP_NAME: string;
|
|
5
|
-
AMQP_URL: string;
|
|
6
|
-
ORCHESTRATOR_QUEUE: string;
|
|
7
|
-
HOST_HEARTBEAT_QUEUE: string;
|
|
8
|
-
HOST_NODE_QUEUE: string;
|
|
9
|
-
HOST_PYTHON_QUEUE: string;
|
|
10
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/esm/demo/send.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/esm/index.d.ts
DELETED