@colabo-flow/s-go 0.1.2 → 0.2.5

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.
Files changed (141) hide show
  1. package/dist/cjs/demo/create-client.d.ts +1 -0
  2. package/dist/cjs/demo/create-host.d.ts +1 -0
  3. package/dist/cjs/demo/send.d.ts +1 -0
  4. package/{index.ts → dist/cjs/index.d.ts} +3 -4
  5. package/dist/cjs/index.js +8 -0
  6. package/dist/cjs/index.js.map +1 -0
  7. package/dist/cjs/jest.config.d.ts +3 -0
  8. package/dist/cjs/lib/config.d.ts +13 -0
  9. package/dist/cjs/lib/go.amqp.client.d.ts +4 -0
  10. package/dist/cjs/lib/go.amqp.host.d.ts +6 -0
  11. package/dist/cjs/lib/go.amqp.host_status.d.ts +1 -0
  12. package/dist/cjs/lib/go.amqp.service.d.ts +1 -0
  13. package/dist/cjs/lib/operators.d.ts +2 -0
  14. package/dist/cjs/lib/params.d.ts +1 -0
  15. package/dist/cjs/lib/vos.d.ts +173 -0
  16. package/dist/cjs/test_ts.d.ts +1 -0
  17. package/dist/cjs/tests/units/chalk/index.d.ts +21 -0
  18. package/dist/cjs/tests/units/tests-vos/tasks-and-flows.vos.d.ts +20 -0
  19. package/dist/esm/demo/create-client.d.ts +1 -0
  20. package/dist/esm/demo/create-host.d.ts +1 -0
  21. package/dist/esm/demo/send.d.ts +1 -0
  22. package/dist/esm/index.d.ts +3 -0
  23. package/dist/esm/index.js +8 -0
  24. package/dist/esm/index.js.map +1 -0
  25. package/dist/esm/jest.config.d.ts +3 -0
  26. package/dist/esm/lib/config.d.ts +13 -0
  27. package/dist/esm/lib/go.amqp.client.d.ts +4 -0
  28. package/dist/esm/lib/go.amqp.host.d.ts +6 -0
  29. package/dist/esm/lib/go.amqp.host_status.d.ts +1 -0
  30. package/dist/esm/lib/go.amqp.service.d.ts +1 -0
  31. package/dist/esm/lib/operators.d.ts +2 -0
  32. package/dist/esm/lib/params.d.ts +1 -0
  33. package/dist/esm/lib/vos.d.ts +173 -0
  34. package/dist/esm/test_ts.d.ts +1 -0
  35. package/dist/esm/tests/units/chalk/index.d.ts +21 -0
  36. package/dist/esm/tests/units/tests-vos/tasks-and-flows.vos.d.ts +20 -0
  37. package/dist/index.d.ts +184 -0
  38. package/package.json +43 -6
  39. package/DEVELOPMENT.md +0 -38
  40. package/__init__.py +0 -0
  41. package/__pycache__/__init__.cpython-39.pyc +0 -0
  42. package/create_client.py +0 -84
  43. package/create_host.py +0 -91
  44. package/create_host_terra.py +0 -103
  45. package/demo/__init__.py +0 -0
  46. package/demo/create-client.ts +0 -51
  47. package/demo/create-host.ts +0 -136
  48. package/demo/send-simple-recommended.py +0 -26
  49. package/demo/send-simple.py +0 -50
  50. package/demo/send.py +0 -352
  51. package/demo/send.ts +0 -40
  52. package/demo/threading/README.md +0 -14
  53. package/demo/threading/basic_consumer_connection_threaded.png +0 -0
  54. package/demo/threading/basic_consumer_connection_threaded.py +0 -135
  55. package/demo/threading/basic_consumer_threaded.py +0 -100
  56. package/demo/threading/long-running-publisher.py +0 -68
  57. package/docs/ColaboFlow-infrastructure-diagram.png +0 -0
  58. package/docs/workflow.md +0 -35
  59. package/jest.config.ts +0 -172
  60. package/lib/__init__.py +0 -0
  61. package/lib/__pycache__/__init__.cpython-39.pyc +0 -0
  62. package/lib/__pycache__/config.cpython-39.pyc +0 -0
  63. package/lib/__pycache__/executor_operators.cpython-39.pyc +0 -0
  64. package/lib/__pycache__/executor_vos.cpython-39.pyc +0 -0
  65. package/lib/__pycache__/go_amqp_client.cpython-39.pyc +0 -0
  66. package/lib/__pycache__/go_amqp_client_threaded.cpython-39.pyc +0 -0
  67. package/lib/__pycache__/go_amqp_host.cpython-39.pyc +0 -0
  68. package/lib/__pycache__/operators.cpython-39.pyc +0 -0
  69. package/lib/__pycache__/vos.cpython-39.pyc +0 -0
  70. package/lib/config.py +0 -21
  71. package/lib/config.ts +0 -22
  72. package/lib/executor_operators.py +0 -23
  73. package/lib/executor_vos.py +0 -318
  74. package/lib/go.amqp.client-old-basic.py +0 -50
  75. package/lib/go.amqp.client.ts +0 -100
  76. package/lib/go.amqp.host-old-basic.py +0 -48
  77. package/lib/go.amqp.host.ts +0 -269
  78. package/lib/go.amqp.host_status.ts +0 -81
  79. package/lib/go.amqp.service.ts +0 -272
  80. package/lib/go_amqp_client.py +0 -263
  81. package/lib/go_amqp_client_non_threaded.py +0 -152
  82. package/lib/go_amqp_host.py +0 -348
  83. package/lib/operators.py +0 -16
  84. package/lib/operators.ts +0 -17
  85. package/lib/params.ts +0 -1
  86. package/lib/vos.py +0 -232
  87. package/lib/vos.ts +0 -212
  88. package/requirements.txt +0 -4
  89. package/tests/units/README.md +0 -12
  90. package/tests/units/chalk/index.ts +0 -41
  91. package/tests/units/go.amqp.host.test.ts +0 -116
  92. package/tests/units/tests-vos/tasks-and-flows.vos.ts +0 -128
  93. package/tsconfig.json +0 -45
  94. package/v1 - GRPC/README.md +0 -18
  95. package/v1 - GRPC/node/README.md +0 -13
  96. package/v1 - GRPC/node/colaboflow_go_actionhost_client.ts +0 -91
  97. package/v1 - GRPC/node/colaboflow_go_actionhost_server.ts +0 -84
  98. package/v1 - GRPC/node/colaboflow_go_client.ts +0 -82
  99. package/v1 - GRPC/node/colaboflow_go_server.ts +0 -84
  100. package/v1 - GRPC/node/demos/demo-colaboflow_go_actionhost_client.ts +0 -21
  101. package/v1 - GRPC/node/index.ts +0 -3
  102. package/v1 - GRPC/node/package-lock.json +0 -770
  103. package/v1 - GRPC/node/package.json +0 -30
  104. package/v1 - GRPC/node/tsconfig.json +0 -32
  105. package/v1 - GRPC/node/yarn.lock +0 -642
  106. package/v1 - GRPC/protos/colabo/flow/go/go.proto +0 -135
  107. package/v1 - GRPC/python/DEVELOPMENT.md +0 -86
  108. package/v1 - GRPC/python/DISCUSSION.md +0 -8
  109. package/v1 - GRPC/python/LICENSE.txt +0 -21
  110. package/v1 - GRPC/python/README.md +0 -45
  111. package/v1 - GRPC/python/__init__.py +0 -1
  112. package/v1 - GRPC/python/colabo/__init__.py +0 -3
  113. package/v1 - GRPC/python/colabo/flow/__init__.py +0 -3
  114. package/v1 - GRPC/python/colabo/flow/go/__init__.py +0 -12
  115. package/v1 - GRPC/python/colabo/flow/go/basic/PuzzleImporter.py +0 -77
  116. package/v1 - GRPC/python/colabo/flow/go/basic/__init__.py +0 -5
  117. package/v1 - GRPC/python/colabo/flow/go/basic/colaboflow_go_basic.py +0 -66
  118. package/v1 - GRPC/python/colabo/flow/go/basic/parseFlowJSON.py +0 -32
  119. package/v1 - GRPC/python/colabo/flow/go/colaboflow_go_actionhost.py +0 -44
  120. package/v1 - GRPC/python/colabo/flow/go/colaboflow_go_client.py +0 -48
  121. package/v1 - GRPC/python/colabo/flow/go/colaboflow_go_demo.py +0 -168
  122. package/v1 - GRPC/python/colabo/flow/go/go_pb2.py +0 -976
  123. package/v1 - GRPC/python/colabo/flow/go/go_pb2_grpc.py +0 -139
  124. package/v1 - GRPC/python/colabo.flow.go.egg-info/PKG-INFO +0 -58
  125. package/v1 - GRPC/python/colabo.flow.go.egg-info/SOURCES.txt +0 -16
  126. package/v1 - GRPC/python/colabo.flow.go.egg-info/dependency_links.txt +0 -1
  127. package/v1 - GRPC/python/colabo.flow.go.egg-info/requires.txt +0 -3
  128. package/v1 - GRPC/python/colabo.flow.go.egg-info/top_level.txt +0 -2
  129. package/v1 - GRPC/python/demo-0.py +0 -69
  130. package/v1 - GRPC/python/demo-1.py +0 -146
  131. package/v1 - GRPC/python/demo-actionhost.py +0 -47
  132. package/v1 - GRPC/python/demo-basic.md +0 -13
  133. package/v1 - GRPC/python/demo-basic.py +0 -38
  134. package/v1 - GRPC/python/demo-executeActionSync.py +0 -32
  135. package/v1 - GRPC/python/demo-flows/flow-demo.json +0 -36
  136. package/v1 - GRPC/python/demo-puzzles/puzzles/puzzle-a.py +0 -19
  137. package/v1 - GRPC/python/demo-puzzles/puzzles/puzzle-b.py +0 -21
  138. package/v1 - GRPC/python/demo-puzzles/puzzles/puzzle-c.py +0 -20
  139. package/v1 - GRPC/python/requirements.txt +0 -7
  140. package/v1 - GRPC/python/setup.py +0 -39
  141. package/v1 - GRPC/python/use-cases/__init__.py +0 -0
@@ -0,0 +1,3 @@
1
+ import type { Config } from 'jest';
2
+ declare const config: Config;
3
+ export default config;
@@ -0,0 +1,13 @@
1
+ export declare const reportsConfig: {
2
+ showHeartbeatMsgs: boolean;
3
+ showReportsMsgs: boolean;
4
+ showExecutionMsgs: boolean;
5
+ };
6
+ export declare const connectConfig: {
7
+ APP_NAME: string;
8
+ AMQP_URL: string;
9
+ ORCHESTRATOR_QUEUE: string;
10
+ HOST_HEARTBEAT_QUEUE: string;
11
+ HOST_NODE_QUEUE: string;
12
+ HOST_PYTHON_QUEUE: string;
13
+ };
@@ -0,0 +1,4 @@
1
+ import { IColaboFlowClientData } from "./vos";
2
+ export declare const clientRun: (client: IColaboFlowClientData) => Promise<void>;
3
+ export declare const clientExecuteTask: (client: IColaboFlowClientData, taskId: string, taskInput?: any) => Promise<any>;
4
+ export declare const clientClose: (client: IColaboFlowClientData) => Promise<boolean>;
@@ -0,0 +1,6 @@
1
+ import { IFlowTask, ITaskExecutor } from "@colabo-flow/i-core";
2
+ import { IColaboFlowHostData } from "./vos";
3
+ export declare const hostSetTitles: (host: IColaboFlowHostData) => void;
4
+ export declare const hostRegisterTaskExecutor: (host: IColaboFlowHostData, executor: ITaskExecutor) => void;
5
+ export declare const hostRegisterTask: (host: IColaboFlowHostData, task: IFlowTask) => void;
6
+ export declare const hostRun: (host: IColaboFlowHostData) => Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { EColaboFlowGoMsgType, IColaboFlowGoMsg } from "./vos";
2
+ export declare const createGoMsg: (sender: string, type: EColaboFlowGoMsgType) => IColaboFlowGoMsg;
@@ -0,0 +1 @@
1
+ export declare const MODULE_NAME: string;
@@ -0,0 +1,173 @@
1
+ import { IFlowTask, IFlowTaskInstance, ITaskExecutor } from "@colabo-flow/i-core";
2
+ import { Channel } from "amqplib";
3
+ declare 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
+ /**
13
+ * An interface describing messages exchanged between ColaboFlow.GO peers
14
+ */
15
+ export interface IColaboFlowGoMsg {
16
+ /** unique message id */
17
+ id: string;
18
+ type: EColaboFlowGoMsgType;
19
+ /** unique request id, should be kept the same along the course of a same single message exchange */
20
+ requestId: string;
21
+ /** the id of the message sender */
22
+ sender: string;
23
+ /** the name of the queue to reply to (if there is a reply to the message) */
24
+ replyTo?: string;
25
+ /** the list of proxies that forwarded the message */
26
+ proxies: string[];
27
+ /**
28
+ * list of msg ids with the history of the replying messages
29
+ */
30
+ msgReplyChainIds: string[];
31
+ /** string message that can be used for human purpose mainly */
32
+ msg?: string;
33
+ /** extension for various types of messages */
34
+ extension?: any;
35
+ }
36
+ /** enumeration of all the languages that are supported by ColaboFlow */
37
+ export declare enum EProgrammingLanguageSupported {
38
+ /** Javascript or its extensions that will be compiled to JavaScript eventually (TypeScript, Coffeescript) */
39
+ JAVASCRIPT = "JAVASCRIPT",
40
+ PYTHON = "PYTHON",
41
+ NATIVE = "NATIVE"
42
+ }
43
+ /** Message extension for the heartbeat message */
44
+ export interface IColaboFlowGoMsgExtension_Heartbeat {
45
+ /** the id of the heartbeat pulse message */
46
+ id: number;
47
+ /** the programming language that the host speaks */
48
+ language: EProgrammingLanguageSupported;
49
+ /** the list of the tasks' ids that the host implements */
50
+ taskIds: string[];
51
+ /** The queue that the host listens to */
52
+ queueHost: string;
53
+ }
54
+ export interface IColaboFlowGoMsgExtension_Heartbeat_Response {
55
+ /** the id of the heartbeat pulse message */
56
+ id: number;
57
+ /** the name of the service responding */
58
+ serviceName: string;
59
+ }
60
+ /** Message extension for the task execution request */
61
+ export interface IColaboFlowGoMsgExtension_TaskExecute_Request {
62
+ /** the id of the task we want to execute */
63
+ taskId: string;
64
+ /** input to the task we want to execute */
65
+ taskInput: any;
66
+ }
67
+ export declare enum ETaskExecute_Progress_Status {
68
+ INITIALIZED = "INITIALIZED"
69
+ }
70
+ /** Message extension for the task execution response */
71
+ export interface IColaboFlowGoMsgExtension_TaskExecute_Progress {
72
+ /** the id if the task executing instance */
73
+ taskInstanceId: string;
74
+ /** the current status of the task execution */
75
+ status: ETaskExecute_Progress_Status;
76
+ /** the percentage of the task executed */
77
+ progress: number;
78
+ }
79
+ /** Message extension for the task execution response */
80
+ export interface IColaboFlowGoMsgExtension_TaskExecute_Response {
81
+ /** output of the executed task */
82
+ taskOutput: any;
83
+ }
84
+ /** Message extension for the task instances report requesting */
85
+ export interface IColaboFlowGoMsgExtension_TaskInstancesReport_Request {
86
+ reportFinalizedTaskInstances: boolean;
87
+ reportRunningTaskInstances: boolean;
88
+ }
89
+ /** Message extension for the task instances report response */
90
+ export interface IColaboFlowGoMsgExtension_TaskInstancesReport_Response {
91
+ tasksInstanceInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
92
+ }
93
+ /**
94
+ * Provides all required info about the task execution request and its progress, etc
95
+ */
96
+ export interface IColaboFlowGoTaskInstanceInfo {
97
+ /** taskInstance id */
98
+ id: string;
99
+ /** task instance */
100
+ taskInstance: IFlowTaskInstance;
101
+ }
102
+ /** contains all the data that are necessary for a ColaboFlow.Go host to operate */
103
+ export interface IColaboFlowHostData {
104
+ hostname: string;
105
+ appNameText?: string;
106
+ amqpUrl: string;
107
+ queueHost: string;
108
+ queueHostHeartbeat: string;
109
+ chHostHeartbeat?: Channel;
110
+ taskExecutorsAvailable: Record<string, ITaskExecutor>;
111
+ tasksAvailable: Record<string, IFlowTask>;
112
+ taskInstances: Record<string, IFlowTaskInstance>;
113
+ /** Provides all required info about the task execution requests (except the executed ones) coming for this particular host and its progress, etc
114
+ * Provides all required info about the task execution request and its progress, etc
115
+ * ***record key*** is the `id` of the `taskInstance`
116
+ */
117
+ runningTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
118
+ /** Provides all required info about the finalized (finished, stopped, failed, ...) task execution requests coming for this particular host and its progress, etc
119
+ * Provides all required info about the task execution request and its progress, etc
120
+ * ***record key*** is the `id` of the `taskInstance`
121
+ */
122
+ finalizedTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
123
+ }
124
+ /** contains all the data that are necessary for a ColaboFlow.Go client to operate */
125
+ export interface IColaboFlowClientData {
126
+ clientName: string;
127
+ appNameText?: string;
128
+ amqpUrl: string;
129
+ queueServiceOrchestrator: string;
130
+ connection?: ChannelModel;
131
+ channel?: Channel;
132
+ taskInstances: Record<string, IFlowTaskInstance>;
133
+ }
134
+ /** Contains all the data that are necessary for a ColaboFlow.Go service to handle a node */
135
+ export interface IColaboFlowServiceHostData {
136
+ /** the name of the host */
137
+ hostName: string;
138
+ /** the name of the queue host listens on */
139
+ queueHost: string;
140
+ /** tasks' ids available for a specific host */
141
+ taskIdsAvailable: string[];
142
+ /** tasks instances' ids available for a specific host */
143
+ taskInstanceIds: string[];
144
+ }
145
+ /** contains all the data that are necessary for a ColaboFlow.Go service to operate */
146
+ export interface IColaboFlowServiceData {
147
+ serviceName: string;
148
+ amqpUrl: string;
149
+ /** the heartbeat queue that the service uses to listens heartbeat (registration) for the hosts */
150
+ queueHostHeartbeat: string;
151
+ /** the orchestrator queue that the service uses to listens from the clients */
152
+ queueOrchestrator: string;
153
+ /** the channel for the clients communication */
154
+ clientsChannel?: Channel;
155
+ /** the channel for the hosts communication */
156
+ hostsChannel?: Channel;
157
+ /** infos about each host known to the service
158
+ * currently hosts are discovered by receiving heartbeat messages from the hosts
159
+ */
160
+ hosts: Record<string, IColaboFlowServiceHostData>;
161
+ /** Provides all required info about the task execution requests (except the executed ones) coming for this particular host and its progress, etc
162
+ * Provides all required info about the task execution request and its progress, etc
163
+ * ***record key*** is the `id` of the `taskInstance`
164
+ */
165
+ runningTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
166
+ /** Provides all required info about the finalized (finished, stopped, failed, ...) task execution requests coming for this particular host and its progress, etc
167
+ * Provides all required info about the task execution request and its progress, etc
168
+ * ***record key*** is the `id` of the `taskInstance`
169
+ */
170
+ finalizedTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
171
+ hostsForTaskIds: Record<string, string[]>;
172
+ }
173
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
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;
@@ -0,0 +1,20 @@
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;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from "./lib/go.amqp.client";
2
+ export * from "./lib/go.amqp.host";
3
+ export * from "./lib/vos";