Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat(proto): risk (#5104)
p0ny7447775186ba
diff --git a/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts b/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.tsnew file mode 100644index 0000000000..124e896f52--- /dev/null+++ b/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts@@ -0,0 +1,1677 @@+/* eslint-disable */+import * as Long from "long";+import * as _m0 from "protobufjs/minimal";+import { Duration } from "../../../protobuf/duration";+import { NullValue, nullValueFromJSON, nullValueToJSON } from "../../../protobuf/struct";+import { Timestamp } from "../../../protobuf/timestamp";++export const protobufPackage = "google.api.expr.v1alpha1";++/** An expression together with source information as returned by the parser. */+export interface ParsedExpr {+ /** The parsed expression. */+ expr?: Expr;+ /** The source info derived from input that generated the parsed `expr`. */+ sourceInfo?: SourceInfo;+}++/**+ * An abstract representation of a common expression.+ *+ * Expressions are abstractly represented as a collection of identifiers,+ * select statements, function calls, literals, and comprehensions. All+ * operators with the exception of the '.' operator are modelled as function+ * calls. This makes it easy to represent new operators into the existing AST.+ *+ * All references within expressions must resolve to a [Decl][google.api.expr.v1alpha1.Decl] provided at+ * type-check for an expression to be valid. A reference may either be a bare+ * identifier `name` or a qualified identifier `google.api.name`. References+ * may either refer to a value or a function declaration.+ *+ * For example, the expression `google.api.name.startsWith('expr')` references+ * the declaration `google.api.name` within a [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression, and+ * the function declaration `startsWith`.+ */+export interface Expr {+ /**+ * Required. An id assigned to this node by the parser which is unique in a+ * given expression tree. This is used to associate type information and other+ * attributes to a node in the parse tree.+ */+ id: number;+ /** A literal expression. */+ constExpr?:+ | Constant+ | undefined;+ /** An identifier expression. */+ identExpr?:+ | Expr_Ident+ | undefined;+ /** A field selection expression, e.g. `request.auth`. */+ selectExpr?:+ | Expr_Select+ | undefined;+ /** A call expression, including calls to predefined functions and operators. */+ callExpr?:+ | Expr_Call+ | undefined;+ /** A list creation expression. */+ listExpr?:+ | Expr_CreateList+ | undefined;+ /** A map or message creation expression. */+ structExpr?:+ | Expr_CreateStruct+ | undefined;+ /** A comprehension expression. */+ comprehensionExpr?: Expr_Comprehension | undefined;+}++/** An identifier expression. e.g. `request`. */+export interface Expr_Ident {+ /**+ * Required. Holds a single, unqualified identifier, possibly preceded by a+ * '.'.+ *+ * Qualified names are represented by the [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression.+ */+ name: string;+}++/** A field selection expression. e.g. `request.auth`. */+export interface Expr_Select {+ /**+ * Required. The target of the selection expression.+ *+ * For example, in the select expression `request.auth`, the `request`+ * portion of the expression is the `operand`.+ */+ operand?: Expr;+ /**+ * Required. The name of the field to select.+ *+ * For example, in the select expression `request.auth`, the `auth` portion+ * of the expression would be the `field`.+ */+ field: string;+ /**+ * Whether the select is to be interpreted as a field presence test.+ *+ * This results from the macro `has(request.auth)`.+ */+ testOnly: boolean;+}++/**+ * A call expression, including calls to predefined functions and operators.+ *+ * For example, `value == 10`, `size(map_value)`.+ */+export interface Expr_Call {+ /**+ * The target of an method call-style expression. For example, `x` in+ * `x.f()`.+ */+ target?: Expr;+ /** Required. The name of the function or method being called. */+ function: string;+ /** The arguments. */+ args: Expr[];+}++/**+ * A list creation expression.+ *+ * Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogeneous, e.g.+ * `dyn([1, 'hello', 2.0])`+ */+export interface Expr_CreateList {+ /** The elements part of the list. */+ elements: Expr[];+ /**+ * The indices within the elements list which are marked as optional+ * elements.+ *+ * When an optional-typed value is present, the value it contains+ * is included in the list. If the optional-typed value is absent, the list+ * element is omitted from the CreateList result.+ */+ optionalIndices: number[];+}++/**+ * A map or message creation expression.+ *+ * Maps are constructed as `{'key_name': 'value'}`. Message construction is+ * similar, but prefixed with a type name and composed of field ids:+ * `types.MyType{field_id: 'value'}`.+ */+export interface Expr_CreateStruct {+ /**+ * The type name of the message to be created, empty when creating map+ * literals.+ */+ messageName: string;+ /** The entries in the creation expression. */+ entries: Expr_CreateStruct_Entry[];+}++/** Represents an entry. */+export interface Expr_CreateStruct_Entry {+ /**+ * Required. An id assigned to this node by the parser which is unique+ * in a given expression tree. This is used to associate type+ * information and other attributes to the node.+ */+ id: number;+ /** The field key for a message creator statement. */+ fieldKey?:+ | string+ | undefined;+ /** The key expression for a map creation statement. */+ mapKey?:+ | Expr+ | undefined;+ /**+ * Required. The value assigned to the key.+ *+ * If the optional_entry field is true, the expression must resolve to an+ * optional-typed value. If the optional value is present, the key will be+ * set; however, if the optional value is absent, the key will be unset.+ */+ value?: Expr;+ /** Whether the key-value pair is optional. */+ optionalEntry: boolean;+}++/**+ * A comprehension expression applied to a list or map.+ *+ * Comprehensions are not part of the core syntax, but enabled with macros.+ * A macro matches a specific call signature within a parsed AST and replaces+ * the call with an alternate AST block. Macro expansion happens at parse+ * time.+ *+ * The following macros are supported within CEL:+ *+ * Aggregate type macros may be applied to all elements in a list or all keys+ * in a map:+ *+ * * `all`, `exists`, `exists_one` - test a predicate expression against+ * the inputs and return `true` if the predicate is satisfied for all,+ * any, or only one value `list.all(x, x < 10)`.+ * * `filter` - test a predicate expression against the inputs and return+ * the subset of elements which satisfy the predicate:+ * `payments.filter(p, p > 1000)`.+ * * `map` - apply an expression to all elements in the input and return the+ * output aggregate type: `[1, 2, 3].map(i, i * i)`.+ *+ * The `has(m.x)` macro tests whether the property `x` is present in struct+ * `m`. The semantics of this macro depend on the type of `m`. For proto2+ * messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the+ * macro tests whether the property is set to its default. For map and struct+ * types, the macro tests whether the property `x` is defined on `m`.+ */+export interface Expr_Comprehension {+ /** The name of the iteration variable. */+ iterVar: string;+ /** The range over which var iterates. */+ iterRange?: Expr;+ /** The name of the variable used for accumulation of the result. */+ accuVar: string;+ /** The initial value of the accumulator. */+ accuInit?: Expr;+ /**+ * An expression which can contain iter_var and accu_var.+ *+ * Returns false when the result has been computed and may be used as+ * a hint to short-circuit the remainder of the comprehension.+ */+ loopCondition?: Expr;+ /**+ * An expression which can contain iter_var and accu_var.+ *+ * Computes the next value of accu_var.+ */+ loopStep?: Expr;+ /**+ * An expression which can contain accu_var.+ *+ * Computes the result.+ */+ result?: Expr;+}++/**+ * Represents a primitive literal.+ *+ * Named 'Constant' here for backwards compatibility.+ *+ * This is similar as the primitives supported in the well-known type+ * `google.protobuf.Value`, but richer so it can represent CEL's full range of+ * primitives.+ *+ * Lists and structs are not included as constants as these aggregate types may+ * contain [Expr][google.api.expr.v1alpha1.Expr] elements which require evaluation and are thus not constant.+ *+ * Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`,+ * `true`, `null`.+ */+export interface Constant {+ /** null value. */+ nullValue?:+ | NullValue+ | undefined;+ /** boolean value. */+ boolValue?:+ | boolean+ | undefined;+ /** int64 value. */+ int64Value?:+ | number+ | undefined;+ /** uint64 value. */+ uint64Value?:+ | number+ | undefined;+ /** double value. */+ doubleValue?:+ | number+ | undefined;+ /** string value. */+ stringValue?:+ | string+ | undefined;+ /** bytes value. */+ bytesValue?:+ | Uint8Array+ | undefined;+ /**+ * protobuf.Duration value.+ *+ * Deprecated: duration is no longer considered a builtin cel type.+ *+ * @deprecated+ */+ durationValue?:+ | Duration+ | undefined;+ /**+ * protobuf.Timestamp value.+ *+ * Deprecated: timestamp is no longer considered a builtin cel type.+ *+ * @deprecated+ */+ timestampValue?: Date | undefined;+}++/** Source information collected at parse time. */+export interface SourceInfo {+ /** The syntax version of the source, e.g. `cel1`. */+ syntaxVersion: string;+ /**+ * The location name. All position information attached to an expression is+ * relative to this location.+ *+ * The location could be a file, UI element, or similar. For example,+ * `acme/app/AnvilPolicy.cel`.+ */+ location: string;+ /**+ * Monotonically increasing list of code point offsets where newlines+ * `\n` appear.+ *+ * The line number of a given position is the index `i` where for a given+ * `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The+ * column may be derivd from `id_positions[id] - line_offsets[i]`.+ */+ lineOffsets: number[];+ /**+ * A map from the parse node id (e.g. `Expr.id`) to the code point offset+ * within the source.+ */+ positions: { [key: number]: number };+ /**+ * A map from the parse node id where a macro replacement was made to the+ * call `Expr` that resulted in a macro expansion.+ *+ * For example, `has(value.field)` is a function call that is replaced by a+ * `test_only` field selection in the AST. Likewise, the call+ * `list.exists(e, e > 10)` translates to a comprehension expression. The key+ * in the map corresponds to the expression id of the expanded macro, and the+ * value is the call `Expr` that was replaced.+ */+ macroCalls: { [key: number]: Expr };+}++export interface SourceInfo_PositionsEntry {+ key: number;+ value: number;+}++export interface SourceInfo_MacroCallsEntry {+ key: number;+ value?: Expr;+}++/** A specific position in source. */+export interface SourcePosition {+ /** The soucre location name (e.g. file name). */+ location: string;+ /** The UTF-8 code unit offset. */+ offset: number;+ /**+ * The 1-based index of the starting line in the source text+ * where the issue occurs, or 0 if unknown.+ */+ line: number;+ /**+ * The 0-based index of the starting position within the line of source text+ * where the issue occurs. Only meaningful if line is nonzero.+ */+ column: number;+}++function createBaseParsedExpr(): ParsedExpr {+ return { expr: undefined, sourceInfo: undefined };+}++export const ParsedExpr = {+ encode(message: ParsedExpr, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.expr !== undefined) {+ Expr.encode(message.expr, writer.uint32(18).fork()).ldelim();+ }+ if (message.sourceInfo !== undefined) {+ SourceInfo.encode(message.sourceInfo, writer.uint32(26).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): ParsedExpr {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseParsedExpr();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 2:+ message.expr = Expr.decode(reader, reader.uint32());+ break;+ case 3:+ message.sourceInfo = SourceInfo.decode(reader, reader.uint32());+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): ParsedExpr {+ return {+ expr: isSet(object.expr) ? Expr.fromJSON(object.expr) : undefined,+ sourceInfo: isSet(object.sourceInfo) ? SourceInfo.fromJSON(object.sourceInfo) : undefined,+ };+ },++ toJSON(message: ParsedExpr): unknown {+ const obj: any = {};+ message.expr !== undefined && (obj.expr = message.expr ? Expr.toJSON(message.expr) : undefined);+ message.sourceInfo !== undefined &&+ (obj.sourceInfo = message.sourceInfo ? SourceInfo.toJSON(message.sourceInfo) : undefined);+ return obj;+ },++ fromPartial(object: DeepPartial<ParsedExpr>): ParsedExpr {+ const message = createBaseParsedExpr();+ message.expr = (object.expr !== undefined && object.expr !== null) ? Expr.fromPartial(object.expr) : undefined;+ message.sourceInfo = (object.sourceInfo !== undefined && object.sourceInfo !== null)+ ? SourceInfo.fromPartial(object.sourceInfo)+ : undefined;+ return message;+ },+};++function createBaseExpr(): Expr {+ return {+ id: 0,+ constExpr: undefined,+ identExpr: undefined,+ selectExpr: undefined,+ callExpr: undefined,+ listExpr: undefined,+ structExpr: undefined,+ comprehensionExpr: undefined,+ };+}++export const Expr = {+ encode(message: Expr, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.id !== 0) {+ writer.uint32(16).int64(message.id);+ }+ if (message.constExpr !== undefined) {+ Constant.encode(message.constExpr, writer.uint32(26).fork()).ldelim();+ }+ if (message.identExpr !== undefined) {+ Expr_Ident.encode(message.identExpr, writer.uint32(34).fork()).ldelim();+ }+ if (message.selectExpr !== undefined) {+ Expr_Select.encode(message.selectExpr, writer.uint32(42).fork()).ldelim();+ }+ if (message.callExpr !== undefined) {+ Expr_Call.encode(message.callExpr, writer.uint32(50).fork()).ldelim();+ }+ if (message.listExpr !== undefined) {+ Expr_CreateList.encode(message.listExpr, writer.uint32(58).fork()).ldelim();+ }+ if (message.structExpr !== undefined) {+ Expr_CreateStruct.encode(message.structExpr, writer.uint32(66).fork()).ldelim();+ }+ if (message.comprehensionExpr !== undefined) {+ Expr_Comprehension.encode(message.comprehensionExpr, writer.uint32(74).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): Expr {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseExpr();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 2:+ message.id = longToNumber(reader.int64() as Long);+ break;+ case 3:+ message.constExpr = Constant.decode(reader, reader.uint32());+ break;+ case 4:+ message.identExpr = Expr_Ident.decode(reader, reader.uint32());+ break;+ case 5:+ message.selectExpr = Expr_Select.decode(reader, reader.uint32());+ break;+ case 6:+ message.callExpr = Expr_Call.decode(reader, reader.uint32());+ break;+ case 7:+ message.listExpr = Expr_CreateList.decode(reader, reader.uint32());+ break;+ case 8:+ message.structExpr = Expr_CreateStruct.decode(reader, reader.uint32());+ break;+ case 9:+ message.comprehensionExpr = Expr_Comprehension.decode(reader, reader.uint32());+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): Expr {+ return {+ id: isSet(object.id) ? Number(object.id) : 0,+ constExpr: isSet(object.constExpr) ? Constant.fromJSON(object.constExpr) : undefined,+ identExpr: isSet(object.identExpr) ? Expr_Ident.fromJSON(object.identExpr) : undefined,+ selectExpr: isSet(object.selectExpr) ? Expr_Select.fromJSON(object.selectExpr) : undefined,+ callExpr: isSet(object.callExpr) ? Expr_Call.fromJSON(object.callExpr) : undefined,+ listExpr: isSet(object.listExpr) ? Expr_CreateList.fromJSON(object.listExpr) : undefined,+ structExpr: isSet(object.structExpr) ? Expr_CreateStruct.fromJSON(object.structExpr) : undefined,+ comprehensionExpr: isSet(object.comprehensionExpr)+ ? Expr_Comprehension.fromJSON(object.comprehensionExpr)+ : undefined,+ };+ },++ toJSON(message: Expr): unknown {+ const obj: any = {};+ message.id !== undefined && (obj.id = Math.round(message.id));+ message.constExpr !== undefined &&+ (obj.constExpr = message.constExpr ? Constant.toJSON(message.constExpr) : undefined);+ message.identExpr !== undefined &&+ (obj.identExpr = message.identExpr ? Expr_Ident.toJSON(message.identExpr) : undefined);+ message.selectExpr !== undefined &&+ (obj.selectExpr = message.selectExpr ? Expr_Select.toJSON(message.selectExpr) : undefined);+ message.callExpr !== undefined &&+ (obj.callExpr = message.callExpr ? Expr_Call.toJSON(message.callExpr) : undefined);+ message.listExpr !== undefined &&+ (obj.listExpr = message.listExpr ? Expr_CreateList.toJSON(message.listExpr) : undefined);+ message.structExpr !== undefined &&+ (obj.structExpr = message.structExpr ? Expr_CreateStruct.toJSON(message.structExpr) : undefined);+ message.comprehensionExpr !== undefined && (obj.comprehensionExpr = message.comprehensionExpr+ ? Expr_Comprehension.toJSON(message.comprehensionExpr)+ : undefined);+ return obj;+ },++ fromPartial(object: DeepPartial<Expr>): Expr {+ const message = createBaseExpr();+ message.id = object.id ?? 0;+ message.constExpr = (object.constExpr !== undefined && object.constExpr !== null)+ ? Constant.fromPartial(object.constExpr)+ : undefined;+ message.identExpr = (object.identExpr !== undefined && object.identExpr !== null)+ ? Expr_Ident.fromPartial(object.identExpr)+ : undefined;+ message.selectExpr = (object.selectExpr !== undefined && object.selectExpr !== null)+ ? Expr_Select.fromPartial(object.selectExpr)+ : undefined;+ message.callExpr = (object.callExpr !== undefined && object.callExpr !== null)+ ? Expr_Call.fromPartial(object.callExpr)+ : undefined;+ message.listExpr = (object.listExpr !== undefined && object.listExpr !== null)+ ? Expr_CreateList.fromPartial(object.listExpr)+ : undefined;+ message.structExpr = (object.structExpr !== undefined && object.structExpr !== null)+ ? Expr_CreateStruct.fromPartial(object.structExpr)+ : undefined;+ message.comprehensionExpr = (object.comprehensionExpr !== undefined && object.comprehensionExpr !== null)+ ? Expr_Comprehension.fromPartial(object.comprehensionExpr)+ : undefined;+ return message;+ },+};++function createBaseExpr_Ident(): Expr_Ident {+ return { name: "" };+}++export const Expr_Ident = {+ encode(message: Expr_Ident, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.name !== "") {+ writer.uint32(10).string(message.name);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): Expr_Ident {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseExpr_Ident();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.name = reader.string();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): Expr_Ident {+ return { name: isSet(object.name) ? String(object.name) : "" };+ },++ toJSON(message: Expr_Ident): unknown {+ const obj: any = {};+ message.name !== undefined && (obj.name = message.name);+ return obj;+ },++ fromPartial(object: DeepPartial<Expr_Ident>): Expr_Ident {+ const message = createBaseExpr_Ident();+ message.name = object.name ?? "";+ return message;+ },+};++function createBaseExpr_Select(): Expr_Select {+ return { operand: undefined, field: "", testOnly: false };+}++export const Expr_Select = {+ encode(message: Expr_Select, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.operand !== undefined) {+ Expr.encode(message.operand, writer.uint32(10).fork()).ldelim();+ }+ if (message.field !== "") {+ writer.uint32(18).string(message.field);+ }+ if (message.testOnly === true) {+ writer.uint32(24).bool(message.testOnly);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): Expr_Select {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseExpr_Select();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.operand = Expr.decode(reader, reader.uint32());+ break;+ case 2:+ message.field = reader.string();+ break;+ case 3:+ message.testOnly = reader.bool();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): Expr_Select {+ return {+ operand: isSet(object.operand) ? Expr.fromJSON(object.operand) : undefined,+ field: isSet(object.field) ? String(object.field) : "",+ testOnly: isSet(object.testOnly) ? Boolean(object.testOnly) : false,+ };+ },++ toJSON(message: Expr_Select): unknown {+ const obj: any = {};+ message.operand !== undefined && (obj.operand = message.operand ? Expr.toJSON(message.operand) : undefined);+ message.field !== undefined && (obj.field = message.field);+ message.testOnly !== undefined && (obj.testOnly = message.testOnly);+ return obj;+ },++ fromPartial(object: DeepPartial<Expr_Select>): Expr_Select {+ const message = createBaseExpr_Select();+ message.operand = (object.operand !== undefined && object.operand !== null)+ ? Expr.fromPartial(object.operand)+ : undefined;+ message.field = object.field ?? "";+ message.testOnly = object.testOnly ?? false;+ return message;+ },+};++function createBaseExpr_Call(): Expr_Call {+ return { target: undefined, function: "", args: [] };+}++export const Expr_Call = {+ encode(message: Expr_Call, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.target !== undefined) {+ Expr.encode(message.target, writer.uint32(10).fork()).ldelim();+ }+ if (message.function !== "") {+ writer.uint32(18).string(message.function);+ }+ for (const v of message.args) {+ Expr.encode(v!, writer.uint32(26).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): Expr_Call {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseExpr_Call();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.target = Expr.decode(reader, reader.uint32());+ break;+ case 2:+ message.function = reader.string();+ break;+ case 3:+ message.args.push(Expr.decode(reader, reader.uint32()));+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): Expr_Call {+ return {+ target: isSet(object.target) ? Expr.fromJSON(object.target) : undefined,+ function: isSet(object.function) ? String(object.function) : "",+ args: Array.isArray(object?.args) ? object.args.map((e: any) => Expr.fromJSON(e)) : [],+ };+ },++ toJSON(message: Expr_Call): unknown {+ const obj: any = {};+ message.target !== undefined && (obj.target = message.target ? Expr.toJSON(message.target) : undefined);+ message.function !== undefined && (obj.function = message.function);+ if (message.args) {+ obj.args = message.args.map((e) => e ? Expr.toJSON(e) : undefined);+ } else {+ obj.args = [];+ }+ return obj;+ },++ fromPartial(object: DeepPartial<Expr_Call>): Expr_Call {+ const message = createBaseExpr_Call();+ message.target = (object.target !== undefined && object.target !== null)+ ? Expr.fromPartial(object.target)+ : undefined;+ message.function = object.function ?? "";+ message.args = object.args?.map((e) => Expr.fromPartial(e)) || [];+ return message;+ },+};++function createBaseExpr_CreateList(): Expr_CreateList {+ return { elements: [], optionalIndices: [] };+}++export const Expr_CreateList = {+ encode(message: Expr_CreateList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ for (const v of message.elements) {+ Expr.encode(v!, writer.uint32(10).fork()).ldelim();+ }+ writer.uint32(18).fork();+ for (const v of message.optionalIndices) {+ writer.int32(v);+ }+ writer.ldelim();+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): Expr_CreateList {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseExpr_CreateList();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.elements.push(Expr.decode(reader, reader.uint32()));+ break;+ case 2:+ if ((tag & 7) === 2) {+ const end2 = reader.uint32() + reader.pos;+ while (reader.pos < end2) {+ message.optionalIndices.push(reader.int32());+ }+ } else {+ message.optionalIndices.push(reader.int32());+ }+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): Expr_CreateList {+ return {+ elements: Array.isArray(object?.elements) ? object.elements.map((e: any) => Expr.fromJSON(e)) : [],+ optionalIndices: Array.isArray(object?.optionalIndices) ? object.optionalIndices.map((e: any) => Number(e)) : [],+ };+ },++ toJSON(message: Expr_CreateList): unknown {+ const obj: any = {};+ if (message.elements) {+ obj.elements = message.elements.map((e) => e ? Expr.toJSON(e) : undefined);+ } else {+ obj.elements = [];+ }+ if (message.optionalIndices) {+ obj.optionalIndices = message.optionalIndices.map((e) => Math.round(e));+ } else {+ obj.optionalIndices = [];+ }+ return obj;+ },++ fromPartial(object: DeepPartial<Expr_CreateList>): Expr_CreateList {+ const message = createBaseExpr_CreateList();+ message.elements = object.elements?.map((e) => Expr.fromPartial(e)) || [];+ message.optionalIndices = object.optionalIndices?.map((e) => e) || [];+ return message;+ },+};++function createBaseExpr_CreateStruct(): Expr_CreateStruct {+ return { messageName: "", entries: [] };+}++export const Expr_CreateStruct = {+ encode(message: Expr_CreateStruct, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.messageName !== "") {+ writer.uint32(10).string(message.messageName);+ }+ for (const v of message.entries) {+ Expr_CreateStruct_Entry.encode(v!, writer.uint32(18).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): Expr_CreateStruct {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseExpr_CreateStruct();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.messageName = reader.string();+ break;+ case 2:+ message.entries.push(Expr_CreateStruct_Entry.decode(reader, reader.uint32()));+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): Expr_CreateStruct {+ return {+ messageName: isSet(object.messageName) ? String(object.messageName) : "",+ entries: Array.isArray(object?.entries)+ ? object.entries.map((e: any) => Expr_CreateStruct_Entry.fromJSON(e))+ : [],+ };+ },++ toJSON(message: Expr_CreateStruct): unknown {+ const obj: any = {};+ message.messageName !== undefined && (obj.messageName = message.messageName);+ if (message.entries) {+ obj.entries = message.entries.map((e) => e ? Expr_CreateStruct_Entry.toJSON(e) : undefined);+ } else {+ obj.entries = [];+ }+ return obj;+ },++ fromPartial(object: DeepPartial<Expr_CreateStruct>): Expr_CreateStruct {+ const message = createBaseExpr_CreateStruct();+ message.messageName = object.messageName ?? "";+ message.entries = object.entries?.map((e) => Expr_CreateStruct_Entry.fromPartial(e)) || [];+ return message;+ },+};++function createBaseExpr_CreateStruct_Entry(): Expr_CreateStruct_Entry {+ return { id: 0, fieldKey: undefined, mapKey: undefined, value: undefined, optionalEntry: false };+}++export const Expr_CreateStruct_Entry = {+ encode(message: Expr_CreateStruct_Entry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.id !== 0) {+ writer.uint32(8).int64(message.id);+ }+ if (message.fieldKey !== undefined) {+ writer.uint32(18).string(message.fieldKey);+ }+ if (message.mapKey !== undefined) {+ Expr.encode(message.mapKey, writer.uint32(26).fork()).ldelim();+ }+ if (message.value !== undefined) {+ Expr.encode(message.value, writer.uint32(34).fork()).ldelim();+ }+ if (message.optionalEntry === true) {+ writer.uint32(40).bool(message.optionalEntry);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): Expr_CreateStruct_Entry {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseExpr_CreateStruct_Entry();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.id = longToNumber(reader.int64() as Long);+ break;+ case 2:+ message.fieldKey = reader.string();+ break;+ case 3:+ message.mapKey = Expr.decode(reader, reader.uint32());+ break;+ case 4:+ message.value = Expr.decode(reader, reader.uint32());+ break;+ case 5:+ message.optionalEntry = reader.bool();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): Expr_CreateStruct_Entry {+ return {+ id: isSet(object.id) ? Number(object.id) : 0,+ fieldKey: isSet(object.fieldKey) ? String(object.fieldKey) : undefined,+ mapKey: isSet(object.mapKey) ? Expr.fromJSON(object.mapKey) : undefined,+ value: isSet(object.value) ? Expr.fromJSON(object.value) : undefined,+ optionalEntry: isSet(object.optionalEntry) ? Boolean(object.optionalEntry) : false,+ };+ },++ toJSON(message: Expr_CreateStruct_Entry): unknown {+ const obj: any = {};+ message.id !== undefined && (obj.id = Math.round(message.id));+ message.fieldKey !== undefined && (obj.fieldKey = message.fieldKey);+ message.mapKey !== undefined && (obj.mapKey = message.mapKey ? Expr.toJSON(message.mapKey) : undefined);+ message.value !== undefined && (obj.value = message.value ? Expr.toJSON(message.value) : undefined);+ message.optionalEntry !== undefined && (obj.optionalEntry = message.optionalEntry);+ return obj;+ },++ fromPartial(object: DeepPartial<Expr_CreateStruct_Entry>): Expr_CreateStruct_Entry {+ const message = createBaseExpr_CreateStruct_Entry();+ message.id = object.id ?? 0;+ message.fieldKey = object.fieldKey ?? undefined;+ message.mapKey = (object.mapKey !== undefined && object.mapKey !== null)+ ? Expr.fromPartial(object.mapKey)+ : undefined;+ message.value = (object.value !== undefined && object.value !== null) ? Expr.fromPartial(object.value) : undefined;+ message.optionalEntry = object.optionalEntry ?? false;+ return message;+ },+};++function createBaseExpr_Comprehension(): Expr_Comprehension {+ return {+ iterVar: "",+ iterRange: undefined,+ accuVar: "",+ accuInit: undefined,+ loopCondition: undefined,+ loopStep: undefined,+ result: undefined,+ };+}++export const Expr_Comprehension = {+ encode(message: Expr_Comprehension, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.iterVar !== "") {+ writer.uint32(10).string(message.iterVar);+ }+ if (message.iterRange !== undefined) {+ Expr.encode(message.iterRange, writer.uint32(18).fork()).ldelim();+ }+ if (message.accuVar !== "") {+ writer.uint32(26).string(message.accuVar);+ }+ if (message.accuInit !== undefined) {+ Expr.encode(message.accuInit, writer.uint32(34).fork()).ldelim();+ }+ if (message.loopCondition !== undefined) {+ Expr.encode(message.loopCondition, writer.uint32(42).fork()).ldelim();+ }+ if (message.loopStep !== undefined) {+ Expr.encode(message.loopStep, writer.uint32(50).fork()).ldelim();+ }+ if (message.result !== undefined) {+ Expr.encode(message.result, writer.uint32(58).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): Expr_Comprehension {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseExpr_Comprehension();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.iterVar = reader.string();+ break;+ case 2:+ message.iterRange = Expr.decode(reader, reader.uint32());+ break;+ case 3:+ message.accuVar = reader.string();+ break;+ case 4:+ message.accuInit = Expr.decode(reader, reader.uint32());+ break;+ case 5:+ message.loopCondition = Expr.decode(reader, reader.uint32());+ break;+ case 6:+ message.loopStep = Expr.decode(reader, reader.uint32());+ break;+ case 7:+ message.result = Expr.decode(reader, reader.uint32());+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): Expr_Comprehension {+ return {+ iterVar: isSet(object.iterVar) ? String(object.iterVar) : "",+ iterRange: isSet(object.iterRange) ? Expr.fromJSON(object.iterRange) : undefined,+ accuVar: isSet(object.accuVar) ? String(object.accuVar) : "",+ accuInit: isSet(object.accuInit) ? Expr.fromJSON(object.accuInit) : undefined,+ loopCondition: isSet(object.loopCondition) ? Expr.fromJSON(object.loopCondition) : undefined,+ loopStep: isSet(object.loopStep) ? Expr.fromJSON(object.loopStep) : undefined,+ result: isSet(object.result) ? Expr.fromJSON(object.result) : undefined,+ };+ },++ toJSON(message: Expr_Comprehension): unknown {+ const obj: any = {};+ message.iterVar !== undefined && (obj.iterVar = message.iterVar);+ message.iterRange !== undefined && (obj.iterRange = message.iterRange ? Expr.toJSON(message.iterRange) : undefined);+ message.accuVar !== undefined && (obj.accuVar = message.accuVar);+ message.accuInit !== undefined && (obj.accuInit = message.accuInit ? Expr.toJSON(message.accuInit) : undefined);+ message.loopCondition !== undefined &&+ (obj.loopCondition = message.loopCondition ? Expr.toJSON(message.loopCondition) : undefined);+ message.loopStep !== undefined && (obj.loopStep = message.loopStep ? Expr.toJSON(message.loopStep) : undefined);+ message.result !== undefined && (obj.result = message.result ? Expr.toJSON(message.result) : undefined);+ return obj;+ },++ fromPartial(object: DeepPartial<Expr_Comprehension>): Expr_Comprehension {+ const message = createBaseExpr_Comprehension();+ message.iterVar = object.iterVar ?? "";+ message.iterRange = (object.iterRange !== undefined && object.iterRange !== null)+ ? Expr.fromPartial(object.iterRange)+ : undefined;+ message.accuVar = object.accuVar ?? "";+ message.accuInit = (object.accuInit !== undefined && object.accuInit !== null)+ ? Expr.fromPartial(object.accuInit)+ : undefined;+ message.loopCondition = (object.loopCondition !== undefined && object.loopCondition !== null)+ ? Expr.fromPartial(object.loopCondition)+ : undefined;+ message.loopStep = (object.loopStep !== undefined && object.loopStep !== null)+ ? Expr.fromPartial(object.loopStep)+ : undefined;+ message.result = (object.result !== undefined && object.result !== null)+ ? Expr.fromPartial(object.result)+ : undefined;+ return message;+ },+};++function createBaseConstant(): Constant {+ return {+ nullValue: undefined,+ boolValue: undefined,+ int64Value: undefined,+ uint64Value: undefined,+ doubleValue: undefined,+ stringValue: undefined,+ bytesValue: undefined,+ durationValue: undefined,+ timestampValue: undefined,+ };+}++export const Constant = {+ encode(message: Constant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.nullValue !== undefined) {+ writer.uint32(8).int32(message.nullValue);+ }+ if (message.boolValue !== undefined) {+ writer.uint32(16).bool(message.boolValue);+ }+ if (message.int64Value !== undefined) {+ writer.uint32(24).int64(message.int64Value);+ }+ if (message.uint64Value !== undefined) {+ writer.uint32(32).uint64(message.uint64Value);+ }+ if (message.doubleValue !== undefined) {+ writer.uint32(41).double(message.doubleValue);+ }+ if (message.stringValue !== undefined) {+ writer.uint32(50).string(message.stringValue);+ }+ if (message.bytesValue !== undefined) {+ writer.uint32(58).bytes(message.bytesValue);+ }+ if (message.durationValue !== undefined) {+ Duration.encode(message.durationValue, writer.uint32(66).fork()).ldelim();+ }+ if (message.timestampValue !== undefined) {+ Timestamp.encode(toTimestamp(message.timestampValue), writer.uint32(74).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): Constant {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseConstant();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.nullValue = reader.int32() as any;+ break;+ case 2:+ message.boolValue = reader.bool();+ break;+ case 3:+ message.int64Value = longToNumber(reader.int64() as Long);+ break;+ case 4:+ message.uint64Value = longToNumber(reader.uint64() as Long);+ break;+ case 5:+ message.doubleValue = reader.double();+ break;+ case 6:+ message.stringValue = reader.string();+ break;+ case 7:+ message.bytesValue = reader.bytes();+ break;+ case 8:+ message.durationValue = Duration.decode(reader, reader.uint32());+ break;+ case 9:+ message.timestampValue = fromTimestamp(Timestamp.decode(reader, reader.uint32()));+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): Constant {+ return {+ nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,+ boolValue: isSet(object.boolValue) ? Boolean(object.boolValue) : undefined,+ int64Value: isSet(object.int64Value) ? Number(object.int64Value) : undefined,+ uint64Value: isSet(object.uint64Value) ? Number(object.uint64Value) : undefined,+ doubleValue: isSet(object.doubleValue) ? Number(object.doubleValue) : undefined,+ stringValue: isSet(object.stringValue) ? String(object.stringValue) : undefined,+ bytesValue: isSet(object.bytesValue) ? bytesFromBase64(object.bytesValue) : undefined,+ durationValue: isSet(object.durationValue) ? Duration.fromJSON(object.durationValue) : undefined,+ timestampValue: isSet(object.timestampValue) ? fromJsonTimestamp(object.timestampValue) : undefined,+ };+ },++ toJSON(message: Constant): unknown {+ const obj: any = {};+ message.nullValue !== undefined &&+ (obj.nullValue = message.nullValue !== undefined ? nullValueToJSON(message.nullValue) : undefined);+ message.boolValue !== undefined && (obj.boolValue = message.boolValue);+ message.int64Value !== undefined && (obj.int64Value = Math.round(message.int64Value));+ message.uint64Value !== undefined && (obj.uint64Value = Math.round(message.uint64Value));+ message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue);+ message.stringValue !== undefined && (obj.stringValue = message.stringValue);+ message.bytesValue !== undefined &&+ (obj.bytesValue = message.bytesValue !== undefined ? base64FromBytes(message.bytesValue) : undefined);+ message.durationValue !== undefined &&+ (obj.durationValue = message.durationValue ? Duration.toJSON(message.durationValue) : undefined);+ message.timestampValue !== undefined && (obj.timestampValue = message.timestampValue.toISOString());+ return obj;+ },++ fromPartial(object: DeepPartial<Constant>): Constant {+ const message = createBaseConstant();+ message.nullValue = object.nullValue ?? undefined;+ message.boolValue = object.boolValue ?? undefined;+ message.int64Value = object.int64Value ?? undefined;+ message.uint64Value = object.uint64Value ?? undefined;+ message.doubleValue = object.doubleValue ?? undefined;+ message.stringValue = object.stringValue ?? undefined;+ message.bytesValue = object.bytesValue ?? undefined;+ message.durationValue = (object.durationValue !== undefined && object.durationValue !== null)+ ? Duration.fromPartial(object.durationValue)+ : undefined;+ message.timestampValue = object.timestampValue ?? undefined;+ return message;+ },+};++function createBaseSourceInfo(): SourceInfo {+ return { syntaxVersion: "", location: "", lineOffsets: [], positions: {}, macroCalls: {} };+}++export const SourceInfo = {+ encode(message: SourceInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.syntaxVersion !== "") {+ writer.uint32(10).string(message.syntaxVersion);+ }+ if (message.location !== "") {+ writer.uint32(18).string(message.location);+ }+ writer.uint32(26).fork();+ for (const v of message.lineOffsets) {+ writer.int32(v);+ }+ writer.ldelim();+ Object.entries(message.positions).forEach(([key, value]) => {+ SourceInfo_PositionsEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).ldelim();+ });+ Object.entries(message.macroCalls).forEach(([key, value]) => {+ SourceInfo_MacroCallsEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).ldelim();+ });+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): SourceInfo {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseSourceInfo();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.syntaxVersion = reader.string();+ break;+ case 2:+ message.location = reader.string();+ break;+ case 3:+ if ((tag & 7) === 2) {+ const end2 = reader.uint32() + reader.pos;+ while (reader.pos < end2) {+ message.lineOffsets.push(reader.int32());+ }+ } else {+ message.lineOffsets.push(reader.int32());+ }+ break;+ case 4:+ const entry4 = SourceInfo_PositionsEntry.decode(reader, reader.uint32());+ if (entry4.value !== undefined) {+ message.positions[entry4.key] = entry4.value;+ }+ break;+ case 5:+ const entry5 = SourceInfo_MacroCallsEntry.decode(reader, reader.uint32());+ if (entry5.value !== undefined) {+ message.macroCalls[entry5.key] = entry5.value;+ }+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): SourceInfo {+ return {+ syntaxVersion: isSet(object.syntaxVersion) ? String(object.syntaxVersion) : "",+ location: isSet(object.location) ? String(object.location) : "",+ lineOffsets: Array.isArray(object?.lineOffsets) ? object.lineOffsets.map((e: any) => Number(e)) : [],+ positions: isObject(object.positions)+ ? Object.entries(object.positions).reduce<{ [key: number]: number }>((acc, [key, value]) => {+ acc[Number(key)] = Number(value);+ return acc;+ }, {})+ : {},+ macroCalls: isObject(object.macroCalls)+ ? Object.entries(object.macroCalls).reduce<{ [key: number]: Expr }>((acc, [key, value]) => {+ acc[Number(key)] = Expr.fromJSON(value);+ return acc;+ }, {})+ : {},+ };+ },++ toJSON(message: SourceInfo): unknown {+ const obj: any = {};+ message.syntaxVersion !== undefined && (obj.syntaxVersion = message.syntaxVersion);+ message.location !== undefined && (obj.location = message.location);+ if (message.lineOffsets) {+ obj.lineOffsets = message.lineOffsets.map((e) => Math.round(e));+ } else {+ obj.lineOffsets = [];+ }+ obj.positions = {};+ if (message.positions) {+ Object.entries(message.positions).forEach(([k, v]) => {+ obj.positions[k] = Math.round(v);+ });+ }+ obj.macroCalls = {};+ if (message.macroCalls) {+ Object.entries(message.macroCalls).forEach(([k, v]) => {+ obj.macroCalls[k] = Expr.toJSON(v);+ });+ }+ return obj;+ },++ fromPartial(object: DeepPartial<SourceInfo>): SourceInfo {+ const message = createBaseSourceInfo();+ message.syntaxVersion = object.syntaxVersion ?? "";+ message.location = object.location ?? "";+ message.lineOffsets = object.lineOffsets?.map((e) => e) || [];+ message.positions = Object.entries(object.positions ?? {}).reduce<{ [key: number]: number }>(+ (acc, [key, value]) => {+ if (value !== undefined) {+ acc[Number(key)] = Number(value);+ }+ return acc;+ },+ {},+ );+ message.macroCalls = Object.entries(object.macroCalls ?? {}).reduce<{ [key: number]: Expr }>(+ (acc, [key, value]) => {+ if (value !== undefined) {+ acc[Number(key)] = Expr.fromPartial(value);+ }+ return acc;+ },+ {},+ );+ return message;+ },+};++function createBaseSourceInfo_PositionsEntry(): SourceInfo_PositionsEntry {+ return { key: 0, value: 0 };+}++export const SourceInfo_PositionsEntry = {+ encode(message: SourceInfo_PositionsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.key !== 0) {+ writer.uint32(8).int64(message.key);+ }+ if (message.value !== 0) {+ writer.uint32(16).int32(message.value);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): SourceInfo_PositionsEntry {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseSourceInfo_PositionsEntry();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.key = longToNumber(reader.int64() as Long);+ break;+ case 2:+ message.value = reader.int32();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): SourceInfo_PositionsEntry {+ return { key: isSet(object.key) ? Number(object.key) : 0, value: isSet(object.value) ? Number(object.value) : 0 };+ },++ toJSON(message: SourceInfo_PositionsEntry): unknown {+ const obj: any = {};+ message.key !== undefined && (obj.key = Math.round(message.key));+ message.value !== undefined && (obj.value = Math.round(message.value));+ return obj;+ },++ fromPartial(object: DeepPartial<SourceInfo_PositionsEntry>): SourceInfo_PositionsEntry {+ const message = createBaseSourceInfo_PositionsEntry();+ message.key = object.key ?? 0;+ message.value = object.value ?? 0;+ return message;+ },+};++function createBaseSourceInfo_MacroCallsEntry(): SourceInfo_MacroCallsEntry {+ return { key: 0, value: undefined };+}++export const SourceInfo_MacroCallsEntry = {+ encode(message: SourceInfo_MacroCallsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.key !== 0) {+ writer.uint32(8).int64(message.key);+ }+ if (message.value !== undefined) {+ Expr.encode(message.value, writer.uint32(18).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): SourceInfo_MacroCallsEntry {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseSourceInfo_MacroCallsEntry();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.key = longToNumber(reader.int64() as Long);+ break;+ case 2:+ message.value = Expr.decode(reader, reader.uint32());+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): SourceInfo_MacroCallsEntry {+ return {+ key: isSet(object.key) ? Number(object.key) : 0,+ value: isSet(object.value) ? Expr.fromJSON(object.value) : undefined,+ };+ },++ toJSON(message: SourceInfo_MacroCallsEntry): unknown {+ const obj: any = {};+ message.key !== undefined && (obj.key = Math.round(message.key));+ message.value !== undefined && (obj.value = message.value ? Expr.toJSON(message.value) : undefined);+ return obj;+ },++ fromPartial(object: DeepPartial<SourceInfo_MacroCallsEntry>): SourceInfo_MacroCallsEntry {+ const message = createBaseSourceInfo_MacroCallsEntry();+ message.key = object.key ?? 0;+ message.value = (object.value !== undefined && object.value !== null) ? Expr.fromPartial(object.value) : undefined;+ return message;+ },+};++function createBaseSourcePosition(): SourcePosition {+ return { location: "", offset: 0, line: 0, column: 0 };+}++export const SourcePosition = {+ encode(message: SourcePosition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.location !== "") {+ writer.uint32(10).string(message.location);+ }+ if (message.offset !== 0) {+ writer.uint32(16).int32(message.offset);+ }+ if (message.line !== 0) {+ writer.uint32(24).int32(message.line);+ }+ if (message.column !== 0) {+ writer.uint32(32).int32(message.column);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): SourcePosition {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseSourcePosition();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.location = reader.string();+ break;+ case 2:+ message.offset = reader.int32();+ break;+ case 3:+ message.line = reader.int32();+ break;+ case 4:+ message.column = reader.int32();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): SourcePosition {+ return {+ location: isSet(object.location) ? String(object.location) : "",+ offset: isSet(object.offset) ? Number(object.offset) : 0,+ line: isSet(object.line) ? Number(object.line) : 0,+ column: isSet(object.column) ? Number(object.column) : 0,+ };+ },++ toJSON(message: SourcePosition): unknown {+ const obj: any = {};+ message.location !== undefined && (obj.location = message.location);+ message.offset !== undefined && (obj.offset = Math.round(message.offset));+ message.line !== undefined && (obj.line = Math.round(message.line));+ message.column !== undefined && (obj.column = Math.round(message.column));+ return obj;+ },++ fromPartial(object: DeepPartial<SourcePosition>): SourcePosition {+ const message = createBaseSourcePosition();+ message.location = object.location ?? "";+ message.offset = object.offset ?? 0;+ message.line = object.line ?? 0;+ message.column = object.column ?? 0;+ return message;+ },+};++declare var self: any | undefined;+declare var window: any | undefined;+declare var global: any | undefined;+var globalThis: any = (() => {+ if (typeof globalThis !== "undefined") {+ return globalThis;+ }+ if (typeof self !== "undefined") {+ return self;+ }+ if (typeof window !== "undefined") {+ return window;+ }+ if (typeof global !== "undefined") {+ return global;+ }+ throw "Unable to locate global object";+})();++function bytesFromBase64(b64: string): Uint8Array {+ if (globalThis.Buffer) {+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));+ } else {+ const bin = globalThis.atob(b64);+ const arr = new Uint8Array(bin.length);+ for (let i = 0; i < bin.length; ++i) {+ arr[i] = bin.charCodeAt(i);+ }+ return arr;+ }+}++function base64FromBytes(arr: Uint8Array): string {+ if (globalThis.Buffer) {+ return globalThis.Buffer.from(arr).toString("base64");+ } else {+ const bin: string[] = [];+ arr.forEach((byte) => {+ bin.push(String.fromCharCode(byte));+ });+ return globalThis.btoa(bin.join(""));+ }+}++type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;++export type DeepPartial<T> = T extends Builtin ? T+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }+ : Partial<T>;++function toTimestamp(date: Date): Timestamp {+ const seconds = date.getTime() / 1_000;+ const nanos = (date.getTime() % 1_000) * 1_000_000;+ return { seconds, nanos };+}++function fromTimestamp(t: Timestamp): Date {+ let millis = t.seconds * 1_000;+ millis += t.nanos / 1_000_000;+ return new Date(millis);+}++function fromJsonTimestamp(o: any): Date {+ if (o instanceof Date) {+ return o;+ } else if (typeof o === "string") {+ return new Date(o);+ } else {+ return fromTimestamp(Timestamp.fromJSON(o));+ }+}++function longToNumber(long: Long): number {+ if (long.gt(Number.MAX_SAFE_INTEGER)) {+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");+ }+ return long.toNumber();+}++// If you get a compile-error about 'Constructor<Long> and ... have no overlap',+// add '--ts_proto_opt=esModuleInterop=true' as a flag when calling 'protoc'.+if (_m0.util.Long !== Long) {+ _m0.util.Long = Long as any;+ _m0.configure();+}++function isObject(value: any): boolean {+ return typeof value === "object" && value !== null;+}++function isSet(value: any): boolean {+ return value !== null && value !== undefined;+}diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.tsindex d3fee42ef9..89cc93b414 100644--- a/frontend/src/types/proto/google/protobuf/descriptor.ts+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts@@ -42,13 +42,9 @@ export interface FileDescriptorProto {sourceCodeInfo?: SourceCodeInfo;/*** The syntax of the proto file.- * The supported values are "proto2", "proto3", and "editions".- *- * If `edition` is present, this value must be "editions".+ * The supported values are "proto2" and "proto3".*/syntax: string;- /** The edition of the proto file, which is an opaque string. */- edition: string;}/** Describes a message type. */@@ -623,10 +619,6 @@ export interface MessageOptions {*/deprecated: boolean;/**- * NOTE: Do not set the option in .proto files. Always use the maps syntax- * instead. The option should only be implicitly set by the proto compiler- * parser.- ** Whether the message is an automatically generated map entry type for the* maps field.*@@ -644,23 +636,12 @@ export interface MessageOptions {* use a native map in the target language to hold the keys and values.* The reflection APIs in such implementations still need to work as* if the field is a repeated message field.- */- mapEntry: boolean;- /**- * Enable the legacy handling of JSON field name conflicts. This lowercases- * and strips underscored from the fields before comparison in proto3 only.- * The new behavior takes `json_name` into account and applies to proto2 as- * well.*- * This should only be used as a temporary measure against broken builds due- * to the change in behavior for JSON field name conflicts.- *- * TODO(b/261750190) This is legacy behavior we plan to remove once downstream- * teams have had time to migrate.- *- * @deprecated+ * NOTE: Do not set the option in .proto files. Always use the maps syntax+ * instead. The option should only be implicitly set by the proto compiler+ * parser.*/- deprecatedLegacyJsonFieldConflicts: boolean;+ mapEntry: boolean;/** The parser stores options it doesn't recognize here. See above. */uninterpretedOption: UninterpretedOption[];}@@ -724,8 +705,11 @@ export interface FieldOptions {* check its required fields, regardless of whether or not the message has* been parsed.*- * As of May 2022, lazy verifies the contents of the byte stream during- * parsing. An invalid byte stream will cause the overall parsing to fail.+ * As of 2021, lazy does no correctness checks on the byte stream during+ * parsing. This may lead to crashes if and when an invalid byte stream is+ * finally parsed upon access.+ *+ * TODO(b/211906113): Enable validation on lazy fields.*/lazy: boolean;/**@@ -743,13 +727,6 @@ export interface FieldOptions {deprecated: boolean;/** For Google-internal migration only. Do not use. */weak: boolean;- /**- * Indicate that the field value should not be printed out when using debug- * formats, e.g. when the field contains sensitive credentials.- */- debugRedact: boolean;- retention: FieldOptions_OptionRetention;- target: FieldOptions_OptionTargetType;/** The parser stores options it doesn't recognize here. See above. */uninterpretedOption: UninterpretedOption[];}@@ -836,137 +813,6 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string {}}-/**- * If set to RETENTION_SOURCE, the option will be omitted from the binary.- * Note: as of January 2023, support for this is in progress and does not yet- * have an effect (b/264593489).- */-export enum FieldOptions_OptionRetention {- RETENTION_UNKNOWN = 0,- RETENTION_RUNTIME = 1,- RETENTION_SOURCE = 2,- UNRECOGNIZED = -1,-}--export function fieldOptions_OptionRetentionFromJSON(object: any): FieldOptions_OptionRetention {- switch (object) {- case 0:- case "RETENTION_UNKNOWN":- return FieldOptions_OptionRetention.RETENTION_UNKNOWN;- case 1:- case "RETENTION_RUNTIME":- return FieldOptions_OptionRetention.RETENTION_RUNTIME;- case 2:- case "RETENTION_SOURCE":- return FieldOptions_OptionRetention.RETENTION_SOURCE;- case -1:- case "UNRECOGNIZED":- default:- return FieldOptions_OptionRetention.UNRECOGNIZED;- }-}--export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRetention): string {- switch (object) {- case FieldOptions_OptionRetention.RETENTION_UNKNOWN:- return "RETENTION_UNKNOWN";- case FieldOptions_OptionRetention.RETENTION_RUNTIME:- return "RETENTION_RUNTIME";- case FieldOptions_OptionRetention.RETENTION_SOURCE:- return "RETENTION_SOURCE";- case FieldOptions_OptionRetention.UNRECOGNIZED:- default:- return "UNRECOGNIZED";- }-}--/**- * This indicates the types of entities that the field may apply to when used- * as an option. If it is unset, then the field may be freely used as an- * option on any kind of entity. Note: as of January 2023, support for this is- * in progress and does not yet have an effect (b/264593489).- */-export enum FieldOptions_OptionTargetType {- TARGET_TYPE_UNKNOWN = 0,- TARGET_TYPE_FILE = 1,- TARGET_TYPE_EXTENSION_RANGE = 2,- TARGET_TYPE_MESSAGE = 3,- TARGET_TYPE_FIELD = 4,- TARGET_TYPE_ONEOF = 5,- TARGET_TYPE_ENUM = 6,- TARGET_TYPE_ENUM_ENTRY = 7,- TARGET_TYPE_SERVICE = 8,- TARGET_TYPE_METHOD = 9,- UNRECOGNIZED = -1,-}--export function fieldOptions_OptionTargetTypeFromJSON(object: any): FieldOptions_OptionTargetType {- switch (object) {- case 0:- case "TARGET_TYPE_UNKNOWN":- return FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN;- case 1:- case "TARGET_TYPE_FILE":- return FieldOptions_OptionTargetType.TARGET_TYPE_FILE;- case 2:- case "TARGET_TYPE_EXTENSION_RANGE":- return FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE;- case 3:- case "TARGET_TYPE_MESSAGE":- return FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE;- case 4:- case "TARGET_TYPE_FIELD":- return FieldOptions_OptionTargetType.TARGET_TYPE_FIELD;- case 5:- case "TARGET_TYPE_ONEOF":- return FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF;- case 6:- case "TARGET_TYPE_ENUM":- return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM;- case 7:- case "TARGET_TYPE_ENUM_ENTRY":- return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY;- case 8:- case "TARGET_TYPE_SERVICE":- return FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE;- case 9:- case "TARGET_TYPE_METHOD":- return FieldOptions_OptionTargetType.TARGET_TYPE_METHOD;- case -1:- case "UNRECOGNIZED":- default:- return FieldOptions_OptionTargetType.UNRECOGNIZED;- }-}--export function fieldOptions_OptionTargetTypeToJSON(object: FieldOptions_OptionTargetType): string {- switch (object) {- case FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN:- return "TARGET_TYPE_UNKNOWN";- case FieldOptions_OptionTargetType.TARGET_TYPE_FILE:- return "TARGET_TYPE_FILE";- case FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE:- return "TARGET_TYPE_EXTENSION_RANGE";- case FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE:- return "TARGET_TYPE_MESSAGE";- case FieldOptions_OptionTargetType.TARGET_TYPE_FIELD:- return "TARGET_TYPE_FIELD";- case FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF:- return "TARGET_TYPE_ONEOF";- case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM:- return "TARGET_TYPE_ENUM";- case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY:- return "TARGET_TYPE_ENUM_ENTRY";- case FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE:- return "TARGET_TYPE_SERVICE";- case FieldOptions_OptionTargetType.TARGET_TYPE_METHOD:- return "TARGET_TYPE_METHOD";- case FieldOptions_OptionTargetType.UNRECOGNIZED:- default:- return "UNRECOGNIZED";- }-}-export interface OneofOptions {/** The parser stores options it doesn't recognize here. See above. */uninterpretedOption: UninterpretedOption[];@@ -985,17 +831,6 @@ export interface EnumOptions {* is a formalization for deprecating enums.*/deprecated: boolean;- /**- * Enable the legacy handling of JSON field name conflicts. This lowercases- * and strips underscored from the fields before comparison in proto3 only.- * The new behavior takes `json_name` into account and applies to proto2 as- * well.- * TODO(b/261750190) Remove this legacy behavior once downstream teams have- * had time to migrate.- *- * @deprecated- */- deprecatedLegacyJsonFieldConflicts: boolean;/** The parser stores options it doesn't recognize here. See above. */uninterpretedOption: UninterpretedOption[];}@@ -1287,57 +1122,10 @@ export interface GeneratedCodeInfo_Annotation {begin: number;/*** Identifies the ending offset in bytes in the generated code that- * relates to the identified object. The end offset should be one past+ * relates to the identified offset. The end offset should be one past* the last relevant byte (so the length of the text = end - begin).*/end: number;- semantic: GeneratedCodeInfo_Annotation_Semantic;-}--/**- * Represents the identified object's effect on the element in the original- * .proto file.- */-export enum GeneratedCodeInfo_Annotation_Semantic {- /** NONE - There is no effect or the effect is indescribable. */- NONE = 0,- /** SET - The element is set or otherwise mutated. */- SET = 1,- /** ALIAS - An alias to the element is returned. */- ALIAS = 2,- UNRECOGNIZED = -1,-}--export function generatedCodeInfo_Annotation_SemanticFromJSON(object: any): GeneratedCodeInfo_Annotation_Semantic {- switch (object) {- case 0:- case "NONE":- return GeneratedCodeInfo_Annotation_Semantic.NONE;- case 1:- case "SET":- return GeneratedCodeInfo_Annotation_Semantic.SET;- case 2:- case "ALIAS":- return GeneratedCodeInfo_Annotation_Semantic.ALIAS;- case -1:- case "UNRECOGNIZED":- default:- return GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED;- }-}--export function generatedCodeInfo_Annotation_SemanticToJSON(object: GeneratedCodeInfo_Annotation_Semantic): string {- switch (object) {- case GeneratedCodeInfo_Annotation_Semantic.NONE:- return "NONE";- case GeneratedCodeInfo_Annotation_Semantic.SET:- return "SET";- case GeneratedCodeInfo_Annotation_Semantic.ALIAS:- return "ALIAS";- case GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED:- default:- return "UNRECOGNIZED";- }}function createBaseFileDescriptorSet(): FileDescriptorSet {@@ -1405,7 +1193,6 @@ function createBaseFileDescriptorProto(): FileDescriptorProto {options: undefined,sourceCodeInfo: undefined,syntax: "",- edition: "",};}@@ -1451,9 +1238,6 @@ export const FileDescriptorProto = {if (message.syntax !== "") {writer.uint32(98).string(message.syntax);}- if (message.edition !== "") {- writer.uint32(106).string(message.edition);- }return writer;},@@ -1514,9 +1298,6 @@ export const FileDescriptorProto = {case 12:message.syntax = reader.string();break;- case 13:- message.edition = reader.string();- break;default:reader.skipType(tag & 7);break;@@ -1545,7 +1326,6 @@ export const FileDescriptorProto = {options: isSet(object.options) ? FileOptions.fromJSON(object.options) : undefined,sourceCodeInfo: isSet(object.sourceCodeInfo) ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) : undefined,syntax: isSet(object.syntax) ? String(object.syntax) : "",- edition: isSet(object.edition) ? String(object.edition) : "",};},@@ -1592,7 +1372,6 @@ export const FileDescriptorProto = {message.sourceCodeInfo !== undefined &&(obj.sourceCodeInfo = message.sourceCodeInfo ? SourceCodeInfo.toJSON(message.sourceCodeInfo) : undefined);message.syntax !== undefined && (obj.syntax = message.syntax);- message.edition !== undefined && (obj.edition = message.edition);return obj;},@@ -1614,7 +1393,6 @@ export const FileDescriptorProto = {? SourceCodeInfo.fromPartial(object.sourceCodeInfo): undefined;message.syntax = object.syntax ?? "";- message.edition = object.edition ?? "";return message;},};@@ -2871,7 +2649,6 @@ function createBaseMessageOptions(): MessageOptions {noStandardDescriptorAccessor: false,deprecated: false,mapEntry: false,- deprecatedLegacyJsonFieldConflicts: false,uninterpretedOption: [],};}@@ -2890,9 +2667,6 @@ export const MessageOptions = {if (message.mapEntry === true) {writer.uint32(56).bool(message.mapEntry);}- if (message.deprecatedLegacyJsonFieldConflicts === true) {- writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts);- }for (const v of message.uninterpretedOption) {UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();}@@ -2918,9 +2692,6 @@ export const MessageOptions = {case 7:message.mapEntry = reader.bool();break;- case 11:- message.deprecatedLegacyJsonFieldConflicts = reader.bool();- break;case 999:message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32()));break;@@ -2940,9 +2711,6 @@ export const MessageOptions = {: false,deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false,mapEntry: isSet(object.mapEntry) ? Boolean(object.mapEntry) : false,- deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts)- ? Boolean(object.deprecatedLegacyJsonFieldConflicts)- : false,uninterpretedOption: Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)): [],@@ -2956,8 +2724,6 @@ export const MessageOptions = {(obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor);message.deprecated !== undefined && (obj.deprecated = message.deprecated);message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry);- message.deprecatedLegacyJsonFieldConflicts !== undefined &&- (obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts);if (message.uninterpretedOption) {obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined);} else {@@ -2972,7 +2738,6 @@ export const MessageOptions = {message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false;message.deprecated = object.deprecated ?? false;message.mapEntry = object.mapEntry ?? false;- message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false;message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];return message;},@@ -2987,9 +2752,6 @@ function createBaseFieldOptions(): FieldOptions {unverifiedLazy: false,deprecated: false,weak: false,- debugRedact: false,- retention: 0,- target: 0,uninterpretedOption: [],};}@@ -3017,15 +2779,6 @@ export const FieldOptions = {if (message.weak === true) {writer.uint32(80).bool(message.weak);}- if (message.debugRedact === true) {- writer.uint32(128).bool(message.debugRedact);- }- if (message.retention !== 0) {- writer.uint32(136).int32(message.retention);- }- if (message.target !== 0) {- writer.uint32(144).int32(message.target);- }for (const v of message.uninterpretedOption) {UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();}@@ -3060,15 +2813,6 @@ export const FieldOptions = {case 10:message.weak = reader.bool();break;- case 16:- message.debugRedact = reader.bool();- break;- case 17:- message.retention = reader.int32() as any;- break;- case 18:- message.target = reader.int32() as any;- break;case 999:message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32()));break;@@ -3089,9 +2833,6 @@ export const FieldOptions = {unverifiedLazy: isSet(object.unverifiedLazy) ? Boolean(object.unverifiedLazy) : false,deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false,weak: isSet(object.weak) ? Boolean(object.weak) : false,- debugRedact: isSet(object.debugRedact) ? Boolean(object.debugRedact) : false,- retention: isSet(object.retention) ? fieldOptions_OptionRetentionFromJSON(object.retention) : 0,- target: isSet(object.target) ? fieldOptions_OptionTargetTypeFromJSON(object.target) : 0,uninterpretedOption: Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)): [],@@ -3107,9 +2848,6 @@ export const FieldOptions = {message.unverifiedLazy !== undefined && (obj.unverifiedLazy = message.unverifiedLazy);message.deprecated !== undefined && (obj.deprecated = message.deprecated);message.weak !== undefined && (obj.weak = message.weak);- message.debugRedact !== undefined && (obj.debugRedact = message.debugRedact);- message.retention !== undefined && (obj.retention = fieldOptions_OptionRetentionToJSON(message.retention));- message.target !== undefined && (obj.target = fieldOptions_OptionTargetTypeToJSON(message.target));if (message.uninterpretedOption) {obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined);} else {@@ -3127,9 +2865,6 @@ export const FieldOptions = {message.unverifiedLazy = object.unverifiedLazy ?? false;message.deprecated = object.deprecated ?? false;message.weak = object.weak ?? false;- message.debugRedact = object.debugRedact ?? false;- message.retention = object.retention ?? 0;- message.target = object.target ?? 0;message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];return message;},@@ -3191,7 +2926,7 @@ export const OneofOptions = {};function createBaseEnumOptions(): EnumOptions {- return { allowAlias: false, deprecated: false, deprecatedLegacyJsonFieldConflicts: false, uninterpretedOption: [] };+ return { allowAlias: false, deprecated: false, uninterpretedOption: [] };}export const EnumOptions = {@@ -3202,9 +2937,6 @@ export const EnumOptions = {if (message.deprecated === true) {writer.uint32(24).bool(message.deprecated);}- if (message.deprecatedLegacyJsonFieldConflicts === true) {- writer.uint32(48).bool(message.deprecatedLegacyJsonFieldConflicts);- }for (const v of message.uninterpretedOption) {UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();}@@ -3224,9 +2956,6 @@ export const EnumOptions = {case 3:message.deprecated = reader.bool();break;- case 6:- message.deprecatedLegacyJsonFieldConflicts = reader.bool();- break;case 999:message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32()));break;@@ -3242,9 +2971,6 @@ export const EnumOptions = {return {allowAlias: isSet(object.allowAlias) ? Boolean(object.allowAlias) : false,deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false,- deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts)- ? Boolean(object.deprecatedLegacyJsonFieldConflicts)- : false,uninterpretedOption: Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)): [],@@ -3255,8 +2981,6 @@ export const EnumOptions = {const obj: any = {};message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias);message.deprecated !== undefined && (obj.deprecated = message.deprecated);- message.deprecatedLegacyJsonFieldConflicts !== undefined &&- (obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts);if (message.uninterpretedOption) {obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined);} else {@@ -3269,7 +2993,6 @@ export const EnumOptions = {const message = createBaseEnumOptions();message.allowAlias = object.allowAlias ?? false;message.deprecated = object.deprecated ?? false;- message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false;message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];return message;},@@ -3881,7 +3604,7 @@ export const GeneratedCodeInfo = {};function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation {- return { path: [], sourceFile: "", begin: 0, end: 0, semantic: 0 };+ return { path: [], sourceFile: "", begin: 0, end: 0 };}export const GeneratedCodeInfo_Annotation = {@@ -3900,9 +3623,6 @@ export const GeneratedCodeInfo_Annotation = {if (message.end !== 0) {writer.uint32(32).int32(message.end);}- if (message.semantic !== 0) {- writer.uint32(40).int32(message.semantic);- }return writer;},@@ -3932,9 +3652,6 @@ export const GeneratedCodeInfo_Annotation = {case 4:message.end = reader.int32();break;- case 5:- message.semantic = reader.int32() as any;- break;default:reader.skipType(tag & 7);break;@@ -3949,7 +3666,6 @@ export const GeneratedCodeInfo_Annotation = {sourceFile: isSet(object.sourceFile) ? String(object.sourceFile) : "",begin: isSet(object.begin) ? Number(object.begin) : 0,end: isSet(object.end) ? Number(object.end) : 0,- semantic: isSet(object.semantic) ? generatedCodeInfo_Annotation_SemanticFromJSON(object.semantic) : 0,};},@@ -3963,7 +3679,6 @@ export const GeneratedCodeInfo_Annotation = {message.sourceFile !== undefined && (obj.sourceFile = message.sourceFile);message.begin !== undefined && (obj.begin = Math.round(message.begin));message.end !== undefined && (obj.end = Math.round(message.end));- message.semantic !== undefined && (obj.semantic = generatedCodeInfo_Annotation_SemanticToJSON(message.semantic));return obj;},@@ -3973,7 +3688,6 @@ export const GeneratedCodeInfo_Annotation = {message.sourceFile = object.sourceFile ?? "";message.begin = object.begin ?? 0;message.end = object.end ?? 0;- message.semantic = object.semantic ?? 0;return message;},};diff --git a/frontend/src/types/proto/store/risk.ts b/frontend/src/types/proto/store/risk.tsnew file mode 100644index 0000000000..fb53aecc33--- /dev/null+++ b/frontend/src/types/proto/store/risk.ts@@ -0,0 +1,70 @@+/* eslint-disable */+import * as _m0 from "protobufjs/minimal";+import { ParsedExpr } from "../google/api/expr/v1alpha1/syntax";++export const protobufPackage = "bytebase.store";++export interface RiskExpression {+ expression?: ParsedExpr;+}++function createBaseRiskExpression(): RiskExpression {+ return { expression: undefined };+}++export const RiskExpression = {+ encode(message: RiskExpression, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.expression !== undefined) {+ ParsedExpr.encode(message.expression, writer.uint32(10).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): RiskExpression {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseRiskExpression();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.expression = ParsedExpr.decode(reader, reader.uint32());+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): RiskExpression {+ return { expression: isSet(object.expression) ? ParsedExpr.fromJSON(object.expression) : undefined };+ },++ toJSON(message: RiskExpression): unknown {+ const obj: any = {};+ message.expression !== undefined &&+ (obj.expression = message.expression ? ParsedExpr.toJSON(message.expression) : undefined);+ return obj;+ },++ fromPartial(object: DeepPartial<RiskExpression>): RiskExpression {+ const message = createBaseRiskExpression();+ message.expression = (object.expression !== undefined && object.expression !== null)+ ? ParsedExpr.fromPartial(object.expression)+ : undefined;+ return message;+ },+};++type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;++export type DeepPartial<T> = T extends Builtin ? T+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }+ : Partial<T>;++function isSet(value: any): boolean {+ return value !== null && value !== undefined;+}diff --git a/frontend/src/types/proto/v1/risk_service.ts b/frontend/src/types/proto/v1/risk_service.tsnew file mode 100644index 0000000000..6175e29233--- /dev/null+++ b/frontend/src/types/proto/v1/risk_service.ts@@ -0,0 +1,644 @@+/* eslint-disable */+import * as Long from "long";+import type { CallContext, CallOptions } from "nice-grpc-common";+import * as _m0 from "protobufjs/minimal";+import { ParsedExpr } from "../google/api/expr/v1alpha1/syntax";+import { FieldMask } from "../google/protobuf/field_mask";++export const protobufPackage = "bytebase.v1";++export interface ListRisksRequest {+ /**+ * The maximum number of risks to return. The service may return fewer than+ * this value.+ * If unspecified, at most 50 risks will be returned.+ * The maximum value is 1000; values above 1000 will be coerced to 1000.+ */+ pageSize: number;+ /**+ * A page token, received from a previous `ListRisks` call.+ * Provide this to retrieve the subsequent page.+ *+ * When paginating, all other parameters provided to `LiskRisks` must match+ * the call that provided the page token.+ */+ pageToken: string;+}++export interface ListRisksResponse {+ risks: Risk[];+ /**+ * A token, which can be sent as `page_token` to retrieve the next page.+ * If this field is omitted, there are no subsequent pages.+ */+ nextPageToken: string;+}++export interface UpdateRiskRequest {+ /**+ * The risk to update.+ *+ * The risk's `name` field is used to identify the risk to update.+ * Format: risks/{risk}+ */+ risk?: Risk;+ /** The list of fields to update. */+ updateMask?: string[];+}++export interface Risk {+ /** Format: risks/{risk} */+ name: string;+ /** system-generated unique identifier. */+ uid: string;+ namespace: Risk_Namespace;+ title: string;+ level: number;+ actions: RiskAction[];+ rules: RiskRule[];+}++export enum Risk_Namespace {+ NAMESPACE_UNSPECIFIED = 0,+ DDL = 1,+ DML = 2,+ CREATE_DATABASE = 3,+ UNRECOGNIZED = -1,+}++export function risk_NamespaceFromJSON(object: any): Risk_Namespace {+ switch (object) {+ case 0:+ case "NAMESPACE_UNSPECIFIED":+ return Risk_Namespace.NAMESPACE_UNSPECIFIED;+ case 1:+ case "DDL":+ return Risk_Namespace.DDL;+ case 2:+ case "DML":+ return Risk_Namespace.DML;+ case 3:+ case "CREATE_DATABASE":+ return Risk_Namespace.CREATE_DATABASE;+ case -1:+ case "UNRECOGNIZED":+ default:+ return Risk_Namespace.UNRECOGNIZED;+ }+}++export function risk_NamespaceToJSON(object: Risk_Namespace): string {+ switch (object) {+ case Risk_Namespace.NAMESPACE_UNSPECIFIED:+ return "NAMESPACE_UNSPECIFIED";+ case Risk_Namespace.DDL:+ return "DDL";+ case Risk_Namespace.DML:+ return "DML";+ case Risk_Namespace.CREATE_DATABASE:+ return "CREATE_DATABASE";+ case Risk_Namespace.UNRECOGNIZED:+ default:+ return "UNRECOGNIZED";+ }+}++export interface RiskAction {+ type: RiskAction_Type;+ /** Format: approvalTemplates/{approvalTemplate} */+ approvalTemplate?: string | undefined;+}++export enum RiskAction_Type {+ TYPE_UNSPECIFIED = 0,+ CHOOSE_APPROVAL_TEMPLATE = 1,+ UNRECOGNIZED = -1,+}++export function riskAction_TypeFromJSON(object: any): RiskAction_Type {+ switch (object) {+ case 0:+ case "TYPE_UNSPECIFIED":+ return RiskAction_Type.TYPE_UNSPECIFIED;+ case 1:+ case "CHOOSE_APPROVAL_TEMPLATE":+ return RiskAction_Type.CHOOSE_APPROVAL_TEMPLATE;+ case -1:+ case "UNRECOGNIZED":+ default:+ return RiskAction_Type.UNRECOGNIZED;+ }+}++export function riskAction_TypeToJSON(object: RiskAction_Type): string {+ switch (object) {+ case RiskAction_Type.TYPE_UNSPECIFIED:+ return "TYPE_UNSPECIFIED";+ case RiskAction_Type.CHOOSE_APPROVAL_TEMPLATE:+ return "CHOOSE_APPROVAL_TEMPLATE";+ case RiskAction_Type.UNRECOGNIZED:+ default:+ return "UNRECOGNIZED";+ }+}++export interface RiskRule {+ title: string;+ expression?: ParsedExpr;+ active: boolean;+}++function createBaseListRisksRequest(): ListRisksRequest {+ return { pageSize: 0, pageToken: "" };+}++export const ListRisksRequest = {+ encode(message: ListRisksRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.pageSize !== 0) {+ writer.uint32(8).int32(message.pageSize);+ }+ if (message.pageToken !== "") {+ writer.uint32(18).string(message.pageToken);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): ListRisksRequest {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseListRisksRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.pageSize = reader.int32();+ break;+ case 2:+ message.pageToken = reader.string();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): ListRisksRequest {+ return {+ pageSize: isSet(object.pageSize) ? Number(object.pageSize) : 0,+ pageToken: isSet(object.pageToken) ? String(object.pageToken) : "",+ };+ },++ toJSON(message: ListRisksRequest): unknown {+ const obj: any = {};+ message.pageSize !== undefined && (obj.pageSize = Math.round(message.pageSize));+ message.pageToken !== undefined && (obj.pageToken = message.pageToken);+ return obj;+ },++ fromPartial(object: DeepPartial<ListRisksRequest>): ListRisksRequest {+ const message = createBaseListRisksRequest();+ message.pageSize = object.pageSize ?? 0;+ message.pageToken = object.pageToken ?? "";+ return message;+ },+};++function createBaseListRisksResponse(): ListRisksResponse {+ return { risks: [], nextPageToken: "" };+}++export const ListRisksResponse = {+ encode(message: ListRisksResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ for (const v of message.risks) {+ Risk.encode(v!, writer.uint32(10).fork()).ldelim();+ }+ if (message.nextPageToken !== "") {+ writer.uint32(18).string(message.nextPageToken);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): ListRisksResponse {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseListRisksResponse();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.risks.push(Risk.decode(reader, reader.uint32()));+ break;+ case 2:+ message.nextPageToken = reader.string();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): ListRisksResponse {+ return {+ risks: Array.isArray(object?.risks) ? object.risks.map((e: any) => Risk.fromJSON(e)) : [],+ nextPageToken: isSet(object.nextPageToken) ? String(object.nextPageToken) : "",+ };+ },++ toJSON(message: ListRisksResponse): unknown {+ const obj: any = {};+ if (message.risks) {+ obj.risks = message.risks.map((e) => e ? Risk.toJSON(e) : undefined);+ } else {+ obj.risks = [];+ }+ message.nextPageToken !== undefined && (obj.nextPageToken = message.nextPageToken);+ return obj;+ },++ fromPartial(object: DeepPartial<ListRisksResponse>): ListRisksResponse {+ const message = createBaseListRisksResponse();+ message.risks = object.risks?.map((e) => Risk.fromPartial(e)) || [];+ message.nextPageToken = object.nextPageToken ?? "";+ return message;+ },+};++function createBaseUpdateRiskRequest(): UpdateRiskRequest {+ return { risk: undefined, updateMask: undefined };+}++export const UpdateRiskRequest = {+ encode(message: UpdateRiskRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.risk !== undefined) {+ Risk.encode(message.risk, writer.uint32(10).fork()).ldelim();+ }+ if (message.updateMask !== undefined) {+ FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): UpdateRiskRequest {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseUpdateRiskRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.risk = Risk.decode(reader, reader.uint32());+ break;+ case 2:+ message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): UpdateRiskRequest {+ return {+ risk: isSet(object.risk) ? Risk.fromJSON(object.risk) : undefined,+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,+ };+ },++ toJSON(message: UpdateRiskRequest): unknown {+ const obj: any = {};+ message.risk !== undefined && (obj.risk = message.risk ? Risk.toJSON(message.risk) : undefined);+ message.updateMask !== undefined && (obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask)));+ return obj;+ },++ fromPartial(object: DeepPartial<UpdateRiskRequest>): UpdateRiskRequest {+ const message = createBaseUpdateRiskRequest();+ message.risk = (object.risk !== undefined && object.risk !== null) ? Risk.fromPartial(object.risk) : undefined;+ message.updateMask = object.updateMask ?? undefined;+ return message;+ },+};++function createBaseRisk(): Risk {+ return { name: "", uid: "", namespace: 0, title: "", level: 0, actions: [], rules: [] };+}++export const Risk = {+ encode(message: Risk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.name !== "") {+ writer.uint32(10).string(message.name);+ }+ if (message.uid !== "") {+ writer.uint32(18).string(message.uid);+ }+ if (message.namespace !== 0) {+ writer.uint32(24).int32(message.namespace);+ }+ if (message.title !== "") {+ writer.uint32(34).string(message.title);+ }+ if (message.level !== 0) {+ writer.uint32(40).int64(message.level);+ }+ for (const v of message.actions) {+ RiskAction.encode(v!, writer.uint32(50).fork()).ldelim();+ }+ for (const v of message.rules) {+ RiskRule.encode(v!, writer.uint32(58).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): Risk {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseRisk();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.name = reader.string();+ break;+ case 2:+ message.uid = reader.string();+ break;+ case 3:+ message.namespace = reader.int32() as any;+ break;+ case 4:+ message.title = reader.string();+ break;+ case 5:+ message.level = longToNumber(reader.int64() as Long);+ break;+ case 6:+ message.actions.push(RiskAction.decode(reader, reader.uint32()));+ break;+ case 7:+ message.rules.push(RiskRule.decode(reader, reader.uint32()));+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): Risk {+ return {+ name: isSet(object.name) ? String(object.name) : "",+ uid: isSet(object.uid) ? String(object.uid) : "",+ namespace: isSet(object.namespace) ? risk_NamespaceFromJSON(object.namespace) : 0,+ title: isSet(object.title) ? String(object.title) : "",+ level: isSet(object.level) ? Number(object.level) : 0,+ actions: Array.isArray(object?.actions) ? object.actions.map((e: any) => RiskAction.fromJSON(e)) : [],+ rules: Array.isArray(object?.rules) ? object.rules.map((e: any) => RiskRule.fromJSON(e)) : [],+ };+ },++ toJSON(message: Risk): unknown {+ const obj: any = {};+ message.name !== undefined && (obj.name = message.name);+ message.uid !== undefined && (obj.uid = message.uid);+ message.namespace !== undefined && (obj.namespace = risk_NamespaceToJSON(message.namespace));+ message.title !== undefined && (obj.title = message.title);+ message.level !== undefined && (obj.level = Math.round(message.level));+ if (message.actions) {+ obj.actions = message.actions.map((e) => e ? RiskAction.toJSON(e) : undefined);+ } else {+ obj.actions = [];+ }+ if (message.rules) {+ obj.rules = message.rules.map((e) => e ? RiskRule.toJSON(e) : undefined);+ } else {+ obj.rules = [];+ }+ return obj;+ },++ fromPartial(object: DeepPartial<Risk>): Risk {+ const message = createBaseRisk();+ message.name = object.name ?? "";+ message.uid = object.uid ?? "";+ message.namespace = object.namespace ?? 0;+ message.title = object.title ?? "";+ message.level = object.level ?? 0;+ message.actions = object.actions?.map((e) => RiskAction.fromPartial(e)) || [];+ message.rules = object.rules?.map((e) => RiskRule.fromPartial(e)) || [];+ return message;+ },+};++function createBaseRiskAction(): RiskAction {+ return { type: 0, approvalTemplate: undefined };+}++export const RiskAction = {+ encode(message: RiskAction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.type !== 0) {+ writer.uint32(8).int32(message.type);+ }+ if (message.approvalTemplate !== undefined) {+ writer.uint32(18).string(message.approvalTemplate);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): RiskAction {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseRiskAction();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.type = reader.int32() as any;+ break;+ case 2:+ message.approvalTemplate = reader.string();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): RiskAction {+ return {+ type: isSet(object.type) ? riskAction_TypeFromJSON(object.type) : 0,+ approvalTemplate: isSet(object.approvalTemplate) ? String(object.approvalTemplate) : undefined,+ };+ },++ toJSON(message: RiskAction): unknown {+ const obj: any = {};+ message.type !== undefined && (obj.type = riskAction_TypeToJSON(message.type));+ message.approvalTemplate !== undefined && (obj.approvalTemplate = message.approvalTemplate);+ return obj;+ },++ fromPartial(object: DeepPartial<RiskAction>): RiskAction {+ const message = createBaseRiskAction();+ message.type = object.type ?? 0;+ message.approvalTemplate = object.approvalTemplate ?? undefined;+ return message;+ },+};++function createBaseRiskRule(): RiskRule {+ return { title: "", expression: undefined, active: false };+}++export const RiskRule = {+ encode(message: RiskRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.title !== "") {+ writer.uint32(10).string(message.title);+ }+ if (message.expression !== undefined) {+ ParsedExpr.encode(message.expression, writer.uint32(18).fork()).ldelim();+ }+ if (message.active === true) {+ writer.uint32(24).bool(message.active);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): RiskRule {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseRiskRule();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.title = reader.string();+ break;+ case 2:+ message.expression = ParsedExpr.decode(reader, reader.uint32());+ break;+ case 3:+ message.active = reader.bool();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): RiskRule {+ return {+ title: isSet(object.title) ? String(object.title) : "",+ expression: isSet(object.expression) ? ParsedExpr.fromJSON(object.expression) : undefined,+ active: isSet(object.active) ? Boolean(object.active) : false,+ };+ },++ toJSON(message: RiskRule): unknown {+ const obj: any = {};+ message.title !== undefined && (obj.title = message.title);+ message.expression !== undefined &&+ (obj.expression = message.expression ? ParsedExpr.toJSON(message.expression) : undefined);+ message.active !== undefined && (obj.active = message.active);+ return obj;+ },++ fromPartial(object: DeepPartial<RiskRule>): RiskRule {+ const message = createBaseRiskRule();+ message.title = object.title ?? "";+ message.expression = (object.expression !== undefined && object.expression !== null)+ ? ParsedExpr.fromPartial(object.expression)+ : undefined;+ message.active = object.active ?? false;+ return message;+ },+};++export type RiskServiceDefinition = typeof RiskServiceDefinition;+export const RiskServiceDefinition = {+ name: "RiskService",+ fullName: "bytebase.v1.RiskService",+ methods: {+ listRisks: {+ name: "ListRisks",+ requestType: ListRisksRequest,+ requestStream: false,+ responseType: ListRisksResponse,+ responseStream: false,+ options: {},+ },+ updateRisk: {+ name: "UpdateRisk",+ requestType: UpdateRiskRequest,+ requestStream: false,+ responseType: Risk,+ responseStream: false,+ options: {},+ },+ },+} as const;++export interface RiskServiceImplementation<CallContextExt = {}> {+ listRisks(request: ListRisksRequest, context: CallContext & CallContextExt): Promise<DeepPartial<ListRisksResponse>>;+ updateRisk(request: UpdateRiskRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Risk>>;+}++export interface RiskServiceClient<CallOptionsExt = {}> {+ listRisks(request: DeepPartial<ListRisksRequest>, options?: CallOptions & CallOptionsExt): Promise<ListRisksResponse>;+ updateRisk(request: DeepPartial<UpdateRiskRequest>, options?: CallOptions & CallOptionsExt): Promise<Risk>;+}++declare var self: any | undefined;+declare var window: any | undefined;+declare var global: any | undefined;+var globalThis: any = (() => {+ if (typeof globalThis !== "undefined") {+ return globalThis;+ }+ if (typeof self !== "undefined") {+ return self;+ }+ if (typeof window !== "undefined") {+ return window;+ }+ if (typeof global !== "undefined") {+ return global;+ }+ throw "Unable to locate global object";+})();++type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;++export type DeepPartial<T> = T extends Builtin ? T+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }+ : Partial<T>;++function longToNumber(long: Long): number {+ if (long.gt(Number.MAX_SAFE_INTEGER)) {+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");+ }+ return long.toNumber();+}++// If you get a compile-error about 'Constructor<Long> and ... have no overlap',+// add '--ts_proto_opt=esModuleInterop=true' as a flag when calling 'protoc'.+if (_m0.util.Long !== Long) {+ _m0.util.Long = Long as any;+ _m0.configure();+}++function isSet(value: any): boolean {+ return value !== null && value !== undefined;+}diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 7749ab7f1b..670001c1fc 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -280,7 +280,7 @@ FieldMapping saves the field names from user info API of identity provider.As we save all raw json string of user info response data into `principal.idp_user_info`,we can extract the relevant data based with `FieldMapping`.-e.g. For GitHub authenticated user API, it will return `login`, `name` and `email` in response.+e.g. For GitHub authenticated user API, it will return `login`, `name` and `email` in response.Then the identifier of FieldMapping will be `login`, display_name will be `name`,and email will be `email`.reference: https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-userdiff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 2a62ba0e00..7c590682ac 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -268,6 +268,19 @@- [ProjectService](#bytebase-v1-ProjectService)+- [v1/risk_service.proto](#v1_risk_service-proto)+ - [ListRisksRequest](#bytebase-v1-ListRisksRequest)+ - [ListRisksResponse](#bytebase-v1-ListRisksResponse)+ - [Risk](#bytebase-v1-Risk)+ - [RiskAction](#bytebase-v1-RiskAction)+ - [RiskRule](#bytebase-v1-RiskRule)+ - [UpdateRiskRequest](#bytebase-v1-UpdateRiskRequest)++ - [Risk.Namespace](#bytebase-v1-Risk-Namespace)+ - [RiskAction.Type](#bytebase-v1-RiskAction-Type)++ - [RiskService](#bytebase-v1-RiskService)+- [v1/setting_service.proto](#v1_setting_service-proto)- [GetSettingRequest](#bytebase-v1-GetSettingRequest)- [GetSettingResponse](#bytebase-v1-GetSettingResponse)@@ -523,7 +536,7 @@ InstanceConnectionDetail is the detail for instance connection anomaly.| ----- | ---- | ----- | ----------- || filter | [string](#string) | | filter is the filter to apply on the search anomaly request, follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax. Only support filter by resource and type for now. For example: Search the anomalies of a specific resource: 'resource="environments/{environemnt}/instances/{instance}".' Search the specified types of anomalies: 'type="DATABASE_BACKUP_POLICY_VIOLATION" | "MIGRATION_SCHEMA".' || page_size | [int32](#int32) | | Not used. The maximum number of anomalies to return. The service may return fewer than this value. If unspecified, at most 50 anomalies will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |-| page_token | [string](#string) | | Not used. A page token, received from a previous `SearchAnomalies` call. Provide this to retrieve the subsequent page.+| page_token | [string](#string) | | Not used. A page token, received from a previous `SearchAnomalies` call. Provide this to retrieve the subsequent page.When paginating, all other parameters provided to `SearchAnomalies` must match the call that provided the page token. |@@ -972,7 +985,7 @@ The user's `name` field is used to identify the user to update. Format: user| ----- | ---- | ----- | ----------- || parent | [string](#string) | | The parent resource of the bookmark. Format: users/{user}, user is a server-generated unique ID. || page_size | [int32](#int32) | | Not used. The maximum number of bookmarks to return. The service may return fewer than this value. If unspecified, at most 50 bookmarks will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |-| page_token | [string](#string) | | Not used. A page token, received from a previous `ListBookmarks` call. Provide this to retrieve the subsequent page.+| page_token | [string](#string) | | Not used. A page token, received from a previous `ListBookmarks` call. Provide this to retrieve the subsequent page.When paginating, all other parameters provided to `ListBookmarks` must match the call that provided the page token. |@@ -1336,7 +1349,7 @@ ListBackupRequest is the request message for ListBackup.| ----- | ---- | ----- | ----------- || parent | [string](#string) | | The parent resource where this backup will be created. Format: environments/{environment}/instances/{instance}/databases/{database} || page_size | [int32](#int32) | | Not used. The maximum number of backups to return. The service may return fewer than this value. If unspecified, at most 50 backups will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |-| page_token | [string](#string) | | Not used. A page token, received from a previous `ListBackup` call. Provide this to retrieve the subsequent page.+| page_token | [string](#string) | | Not used. A page token, received from a previous `ListBackup` call. Provide this to retrieve the subsequent page.When paginating, all other parameters provided to `ListBackup` must match the call that provided the page token. |@@ -2071,7 +2084,7 @@ FieldMapping saves the field names from user info API of identity provider.As we save all raw json string of user info response data into `principal.idp_user_info`,we can extract the relevant data based with `FieldMapping`.-e.g. For GitHub authenticated user API, it will return `login`, `name` and `email` in response.+e.g. For GitHub authenticated user API, it will return `login`, `name` and `email` in response.Then the identifier of FieldMapping will be `login`, display_name will be `name`,and email will be `email`.reference: https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-user@@ -4085,6 +4098,165 @@ TYPE_PROJECT_REPOSITORY_PUSH represents Bytebase receiving a push event from the+<a name="v1_risk_service-proto"></a>+<p align="right"><a href="#top">Top</a></p>++## v1/risk_service.proto++++<a name="bytebase-v1-ListRisksRequest"></a>++### ListRisksRequest++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| page_size | [int32](#int32) | | The maximum number of risks to return. The service may return fewer than this value. If unspecified, at most 50 risks will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |+| page_token | [string](#string) | | A page token, received from a previous `ListRisks` call. Provide this to retrieve the subsequent page.++When paginating, all other parameters provided to `LiskRisks` must match the call that provided the page token. |+++++++<a name="bytebase-v1-ListRisksResponse"></a>++### ListRisksResponse++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| risks | [Risk](#bytebase-v1-Risk) | repeated | |+| next_page_token | [string](#string) | | A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. |+++++++<a name="bytebase-v1-Risk"></a>++### Risk++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| name | [string](#string) | | Format: risks/{risk} |+| uid | [string](#string) | | system-generated unique identifier. |+| namespace | [Risk.Namespace](#bytebase-v1-Risk-Namespace) | | |+| title | [string](#string) | | |+| level | [int64](#int64) | | |+| actions | [RiskAction](#bytebase-v1-RiskAction) | repeated | |+| rules | [RiskRule](#bytebase-v1-RiskRule) | repeated | |+++++++<a name="bytebase-v1-RiskAction"></a>++### RiskAction++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| type | [RiskAction.Type](#bytebase-v1-RiskAction-Type) | | |+| approval_template | [string](#string) | | Format: approvalTemplates/{approvalTemplate} |+++++++<a name="bytebase-v1-RiskRule"></a>++### RiskRule++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| title | [string](#string) | | |+| expression | [google.api.expr.v1alpha1.ParsedExpr](#google-api-expr-v1alpha1-ParsedExpr) | | |+| active | [bool](#bool) | | |+++++++<a name="bytebase-v1-UpdateRiskRequest"></a>++### UpdateRiskRequest++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| risk | [Risk](#bytebase-v1-Risk) | | The risk to update.++The risk's `name` field is used to identify the risk to update. Format: risks/{risk} |+| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to update. |+++++++++<a name="bytebase-v1-Risk-Namespace"></a>++### Risk.Namespace+++| Name | Number | Description |+| ---- | ------ | ----------- |+| NAMESPACE_UNSPECIFIED | 0 | |+| DDL | 1 | |+| DML | 2 | |+| CREATE_DATABASE | 3 | |++++<a name="bytebase-v1-RiskAction-Type"></a>++### RiskAction.Type+++| Name | Number | Description |+| ---- | ------ | ----------- |+| TYPE_UNSPECIFIED | 0 | |+| CHOOSE_APPROVAL_TEMPLATE | 1 | |++++++++<a name="bytebase-v1-RiskService"></a>++### RiskService+++| Method Name | Request Type | Response Type | Description |+| ----------- | ------------ | ------------- | ------------|+| ListRisks | [ListRisksRequest](#bytebase-v1-ListRisksRequest) | [ListRisksResponse](#bytebase-v1-ListRisksResponse) | |+| UpdateRisk | [UpdateRiskRequest](#bytebase-v1-UpdateRiskRequest) | [Risk](#bytebase-v1-Risk) | |+++++<a name="v1_setting_service-proto"></a><p align="right"><a href="#top">Top</a></p>diff --git a/proto/generated-go/store/risk.pb.go b/proto/generated-go/store/risk.pb.gonew file mode 100644index 0000000000..b86128d1ff--- /dev/null+++ b/proto/generated-go/store/risk.pb.go@@ -0,0 +1,151 @@+// Code generated by protoc-gen-go. DO NOT EDIT.+// versions:+// protoc-gen-go v1.29.0+// protoc (unknown)+// source: store/risk.proto++package store++import (+ v1alpha1 "google.golang.org/genproto/googleapis/api/expr/v1alpha1"+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"+ reflect "reflect"+ sync "sync"+)++const (+ // Verify that this generated code is sufficiently up-to-date.+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)+ // Verify that runtime/protoimpl is sufficiently up-to-date.+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)+)++type RiskExpression struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ Expression *v1alpha1.ParsedExpr `protobuf:"bytes,1,opt,name=expression,proto3" json:"expression,omitempty"`+}++func (x *RiskExpression) Reset() {+ *x = RiskExpression{}+ if protoimpl.UnsafeEnabled {+ mi := &file_store_risk_proto_msgTypes[0]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *RiskExpression) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*RiskExpression) ProtoMessage() {}++func (x *RiskExpression) ProtoReflect() protoreflect.Message {+ mi := &file_store_risk_proto_msgTypes[0]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use RiskExpression.ProtoReflect.Descriptor instead.+func (*RiskExpression) Descriptor() ([]byte, []int) {+ return file_store_risk_proto_rawDescGZIP(), []int{0}+}++func (x *RiskExpression) GetExpression() *v1alpha1.ParsedExpr {+ if x != nil {+ return x.Expression+ }+ return nil+}++var File_store_risk_proto protoreflect.FileDescriptor++var file_store_risk_proto_rawDesc = []byte{+ 0x0a, 0x10, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x72, 0x69, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f,+ 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,+ 0x72, 0x65, 0x1a, 0x25, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65,+ 0x78, 0x70, 0x72, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x79, 0x6e,+ 0x74, 0x61, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a, 0x0e, 0x52, 0x69, 0x73,+ 0x6b, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x0a, 0x65,+ 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,+ 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70,+ 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65,+ 0x64, 0x45, 0x78, 0x70, 0x72, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f,+ 0x6e, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67,+ 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,+}++var (+ file_store_risk_proto_rawDescOnce sync.Once+ file_store_risk_proto_rawDescData = file_store_risk_proto_rawDesc+)++func file_store_risk_proto_rawDescGZIP() []byte {+ file_store_risk_proto_rawDescOnce.Do(func() {+ file_store_risk_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_risk_proto_rawDescData)+ })+ return file_store_risk_proto_rawDescData+}++var file_store_risk_proto_msgTypes = make([]protoimpl.MessageInfo, 1)+var file_store_risk_proto_goTypes = []interface{}{+ (*RiskExpression)(nil), // 0: bytebase.store.RiskExpression+ (*v1alpha1.ParsedExpr)(nil), // 1: google.api.expr.v1alpha1.ParsedExpr+}+var file_store_risk_proto_depIdxs = []int32{+ 1, // 0: bytebase.store.RiskExpression.expression:type_name -> google.api.expr.v1alpha1.ParsedExpr+ 1, // [1:1] is the sub-list for method output_type+ 1, // [1:1] is the sub-list for method input_type+ 1, // [1:1] is the sub-list for extension type_name+ 1, // [1:1] is the sub-list for extension extendee+ 0, // [0:1] is the sub-list for field type_name+}++func init() { file_store_risk_proto_init() }+func file_store_risk_proto_init() {+ if File_store_risk_proto != nil {+ return+ }+ if !protoimpl.UnsafeEnabled {+ file_store_risk_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*RiskExpression); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ }+ type x struct{}+ out := protoimpl.TypeBuilder{+ File: protoimpl.DescBuilder{+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),+ RawDescriptor: file_store_risk_proto_rawDesc,+ NumEnums: 0,+ NumMessages: 1,+ NumExtensions: 0,+ NumServices: 0,+ },+ GoTypes: file_store_risk_proto_goTypes,+ DependencyIndexes: file_store_risk_proto_depIdxs,+ MessageInfos: file_store_risk_proto_msgTypes,+ }.Build()+ File_store_risk_proto = out.File+ file_store_risk_proto_rawDesc = nil+ file_store_risk_proto_goTypes = nil+ file_store_risk_proto_depIdxs = nil+}diff --git a/proto/generated-go/v1/anomaly_service.pb.go b/proto/generated-go/v1/anomaly_service.pb.goindex 29ff298f1d..e686a0c7a1 100644--- a/proto/generated-go/v1/anomaly_service.pb.go+++ b/proto/generated-go/v1/anomaly_service.pb.go@@ -806,10 +806,10 @@ var file_v1_anomaly_service_proto_rawDesc = []byte{0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e,0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,- 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15,- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2e,- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,- 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72,+ 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f,+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64,+ 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,+ 0x15, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x68, 0x74, 0x74, 0x70,0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61,0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,diff --git a/proto/generated-go/v1/logging_service.pb.go b/proto/generated-go/v1/logging_service.pb.goindex a8de0f3ee2..ae51cc0d8a 100644--- a/proto/generated-go/v1/logging_service.pb.go+++ b/proto/generated-go/v1/logging_service.pb.go@@ -482,13 +482,13 @@ var file_v1_logging_service_proto_rawDesc = []byte{0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f,0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69,- 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e,+ 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c,0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,- 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f,- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,- 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,- 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,- 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x76,+ 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f,+ 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69,+ 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67,+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77,+ 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x76,0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x82,0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,0x73, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01,diff --git a/proto/generated-go/v1/risk_service.pb.go b/proto/generated-go/v1/risk_service.pb.gonew file mode 100644index 0000000000..2c3124ca13--- /dev/null+++ b/proto/generated-go/v1/risk_service.pb.go@@ -0,0 +1,784 @@+// Code generated by protoc-gen-go. DO NOT EDIT.+// versions:+// protoc-gen-go v1.29.0+// protoc (unknown)+// source: v1/risk_service.proto++package v1++import (+ _ "google.golang.org/genproto/googleapis/api/annotations"+ v1alpha1 "google.golang.org/genproto/googleapis/api/expr/v1alpha1"+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"+ _ "google.golang.org/protobuf/types/known/emptypb"+ fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"+ reflect "reflect"+ sync "sync"+)++const (+ // Verify that this generated code is sufficiently up-to-date.+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)+ // Verify that runtime/protoimpl is sufficiently up-to-date.+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)+)++type Risk_Namespace int32++const (+ Risk_NAMESPACE_UNSPECIFIED Risk_Namespace = 0+ Risk_DDL Risk_Namespace = 1+ Risk_DML Risk_Namespace = 2+ Risk_CREATE_DATABASE Risk_Namespace = 3+)++// Enum value maps for Risk_Namespace.+var (+ Risk_Namespace_name = map[int32]string{+ 0: "NAMESPACE_UNSPECIFIED",+ 1: "DDL",+ 2: "DML",+ 3: "CREATE_DATABASE",+ }+ Risk_Namespace_value = map[string]int32{+ "NAMESPACE_UNSPECIFIED": 0,+ "DDL": 1,+ "DML": 2,+ "CREATE_DATABASE": 3,+ }+)++func (x Risk_Namespace) Enum() *Risk_Namespace {+ p := new(Risk_Namespace)+ *p = x+ return p+}++func (x Risk_Namespace) String() string {+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))+}++func (Risk_Namespace) Descriptor() protoreflect.EnumDescriptor {+ return file_v1_risk_service_proto_enumTypes[0].Descriptor()+}++func (Risk_Namespace) Type() protoreflect.EnumType {+ return &file_v1_risk_service_proto_enumTypes[0]+}++func (x Risk_Namespace) Number() protoreflect.EnumNumber {+ return protoreflect.EnumNumber(x)+}++// Deprecated: Use Risk_Namespace.Descriptor instead.+func (Risk_Namespace) EnumDescriptor() ([]byte, []int) {+ return file_v1_risk_service_proto_rawDescGZIP(), []int{3, 0}+}++type RiskAction_Type int32++const (+ RiskAction_TYPE_UNSPECIFIED RiskAction_Type = 0+ RiskAction_CHOOSE_APPROVAL_TEMPLATE RiskAction_Type = 1+)++// Enum value maps for RiskAction_Type.+var (+ RiskAction_Type_name = map[int32]string{+ 0: "TYPE_UNSPECIFIED",+ 1: "CHOOSE_APPROVAL_TEMPLATE",+ }+ RiskAction_Type_value = map[string]int32{+ "TYPE_UNSPECIFIED": 0,+ "CHOOSE_APPROVAL_TEMPLATE": 1,+ }+)++func (x RiskAction_Type) Enum() *RiskAction_Type {+ p := new(RiskAction_Type)+ *p = x+ return p+}++func (x RiskAction_Type) String() string {+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))+}++func (RiskAction_Type) Descriptor() protoreflect.EnumDescriptor {+ return file_v1_risk_service_proto_enumTypes[1].Descriptor()+}++func (RiskAction_Type) Type() protoreflect.EnumType {+ return &file_v1_risk_service_proto_enumTypes[1]+}++func (x RiskAction_Type) Number() protoreflect.EnumNumber {+ return protoreflect.EnumNumber(x)+}++// Deprecated: Use RiskAction_Type.Descriptor instead.+func (RiskAction_Type) EnumDescriptor() ([]byte, []int) {+ return file_v1_risk_service_proto_rawDescGZIP(), []int{4, 0}+}++type ListRisksRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The maximum number of risks to return. The service may return fewer than+ // this value.+ // If unspecified, at most 50 risks will be returned.+ // The maximum value is 1000; values above 1000 will be coerced to 1000.+ PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`+ // A page token, received from a previous `ListRisks` call.+ // Provide this to retrieve the subsequent page.+ //+ // When paginating, all other parameters provided to `LiskRisks` must match+ // the call that provided the page token.+ PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`+}++func (x *ListRisksRequest) Reset() {+ *x = ListRisksRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_risk_service_proto_msgTypes[0]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *ListRisksRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*ListRisksRequest) ProtoMessage() {}++func (x *ListRisksRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_risk_service_proto_msgTypes[0]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use ListRisksRequest.ProtoReflect.Descriptor instead.+func (*ListRisksRequest) Descriptor() ([]byte, []int) {+ return file_v1_risk_service_proto_rawDescGZIP(), []int{0}+}++func (x *ListRisksRequest) GetPageSize() int32 {+ if x != nil {+ return x.PageSize+ }+ return 0+}++func (x *ListRisksRequest) GetPageToken() string {+ if x != nil {+ return x.PageToken+ }+ return ""+}++type ListRisksResponse struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ Risks []*Risk `protobuf:"bytes,1,rep,name=risks,proto3" json:"risks,omitempty"`+ // A token, which can be sent as `page_token` to retrieve the next page.+ // If this field is omitted, there are no subsequent pages.+ NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`+}++func (x *ListRisksResponse) Reset() {+ *x = ListRisksResponse{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_risk_service_proto_msgTypes[1]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *ListRisksResponse) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*ListRisksResponse) ProtoMessage() {}++func (x *ListRisksResponse) ProtoReflect() protoreflect.Message {+ mi := &file_v1_risk_service_proto_msgTypes[1]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use ListRisksResponse.ProtoReflect.Descriptor instead.+func (*ListRisksResponse) Descriptor() ([]byte, []int) {+ return file_v1_risk_service_proto_rawDescGZIP(), []int{1}+}++func (x *ListRisksResponse) GetRisks() []*Risk {+ if x != nil {+ return x.Risks+ }+ return nil+}++func (x *ListRisksResponse) GetNextPageToken() string {+ if x != nil {+ return x.NextPageToken+ }+ return ""+}++type UpdateRiskRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The risk to update.+ //+ // The risk's `name` field is used to identify the risk to update.+ // Format: risks/{risk}+ Risk *Risk `protobuf:"bytes,1,opt,name=risk,proto3" json:"risk,omitempty"`+ // The list of fields to update.+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`+}++func (x *UpdateRiskRequest) Reset() {+ *x = UpdateRiskRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_risk_service_proto_msgTypes[2]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *UpdateRiskRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*UpdateRiskRequest) ProtoMessage() {}++func (x *UpdateRiskRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_risk_service_proto_msgTypes[2]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use UpdateRiskRequest.ProtoReflect.Descriptor instead.+func (*UpdateRiskRequest) Descriptor() ([]byte, []int) {+ return file_v1_risk_service_proto_rawDescGZIP(), []int{2}+}++func (x *UpdateRiskRequest) GetRisk() *Risk {+ if x != nil {+ return x.Risk+ }+ return nil+}++func (x *UpdateRiskRequest) GetUpdateMask() *fieldmaskpb.FieldMask {+ if x != nil {+ return x.UpdateMask+ }+ return nil+}++type Risk struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // Format: risks/{risk}+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`+ // system-generated unique identifier.+ Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"`+ Namespace Risk_Namespace `protobuf:"varint,3,opt,name=namespace,proto3,enum=bytebase.v1.Risk_Namespace" json:"namespace,omitempty"`+ Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`+ Level int64 `protobuf:"varint,5,opt,name=level,proto3" json:"level,omitempty"`+ Actions []*RiskAction `protobuf:"bytes,6,rep,name=actions,proto3" json:"actions,omitempty"`+ Rules []*RiskRule `protobuf:"bytes,7,rep,name=rules,proto3" json:"rules,omitempty"`+}++func (x *Risk) Reset() {+ *x = Risk{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_risk_service_proto_msgTypes[3]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *Risk) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*Risk) ProtoMessage() {}++func (x *Risk) ProtoReflect() protoreflect.Message {+ mi := &file_v1_risk_service_proto_msgTypes[3]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use Risk.ProtoReflect.Descriptor instead.+func (*Risk) Descriptor() ([]byte, []int) {+ return file_v1_risk_service_proto_rawDescGZIP(), []int{3}+}++func (x *Risk) GetName() string {+ if x != nil {+ return x.Name+ }+ return ""+}++func (x *Risk) GetUid() string {+ if x != nil {+ return x.Uid+ }+ return ""+}++func (x *Risk) GetNamespace() Risk_Namespace {+ if x != nil {+ return x.Namespace+ }+ return Risk_NAMESPACE_UNSPECIFIED+}++func (x *Risk) GetTitle() string {+ if x != nil {+ return x.Title+ }+ return ""+}++func (x *Risk) GetLevel() int64 {+ if x != nil {+ return x.Level+ }+ return 0+}++func (x *Risk) GetActions() []*RiskAction {+ if x != nil {+ return x.Actions+ }+ return nil+}++func (x *Risk) GetRules() []*RiskRule {+ if x != nil {+ return x.Rules+ }+ return nil+}++type RiskAction struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ Type RiskAction_Type `protobuf:"varint,1,opt,name=type,proto3,enum=bytebase.v1.RiskAction_Type" json:"type,omitempty"`+ // Types that are assignable to Payload:+ //+ // *RiskAction_ApprovalTemplate+ Payload isRiskAction_Payload `protobuf_oneof:"payload"`+}++func (x *RiskAction) Reset() {+ *x = RiskAction{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_risk_service_proto_msgTypes[4]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *RiskAction) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*RiskAction) ProtoMessage() {}++func (x *RiskAction) ProtoReflect() protoreflect.Message {+ mi := &file_v1_risk_service_proto_msgTypes[4]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use RiskAction.ProtoReflect.Descriptor instead.+func (*RiskAction) Descriptor() ([]byte, []int) {+ return file_v1_risk_service_proto_rawDescGZIP(), []int{4}+}++func (x *RiskAction) GetType() RiskAction_Type {+ if x != nil {+ return x.Type+ }+ return RiskAction_TYPE_UNSPECIFIED+}++func (m *RiskAction) GetPayload() isRiskAction_Payload {+ if m != nil {+ return m.Payload+ }+ return nil+}++func (x *RiskAction) GetApprovalTemplate() string {+ if x, ok := x.GetPayload().(*RiskAction_ApprovalTemplate); ok {+ return x.ApprovalTemplate+ }+ return ""+}++type isRiskAction_Payload interface {+ isRiskAction_Payload()+}++type RiskAction_ApprovalTemplate struct {+ // Format: approvalTemplates/{approvalTemplate}+ ApprovalTemplate string `protobuf:"bytes,2,opt,name=approval_template,json=approvalTemplate,proto3,oneof"`+}++func (*RiskAction_ApprovalTemplate) isRiskAction_Payload() {}++type RiskRule struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`+ Expression *v1alpha1.ParsedExpr `protobuf:"bytes,2,opt,name=expression,proto3" json:"expression,omitempty"`+ Active bool `protobuf:"varint,3,opt,name=active,proto3" json:"active,omitempty"`+}++func (x *RiskRule) Reset() {+ *x = RiskRule{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_risk_service_proto_msgTypes[5]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *RiskRule) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*RiskRule) ProtoMessage() {}++func (x *RiskRule) ProtoReflect() protoreflect.Message {+ mi := &file_v1_risk_service_proto_msgTypes[5]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use RiskRule.ProtoReflect.Descriptor instead.+func (*RiskRule) Descriptor() ([]byte, []int) {+ return file_v1_risk_service_proto_rawDescGZIP(), []int{5}+}++func (x *RiskRule) GetTitle() string {+ if x != nil {+ return x.Title+ }+ return ""+}++func (x *RiskRule) GetExpression() *v1alpha1.ParsedExpr {+ if x != nil {+ return x.Expression+ }+ return nil+}++func (x *RiskRule) GetActive() bool {+ if x != nil {+ return x.Active+ }+ return false+}++var File_v1_risk_service_proto protoreflect.FileDescriptor++var file_v1_risk_service_proto_rawDesc = []byte{+ 0x0a, 0x15, 0x76, 0x31, 0x2f, 0x72, 0x69, 0x73, 0x6b, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,+ 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,+ 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f,+ 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63,+ 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x67, 0x6f, 0x6f,+ 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x76, 0x31, 0x61,+ 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x70, 0x72, 0x6f,+ 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66,+ 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72,+ 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,+ 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,+ 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,+ 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f,+ 0x74, 0x6f, 0x22, 0x4e, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x69, 0x73, 0x6b, 0x73, 0x52,+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73,+ 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53,+ 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65,+ 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b,+ 0x65, 0x6e, 0x22, 0x64, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x69, 0x73, 0x6b, 0x73, 0x52,+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x72, 0x69, 0x73, 0x6b, 0x73,+ 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x69, 0x73, 0x6b, 0x52, 0x05, 0x72, 0x69, 0x73, 0x6b, 0x73,+ 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f,+ 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50,+ 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x7c, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61,+ 0x74, 0x65, 0x52, 0x69, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a,+ 0x04, 0x72, 0x69, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x79,+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x69, 0x73, 0x6b, 0x42, 0x03,+ 0xe0, 0x41, 0x02, 0x52, 0x04, 0x72, 0x69, 0x73, 0x6b, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64,+ 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,+ 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61,+ 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0xc7, 0x02, 0x0a, 0x04, 0x52, 0x69, 0x73, 0x6b, 0x12,+ 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,+ 0x61, 0x6d, 0x65, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,+ 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x09, 0x6e, 0x61,+ 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e,+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x69, 0x73, 0x6b,+ 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65,+ 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04,+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c,+ 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65,+ 0x6c, 0x12, 0x31, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03,+ 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,+ 0x2e, 0x52, 0x69, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x61, 0x63, 0x74,+ 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2b, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x07, 0x20,+ 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,+ 0x31, 0x2e, 0x52, 0x69, 0x73, 0x6b, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65,+ 0x73, 0x22, 0x4d, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x19,+ 0x0a, 0x15, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50,+ 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x44, 0x4c,+ 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x4d, 0x4c, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x43,+ 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x10, 0x03,+ 0x22, 0xb4, 0x01, 0x0a, 0x0a, 0x52, 0x69, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12,+ 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e,+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x69, 0x73, 0x6b,+ 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70,+ 0x65, 0x12, 0x2d, 0x0a, 0x11, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x5f, 0x74, 0x65,+ 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x10,+ 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,+ 0x22, 0x3a, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45,+ 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c,+ 0x0a, 0x18, 0x43, 0x48, 0x4f, 0x4f, 0x53, 0x45, 0x5f, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41,+ 0x4c, 0x5f, 0x54, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x54, 0x45, 0x10, 0x01, 0x42, 0x09, 0x0a, 0x07,+ 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x7e, 0x0a, 0x08, 0x52, 0x69, 0x73, 0x6b, 0x52,+ 0x75, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x65, 0x78, 0x70,+ 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e,+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e,+ 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x45,+ 0x78, 0x70, 0x72, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12,+ 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52,+ 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x32, 0xea, 0x01, 0x0a, 0x0b, 0x52, 0x69, 0x73, 0x6b,+ 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x60, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x52,+ 0x69, 0x73, 0x6b, 0x73, 0x12, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,+ 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x69, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75,+ 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,+ 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x69, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,+ 0x6e, 0x73, 0x65, 0x22, 0x14, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09,+ 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x69, 0x73, 0x6b, 0x73, 0x12, 0x79, 0x0a, 0x0a, 0x55, 0x70, 0x64,+ 0x61, 0x74, 0x65, 0x52, 0x69, 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x69, 0x73, 0x6b,+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x69, 0x73, 0x6b, 0x22, 0x38, 0xda, 0x41, 0x10, 0x72,+ 0x69, 0x73, 0x6b, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82,+ 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x04, 0x72, 0x69, 0x73, 0x6b, 0x32, 0x17, 0x2f, 0x76, 0x31,+ 0x2f, 0x7b, 0x72, 0x69, 0x73, 0x6b, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x69, 0x73, 0x6b,+ 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65,+ 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,+}++var (+ file_v1_risk_service_proto_rawDescOnce sync.Once+ file_v1_risk_service_proto_rawDescData = file_v1_risk_service_proto_rawDesc+)++func file_v1_risk_service_proto_rawDescGZIP() []byte {+ file_v1_risk_service_proto_rawDescOnce.Do(func() {+ file_v1_risk_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_risk_service_proto_rawDescData)+ })+ return file_v1_risk_service_proto_rawDescData+}++var file_v1_risk_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)+var file_v1_risk_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)+var file_v1_risk_service_proto_goTypes = []interface{}{+ (Risk_Namespace)(0), // 0: bytebase.v1.Risk.Namespace+ (RiskAction_Type)(0), // 1: bytebase.v1.RiskAction.Type+ (*ListRisksRequest)(nil), // 2: bytebase.v1.ListRisksRequest+ (*ListRisksResponse)(nil), // 3: bytebase.v1.ListRisksResponse+ (*UpdateRiskRequest)(nil), // 4: bytebase.v1.UpdateRiskRequest+ (*Risk)(nil), // 5: bytebase.v1.Risk+ (*RiskAction)(nil), // 6: bytebase.v1.RiskAction+ (*RiskRule)(nil), // 7: bytebase.v1.RiskRule+ (*fieldmaskpb.FieldMask)(nil), // 8: google.protobuf.FieldMask+ (*v1alpha1.ParsedExpr)(nil), // 9: google.api.expr.v1alpha1.ParsedExpr+}+var file_v1_risk_service_proto_depIdxs = []int32{+ 5, // 0: bytebase.v1.ListRisksResponse.risks:type_name -> bytebase.v1.Risk+ 5, // 1: bytebase.v1.UpdateRiskRequest.risk:type_name -> bytebase.v1.Risk+ 8, // 2: bytebase.v1.UpdateRiskRequest.update_mask:type_name -> google.protobuf.FieldMask+ 0, // 3: bytebase.v1.Risk.namespace:type_name -> bytebase.v1.Risk.Namespace+ 6, // 4: bytebase.v1.Risk.actions:type_name -> bytebase.v1.RiskAction+ 7, // 5: bytebase.v1.Risk.rules:type_name -> bytebase.v1.RiskRule+ 1, // 6: bytebase.v1.RiskAction.type:type_name -> bytebase.v1.RiskAction.Type+ 9, // 7: bytebase.v1.RiskRule.expression:type_name -> google.api.expr.v1alpha1.ParsedExpr+ 2, // 8: bytebase.v1.RiskService.ListRisks:input_type -> bytebase.v1.ListRisksRequest+ 4, // 9: bytebase.v1.RiskService.UpdateRisk:input_type -> bytebase.v1.UpdateRiskRequest+ 3, // 10: bytebase.v1.RiskService.ListRisks:output_type -> bytebase.v1.ListRisksResponse+ 5, // 11: bytebase.v1.RiskService.UpdateRisk:output_type -> bytebase.v1.Risk+ 10, // [10:12] is the sub-list for method output_type+ 8, // [8:10] is the sub-list for method input_type+ 8, // [8:8] is the sub-list for extension type_name+ 8, // [8:8] is the sub-list for extension extendee+ 0, // [0:8] is the sub-list for field type_name+}++func init() { file_v1_risk_service_proto_init() }+func file_v1_risk_service_proto_init() {+ if File_v1_risk_service_proto != nil {+ return+ }+ if !protoimpl.UnsafeEnabled {+ file_v1_risk_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*ListRisksRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_risk_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*ListRisksResponse); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_risk_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*UpdateRiskRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_risk_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*Risk); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_risk_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*RiskAction); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_risk_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*RiskRule); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ }+ file_v1_risk_service_proto_msgTypes[4].OneofWrappers = []interface{}{+ (*RiskAction_ApprovalTemplate)(nil),+ }+ type x struct{}+ out := protoimpl.TypeBuilder{+ File: protoimpl.DescBuilder{+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),+ RawDescriptor: file_v1_risk_service_proto_rawDesc,+ NumEnums: 2,+ NumMessages: 6,+ NumExtensions: 0,+ NumServices: 1,+ },+ GoTypes: file_v1_risk_service_proto_goTypes,+ DependencyIndexes: file_v1_risk_service_proto_depIdxs,+ EnumInfos: file_v1_risk_service_proto_enumTypes,+ MessageInfos: file_v1_risk_service_proto_msgTypes,+ }.Build()+ File_v1_risk_service_proto = out.File+ file_v1_risk_service_proto_rawDesc = nil+ file_v1_risk_service_proto_goTypes = nil+ file_v1_risk_service_proto_depIdxs = nil+}diff --git a/proto/generated-go/v1/risk_service.pb.gw.go b/proto/generated-go/v1/risk_service.pb.gw.gonew file mode 100644index 0000000000..a282654373--- /dev/null+++ b/proto/generated-go/v1/risk_service.pb.gw.go@@ -0,0 +1,324 @@+// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.+// source: v1/risk_service.proto++/*+Package v1 is a reverse proxy.++It translates gRPC into RESTful JSON APIs.+*/+package v1++import (+ "context"+ "io"+ "net/http"++ "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"+ "github.com/grpc-ecosystem/grpc-gateway/v2/utilities"+ "google.golang.org/grpc"+ "google.golang.org/grpc/codes"+ "google.golang.org/grpc/grpclog"+ "google.golang.org/grpc/metadata"+ "google.golang.org/grpc/status"+ "google.golang.org/protobuf/proto"+)++// Suppress "imported and not used" errors+var _ codes.Code+var _ io.Reader+var _ status.Status+var _ = runtime.String+var _ = utilities.NewDoubleArray+var _ = metadata.Join++var (+ filter_RiskService_ListRisks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}+)++func request_RiskService_ListRisks_0(ctx context.Context, marshaler runtime.Marshaler, client RiskServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq ListRisksRequest+ var metadata runtime.ServerMetadata++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RiskService_ListRisks_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := client.ListRisks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_RiskService_ListRisks_0(ctx context.Context, marshaler runtime.Marshaler, server RiskServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq ListRisksRequest+ var metadata runtime.ServerMetadata++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RiskService_ListRisks_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := server.ListRisks(ctx, &protoReq)+ return msg, metadata, err++}++var (+ filter_RiskService_UpdateRisk_0 = &utilities.DoubleArray{Encoding: map[string]int{"risk": 0, "name": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}}+)++func request_RiskService_UpdateRisk_0(ctx context.Context, marshaler runtime.Marshaler, client RiskServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq UpdateRiskRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Risk); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Risk); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ } else {+ protoReq.UpdateMask = fieldMask+ }+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["risk.name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "risk.name")+ }++ err = runtime.PopulateFieldFromPath(&protoReq, "risk.name", val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "risk.name", err)+ }++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RiskService_UpdateRisk_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := client.UpdateRisk(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_RiskService_UpdateRisk_0(ctx context.Context, marshaler runtime.Marshaler, server RiskServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq UpdateRiskRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Risk); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Risk); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ } else {+ protoReq.UpdateMask = fieldMask+ }+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["risk.name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "risk.name")+ }++ err = runtime.PopulateFieldFromPath(&protoReq, "risk.name", val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "risk.name", err)+ }++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RiskService_UpdateRisk_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := server.UpdateRisk(ctx, &protoReq)+ return msg, metadata, err++}++// RegisterRiskServiceHandlerServer registers the http handlers for service RiskService to "mux".+// UnaryRPC :call RiskServiceServer directly.+// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.+// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRiskServiceHandlerFromEndpoint instead.+func RegisterRiskServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RiskServiceServer) error {++ mux.Handle("GET", pattern_RiskService_ListRisks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.RiskService/ListRisks", runtime.WithHTTPPathPattern("/v1/risks"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_RiskService_ListRisks_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_RiskService_ListRisks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("PATCH", pattern_RiskService_UpdateRisk_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.RiskService/UpdateRisk", runtime.WithHTTPPathPattern("/v1/{risk.name=risks/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_RiskService_UpdateRisk_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_RiskService_UpdateRisk_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ return nil+}++// RegisterRiskServiceHandlerFromEndpoint is same as RegisterRiskServiceHandler but+// automatically dials to "endpoint" and closes the connection when "ctx" gets done.+func RegisterRiskServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {+ conn, err := grpc.DialContext(ctx, endpoint, opts...)+ if err != nil {+ return err+ }+ defer func() {+ if err != nil {+ if cerr := conn.Close(); cerr != nil {+ grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)+ }+ return+ }+ go func() {+ <-ctx.Done()+ if cerr := conn.Close(); cerr != nil {+ grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)+ }+ }()+ }()++ return RegisterRiskServiceHandler(ctx, mux, conn)+}++// RegisterRiskServiceHandler registers the http handlers for service RiskService to "mux".+// The handlers forward requests to the grpc endpoint over "conn".+func RegisterRiskServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {+ return RegisterRiskServiceHandlerClient(ctx, mux, NewRiskServiceClient(conn))+}++// RegisterRiskServiceHandlerClient registers the http handlers for service RiskService+// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RiskServiceClient".+// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RiskServiceClient"+// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in+// "RiskServiceClient" to call the correct interceptors.+func RegisterRiskServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RiskServiceClient) error {++ mux.Handle("GET", pattern_RiskService_ListRisks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.RiskService/ListRisks", runtime.WithHTTPPathPattern("/v1/risks"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_RiskService_ListRisks_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_RiskService_ListRisks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("PATCH", pattern_RiskService_UpdateRisk_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.RiskService/UpdateRisk", runtime.WithHTTPPathPattern("/v1/{risk.name=risks/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_RiskService_UpdateRisk_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_RiskService_UpdateRisk_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ return nil+}++var (+ pattern_RiskService_ListRisks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "risks"}, ""))++ pattern_RiskService_UpdateRisk_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "risks", "risk.name"}, ""))+)++var (+ forward_RiskService_ListRisks_0 = runtime.ForwardResponseMessage++ forward_RiskService_UpdateRisk_0 = runtime.ForwardResponseMessage+)diff --git a/proto/generated-go/v1/risk_service_grpc.pb.go b/proto/generated-go/v1/risk_service_grpc.pb.gonew file mode 100644index 0000000000..fa3b438cc4--- /dev/null+++ b/proto/generated-go/v1/risk_service_grpc.pb.go@@ -0,0 +1,146 @@+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.+// versions:+// - protoc-gen-go-grpc v1.3.0+// - protoc (unknown)+// source: v1/risk_service.proto++package v1++import (+ context "context"+ grpc "google.golang.org/grpc"+ codes "google.golang.org/grpc/codes"+ status "google.golang.org/grpc/status"+)++// This is a compile-time assertion to ensure that this generated file+// is compatible with the grpc package it is being compiled against.+// Requires gRPC-Go v1.32.0 or later.+const _ = grpc.SupportPackageIsVersion7++const (+ RiskService_ListRisks_FullMethodName = "/bytebase.v1.RiskService/ListRisks"+ RiskService_UpdateRisk_FullMethodName = "/bytebase.v1.RiskService/UpdateRisk"+)++// RiskServiceClient is the client API for RiskService service.+//+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.+type RiskServiceClient interface {+ ListRisks(ctx context.Context, in *ListRisksRequest, opts ...grpc.CallOption) (*ListRisksResponse, error)+ UpdateRisk(ctx context.Context, in *UpdateRiskRequest, opts ...grpc.CallOption) (*Risk, error)+}++type riskServiceClient struct {+ cc grpc.ClientConnInterface+}++func NewRiskServiceClient(cc grpc.ClientConnInterface) RiskServiceClient {+ return &riskServiceClient{cc}+}++func (c *riskServiceClient) ListRisks(ctx context.Context, in *ListRisksRequest, opts ...grpc.CallOption) (*ListRisksResponse, error) {+ out := new(ListRisksResponse)+ err := c.cc.Invoke(ctx, RiskService_ListRisks_FullMethodName, in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}++func (c *riskServiceClient) UpdateRisk(ctx context.Context, in *UpdateRiskRequest, opts ...grpc.CallOption) (*Risk, error) {+ out := new(Risk)+ err := c.cc.Invoke(ctx, RiskService_UpdateRisk_FullMethodName, in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}++// RiskServiceServer is the server API for RiskService service.+// All implementations must embed UnimplementedRiskServiceServer+// for forward compatibility+type RiskServiceServer interface {+ ListRisks(context.Context, *ListRisksRequest) (*ListRisksResponse, error)+ UpdateRisk(context.Context, *UpdateRiskRequest) (*Risk, error)+ mustEmbedUnimplementedRiskServiceServer()+}++// UnimplementedRiskServiceServer must be embedded to have forward compatible implementations.+type UnimplementedRiskServiceServer struct {+}++func (UnimplementedRiskServiceServer) ListRisks(context.Context, *ListRisksRequest) (*ListRisksResponse, error) {+ return nil, status.Errorf(codes.Unimplemented, "method ListRisks not implemented")+}+func (UnimplementedRiskServiceServer) UpdateRisk(context.Context, *UpdateRiskRequest) (*Risk, error) {+ return nil, status.Errorf(codes.Unimplemented, "method UpdateRisk not implemented")+}+func (UnimplementedRiskServiceServer) mustEmbedUnimplementedRiskServiceServer() {}++// UnsafeRiskServiceServer may be embedded to opt out of forward compatibility for this service.+// Use of this interface is not recommended, as added methods to RiskServiceServer will+// result in compilation errors.+type UnsafeRiskServiceServer interface {+ mustEmbedUnimplementedRiskServiceServer()+}++func RegisterRiskServiceServer(s grpc.ServiceRegistrar, srv RiskServiceServer) {+ s.RegisterService(&RiskService_ServiceDesc, srv)+}++func _RiskService_ListRisks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(ListRisksRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(RiskServiceServer).ListRisks(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: RiskService_ListRisks_FullMethodName,+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(RiskServiceServer).ListRisks(ctx, req.(*ListRisksRequest))+ }+ return interceptor(ctx, in, info, handler)+}++func _RiskService_UpdateRisk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(UpdateRiskRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(RiskServiceServer).UpdateRisk(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: RiskService_UpdateRisk_FullMethodName,+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(RiskServiceServer).UpdateRisk(ctx, req.(*UpdateRiskRequest))+ }+ return interceptor(ctx, in, info, handler)+}++// RiskService_ServiceDesc is the grpc.ServiceDesc for RiskService service.+// It's only intended for direct use with grpc.RegisterService,+// and not to be introspected or modified (even as a copy)+var RiskService_ServiceDesc = grpc.ServiceDesc{+ ServiceName: "bytebase.v1.RiskService",+ HandlerType: (*RiskServiceServer)(nil),+ Methods: []grpc.MethodDesc{+ {+ MethodName: "ListRisks",+ Handler: _RiskService_ListRisks_Handler,+ },+ {+ MethodName: "UpdateRisk",+ Handler: _RiskService_UpdateRisk_Handler,+ },+ },+ Streams: []grpc.StreamDesc{},+ Metadata: "v1/risk_service.proto",+}diff --git a/proto/v1/risk_service.proto b/proto/v1/risk_service.protonew file mode 100644index 0000000000..2175c3376a--- /dev/null+++ b/proto/v1/risk_service.proto@@ -0,0 +1,100 @@+syntax = "proto3";++package bytebase.v1;++import "google/api/annotations.proto";+import "google/api/client.proto";+import "google/api/expr/v1alpha1/syntax.proto";+import "google/api/field_behavior.proto";+import "google/protobuf/empty.proto";+import "google/protobuf/field_mask.proto";++option go_package = "generated-go/v1";++service RiskService {+ rpc ListRisks(ListRisksRequest) returns (ListRisksResponse) {+ option (google.api.http) = {get: "/v1/risks"};+ option (google.api.method_signature) = "";+ }++ rpc UpdateRisk(UpdateRiskRequest) returns (Risk) {+ option (google.api.http) = {+ patch: "/v1/{risk.name=risks/*}"+ body: "risk"+ };+ option (google.api.method_signature) = "risk,update_mask";+ }+}++message ListRisksRequest {+ // The maximum number of risks to return. The service may return fewer than+ // this value.+ // If unspecified, at most 50 risks will be returned.+ // The maximum value is 1000; values above 1000 will be coerced to 1000.+ int32 page_size = 1;++ // A page token, received from a previous `ListRisks` call.+ // Provide this to retrieve the subsequent page.+ //+ // When paginating, all other parameters provided to `LiskRisks` must match+ // the call that provided the page token.+ string page_token = 2;+}++message ListRisksResponse {+ repeated Risk risks = 1;++ // A token, which can be sent as `page_token` to retrieve the next page.+ // If this field is omitted, there are no subsequent pages.+ string next_page_token = 2;+}++message UpdateRiskRequest {+ // The risk to update.+ //+ // The risk's `name` field is used to identify the risk to update.+ // Format: risks/{risk}+ Risk risk = 1 [(google.api.field_behavior) = REQUIRED];++ // The list of fields to update.+ google.protobuf.FieldMask update_mask = 2;+}++message Risk {+ // Format: risks/{risk}+ string name = 1;++ // system-generated unique identifier.+ string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];++ enum Namespace {+ NAMESPACE_UNSPECIFIED = 0;+ DDL = 1;+ DML = 2;+ CREATE_DATABASE = 3;+ }+ Namespace namespace = 3;++ string title = 4;+ int64 level = 5;+ repeated RiskAction actions = 6;+ repeated RiskRule rules = 7;+}++message RiskAction {+ enum Type {+ TYPE_UNSPECIFIED = 0;+ CHOOSE_APPROVAL_TEMPLATE = 1;+ }+ Type type = 1;+ oneof payload {+ // Format: approvalTemplates/{approvalTemplate}+ string approval_template = 2;+ }+}++message RiskRule {+ string title = 1;+ google.api.expr.v1alpha1.ParsedExpr expression = 2;+ bool active = 3;+}