@wenlarge/communication 1.2.3 → 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/executor-core.d.ts +3 -0
- package/dist/generated/project.d.ts +0 -3
- package/dist/generated/workflow.d.ts +6 -0
- package/dist/grpc-interceptors/grpc-struct.interceptor.d.ts +31 -0
- package/dist/grpc-interceptors/grpc-struct.interceptor.js +97 -0
- package/dist/helpers/resolve-config-value.d.ts +1 -0
- package/dist/helpers/resolve-config-value.js +79 -0
- package/dist/helpers/struct-deep.d.ts +19 -0
- package/dist/helpers/struct-deep.js +88 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -1
- package/proto/auth.proto +102 -102
- package/proto/executor-core.proto +21 -20
- package/proto/notification.proto +22 -22
- package/proto/project.proto +116 -119
- package/proto/workflow.proto +186 -180
- package/src/generated/common.ts +16 -16
- package/src/generated/executor-core.ts +1 -0
- package/src/generated/project.ts +0 -3
- package/src/generated/workflow.ts +6 -0
- package/dist/generated/google/protobuf/timestamp.d.ts +0 -108
- package/dist/generated/google/protobuf/timestamp.js +0 -11
|
@@ -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;
|
|
@@ -63,6 +66,7 @@ export interface WorkflowNodeRequest {
|
|
|
63
66
|
[key: string]: any;
|
|
64
67
|
} | undefined;
|
|
65
68
|
nodeTypeId: string;
|
|
69
|
+
environmentId?: string | undefined;
|
|
66
70
|
}
|
|
67
71
|
export interface FindManyWorkflowNodeRequest {
|
|
68
72
|
workflowId: string;
|
|
@@ -86,6 +90,7 @@ export interface WorkflowNodeResponse {
|
|
|
86
90
|
} | undefined;
|
|
87
91
|
createdAt: string;
|
|
88
92
|
updatedAt: string;
|
|
93
|
+
environmentId?: string | undefined;
|
|
89
94
|
}
|
|
90
95
|
export interface WorkflowNodeConnection {
|
|
91
96
|
id: string;
|
|
@@ -101,6 +106,7 @@ export interface SaveWorkflowBatchRequest {
|
|
|
101
106
|
workflowName: string;
|
|
102
107
|
nodes: WorkflowNodeRequest[];
|
|
103
108
|
connections: UpdateBatchConnection[];
|
|
109
|
+
defaultEnvironmentId?: string | undefined;
|
|
104
110
|
}
|
|
105
111
|
export interface UpdateBatchConnection {
|
|
106
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 @@
|
|
|
1
|
+
export declare function resolveConfigValue(value: unknown, input?: Record<string, any> | null, env?: Record<string, any> | null): unknown;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveConfigValue = resolveConfigValue;
|
|
4
|
+
const expr_eval_1 = require("expr-eval");
|
|
5
|
+
const FORBIDDEN_KEYS = new Set(["__proto__", "prototype", "constructor"]);
|
|
6
|
+
function sanitize(value) {
|
|
7
|
+
if (value == null)
|
|
8
|
+
return value;
|
|
9
|
+
if (typeof value === "function")
|
|
10
|
+
return undefined;
|
|
11
|
+
if (Array.isArray(value))
|
|
12
|
+
return value.map(sanitize);
|
|
13
|
+
if (typeof value === "object") {
|
|
14
|
+
const clean = Object.create(null);
|
|
15
|
+
for (const key of Object.keys(value)) {
|
|
16
|
+
if (FORBIDDEN_KEYS.has(key))
|
|
17
|
+
continue;
|
|
18
|
+
clean[key] = sanitize(value[key]);
|
|
19
|
+
}
|
|
20
|
+
return clean;
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
function resolveConfigValue(value, input, env) {
|
|
25
|
+
var _a;
|
|
26
|
+
if (typeof value !== "string")
|
|
27
|
+
return value;
|
|
28
|
+
const parser = new expr_eval_1.Parser();
|
|
29
|
+
parser.consts = {};
|
|
30
|
+
parser.functions = {};
|
|
31
|
+
const evaluateExpr = (exprRaw) => {
|
|
32
|
+
var _a;
|
|
33
|
+
const expr = exprRaw.trim();
|
|
34
|
+
if (!expr)
|
|
35
|
+
return undefined;
|
|
36
|
+
if (/[a-zA-Z_$][\w$]*\s*\(/.test(expr))
|
|
37
|
+
return undefined;
|
|
38
|
+
try {
|
|
39
|
+
const context = {
|
|
40
|
+
input: sanitize(input !== null && input !== void 0 ? input : null),
|
|
41
|
+
env: sanitize((_a = env !== null && env !== void 0 ? env : input === null || input === void 0 ? void 0 : input.env) !== null && _a !== void 0 ? _a : null),
|
|
42
|
+
};
|
|
43
|
+
const result = parser.parse(expr).evaluate(context);
|
|
44
|
+
return typeof result === "function" ? undefined : result;
|
|
45
|
+
}
|
|
46
|
+
catch (_b) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const stringifyInline = (resolved, fallback) => {
|
|
51
|
+
if (resolved === undefined)
|
|
52
|
+
return fallback;
|
|
53
|
+
if (resolved == null)
|
|
54
|
+
return "";
|
|
55
|
+
if (typeof resolved === "string")
|
|
56
|
+
return resolved;
|
|
57
|
+
if (typeof resolved === "number" || typeof resolved === "boolean") {
|
|
58
|
+
return String(resolved);
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
return JSON.stringify(resolved);
|
|
62
|
+
}
|
|
63
|
+
catch (_a) {
|
|
64
|
+
return String(resolved);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const exact = value.match(/^\{\{\s*(.*?)\s*\}\}$/);
|
|
68
|
+
if (exact) {
|
|
69
|
+
const resolved = evaluateExpr((_a = exact[1]) !== null && _a !== void 0 ? _a : "");
|
|
70
|
+
return resolved === undefined ? value : resolved;
|
|
71
|
+
}
|
|
72
|
+
if (value.includes("{{")) {
|
|
73
|
+
return value.replace(/\{\{\s*(.*?)\s*\}\}/g, (m, exprRaw) => {
|
|
74
|
+
const resolved = evaluateExpr(exprRaw);
|
|
75
|
+
return stringifyInline(resolved, m);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return value;
|
|
79
|
+
}
|
|
@@ -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/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.ListValue = exports.Value = exports.Struct = exports.Notification = exports.ExecutorCore = exports.Metadata = exports.Project = exports.Workflow = exports.Auth = void 0;
|
|
40
40
|
__exportStar(require("./helpers/helper"), exports);
|
|
41
|
+
__exportStar(require("./helpers/resolve-config-value"), exports);
|
|
41
42
|
exports.Auth = __importStar(require("./generated/auth"));
|
|
42
43
|
__exportStar(require("./config/auth-config"), exports);
|
|
43
44
|
exports.Workflow = __importStar(require("./generated/workflow"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wenlarge/communication",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
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",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@grpc/grpc-js": "^1.14.1",
|
|
37
37
|
"@grpc/proto-loader": "^0.7.15",
|
|
38
|
+
"expr-eval": "^2.0.2",
|
|
38
39
|
"rxjs": "^7.8.1"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
package/proto/auth.proto
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
import "google/protobuf/empty.proto";
|
|
4
|
-
|
|
5
|
-
package auth;
|
|
6
|
-
|
|
7
|
-
service AuthService {
|
|
8
|
-
rpc Login (LoginRequest) returns (LoginResponse);
|
|
9
|
-
rpc Register (RegisterRequest) returns (google.protobuf.Empty);
|
|
10
|
-
rpc GetMe (GetMeRequest) returns (GetMeResponse);
|
|
11
|
-
rpc InviteToCompany (InviteToCompanyRequest) returns (InviteToCompanyResponse);
|
|
12
|
-
rpc UpdateInviteStatus (UpdateInviteStatusRequest) returns (UpdateInviteStatusResponse);
|
|
13
|
-
rpc GetCompanyUsers (GetCompanyUsersRequest) returns (GetCompanyUsersResponse);
|
|
14
|
-
rpc RemoveUserFromCompany (RemoveUserFromCompanyRequest) returns (google.protobuf.Empty);
|
|
15
|
-
rpc RefreshToken (RefreshTokenRequest) returns (LoginResponse);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
message LoginRequest {
|
|
19
|
-
string email = 1;
|
|
20
|
-
string password = 2;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
message LoginResponse {
|
|
24
|
-
string jwt = 1;
|
|
25
|
-
string expiresIn = 2;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
message RegisterRequest {
|
|
29
|
-
string name = 1;
|
|
30
|
-
string email = 2;
|
|
31
|
-
string password = 3;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
message GetMeRequest {
|
|
35
|
-
string jwt = 1;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
message Company {
|
|
39
|
-
string id = 1;
|
|
40
|
-
string name = 2;
|
|
41
|
-
string createdAt = 3;
|
|
42
|
-
string updatedAt = 4;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
message CompanyUser {
|
|
46
|
-
Company company = 1;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
message InviteToCompanyRequest {
|
|
50
|
-
string companyId = 1;
|
|
51
|
-
string email = 2;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
message InviteToCompanyResponse{
|
|
55
|
-
string id = 1;
|
|
56
|
-
string companyId = 2;
|
|
57
|
-
string email = 3;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
message UpdateInviteStatusRequest{
|
|
61
|
-
string inviteId = 1;
|
|
62
|
-
string userId =2;
|
|
63
|
-
string status = 3;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
message UpdateInviteStatusResponse{
|
|
67
|
-
string id = 1 ;
|
|
68
|
-
string status = 2;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
message GetMeResponse {
|
|
72
|
-
string id = 1;
|
|
73
|
-
string name = 2;
|
|
74
|
-
string email = 3;
|
|
75
|
-
string createdAt = 4;
|
|
76
|
-
string updatedAt = 5;
|
|
77
|
-
repeated CompanyUser companyUsersOnUser = 6;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
message GetCompanyUsersRequest {
|
|
81
|
-
string companyId = 1;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
message CompanyUserDetail {
|
|
85
|
-
string userId = 1;
|
|
86
|
-
string userName = 2;
|
|
87
|
-
string userEmail = 3;
|
|
88
|
-
string joinedAt = 4;
|
|
89
|
-
bool isOwner = 5;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
message GetCompanyUsersResponse {
|
|
93
|
-
repeated CompanyUserDetail users = 1;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
message RemoveUserFromCompanyRequest {
|
|
97
|
-
string companyId = 1;
|
|
98
|
-
string userId = 2;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
message RefreshTokenRequest {
|
|
102
|
-
string userId = 1;
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
import "google/protobuf/empty.proto";
|
|
4
|
+
|
|
5
|
+
package auth;
|
|
6
|
+
|
|
7
|
+
service AuthService {
|
|
8
|
+
rpc Login (LoginRequest) returns (LoginResponse);
|
|
9
|
+
rpc Register (RegisterRequest) returns (google.protobuf.Empty);
|
|
10
|
+
rpc GetMe (GetMeRequest) returns (GetMeResponse);
|
|
11
|
+
rpc InviteToCompany (InviteToCompanyRequest) returns (InviteToCompanyResponse);
|
|
12
|
+
rpc UpdateInviteStatus (UpdateInviteStatusRequest) returns (UpdateInviteStatusResponse);
|
|
13
|
+
rpc GetCompanyUsers (GetCompanyUsersRequest) returns (GetCompanyUsersResponse);
|
|
14
|
+
rpc RemoveUserFromCompany (RemoveUserFromCompanyRequest) returns (google.protobuf.Empty);
|
|
15
|
+
rpc RefreshToken (RefreshTokenRequest) returns (LoginResponse);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message LoginRequest {
|
|
19
|
+
string email = 1;
|
|
20
|
+
string password = 2;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message LoginResponse {
|
|
24
|
+
string jwt = 1;
|
|
25
|
+
string expiresIn = 2;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message RegisterRequest {
|
|
29
|
+
string name = 1;
|
|
30
|
+
string email = 2;
|
|
31
|
+
string password = 3;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message GetMeRequest {
|
|
35
|
+
string jwt = 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message Company {
|
|
39
|
+
string id = 1;
|
|
40
|
+
string name = 2;
|
|
41
|
+
string createdAt = 3;
|
|
42
|
+
string updatedAt = 4;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message CompanyUser {
|
|
46
|
+
Company company = 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message InviteToCompanyRequest {
|
|
50
|
+
string companyId = 1;
|
|
51
|
+
string email = 2;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
message InviteToCompanyResponse{
|
|
55
|
+
string id = 1;
|
|
56
|
+
string companyId = 2;
|
|
57
|
+
string email = 3;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message UpdateInviteStatusRequest{
|
|
61
|
+
string inviteId = 1;
|
|
62
|
+
string userId =2;
|
|
63
|
+
string status = 3;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message UpdateInviteStatusResponse{
|
|
67
|
+
string id = 1 ;
|
|
68
|
+
string status = 2;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
message GetMeResponse {
|
|
72
|
+
string id = 1;
|
|
73
|
+
string name = 2;
|
|
74
|
+
string email = 3;
|
|
75
|
+
string createdAt = 4;
|
|
76
|
+
string updatedAt = 5;
|
|
77
|
+
repeated CompanyUser companyUsersOnUser = 6;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
message GetCompanyUsersRequest {
|
|
81
|
+
string companyId = 1;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
message CompanyUserDetail {
|
|
85
|
+
string userId = 1;
|
|
86
|
+
string userName = 2;
|
|
87
|
+
string userEmail = 3;
|
|
88
|
+
string joinedAt = 4;
|
|
89
|
+
bool isOwner = 5;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
message GetCompanyUsersResponse {
|
|
93
|
+
repeated CompanyUserDetail users = 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message RemoveUserFromCompanyRequest {
|
|
97
|
+
string companyId = 1;
|
|
98
|
+
string userId = 2;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
message RefreshTokenRequest {
|
|
102
|
+
string userId = 1;
|
|
103
103
|
}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package executor_core;
|
|
4
|
-
import "google/protobuf/struct.proto";
|
|
5
|
-
|
|
6
|
-
message ExecuteNodeRequest {
|
|
7
|
-
string nodeTypeId = 1;
|
|
8
|
-
string nodeId = 2;
|
|
9
|
-
google.protobuf.Struct config = 3;
|
|
10
|
-
google.protobuf.Struct inputSchema = 4;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package executor_core;
|
|
4
|
+
import "google/protobuf/struct.proto";
|
|
5
|
+
|
|
6
|
+
message ExecuteNodeRequest {
|
|
7
|
+
string nodeTypeId = 1;
|
|
8
|
+
string nodeId = 2;
|
|
9
|
+
google.protobuf.Struct config = 3;
|
|
10
|
+
google.protobuf.Struct inputSchema = 4;
|
|
11
|
+
google.protobuf.Struct env = 5;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message ExecuteNodeResponse {
|
|
15
|
+
google.protobuf.Struct output = 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
service CoreExecutionService {
|
|
19
|
+
rpc ExecuteNode (ExecuteNodeRequest) returns (ExecuteNodeResponse);
|
|
20
|
+
|
|
21
|
+
}
|