@wenlarge/communication 1.0.6 → 1.0.8
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/dist/config/workflow-config.d.ts +1 -0
- package/dist/config/workflow-config.js +6 -0
- package/dist/generated/project.d.ts +8 -0
- package/dist/generated/project.js +1 -1
- package/dist/generated/workflow.d.ts +104 -0
- package/dist/generated/workflow.js +37 -0
- package/dist/grpc-client/grpc-client.module.d.ts +1 -0
- package/dist/grpc-client/grpc-client.module.js +18 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/package.json +4 -1
- package/proto/project.proto +9 -0
- package/proto/workflow.proto +105 -0
- package/src/generated/project.ts +16 -1
- package/src/generated/workflow.ts +192 -0
- package/src/generated/google/protobuf/timestamp.ts +0 -118
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WORKFLOW_PROTO_PATH: string[];
|
|
@@ -25,18 +25,26 @@ export interface GetAllRequest {
|
|
|
25
25
|
export interface GetAllResponse {
|
|
26
26
|
projects: ProjectResponse[];
|
|
27
27
|
}
|
|
28
|
+
export interface GetProjectByIdRequest {
|
|
29
|
+
id: string;
|
|
30
|
+
}
|
|
31
|
+
export interface GetProjectByIdResponse {
|
|
32
|
+
project?: ProjectResponse | undefined;
|
|
33
|
+
}
|
|
28
34
|
export declare const PROJECT_PACKAGE_NAME = "project";
|
|
29
35
|
export interface ProjectServiceClient {
|
|
30
36
|
create(request: CreateProjectRequest, metadata?: Metadata): Observable<ProjectResponse>;
|
|
31
37
|
getAll(request: GetAllRequest, metadata?: Metadata): Observable<GetAllResponse>;
|
|
32
38
|
delete(request: DeleteProjectRequest, metadata?: Metadata): Observable<Empty>;
|
|
33
39
|
update(request: UpdateProjectRequest, metadata?: Metadata): Observable<ProjectResponse>;
|
|
40
|
+
getById(request: GetProjectByIdRequest, metadata?: Metadata): Observable<GetProjectByIdResponse>;
|
|
34
41
|
}
|
|
35
42
|
export interface ProjectServiceController {
|
|
36
43
|
create(request: CreateProjectRequest, metadata?: Metadata): Promise<ProjectResponse> | Observable<ProjectResponse> | ProjectResponse;
|
|
37
44
|
getAll(request: GetAllRequest, metadata?: Metadata): Promise<GetAllResponse> | Observable<GetAllResponse> | GetAllResponse;
|
|
38
45
|
delete(request: DeleteProjectRequest, metadata?: Metadata): void;
|
|
39
46
|
update(request: UpdateProjectRequest, metadata?: Metadata): Promise<ProjectResponse> | Observable<ProjectResponse> | ProjectResponse;
|
|
47
|
+
getById(request: GetProjectByIdRequest, metadata?: Metadata): Promise<GetProjectByIdResponse> | Observable<GetProjectByIdResponse> | GetProjectByIdResponse;
|
|
40
48
|
}
|
|
41
49
|
export declare function ProjectServiceControllerMethods(): (constructor: Function) => void;
|
|
42
50
|
export declare const PROJECT_SERVICE_NAME = "ProjectService";
|
|
@@ -12,7 +12,7 @@ exports.protobufPackage = "project";
|
|
|
12
12
|
exports.PROJECT_PACKAGE_NAME = "project";
|
|
13
13
|
function ProjectServiceControllerMethods() {
|
|
14
14
|
return function (constructor) {
|
|
15
|
-
const grpcMethods = ["create", "getAll", "delete", "update"];
|
|
15
|
+
const grpcMethods = ["create", "getAll", "delete", "update", "getById"];
|
|
16
16
|
for (const method of grpcMethods) {
|
|
17
17
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
18
18
|
(0, microservices_1.GrpcMethod)("ProjectService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Metadata } from "@grpc/grpc-js";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import { Empty } from "./google/protobuf/empty";
|
|
4
|
+
export declare const protobufPackage = "workflow";
|
|
5
|
+
export interface CreateWorkflowRequest {
|
|
6
|
+
name: string;
|
|
7
|
+
projectId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface WorkflowResponse {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
companyId: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DeleteWorkflowRequest {
|
|
17
|
+
id: string;
|
|
18
|
+
}
|
|
19
|
+
export interface UpdateWorkflowRequest {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
}
|
|
23
|
+
export interface GetAllWorkflowRequest {
|
|
24
|
+
companyId: string;
|
|
25
|
+
}
|
|
26
|
+
export interface GetAllWorkflowResponse {
|
|
27
|
+
workflows: WorkflowResponse[];
|
|
28
|
+
}
|
|
29
|
+
/** NODE SERVICE COMPS */
|
|
30
|
+
export interface NodeCreateRequest {
|
|
31
|
+
workflowId: string;
|
|
32
|
+
name: string;
|
|
33
|
+
type: string;
|
|
34
|
+
positionX: number;
|
|
35
|
+
positionY: number;
|
|
36
|
+
inputSchema: string;
|
|
37
|
+
outputSchema: string;
|
|
38
|
+
config: string;
|
|
39
|
+
nextNodeIds: string[];
|
|
40
|
+
}
|
|
41
|
+
export interface NodeUpdateRequest {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
type: string;
|
|
45
|
+
positionX: number;
|
|
46
|
+
positionY: number;
|
|
47
|
+
nextNodeIds: string[];
|
|
48
|
+
inputSchema: string;
|
|
49
|
+
outputSchema: string;
|
|
50
|
+
config: string;
|
|
51
|
+
}
|
|
52
|
+
export interface NodeDeleteRequest {
|
|
53
|
+
id: string;
|
|
54
|
+
}
|
|
55
|
+
export interface NodeGetAllRequest {
|
|
56
|
+
workflowId: string;
|
|
57
|
+
}
|
|
58
|
+
export interface NodeGetAllResponse {
|
|
59
|
+
nodes: NodeResponse[];
|
|
60
|
+
}
|
|
61
|
+
export interface NodeGetByIdRequest {
|
|
62
|
+
id: string;
|
|
63
|
+
}
|
|
64
|
+
export interface NodeGetByIdResponse {
|
|
65
|
+
node?: NodeResponse | undefined;
|
|
66
|
+
}
|
|
67
|
+
export interface NodeResponse {
|
|
68
|
+
id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
type: string;
|
|
71
|
+
positionX: number;
|
|
72
|
+
positionY: number;
|
|
73
|
+
inputSchema: string;
|
|
74
|
+
outputSchema: string;
|
|
75
|
+
config: string;
|
|
76
|
+
nextNodeIds: string[];
|
|
77
|
+
createdAt: string;
|
|
78
|
+
updatedAt: string;
|
|
79
|
+
}
|
|
80
|
+
export declare const WORKFLOW_PACKAGE_NAME = "workflow";
|
|
81
|
+
export interface WorkflowServiceClient {
|
|
82
|
+
create(request: CreateWorkflowRequest, metadata?: Metadata): Observable<WorkflowResponse>;
|
|
83
|
+
getAll(request: GetAllWorkflowRequest, metadata?: Metadata): Observable<GetAllWorkflowResponse>;
|
|
84
|
+
delete(request: DeleteWorkflowRequest, metadata?: Metadata): Observable<Empty>;
|
|
85
|
+
update(request: UpdateWorkflowRequest, metadata?: Metadata): Observable<WorkflowResponse>;
|
|
86
|
+
createNode(request: NodeCreateRequest, metadata?: Metadata): Observable<NodeResponse>;
|
|
87
|
+
getAllNode(request: NodeGetAllRequest, metadata?: Metadata): Observable<NodeGetAllResponse>;
|
|
88
|
+
getByIdNode(request: NodeGetByIdRequest, metadata?: Metadata): Observable<NodeGetByIdResponse>;
|
|
89
|
+
updateNode(request: NodeUpdateRequest, metadata?: Metadata): Observable<NodeResponse>;
|
|
90
|
+
deleteNode(request: NodeDeleteRequest, metadata?: Metadata): Observable<Empty>;
|
|
91
|
+
}
|
|
92
|
+
export interface WorkflowServiceController {
|
|
93
|
+
create(request: CreateWorkflowRequest, metadata?: Metadata): Promise<WorkflowResponse> | Observable<WorkflowResponse> | WorkflowResponse;
|
|
94
|
+
getAll(request: GetAllWorkflowRequest, metadata?: Metadata): Promise<GetAllWorkflowResponse> | Observable<GetAllWorkflowResponse> | GetAllWorkflowResponse;
|
|
95
|
+
delete(request: DeleteWorkflowRequest, metadata?: Metadata): void;
|
|
96
|
+
update(request: UpdateWorkflowRequest, metadata?: Metadata): Promise<WorkflowResponse> | Observable<WorkflowResponse> | WorkflowResponse;
|
|
97
|
+
createNode(request: NodeCreateRequest, metadata?: Metadata): Promise<NodeResponse> | Observable<NodeResponse> | NodeResponse;
|
|
98
|
+
getAllNode(request: NodeGetAllRequest, metadata?: Metadata): Promise<NodeGetAllResponse> | Observable<NodeGetAllResponse> | NodeGetAllResponse;
|
|
99
|
+
getByIdNode(request: NodeGetByIdRequest, metadata?: Metadata): Promise<NodeGetByIdResponse> | Observable<NodeGetByIdResponse> | NodeGetByIdResponse;
|
|
100
|
+
updateNode(request: NodeUpdateRequest, metadata?: Metadata): Promise<NodeResponse> | Observable<NodeResponse> | NodeResponse;
|
|
101
|
+
deleteNode(request: NodeDeleteRequest, metadata?: Metadata): void;
|
|
102
|
+
}
|
|
103
|
+
export declare function WorkflowServiceControllerMethods(): (constructor: Function) => void;
|
|
104
|
+
export declare const WORKFLOW_SERVICE_NAME = "WorkflowService";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v1.181.2
|
|
5
|
+
// protoc v3.21.5
|
|
6
|
+
// source: workflow.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.WORKFLOW_SERVICE_NAME = exports.WORKFLOW_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.WorkflowServiceControllerMethods = WorkflowServiceControllerMethods;
|
|
10
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
11
|
+
exports.protobufPackage = "workflow";
|
|
12
|
+
exports.WORKFLOW_PACKAGE_NAME = "workflow";
|
|
13
|
+
function WorkflowServiceControllerMethods() {
|
|
14
|
+
return function (constructor) {
|
|
15
|
+
const grpcMethods = [
|
|
16
|
+
"create",
|
|
17
|
+
"getAll",
|
|
18
|
+
"delete",
|
|
19
|
+
"update",
|
|
20
|
+
"createNode",
|
|
21
|
+
"getAllNode",
|
|
22
|
+
"getByIdNode",
|
|
23
|
+
"updateNode",
|
|
24
|
+
"deleteNode",
|
|
25
|
+
];
|
|
26
|
+
for (const method of grpcMethods) {
|
|
27
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
28
|
+
(0, microservices_1.GrpcMethod)("WorkflowService", method)(constructor.prototype[method], method, descriptor);
|
|
29
|
+
}
|
|
30
|
+
const grpcStreamMethods = [];
|
|
31
|
+
for (const method of grpcStreamMethods) {
|
|
32
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
33
|
+
(0, microservices_1.GrpcStreamMethod)("WorkflowService", method)(constructor.prototype[method], method, descriptor);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.WORKFLOW_SERVICE_NAME = "WorkflowService";
|
|
@@ -2,6 +2,7 @@ import { DynamicModule } from "@nestjs/common";
|
|
|
2
2
|
export interface GrpcClientModuleOptions {
|
|
3
3
|
authServiceUrl: string;
|
|
4
4
|
projectServiceUrl: string;
|
|
5
|
+
workflowServiceUrl: string;
|
|
5
6
|
}
|
|
6
7
|
export declare class GrpcClientModule {
|
|
7
8
|
static forRoot(options: GrpcClientModuleOptions): DynamicModule;
|
|
@@ -46,6 +46,8 @@ const auth_1 = require("../generated/auth");
|
|
|
46
46
|
const project_1 = require("../generated/project");
|
|
47
47
|
const auth_config_1 = require("../config/auth-config");
|
|
48
48
|
const project_config_1 = require("../config/project-config");
|
|
49
|
+
const workflow_1 = require("../generated/workflow");
|
|
50
|
+
const workflow_config_1 = require("../config/workflow-config");
|
|
49
51
|
let GrpcClientModule = (() => {
|
|
50
52
|
let _classDecorators = [(0, common_1.Module)({})];
|
|
51
53
|
let _classDescriptor;
|
|
@@ -90,6 +92,22 @@ let GrpcClientModule = (() => {
|
|
|
90
92
|
},
|
|
91
93
|
},
|
|
92
94
|
},
|
|
95
|
+
{
|
|
96
|
+
name: workflow_1.WORKFLOW_SERVICE_NAME,
|
|
97
|
+
transport: microservices_1.Transport.GRPC,
|
|
98
|
+
options: {
|
|
99
|
+
package: workflow_1.WORKFLOW_PACKAGE_NAME,
|
|
100
|
+
protoPath: workflow_config_1.WORKFLOW_PROTO_PATH.map((p) => (0, path_1.join)(__dirname, "../../" + p)),
|
|
101
|
+
url: options.workflowServiceUrl,
|
|
102
|
+
loader: {
|
|
103
|
+
keepCase: true,
|
|
104
|
+
longs: String,
|
|
105
|
+
enums: String,
|
|
106
|
+
defaults: true,
|
|
107
|
+
oneofs: true,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
93
111
|
]),
|
|
94
112
|
],
|
|
95
113
|
exports: [microservices_1.ClientsModule],
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./helpers/helper";
|
|
2
2
|
export * as Auth from "./generated/auth";
|
|
3
3
|
export * from "./config/auth-config";
|
|
4
|
+
export * as Workflow from "./generated/workflow";
|
|
5
|
+
export * from "./config/workflow-config";
|
|
4
6
|
export * as Project from "./generated/project";
|
|
5
7
|
export * from "./config/project-config";
|
|
6
8
|
export * from "./grpc-client";
|
package/dist/index.js
CHANGED
|
@@ -36,10 +36,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Metadata = exports.Project = exports.Auth = void 0;
|
|
39
|
+
exports.Metadata = exports.Project = exports.Workflow = exports.Auth = void 0;
|
|
40
40
|
__exportStar(require("./helpers/helper"), exports);
|
|
41
41
|
exports.Auth = __importStar(require("./generated/auth"));
|
|
42
42
|
__exportStar(require("./config/auth-config"), exports);
|
|
43
|
+
exports.Workflow = __importStar(require("./generated/workflow"));
|
|
44
|
+
__exportStar(require("./config/workflow-config"), exports);
|
|
43
45
|
exports.Project = __importStar(require("./generated/project"));
|
|
44
46
|
__exportStar(require("./config/project-config"), exports);
|
|
45
47
|
__exportStar(require("./grpc-client"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wenlarge/communication",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Shared gRPC proto interfaces and generated clients for Wenlarge microservices.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -42,5 +42,8 @@
|
|
|
42
42
|
"@types/node": "^24.9.1",
|
|
43
43
|
"ts-proto": "^1.152.2",
|
|
44
44
|
"typescript": "^5.3.3"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies":{
|
|
47
|
+
"@grpc/grpc-js": "^1.14.1"
|
|
45
48
|
}
|
|
46
49
|
}
|
package/proto/project.proto
CHANGED
|
@@ -10,6 +10,7 @@ service ProjectService {
|
|
|
10
10
|
rpc GetAll (GetAllRequest) returns (GetAllResponse);
|
|
11
11
|
rpc Delete (DeleteProjectRequest) returns (google.protobuf.Empty);
|
|
12
12
|
rpc Update (UpdateProjectRequest) returns (ProjectResponse);
|
|
13
|
+
rpc GetById (GetProjectByIdRequest) returns (GetProjectByIdResponse);
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
message CreateProjectRequest {
|
|
@@ -39,4 +40,12 @@ message GetAllRequest{
|
|
|
39
40
|
|
|
40
41
|
message GetAllResponse{
|
|
41
42
|
repeated ProjectResponse projects = 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message GetProjectByIdRequest{
|
|
46
|
+
string id = 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message GetProjectByIdResponse{
|
|
50
|
+
ProjectResponse project = 1;
|
|
42
51
|
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
import "google/protobuf/empty.proto";
|
|
4
|
+
|
|
5
|
+
package workflow;
|
|
6
|
+
|
|
7
|
+
service WorkflowService {
|
|
8
|
+
rpc Create (CreateWorkflowRequest) returns (WorkflowResponse);
|
|
9
|
+
rpc GetAll (GetAllWorkflowRequest) returns (GetAllWorkflowResponse);
|
|
10
|
+
rpc Delete (DeleteWorkflowRequest) returns (google.protobuf.Empty);
|
|
11
|
+
rpc Update (UpdateWorkflowRequest) returns (WorkflowResponse);
|
|
12
|
+
rpc CreateNode (NodeCreateRequest) returns (NodeResponse);
|
|
13
|
+
rpc GetAllNode (NodeGetAllRequest) returns (NodeGetAllResponse);
|
|
14
|
+
rpc GetByIdNode (NodeGetByIdRequest) returns (NodeGetByIdResponse);
|
|
15
|
+
rpc UpdateNode (NodeUpdateRequest) returns (NodeResponse);
|
|
16
|
+
rpc DeleteNode (NodeDeleteRequest) returns (google.protobuf.Empty);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message CreateWorkflowRequest {
|
|
20
|
+
string name = 1;
|
|
21
|
+
string projectId = 2;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message WorkflowResponse {
|
|
25
|
+
string id = 1;
|
|
26
|
+
string name = 2;
|
|
27
|
+
string companyId = 3;
|
|
28
|
+
string createdAt = 4;
|
|
29
|
+
string updatedAt = 5;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
message DeleteWorkflowRequest{
|
|
33
|
+
string id = 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message UpdateWorkflowRequest{
|
|
37
|
+
string id = 1;
|
|
38
|
+
string name = 2;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message GetAllWorkflowRequest{
|
|
42
|
+
string companyId = 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message GetAllWorkflowResponse{
|
|
46
|
+
repeated WorkflowResponse workflows = 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// NODE SERVICE COMPS
|
|
50
|
+
message NodeCreateRequest{
|
|
51
|
+
string workflowId = 1;
|
|
52
|
+
string name = 2;
|
|
53
|
+
string type = 3;
|
|
54
|
+
int32 positionX = 4;
|
|
55
|
+
int32 positionY = 5;
|
|
56
|
+
string inputSchema = 6;
|
|
57
|
+
string outputSchema = 7;
|
|
58
|
+
string config = 8;
|
|
59
|
+
repeated string nextNodeIds = 9;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message NodeUpdateRequest{
|
|
63
|
+
string id = 1;
|
|
64
|
+
string name = 2;
|
|
65
|
+
string type =3;
|
|
66
|
+
int32 positionX = 4;
|
|
67
|
+
int32 positionY=5;
|
|
68
|
+
repeated string nextNodeIds = 6;
|
|
69
|
+
string inputSchema = 7;
|
|
70
|
+
string outputSchema = 8;
|
|
71
|
+
string config = 9;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
message NodeDeleteRequest{
|
|
75
|
+
string id = 1;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
message NodeGetAllRequest{
|
|
79
|
+
string workflowId = 1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
message NodeGetAllResponse{
|
|
83
|
+
repeated NodeResponse nodes = 1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message NodeGetByIdRequest{
|
|
87
|
+
string id = 1;
|
|
88
|
+
}
|
|
89
|
+
message NodeGetByIdResponse{
|
|
90
|
+
NodeResponse node = 1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
message NodeResponse{
|
|
94
|
+
string id = 1;
|
|
95
|
+
string name = 2;
|
|
96
|
+
string type = 3;
|
|
97
|
+
int32 positionX = 4;
|
|
98
|
+
int32 positionY = 5;
|
|
99
|
+
string inputSchema = 6;
|
|
100
|
+
string outputSchema = 7;
|
|
101
|
+
string config = 8;
|
|
102
|
+
repeated string nextNodeIds = 9;
|
|
103
|
+
string createdAt = 10;
|
|
104
|
+
string updatedAt = 11;
|
|
105
|
+
}
|
package/src/generated/project.ts
CHANGED
|
@@ -41,6 +41,14 @@ export interface GetAllResponse {
|
|
|
41
41
|
projects: ProjectResponse[];
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
export interface GetProjectByIdRequest {
|
|
45
|
+
id: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface GetProjectByIdResponse {
|
|
49
|
+
project?: ProjectResponse | undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
44
52
|
export const PROJECT_PACKAGE_NAME = "project";
|
|
45
53
|
|
|
46
54
|
export interface ProjectServiceClient {
|
|
@@ -51,6 +59,8 @@ export interface ProjectServiceClient {
|
|
|
51
59
|
delete(request: DeleteProjectRequest, metadata?: Metadata): Observable<Empty>;
|
|
52
60
|
|
|
53
61
|
update(request: UpdateProjectRequest, metadata?: Metadata): Observable<ProjectResponse>;
|
|
62
|
+
|
|
63
|
+
getById(request: GetProjectByIdRequest, metadata?: Metadata): Observable<GetProjectByIdResponse>;
|
|
54
64
|
}
|
|
55
65
|
|
|
56
66
|
export interface ProjectServiceController {
|
|
@@ -70,11 +80,16 @@ export interface ProjectServiceController {
|
|
|
70
80
|
request: UpdateProjectRequest,
|
|
71
81
|
metadata?: Metadata,
|
|
72
82
|
): Promise<ProjectResponse> | Observable<ProjectResponse> | ProjectResponse;
|
|
83
|
+
|
|
84
|
+
getById(
|
|
85
|
+
request: GetProjectByIdRequest,
|
|
86
|
+
metadata?: Metadata,
|
|
87
|
+
): Promise<GetProjectByIdResponse> | Observable<GetProjectByIdResponse> | GetProjectByIdResponse;
|
|
73
88
|
}
|
|
74
89
|
|
|
75
90
|
export function ProjectServiceControllerMethods() {
|
|
76
91
|
return function (constructor: Function) {
|
|
77
|
-
const grpcMethods: string[] = ["create", "getAll", "delete", "update"];
|
|
92
|
+
const grpcMethods: string[] = ["create", "getAll", "delete", "update", "getById"];
|
|
78
93
|
for (const method of grpcMethods) {
|
|
79
94
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
80
95
|
GrpcMethod("ProjectService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v1.181.2
|
|
4
|
+
// protoc v3.21.5
|
|
5
|
+
// source: workflow.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { Metadata } from "@grpc/grpc-js";
|
|
9
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
10
|
+
import { Observable } from "rxjs";
|
|
11
|
+
import { Empty } from "./google/protobuf/empty";
|
|
12
|
+
|
|
13
|
+
export const protobufPackage = "workflow";
|
|
14
|
+
|
|
15
|
+
export interface CreateWorkflowRequest {
|
|
16
|
+
name: string;
|
|
17
|
+
projectId: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface WorkflowResponse {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
companyId: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface DeleteWorkflowRequest {
|
|
29
|
+
id: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface UpdateWorkflowRequest {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface GetAllWorkflowRequest {
|
|
38
|
+
companyId: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface GetAllWorkflowResponse {
|
|
42
|
+
workflows: WorkflowResponse[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** NODE SERVICE COMPS */
|
|
46
|
+
export interface NodeCreateRequest {
|
|
47
|
+
workflowId: string;
|
|
48
|
+
name: string;
|
|
49
|
+
type: string;
|
|
50
|
+
positionX: number;
|
|
51
|
+
positionY: number;
|
|
52
|
+
inputSchema: string;
|
|
53
|
+
outputSchema: string;
|
|
54
|
+
config: string;
|
|
55
|
+
nextNodeIds: string[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface NodeUpdateRequest {
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
type: string;
|
|
62
|
+
positionX: number;
|
|
63
|
+
positionY: number;
|
|
64
|
+
nextNodeIds: string[];
|
|
65
|
+
inputSchema: string;
|
|
66
|
+
outputSchema: string;
|
|
67
|
+
config: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface NodeDeleteRequest {
|
|
71
|
+
id: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface NodeGetAllRequest {
|
|
75
|
+
workflowId: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface NodeGetAllResponse {
|
|
79
|
+
nodes: NodeResponse[];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface NodeGetByIdRequest {
|
|
83
|
+
id: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface NodeGetByIdResponse {
|
|
87
|
+
node?: NodeResponse | undefined;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface NodeResponse {
|
|
91
|
+
id: string;
|
|
92
|
+
name: string;
|
|
93
|
+
type: string;
|
|
94
|
+
positionX: number;
|
|
95
|
+
positionY: number;
|
|
96
|
+
inputSchema: string;
|
|
97
|
+
outputSchema: string;
|
|
98
|
+
config: string;
|
|
99
|
+
nextNodeIds: string[];
|
|
100
|
+
createdAt: string;
|
|
101
|
+
updatedAt: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export const WORKFLOW_PACKAGE_NAME = "workflow";
|
|
105
|
+
|
|
106
|
+
export interface WorkflowServiceClient {
|
|
107
|
+
create(request: CreateWorkflowRequest, metadata?: Metadata): Observable<WorkflowResponse>;
|
|
108
|
+
|
|
109
|
+
getAll(request: GetAllWorkflowRequest, metadata?: Metadata): Observable<GetAllWorkflowResponse>;
|
|
110
|
+
|
|
111
|
+
delete(request: DeleteWorkflowRequest, metadata?: Metadata): Observable<Empty>;
|
|
112
|
+
|
|
113
|
+
update(request: UpdateWorkflowRequest, metadata?: Metadata): Observable<WorkflowResponse>;
|
|
114
|
+
|
|
115
|
+
createNode(request: NodeCreateRequest, metadata?: Metadata): Observable<NodeResponse>;
|
|
116
|
+
|
|
117
|
+
getAllNode(request: NodeGetAllRequest, metadata?: Metadata): Observable<NodeGetAllResponse>;
|
|
118
|
+
|
|
119
|
+
getByIdNode(request: NodeGetByIdRequest, metadata?: Metadata): Observable<NodeGetByIdResponse>;
|
|
120
|
+
|
|
121
|
+
updateNode(request: NodeUpdateRequest, metadata?: Metadata): Observable<NodeResponse>;
|
|
122
|
+
|
|
123
|
+
deleteNode(request: NodeDeleteRequest, metadata?: Metadata): Observable<Empty>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface WorkflowServiceController {
|
|
127
|
+
create(
|
|
128
|
+
request: CreateWorkflowRequest,
|
|
129
|
+
metadata?: Metadata,
|
|
130
|
+
): Promise<WorkflowResponse> | Observable<WorkflowResponse> | WorkflowResponse;
|
|
131
|
+
|
|
132
|
+
getAll(
|
|
133
|
+
request: GetAllWorkflowRequest,
|
|
134
|
+
metadata?: Metadata,
|
|
135
|
+
): Promise<GetAllWorkflowResponse> | Observable<GetAllWorkflowResponse> | GetAllWorkflowResponse;
|
|
136
|
+
|
|
137
|
+
delete(request: DeleteWorkflowRequest, metadata?: Metadata): void;
|
|
138
|
+
|
|
139
|
+
update(
|
|
140
|
+
request: UpdateWorkflowRequest,
|
|
141
|
+
metadata?: Metadata,
|
|
142
|
+
): Promise<WorkflowResponse> | Observable<WorkflowResponse> | WorkflowResponse;
|
|
143
|
+
|
|
144
|
+
createNode(
|
|
145
|
+
request: NodeCreateRequest,
|
|
146
|
+
metadata?: Metadata,
|
|
147
|
+
): Promise<NodeResponse> | Observable<NodeResponse> | NodeResponse;
|
|
148
|
+
|
|
149
|
+
getAllNode(
|
|
150
|
+
request: NodeGetAllRequest,
|
|
151
|
+
metadata?: Metadata,
|
|
152
|
+
): Promise<NodeGetAllResponse> | Observable<NodeGetAllResponse> | NodeGetAllResponse;
|
|
153
|
+
|
|
154
|
+
getByIdNode(
|
|
155
|
+
request: NodeGetByIdRequest,
|
|
156
|
+
metadata?: Metadata,
|
|
157
|
+
): Promise<NodeGetByIdResponse> | Observable<NodeGetByIdResponse> | NodeGetByIdResponse;
|
|
158
|
+
|
|
159
|
+
updateNode(
|
|
160
|
+
request: NodeUpdateRequest,
|
|
161
|
+
metadata?: Metadata,
|
|
162
|
+
): Promise<NodeResponse> | Observable<NodeResponse> | NodeResponse;
|
|
163
|
+
|
|
164
|
+
deleteNode(request: NodeDeleteRequest, metadata?: Metadata): void;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function WorkflowServiceControllerMethods() {
|
|
168
|
+
return function (constructor: Function) {
|
|
169
|
+
const grpcMethods: string[] = [
|
|
170
|
+
"create",
|
|
171
|
+
"getAll",
|
|
172
|
+
"delete",
|
|
173
|
+
"update",
|
|
174
|
+
"createNode",
|
|
175
|
+
"getAllNode",
|
|
176
|
+
"getByIdNode",
|
|
177
|
+
"updateNode",
|
|
178
|
+
"deleteNode",
|
|
179
|
+
];
|
|
180
|
+
for (const method of grpcMethods) {
|
|
181
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
182
|
+
GrpcMethod("WorkflowService", method)(constructor.prototype[method], method, descriptor);
|
|
183
|
+
}
|
|
184
|
+
const grpcStreamMethods: string[] = [];
|
|
185
|
+
for (const method of grpcStreamMethods) {
|
|
186
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
187
|
+
GrpcStreamMethod("WorkflowService", method)(constructor.prototype[method], method, descriptor);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export const WORKFLOW_SERVICE_NAME = "WorkflowService";
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v1.181.2
|
|
4
|
-
// protoc v3.21.5
|
|
5
|
-
// source: google/protobuf/timestamp.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
|
|
9
|
-
export const protobufPackage = "google.protobuf";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* A Timestamp represents a point in time independent of any time zone or local
|
|
13
|
-
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
14
|
-
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
|
15
|
-
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
|
16
|
-
* Gregorian calendar backwards to year one.
|
|
17
|
-
*
|
|
18
|
-
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
|
19
|
-
* second table is needed for interpretation, using a [24-hour linear
|
|
20
|
-
* smear](https://developers.google.com/time/smear).
|
|
21
|
-
*
|
|
22
|
-
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
|
23
|
-
* restricting to that range, we ensure that we can convert to and from [RFC
|
|
24
|
-
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
|
25
|
-
*
|
|
26
|
-
* # Examples
|
|
27
|
-
*
|
|
28
|
-
* Example 1: Compute Timestamp from POSIX `time()`.
|
|
29
|
-
*
|
|
30
|
-
* Timestamp timestamp;
|
|
31
|
-
* timestamp.set_seconds(time(NULL));
|
|
32
|
-
* timestamp.set_nanos(0);
|
|
33
|
-
*
|
|
34
|
-
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
35
|
-
*
|
|
36
|
-
* struct timeval tv;
|
|
37
|
-
* gettimeofday(&tv, NULL);
|
|
38
|
-
*
|
|
39
|
-
* Timestamp timestamp;
|
|
40
|
-
* timestamp.set_seconds(tv.tv_sec);
|
|
41
|
-
* timestamp.set_nanos(tv.tv_usec * 1000);
|
|
42
|
-
*
|
|
43
|
-
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
44
|
-
*
|
|
45
|
-
* FILETIME ft;
|
|
46
|
-
* GetSystemTimeAsFileTime(&ft);
|
|
47
|
-
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
48
|
-
*
|
|
49
|
-
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
50
|
-
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
51
|
-
* Timestamp timestamp;
|
|
52
|
-
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
53
|
-
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
54
|
-
*
|
|
55
|
-
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
56
|
-
*
|
|
57
|
-
* long millis = System.currentTimeMillis();
|
|
58
|
-
*
|
|
59
|
-
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
60
|
-
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
61
|
-
*
|
|
62
|
-
* Example 5: Compute Timestamp from Java `Instant.now()`.
|
|
63
|
-
*
|
|
64
|
-
* Instant now = Instant.now();
|
|
65
|
-
*
|
|
66
|
-
* Timestamp timestamp =
|
|
67
|
-
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
|
68
|
-
* .setNanos(now.getNano()).build();
|
|
69
|
-
*
|
|
70
|
-
* Example 6: Compute Timestamp from current time in Python.
|
|
71
|
-
*
|
|
72
|
-
* timestamp = Timestamp()
|
|
73
|
-
* timestamp.GetCurrentTime()
|
|
74
|
-
*
|
|
75
|
-
* # JSON Mapping
|
|
76
|
-
*
|
|
77
|
-
* In JSON format, the Timestamp type is encoded as a string in the
|
|
78
|
-
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
|
79
|
-
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
|
80
|
-
* where {year} is always expressed using four digits while {month}, {day},
|
|
81
|
-
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
82
|
-
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
83
|
-
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
84
|
-
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
|
85
|
-
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
86
|
-
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
87
|
-
*
|
|
88
|
-
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
89
|
-
* 01:30 UTC on January 15, 2017.
|
|
90
|
-
*
|
|
91
|
-
* In JavaScript, one can convert a Date object to this format using the
|
|
92
|
-
* standard
|
|
93
|
-
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
94
|
-
* method. In Python, a standard `datetime.datetime` object can be converted
|
|
95
|
-
* to this format using
|
|
96
|
-
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
97
|
-
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
98
|
-
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
99
|
-
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
|
100
|
-
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
101
|
-
*/
|
|
102
|
-
export interface Timestamp {
|
|
103
|
-
/**
|
|
104
|
-
* Represents seconds of UTC time since Unix epoch
|
|
105
|
-
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
|
106
|
-
* 9999-12-31T23:59:59Z inclusive.
|
|
107
|
-
*/
|
|
108
|
-
seconds: string;
|
|
109
|
-
/**
|
|
110
|
-
* Non-negative fractions of a second at nanosecond resolution. Negative
|
|
111
|
-
* second values with fractions must still have non-negative nanos values
|
|
112
|
-
* that count forward in time. Must be from 0 to 999,999,999
|
|
113
|
-
* inclusive.
|
|
114
|
-
*/
|
|
115
|
-
nanos: number;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|