@wenlarge/communication 1.2.4 → 1.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.
- package/dist/generated/project.d.ts +0 -3
- package/dist/generated/workflow.d.ts +6 -5
- package/dist/grpc-interceptors/grpc-struct.interceptor.d.ts +31 -0
- package/dist/grpc-interceptors/grpc-struct.interceptor.js +97 -0
- package/dist/helpers/struct-deep.d.ts +19 -0
- package/dist/helpers/struct-deep.js +88 -0
- package/package.json +51 -51
- package/proto/project.proto +0 -3
- package/proto/workflow.proto +6 -3
- package/src/generated/project.ts +0 -3
- package/src/generated/workflow.ts +6 -3
|
@@ -36,13 +36,11 @@ export interface FindFirstResponse {
|
|
|
36
36
|
export interface CreateEnvironmentRequest {
|
|
37
37
|
projectId: string;
|
|
38
38
|
name: string;
|
|
39
|
-
type: string;
|
|
40
39
|
variables: EnvironmentVariableInput[];
|
|
41
40
|
}
|
|
42
41
|
export interface UpdateEnvironmentRequest {
|
|
43
42
|
id: string;
|
|
44
43
|
name: string;
|
|
45
|
-
type: string;
|
|
46
44
|
variables: EnvironmentVariableInput[];
|
|
47
45
|
}
|
|
48
46
|
export interface DeleteEnvironmentRequest {
|
|
@@ -67,7 +65,6 @@ export interface EnvironmentResponse {
|
|
|
67
65
|
id: string;
|
|
68
66
|
projectId: string;
|
|
69
67
|
name: string;
|
|
70
|
-
type: string;
|
|
71
68
|
variables: EnvironmentVariableResponse[];
|
|
72
69
|
createdAt: string;
|
|
73
70
|
updatedAt: string;
|
|
@@ -10,6 +10,7 @@ export declare enum WorkflowStatus {
|
|
|
10
10
|
export interface CreateWorkflowRequest {
|
|
11
11
|
name: string;
|
|
12
12
|
projectId: string;
|
|
13
|
+
defaultEnvironmentId?: string | undefined;
|
|
13
14
|
}
|
|
14
15
|
export interface WorkflowResponse {
|
|
15
16
|
id: string;
|
|
@@ -19,6 +20,7 @@ export interface WorkflowResponse {
|
|
|
19
20
|
createdAt: string;
|
|
20
21
|
updatedAt: string;
|
|
21
22
|
status: WorkflowStatus;
|
|
23
|
+
defaultEnvironmentId?: string | undefined;
|
|
22
24
|
}
|
|
23
25
|
export interface DeleteWorkflowRequest {
|
|
24
26
|
id: string;
|
|
@@ -26,6 +28,7 @@ export interface DeleteWorkflowRequest {
|
|
|
26
28
|
export interface UpdateWorkflowRequest {
|
|
27
29
|
id: string;
|
|
28
30
|
name: string;
|
|
31
|
+
defaultEnvironmentId?: string | undefined;
|
|
29
32
|
}
|
|
30
33
|
export interface FindManyWorkflowRequest {
|
|
31
34
|
projectId: string;
|
|
@@ -41,7 +44,6 @@ export interface FindFirstWorkflowRequest {
|
|
|
41
44
|
}
|
|
42
45
|
export interface TriggerWorkflowRequest {
|
|
43
46
|
workflowId: string;
|
|
44
|
-
environmentId?: string | undefined;
|
|
45
47
|
}
|
|
46
48
|
export interface TriggerNodeRequest {
|
|
47
49
|
nodeId: string;
|
|
@@ -49,10 +51,6 @@ export interface TriggerNodeRequest {
|
|
|
49
51
|
inputSchema?: {
|
|
50
52
|
[key: string]: any;
|
|
51
53
|
} | undefined;
|
|
52
|
-
environmentId?: string | undefined;
|
|
53
|
-
env?: {
|
|
54
|
-
[key: string]: any;
|
|
55
|
-
} | undefined;
|
|
56
54
|
}
|
|
57
55
|
export interface WorkflowNodeRequest {
|
|
58
56
|
id: string;
|
|
@@ -68,6 +66,7 @@ export interface WorkflowNodeRequest {
|
|
|
68
66
|
[key: string]: any;
|
|
69
67
|
} | undefined;
|
|
70
68
|
nodeTypeId: string;
|
|
69
|
+
environmentId?: string | undefined;
|
|
71
70
|
}
|
|
72
71
|
export interface FindManyWorkflowNodeRequest {
|
|
73
72
|
workflowId: string;
|
|
@@ -91,6 +90,7 @@ export interface WorkflowNodeResponse {
|
|
|
91
90
|
} | undefined;
|
|
92
91
|
createdAt: string;
|
|
93
92
|
updatedAt: string;
|
|
93
|
+
environmentId?: string | undefined;
|
|
94
94
|
}
|
|
95
95
|
export interface WorkflowNodeConnection {
|
|
96
96
|
id: string;
|
|
@@ -106,6 +106,7 @@ export interface SaveWorkflowBatchRequest {
|
|
|
106
106
|
workflowName: string;
|
|
107
107
|
nodes: WorkflowNodeRequest[];
|
|
108
108
|
connections: UpdateBatchConnection[];
|
|
109
|
+
defaultEnvironmentId?: string | undefined;
|
|
109
110
|
}
|
|
110
111
|
export interface UpdateBatchConnection {
|
|
111
112
|
fromNodeId: string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CallHandler, ExecutionContext, NestInterceptor } from "@nestjs/common";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
export interface GrpcStructInterceptorOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Recursively unwrap `google.protobuf.Struct` in the incoming RPC payload (default: true).
|
|
6
|
+
*/
|
|
7
|
+
unwrapRequest?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Top-level response keys whose plain JSON values should be wrapped to Struct before serialization.
|
|
10
|
+
* Example: `['output']` for ExecuteNodeResponse.
|
|
11
|
+
*/
|
|
12
|
+
wrapResponsePaths?: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* gRPC RPC interceptor: unwrap Struct in requests, optionally wrap plain objects to Struct on responses.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* app.useGlobalInterceptors(
|
|
20
|
+
* new GrpcStructInterceptor({
|
|
21
|
+
* unwrapRequest: true,
|
|
22
|
+
* wrapResponsePaths: ['output'],
|
|
23
|
+
* }),
|
|
24
|
+
* );
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class GrpcStructInterceptor implements NestInterceptor {
|
|
28
|
+
private readonly options;
|
|
29
|
+
constructor(options?: GrpcStructInterceptorOptions);
|
|
30
|
+
intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.GrpcStructInterceptor = void 0;
|
|
42
|
+
const common_1 = require("@nestjs/common");
|
|
43
|
+
const operators_1 = require("rxjs/operators");
|
|
44
|
+
const struct_deep_1 = require("../helpers/struct-deep");
|
|
45
|
+
/**
|
|
46
|
+
* gRPC RPC interceptor: unwrap Struct in requests, optionally wrap plain objects to Struct on responses.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* app.useGlobalInterceptors(
|
|
51
|
+
* new GrpcStructInterceptor({
|
|
52
|
+
* unwrapRequest: true,
|
|
53
|
+
* wrapResponsePaths: ['output'],
|
|
54
|
+
* }),
|
|
55
|
+
* );
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
let GrpcStructInterceptor = (() => {
|
|
59
|
+
let _classDecorators = [(0, common_1.Injectable)()];
|
|
60
|
+
let _classDescriptor;
|
|
61
|
+
let _classExtraInitializers = [];
|
|
62
|
+
let _classThis;
|
|
63
|
+
var GrpcStructInterceptor = _classThis = class {
|
|
64
|
+
constructor(options = {}) {
|
|
65
|
+
this.options = options;
|
|
66
|
+
}
|
|
67
|
+
intercept(context, next) {
|
|
68
|
+
var _a;
|
|
69
|
+
if (context.getType() !== "rpc") {
|
|
70
|
+
return next.handle();
|
|
71
|
+
}
|
|
72
|
+
const args = context.getArgs();
|
|
73
|
+
if (this.options.unwrapRequest !== false && args[0] != null) {
|
|
74
|
+
args[0] = (0, struct_deep_1.deepUnwrapStructs)(args[0]);
|
|
75
|
+
}
|
|
76
|
+
const paths = (_a = this.options.wrapResponsePaths) !== null && _a !== void 0 ? _a : [];
|
|
77
|
+
if (paths.length === 0) {
|
|
78
|
+
return next.handle();
|
|
79
|
+
}
|
|
80
|
+
return next.handle().pipe((0, operators_1.map)((data) => {
|
|
81
|
+
if (data == null || typeof data !== "object")
|
|
82
|
+
return data;
|
|
83
|
+
return (0, struct_deep_1.wrapPlainObjectsAtPaths)(data, paths);
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
__setFunctionName(_classThis, "GrpcStructInterceptor");
|
|
88
|
+
(() => {
|
|
89
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
90
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
91
|
+
GrpcStructInterceptor = _classThis = _classDescriptor.value;
|
|
92
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
93
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
94
|
+
})();
|
|
95
|
+
return GrpcStructInterceptor = _classThis;
|
|
96
|
+
})();
|
|
97
|
+
exports.GrpcStructInterceptor = GrpcStructInterceptor;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Struct } from "../generated/google/protobuf/struct";
|
|
2
|
+
/**
|
|
3
|
+
* Heuristic: value is a wire-format google.protobuf.Struct (fields map to protobuf Values).
|
|
4
|
+
*/
|
|
5
|
+
export declare function isStructLike(value: unknown): value is Struct;
|
|
6
|
+
/**
|
|
7
|
+
* Recursively converts nested protobuf Struct instances to plain JSON objects.
|
|
8
|
+
*/
|
|
9
|
+
export declare function deepUnwrapStructs(value: unknown): unknown;
|
|
10
|
+
/**
|
|
11
|
+
* If the value is still wire-format Struct, unwrap once; otherwise return as-is.
|
|
12
|
+
* Use in services when an interceptor may or may not have run.
|
|
13
|
+
*/
|
|
14
|
+
export declare function normalizeMaybeStruct<T>(value: T | undefined): T | Record<string, unknown> | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Wraps plain objects at the given top-level keys into google.protobuf.Struct.
|
|
17
|
+
* Skips values that already look like Struct.
|
|
18
|
+
*/
|
|
19
|
+
export declare function wrapPlainObjectsAtPaths(data: Record<string, unknown>, paths: string[]): Record<string, unknown>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isStructLike = isStructLike;
|
|
4
|
+
exports.deepUnwrapStructs = deepUnwrapStructs;
|
|
5
|
+
exports.normalizeMaybeStruct = normalizeMaybeStruct;
|
|
6
|
+
exports.wrapPlainObjectsAtPaths = wrapPlainObjectsAtPaths;
|
|
7
|
+
const struct_1 = require("../generated/google/protobuf/struct");
|
|
8
|
+
/**
|
|
9
|
+
* Heuristic: value is a wire-format google.protobuf.Struct (fields map to protobuf Values).
|
|
10
|
+
*/
|
|
11
|
+
function isStructLike(value) {
|
|
12
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
13
|
+
return false;
|
|
14
|
+
if (!("fields" in value))
|
|
15
|
+
return false;
|
|
16
|
+
const fields = value.fields;
|
|
17
|
+
if (fields === null || typeof fields !== "object")
|
|
18
|
+
return false;
|
|
19
|
+
const keys = Object.keys(fields);
|
|
20
|
+
if (keys.length === 0)
|
|
21
|
+
return true;
|
|
22
|
+
const sample = fields[keys[0]];
|
|
23
|
+
if (!sample || typeof sample !== "object" || Array.isArray(sample)) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return ("stringValue" in sample ||
|
|
27
|
+
"numberValue" in sample ||
|
|
28
|
+
"boolValue" in sample ||
|
|
29
|
+
"nullValue" in sample ||
|
|
30
|
+
"structValue" in sample ||
|
|
31
|
+
"listValue" in sample);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Recursively converts nested protobuf Struct instances to plain JSON objects.
|
|
35
|
+
*/
|
|
36
|
+
function deepUnwrapStructs(value) {
|
|
37
|
+
if (value === null || value === undefined)
|
|
38
|
+
return value;
|
|
39
|
+
if (value instanceof Date)
|
|
40
|
+
return value;
|
|
41
|
+
if (typeof Buffer !== "undefined" && Buffer.isBuffer(value))
|
|
42
|
+
return value;
|
|
43
|
+
if (Array.isArray(value))
|
|
44
|
+
return value.map(deepUnwrapStructs);
|
|
45
|
+
if (typeof value !== "object")
|
|
46
|
+
return value;
|
|
47
|
+
if (isStructLike(value)) {
|
|
48
|
+
return struct_1.Struct.unwrap(value);
|
|
49
|
+
}
|
|
50
|
+
const obj = value;
|
|
51
|
+
const out = {};
|
|
52
|
+
for (const k of Object.keys(obj)) {
|
|
53
|
+
out[k] = deepUnwrapStructs(obj[k]);
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* If the value is still wire-format Struct, unwrap once; otherwise return as-is.
|
|
59
|
+
* Use in services when an interceptor may or may not have run.
|
|
60
|
+
*/
|
|
61
|
+
function normalizeMaybeStruct(value) {
|
|
62
|
+
if (value === undefined || value === null)
|
|
63
|
+
return value;
|
|
64
|
+
if (typeof value === "object" && !Array.isArray(value) && isStructLike(value)) {
|
|
65
|
+
return struct_1.Struct.unwrap(value);
|
|
66
|
+
}
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Wraps plain objects at the given top-level keys into google.protobuf.Struct.
|
|
71
|
+
* Skips values that already look like Struct.
|
|
72
|
+
*/
|
|
73
|
+
function wrapPlainObjectsAtPaths(data, paths) {
|
|
74
|
+
if (!data || typeof data !== "object")
|
|
75
|
+
return data;
|
|
76
|
+
const result = { ...data };
|
|
77
|
+
for (const key of paths) {
|
|
78
|
+
if (!(key in result))
|
|
79
|
+
continue;
|
|
80
|
+
const v = result[key];
|
|
81
|
+
if (v == null || typeof v !== "object" || Array.isArray(v))
|
|
82
|
+
continue;
|
|
83
|
+
if (isStructLike(v))
|
|
84
|
+
continue;
|
|
85
|
+
result[key] = struct_1.Struct.wrap(v);
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@wenlarge/communication",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "Shared gRPC proto interfaces and generated clients for Wenlarge microservices.",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist",
|
|
9
|
-
"proto",
|
|
10
|
-
"src/generated"
|
|
11
|
-
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"proto:build": "npx protoc --plugin=node_modules/.bin/protoc-gen-ts_proto.cmd --proto_path=proto --ts_proto_out=src/generated proto/*.proto --ts_proto_opt=nestJs=true,esModuleInterop=true,forceLong=string,useOptionals=messages,useDate=true,addGrpcMetadata=true,stringEnums=true",
|
|
14
|
-
"build": "npm run proto:build && tsc",
|
|
15
|
-
"prepare": "npm run build"
|
|
16
|
-
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"nestjs",
|
|
19
|
-
"grpc",
|
|
20
|
-
"proto",
|
|
21
|
-
"typescript",
|
|
22
|
-
"microservices",
|
|
23
|
-
"communication",
|
|
24
|
-
"shared"
|
|
25
|
-
],
|
|
26
|
-
"author": "Kerem Çakır <admin@wenlarge.com>",
|
|
27
|
-
"license": "MIT",
|
|
28
|
-
"repository": {
|
|
29
|
-
"type": "git",
|
|
30
|
-
"url": "https://github.com/wenlarge/communication.git"
|
|
31
|
-
},
|
|
32
|
-
"publishConfig": {
|
|
33
|
-
"access": "public"
|
|
34
|
-
},
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"@grpc/grpc-js": "^1.14.1",
|
|
37
|
-
"@grpc/proto-loader": "^0.7.15",
|
|
38
|
-
"expr-eval": "^2.0.2",
|
|
39
|
-
"rxjs": "^7.8.1"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@bufbuild/buf": "^1.66.1",
|
|
43
|
-
"@nestjs/microservices": "^10.4.20",
|
|
44
|
-
"@types/node": "^24.9.1",
|
|
45
|
-
"ts-proto": "^1.152.2",
|
|
46
|
-
"typescript": "^5.3.3"
|
|
47
|
-
},
|
|
48
|
-
"peerDependencies": {
|
|
49
|
-
"@grpc/grpc-js": "^1.14.1"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@wenlarge/communication",
|
|
3
|
+
"version": "1.2.5",
|
|
4
|
+
"description": "Shared gRPC proto interfaces and generated clients for Wenlarge microservices.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"proto",
|
|
10
|
+
"src/generated"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"proto:build": "npx protoc --plugin=node_modules/.bin/protoc-gen-ts_proto.cmd --proto_path=proto --ts_proto_out=src/generated proto/*.proto --ts_proto_opt=nestJs=true,esModuleInterop=true,forceLong=string,useOptionals=messages,useDate=true,addGrpcMetadata=true,stringEnums=true",
|
|
14
|
+
"build": "npm run proto:build && tsc",
|
|
15
|
+
"prepare": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"nestjs",
|
|
19
|
+
"grpc",
|
|
20
|
+
"proto",
|
|
21
|
+
"typescript",
|
|
22
|
+
"microservices",
|
|
23
|
+
"communication",
|
|
24
|
+
"shared"
|
|
25
|
+
],
|
|
26
|
+
"author": "Kerem Çakır <admin@wenlarge.com>",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/wenlarge/communication.git"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@grpc/grpc-js": "^1.14.1",
|
|
37
|
+
"@grpc/proto-loader": "^0.7.15",
|
|
38
|
+
"expr-eval": "^2.0.2",
|
|
39
|
+
"rxjs": "^7.8.1"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@bufbuild/buf": "^1.66.1",
|
|
43
|
+
"@nestjs/microservices": "^10.4.20",
|
|
44
|
+
"@types/node": "^24.9.1",
|
|
45
|
+
"ts-proto": "^1.152.2",
|
|
46
|
+
"typescript": "^5.3.3"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@grpc/grpc-js": "^1.14.1"
|
|
50
|
+
}
|
|
51
|
+
}
|
package/proto/project.proto
CHANGED
|
@@ -62,14 +62,12 @@ message FindFirstResponse{
|
|
|
62
62
|
message CreateEnvironmentRequest {
|
|
63
63
|
string projectId = 1;
|
|
64
64
|
string name = 2;
|
|
65
|
-
string type = 3;
|
|
66
65
|
repeated EnvironmentVariableInput variables = 4;
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
message UpdateEnvironmentRequest {
|
|
70
69
|
string id = 1;
|
|
71
70
|
string name = 2;
|
|
72
|
-
string type = 3;
|
|
73
71
|
repeated EnvironmentVariableInput variables = 4;
|
|
74
72
|
}
|
|
75
73
|
|
|
@@ -100,7 +98,6 @@ message EnvironmentResponse {
|
|
|
100
98
|
string id = 1;
|
|
101
99
|
string projectId = 2;
|
|
102
100
|
string name = 3;
|
|
103
|
-
string type = 4;
|
|
104
101
|
repeated EnvironmentVariableResponse variables = 5;
|
|
105
102
|
string createdAt = 6;
|
|
106
103
|
string updatedAt = 7;
|
package/proto/workflow.proto
CHANGED
|
@@ -25,6 +25,7 @@ service WorkflowService {
|
|
|
25
25
|
message CreateWorkflowRequest {
|
|
26
26
|
string name = 1;
|
|
27
27
|
string projectId = 2;
|
|
28
|
+
optional string default_environment_id = 3;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
message WorkflowResponse {
|
|
@@ -35,6 +36,7 @@ message WorkflowResponse {
|
|
|
35
36
|
string createdAt = 5;
|
|
36
37
|
string updatedAt = 6;
|
|
37
38
|
WorkflowStatus status = 7;
|
|
39
|
+
optional string default_environment_id = 8;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
message DeleteWorkflowRequest{
|
|
@@ -44,6 +46,7 @@ message DeleteWorkflowRequest{
|
|
|
44
46
|
message UpdateWorkflowRequest{
|
|
45
47
|
string id = 1;
|
|
46
48
|
string name = 2;
|
|
49
|
+
optional string default_environment_id = 3;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
message FindManyWorkflowRequest{
|
|
@@ -63,15 +66,12 @@ message FindFirstWorkflowRequest {
|
|
|
63
66
|
|
|
64
67
|
message TriggerWorkflowRequest{
|
|
65
68
|
string workflowId = 1;
|
|
66
|
-
optional string environmentId = 2;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
message TriggerNodeRequest{
|
|
70
72
|
string nodeId = 1;
|
|
71
73
|
string workflowId = 2;
|
|
72
74
|
google.protobuf.Struct inputSchema = 3;
|
|
73
|
-
optional string environmentId = 4;
|
|
74
|
-
google.protobuf.Struct env = 5;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
message WorkflowNodeRequest{
|
|
@@ -82,6 +82,7 @@ message WorkflowNodeRequest{
|
|
|
82
82
|
google.protobuf.Struct outputSchema = 5;
|
|
83
83
|
google.protobuf.Struct config = 6;
|
|
84
84
|
string nodeTypeId = 7;
|
|
85
|
+
optional string environment_id = 8;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
message FindManyWorkflowNodeRequest{
|
|
@@ -102,6 +103,7 @@ message WorkflowNodeResponse{
|
|
|
102
103
|
google.protobuf.Struct config = 7;
|
|
103
104
|
string createdAt = 8;
|
|
104
105
|
string updatedAt = 9;
|
|
106
|
+
optional string environment_id = 10;
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
message WorkflowNodeConnection {
|
|
@@ -117,6 +119,7 @@ message SaveWorkflowBatchRequest {
|
|
|
117
119
|
string workflowName = 2;
|
|
118
120
|
repeated WorkflowNodeRequest nodes = 3;
|
|
119
121
|
repeated UpdateBatchConnection connections = 4;
|
|
122
|
+
optional string default_environment_id = 5;
|
|
120
123
|
}
|
|
121
124
|
|
|
122
125
|
message UpdateBatchConnection {
|
package/src/generated/project.ts
CHANGED
|
@@ -54,14 +54,12 @@ export interface FindFirstResponse {
|
|
|
54
54
|
export interface CreateEnvironmentRequest {
|
|
55
55
|
projectId: string;
|
|
56
56
|
name: string;
|
|
57
|
-
type: string;
|
|
58
57
|
variables: EnvironmentVariableInput[];
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
export interface UpdateEnvironmentRequest {
|
|
62
61
|
id: string;
|
|
63
62
|
name: string;
|
|
64
|
-
type: string;
|
|
65
63
|
variables: EnvironmentVariableInput[];
|
|
66
64
|
}
|
|
67
65
|
|
|
@@ -92,7 +90,6 @@ export interface EnvironmentResponse {
|
|
|
92
90
|
id: string;
|
|
93
91
|
projectId: string;
|
|
94
92
|
name: string;
|
|
95
|
-
type: string;
|
|
96
93
|
variables: EnvironmentVariableResponse[];
|
|
97
94
|
createdAt: string;
|
|
98
95
|
updatedAt: string;
|
|
@@ -23,6 +23,7 @@ export enum WorkflowStatus {
|
|
|
23
23
|
export interface CreateWorkflowRequest {
|
|
24
24
|
name: string;
|
|
25
25
|
projectId: string;
|
|
26
|
+
defaultEnvironmentId?: string | undefined;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export interface WorkflowResponse {
|
|
@@ -33,6 +34,7 @@ export interface WorkflowResponse {
|
|
|
33
34
|
createdAt: string;
|
|
34
35
|
updatedAt: string;
|
|
35
36
|
status: WorkflowStatus;
|
|
37
|
+
defaultEnvironmentId?: string | undefined;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
export interface DeleteWorkflowRequest {
|
|
@@ -42,6 +44,7 @@ export interface DeleteWorkflowRequest {
|
|
|
42
44
|
export interface UpdateWorkflowRequest {
|
|
43
45
|
id: string;
|
|
44
46
|
name: string;
|
|
47
|
+
defaultEnvironmentId?: string | undefined;
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
export interface FindManyWorkflowRequest {
|
|
@@ -61,15 +64,12 @@ export interface FindFirstWorkflowRequest {
|
|
|
61
64
|
|
|
62
65
|
export interface TriggerWorkflowRequest {
|
|
63
66
|
workflowId: string;
|
|
64
|
-
environmentId?: string | undefined;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
export interface TriggerNodeRequest {
|
|
68
70
|
nodeId: string;
|
|
69
71
|
workflowId: string;
|
|
70
72
|
inputSchema?: { [key: string]: any } | undefined;
|
|
71
|
-
environmentId?: string | undefined;
|
|
72
|
-
env?: { [key: string]: any } | undefined;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
export interface WorkflowNodeRequest {
|
|
@@ -80,6 +80,7 @@ export interface WorkflowNodeRequest {
|
|
|
80
80
|
outputSchema?: { [key: string]: any } | undefined;
|
|
81
81
|
config?: { [key: string]: any } | undefined;
|
|
82
82
|
nodeTypeId: string;
|
|
83
|
+
environmentId?: string | undefined;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
export interface FindManyWorkflowNodeRequest {
|
|
@@ -100,6 +101,7 @@ export interface WorkflowNodeResponse {
|
|
|
100
101
|
config?: { [key: string]: any } | undefined;
|
|
101
102
|
createdAt: string;
|
|
102
103
|
updatedAt: string;
|
|
104
|
+
environmentId?: string | undefined;
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
export interface WorkflowNodeConnection {
|
|
@@ -115,6 +117,7 @@ export interface SaveWorkflowBatchRequest {
|
|
|
115
117
|
workflowName: string;
|
|
116
118
|
nodes: WorkflowNodeRequest[];
|
|
117
119
|
connections: UpdateBatchConnection[];
|
|
120
|
+
defaultEnvironmentId?: string | undefined;
|
|
118
121
|
}
|
|
119
122
|
|
|
120
123
|
export interface UpdateBatchConnection {
|