@wenlarge/communication 1.1.3 → 1.1.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.
- package/dist/generated/auth.d.ts +21 -0
- package/dist/generated/auth.js +10 -2
- package/dist/generated/executor-core.d.ts +7 -3
- package/dist/generated/executor-core.js +4 -1
- package/dist/generated/google/protobuf/empty.js +1 -1
- package/dist/generated/google/protobuf/struct.d.ts +82 -0
- package/dist/generated/google/protobuf/struct.js +117 -0
- package/dist/generated/project.js +1 -1
- package/dist/generated/workflow.d.ts +71 -18
- package/dist/generated/workflow.js +16 -3
- package/dist/helpers/structToJson.d.ts +1 -0
- package/dist/helpers/structToJson.js +23 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -1
- package/package.json +1 -1
- package/proto/auth.proto +23 -0
- package/proto/executor-core.proto +4 -3
- package/proto/workflow.proto +52 -16
- package/src/generated/auth.ts +42 -2
- package/src/generated/executor-core.ts +8 -4
- package/src/generated/google/protobuf/empty.ts +1 -1
- package/src/generated/google/protobuf/struct.ts +179 -0
- package/src/generated/project.ts +1 -1
- package/src/generated/workflow.ts +84 -23
- package/dist/kafka/execution.types.d.ts +0 -23
- package/dist/kafka/execution.types.js +0 -2
package/proto/workflow.proto
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
syntax = "proto3";
|
|
2
2
|
|
|
3
3
|
import "google/protobuf/empty.proto";
|
|
4
|
+
import "google/protobuf/struct.proto";
|
|
4
5
|
|
|
5
6
|
package workflow;
|
|
6
7
|
|
|
@@ -9,13 +10,17 @@ service WorkflowService {
|
|
|
9
10
|
rpc FindMany (FindManyWorkflowRequest) returns (FindManyWorkflowResponse);
|
|
10
11
|
rpc Delete (DeleteWorkflowRequest) returns (google.protobuf.Empty);
|
|
11
12
|
rpc Update (UpdateWorkflowRequest) returns (WorkflowResponse);
|
|
12
|
-
rpc TriggerWorkflow (
|
|
13
|
+
rpc TriggerWorkflow (TriggerWorkflowRequest) returns (google.protobuf.Empty);
|
|
14
|
+
rpc TriggerNode (TriggerNodeRequest) returns (google.protobuf.Empty);
|
|
13
15
|
rpc CreateWorkflowNode (CreateWorkflowNodeRequest) returns (WorkflowNodeResponse);
|
|
14
16
|
rpc FindManyWorkflowNode (FindManyWorkflowNodeRequest) returns (FindManyWorkflowNodeResponse);
|
|
15
17
|
rpc FindFirstWorkflowNode (FindFirstWorkflowNodeRequest) returns (FindFirstWorkflowNodeResponse);
|
|
16
18
|
rpc UpdateWorkflowNode (UpdateWorkflowNodeRequest) returns (WorkflowNodeResponse);
|
|
17
19
|
rpc DeleteWorkflowNode (DeleteWorkflowNodeRequest) returns (google.protobuf.Empty);
|
|
18
|
-
rpc
|
|
20
|
+
rpc SaveWorkflowBatch (SaveWorkflowBatchRequest) returns (google.protobuf.Empty);
|
|
21
|
+
rpc FindWorkflowNodeTypes (google.protobuf.Empty) returns (FindManyWorkflowNodeTypeResponse);
|
|
22
|
+
rpc FindConnections (FindConnectionsRequest) returns (FindConnectionsResponse);
|
|
23
|
+
rpc UpdateWorkflowStatus (UpdateWorkflowStatusRequest) returns (google.protobuf.Empty);
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
message CreateWorkflowRequest {
|
|
@@ -52,22 +57,23 @@ message FindManyWorkflowResponse{
|
|
|
52
57
|
int32 total = 2;
|
|
53
58
|
}
|
|
54
59
|
|
|
55
|
-
message
|
|
56
|
-
string
|
|
60
|
+
message TriggerWorkflowRequest{
|
|
61
|
+
string workflowId = 1;
|
|
57
62
|
}
|
|
58
63
|
|
|
59
|
-
message
|
|
60
|
-
|
|
64
|
+
message TriggerNodeRequest{
|
|
65
|
+
string nodeId = 1;
|
|
61
66
|
}
|
|
62
67
|
|
|
68
|
+
|
|
63
69
|
message CreateWorkflowNodeRequest{
|
|
64
70
|
string workflowId = 1;
|
|
65
71
|
string name = 2;
|
|
66
72
|
int32 positionX = 3;
|
|
67
73
|
int32 positionY = 4;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
google.protobuf.Struct inputSchema = 5;
|
|
75
|
+
google.protobuf.Struct outputSchema = 6;
|
|
76
|
+
google.protobuf.Struct config = 7;
|
|
71
77
|
string nodeTypeId = 8;
|
|
72
78
|
}
|
|
73
79
|
|
|
@@ -77,9 +83,9 @@ message UpdateWorkflowNodeRequest{
|
|
|
77
83
|
string nodeTypeId = 3;
|
|
78
84
|
int32 positionX = 4;
|
|
79
85
|
int32 positionY=5;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
google.protobuf.Struct inputSchema = 6;
|
|
87
|
+
google.protobuf.Struct outputSchema = 7;
|
|
88
|
+
google.protobuf.Struct config = 8;
|
|
83
89
|
string workflowId = 9;
|
|
84
90
|
}
|
|
85
91
|
|
|
@@ -111,9 +117,9 @@ message WorkflowNodeResponse{
|
|
|
111
117
|
string nodeTypeId = 3;
|
|
112
118
|
int32 positionX = 4;
|
|
113
119
|
int32 positionY = 5;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
120
|
+
google.protobuf.Struct inputSchema = 6;
|
|
121
|
+
google.protobuf.Struct outputSchema = 7;
|
|
122
|
+
google.protobuf.Struct config = 8;
|
|
117
123
|
string createdAt = 9;
|
|
118
124
|
string updatedAt = 10;
|
|
119
125
|
string workflowId = 11;
|
|
@@ -126,7 +132,7 @@ message WorkflowNodeConnection {
|
|
|
126
132
|
string toNodeId = 4;
|
|
127
133
|
}
|
|
128
134
|
|
|
129
|
-
message
|
|
135
|
+
message SaveWorkflowBatchRequest {
|
|
130
136
|
string workflowId = 1;
|
|
131
137
|
repeated UpdateWorkflowNodeRequest nodes = 2;
|
|
132
138
|
repeated UpdateBatchConnection connections = 3;
|
|
@@ -135,4 +141,34 @@ message UpdateBatchWorkflowRequest {
|
|
|
135
141
|
message UpdateBatchConnection {
|
|
136
142
|
string fromNodeId = 1;
|
|
137
143
|
string toNodeId = 2;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
message WorkflowNodeTypeResponse {
|
|
147
|
+
string id = 1;
|
|
148
|
+
string label = 2;
|
|
149
|
+
string description = 3;
|
|
150
|
+
string service = 4;
|
|
151
|
+
google.protobuf.Struct form = 5;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
message FindManyWorkflowNodeTypeResponse {
|
|
155
|
+
repeated WorkflowNodeTypeResponse data = 1;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
message FindConnectionsRequest {
|
|
159
|
+
string workflowId = 1;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
message FindConnectionsResponse {
|
|
163
|
+
repeated WorkflowNodeConnection data = 1;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
enum WorkflowStatus {
|
|
167
|
+
DRAFT = 0;
|
|
168
|
+
PUBLISHED = 1;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
message UpdateWorkflowStatusRequest {
|
|
172
|
+
string workflowId = 1;
|
|
173
|
+
WorkflowStatus status = 2;
|
|
138
174
|
}
|
package/src/generated/auth.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
3
|
// protoc-gen-ts_proto v1.181.2
|
|
4
|
-
// protoc
|
|
4
|
+
// protoc v7.34.0
|
|
5
5
|
// source: auth.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
@@ -74,6 +74,27 @@ export interface GetMeResponse {
|
|
|
74
74
|
companyUsersOnUser: CompanyUser[];
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
export interface GetCompanyUsersRequest {
|
|
78
|
+
companyId: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface CompanyUserDetail {
|
|
82
|
+
userId: string;
|
|
83
|
+
userName: string;
|
|
84
|
+
userEmail: string;
|
|
85
|
+
joinedAt: string;
|
|
86
|
+
isOwner: boolean;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface GetCompanyUsersResponse {
|
|
90
|
+
users: CompanyUserDetail[];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface RemoveUserFromCompanyRequest {
|
|
94
|
+
companyId: string;
|
|
95
|
+
userId: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
77
98
|
export const AUTH_PACKAGE_NAME = "auth";
|
|
78
99
|
|
|
79
100
|
export interface AuthServiceClient {
|
|
@@ -86,6 +107,10 @@ export interface AuthServiceClient {
|
|
|
86
107
|
inviteToCompany(request: InviteToCompanyRequest, metadata?: Metadata): Observable<InviteToCompanyResponse>;
|
|
87
108
|
|
|
88
109
|
updateInviteStatus(request: UpdateInviteStatusRequest, metadata?: Metadata): Observable<UpdateInviteStatusResponse>;
|
|
110
|
+
|
|
111
|
+
getCompanyUsers(request: GetCompanyUsersRequest, metadata?: Metadata): Observable<GetCompanyUsersResponse>;
|
|
112
|
+
|
|
113
|
+
removeUserFromCompany(request: RemoveUserFromCompanyRequest, metadata?: Metadata): Observable<Empty>;
|
|
89
114
|
}
|
|
90
115
|
|
|
91
116
|
export interface AuthServiceController {
|
|
@@ -104,11 +129,26 @@ export interface AuthServiceController {
|
|
|
104
129
|
request: UpdateInviteStatusRequest,
|
|
105
130
|
metadata?: Metadata,
|
|
106
131
|
): Promise<UpdateInviteStatusResponse> | Observable<UpdateInviteStatusResponse> | UpdateInviteStatusResponse;
|
|
132
|
+
|
|
133
|
+
getCompanyUsers(
|
|
134
|
+
request: GetCompanyUsersRequest,
|
|
135
|
+
metadata?: Metadata,
|
|
136
|
+
): Promise<GetCompanyUsersResponse> | Observable<GetCompanyUsersResponse> | GetCompanyUsersResponse;
|
|
137
|
+
|
|
138
|
+
removeUserFromCompany(request: RemoveUserFromCompanyRequest, metadata?: Metadata): void;
|
|
107
139
|
}
|
|
108
140
|
|
|
109
141
|
export function AuthServiceControllerMethods() {
|
|
110
142
|
return function (constructor: Function) {
|
|
111
|
-
const grpcMethods: string[] = [
|
|
143
|
+
const grpcMethods: string[] = [
|
|
144
|
+
"login",
|
|
145
|
+
"register",
|
|
146
|
+
"getMe",
|
|
147
|
+
"inviteToCompany",
|
|
148
|
+
"updateInviteStatus",
|
|
149
|
+
"getCompanyUsers",
|
|
150
|
+
"removeUserFromCompany",
|
|
151
|
+
];
|
|
112
152
|
for (const method of grpcMethods) {
|
|
113
153
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
114
154
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
3
|
// protoc-gen-ts_proto v1.181.2
|
|
4
|
-
// protoc
|
|
4
|
+
// protoc v7.34.0
|
|
5
5
|
// source: executor-core.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { Metadata } from "@grpc/grpc-js";
|
|
9
9
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
10
|
+
import { wrappers } from "protobufjs";
|
|
10
11
|
import { Observable } from "rxjs";
|
|
12
|
+
import { Struct } from "./google/protobuf/struct";
|
|
11
13
|
|
|
12
14
|
export const protobufPackage = "executor_core";
|
|
13
15
|
|
|
14
16
|
export interface ExecuteNodeRequest {
|
|
15
17
|
nodeTypeId: string;
|
|
16
18
|
nodeId: string;
|
|
17
|
-
config: string;
|
|
18
|
-
inputSchema: string;
|
|
19
|
+
config?: { [key: string]: any } | undefined;
|
|
20
|
+
inputSchema?: { [key: string]: any } | undefined;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
export interface ExecuteNodeResponse {
|
|
22
|
-
|
|
24
|
+
output: string;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export const EXECUTOR_CORE_PACKAGE_NAME = "executor_core";
|
|
26
28
|
|
|
29
|
+
wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
|
|
30
|
+
|
|
27
31
|
export interface CoreExecutionServiceClient {
|
|
28
32
|
executeNode(request: ExecuteNodeRequest, metadata?: Metadata): Observable<ExecuteNodeResponse>;
|
|
29
33
|
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v1.181.2
|
|
4
|
+
// protoc v7.34.0
|
|
5
|
+
// source: google/protobuf/struct.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { wrappers } from "protobufjs";
|
|
9
|
+
|
|
10
|
+
export const protobufPackage = "google.protobuf";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
14
|
+
* `Value` type union.
|
|
15
|
+
*
|
|
16
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
17
|
+
*/
|
|
18
|
+
export enum NullValue {
|
|
19
|
+
/** NULL_VALUE - Null value. */
|
|
20
|
+
NULL_VALUE = "NULL_VALUE",
|
|
21
|
+
UNRECOGNIZED = "UNRECOGNIZED",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* `Struct` represents a structured data value, consisting of fields
|
|
26
|
+
* which map to dynamically typed values. In some languages, `Struct`
|
|
27
|
+
* might be supported by a native representation. For example, in
|
|
28
|
+
* scripting languages like JS a struct is represented as an
|
|
29
|
+
* object. The details of that representation are described together
|
|
30
|
+
* with the proto support for the language.
|
|
31
|
+
*
|
|
32
|
+
* The JSON representation for `Struct` is JSON object.
|
|
33
|
+
*/
|
|
34
|
+
export interface Struct {
|
|
35
|
+
/** Unordered map of dynamically typed values. */
|
|
36
|
+
fields: { [key: string]: any | undefined };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface Struct_FieldsEntry {
|
|
40
|
+
key: string;
|
|
41
|
+
value?: any | undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* `Value` represents a dynamically typed value which can be either
|
|
46
|
+
* null, a number, a string, a boolean, a recursive struct value, or a
|
|
47
|
+
* list of values. A producer of value is expected to set one of these
|
|
48
|
+
* variants. Absence of any variant indicates an error.
|
|
49
|
+
*
|
|
50
|
+
* The JSON representation for `Value` is JSON value.
|
|
51
|
+
*/
|
|
52
|
+
export interface Value {
|
|
53
|
+
/** Represents a null value. */
|
|
54
|
+
nullValue?:
|
|
55
|
+
| NullValue
|
|
56
|
+
| undefined;
|
|
57
|
+
/** Represents a double value. */
|
|
58
|
+
numberValue?:
|
|
59
|
+
| number
|
|
60
|
+
| undefined;
|
|
61
|
+
/** Represents a string value. */
|
|
62
|
+
stringValue?:
|
|
63
|
+
| string
|
|
64
|
+
| undefined;
|
|
65
|
+
/** Represents a boolean value. */
|
|
66
|
+
boolValue?:
|
|
67
|
+
| boolean
|
|
68
|
+
| undefined;
|
|
69
|
+
/** Represents a structured value. */
|
|
70
|
+
structValue?:
|
|
71
|
+
| { [key: string]: any }
|
|
72
|
+
| undefined;
|
|
73
|
+
/** Represents a repeated `Value`. */
|
|
74
|
+
listValue?: Array<any> | undefined;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* `ListValue` is a wrapper around a repeated field of values.
|
|
79
|
+
*
|
|
80
|
+
* The JSON representation for `ListValue` is JSON array.
|
|
81
|
+
*/
|
|
82
|
+
export interface ListValue {
|
|
83
|
+
/** Repeated field of dynamically typed values. */
|
|
84
|
+
values: any[];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
88
|
+
|
|
89
|
+
function createBaseStruct(): Struct {
|
|
90
|
+
return { fields: {} };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export const Struct = {
|
|
94
|
+
wrap(object: { [key: string]: any } | undefined): Struct {
|
|
95
|
+
const struct = createBaseStruct();
|
|
96
|
+
|
|
97
|
+
if (object !== undefined) {
|
|
98
|
+
for (const key of Object.keys(object)) {
|
|
99
|
+
struct.fields[key] = Value.wrap(object[key]);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return struct;
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
unwrap(message: Struct): { [key: string]: any } {
|
|
106
|
+
const object: { [key: string]: any } = {};
|
|
107
|
+
if (message.fields) {
|
|
108
|
+
for (const key of Object.keys(message.fields)) {
|
|
109
|
+
object[key] = Value.unwrap(message.fields[key]);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return object;
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
function createBaseValue(): Value {
|
|
117
|
+
return {};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const Value = {
|
|
121
|
+
wrap(value: any): Value {
|
|
122
|
+
const result = {} as any;
|
|
123
|
+
if (value === null) {
|
|
124
|
+
result.nullValue = NullValue.NULL_VALUE;
|
|
125
|
+
} else if (typeof value === "boolean") {
|
|
126
|
+
result.boolValue = value;
|
|
127
|
+
} else if (typeof value === "number") {
|
|
128
|
+
result.numberValue = value;
|
|
129
|
+
} else if (typeof value === "string") {
|
|
130
|
+
result.stringValue = value;
|
|
131
|
+
} else if (globalThis.Array.isArray(value)) {
|
|
132
|
+
result.listValue = ListValue.wrap(value);
|
|
133
|
+
} else if (typeof value === "object") {
|
|
134
|
+
result.structValue = Struct.wrap(value);
|
|
135
|
+
} else if (typeof value !== "undefined") {
|
|
136
|
+
throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
|
137
|
+
}
|
|
138
|
+
return result;
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined {
|
|
142
|
+
if (message?.hasOwnProperty("stringValue") && message.stringValue !== undefined) {
|
|
143
|
+
return message.stringValue;
|
|
144
|
+
} else if (message?.hasOwnProperty("numberValue") && message?.numberValue !== undefined) {
|
|
145
|
+
return message.numberValue;
|
|
146
|
+
} else if (message?.hasOwnProperty("boolValue") && message?.boolValue !== undefined) {
|
|
147
|
+
return message.boolValue;
|
|
148
|
+
} else if (message?.hasOwnProperty("structValue") && message?.structValue !== undefined) {
|
|
149
|
+
return Struct.unwrap(message.structValue as any);
|
|
150
|
+
} else if (message?.hasOwnProperty("listValue") && message?.listValue !== undefined) {
|
|
151
|
+
return ListValue.unwrap(message.listValue);
|
|
152
|
+
} else if (message?.hasOwnProperty("nullValue") && message?.nullValue !== undefined) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
return undefined;
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
function createBaseListValue(): ListValue {
|
|
160
|
+
return { values: [] };
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export const ListValue = {
|
|
164
|
+
wrap(array: Array<any> | undefined): ListValue {
|
|
165
|
+
const result = createBaseListValue();
|
|
166
|
+
result.values = (array ?? []).map(Value.wrap);
|
|
167
|
+
return result;
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
unwrap(message: ListValue): Array<any> {
|
|
171
|
+
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
|
|
172
|
+
return message.values.map(Value.unwrap);
|
|
173
|
+
} else {
|
|
174
|
+
return message as any;
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
|
package/src/generated/project.ts
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
3
|
// protoc-gen-ts_proto v1.181.2
|
|
4
|
-
// protoc
|
|
4
|
+
// protoc v7.34.0
|
|
5
5
|
// source: workflow.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { Metadata } from "@grpc/grpc-js";
|
|
9
9
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
10
|
+
import { wrappers } from "protobufjs";
|
|
10
11
|
import { Observable } from "rxjs";
|
|
11
12
|
import { Empty } from "./google/protobuf/empty";
|
|
13
|
+
import { Struct } from "./google/protobuf/struct";
|
|
12
14
|
|
|
13
15
|
export const protobufPackage = "workflow";
|
|
14
16
|
|
|
17
|
+
export enum WorkflowStatus {
|
|
18
|
+
DRAFT = "DRAFT",
|
|
19
|
+
PUBLISHED = "PUBLISHED",
|
|
20
|
+
UNRECOGNIZED = "UNRECOGNIZED",
|
|
21
|
+
}
|
|
22
|
+
|
|
15
23
|
export interface CreateWorkflowRequest {
|
|
16
24
|
name: string;
|
|
17
25
|
projectId: string;
|
|
@@ -46,12 +54,12 @@ export interface FindManyWorkflowResponse {
|
|
|
46
54
|
total: number;
|
|
47
55
|
}
|
|
48
56
|
|
|
49
|
-
export interface
|
|
50
|
-
|
|
57
|
+
export interface TriggerWorkflowRequest {
|
|
58
|
+
workflowId: string;
|
|
51
59
|
}
|
|
52
60
|
|
|
53
|
-
export interface
|
|
54
|
-
|
|
61
|
+
export interface TriggerNodeRequest {
|
|
62
|
+
nodeId: string;
|
|
55
63
|
}
|
|
56
64
|
|
|
57
65
|
export interface CreateWorkflowNodeRequest {
|
|
@@ -59,9 +67,9 @@ export interface CreateWorkflowNodeRequest {
|
|
|
59
67
|
name: string;
|
|
60
68
|
positionX: number;
|
|
61
69
|
positionY: number;
|
|
62
|
-
inputSchema: string;
|
|
63
|
-
outputSchema: string;
|
|
64
|
-
config: string;
|
|
70
|
+
inputSchema?: { [key: string]: any } | undefined;
|
|
71
|
+
outputSchema?: { [key: string]: any } | undefined;
|
|
72
|
+
config?: { [key: string]: any } | undefined;
|
|
65
73
|
nodeTypeId: string;
|
|
66
74
|
}
|
|
67
75
|
|
|
@@ -71,9 +79,9 @@ export interface UpdateWorkflowNodeRequest {
|
|
|
71
79
|
nodeTypeId: string;
|
|
72
80
|
positionX: number;
|
|
73
81
|
positionY: number;
|
|
74
|
-
inputSchema: string;
|
|
75
|
-
outputSchema: string;
|
|
76
|
-
config: string;
|
|
82
|
+
inputSchema?: { [key: string]: any } | undefined;
|
|
83
|
+
outputSchema?: { [key: string]: any } | undefined;
|
|
84
|
+
config?: { [key: string]: any } | undefined;
|
|
77
85
|
workflowId: string;
|
|
78
86
|
}
|
|
79
87
|
|
|
@@ -106,9 +114,9 @@ export interface WorkflowNodeResponse {
|
|
|
106
114
|
nodeTypeId: string;
|
|
107
115
|
positionX: number;
|
|
108
116
|
positionY: number;
|
|
109
|
-
inputSchema: string;
|
|
110
|
-
outputSchema: string;
|
|
111
|
-
config: string;
|
|
117
|
+
inputSchema?: { [key: string]: any } | undefined;
|
|
118
|
+
outputSchema?: { [key: string]: any } | undefined;
|
|
119
|
+
config?: { [key: string]: any } | undefined;
|
|
112
120
|
createdAt: string;
|
|
113
121
|
updatedAt: string;
|
|
114
122
|
workflowId: string;
|
|
@@ -121,7 +129,7 @@ export interface WorkflowNodeConnection {
|
|
|
121
129
|
toNodeId: string;
|
|
122
130
|
}
|
|
123
131
|
|
|
124
|
-
export interface
|
|
132
|
+
export interface SaveWorkflowBatchRequest {
|
|
125
133
|
workflowId: string;
|
|
126
134
|
nodes: UpdateWorkflowNodeRequest[];
|
|
127
135
|
connections: UpdateBatchConnection[];
|
|
@@ -132,8 +140,35 @@ export interface UpdateBatchConnection {
|
|
|
132
140
|
toNodeId: string;
|
|
133
141
|
}
|
|
134
142
|
|
|
143
|
+
export interface WorkflowNodeTypeResponse {
|
|
144
|
+
id: string;
|
|
145
|
+
label: string;
|
|
146
|
+
description: string;
|
|
147
|
+
service: string;
|
|
148
|
+
form?: { [key: string]: any } | undefined;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface FindManyWorkflowNodeTypeResponse {
|
|
152
|
+
data: WorkflowNodeTypeResponse[];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface FindConnectionsRequest {
|
|
156
|
+
workflowId: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface FindConnectionsResponse {
|
|
160
|
+
data: WorkflowNodeConnection[];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface UpdateWorkflowStatusRequest {
|
|
164
|
+
workflowId: string;
|
|
165
|
+
status: WorkflowStatus;
|
|
166
|
+
}
|
|
167
|
+
|
|
135
168
|
export const WORKFLOW_PACKAGE_NAME = "workflow";
|
|
136
169
|
|
|
170
|
+
wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
|
|
171
|
+
|
|
137
172
|
export interface WorkflowServiceClient {
|
|
138
173
|
create(request: CreateWorkflowRequest, metadata?: Metadata): Observable<WorkflowResponse>;
|
|
139
174
|
|
|
@@ -143,7 +178,9 @@ export interface WorkflowServiceClient {
|
|
|
143
178
|
|
|
144
179
|
update(request: UpdateWorkflowRequest, metadata?: Metadata): Observable<WorkflowResponse>;
|
|
145
180
|
|
|
146
|
-
triggerWorkflow(request:
|
|
181
|
+
triggerWorkflow(request: TriggerWorkflowRequest, metadata?: Metadata): Observable<Empty>;
|
|
182
|
+
|
|
183
|
+
triggerNode(request: TriggerNodeRequest, metadata?: Metadata): Observable<Empty>;
|
|
147
184
|
|
|
148
185
|
createWorkflowNode(request: CreateWorkflowNodeRequest, metadata?: Metadata): Observable<WorkflowNodeResponse>;
|
|
149
186
|
|
|
@@ -161,7 +198,13 @@ export interface WorkflowServiceClient {
|
|
|
161
198
|
|
|
162
199
|
deleteWorkflowNode(request: DeleteWorkflowNodeRequest, metadata?: Metadata): Observable<Empty>;
|
|
163
200
|
|
|
164
|
-
|
|
201
|
+
saveWorkflowBatch(request: SaveWorkflowBatchRequest, metadata?: Metadata): Observable<Empty>;
|
|
202
|
+
|
|
203
|
+
findWorkflowNodeTypes(request: Empty, metadata?: Metadata): Observable<FindManyWorkflowNodeTypeResponse>;
|
|
204
|
+
|
|
205
|
+
findConnections(request: FindConnectionsRequest, metadata?: Metadata): Observable<FindConnectionsResponse>;
|
|
206
|
+
|
|
207
|
+
updateWorkflowStatus(request: UpdateWorkflowStatusRequest, metadata?: Metadata): Observable<Empty>;
|
|
165
208
|
}
|
|
166
209
|
|
|
167
210
|
export interface WorkflowServiceController {
|
|
@@ -182,10 +225,9 @@ export interface WorkflowServiceController {
|
|
|
182
225
|
metadata?: Metadata,
|
|
183
226
|
): Promise<WorkflowResponse> | Observable<WorkflowResponse> | WorkflowResponse;
|
|
184
227
|
|
|
185
|
-
triggerWorkflow(
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
): Promise<TriggerExecutionResponse> | Observable<TriggerExecutionResponse> | TriggerExecutionResponse;
|
|
228
|
+
triggerWorkflow(request: TriggerWorkflowRequest, metadata?: Metadata): void;
|
|
229
|
+
|
|
230
|
+
triggerNode(request: TriggerNodeRequest, metadata?: Metadata): void;
|
|
189
231
|
|
|
190
232
|
createWorkflowNode(
|
|
191
233
|
request: CreateWorkflowNodeRequest,
|
|
@@ -209,7 +251,22 @@ export interface WorkflowServiceController {
|
|
|
209
251
|
|
|
210
252
|
deleteWorkflowNode(request: DeleteWorkflowNodeRequest, metadata?: Metadata): void;
|
|
211
253
|
|
|
212
|
-
|
|
254
|
+
saveWorkflowBatch(request: SaveWorkflowBatchRequest, metadata?: Metadata): void;
|
|
255
|
+
|
|
256
|
+
findWorkflowNodeTypes(
|
|
257
|
+
request: Empty,
|
|
258
|
+
metadata?: Metadata,
|
|
259
|
+
):
|
|
260
|
+
| Promise<FindManyWorkflowNodeTypeResponse>
|
|
261
|
+
| Observable<FindManyWorkflowNodeTypeResponse>
|
|
262
|
+
| FindManyWorkflowNodeTypeResponse;
|
|
263
|
+
|
|
264
|
+
findConnections(
|
|
265
|
+
request: FindConnectionsRequest,
|
|
266
|
+
metadata?: Metadata,
|
|
267
|
+
): Promise<FindConnectionsResponse> | Observable<FindConnectionsResponse> | FindConnectionsResponse;
|
|
268
|
+
|
|
269
|
+
updateWorkflowStatus(request: UpdateWorkflowStatusRequest, metadata?: Metadata): void;
|
|
213
270
|
}
|
|
214
271
|
|
|
215
272
|
export function WorkflowServiceControllerMethods() {
|
|
@@ -220,12 +277,16 @@ export function WorkflowServiceControllerMethods() {
|
|
|
220
277
|
"delete",
|
|
221
278
|
"update",
|
|
222
279
|
"triggerWorkflow",
|
|
280
|
+
"triggerNode",
|
|
223
281
|
"createWorkflowNode",
|
|
224
282
|
"findManyWorkflowNode",
|
|
225
283
|
"findFirstWorkflowNode",
|
|
226
284
|
"updateWorkflowNode",
|
|
227
285
|
"deleteWorkflowNode",
|
|
228
|
-
"
|
|
286
|
+
"saveWorkflowBatch",
|
|
287
|
+
"findWorkflowNodeTypes",
|
|
288
|
+
"findConnections",
|
|
289
|
+
"updateWorkflowStatus",
|
|
229
290
|
];
|
|
230
291
|
for (const method of grpcMethods) {
|
|
231
292
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export type TriggerExecutionPayload = {
|
|
2
|
-
nodeId: string;
|
|
3
|
-
};
|
|
4
|
-
export type ExecutionWaitingPayload = {
|
|
5
|
-
nodeId: string;
|
|
6
|
-
nodeTypeId: string;
|
|
7
|
-
workflowId: string;
|
|
8
|
-
config: string;
|
|
9
|
-
inputSchema: string;
|
|
10
|
-
triggeredAt: number;
|
|
11
|
-
};
|
|
12
|
-
export type ExecutionCompletedPayload = {
|
|
13
|
-
workflowId: string;
|
|
14
|
-
nodeId: string;
|
|
15
|
-
result: string;
|
|
16
|
-
finishedAt: number;
|
|
17
|
-
};
|
|
18
|
-
export type ExecutionFailedPayload = {
|
|
19
|
-
workflowId: string;
|
|
20
|
-
nodeId: string;
|
|
21
|
-
error: string;
|
|
22
|
-
failedAt: number;
|
|
23
|
-
};
|