@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
@@ -1,84 +0,0 @@
1
- const MODULE_NAME: string = "@colabo-flow/s-go";
2
-
3
- // var fs = require('fs');
4
- import * as fs from "fs";
5
-
6
- // var chalk = require('chalk');
7
- // import * as chalk from 'chalk';
8
- import chalk from "chalk";
9
- const parseArgs = require("minimist");
10
- const _ = require("lodash");
11
- // var grpc = require('grpc');
12
- import * as grpc from "grpc";
13
- // var protoLoader = require('@grpc/proto-loader');
14
- import * as protoLoader from "@grpc/proto-loader";
15
-
16
- import { GetPuzzle } from "@colabo-utils/i-config";
17
-
18
- import { RpcMethods, ActionExecuteRequestInterface, ActionExecuteRequestClass } from "@colabo-flow/i-go";
19
-
20
- export class ColaboFlowGoActionHostServer {
21
- protected gRpcServer: any;
22
- protected rpcMethods: RpcMethods;
23
- protected gRpcColaboFlow: any;
24
- protected puzzleConfig: any;
25
-
26
- constructor() {
27
- this.puzzleConfig = GetPuzzle(MODULE_NAME);
28
-
29
- // relative to the dist folder
30
- let PROTO_PATH = __dirname + "/../../protos/colabo/flow/go/go.proto";
31
- console.log("__dirname: %s, PROTO_PATH: %s", __dirname, PROTO_PATH);
32
- PROTO_PATH = fs.realpathSync(PROTO_PATH);
33
- console.log("after fs.realpathSync: PROTO_PATH: %s", PROTO_PATH);
34
-
35
- // load the `*.proto` file with gRPC service definition
36
- const packageDefinition = protoLoader.loadSync(PROTO_PATH, {
37
- keepCase: true,
38
- longs: String,
39
- enums: String,
40
- defaults: true,
41
- oneofs: true,
42
- });
43
- // The protoDescriptor object has the full package hierarchy
44
- const protoDescriptor = grpc.loadPackageDefinition(packageDefinition);
45
- // we are getting the colaboFlow descriptor ...
46
- this.gRpcColaboFlow = (<any>protoDescriptor.colabo).flow;
47
- }
48
-
49
- init(rpcMethods: RpcMethods) {
50
- this.rpcMethods = rpcMethods;
51
- }
52
-
53
- /**
54
- * Get a new server with the handler functions in this file bound to the methods
55
- * it serves.
56
- * @return {Server} The new server object
57
- */
58
- protected getServer(): any {
59
- const server = new grpc.Server();
60
- server.addService(this.gRpcColaboFlow.ActionsHost.service, {
61
- executeAction: this.executeActionWrapper.bind(this),
62
- });
63
- return server;
64
- }
65
-
66
- /**
67
- * executeAction request handler. Gets a request with a point, and responds with a
68
- * feature object indicating whether there is a feature at that point.
69
- * @param {EventEmitter} call Call object for the handler to process
70
- * @param {function(Error, feature)} callback Response callback
71
- */
72
- protected executeActionWrapper(call, callback) {
73
- // first parameter equal to null indicates that there is no error
74
- this.rpcMethods.executeAction(call.request, callback);
75
- }
76
-
77
- start() {
78
- this.gRpcServer = this.getServer();
79
- const gRpcUrl: string = this.puzzleConfig.gRpcUrl;
80
- console.info("[%s] Starting service at %s", MODULE_NAME, gRpcUrl);
81
- this.gRpcServer.bind(gRpcUrl, grpc.ServerCredentials.createInsecure());
82
- this.gRpcServer.start();
83
- }
84
- }
@@ -1,82 +0,0 @@
1
- // var fs = require('fs');
2
- import * as fs from "fs";
3
-
4
- // relative to the dist folder
5
- let PROTO_PATH = __dirname + "/../../protos/colabo/flow/go/go.proto";
6
- console.log("__dirname: %s, PROTO_PATH: %s", __dirname, PROTO_PATH);
7
- PROTO_PATH = fs.realpathSync(PROTO_PATH);
8
- console.log("after fs.realpathSync: PROTO_PATH: %s", PROTO_PATH);
9
-
10
- // var chalk = require('chalk');
11
- // import * as chalk from 'chalk';
12
- import chalk from "chalk";
13
- const parseArgs = require("minimist");
14
- const _ = require("lodash");
15
- const async = require("async");
16
- // var grpc = require('grpc');
17
- import * as grpc from "grpc";
18
- // var protoLoader = require('@grpc/proto-loader');
19
- import * as protoLoader from "@grpc/proto-loader";
20
- // load the `*.proto` file with gRPC service definition
21
- const packageDefinition = protoLoader.loadSync(
22
- PROTO_PATH,
23
- // Suggested options for similarity to existing grpc.load behavior
24
- {
25
- keepCase: true,
26
- longs: String,
27
- enums: String,
28
- defaults: true,
29
- oneofs: true,
30
- }
31
- );
32
- // The protoDescriptor object has the full package hierarchy
33
- const protoDescriptor = grpc.loadPackageDefinition(packageDefinition);
34
- // we are getting the colaboFlow descriptor ...
35
- const colaboFlow = protoDescriptor.colabo.flow;
36
-
37
- // and building stub client from the `colaboFlow.Go` class
38
- // (similarly the service class used to create a server is in the `colaboFlow.Go.service` class)
39
- const client = new colaboFlow.Go("localhost:50505", grpc.credentials.createInsecure());
40
-
41
- const COORD_FACTOR = 1e7;
42
-
43
- /**
44
- * Run the getFeature demo. Calls getFeature with a point known to have a
45
- * feature and a point known not to have a feature.
46
- * @param {function} callback Called when this demo is complete
47
- */
48
- function submit(callback) {
49
- const next = _.after(2, callback);
50
-
51
- function featureCallback(error, result) {
52
- if (error) {
53
- callback(error);
54
- return;
55
- }
56
- console.log("Result: ", result);
57
- next();
58
- }
59
- const request1 = {
60
- n1: 2,
61
- n2: 3,
62
- };
63
- client.submit(request1, featureCallback);
64
- const request2 = {
65
- n1: 4,
66
- n2: 3,
67
- };
68
- client.submit(request2, featureCallback);
69
- }
70
-
71
- /**
72
- * Run all of the demos in order
73
- */
74
- function main() {
75
- async.series([submit]);
76
- }
77
-
78
- if (require.main === module) {
79
- main();
80
- }
81
-
82
- exports.submit = submit;
@@ -1,84 +0,0 @@
1
- const MODULE_NAME: string = "@colabo-flow/s-go";
2
-
3
- // var fs = require('fs');
4
- import * as fs from "fs";
5
-
6
- // var chalk = require('chalk');
7
- // import * as chalk from 'chalk';
8
- import chalk from "chalk";
9
- const parseArgs = require("minimist");
10
- const _ = require("lodash");
11
- // var grpc = require('grpc');
12
- import * as grpc from "grpc";
13
- // var protoLoader = require('@grpc/proto-loader');
14
- import * as protoLoader from "@grpc/proto-loader";
15
-
16
- import { GetPuzzle } from "@colabo-utils/i-config";
17
-
18
- import { RpcMethods } from "@colabo-flow/i-go";
19
-
20
- export class ColaboFlowGoServer {
21
- protected gRpcServer: any;
22
- protected rpcMethods: RpcMethods;
23
- protected gRpcColaboFlow: any;
24
- protected puzzleConfig: any;
25
-
26
- constructor() {
27
- this.puzzleConfig = GetPuzzle(MODULE_NAME);
28
-
29
- // relative to the dist folder
30
- let PROTO_PATH = __dirname + "/../../protos/colabo/flow/go/go.proto";
31
- console.log("__dirname: %s, PROTO_PATH: %s", __dirname, PROTO_PATH);
32
- PROTO_PATH = fs.realpathSync(PROTO_PATH);
33
- console.log("after fs.realpathSync: PROTO_PATH: %s", PROTO_PATH);
34
-
35
- // load the `*.proto` file with gRPC service definition
36
- const packageDefinition = protoLoader.loadSync(PROTO_PATH, {
37
- keepCase: true,
38
- longs: String,
39
- enums: String,
40
- defaults: true,
41
- oneofs: true,
42
- });
43
- // The protoDescriptor object has the full package hierarchy
44
- const protoDescriptor = grpc.loadPackageDefinition(packageDefinition);
45
- // we are getting the colaboFlow descriptor ...
46
- this.gRpcColaboFlow = (<any>protoDescriptor.colabo).flow;
47
- }
48
-
49
- init(rpcMethods: RpcMethods) {
50
- this.rpcMethods = rpcMethods;
51
- }
52
-
53
- /**
54
- * Get a new server with the handler functions in this file bound to the methods
55
- * it serves.
56
- * @return {Server} The new server object
57
- */
58
- protected getServer(): any {
59
- const server = new grpc.Server();
60
- server.addService(this.gRpcColaboFlow.FlowsHost.service, {
61
- executeActionSync: this.executeActionSyncWrapper.bind(this),
62
- });
63
- return server;
64
- }
65
-
66
- /**
67
- * executeActionSync request handler. Gets a request with a point, and responds with a
68
- * feature object indicating whether there is a feature at that point.
69
- * @param {EventEmitter} call Call object for the handler to process
70
- * @param {function(Error, feature)} callback Response callback
71
- */
72
- protected executeActionSyncWrapper(call, callback) {
73
- // first parameter equal to null indicates that there is no error
74
- this.rpcMethods.executeActionSync(call.request, callback);
75
- }
76
-
77
- start() {
78
- this.gRpcServer = this.getServer();
79
- const gRpcUrl: string = this.puzzleConfig.gRpcUrl;
80
- console.info("[%s] Starting service at %s", MODULE_NAME, gRpcUrl);
81
- this.gRpcServer.bind(gRpcUrl, grpc.ServerCredentials.createInsecure());
82
- this.gRpcServer.start();
83
- }
84
- }
@@ -1,21 +0,0 @@
1
- import { ColaboFlowGoActionHostClient} from '../index';
2
-
3
- import { ActionExecuteRequestInterface, ActionExecuteRequestClass } from '@colabo-flow/i-go';
4
-
5
- // test python
6
- let socketUrl:string = "localhost:50801";
7
- // check-credentials @ ACE
8
- // let socketUrl: string = "localhost:50901";
9
- let colaboFlowGoActionHostClient: ColaboFlowGoActionHostClient = new ColaboFlowGoActionHostClient(socketUrl);
10
-
11
- let actionExecuteRequest: ActionExecuteRequestClass = new ActionExecuteRequestClass();
12
- actionExecuteRequest.name = 'search-sounds';
13
- // actionExecuteRequest.name = 'check-authorization';
14
-
15
- function finished(error, result) {
16
- if (!error){
17
- console.log("[demo::finished] Result: ", result);
18
- }
19
- }
20
-
21
- colaboFlowGoActionHostClient.executeAction(actionExecuteRequest, finished);
@@ -1,3 +0,0 @@
1
- export { ColaboFlowGoServer } from "./colaboflow_go_server";
2
- export { ColaboFlowGoActionHostClient } from "./colaboflow_go_actionhost_client";
3
- export { ColaboFlowGoActionHostServer } from "./colaboflow_go_actionhost_server";