@wenlarge/communication 1.1.5 → 1.1.7

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.
@@ -148,6 +148,31 @@ export interface UpdateWorkflowStatusRequest {
148
148
  workflowId: string;
149
149
  status: WorkflowStatus;
150
150
  }
151
+ export interface GetNodeExecutionLogRequest {
152
+ nodeId: string;
153
+ workflowId: string;
154
+ }
155
+ export interface GetExecutionLogResponse {
156
+ logs: ExecutionLogEntry[];
157
+ }
158
+ export interface GetWorkflowExecutionLogRequest {
159
+ workflowId: string;
160
+ }
161
+ export interface ExecutionLogEntry {
162
+ nodeId: string;
163
+ status: string;
164
+ inputSchema?: {
165
+ [key: string]: any;
166
+ } | undefined;
167
+ outputSchema?: {
168
+ [key: string]: any;
169
+ } | undefined;
170
+ config?: {
171
+ [key: string]: any;
172
+ } | undefined;
173
+ startedAt: string;
174
+ finishedAt: string;
175
+ }
151
176
  export declare const WORKFLOW_PACKAGE_NAME = "workflow";
152
177
  export interface WorkflowServiceClient {
153
178
  create(request: CreateWorkflowRequest, metadata?: Metadata): Observable<WorkflowResponse>;
@@ -165,6 +190,8 @@ export interface WorkflowServiceClient {
165
190
  findWorkflowNodeTypes(request: Empty, metadata?: Metadata): Observable<FindManyWorkflowNodeTypeResponse>;
166
191
  findConnections(request: FindConnectionsRequest, metadata?: Metadata): Observable<FindConnectionsResponse>;
167
192
  updateWorkflowStatus(request: UpdateWorkflowStatusRequest, metadata?: Metadata): Observable<Empty>;
193
+ getNodeExecutionLog(request: GetNodeExecutionLogRequest, metadata?: Metadata): Observable<GetExecutionLogResponse>;
194
+ getWorkflowExecutionLog(request: GetWorkflowExecutionLogRequest, metadata?: Metadata): Observable<GetExecutionLogResponse>;
168
195
  }
169
196
  export interface WorkflowServiceController {
170
197
  create(request: CreateWorkflowRequest, metadata?: Metadata): Promise<WorkflowResponse> | Observable<WorkflowResponse> | WorkflowResponse;
@@ -182,6 +209,8 @@ export interface WorkflowServiceController {
182
209
  findWorkflowNodeTypes(request: Empty, metadata?: Metadata): Promise<FindManyWorkflowNodeTypeResponse> | Observable<FindManyWorkflowNodeTypeResponse> | FindManyWorkflowNodeTypeResponse;
183
210
  findConnections(request: FindConnectionsRequest, metadata?: Metadata): Promise<FindConnectionsResponse> | Observable<FindConnectionsResponse> | FindConnectionsResponse;
184
211
  updateWorkflowStatus(request: UpdateWorkflowStatusRequest, metadata?: Metadata): void;
212
+ getNodeExecutionLog(request: GetNodeExecutionLogRequest, metadata?: Metadata): Promise<GetExecutionLogResponse> | Observable<GetExecutionLogResponse> | GetExecutionLogResponse;
213
+ getWorkflowExecutionLog(request: GetWorkflowExecutionLogRequest, metadata?: Metadata): Promise<GetExecutionLogResponse> | Observable<GetExecutionLogResponse> | GetExecutionLogResponse;
185
214
  }
186
215
  export declare function WorkflowServiceControllerMethods(): (constructor: Function) => void;
187
216
  export declare const WORKFLOW_SERVICE_NAME = "WorkflowService";
@@ -37,6 +37,8 @@ function WorkflowServiceControllerMethods() {
37
37
  "findWorkflowNodeTypes",
38
38
  "findConnections",
39
39
  "updateWorkflowStatus",
40
+ "getNodeExecutionLog",
41
+ "getWorkflowExecutionLog",
40
42
  ];
41
43
  for (const method of grpcMethods) {
42
44
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -1,9 +1,11 @@
1
1
  import { DynamicModule } from "@nestjs/common";
2
+ export declare const EXECUTOR_HTTP_GRPC_CLIENT = "EXECUTOR_HTTP_GRPC_CLIENT";
2
3
  export interface GrpcClientModuleOptions {
3
4
  authServiceUrl: string;
4
5
  projectServiceUrl: string;
5
6
  workflowServiceUrl: string;
6
7
  executorCoreServiceUrl: string;
8
+ executorHttpServiceUrl: string;
7
9
  }
8
10
  export declare class GrpcClientModule {
9
11
  static forRoot(options: GrpcClientModuleOptions): DynamicModule;
@@ -38,7 +38,7 @@ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, p
38
38
  return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
39
39
  };
40
40
  Object.defineProperty(exports, "__esModule", { value: true });
41
- exports.GrpcClientModule = void 0;
41
+ exports.GrpcClientModule = exports.EXECUTOR_HTTP_GRPC_CLIENT = void 0;
42
42
  const common_1 = require("@nestjs/common");
43
43
  const microservices_1 = require("@nestjs/microservices");
44
44
  const path_1 = require("path");
@@ -50,6 +50,7 @@ const workflow_1 = require("../generated/workflow");
50
50
  const workflow_config_1 = require("../config/workflow-config");
51
51
  const executor_core_1 = require("../generated/executor-core");
52
52
  const executor_core_config_1 = require("../config/executor-core-config");
53
+ exports.EXECUTOR_HTTP_GRPC_CLIENT = "EXECUTOR_HTTP_GRPC_CLIENT";
53
54
  let GrpcClientModule = (() => {
54
55
  let _classDecorators = [(0, common_1.Module)({})];
55
56
  let _classDescriptor;
@@ -57,6 +58,7 @@ let GrpcClientModule = (() => {
57
58
  let _classThis;
58
59
  var GrpcClientModule = _classThis = class {
59
60
  static forRoot(options) {
61
+ var _a;
60
62
  return {
61
63
  module: GrpcClientModule,
62
64
  global: true,
@@ -126,6 +128,22 @@ let GrpcClientModule = (() => {
126
128
  },
127
129
  },
128
130
  },
131
+ {
132
+ name: exports.EXECUTOR_HTTP_GRPC_CLIENT,
133
+ transport: microservices_1.Transport.GRPC,
134
+ options: {
135
+ package: executor_core_1.EXECUTOR_CORE_PACKAGE_NAME,
136
+ protoPath: executor_core_config_1.EXECUTOR_CORE_PROTO_PATH.map((p) => (0, path_1.join)(__dirname, "../../" + p)),
137
+ url: (_a = options.executorHttpServiceUrl) !== null && _a !== void 0 ? _a : options.executorCoreServiceUrl,
138
+ loader: {
139
+ keepCase: true,
140
+ longs: String,
141
+ enums: String,
142
+ defaults: true,
143
+ oneofs: true,
144
+ },
145
+ },
146
+ },
129
147
  ]),
130
148
  ],
131
149
  exports: [microservices_1.ClientsModule],
@@ -1 +1,2 @@
1
1
  export declare function unwrapStruct(fields: Record<string, any>): Record<string, any>;
2
+ export declare function wrapStruct(obj: any): any;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.unwrapStruct = unwrapStruct;
4
+ exports.wrapStruct = wrapStruct;
5
+ const struct_1 = require("../generated/google/protobuf/struct");
4
6
  function unwrapStruct(fields) {
5
7
  var _a, _b;
6
8
  const result = {};
@@ -21,3 +23,8 @@ function unwrapStruct(fields) {
21
23
  }
22
24
  return result;
23
25
  }
26
+ function wrapStruct(obj) {
27
+ if (!obj)
28
+ return undefined;
29
+ return struct_1.Struct.wrap(obj);
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenlarge/communication",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
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",
@@ -16,4 +16,5 @@ message ExecuteNodeResponse {
16
16
 
17
17
  service CoreExecutionService {
18
18
  rpc ExecuteNode (ExecuteNodeRequest) returns (ExecuteNodeResponse);
19
+
19
20
  }
@@ -21,6 +21,8 @@ service WorkflowService {
21
21
  rpc FindWorkflowNodeTypes (google.protobuf.Empty) returns (FindManyWorkflowNodeTypeResponse);
22
22
  rpc FindConnections (FindConnectionsRequest) returns (FindConnectionsResponse);
23
23
  rpc UpdateWorkflowStatus (UpdateWorkflowStatusRequest) returns (google.protobuf.Empty);
24
+ rpc GetNodeExecutionLog(GetNodeExecutionLogRequest) returns (GetExecutionLogResponse);
25
+ rpc GetWorkflowExecutionLog(GetWorkflowExecutionLogRequest) returns (GetExecutionLogResponse);
24
26
  }
25
27
 
26
28
  message CreateWorkflowRequest {
@@ -171,4 +173,27 @@ enum WorkflowStatus {
171
173
  message UpdateWorkflowStatusRequest {
172
174
  string workflowId = 1;
173
175
  WorkflowStatus status = 2;
176
+ }
177
+
178
+ message GetNodeExecutionLogRequest {
179
+ string nodeId = 1;
180
+ string workflowId =2;
181
+ }
182
+
183
+ message GetExecutionLogResponse {
184
+ repeated ExecutionLogEntry logs = 1;
185
+ }
186
+
187
+ message GetWorkflowExecutionLogRequest{
188
+ string workflowId = 1;
189
+ }
190
+
191
+ message ExecutionLogEntry {
192
+ string nodeId = 1;
193
+ string status = 2;
194
+ google.protobuf.Struct inputSchema = 3;
195
+ google.protobuf.Struct outputSchema = 4;
196
+ google.protobuf.Struct config = 5;
197
+ string startedAt = 6;
198
+ string finishedAt = 7;
174
199
  }
@@ -165,6 +165,29 @@ export interface UpdateWorkflowStatusRequest {
165
165
  status: WorkflowStatus;
166
166
  }
167
167
 
168
+ export interface GetNodeExecutionLogRequest {
169
+ nodeId: string;
170
+ workflowId: string;
171
+ }
172
+
173
+ export interface GetExecutionLogResponse {
174
+ logs: ExecutionLogEntry[];
175
+ }
176
+
177
+ export interface GetWorkflowExecutionLogRequest {
178
+ workflowId: string;
179
+ }
180
+
181
+ export interface ExecutionLogEntry {
182
+ nodeId: string;
183
+ status: string;
184
+ inputSchema?: { [key: string]: any } | undefined;
185
+ outputSchema?: { [key: string]: any } | undefined;
186
+ config?: { [key: string]: any } | undefined;
187
+ startedAt: string;
188
+ finishedAt: string;
189
+ }
190
+
168
191
  export const WORKFLOW_PACKAGE_NAME = "workflow";
169
192
 
170
193
  wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
@@ -205,6 +228,13 @@ export interface WorkflowServiceClient {
205
228
  findConnections(request: FindConnectionsRequest, metadata?: Metadata): Observable<FindConnectionsResponse>;
206
229
 
207
230
  updateWorkflowStatus(request: UpdateWorkflowStatusRequest, metadata?: Metadata): Observable<Empty>;
231
+
232
+ getNodeExecutionLog(request: GetNodeExecutionLogRequest, metadata?: Metadata): Observable<GetExecutionLogResponse>;
233
+
234
+ getWorkflowExecutionLog(
235
+ request: GetWorkflowExecutionLogRequest,
236
+ metadata?: Metadata,
237
+ ): Observable<GetExecutionLogResponse>;
208
238
  }
209
239
 
210
240
  export interface WorkflowServiceController {
@@ -267,6 +297,16 @@ export interface WorkflowServiceController {
267
297
  ): Promise<FindConnectionsResponse> | Observable<FindConnectionsResponse> | FindConnectionsResponse;
268
298
 
269
299
  updateWorkflowStatus(request: UpdateWorkflowStatusRequest, metadata?: Metadata): void;
300
+
301
+ getNodeExecutionLog(
302
+ request: GetNodeExecutionLogRequest,
303
+ metadata?: Metadata,
304
+ ): Promise<GetExecutionLogResponse> | Observable<GetExecutionLogResponse> | GetExecutionLogResponse;
305
+
306
+ getWorkflowExecutionLog(
307
+ request: GetWorkflowExecutionLogRequest,
308
+ metadata?: Metadata,
309
+ ): Promise<GetExecutionLogResponse> | Observable<GetExecutionLogResponse> | GetExecutionLogResponse;
270
310
  }
271
311
 
272
312
  export function WorkflowServiceControllerMethods() {
@@ -287,6 +327,8 @@ export function WorkflowServiceControllerMethods() {
287
327
  "findWorkflowNodeTypes",
288
328
  "findConnections",
289
329
  "updateWorkflowStatus",
330
+ "getNodeExecutionLog",
331
+ "getWorkflowExecutionLog",
290
332
  ];
291
333
  for (const method of grpcMethods) {
292
334
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);