Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: reintroduce from json (#16485)

boojackd4653ffdd4f0
diff --git a/frontend/src/store/modules/sqlEditor/webTerminal.ts b/frontend/src/store/modules/sqlEditor/webTerminal.ts
index 008cfef0db..ceddeb95d3 100644
--- a/frontend/src/store/modules/sqlEditor/webTerminal.ts
+++ b/frontend/src/store/modules/sqlEditor/webTerminal.ts
@@ -145,7 +145,7 @@ const createStreamingQueryController = () => {
result.latency = parseDuration(result.latency);
});
}
- const response = AdminExecuteResponse.fromPartial(data.result);
+ const response = AdminExecuteResponse.fromJSON(data.result);
subscriber.next(response);
} else if (data.error) {
const err = new ClientError(
diff --git a/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts b/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts
index 0738694978..1a6eeee526 100644
--- a/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts
+++ b/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts
@@ -440,6 +440,21 @@ export const Expr: MessageFns<Expr> = {
return message;
},
+ fromJSON(object: any): Expr {
+ return {
+ id: isSet(object.id) ? Long.fromValue(object.id) : Long.ZERO,
+ 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 = {};
if (!message.id.equals(Long.ZERO)) {
@@ -536,6 +551,10 @@ export const Expr_Ident: MessageFns<Expr_Ident> = {
return message;
},
+ fromJSON(object: any): Expr_Ident {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: Expr_Ident): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -612,6 +631,14 @@ export const Expr_Select: MessageFns<Expr_Select> = {
return message;
},
+ fromJSON(object: any): Expr_Select {
+ return {
+ operand: isSet(object.operand) ? Expr.fromJSON(object.operand) : undefined,
+ field: isSet(object.field) ? globalThis.String(object.field) : "",
+ testOnly: isSet(object.testOnly) ? globalThis.Boolean(object.testOnly) : false,
+ };
+ },
+
toJSON(message: Expr_Select): unknown {
const obj: any = {};
if (message.operand !== undefined) {
@@ -698,6 +725,14 @@ export const Expr_Call: MessageFns<Expr_Call> = {
return message;
},
+ fromJSON(object: any): Expr_Call {
+ return {
+ target: isSet(object.target) ? Expr.fromJSON(object.target) : undefined,
+ function: isSet(object.function) ? globalThis.String(object.function) : "",
+ args: globalThis.Array.isArray(object?.args) ? object.args.map((e: any) => Expr.fromJSON(e)) : [],
+ };
+ },
+
toJSON(message: Expr_Call): unknown {
const obj: any = {};
if (message.target !== undefined) {
@@ -785,6 +820,15 @@ export const Expr_CreateList: MessageFns<Expr_CreateList> = {
return message;
},
+ fromJSON(object: any): Expr_CreateList {
+ return {
+ elements: globalThis.Array.isArray(object?.elements) ? object.elements.map((e: any) => Expr.fromJSON(e)) : [],
+ optionalIndices: globalThis.Array.isArray(object?.optionalIndices)
+ ? object.optionalIndices.map((e: any) => globalThis.Number(e))
+ : [],
+ };
+ },
+
toJSON(message: Expr_CreateList): unknown {
const obj: any = {};
if (message.elements?.length) {
@@ -854,6 +898,15 @@ export const Expr_CreateStruct: MessageFns<Expr_CreateStruct> = {
return message;
},
+ fromJSON(object: any): Expr_CreateStruct {
+ return {
+ messageName: isSet(object.messageName) ? globalThis.String(object.messageName) : "",
+ entries: globalThis.Array.isArray(object?.entries)
+ ? object.entries.map((e: any) => Expr_CreateStruct_Entry.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: Expr_CreateStruct): unknown {
const obj: any = {};
if (message.messageName !== "") {
@@ -956,6 +1009,16 @@ export const Expr_CreateStruct_Entry: MessageFns<Expr_CreateStruct_Entry> = {
return message;
},
+ fromJSON(object: any): Expr_CreateStruct_Entry {
+ return {
+ id: isSet(object.id) ? Long.fromValue(object.id) : Long.ZERO,
+ fieldKey: isSet(object.fieldKey) ? globalThis.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) ? globalThis.Boolean(object.optionalEntry) : false,
+ };
+ },
+
toJSON(message: Expr_CreateStruct_Entry): unknown {
const obj: any = {};
if (!message.id.equals(Long.ZERO)) {
@@ -1102,6 +1165,18 @@ export const Expr_Comprehension: MessageFns<Expr_Comprehension> = {
return message;
},
+ fromJSON(object: any): Expr_Comprehension {
+ return {
+ iterVar: isSet(object.iterVar) ? globalThis.String(object.iterVar) : "",
+ iterRange: isSet(object.iterRange) ? Expr.fromJSON(object.iterRange) : undefined,
+ accuVar: isSet(object.accuVar) ? globalThis.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 = {};
if (message.iterVar !== "") {
@@ -1288,6 +1363,20 @@ export const Constant: MessageFns<Constant> = {
return message;
},
+ fromJSON(object: any): Constant {
+ return {
+ nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,
+ boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined,
+ int64Value: isSet(object.int64Value) ? Long.fromValue(object.int64Value) : undefined,
+ uint64Value: isSet(object.uint64Value) ? Long.fromValue(object.uint64Value) : undefined,
+ doubleValue: isSet(object.doubleValue) ? globalThis.Number(object.doubleValue) : undefined,
+ stringValue: isSet(object.stringValue) ? globalThis.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 = {};
if (message.nullValue !== undefined) {
@@ -1346,6 +1435,15 @@ export const Constant: MessageFns<Constant> = {
},
};
+function bytesFromBase64(b64: string): Uint8Array {
+ 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 {
const bin: string[] = [];
arr.forEach((byte) => {
@@ -1362,15 +1460,40 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/google/api/http.ts b/frontend/src/types/proto/google/api/http.ts
index 9bfa5162fb..82246871c6 100644
--- a/frontend/src/types/proto/google/api/http.ts
+++ b/frontend/src/types/proto/google/api/http.ts
@@ -503,6 +503,23 @@ export const HttpRule: MessageFns<HttpRule> = {
return message;
},
+ fromJSON(object: any): HttpRule {
+ return {
+ selector: isSet(object.selector) ? globalThis.String(object.selector) : "",
+ get: isSet(object.get) ? globalThis.String(object.get) : undefined,
+ put: isSet(object.put) ? globalThis.String(object.put) : undefined,
+ post: isSet(object.post) ? globalThis.String(object.post) : undefined,
+ delete: isSet(object.delete) ? globalThis.String(object.delete) : undefined,
+ patch: isSet(object.patch) ? globalThis.String(object.patch) : undefined,
+ custom: isSet(object.custom) ? CustomHttpPattern.fromJSON(object.custom) : undefined,
+ body: isSet(object.body) ? globalThis.String(object.body) : "",
+ responseBody: isSet(object.responseBody) ? globalThis.String(object.responseBody) : "",
+ additionalBindings: globalThis.Array.isArray(object?.additionalBindings)
+ ? object.additionalBindings.map((e: any) => HttpRule.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: HttpRule): unknown {
const obj: any = {};
if (message.selector !== "") {
@@ -606,6 +623,13 @@ export const CustomHttpPattern: MessageFns<CustomHttpPattern> = {
return message;
},
+ fromJSON(object: any): CustomHttpPattern {
+ return {
+ kind: isSet(object.kind) ? globalThis.String(object.kind) : "",
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
+ };
+ },
+
toJSON(message: CustomHttpPattern): unknown {
const obj: any = {};
if (message.kind !== "") {
@@ -636,9 +660,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/google/api/resource.ts b/frontend/src/types/proto/google/api/resource.ts
index 841c3d5582..2d7ff99656 100644
--- a/frontend/src/types/proto/google/api/resource.ts
+++ b/frontend/src/types/proto/google/api/resource.ts
@@ -433,6 +433,22 @@ export const ResourceDescriptor: MessageFns<ResourceDescriptor> = {
return message;
},
+ fromJSON(object: any): ResourceDescriptor {
+ return {
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
+ pattern: globalThis.Array.isArray(object?.pattern) ? object.pattern.map((e: any) => globalThis.String(e)) : [],
+ nameField: isSet(object.nameField) ? globalThis.String(object.nameField) : "",
+ history: isSet(object.history)
+ ? resourceDescriptor_HistoryFromJSON(object.history)
+ : ResourceDescriptor_History.HISTORY_UNSPECIFIED,
+ plural: isSet(object.plural) ? globalThis.String(object.plural) : "",
+ singular: isSet(object.singular) ? globalThis.String(object.singular) : "",
+ style: globalThis.Array.isArray(object?.style)
+ ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: ResourceDescriptor): unknown {
const obj: any = {};
if (message.type !== "") {
@@ -522,6 +538,13 @@ export const ResourceReference: MessageFns<ResourceReference> = {
return message;
},
+ fromJSON(object: any): ResourceReference {
+ return {
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
+ childType: isSet(object.childType) ? globalThis.String(object.childType) : "",
+ };
+ },
+
toJSON(message: ResourceReference): unknown {
const obj: any = {};
if (message.type !== "") {
@@ -552,9 +575,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/google/protobuf/any.ts b/frontend/src/types/proto/google/protobuf/any.ts
index 969cb0c0b8..08ea574080 100644
--- a/frontend/src/types/proto/google/protobuf/any.ts
+++ b/frontend/src/types/proto/google/protobuf/any.ts
@@ -180,6 +180,13 @@ export const Any: MessageFns<Any> = {
return message;
},
+ fromJSON(object: any): Any {
+ return {
+ typeUrl: isSet(object.typeUrl) ? globalThis.String(object.typeUrl) : "",
+ value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0),
+ };
+ },
+
toJSON(message: Any): unknown {
const obj: any = {};
if (message.typeUrl !== "") {
@@ -202,6 +209,15 @@ export const Any: MessageFns<Any> = {
},
};
+function bytesFromBase64(b64: string): Uint8Array {
+ 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 {
const bin: string[] = [];
arr.forEach((byte) => {
@@ -218,9 +234,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.ts
index 712b5cc618..391ece45b7 100644
--- a/frontend/src/types/proto/google/protobuf/descriptor.ts
+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts
@@ -1322,6 +1322,26 @@ export const MessageOptions: MessageFns<MessageOptions> = {
return message;
},
+ fromJSON(object: any): MessageOptions {
+ return {
+ messageSetWireFormat: isSet(object.messageSetWireFormat)
+ ? globalThis.Boolean(object.messageSetWireFormat)
+ : false,
+ noStandardDescriptorAccessor: isSet(object.noStandardDescriptorAccessor)
+ ? globalThis.Boolean(object.noStandardDescriptorAccessor)
+ : false,
+ deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false,
+ mapEntry: isSet(object.mapEntry) ? globalThis.Boolean(object.mapEntry) : false,
+ deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts)
+ ? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts)
+ : false,
+ features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
+ uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
+ ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: MessageOptions): unknown {
const obj: any = {};
if (message.messageSetWireFormat !== undefined && message.messageSetWireFormat !== false) {
@@ -1574,6 +1594,35 @@ export const FieldOptions: MessageFns<FieldOptions> = {
return message;
},
+ fromJSON(object: any): FieldOptions {
+ return {
+ ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : FieldOptions_CType.STRING,
+ packed: isSet(object.packed) ? globalThis.Boolean(object.packed) : false,
+ jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : FieldOptions_JSType.JS_NORMAL,
+ lazy: isSet(object.lazy) ? globalThis.Boolean(object.lazy) : false,
+ unverifiedLazy: isSet(object.unverifiedLazy) ? globalThis.Boolean(object.unverifiedLazy) : false,
+ deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false,
+ weak: isSet(object.weak) ? globalThis.Boolean(object.weak) : false,
+ debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false,
+ retention: isSet(object.retention)
+ ? fieldOptions_OptionRetentionFromJSON(object.retention)
+ : FieldOptions_OptionRetention.RETENTION_UNKNOWN,
+ targets: globalThis.Array.isArray(object?.targets)
+ ? object.targets.map((e: any) => fieldOptions_OptionTargetTypeFromJSON(e))
+ : [],
+ editionDefaults: globalThis.Array.isArray(object?.editionDefaults)
+ ? object.editionDefaults.map((e: any) => FieldOptions_EditionDefault.fromJSON(e))
+ : [],
+ features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
+ featureSupport: isSet(object.featureSupport)
+ ? FieldOptions_FeatureSupport.fromJSON(object.featureSupport)
+ : undefined,
+ uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
+ ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: FieldOptions): unknown {
const obj: any = {};
if (message.ctype !== undefined && message.ctype !== FieldOptions_CType.STRING) {
@@ -1695,6 +1744,13 @@ export const FieldOptions_EditionDefault: MessageFns<FieldOptions_EditionDefault
return message;
},
+ fromJSON(object: any): FieldOptions_EditionDefault {
+ return {
+ edition: isSet(object.edition) ? editionFromJSON(object.edition) : Edition.EDITION_UNKNOWN,
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
+ };
+ },
+
toJSON(message: FieldOptions_EditionDefault): unknown {
const obj: any = {};
if (message.edition !== undefined && message.edition !== Edition.EDITION_UNKNOWN) {
@@ -1791,6 +1847,19 @@ export const FieldOptions_FeatureSupport: MessageFns<FieldOptions_FeatureSupport
return message;
},
+ fromJSON(object: any): FieldOptions_FeatureSupport {
+ return {
+ editionIntroduced: isSet(object.editionIntroduced)
+ ? editionFromJSON(object.editionIntroduced)
+ : Edition.EDITION_UNKNOWN,
+ editionDeprecated: isSet(object.editionDeprecated)
+ ? editionFromJSON(object.editionDeprecated)
+ : Edition.EDITION_UNKNOWN,
+ deprecationWarning: isSet(object.deprecationWarning) ? globalThis.String(object.deprecationWarning) : "",
+ editionRemoved: isSet(object.editionRemoved) ? editionFromJSON(object.editionRemoved) : Edition.EDITION_UNKNOWN,
+ };
+ },
+
toJSON(message: FieldOptions_FeatureSupport): unknown {
const obj: any = {};
if (message.editionIntroduced !== undefined && message.editionIntroduced !== Edition.EDITION_UNKNOWN) {
@@ -1898,6 +1967,19 @@ export const MethodOptions: MessageFns<MethodOptions> = {
return message;
},
+ fromJSON(object: any): MethodOptions {
+ return {
+ deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false,
+ idempotencyLevel: isSet(object.idempotencyLevel)
+ ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel)
+ : MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN,
+ features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
+ uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
+ ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: MethodOptions): unknown {
const obj: any = {};
if (message.deprecated !== undefined && message.deprecated !== false) {
@@ -2043,6 +2125,20 @@ export const UninterpretedOption: MessageFns<UninterpretedOption> = {
return message;
},
+ fromJSON(object: any): UninterpretedOption {
+ return {
+ name: globalThis.Array.isArray(object?.name)
+ ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e))
+ : [],
+ identifierValue: isSet(object.identifierValue) ? globalThis.String(object.identifierValue) : "",
+ positiveIntValue: isSet(object.positiveIntValue) ? Long.fromValue(object.positiveIntValue) : Long.UZERO,
+ negativeIntValue: isSet(object.negativeIntValue) ? Long.fromValue(object.negativeIntValue) : Long.ZERO,
+ doubleValue: isSet(object.doubleValue) ? globalThis.Number(object.doubleValue) : 0,
+ stringValue: isSet(object.stringValue) ? bytesFromBase64(object.stringValue) : new Uint8Array(0),
+ aggregateValue: isSet(object.aggregateValue) ? globalThis.String(object.aggregateValue) : "",
+ };
+ },
+
toJSON(message: UninterpretedOption): unknown {
const obj: any = {};
if (message.name?.length) {
@@ -2136,6 +2232,13 @@ export const UninterpretedOption_NamePart: MessageFns<UninterpretedOption_NamePa
return message;
},
+ fromJSON(object: any): UninterpretedOption_NamePart {
+ return {
+ namePart: isSet(object.namePart) ? globalThis.String(object.namePart) : "",
+ isExtension: isSet(object.isExtension) ? globalThis.Boolean(object.isExtension) : false,
+ };
+ },
+
toJSON(message: UninterpretedOption_NamePart): unknown {
const obj: any = {};
if (message.namePart !== "") {
@@ -2282,6 +2385,32 @@ export const FeatureSet: MessageFns<FeatureSet> = {
return message;
},
+ fromJSON(object: any): FeatureSet {
+ return {
+ fieldPresence: isSet(object.fieldPresence)
+ ? featureSet_FieldPresenceFromJSON(object.fieldPresence)
+ : FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN,
+ enumType: isSet(object.enumType)
+ ? featureSet_EnumTypeFromJSON(object.enumType)
+ : FeatureSet_EnumType.ENUM_TYPE_UNKNOWN,
+ repeatedFieldEncoding: isSet(object.repeatedFieldEncoding)
+ ? featureSet_RepeatedFieldEncodingFromJSON(object.repeatedFieldEncoding)
+ : FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN,
+ utf8Validation: isSet(object.utf8Validation)
+ ? featureSet_Utf8ValidationFromJSON(object.utf8Validation)
+ : FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN,
+ messageEncoding: isSet(object.messageEncoding)
+ ? featureSet_MessageEncodingFromJSON(object.messageEncoding)
+ : FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN,
+ jsonFormat: isSet(object.jsonFormat)
+ ? featureSet_JsonFormatFromJSON(object.jsonFormat)
+ : FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN,
+ enforceNamingStyle: isSet(object.enforceNamingStyle)
+ ? featureSet_EnforceNamingStyleFromJSON(object.enforceNamingStyle)
+ : FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN,
+ };
+ },
+
toJSON(message: FeatureSet): unknown {
const obj: any = {};
if (
@@ -2340,6 +2469,15 @@ export const FeatureSet: MessageFns<FeatureSet> = {
},
};
+function bytesFromBase64(b64: string): Uint8Array {
+ 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 {
const bin: string[] = [];
arr.forEach((byte) => {
@@ -2356,9 +2494,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/google/protobuf/duration.ts b/frontend/src/types/proto/google/protobuf/duration.ts
index 34a72a09e2..9fdac5234c 100644
--- a/frontend/src/types/proto/google/protobuf/duration.ts
+++ b/frontend/src/types/proto/google/protobuf/duration.ts
@@ -135,6 +135,13 @@ export const Duration: MessageFns<Duration> = {
return message;
},
+ fromJSON(object: any): Duration {
+ return {
+ seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO,
+ nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
+ };
+ },
+
toJSON(message: Duration): unknown {
const obj: any = {};
if (!message.seconds.equals(Long.ZERO)) {
@@ -167,9 +174,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/google/protobuf/empty.ts b/frontend/src/types/proto/google/protobuf/empty.ts
index be738db3d3..49d47d6f3a 100644
--- a/frontend/src/types/proto/google/protobuf/empty.ts
+++ b/frontend/src/types/proto/google/protobuf/empty.ts
@@ -47,6 +47,10 @@ export const Empty: MessageFns<Empty> = {
return message;
},
+ fromJSON(_: any): Empty {
+ return {};
+ },
+
toJSON(_: Empty): unknown {
const obj: any = {};
return obj;
@@ -72,6 +76,7 @@ export type DeepPartial<T> = T extends Builtin ? T
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/google/protobuf/field_mask.ts b/frontend/src/types/proto/google/protobuf/field_mask.ts
index 9521eecb93..edb4875a82 100644
--- a/frontend/src/types/proto/google/protobuf/field_mask.ts
+++ b/frontend/src/types/proto/google/protobuf/field_mask.ts
@@ -251,6 +251,16 @@ export const FieldMask: MessageFns<FieldMask> & FieldMaskWrapperFns = {
return message;
},
+ fromJSON(object: any): FieldMask {
+ return {
+ paths: typeof object === "string"
+ ? object.split(",").filter(globalThis.Boolean)
+ : globalThis.Array.isArray(object?.paths)
+ ? object.paths.map(globalThis.String)
+ : [],
+ };
+ },
+
toJSON(message: FieldMask): string {
return message.paths.join(",");
},
@@ -286,6 +296,7 @@ export type DeepPartial<T> = T extends Builtin ? T
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/google/protobuf/struct.ts b/frontend/src/types/proto/google/protobuf/struct.ts
index d2abf96d4d..0f9cc54755 100644
--- a/frontend/src/types/proto/google/protobuf/struct.ts
+++ b/frontend/src/types/proto/google/protobuf/struct.ts
@@ -158,6 +158,17 @@ export const Struct: MessageFns<Struct> & StructWrapperFns = {
return message;
},
+ fromJSON(object: any): Struct {
+ return {
+ fields: isObject(object.fields)
+ ? Object.entries(object.fields).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => {
+ acc[key] = value as any | undefined;
+ return acc;
+ }, {})
+ : {},
+ };
+ },
+
toJSON(message: Struct): unknown {
const obj: any = {};
if (message.fields) {
@@ -258,6 +269,13 @@ export const Struct_FieldsEntry: MessageFns<Struct_FieldsEntry> = {
return message;
},
+ fromJSON(object: any): Struct_FieldsEntry {
+ return {
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
+ value: isSet(object?.value) ? object.value : undefined,
+ };
+ },
+
toJSON(message: Struct_FieldsEntry): unknown {
const obj: any = {};
if (message.key !== "") {
@@ -378,6 +396,17 @@ export const Value: MessageFns<Value> & AnyValueWrapperFns = {
return message;
},
+ fromJSON(object: any): Value {
+ return {
+ nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,
+ numberValue: isSet(object.numberValue) ? globalThis.Number(object.numberValue) : undefined,
+ stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined,
+ boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined,
+ structValue: isObject(object.structValue) ? object.structValue : undefined,
+ listValue: globalThis.Array.isArray(object.listValue) ? [...object.listValue] : undefined,
+ };
+ },
+
toJSON(message: Value): unknown {
const obj: any = {};
if (message.nullValue !== undefined) {
@@ -489,6 +518,10 @@ export const ListValue: MessageFns<ListValue> & ListValueWrapperFns = {
return message;
},
+ fromJSON(object: any): ListValue {
+ return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] };
+ },
+
toJSON(message: ListValue): unknown {
const obj: any = {};
if (message.values?.length) {
@@ -529,9 +562,18 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isObject(value: any): boolean {
+ return typeof value === "object" && value !== null;
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/google/protobuf/timestamp.ts b/frontend/src/types/proto/google/protobuf/timestamp.ts
index 2741906b9d..0073ddb6a2 100644
--- a/frontend/src/types/proto/google/protobuf/timestamp.ts
+++ b/frontend/src/types/proto/google/protobuf/timestamp.ts
@@ -164,6 +164,13 @@ export const Timestamp: MessageFns<Timestamp> = {
return message;
},
+ fromJSON(object: any): Timestamp {
+ return {
+ seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO,
+ nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
+ };
+ },
+
toJSON(message: Timestamp): unknown {
const obj: any = {};
if (!message.seconds.equals(Long.ZERO)) {
@@ -196,9 +203,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/google/rpc/status.ts b/frontend/src/types/proto/google/rpc/status.ts
index 2799b8be04..d54ee88ba7 100644
--- a/frontend/src/types/proto/google/rpc/status.ts
+++ b/frontend/src/types/proto/google/rpc/status.ts
@@ -98,6 +98,14 @@ export const Status: MessageFns<Status> = {
return message;
},
+ fromJSON(object: any): Status {
+ return {
+ code: isSet(object.code) ? globalThis.Number(object.code) : 0,
+ message: isSet(object.message) ? globalThis.String(object.message) : "",
+ details: globalThis.Array.isArray(object?.details) ? object.details.map((e: any) => Any.fromJSON(e)) : [],
+ };
+ },
+
toJSON(message: Status): unknown {
const obj: any = {};
if (message.code !== 0) {
@@ -132,9 +140,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/google/type/expr.ts b/frontend/src/types/proto/google/type/expr.ts
index 303f17162a..9694155834 100644
--- a/frontend/src/types/proto/google/type/expr.ts
+++ b/frontend/src/types/proto/google/type/expr.ts
@@ -136,6 +136,15 @@ export const Expr: MessageFns<Expr> = {
return message;
},
+ fromJSON(object: any): Expr {
+ return {
+ expression: isSet(object.expression) ? globalThis.String(object.expression) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
+ location: isSet(object.location) ? globalThis.String(object.location) : "",
+ };
+ },
+
toJSON(message: Expr): unknown {
const obj: any = {};
if (message.expression !== "") {
@@ -174,9 +183,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/actuator_service.ts b/frontend/src/types/proto/v1/actuator_service.ts
index 200e32a490..e7ba6d9067 100644
--- a/frontend/src/types/proto/v1/actuator_service.ts
+++ b/frontend/src/types/proto/v1/actuator_service.ts
@@ -124,6 +124,10 @@ export const GetResourcePackageRequest: MessageFns<GetResourcePackageRequest> =
return message;
},
+ fromJSON(_: any): GetResourcePackageRequest {
+ return {};
+ },
+
toJSON(_: GetResourcePackageRequest): unknown {
const obj: any = {};
return obj;
@@ -174,6 +178,10 @@ export const ResourcePackage: MessageFns<ResourcePackage> = {
return message;
},
+ fromJSON(object: any): ResourcePackage {
+ return { logo: isSet(object.logo) ? bytesFromBase64(object.logo) : new Uint8Array(0) };
+ },
+
toJSON(message: ResourcePackage): unknown {
const obj: any = {};
if (message.logo.length !== 0) {
@@ -217,6 +225,10 @@ export const SetupSampleRequest: MessageFns<SetupSampleRequest> = {
return message;
},
+ fromJSON(_: any): SetupSampleRequest {
+ return {};
+ },
+
toJSON(_: SetupSampleRequest): unknown {
const obj: any = {};
return obj;
@@ -256,6 +268,10 @@ export const GetActuatorInfoRequest: MessageFns<GetActuatorInfoRequest> = {
return message;
},
+ fromJSON(_: any): GetActuatorInfoRequest {
+ return {};
+ },
+
toJSON(_: GetActuatorInfoRequest): unknown {
const obj: any = {};
return obj;
@@ -317,6 +333,13 @@ export const UpdateActuatorInfoRequest: MessageFns<UpdateActuatorInfoRequest> =
return message;
},
+ fromJSON(object: any): UpdateActuatorInfoRequest {
+ return {
+ actuator: isSet(object.actuator) ? ActuatorInfo.fromJSON(object.actuator) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateActuatorInfoRequest): unknown {
const obj: any = {};
if (message.actuator !== undefined) {
@@ -366,6 +389,10 @@ export const DeleteCacheRequest: MessageFns<DeleteCacheRequest> = {
return message;
},
+ fromJSON(_: any): DeleteCacheRequest {
+ return {};
+ },
+
toJSON(_: DeleteCacheRequest): unknown {
const obj: any = {};
return obj;
@@ -670,6 +697,43 @@ export const ActuatorInfo: MessageFns<ActuatorInfo> = {
return message;
},
+ fromJSON(object: any): ActuatorInfo {
+ return {
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
+ gitCommit: isSet(object.gitCommit) ? globalThis.String(object.gitCommit) : "",
+ readonly: isSet(object.readonly) ? globalThis.Boolean(object.readonly) : false,
+ saas: isSet(object.saas) ? globalThis.Boolean(object.saas) : false,
+ demo: isSet(object.demo) ? globalThis.Boolean(object.demo) : false,
+ host: isSet(object.host) ? globalThis.String(object.host) : "",
+ port: isSet(object.port) ? globalThis.String(object.port) : "",
+ externalUrl: isSet(object.externalUrl) ? globalThis.String(object.externalUrl) : "",
+ needAdminSetup: isSet(object.needAdminSetup) ? globalThis.Boolean(object.needAdminSetup) : false,
+ disallowSignup: isSet(object.disallowSignup) ? globalThis.Boolean(object.disallowSignup) : false,
+ lastActiveTime: isSet(object.lastActiveTime) ? fromJsonTimestamp(object.lastActiveTime) : undefined,
+ require2fa: isSet(object.require2fa) ? globalThis.Boolean(object.require2fa) : false,
+ workspaceId: isSet(object.workspaceId) ? globalThis.String(object.workspaceId) : "",
+ debug: isSet(object.debug) ? globalThis.Boolean(object.debug) : false,
+ unlicensedFeatures: globalThis.Array.isArray(object?.unlicensedFeatures)
+ ? object.unlicensedFeatures.map((e: any) => globalThis.String(e))
+ : [],
+ disallowPasswordSignin: isSet(object.disallowPasswordSignin)
+ ? globalThis.Boolean(object.disallowPasswordSignin)
+ : false,
+ passwordRestriction: isSet(object.passwordRestriction)
+ ? PasswordRestrictionSetting.fromJSON(object.passwordRestriction)
+ : undefined,
+ docker: isSet(object.docker) ? globalThis.Boolean(object.docker) : false,
+ userStats: globalThis.Array.isArray(object?.userStats)
+ ? object.userStats.map((e: any) => ActuatorInfo_StatUser.fromJSON(e))
+ : [],
+ activatedInstanceCount: isSet(object.activatedInstanceCount)
+ ? globalThis.Number(object.activatedInstanceCount)
+ : 0,
+ totalInstanceCount: isSet(object.totalInstanceCount) ? globalThis.Number(object.totalInstanceCount) : 0,
+ enableSample: isSet(object.enableSample) ? globalThis.Boolean(object.enableSample) : false,
+ };
+ },
+
toJSON(message: ActuatorInfo): unknown {
const obj: any = {};
if (message.version !== "") {
@@ -834,6 +898,14 @@ export const ActuatorInfo_StatUser: MessageFns<ActuatorInfo_StatUser> = {
return message;
},
+ fromJSON(object: any): ActuatorInfo_StatUser {
+ return {
+ userType: isSet(object.userType) ? userTypeFromJSON(object.userType) : UserType.USER_TYPE_UNSPECIFIED,
+ state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
+ count: isSet(object.count) ? globalThis.Number(object.count) : 0,
+ };
+ },
+
toJSON(message: ActuatorInfo_StatUser): unknown {
const obj: any = {};
if (message.userType !== UserType.USER_TYPE_UNSPECIFIED) {
@@ -1081,6 +1153,15 @@ export const ActuatorServiceDefinition = {
},
} as const;
+function bytesFromBase64(b64: string): Uint8Array {
+ 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 {
const bin: string[] = [];
arr.forEach((byte) => {
@@ -1097,15 +1178,40 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/audit_log_service.ts b/frontend/src/types/proto/v1/audit_log_service.ts
index e28d61633d..e4693a7ede 100644
--- a/frontend/src/types/proto/v1/audit_log_service.ts
+++ b/frontend/src/types/proto/v1/audit_log_service.ts
@@ -339,6 +339,16 @@ export const SearchAuditLogsRequest: MessageFns<SearchAuditLogsRequest> = {
return message;
},
+ fromJSON(object: any): SearchAuditLogsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ orderBy: isSet(object.orderBy) ? globalThis.String(object.orderBy) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: SearchAuditLogsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -420,6 +430,15 @@ export const SearchAuditLogsResponse: MessageFns<SearchAuditLogsResponse> = {
return message;
},
+ fromJSON(object: any): SearchAuditLogsResponse {
+ return {
+ auditLogs: globalThis.Array.isArray(object?.auditLogs)
+ ? object.auditLogs.map((e: any) => AuditLog.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: SearchAuditLogsResponse): unknown {
const obj: any = {};
if (message.auditLogs?.length) {
@@ -533,6 +552,17 @@ export const ExportAuditLogsRequest: MessageFns<ExportAuditLogsRequest> = {
return message;
},
+ fromJSON(object: any): ExportAuditLogsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ orderBy: isSet(object.orderBy) ? globalThis.String(object.orderBy) : "",
+ format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: ExportAuditLogsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -618,6 +648,13 @@ export const ExportAuditLogsResponse: MessageFns<ExportAuditLogsResponse> = {
return message;
},
+ fromJSON(object: any): ExportAuditLogsResponse {
+ return {
+ content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0),
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ExportAuditLogsResponse): unknown {
const obj: any = {};
if (message.content.length !== 0) {
@@ -798,6 +835,22 @@ export const AuditLog: MessageFns<AuditLog> = {
return message;
},
+ fromJSON(object: any): AuditLog {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ user: isSet(object.user) ? globalThis.String(object.user) : "",
+ method: isSet(object.method) ? globalThis.String(object.method) : "",
+ severity: isSet(object.severity) ? auditLog_SeverityFromJSON(object.severity) : AuditLog_Severity.DEFAULT,
+ resource: isSet(object.resource) ? globalThis.String(object.resource) : "",
+ request: isSet(object.request) ? globalThis.String(object.request) : "",
+ response: isSet(object.response) ? globalThis.String(object.response) : "",
+ status: isSet(object.status) ? Status.fromJSON(object.status) : undefined,
+ serviceData: isSet(object.serviceData) ? Any.fromJSON(object.serviceData) : undefined,
+ requestMetadata: isSet(object.requestMetadata) ? RequestMetadata.fromJSON(object.requestMetadata) : undefined,
+ };
+ },
+
toJSON(message: AuditLog): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -900,6 +953,10 @@ export const AuditData: MessageFns<AuditData> = {
return message;
},
+ fromJSON(object: any): AuditData {
+ return { policyDelta: isSet(object.policyDelta) ? PolicyDelta.fromJSON(object.policyDelta) : undefined };
+ },
+
toJSON(message: AuditData): unknown {
const obj: any = {};
if (message.policyDelta !== undefined) {
@@ -967,6 +1024,15 @@ export const RequestMetadata: MessageFns<RequestMetadata> = {
return message;
},
+ fromJSON(object: any): RequestMetadata {
+ return {
+ callerIp: isSet(object.callerIp) ? globalThis.String(object.callerIp) : "",
+ callerSuppliedUserAgent: isSet(object.callerSuppliedUserAgent)
+ ? globalThis.String(object.callerSuppliedUserAgent)
+ : "",
+ };
+ },
+
toJSON(message: RequestMetadata): unknown {
const obj: any = {};
if (message.callerIp !== "") {
@@ -1202,6 +1268,15 @@ export const AuditLogServiceDefinition = {
},
} as const;
+function bytesFromBase64(b64: string): Uint8Array {
+ 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 {
const bin: string[] = [];
arr.forEach((byte) => {
@@ -1218,15 +1293,40 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/auth_service.ts b/frontend/src/types/proto/v1/auth_service.ts
index 7c6e920640..fa7d6eb3b0 100644
--- a/frontend/src/types/proto/v1/auth_service.ts
+++ b/frontend/src/types/proto/v1/auth_service.ts
@@ -183,6 +183,19 @@ export const LoginRequest: MessageFns<LoginRequest> = {
return message;
},
+ fromJSON(object: any): LoginRequest {
+ return {
+ email: isSet(object.email) ? globalThis.String(object.email) : "",
+ password: isSet(object.password) ? globalThis.String(object.password) : "",
+ web: isSet(object.web) ? globalThis.Boolean(object.web) : false,
+ idpName: isSet(object.idpName) ? globalThis.String(object.idpName) : "",
+ idpContext: isSet(object.idpContext) ? IdentityProviderContext.fromJSON(object.idpContext) : undefined,
+ otpCode: isSet(object.otpCode) ? globalThis.String(object.otpCode) : undefined,
+ recoveryCode: isSet(object.recoveryCode) ? globalThis.String(object.recoveryCode) : undefined,
+ mfaTempToken: isSet(object.mfaTempToken) ? globalThis.String(object.mfaTempToken) : undefined,
+ };
+ },
+
toJSON(message: LoginRequest): unknown {
const obj: any = {};
if (message.email !== "") {
@@ -278,6 +291,15 @@ export const IdentityProviderContext: MessageFns<IdentityProviderContext> = {
return message;
},
+ fromJSON(object: any): IdentityProviderContext {
+ return {
+ oauth2Context: isSet(object.oauth2Context)
+ ? OAuth2IdentityProviderContext.fromJSON(object.oauth2Context)
+ : undefined,
+ oidcContext: isSet(object.oidcContext) ? OIDCIdentityProviderContext.fromJSON(object.oidcContext) : undefined,
+ };
+ },
+
toJSON(message: IdentityProviderContext): unknown {
const obj: any = {};
if (message.oauth2Context !== undefined) {
@@ -340,6 +362,10 @@ export const OAuth2IdentityProviderContext: MessageFns<OAuth2IdentityProviderCon
return message;
},
+ fromJSON(object: any): OAuth2IdentityProviderContext {
+ return { code: isSet(object.code) ? globalThis.String(object.code) : "" };
+ },
+
toJSON(message: OAuth2IdentityProviderContext): unknown {
const obj: any = {};
if (message.code !== "") {
@@ -383,6 +409,10 @@ export const OIDCIdentityProviderContext: MessageFns<OIDCIdentityProviderContext
return message;
},
+ fromJSON(_: any): OIDCIdentityProviderContext {
+ return {};
+ },
+
toJSON(_: OIDCIdentityProviderContext): unknown {
const obj: any = {};
return obj;
@@ -466,6 +496,17 @@ export const LoginResponse: MessageFns<LoginResponse> = {
return message;
},
+ fromJSON(object: any): LoginResponse {
+ return {
+ token: isSet(object.token) ? globalThis.String(object.token) : "",
+ mfaTempToken: isSet(object.mfaTempToken) ? globalThis.String(object.mfaTempToken) : undefined,
+ requireResetPassword: isSet(object.requireResetPassword)
+ ? globalThis.Boolean(object.requireResetPassword)
+ : false,
+ user: isSet(object.user) ? User.fromJSON(object.user) : undefined,
+ };
+ },
+
toJSON(message: LoginResponse): unknown {
const obj: any = {};
if (message.token !== "") {
@@ -521,6 +562,10 @@ export const LogoutRequest: MessageFns<LogoutRequest> = {
return message;
},
+ fromJSON(_: any): LogoutRequest {
+ return {};
+ },
+
toJSON(_: LogoutRequest): unknown {
const obj: any = {};
return obj;
@@ -605,9 +650,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/cel_service.ts b/frontend/src/types/proto/v1/cel_service.ts
index dd2ba0ee50..16dcee5ad5 100644
--- a/frontend/src/types/proto/v1/cel_service.ts
+++ b/frontend/src/types/proto/v1/cel_service.ts
@@ -63,6 +63,14 @@ export const BatchParseRequest: MessageFns<BatchParseRequest> = {
return message;
},
+ fromJSON(object: any): BatchParseRequest {
+ return {
+ expressions: globalThis.Array.isArray(object?.expressions)
+ ? object.expressions.map((e: any) => globalThis.String(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchParseRequest): unknown {
const obj: any = {};
if (message.expressions?.length) {
@@ -117,6 +125,14 @@ export const BatchParseResponse: MessageFns<BatchParseResponse> = {
return message;
},
+ fromJSON(object: any): BatchParseResponse {
+ return {
+ expressions: globalThis.Array.isArray(object?.expressions)
+ ? object.expressions.map((e: any) => Expr.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchParseResponse): unknown {
const obj: any = {};
if (message.expressions?.length) {
@@ -171,6 +187,14 @@ export const BatchDeparseRequest: MessageFns<BatchDeparseRequest> = {
return message;
},
+ fromJSON(object: any): BatchDeparseRequest {
+ return {
+ expressions: globalThis.Array.isArray(object?.expressions)
+ ? object.expressions.map((e: any) => Expr.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchDeparseRequest): unknown {
const obj: any = {};
if (message.expressions?.length) {
@@ -225,6 +249,14 @@ export const BatchDeparseResponse: MessageFns<BatchDeparseResponse> = {
return message;
},
+ fromJSON(object: any): BatchDeparseResponse {
+ return {
+ expressions: globalThis.Array.isArray(object?.expressions)
+ ? object.expressions.map((e: any) => globalThis.String(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchDeparseResponse): unknown {
const obj: any = {};
if (message.expressions?.length) {
@@ -344,6 +376,7 @@ export type DeepPartial<T> = T extends Builtin ? T
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/changelist_service.ts b/frontend/src/types/proto/v1/changelist_service.ts
index 638566e852..82c5f97c80 100644
--- a/frontend/src/types/proto/v1/changelist_service.ts
+++ b/frontend/src/types/proto/v1/changelist_service.ts
@@ -185,6 +185,14 @@ export const CreateChangelistRequest: MessageFns<CreateChangelistRequest> = {
return message;
},
+ fromJSON(object: any): CreateChangelistRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ changelist: isSet(object.changelist) ? Changelist.fromJSON(object.changelist) : undefined,
+ changelistId: isSet(object.changelistId) ? globalThis.String(object.changelistId) : "",
+ };
+ },
+
toJSON(message: CreateChangelistRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -249,6 +257,10 @@ export const GetChangelistRequest: MessageFns<GetChangelistRequest> = {
return message;
},
+ fromJSON(object: any): GetChangelistRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetChangelistRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -325,6 +337,14 @@ export const ListChangelistsRequest: MessageFns<ListChangelistsRequest> = {
return message;
},
+ fromJSON(object: any): ListChangelistsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: ListChangelistsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -398,6 +418,15 @@ export const ListChangelistsResponse: MessageFns<ListChangelistsResponse> = {
return message;
},
+ fromJSON(object: any): ListChangelistsResponse {
+ return {
+ changelists: globalThis.Array.isArray(object?.changelists)
+ ? object.changelists.map((e: any) => Changelist.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListChangelistsResponse): unknown {
const obj: any = {};
if (message.changelists?.length) {
@@ -467,6 +496,13 @@ export const UpdateChangelistRequest: MessageFns<UpdateChangelistRequest> = {
return message;
},
+ fromJSON(object: any): UpdateChangelistRequest {
+ return {
+ changelist: isSet(object.changelist) ? Changelist.fromJSON(object.changelist) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateChangelistRequest): unknown {
const obj: any = {};
if (message.changelist !== undefined) {
@@ -527,6 +563,10 @@ export const DeleteChangelistRequest: MessageFns<DeleteChangelistRequest> = {
return message;
},
+ fromJSON(object: any): DeleteChangelistRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DeleteChangelistRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -625,6 +665,18 @@ export const Changelist: MessageFns<Changelist> = {
return message;
},
+ fromJSON(object: any): Changelist {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
+ creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
+ updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
+ changes: globalThis.Array.isArray(object?.changes)
+ ? object.changes.map((e: any) => Changelist_Change.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: Changelist): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -708,6 +760,13 @@ export const Changelist_Change: MessageFns<Changelist_Change> = {
return message;
},
+ fromJSON(object: any): Changelist_Change {
+ return {
+ sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
+ source: isSet(object.source) ? globalThis.String(object.source) : "",
+ };
+ },
+
toJSON(message: Changelist_Change): unknown {
const obj: any = {};
if (message.sheet !== "") {
@@ -1187,15 +1246,40 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/common.ts b/frontend/src/types/proto/v1/common.ts
index 04a84c97c2..e1f633d6db 100644
--- a/frontend/src/types/proto/v1/common.ts
+++ b/frontend/src/types/proto/v1/common.ts
@@ -525,6 +525,13 @@ export const Position: MessageFns<Position> = {
return message;
},
+ fromJSON(object: any): Position {
+ return {
+ line: isSet(object.line) ? globalThis.Number(object.line) : 0,
+ column: isSet(object.column) ? globalThis.Number(object.column) : 0,
+ };
+ },
+
toJSON(message: Position): unknown {
const obj: any = {};
if (message.line !== 0) {
@@ -594,6 +601,13 @@ export const Range: MessageFns<Range> = {
return message;
},
+ fromJSON(object: any): Range {
+ return {
+ start: isSet(object.start) ? globalThis.Number(object.start) : 0,
+ end: isSet(object.end) ? globalThis.Number(object.end) : 0,
+ };
+ },
+
toJSON(message: Range): unknown {
const obj: any = {};
if (message.start !== 0) {
@@ -624,9 +638,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/database_catalog_service.ts b/frontend/src/types/proto/v1/database_catalog_service.ts
index 76dab0da31..f039aeef7c 100644
--- a/frontend/src/types/proto/v1/database_catalog_service.ts
+++ b/frontend/src/types/proto/v1/database_catalog_service.ts
@@ -200,6 +200,10 @@ export const GetDatabaseCatalogRequest: MessageFns<GetDatabaseCatalogRequest> =
return message;
},
+ fromJSON(object: any): GetDatabaseCatalogRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetDatabaseCatalogRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -254,6 +258,10 @@ export const UpdateDatabaseCatalogRequest: MessageFns<UpdateDatabaseCatalogReque
return message;
},
+ fromJSON(object: any): UpdateDatabaseCatalogRequest {
+ return { catalog: isSet(object.catalog) ? DatabaseCatalog.fromJSON(object.catalog) : undefined };
+ },
+
toJSON(message: UpdateDatabaseCatalogRequest): unknown {
const obj: any = {};
if (message.catalog !== undefined) {
@@ -321,6 +329,15 @@ export const DatabaseCatalog: MessageFns<DatabaseCatalog> = {
return message;
},
+ fromJSON(object: any): DatabaseCatalog {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ schemas: globalThis.Array.isArray(object?.schemas)
+ ? object.schemas.map((e: any) => SchemaCatalog.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: DatabaseCatalog): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -390,6 +407,13 @@ export const SchemaCatalog: MessageFns<SchemaCatalog> = {
return message;
},
+ fromJSON(object: any): SchemaCatalog {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ tables: globalThis.Array.isArray(object?.tables) ? object.tables.map((e: any) => TableCatalog.fromJSON(e)) : [],
+ };
+ },
+
toJSON(message: SchemaCatalog): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -481,6 +505,15 @@ export const TableCatalog: MessageFns<TableCatalog> = {
return message;
},
+ fromJSON(object: any): TableCatalog {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ columns: isSet(object.columns) ? TableCatalog_Columns.fromJSON(object.columns) : undefined,
+ objectSchema: isSet(object.objectSchema) ? ObjectSchema.fromJSON(object.objectSchema) : undefined,
+ classification: isSet(object.classification) ? globalThis.String(object.classification) : "",
+ };
+ },
+
toJSON(message: TableCatalog): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -551,6 +584,14 @@ export const TableCatalog_Columns: MessageFns<TableCatalog_Columns> = {
return message;
},
+ fromJSON(object: any): TableCatalog_Columns {
+ return {
+ columns: globalThis.Array.isArray(object?.columns)
+ ? object.columns.map((e: any) => ColumnCatalog.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: TableCatalog_Columns): unknown {
const obj: any = {};
if (message.columns?.length) {
@@ -652,6 +693,21 @@ export const ColumnCatalog: MessageFns<ColumnCatalog> = {
return message;
},
+ fromJSON(object: any): ColumnCatalog {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ semanticType: isSet(object.semanticType) ? globalThis.String(object.semanticType) : "",
+ labels: isObject(object.labels)
+ ? Object.entries(object.labels).reduce<{ [key: string]: string }>((acc, [key, value]) => {
+ acc[key] = String(value);
+ return acc;
+ }, {})
+ : {},
+ classification: isSet(object.classification) ? globalThis.String(object.classification) : "",
+ objectSchema: isSet(object.objectSchema) ? ObjectSchema.fromJSON(object.objectSchema) : undefined,
+ };
+ },
+
toJSON(message: ColumnCatalog): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -746,6 +802,13 @@ export const ColumnCatalog_LabelsEntry: MessageFns<ColumnCatalog_LabelsEntry> =
return message;
},
+ fromJSON(object: any): ColumnCatalog_LabelsEntry {
+ return {
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
+ };
+ },
+
toJSON(message: ColumnCatalog_LabelsEntry): unknown {
const obj: any = {};
if (message.key !== "") {
@@ -837,6 +900,15 @@ export const ObjectSchema: MessageFns<ObjectSchema> = {
return message;
},
+ fromJSON(object: any): ObjectSchema {
+ return {
+ type: isSet(object.type) ? objectSchema_TypeFromJSON(object.type) : ObjectSchema_Type.TYPE_UNSPECIFIED,
+ structKind: isSet(object.structKind) ? ObjectSchema_StructKind.fromJSON(object.structKind) : undefined,
+ arrayKind: isSet(object.arrayKind) ? ObjectSchema_ArrayKind.fromJSON(object.arrayKind) : undefined,
+ semanticType: isSet(object.semanticType) ? globalThis.String(object.semanticType) : "",
+ };
+ },
+
toJSON(message: ObjectSchema): unknown {
const obj: any = {};
if (message.type !== ObjectSchema_Type.TYPE_UNSPECIFIED) {
@@ -910,6 +982,17 @@ export const ObjectSchema_StructKind: MessageFns<ObjectSchema_StructKind> = {
return message;
},
+ fromJSON(object: any): ObjectSchema_StructKind {
+ return {
+ properties: isObject(object.properties)
+ ? Object.entries(object.properties).reduce<{ [key: string]: ObjectSchema }>((acc, [key, value]) => {
+ acc[key] = ObjectSchema.fromJSON(value);
+ return acc;
+ }, {})
+ : {},
+ };
+ },
+
toJSON(message: ObjectSchema_StructKind): unknown {
const obj: any = {};
if (message.properties) {
@@ -989,6 +1072,13 @@ export const ObjectSchema_StructKind_PropertiesEntry: MessageFns<ObjectSchema_St
return message;
},
+ fromJSON(object: any): ObjectSchema_StructKind_PropertiesEntry {
+ return {
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
+ value: isSet(object.value) ? ObjectSchema.fromJSON(object.value) : undefined,
+ };
+ },
+
toJSON(message: ObjectSchema_StructKind_PropertiesEntry): unknown {
const obj: any = {};
if (message.key !== "") {
@@ -1049,6 +1139,10 @@ export const ObjectSchema_ArrayKind: MessageFns<ObjectSchema_ArrayKind> = {
return message;
},
+ fromJSON(object: any): ObjectSchema_ArrayKind {
+ return { kind: isSet(object.kind) ? ObjectSchema.fromJSON(object.kind) : undefined };
+ },
+
toJSON(message: ObjectSchema_ArrayKind): unknown {
const obj: any = {};
if (message.kind !== undefined) {
@@ -1309,9 +1403,18 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isObject(value: any): boolean {
+ return typeof value === "object" && value !== null;
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/database_group_service.ts b/frontend/src/types/proto/v1/database_group_service.ts
index bf75f6bcac..983ee02ba7 100644
--- a/frontend/src/types/proto/v1/database_group_service.ts
+++ b/frontend/src/types/proto/v1/database_group_service.ts
@@ -270,6 +270,17 @@ export const ListDatabaseGroupsRequest: MessageFns<ListDatabaseGroupsRequest> =
return message;
},
+ fromJSON(object: any): ListDatabaseGroupsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ view: isSet(object.view)
+ ? databaseGroupViewFromJSON(object.view)
+ : DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED,
+ };
+ },
+
toJSON(message: ListDatabaseGroupsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -347,6 +358,15 @@ export const ListDatabaseGroupsResponse: MessageFns<ListDatabaseGroupsResponse>
return message;
},
+ fromJSON(object: any): ListDatabaseGroupsResponse {
+ return {
+ databaseGroups: globalThis.Array.isArray(object?.databaseGroups)
+ ? object.databaseGroups.map((e: any) => DatabaseGroup.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListDatabaseGroupsResponse): unknown {
const obj: any = {};
if (message.databaseGroups?.length) {
@@ -416,6 +436,15 @@ export const GetDatabaseGroupRequest: MessageFns<GetDatabaseGroupRequest> = {
return message;
},
+ fromJSON(object: any): GetDatabaseGroupRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ view: isSet(object.view)
+ ? databaseGroupViewFromJSON(object.view)
+ : DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED,
+ };
+ },
+
toJSON(message: GetDatabaseGroupRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -507,6 +536,15 @@ export const CreateDatabaseGroupRequest: MessageFns<CreateDatabaseGroupRequest>
return message;
},
+ fromJSON(object: any): CreateDatabaseGroupRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ databaseGroup: isSet(object.databaseGroup) ? DatabaseGroup.fromJSON(object.databaseGroup) : undefined,
+ databaseGroupId: isSet(object.databaseGroupId) ? globalThis.String(object.databaseGroupId) : "",
+ validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
+ };
+ },
+
toJSON(message: CreateDatabaseGroupRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -586,6 +624,13 @@ export const UpdateDatabaseGroupRequest: MessageFns<UpdateDatabaseGroupRequest>
return message;
},
+ fromJSON(object: any): UpdateDatabaseGroupRequest {
+ return {
+ databaseGroup: isSet(object.databaseGroup) ? DatabaseGroup.fromJSON(object.databaseGroup) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateDatabaseGroupRequest): unknown {
const obj: any = {};
if (message.databaseGroup !== undefined) {
@@ -646,6 +691,10 @@ export const DeleteDatabaseGroupRequest: MessageFns<DeleteDatabaseGroupRequest>
return message;
},
+ fromJSON(object: any): DeleteDatabaseGroupRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DeleteDatabaseGroupRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -744,6 +793,20 @@ export const DatabaseGroup: MessageFns<DatabaseGroup> = {
return message;
},
+ fromJSON(object: any): DatabaseGroup {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ databaseExpr: isSet(object.databaseExpr) ? Expr.fromJSON(object.databaseExpr) : undefined,
+ matchedDatabases: globalThis.Array.isArray(object?.matchedDatabases)
+ ? object.matchedDatabases.map((e: any) => DatabaseGroup_Database.fromJSON(e))
+ : [],
+ unmatchedDatabases: globalThis.Array.isArray(object?.unmatchedDatabases)
+ ? object.unmatchedDatabases.map((e: any) => DatabaseGroup_Database.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: DatabaseGroup): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -816,6 +879,10 @@ export const DatabaseGroup_Database: MessageFns<DatabaseGroup_Database> = {
return message;
},
+ fromJSON(object: any): DatabaseGroup_Database {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DatabaseGroup_Database): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1255,9 +1322,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/database_service.ts b/frontend/src/types/proto/v1/database_service.ts
index 91fe700889..05ff242e94 100644
--- a/frontend/src/types/proto/v1/database_service.ts
+++ b/frontend/src/types/proto/v1/database_service.ts
@@ -1775,6 +1775,10 @@ export const GetDatabaseRequest: MessageFns<GetDatabaseRequest> = {
return message;
},
+ fromJSON(object: any): GetDatabaseRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetDatabaseRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1840,6 +1844,13 @@ export const BatchGetDatabasesRequest: MessageFns<BatchGetDatabasesRequest> = {
return message;
},
+ fromJSON(object: any): BatchGetDatabasesRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ names: globalThis.Array.isArray(object?.names) ? object.names.map((e: any) => globalThis.String(e)) : [],
+ };
+ },
+
toJSON(message: BatchGetDatabasesRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1898,6 +1909,14 @@ export const BatchGetDatabasesResponse: MessageFns<BatchGetDatabasesResponse> =
return message;
},
+ fromJSON(object: any): BatchGetDatabasesResponse {
+ return {
+ databases: globalThis.Array.isArray(object?.databases)
+ ? object.databases.map((e: any) => Database.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchGetDatabasesResponse): unknown {
const obj: any = {};
if (message.databases?.length) {
@@ -1996,6 +2015,16 @@ export const ListDatabasesRequest: MessageFns<ListDatabasesRequest> = {
return message;
},
+ fromJSON(object: any): ListDatabasesRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
+ };
+ },
+
toJSON(message: ListDatabasesRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -2077,6 +2106,15 @@ export const ListDatabasesResponse: MessageFns<ListDatabasesResponse> = {
return message;
},
+ fromJSON(object: any): ListDatabasesResponse {
+ return {
+ databases: globalThis.Array.isArray(object?.databases)
+ ? object.databases.map((e: any) => Database.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListDatabasesResponse): unknown {
const obj: any = {};
if (message.databases?.length) {
@@ -2146,6 +2184,13 @@ export const UpdateDatabaseRequest: MessageFns<UpdateDatabaseRequest> = {
return message;
},
+ fromJSON(object: any): UpdateDatabaseRequest {
+ return {
+ database: isSet(object.database) ? Database.fromJSON(object.database) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateDatabaseRequest): unknown {
const obj: any = {};
if (message.database !== undefined) {
@@ -2217,6 +2262,15 @@ export const BatchUpdateDatabasesRequest: MessageFns<BatchUpdateDatabasesRequest
return message;
},
+ fromJSON(object: any): BatchUpdateDatabasesRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ requests: globalThis.Array.isArray(object?.requests)
+ ? object.requests.map((e: any) => UpdateDatabaseRequest.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchUpdateDatabasesRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -2275,6 +2329,14 @@ export const BatchUpdateDatabasesResponse: MessageFns<BatchUpdateDatabasesRespon
return message;
},
+ fromJSON(object: any): BatchUpdateDatabasesResponse {
+ return {
+ databases: globalThis.Array.isArray(object?.databases)
+ ? object.databases.map((e: any) => Database.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchUpdateDatabasesResponse): unknown {
const obj: any = {};
if (message.databases?.length) {
@@ -2340,6 +2402,13 @@ export const BatchSyncDatabasesRequest: MessageFns<BatchSyncDatabasesRequest> =
return message;
},
+ fromJSON(object: any): BatchSyncDatabasesRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ names: globalThis.Array.isArray(object?.names) ? object.names.map((e: any) => globalThis.String(e)) : [],
+ };
+ },
+
toJSON(message: BatchSyncDatabasesRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -2387,6 +2456,10 @@ export const BatchSyncDatabasesResponse: MessageFns<BatchSyncDatabasesResponse>
return message;
},
+ fromJSON(_: any): BatchSyncDatabasesResponse {
+ return {};
+ },
+
toJSON(_: BatchSyncDatabasesResponse): unknown {
const obj: any = {};
return obj;
@@ -2437,6 +2510,10 @@ export const SyncDatabaseRequest: MessageFns<SyncDatabaseRequest> = {
return message;
},
+ fromJSON(object: any): SyncDatabaseRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: SyncDatabaseRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2480,6 +2557,10 @@ export const SyncDatabaseResponse: MessageFns<SyncDatabaseResponse> = {
return message;
},
+ fromJSON(_: any): SyncDatabaseResponse {
+ return {};
+ },
+
toJSON(_: SyncDatabaseResponse): unknown {
const obj: any = {};
return obj;
@@ -2541,6 +2622,13 @@ export const GetDatabaseMetadataRequest: MessageFns<GetDatabaseMetadataRequest>
return message;
},
+ fromJSON(object: any): GetDatabaseMetadataRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ };
+ },
+
toJSON(message: GetDatabaseMetadataRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2610,6 +2698,13 @@ export const GetDatabaseSchemaRequest: MessageFns<GetDatabaseSchemaRequest> = {
return message;
},
+ fromJSON(object: any): GetDatabaseSchemaRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ sdlFormat: isSet(object.sdlFormat) ? globalThis.Boolean(object.sdlFormat) : false,
+ };
+ },
+
toJSON(message: GetDatabaseSchemaRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2701,6 +2796,15 @@ export const DiffSchemaRequest: MessageFns<DiffSchemaRequest> = {
return message;
},
+ fromJSON(object: any): DiffSchemaRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ schema: isSet(object.schema) ? globalThis.String(object.schema) : undefined,
+ changelog: isSet(object.changelog) ? globalThis.String(object.changelog) : undefined,
+ sdlFormat: isSet(object.sdlFormat) ? globalThis.Boolean(object.sdlFormat) : false,
+ };
+ },
+
toJSON(message: DiffSchemaRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2767,6 +2871,10 @@ export const DiffSchemaResponse: MessageFns<DiffSchemaResponse> = {
return message;
},
+ fromJSON(object: any): DiffSchemaResponse {
+ return { diff: isSet(object.diff) ? globalThis.String(object.diff) : "" };
+ },
+
toJSON(message: DiffSchemaResponse): unknown {
const obj: any = {};
if (message.diff !== "") {
@@ -2946,6 +3054,27 @@ export const Database: MessageFns<Database> = {
return message;
},
+ fromJSON(object: any): Database {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
+ successfulSyncTime: isSet(object.successfulSyncTime) ? fromJsonTimestamp(object.successfulSyncTime) : undefined,
+ project: isSet(object.project) ? globalThis.String(object.project) : "",
+ schemaVersion: isSet(object.schemaVersion) ? globalThis.String(object.schemaVersion) : "",
+ environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
+ effectiveEnvironment: isSet(object.effectiveEnvironment) ? globalThis.String(object.effectiveEnvironment) : "",
+ labels: isObject(object.labels)
+ ? Object.entries(object.labels).reduce<{ [key: string]: string }>((acc, [key, value]) => {
+ acc[key] = String(value);
+ return acc;
+ }, {})
+ : {},
+ instanceResource: isSet(object.instanceResource) ? InstanceResource.fromJSON(object.instanceResource) : undefined,
+ backupAvailable: isSet(object.backupAvailable) ? globalThis.Boolean(object.backupAvailable) : false,
+ drifted: isSet(object.drifted) ? globalThis.Boolean(object.drifted) : false,
+ };
+ },
+
toJSON(message: Database): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -3066,6 +3195,13 @@ export const Database_LabelsEntry: MessageFns<Database_LabelsEntry> = {
return message;
},
+ fromJSON(object: any): Database_LabelsEntry {
+ return {
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
+ };
+ },
+
toJSON(message: Database_LabelsEntry): unknown {
const obj: any = {};
if (message.key !== "") {
@@ -3190,6 +3326,22 @@ export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
return message;
},
+ fromJSON(object: any): DatabaseMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ schemas: globalThis.Array.isArray(object?.schemas)
+ ? object.schemas.map((e: any) => SchemaMetadata.fromJSON(e))
+ : [],
+ characterSet: isSet(object.characterSet) ? globalThis.String(object.characterSet) : "",
+ collation: isSet(object.collation) ? globalThis.String(object.collation) : "",
+ extensions: globalThis.Array.isArray(object?.extensions)
+ ? object.extensions.map((e: any) => ExtensionMetadata.fromJSON(e))
+ : [],
+ owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
+ searchPath: isSet(object.searchPath) ? globalThis.String(object.searchPath) : "",
+ };
+ },
+
toJSON(message: DatabaseMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -3438,6 +3590,42 @@ export const SchemaMetadata: MessageFns<SchemaMetadata> = {
return message;
},
+ fromJSON(object: any): SchemaMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ tables: globalThis.Array.isArray(object?.tables) ? object.tables.map((e: any) => TableMetadata.fromJSON(e)) : [],
+ externalTables: globalThis.Array.isArray(object?.externalTables)
+ ? object.externalTables.map((e: any) => ExternalTableMetadata.fromJSON(e))
+ : [],
+ views: globalThis.Array.isArray(object?.views) ? object.views.map((e: any) => ViewMetadata.fromJSON(e)) : [],
+ functions: globalThis.Array.isArray(object?.functions)
+ ? object.functions.map((e: any) => FunctionMetadata.fromJSON(e))
+ : [],
+ procedures: globalThis.Array.isArray(object?.procedures)
+ ? object.procedures.map((e: any) => ProcedureMetadata.fromJSON(e))
+ : [],
+ streams: globalThis.Array.isArray(object?.streams)
+ ? object.streams.map((e: any) => StreamMetadata.fromJSON(e))
+ : [],
+ tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => TaskMetadata.fromJSON(e)) : [],
+ materializedViews: globalThis.Array.isArray(object?.materializedViews)
+ ? object.materializedViews.map((e: any) => MaterializedViewMetadata.fromJSON(e))
+ : [],
+ packages: globalThis.Array.isArray(object?.packages)
+ ? object.packages.map((e: any) => PackageMetadata.fromJSON(e))
+ : [],
+ owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
+ sequences: globalThis.Array.isArray(object?.sequences)
+ ? object.sequences.map((e: any) => SequenceMetadata.fromJSON(e))
+ : [],
+ events: globalThis.Array.isArray(object?.events) ? object.events.map((e: any) => EventMetadata.fromJSON(e)) : [],
+ enumTypes: globalThis.Array.isArray(object?.enumTypes)
+ ? object.enumTypes.map((e: any) => EnumTypeMetadata.fromJSON(e))
+ : [],
+ skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
+ };
+ },
+
toJSON(message: SchemaMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -3581,6 +3769,15 @@ export const EnumTypeMetadata: MessageFns<EnumTypeMetadata> = {
return message;
},
+ fromJSON(object: any): EnumTypeMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ values: globalThis.Array.isArray(object?.values) ? object.values.map((e: any) => globalThis.String(e)) : [],
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
+ };
+ },
+
toJSON(message: EnumTypeMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -3702,6 +3899,17 @@ export const EventMetadata: MessageFns<EventMetadata> = {
return message;
},
+ fromJSON(object: any): EventMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
+ timeZone: isSet(object.timeZone) ? globalThis.String(object.timeZone) : "",
+ sqlMode: isSet(object.sqlMode) ? globalThis.String(object.sqlMode) : "",
+ characterSetClient: isSet(object.characterSetClient) ? globalThis.String(object.characterSetClient) : "",
+ collationConnection: isSet(object.collationConnection) ? globalThis.String(object.collationConnection) : "",
+ };
+ },
+
toJSON(message: EventMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -3922,6 +4130,24 @@ export const SequenceMetadata: MessageFns<SequenceMetadata> = {
return message;
},
+ fromJSON(object: any): SequenceMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ dataType: isSet(object.dataType) ? globalThis.String(object.dataType) : "",
+ start: isSet(object.start) ? globalThis.String(object.start) : "",
+ minValue: isSet(object.minValue) ? globalThis.String(object.minValue) : "",
+ maxValue: isSet(object.maxValue) ? globalThis.String(object.maxValue) : "",
+ increment: isSet(object.increment) ? globalThis.String(object.increment) : "",
+ cycle: isSet(object.cycle) ? globalThis.Boolean(object.cycle) : false,
+ cacheSize: isSet(object.cacheSize) ? globalThis.String(object.cacheSize) : "",
+ lastValue: isSet(object.lastValue) ? globalThis.String(object.lastValue) : "",
+ ownerTable: isSet(object.ownerTable) ? globalThis.String(object.ownerTable) : "",
+ ownerColumn: isSet(object.ownerColumn) ? globalThis.String(object.ownerColumn) : "",
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
+ };
+ },
+
toJSON(message: SequenceMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -4122,6 +4348,20 @@ export const TriggerMetadata: MessageFns<TriggerMetadata> = {
return message;
},
+ fromJSON(object: any): TriggerMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ event: isSet(object.event) ? globalThis.String(object.event) : "",
+ timing: isSet(object.timing) ? globalThis.String(object.timing) : "",
+ body: isSet(object.body) ? globalThis.String(object.body) : "",
+ sqlMode: isSet(object.sqlMode) ? globalThis.String(object.sqlMode) : "",
+ characterSetClient: isSet(object.characterSetClient) ? globalThis.String(object.characterSetClient) : "",
+ collationConnection: isSet(object.collationConnection) ? globalThis.String(object.collationConnection) : "",
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
+ };
+ },
+
toJSON(message: TriggerMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -4241,6 +4481,17 @@ export const ExternalTableMetadata: MessageFns<ExternalTableMetadata> = {
return message;
},
+ fromJSON(object: any): ExternalTableMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ externalServerName: isSet(object.externalServerName) ? globalThis.String(object.externalServerName) : "",
+ externalDatabaseName: isSet(object.externalDatabaseName) ? globalThis.String(object.externalDatabaseName) : "",
+ columns: globalThis.Array.isArray(object?.columns)
+ ? object.columns.map((e: any) => ColumnMetadata.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: ExternalTableMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -4561,6 +4812,47 @@ export const TableMetadata: MessageFns<TableMetadata> = {
return message;
},
+ fromJSON(object: any): TableMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ columns: globalThis.Array.isArray(object?.columns)
+ ? object.columns.map((e: any) => ColumnMetadata.fromJSON(e))
+ : [],
+ indexes: globalThis.Array.isArray(object?.indexes)
+ ? object.indexes.map((e: any) => IndexMetadata.fromJSON(e))
+ : [],
+ engine: isSet(object.engine) ? globalThis.String(object.engine) : "",
+ collation: isSet(object.collation) ? globalThis.String(object.collation) : "",
+ charset: isSet(object.charset) ? globalThis.String(object.charset) : "",
+ rowCount: isSet(object.rowCount) ? Long.fromValue(object.rowCount) : Long.ZERO,
+ dataSize: isSet(object.dataSize) ? Long.fromValue(object.dataSize) : Long.ZERO,
+ indexSize: isSet(object.indexSize) ? Long.fromValue(object.indexSize) : Long.ZERO,
+ dataFree: isSet(object.dataFree) ? Long.fromValue(object.dataFree) : Long.ZERO,
+ createOptions: isSet(object.createOptions) ? globalThis.String(object.createOptions) : "",
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ userComment: isSet(object.userComment) ? globalThis.String(object.userComment) : "",
+ foreignKeys: globalThis.Array.isArray(object?.foreignKeys)
+ ? object.foreignKeys.map((e: any) => ForeignKeyMetadata.fromJSON(e))
+ : [],
+ partitions: globalThis.Array.isArray(object?.partitions)
+ ? object.partitions.map((e: any) => TablePartitionMetadata.fromJSON(e))
+ : [],
+ checkConstraints: globalThis.Array.isArray(object?.checkConstraints)
+ ? object.checkConstraints.map((e: any) => CheckConstraintMetadata.fromJSON(e))
+ : [],
+ owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
+ sortingKeys: globalThis.Array.isArray(object?.sortingKeys)
+ ? object.sortingKeys.map((e: any) => globalThis.String(e))
+ : [],
+ triggers: globalThis.Array.isArray(object?.triggers)
+ ? object.triggers.map((e: any) => TriggerMetadata.fromJSON(e))
+ : [],
+ skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
+ shardingInfo: isSet(object.shardingInfo) ? globalThis.String(object.shardingInfo) : "",
+ primaryKeyType: isSet(object.primaryKeyType) ? globalThis.String(object.primaryKeyType) : "",
+ };
+ },
+
toJSON(message: TableMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -4718,6 +5010,13 @@ export const CheckConstraintMetadata: MessageFns<CheckConstraintMetadata> = {
return message;
},
+ fromJSON(object: any): CheckConstraintMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ expression: isSet(object.expression) ? globalThis.String(object.expression) : "",
+ };
+ },
+
toJSON(message: CheckConstraintMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -4862,6 +5161,27 @@ export const TablePartitionMetadata: MessageFns<TablePartitionMetadata> = {
return message;
},
+ fromJSON(object: any): TablePartitionMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ type: isSet(object.type)
+ ? tablePartitionMetadata_TypeFromJSON(object.type)
+ : TablePartitionMetadata_Type.TYPE_UNSPECIFIED,
+ expression: isSet(object.expression) ? globalThis.String(object.expression) : "",
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
+ useDefault: isSet(object.useDefault) ? globalThis.String(object.useDefault) : "",
+ subpartitions: globalThis.Array.isArray(object?.subpartitions)
+ ? object.subpartitions.map((e: any) => TablePartitionMetadata.fromJSON(e))
+ : [],
+ indexes: globalThis.Array.isArray(object?.indexes)
+ ? object.indexes.map((e: any) => IndexMetadata.fromJSON(e))
+ : [],
+ checkConstraints: globalThis.Array.isArray(object?.checkConstraints)
+ ? object.checkConstraints.map((e: any) => CheckConstraintMetadata.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: TablePartitionMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -5162,6 +5482,32 @@ export const ColumnMetadata: MessageFns<ColumnMetadata> = {
return message;
},
+ fromJSON(object: any): ColumnMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ position: isSet(object.position) ? globalThis.Number(object.position) : 0,
+ hasDefault: isSet(object.hasDefault) ? globalThis.Boolean(object.hasDefault) : false,
+ defaultNull: isSet(object.defaultNull) ? globalThis.Boolean(object.defaultNull) : undefined,
+ defaultString: isSet(object.defaultString) ? globalThis.String(object.defaultString) : undefined,
+ defaultExpression: isSet(object.defaultExpression) ? globalThis.String(object.defaultExpression) : undefined,
+ defaultOnNull: isSet(object.defaultOnNull) ? globalThis.Boolean(object.defaultOnNull) : false,
+ onUpdate: isSet(object.onUpdate) ? globalThis.String(object.onUpdate) : "",
+ nullable: isSet(object.nullable) ? globalThis.Boolean(object.nullable) : false,
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
+ characterSet: isSet(object.characterSet) ? globalThis.String(object.characterSet) : "",
+ collation: isSet(object.collation) ? globalThis.String(object.collation) : "",
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ userComment: isSet(object.userComment) ? globalThis.String(object.userComment) : "",
+ generation: isSet(object.generation) ? GenerationMetadata.fromJSON(object.generation) : undefined,
+ isIdentity: isSet(object.isIdentity) ? globalThis.Boolean(object.isIdentity) : false,
+ identityGeneration: isSet(object.identityGeneration)
+ ? columnMetadata_IdentityGenerationFromJSON(object.identityGeneration)
+ : ColumnMetadata_IdentityGeneration.IDENTITY_GENERATION_UNSPECIFIED,
+ identitySeed: isSet(object.identitySeed) ? Long.fromValue(object.identitySeed) : Long.ZERO,
+ identityIncrement: isSet(object.identityIncrement) ? Long.fromValue(object.identityIncrement) : Long.ZERO,
+ };
+ },
+
toJSON(message: ColumnMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -5306,6 +5652,15 @@ export const GenerationMetadata: MessageFns<GenerationMetadata> = {
return message;
},
+ fromJSON(object: any): GenerationMetadata {
+ return {
+ type: isSet(object.type)
+ ? generationMetadata_TypeFromJSON(object.type)
+ : GenerationMetadata_Type.TYPE_UNSPECIFIED,
+ expression: isSet(object.expression) ? globalThis.String(object.expression) : "",
+ };
+ },
+
toJSON(message: GenerationMetadata): unknown {
const obj: any = {};
if (message.type !== GenerationMetadata_Type.TYPE_UNSPECIFIED) {
@@ -5430,6 +5785,24 @@ export const ViewMetadata: MessageFns<ViewMetadata> = {
return message;
},
+ fromJSON(object: any): ViewMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ dependencyColumns: globalThis.Array.isArray(object?.dependencyColumns)
+ ? object.dependencyColumns.map((e: any) => DependencyColumn.fromJSON(e))
+ : [],
+ columns: globalThis.Array.isArray(object?.columns)
+ ? object.columns.map((e: any) => ColumnMetadata.fromJSON(e))
+ : [],
+ triggers: globalThis.Array.isArray(object?.triggers)
+ ? object.triggers.map((e: any) => TriggerMetadata.fromJSON(e))
+ : [],
+ skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
+ };
+ },
+
toJSON(message: ViewMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -5530,6 +5903,14 @@ export const DependencyColumn: MessageFns<DependencyColumn> = {
return message;
},
+ fromJSON(object: any): DependencyColumn {
+ return {
+ schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
+ table: isSet(object.table) ? globalThis.String(object.table) : "",
+ column: isSet(object.column) ? globalThis.String(object.column) : "",
+ };
+ },
+
toJSON(message: DependencyColumn): unknown {
const obj: any = {};
if (message.schema !== "") {
@@ -5658,6 +6039,24 @@ export const MaterializedViewMetadata: MessageFns<MaterializedViewMetadata> = {
return message;
},
+ fromJSON(object: any): MaterializedViewMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ dependencyColumns: globalThis.Array.isArray(object?.dependencyColumns)
+ ? object.dependencyColumns.map((e: any) => DependencyColumn.fromJSON(e))
+ : [],
+ triggers: globalThis.Array.isArray(object?.triggers)
+ ? object.triggers.map((e: any) => TriggerMetadata.fromJSON(e))
+ : [],
+ indexes: globalThis.Array.isArray(object?.indexes)
+ ? object.indexes.map((e: any) => IndexMetadata.fromJSON(e))
+ : [],
+ skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
+ };
+ },
+
toJSON(message: MaterializedViewMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -5747,6 +6146,13 @@ export const DependencyTable: MessageFns<DependencyTable> = {
return message;
},
+ fromJSON(object: any): DependencyTable {
+ return {
+ schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
+ table: isSet(object.table) ? globalThis.String(object.table) : "",
+ };
+ },
+
toJSON(message: DependencyTable): unknown {
const obj: any = {};
if (message.schema !== "") {
@@ -5915,6 +6321,23 @@ export const FunctionMetadata: MessageFns<FunctionMetadata> = {
return message;
},
+ fromJSON(object: any): FunctionMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
+ signature: isSet(object.signature) ? globalThis.String(object.signature) : "",
+ characterSetClient: isSet(object.characterSetClient) ? globalThis.String(object.characterSetClient) : "",
+ collationConnection: isSet(object.collationConnection) ? globalThis.String(object.collationConnection) : "",
+ databaseCollation: isSet(object.databaseCollation) ? globalThis.String(object.databaseCollation) : "",
+ sqlMode: isSet(object.sqlMode) ? globalThis.String(object.sqlMode) : "",
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ dependencyTables: globalThis.Array.isArray(object?.dependencyTables)
+ ? object.dependencyTables.map((e: any) => DependencyTable.fromJSON(e))
+ : [],
+ skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
+ };
+ },
+
toJSON(message: FunctionMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -6091,6 +6514,19 @@ export const ProcedureMetadata: MessageFns<ProcedureMetadata> = {
return message;
},
+ fromJSON(object: any): ProcedureMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
+ signature: isSet(object.signature) ? globalThis.String(object.signature) : "",
+ characterSetClient: isSet(object.characterSetClient) ? globalThis.String(object.characterSetClient) : "",
+ collationConnection: isSet(object.collationConnection) ? globalThis.String(object.collationConnection) : "",
+ databaseCollation: isSet(object.databaseCollation) ? globalThis.String(object.databaseCollation) : "",
+ sqlMode: isSet(object.sqlMode) ? globalThis.String(object.sqlMode) : "",
+ skipDump: isSet(object.skipDump) ? globalThis.Boolean(object.skipDump) : false,
+ };
+ },
+
toJSON(message: ProcedureMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -6184,6 +6620,13 @@ export const PackageMetadata: MessageFns<PackageMetadata> = {
return message;
},
+ fromJSON(object: any): PackageMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
+ };
+ },
+
toJSON(message: PackageMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -6352,6 +6795,23 @@ export const TaskMetadata: MessageFns<TaskMetadata> = {
return message;
},
+ fromJSON(object: any): TaskMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ warehouse: isSet(object.warehouse) ? globalThis.String(object.warehouse) : "",
+ schedule: isSet(object.schedule) ? globalThis.String(object.schedule) : "",
+ predecessors: globalThis.Array.isArray(object?.predecessors)
+ ? object.predecessors.map((e: any) => globalThis.String(e))
+ : [],
+ state: isSet(object.state) ? taskMetadata_StateFromJSON(object.state) : TaskMetadata_State.STATE_UNSPECIFIED,
+ condition: isSet(object.condition) ? globalThis.String(object.condition) : "",
+ definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
+ };
+ },
+
toJSON(message: TaskMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -6528,6 +6988,19 @@ export const StreamMetadata: MessageFns<StreamMetadata> = {
return message;
},
+ fromJSON(object: any): StreamMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ tableName: isSet(object.tableName) ? globalThis.String(object.tableName) : "",
+ owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ type: isSet(object.type) ? streamMetadata_TypeFromJSON(object.type) : StreamMetadata_Type.TYPE_UNSPECIFIED,
+ stale: isSet(object.stale) ? globalThis.Boolean(object.stale) : false,
+ mode: isSet(object.mode) ? streamMetadata_ModeFromJSON(object.mode) : StreamMetadata_Mode.MODE_UNSPECIFIED,
+ definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
+ };
+ },
+
toJSON(message: StreamMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -6792,6 +7265,29 @@ export const IndexMetadata: MessageFns<IndexMetadata> = {
return message;
},
+ fromJSON(object: any): IndexMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ expressions: globalThis.Array.isArray(object?.expressions)
+ ? object.expressions.map((e: any) => globalThis.String(e))
+ : [],
+ keyLength: globalThis.Array.isArray(object?.keyLength) ? object.keyLength.map((e: any) => Long.fromValue(e)) : [],
+ descending: globalThis.Array.isArray(object?.descending)
+ ? object.descending.map((e: any) => globalThis.Boolean(e))
+ : [],
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
+ unique: isSet(object.unique) ? globalThis.Boolean(object.unique) : false,
+ primary: isSet(object.primary) ? globalThis.Boolean(object.primary) : false,
+ visible: isSet(object.visible) ? globalThis.Boolean(object.visible) : false,
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
+ parentIndexSchema: isSet(object.parentIndexSchema) ? globalThis.String(object.parentIndexSchema) : "",
+ parentIndexName: isSet(object.parentIndexName) ? globalThis.String(object.parentIndexName) : "",
+ granularity: isSet(object.granularity) ? Long.fromValue(object.granularity) : Long.ZERO,
+ isConstraint: isSet(object.isConstraint) ? globalThis.Boolean(object.isConstraint) : false,
+ };
+ },
+
toJSON(message: IndexMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -6933,6 +7429,15 @@ export const ExtensionMetadata: MessageFns<ExtensionMetadata> = {
return message;
},
+ fromJSON(object: any): ExtensionMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
+ };
+ },
+
toJSON(message: ExtensionMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -7085,6 +7590,21 @@ export const ForeignKeyMetadata: MessageFns<ForeignKeyMetadata> = {
return message;
},
+ fromJSON(object: any): ForeignKeyMetadata {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ columns: globalThis.Array.isArray(object?.columns) ? object.columns.map((e: any) => globalThis.String(e)) : [],
+ referencedSchema: isSet(object.referencedSchema) ? globalThis.String(object.referencedSchema) : "",
+ referencedTable: isSet(object.referencedTable) ? globalThis.String(object.referencedTable) : "",
+ referencedColumns: globalThis.Array.isArray(object?.referencedColumns)
+ ? object.referencedColumns.map((e: any) => globalThis.String(e))
+ : [],
+ onDelete: isSet(object.onDelete) ? globalThis.String(object.onDelete) : "",
+ onUpdate: isSet(object.onUpdate) ? globalThis.String(object.onUpdate) : "",
+ matchType: isSet(object.matchType) ? globalThis.String(object.matchType) : "",
+ };
+ },
+
toJSON(message: ForeignKeyMetadata): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -7167,6 +7687,10 @@ export const DatabaseSchema: MessageFns<DatabaseSchema> = {
return message;
},
+ fromJSON(object: any): DatabaseSchema {
+ return { schema: isSet(object.schema) ? globalThis.String(object.schema) : "" };
+ },
+
toJSON(message: DatabaseSchema): unknown {
const obj: any = {};
if (message.schema !== "") {
@@ -7243,6 +7767,14 @@ export const ListSecretsRequest: MessageFns<ListSecretsRequest> = {
return message;
},
+ fromJSON(object: any): ListSecretsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: ListSecretsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -7316,6 +7848,13 @@ export const ListSecretsResponse: MessageFns<ListSecretsResponse> = {
return message;
},
+ fromJSON(object: any): ListSecretsResponse {
+ return {
+ secrets: globalThis.Array.isArray(object?.secrets) ? object.secrets.map((e: any) => Secret.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListSecretsResponse): unknown {
const obj: any = {};
if (message.secrets?.length) {
@@ -7396,6 +7935,14 @@ export const UpdateSecretRequest: MessageFns<UpdateSecretRequest> = {
return message;
},
+ fromJSON(object: any): UpdateSecretRequest {
+ return {
+ secret: isSet(object.secret) ? Secret.fromJSON(object.secret) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ allowMissing: isSet(object.allowMissing) ? globalThis.Boolean(object.allowMissing) : false,
+ };
+ },
+
toJSON(message: UpdateSecretRequest): unknown {
const obj: any = {};
if (message.secret !== undefined) {
@@ -7460,6 +8007,10 @@ export const DeleteSecretRequest: MessageFns<DeleteSecretRequest> = {
return message;
},
+ fromJSON(object: any): DeleteSecretRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DeleteSecretRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -7558,6 +8109,16 @@ export const Secret: MessageFns<Secret> = {
return message;
},
+ fromJSON(object: any): Secret {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ createdTime: isSet(object.createdTime) ? fromJsonTimestamp(object.createdTime) : undefined,
+ updatedTime: isSet(object.updatedTime) ? fromJsonTimestamp(object.updatedTime) : undefined,
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
+ };
+ },
+
toJSON(message: Secret): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -7632,6 +8193,14 @@ export const ChangedResources: MessageFns<ChangedResources> = {
return message;
},
+ fromJSON(object: any): ChangedResources {
+ return {
+ databases: globalThis.Array.isArray(object?.databases)
+ ? object.databases.map((e: any) => ChangedResourceDatabase.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: ChangedResources): unknown {
const obj: any = {};
if (message.databases?.length) {
@@ -7697,6 +8266,15 @@ export const ChangedResourceDatabase: MessageFns<ChangedResourceDatabase> = {
return message;
},
+ fromJSON(object: any): ChangedResourceDatabase {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ schemas: globalThis.Array.isArray(object?.schemas)
+ ? object.schemas.map((e: any) => ChangedResourceSchema.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: ChangedResourceDatabase): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -7799,6 +8377,24 @@ export const ChangedResourceSchema: MessageFns<ChangedResourceSchema> = {
return message;
},
+ fromJSON(object: any): ChangedResourceSchema {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ tables: globalThis.Array.isArray(object?.tables)
+ ? object.tables.map((e: any) => ChangedResourceTable.fromJSON(e))
+ : [],
+ views: globalThis.Array.isArray(object?.views)
+ ? object.views.map((e: any) => ChangedResourceView.fromJSON(e))
+ : [],
+ functions: globalThis.Array.isArray(object?.functions)
+ ? object.functions.map((e: any) => ChangedResourceFunction.fromJSON(e))
+ : [],
+ procedures: globalThis.Array.isArray(object?.procedures)
+ ? object.procedures.map((e: any) => ChangedResourceProcedure.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: ChangedResourceSchema): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -7880,6 +8476,13 @@ export const ChangedResourceTable: MessageFns<ChangedResourceTable> = {
return message;
},
+ fromJSON(object: any): ChangedResourceTable {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ ranges: globalThis.Array.isArray(object?.ranges) ? object.ranges.map((e: any) => Range.fromJSON(e)) : [],
+ };
+ },
+
toJSON(message: ChangedResourceTable): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -7949,6 +8552,13 @@ export const ChangedResourceView: MessageFns<ChangedResourceView> = {
return message;
},
+ fromJSON(object: any): ChangedResourceView {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ ranges: globalThis.Array.isArray(object?.ranges) ? object.ranges.map((e: any) => Range.fromJSON(e)) : [],
+ };
+ },
+
toJSON(message: ChangedResourceView): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -8018,6 +8628,13 @@ export const ChangedResourceFunction: MessageFns<ChangedResourceFunction> = {
return message;
},
+ fromJSON(object: any): ChangedResourceFunction {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ ranges: globalThis.Array.isArray(object?.ranges) ? object.ranges.map((e: any) => Range.fromJSON(e)) : [],
+ };
+ },
+
toJSON(message: ChangedResourceFunction): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -8087,6 +8704,13 @@ export const ChangedResourceProcedure: MessageFns<ChangedResourceProcedure> = {
return message;
},
+ fromJSON(object: any): ChangedResourceProcedure {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ ranges: globalThis.Array.isArray(object?.ranges) ? object.ranges.map((e: any) => Range.fromJSON(e)) : [],
+ };
+ },
+
toJSON(message: ChangedResourceProcedure): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -8189,6 +8813,16 @@ export const ListChangelogsRequest: MessageFns<ListChangelogsRequest> = {
return message;
},
+ fromJSON(object: any): ListChangelogsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ view: isSet(object.view) ? changelogViewFromJSON(object.view) : ChangelogView.CHANGELOG_VIEW_UNSPECIFIED,
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ };
+ },
+
toJSON(message: ListChangelogsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -8270,6 +8904,15 @@ export const ListChangelogsResponse: MessageFns<ListChangelogsResponse> = {
return message;
},
+ fromJSON(object: any): ListChangelogsResponse {
+ return {
+ changelogs: globalThis.Array.isArray(object?.changelogs)
+ ? object.changelogs.map((e: any) => Changelog.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListChangelogsResponse): unknown {
const obj: any = {};
if (message.changelogs?.length) {
@@ -8350,6 +8993,14 @@ export const GetChangelogRequest: MessageFns<GetChangelogRequest> = {
return message;
},
+ fromJSON(object: any): GetChangelogRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ view: isSet(object.view) ? changelogViewFromJSON(object.view) : ChangelogView.CHANGELOG_VIEW_UNSPECIFIED,
+ sdlFormat: isSet(object.sdlFormat) ? globalThis.Boolean(object.sdlFormat) : false,
+ };
+ },
+
toJSON(message: GetChangelogRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -8594,6 +9245,27 @@ export const Changelog: MessageFns<Changelog> = {
return message;
},
+ fromJSON(object: any): Changelog {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ status: isSet(object.status) ? changelog_StatusFromJSON(object.status) : Changelog_Status.STATUS_UNSPECIFIED,
+ statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
+ statementSize: isSet(object.statementSize) ? Long.fromValue(object.statementSize) : Long.ZERO,
+ statementSheet: isSet(object.statementSheet) ? globalThis.String(object.statementSheet) : "",
+ schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
+ schemaSize: isSet(object.schemaSize) ? Long.fromValue(object.schemaSize) : Long.ZERO,
+ prevSchema: isSet(object.prevSchema) ? globalThis.String(object.prevSchema) : "",
+ prevSchemaSize: isSet(object.prevSchemaSize) ? Long.fromValue(object.prevSchemaSize) : Long.ZERO,
+ issue: isSet(object.issue) ? globalThis.String(object.issue) : "",
+ taskRun: isSet(object.taskRun) ? globalThis.String(object.taskRun) : "",
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
+ revision: isSet(object.revision) ? globalThis.String(object.revision) : "",
+ changedResources: isSet(object.changedResources) ? ChangedResources.fromJSON(object.changedResources) : undefined,
+ type: isSet(object.type) ? changelog_TypeFromJSON(object.type) : Changelog_Type.TYPE_UNSPECIFIED,
+ };
+ },
+
toJSON(message: Changelog): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -8768,6 +9440,18 @@ export const GetSchemaStringRequest: MessageFns<GetSchemaStringRequest> = {
return message;
},
+ fromJSON(object: any): GetSchemaStringRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ type: isSet(object.type)
+ ? getSchemaStringRequest_ObjectTypeFromJSON(object.type)
+ : GetSchemaStringRequest_ObjectType.OBJECT_TYPE_UNSPECIFIED,
+ schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
+ object: isSet(object.object) ? globalThis.String(object.object) : "",
+ metadata: isSet(object.metadata) ? DatabaseMetadata.fromJSON(object.metadata) : undefined,
+ };
+ },
+
toJSON(message: GetSchemaStringRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -8840,6 +9524,10 @@ export const GetSchemaStringResponse: MessageFns<GetSchemaStringResponse> = {
return message;
},
+ fromJSON(object: any): GetSchemaStringResponse {
+ return { schemaString: isSet(object.schemaString) ? globalThis.String(object.schemaString) : "" };
+ },
+
toJSON(message: GetSchemaStringResponse): unknown {
const obj: any = {};
if (message.schemaString !== "") {
@@ -10307,15 +10995,44 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isObject(value: any): boolean {
+ return typeof value === "object" && value !== null;
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/group_service.ts b/frontend/src/types/proto/v1/group_service.ts
index 23a346e581..fd1bbee947 100644
--- a/frontend/src/types/proto/v1/group_service.ts
+++ b/frontend/src/types/proto/v1/group_service.ts
@@ -203,6 +203,10 @@ export const GetGroupRequest: MessageFns<GetGroupRequest> = {
return message;
},
+ fromJSON(object: any): GetGroupRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetGroupRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -268,6 +272,13 @@ export const ListGroupsRequest: MessageFns<ListGroupsRequest> = {
return message;
},
+ fromJSON(object: any): ListGroupsRequest {
+ return {
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: ListGroupsRequest): unknown {
const obj: any = {};
if (message.pageSize !== 0) {
@@ -337,6 +348,13 @@ export const ListGroupsResponse: MessageFns<ListGroupsResponse> = {
return message;
},
+ fromJSON(object: any): ListGroupsResponse {
+ return {
+ groups: globalThis.Array.isArray(object?.groups) ? object.groups.map((e: any) => Group.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListGroupsResponse): unknown {
const obj: any = {};
if (message.groups?.length) {
@@ -406,6 +424,13 @@ export const CreateGroupRequest: MessageFns<CreateGroupRequest> = {
return message;
},
+ fromJSON(object: any): CreateGroupRequest {
+ return {
+ group: isSet(object.group) ? Group.fromJSON(object.group) : undefined,
+ groupEmail: isSet(object.groupEmail) ? globalThis.String(object.groupEmail) : "",
+ };
+ },
+
toJSON(message: CreateGroupRequest): unknown {
const obj: any = {};
if (message.group !== undefined) {
@@ -486,6 +511,14 @@ export const UpdateGroupRequest: MessageFns<UpdateGroupRequest> = {
return message;
},
+ fromJSON(object: any): UpdateGroupRequest {
+ return {
+ group: isSet(object.group) ? Group.fromJSON(object.group) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ allowMissing: isSet(object.allowMissing) ? globalThis.Boolean(object.allowMissing) : false,
+ };
+ },
+
toJSON(message: UpdateGroupRequest): unknown {
const obj: any = {};
if (message.group !== undefined) {
@@ -548,6 +581,10 @@ export const DeleteGroupRequest: MessageFns<DeleteGroupRequest> = {
return message;
},
+ fromJSON(object: any): DeleteGroupRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DeleteGroupRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -613,6 +650,13 @@ export const GroupMember: MessageFns<GroupMember> = {
return message;
},
+ fromJSON(object: any): GroupMember {
+ return {
+ member: isSet(object.member) ? globalThis.String(object.member) : "",
+ role: isSet(object.role) ? groupMember_RoleFromJSON(object.role) : GroupMember_Role.ROLE_UNSPECIFIED,
+ };
+ },
+
toJSON(message: GroupMember): unknown {
const obj: any = {};
if (message.member !== "") {
@@ -715,6 +759,16 @@ export const Group: MessageFns<Group> = {
return message;
},
+ fromJSON(object: any): Group {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
+ members: globalThis.Array.isArray(object?.members) ? object.members.map((e: any) => GroupMember.fromJSON(e)) : [],
+ source: isSet(object.source) ? globalThis.String(object.source) : "",
+ };
+ },
+
toJSON(message: Group): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -937,9 +991,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/iam_policy.ts b/frontend/src/types/proto/v1/iam_policy.ts
index 96ac8f5dee..ef8ddc8002 100644
--- a/frontend/src/types/proto/v1/iam_policy.ts
+++ b/frontend/src/types/proto/v1/iam_policy.ts
@@ -200,6 +200,10 @@ export const GetIamPolicyRequest: MessageFns<GetIamPolicyRequest> = {
return message;
},
+ fromJSON(object: any): GetIamPolicyRequest {
+ return { resource: isSet(object.resource) ? globalThis.String(object.resource) : "" };
+ },
+
toJSON(message: GetIamPolicyRequest): unknown {
const obj: any = {};
if (message.resource !== "") {
@@ -276,6 +280,14 @@ export const SetIamPolicyRequest: MessageFns<SetIamPolicyRequest> = {
return message;
},
+ fromJSON(object: any): SetIamPolicyRequest {
+ return {
+ resource: isSet(object.resource) ? globalThis.String(object.resource) : "",
+ policy: isSet(object.policy) ? IamPolicy.fromJSON(object.policy) : undefined,
+ etag: isSet(object.etag) ? globalThis.String(object.etag) : "",
+ };
+ },
+
toJSON(message: SetIamPolicyRequest): unknown {
const obj: any = {};
if (message.resource !== "") {
@@ -351,6 +363,13 @@ export const IamPolicy: MessageFns<IamPolicy> = {
return message;
},
+ fromJSON(object: any): IamPolicy {
+ return {
+ bindings: globalThis.Array.isArray(object?.bindings) ? object.bindings.map((e: any) => Binding.fromJSON(e)) : [],
+ etag: isSet(object.etag) ? globalThis.String(object.etag) : "",
+ };
+ },
+
toJSON(message: IamPolicy): unknown {
const obj: any = {};
if (message.bindings?.length) {
@@ -442,6 +461,15 @@ export const Binding: MessageFns<Binding> = {
return message;
},
+ fromJSON(object: any): Binding {
+ return {
+ role: isSet(object.role) ? globalThis.String(object.role) : "",
+ members: globalThis.Array.isArray(object?.members) ? object.members.map((e: any) => globalThis.String(e)) : [],
+ condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
+ parsedExpr: isSet(object.parsedExpr) ? Expr1.fromJSON(object.parsedExpr) : undefined,
+ };
+ },
+
toJSON(message: Binding): unknown {
const obj: any = {};
if (message.role !== "") {
@@ -512,6 +540,14 @@ export const PolicyDelta: MessageFns<PolicyDelta> = {
return message;
},
+ fromJSON(object: any): PolicyDelta {
+ return {
+ bindingDeltas: globalThis.Array.isArray(object?.bindingDeltas)
+ ? object.bindingDeltas.map((e: any) => BindingDelta.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: PolicyDelta): unknown {
const obj: any = {};
if (message.bindingDeltas?.length) {
@@ -599,6 +635,17 @@ export const BindingDelta: MessageFns<BindingDelta> = {
return message;
},
+ fromJSON(object: any): BindingDelta {
+ return {
+ action: isSet(object.action)
+ ? bindingDelta_ActionFromJSON(object.action)
+ : BindingDelta_Action.ACTION_UNSPECIFIED,
+ role: isSet(object.role) ? globalThis.String(object.role) : "",
+ member: isSet(object.member) ? globalThis.String(object.member) : "",
+ condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
+ };
+ },
+
toJSON(message: BindingDelta): unknown {
const obj: any = {};
if (message.action !== BindingDelta_Action.ACTION_UNSPECIFIED) {
@@ -639,9 +686,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/idp_service.ts b/frontend/src/types/proto/v1/idp_service.ts
index 7785746938..90dcdd231b 100644
--- a/frontend/src/types/proto/v1/idp_service.ts
+++ b/frontend/src/types/proto/v1/idp_service.ts
@@ -365,6 +365,10 @@ export const GetIdentityProviderRequest: MessageFns<GetIdentityProviderRequest>
return message;
},
+ fromJSON(object: any): GetIdentityProviderRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetIdentityProviderRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -430,6 +434,13 @@ export const ListIdentityProvidersRequest: MessageFns<ListIdentityProvidersReque
return message;
},
+ fromJSON(object: any): ListIdentityProvidersRequest {
+ return {
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: ListIdentityProvidersRequest): unknown {
const obj: any = {};
if (message.pageSize !== 0) {
@@ -499,6 +510,15 @@ export const ListIdentityProvidersResponse: MessageFns<ListIdentityProvidersResp
return message;
},
+ fromJSON(object: any): ListIdentityProvidersResponse {
+ return {
+ identityProviders: globalThis.Array.isArray(object?.identityProviders)
+ ? object.identityProviders.map((e: any) => IdentityProvider.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListIdentityProvidersResponse): unknown {
const obj: any = {};
if (message.identityProviders?.length) {
@@ -579,6 +599,14 @@ export const CreateIdentityProviderRequest: MessageFns<CreateIdentityProviderReq
return message;
},
+ fromJSON(object: any): CreateIdentityProviderRequest {
+ return {
+ identityProvider: isSet(object.identityProvider) ? IdentityProvider.fromJSON(object.identityProvider) : undefined,
+ identityProviderId: isSet(object.identityProviderId) ? globalThis.String(object.identityProviderId) : "",
+ validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
+ };
+ },
+
toJSON(message: CreateIdentityProviderRequest): unknown {
const obj: any = {};
if (message.identityProvider !== undefined) {
@@ -654,6 +682,13 @@ export const UpdateIdentityProviderRequest: MessageFns<UpdateIdentityProviderReq
return message;
},
+ fromJSON(object: any): UpdateIdentityProviderRequest {
+ return {
+ identityProvider: isSet(object.identityProvider) ? IdentityProvider.fromJSON(object.identityProvider) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateIdentityProviderRequest): unknown {
const obj: any = {};
if (message.identityProvider !== undefined) {
@@ -714,6 +749,10 @@ export const DeleteIdentityProviderRequest: MessageFns<DeleteIdentityProviderReq
return message;
},
+ fromJSON(object: any): DeleteIdentityProviderRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DeleteIdentityProviderRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -779,6 +818,15 @@ export const TestIdentityProviderRequest: MessageFns<TestIdentityProviderRequest
return message;
},
+ fromJSON(object: any): TestIdentityProviderRequest {
+ return {
+ identityProvider: isSet(object.identityProvider) ? IdentityProvider.fromJSON(object.identityProvider) : undefined,
+ oauth2Context: isSet(object.oauth2Context)
+ ? OAuth2IdentityProviderTestRequestContext.fromJSON(object.oauth2Context)
+ : undefined,
+ };
+ },
+
toJSON(message: TestIdentityProviderRequest): unknown {
const obj: any = {};
if (message.identityProvider !== undefined) {
@@ -841,6 +889,10 @@ export const OAuth2IdentityProviderTestRequestContext: MessageFns<OAuth2Identity
return message;
},
+ fromJSON(object: any): OAuth2IdentityProviderTestRequestContext {
+ return { code: isSet(object.code) ? globalThis.String(object.code) : "" };
+ },
+
toJSON(message: OAuth2IdentityProviderTestRequestContext): unknown {
const obj: any = {};
if (message.code !== "") {
@@ -884,6 +936,10 @@ export const TestIdentityProviderResponse: MessageFns<TestIdentityProviderRespon
return message;
},
+ fromJSON(_: any): TestIdentityProviderResponse {
+ return {};
+ },
+
toJSON(_: TestIdentityProviderResponse): unknown {
const obj: any = {};
return obj;
@@ -984,6 +1040,18 @@ export const IdentityProvider: MessageFns<IdentityProvider> = {
return message;
},
+ fromJSON(object: any): IdentityProvider {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
+ type: isSet(object.type)
+ ? identityProviderTypeFromJSON(object.type)
+ : IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED,
+ config: isSet(object.config) ? IdentityProviderConfig.fromJSON(object.config) : undefined,
+ };
+ },
+
toJSON(message: IdentityProvider): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1078,6 +1146,14 @@ export const IdentityProviderConfig: MessageFns<IdentityProviderConfig> = {
return message;
},
+ fromJSON(object: any): IdentityProviderConfig {
+ return {
+ oauth2Config: isSet(object.oauth2Config) ? OAuth2IdentityProviderConfig.fromJSON(object.oauth2Config) : undefined,
+ oidcConfig: isSet(object.oidcConfig) ? OIDCIdentityProviderConfig.fromJSON(object.oidcConfig) : undefined,
+ ldapConfig: isSet(object.ldapConfig) ? LDAPIdentityProviderConfig.fromJSON(object.ldapConfig) : undefined,
+ };
+ },
+
toJSON(message: IdentityProviderConfig): unknown {
const obj: any = {};
if (message.oauth2Config !== undefined) {
@@ -1244,6 +1320,22 @@ export const OAuth2IdentityProviderConfig: MessageFns<OAuth2IdentityProviderConf
return message;
},
+ fromJSON(object: any): OAuth2IdentityProviderConfig {
+ return {
+ authUrl: isSet(object.authUrl) ? globalThis.String(object.authUrl) : "",
+ tokenUrl: isSet(object.tokenUrl) ? globalThis.String(object.tokenUrl) : "",
+ userInfoUrl: isSet(object.userInfoUrl) ? globalThis.String(object.userInfoUrl) : "",
+ clientId: isSet(object.clientId) ? globalThis.String(object.clientId) : "",
+ clientSecret: isSet(object.clientSecret) ? globalThis.String(object.clientSecret) : "",
+ scopes: globalThis.Array.isArray(object?.scopes) ? object.scopes.map((e: any) => globalThis.String(e)) : [],
+ fieldMapping: isSet(object.fieldMapping) ? FieldMapping.fromJSON(object.fieldMapping) : undefined,
+ skipTlsVerify: isSet(object.skipTlsVerify) ? globalThis.Boolean(object.skipTlsVerify) : false,
+ authStyle: isSet(object.authStyle)
+ ? oAuth2AuthStyleFromJSON(object.authStyle)
+ : OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
+ };
+ },
+
toJSON(message: OAuth2IdentityProviderConfig): unknown {
const obj: any = {};
if (message.authUrl !== "") {
@@ -1418,6 +1510,21 @@ export const OIDCIdentityProviderConfig: MessageFns<OIDCIdentityProviderConfig>
return message;
},
+ fromJSON(object: any): OIDCIdentityProviderConfig {
+ return {
+ issuer: isSet(object.issuer) ? globalThis.String(object.issuer) : "",
+ clientId: isSet(object.clientId) ? globalThis.String(object.clientId) : "",
+ clientSecret: isSet(object.clientSecret) ? globalThis.String(object.clientSecret) : "",
+ scopes: globalThis.Array.isArray(object?.scopes) ? object.scopes.map((e: any) => globalThis.String(e)) : [],
+ fieldMapping: isSet(object.fieldMapping) ? FieldMapping.fromJSON(object.fieldMapping) : undefined,
+ skipTlsVerify: isSet(object.skipTlsVerify) ? globalThis.Boolean(object.skipTlsVerify) : false,
+ authStyle: isSet(object.authStyle)
+ ? oAuth2AuthStyleFromJSON(object.authStyle)
+ : OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
+ authEndpoint: isSet(object.authEndpoint) ? globalThis.String(object.authEndpoint) : "",
+ };
+ },
+
toJSON(message: OIDCIdentityProviderConfig): unknown {
const obj: any = {};
if (message.issuer !== "") {
@@ -1600,6 +1707,20 @@ export const LDAPIdentityProviderConfig: MessageFns<LDAPIdentityProviderConfig>
return message;
},
+ fromJSON(object: any): LDAPIdentityProviderConfig {
+ return {
+ host: isSet(object.host) ? globalThis.String(object.host) : "",
+ port: isSet(object.port) ? globalThis.Number(object.port) : 0,
+ skipTlsVerify: isSet(object.skipTlsVerify) ? globalThis.Boolean(object.skipTlsVerify) : false,
+ bindDn: isSet(object.bindDn) ? globalThis.String(object.bindDn) : "",
+ bindPassword: isSet(object.bindPassword) ? globalThis.String(object.bindPassword) : "",
+ baseDn: isSet(object.baseDn) ? globalThis.String(object.baseDn) : "",
+ userFilter: isSet(object.userFilter) ? globalThis.String(object.userFilter) : "",
+ securityProtocol: isSet(object.securityProtocol) ? globalThis.String(object.securityProtocol) : "",
+ fieldMapping: isSet(object.fieldMapping) ? FieldMapping.fromJSON(object.fieldMapping) : undefined,
+ };
+ },
+
toJSON(message: LDAPIdentityProviderConfig): unknown {
const obj: any = {};
if (message.host !== "") {
@@ -1721,6 +1842,15 @@ export const FieldMapping: MessageFns<FieldMapping> = {
return message;
},
+ fromJSON(object: any): FieldMapping {
+ return {
+ identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "",
+ displayName: isSet(object.displayName) ? globalThis.String(object.displayName) : "",
+ phone: isSet(object.phone) ? globalThis.String(object.phone) : "",
+ groups: isSet(object.groups) ? globalThis.String(object.groups) : "",
+ };
+ },
+
toJSON(message: FieldMapping): unknown {
const obj: any = {};
if (message.identifier !== "") {
@@ -2164,9 +2294,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/instance_role_service.ts b/frontend/src/types/proto/v1/instance_role_service.ts
index 4bf4cc77f7..48a4141e3a 100644
--- a/frontend/src/types/proto/v1/instance_role_service.ts
+++ b/frontend/src/types/proto/v1/instance_role_service.ts
@@ -122,6 +122,10 @@ export const GetInstanceRoleRequest: MessageFns<GetInstanceRoleRequest> = {
return message;
},
+ fromJSON(object: any): GetInstanceRoleRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetInstanceRoleRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -209,6 +213,15 @@ export const ListInstanceRolesRequest: MessageFns<ListInstanceRolesRequest> = {
return message;
},
+ fromJSON(object: any): ListInstanceRolesRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ refresh: isSet(object.refresh) ? globalThis.Boolean(object.refresh) : false,
+ };
+ },
+
toJSON(message: ListInstanceRolesRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -286,6 +299,13 @@ export const ListInstanceRolesResponse: MessageFns<ListInstanceRolesResponse> =
return message;
},
+ fromJSON(object: any): ListInstanceRolesResponse {
+ return {
+ roles: globalThis.Array.isArray(object?.roles) ? object.roles.map((e: any) => InstanceRole.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListInstanceRolesResponse): unknown {
const obj: any = {};
if (message.roles?.length) {
@@ -406,6 +426,17 @@ export const InstanceRole: MessageFns<InstanceRole> = {
return message;
},
+ fromJSON(object: any): InstanceRole {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ roleName: isSet(object.roleName) ? globalThis.String(object.roleName) : "",
+ password: isSet(object.password) ? globalThis.String(object.password) : undefined,
+ connectionLimit: isSet(object.connectionLimit) ? globalThis.Number(object.connectionLimit) : undefined,
+ validUntil: isSet(object.validUntil) ? globalThis.String(object.validUntil) : undefined,
+ attribute: isSet(object.attribute) ? globalThis.String(object.attribute) : undefined,
+ };
+ },
+
toJSON(message: InstanceRole): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -610,9 +641,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/instance_service.ts b/frontend/src/types/proto/v1/instance_service.ts
index 2d3313881e..50a35e7e18 100644
--- a/frontend/src/types/proto/v1/instance_service.ts
+++ b/frontend/src/types/proto/v1/instance_service.ts
@@ -830,6 +830,10 @@ export const GetInstanceRequest: MessageFns<GetInstanceRequest> = {
return message;
},
+ fromJSON(object: any): GetInstanceRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetInstanceRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -917,6 +921,15 @@ export const ListInstancesRequest: MessageFns<ListInstancesRequest> = {
return message;
},
+ fromJSON(object: any): ListInstancesRequest {
+ return {
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ };
+ },
+
toJSON(message: ListInstancesRequest): unknown {
const obj: any = {};
if (message.pageSize !== 0) {
@@ -994,6 +1007,15 @@ export const ListInstancesResponse: MessageFns<ListInstancesResponse> = {
return message;
},
+ fromJSON(object: any): ListInstancesResponse {
+ return {
+ instances: globalThis.Array.isArray(object?.instances)
+ ? object.instances.map((e: any) => Instance.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListInstancesResponse): unknown {
const obj: any = {};
if (message.instances?.length) {
@@ -1074,6 +1096,14 @@ export const CreateInstanceRequest: MessageFns<CreateInstanceRequest> = {
return message;
},
+ fromJSON(object: any): CreateInstanceRequest {
+ return {
+ instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined,
+ instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
+ validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
+ };
+ },
+
toJSON(message: CreateInstanceRequest): unknown {
const obj: any = {};
if (message.instance !== undefined) {
@@ -1149,6 +1179,13 @@ export const UpdateInstanceRequest: MessageFns<UpdateInstanceRequest> = {
return message;
},
+ fromJSON(object: any): UpdateInstanceRequest {
+ return {
+ instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateInstanceRequest): unknown {
const obj: any = {};
if (message.instance !== undefined) {
@@ -1220,6 +1257,13 @@ export const DeleteInstanceRequest: MessageFns<DeleteInstanceRequest> = {
return message;
},
+ fromJSON(object: any): DeleteInstanceRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ force: isSet(object.force) ? globalThis.Boolean(object.force) : false,
+ };
+ },
+
toJSON(message: DeleteInstanceRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1278,6 +1322,10 @@ export const UndeleteInstanceRequest: MessageFns<UndeleteInstanceRequest> = {
return message;
},
+ fromJSON(object: any): UndeleteInstanceRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: UndeleteInstanceRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1343,6 +1391,13 @@ export const SyncInstanceRequest: MessageFns<SyncInstanceRequest> = {
return message;
},
+ fromJSON(object: any): SyncInstanceRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ enableFullSync: isSet(object.enableFullSync) ? globalThis.Boolean(object.enableFullSync) : false,
+ };
+ },
+
toJSON(message: SyncInstanceRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1412,6 +1467,13 @@ export const ListInstanceDatabaseRequest: MessageFns<ListInstanceDatabaseRequest
return message;
},
+ fromJSON(object: any): ListInstanceDatabaseRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined,
+ };
+ },
+
toJSON(message: ListInstanceDatabaseRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1472,6 +1534,14 @@ export const ListInstanceDatabaseResponse: MessageFns<ListInstanceDatabaseRespon
return message;
},
+ fromJSON(object: any): ListInstanceDatabaseResponse {
+ return {
+ databases: globalThis.Array.isArray(object?.databases)
+ ? object.databases.map((e: any) => globalThis.String(e))
+ : [],
+ };
+ },
+
toJSON(message: ListInstanceDatabaseResponse): unknown {
const obj: any = {};
if (message.databases?.length) {
@@ -1526,6 +1596,14 @@ export const SyncInstanceResponse: MessageFns<SyncInstanceResponse> = {
return message;
},
+ fromJSON(object: any): SyncInstanceResponse {
+ return {
+ databases: globalThis.Array.isArray(object?.databases)
+ ? object.databases.map((e: any) => globalThis.String(e))
+ : [],
+ };
+ },
+
toJSON(message: SyncInstanceResponse): unknown {
const obj: any = {};
if (message.databases?.length) {
@@ -1580,6 +1658,14 @@ export const BatchSyncInstancesRequest: MessageFns<BatchSyncInstancesRequest> =
return message;
},
+ fromJSON(object: any): BatchSyncInstancesRequest {
+ return {
+ requests: globalThis.Array.isArray(object?.requests)
+ ? object.requests.map((e: any) => SyncInstanceRequest.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchSyncInstancesRequest): unknown {
const obj: any = {};
if (message.requests?.length) {
@@ -1623,6 +1709,10 @@ export const BatchSyncInstancesResponse: MessageFns<BatchSyncInstancesResponse>
return message;
},
+ fromJSON(_: any): BatchSyncInstancesResponse {
+ return {};
+ },
+
toJSON(_: BatchSyncInstancesResponse): unknown {
const obj: any = {};
return obj;
@@ -1673,6 +1763,14 @@ export const BatchUpdateInstancesRequest: MessageFns<BatchUpdateInstancesRequest
return message;
},
+ fromJSON(object: any): BatchUpdateInstancesRequest {
+ return {
+ requests: globalThis.Array.isArray(object?.requests)
+ ? object.requests.map((e: any) => UpdateInstanceRequest.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchUpdateInstancesRequest): unknown {
const obj: any = {};
if (message.requests?.length) {
@@ -1727,6 +1825,14 @@ export const BatchUpdateInstancesResponse: MessageFns<BatchUpdateInstancesRespon
return message;
},
+ fromJSON(object: any): BatchUpdateInstancesResponse {
+ return {
+ instances: globalThis.Array.isArray(object?.instances)
+ ? object.instances.map((e: any) => Instance.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchUpdateInstancesResponse): unknown {
const obj: any = {};
if (message.instances?.length) {
@@ -1803,6 +1909,14 @@ export const AddDataSourceRequest: MessageFns<AddDataSourceRequest> = {
return message;
},
+ fromJSON(object: any): AddDataSourceRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ dataSource: isSet(object.dataSource) ? DataSource.fromJSON(object.dataSource) : undefined,
+ validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
+ };
+ },
+
toJSON(message: AddDataSourceRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1878,6 +1992,13 @@ export const RemoveDataSourceRequest: MessageFns<RemoveDataSourceRequest> = {
return message;
},
+ fromJSON(object: any): RemoveDataSourceRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ dataSource: isSet(object.dataSource) ? DataSource.fromJSON(object.dataSource) : undefined,
+ };
+ },
+
toJSON(message: RemoveDataSourceRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1971,6 +2092,15 @@ export const UpdateDataSourceRequest: MessageFns<UpdateDataSourceRequest> = {
return message;
},
+ fromJSON(object: any): UpdateDataSourceRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ dataSource: isSet(object.dataSource) ? DataSource.fromJSON(object.dataSource) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
+ };
+ },
+
toJSON(message: UpdateDataSourceRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2185,6 +2315,28 @@ export const Instance: MessageFns<Instance> = {
return message;
},
+ fromJSON(object: any): Instance {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
+ engineVersion: isSet(object.engineVersion) ? globalThis.String(object.engineVersion) : "",
+ externalLink: isSet(object.externalLink) ? globalThis.String(object.externalLink) : "",
+ dataSources: globalThis.Array.isArray(object?.dataSources)
+ ? object.dataSources.map((e: any) => DataSource.fromJSON(e))
+ : [],
+ environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
+ activation: isSet(object.activation) ? globalThis.Boolean(object.activation) : false,
+ roles: globalThis.Array.isArray(object?.roles) ? object.roles.map((e: any) => InstanceRole.fromJSON(e)) : [],
+ syncInterval: isSet(object.syncInterval) ? Duration.fromJSON(object.syncInterval) : undefined,
+ maximumConnections: isSet(object.maximumConnections) ? globalThis.Number(object.maximumConnections) : 0,
+ syncDatabases: globalThis.Array.isArray(object?.syncDatabases)
+ ? object.syncDatabases.map((e: any) => globalThis.String(e))
+ : [],
+ };
+ },
+
toJSON(message: Instance): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2375,6 +2527,23 @@ export const DataSourceExternalSecret: MessageFns<DataSourceExternalSecret> = {
return message;
},
+ fromJSON(object: any): DataSourceExternalSecret {
+ return {
+ secretType: isSet(object.secretType)
+ ? dataSourceExternalSecret_SecretTypeFromJSON(object.secretType)
+ : DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED,
+ url: isSet(object.url) ? globalThis.String(object.url) : "",
+ authType: isSet(object.authType)
+ ? dataSourceExternalSecret_AuthTypeFromJSON(object.authType)
+ : DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED,
+ appRole: isSet(object.appRole) ? DataSourceExternalSecret_AppRoleAuthOption.fromJSON(object.appRole) : undefined,
+ token: isSet(object.token) ? globalThis.String(object.token) : undefined,
+ engineName: isSet(object.engineName) ? globalThis.String(object.engineName) : "",
+ secretName: isSet(object.secretName) ? globalThis.String(object.secretName) : "",
+ passwordKeyName: isSet(object.passwordKeyName) ? globalThis.String(object.passwordKeyName) : "",
+ };
+ },
+
toJSON(message: DataSourceExternalSecret): unknown {
const obj: any = {};
if (message.secretType !== DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED) {
@@ -2497,6 +2666,17 @@ export const DataSourceExternalSecret_AppRoleAuthOption: MessageFns<DataSourceEx
return message;
},
+ fromJSON(object: any): DataSourceExternalSecret_AppRoleAuthOption {
+ return {
+ roleId: isSet(object.roleId) ? globalThis.String(object.roleId) : "",
+ secretId: isSet(object.secretId) ? globalThis.String(object.secretId) : "",
+ type: isSet(object.type)
+ ? dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(object.type)
+ : DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED,
+ mountPath: isSet(object.mountPath) ? globalThis.String(object.mountPath) : "",
+ };
+ },
+
toJSON(message: DataSourceExternalSecret_AppRoleAuthOption): unknown {
const obj: any = {};
if (message.roleId !== "") {
@@ -2990,6 +3170,66 @@ export const DataSource: MessageFns<DataSource> = {
return message;
},
+ fromJSON(object: any): DataSource {
+ return {
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ type: isSet(object.type) ? dataSourceTypeFromJSON(object.type) : DataSourceType.DATA_SOURCE_UNSPECIFIED,
+ username: isSet(object.username) ? globalThis.String(object.username) : "",
+ password: isSet(object.password) ? globalThis.String(object.password) : "",
+ useSsl: isSet(object.useSsl) ? globalThis.Boolean(object.useSsl) : false,
+ sslCa: isSet(object.sslCa) ? globalThis.String(object.sslCa) : "",
+ sslCert: isSet(object.sslCert) ? globalThis.String(object.sslCert) : "",
+ sslKey: isSet(object.sslKey) ? globalThis.String(object.sslKey) : "",
+ host: isSet(object.host) ? globalThis.String(object.host) : "",
+ port: isSet(object.port) ? globalThis.String(object.port) : "",
+ database: isSet(object.database) ? globalThis.String(object.database) : "",
+ srv: isSet(object.srv) ? globalThis.Boolean(object.srv) : false,
+ authenticationDatabase: isSet(object.authenticationDatabase)
+ ? globalThis.String(object.authenticationDatabase)
+ : "",
+ replicaSet: isSet(object.replicaSet) ? globalThis.String(object.replicaSet) : "",
+ sid: isSet(object.sid) ? globalThis.String(object.sid) : "",
+ serviceName: isSet(object.serviceName) ? globalThis.String(object.serviceName) : "",
+ sshHost: isSet(object.sshHost) ? globalThis.String(object.sshHost) : "",
+ sshPort: isSet(object.sshPort) ? globalThis.String(object.sshPort) : "",
+ sshUser: isSet(object.sshUser) ? globalThis.String(object.sshUser) : "",
+ sshPassword: isSet(object.sshPassword) ? globalThis.String(object.sshPassword) : "",
+ sshPrivateKey: isSet(object.sshPrivateKey) ? globalThis.String(object.sshPrivateKey) : "",
+ authenticationPrivateKey: isSet(object.authenticationPrivateKey)
+ ? globalThis.String(object.authenticationPrivateKey)
+ : "",
+ externalSecret: isSet(object.externalSecret)
+ ? DataSourceExternalSecret.fromJSON(object.externalSecret)
+ : undefined,
+ authenticationType: isSet(object.authenticationType)
+ ? dataSource_AuthenticationTypeFromJSON(object.authenticationType)
+ : DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED,
+ clientSecretCredential: isSet(object.clientSecretCredential)
+ ? DataSource_ClientSecretCredential.fromJSON(object.clientSecretCredential)
+ : undefined,
+ saslConfig: isSet(object.saslConfig) ? SASLConfig.fromJSON(object.saslConfig) : undefined,
+ additionalAddresses: globalThis.Array.isArray(object?.additionalAddresses)
+ ? object.additionalAddresses.map((e: any) => DataSource_Address.fromJSON(e))
+ : [],
+ directConnection: isSet(object.directConnection) ? globalThis.Boolean(object.directConnection) : false,
+ region: isSet(object.region) ? globalThis.String(object.region) : "",
+ warehouseId: isSet(object.warehouseId) ? globalThis.String(object.warehouseId) : "",
+ masterName: isSet(object.masterName) ? globalThis.String(object.masterName) : "",
+ masterUsername: isSet(object.masterUsername) ? globalThis.String(object.masterUsername) : "",
+ masterPassword: isSet(object.masterPassword) ? globalThis.String(object.masterPassword) : "",
+ redisType: isSet(object.redisType)
+ ? dataSource_RedisTypeFromJSON(object.redisType)
+ : DataSource_RedisType.REDIS_TYPE_UNSPECIFIED,
+ cluster: isSet(object.cluster) ? globalThis.String(object.cluster) : "",
+ extraConnectionParameters: isObject(object.extraConnectionParameters)
+ ? Object.entries(object.extraConnectionParameters).reduce<{ [key: string]: string }>((acc, [key, value]) => {
+ acc[key] = String(value);
+ return acc;
+ }, {})
+ : {},
+ };
+ },
+
toJSON(message: DataSource): unknown {
const obj: any = {};
if (message.id !== "") {
@@ -3226,6 +3466,14 @@ export const DataSource_ClientSecretCredential: MessageFns<DataSource_ClientSecr
return message;
},
+ fromJSON(object: any): DataSource_ClientSecretCredential {
+ return {
+ tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "",
+ clientId: isSet(object.clientId) ? globalThis.String(object.clientId) : "",
+ clientSecret: isSet(object.clientSecret) ? globalThis.String(object.clientSecret) : "",
+ };
+ },
+
toJSON(message: DataSource_ClientSecretCredential): unknown {
const obj: any = {};
if (message.tenantId !== "") {
@@ -3299,6 +3547,13 @@ export const DataSource_Address: MessageFns<DataSource_Address> = {
return message;
},
+ fromJSON(object: any): DataSource_Address {
+ return {
+ host: isSet(object.host) ? globalThis.String(object.host) : "",
+ port: isSet(object.port) ? globalThis.String(object.port) : "",
+ };
+ },
+
toJSON(message: DataSource_Address): unknown {
const obj: any = {};
if (message.host !== "") {
@@ -3368,6 +3623,13 @@ export const DataSource_ExtraConnectionParametersEntry: MessageFns<DataSource_Ex
return message;
},
+ fromJSON(object: any): DataSource_ExtraConnectionParametersEntry {
+ return {
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
+ };
+ },
+
toJSON(message: DataSource_ExtraConnectionParametersEntry): unknown {
const obj: any = {};
if (message.key !== "") {
@@ -3502,6 +3764,20 @@ export const InstanceResource: MessageFns<InstanceResource> = {
return message;
},
+ fromJSON(object: any): InstanceResource {
+ return {
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
+ engineVersion: isSet(object.engineVersion) ? globalThis.String(object.engineVersion) : "",
+ dataSources: globalThis.Array.isArray(object?.dataSources)
+ ? object.dataSources.map((e: any) => DataSource.fromJSON(e))
+ : [],
+ activation: isSet(object.activation) ? globalThis.Boolean(object.activation) : false,
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
+ };
+ },
+
toJSON(message: InstanceResource): unknown {
const obj: any = {};
if (message.title !== "") {
@@ -3580,6 +3856,10 @@ export const SASLConfig: MessageFns<SASLConfig> = {
return message;
},
+ fromJSON(object: any): SASLConfig {
+ return { krbConfig: isSet(object.krbConfig) ? KerberosConfig.fromJSON(object.krbConfig) : undefined };
+ },
+
toJSON(message: SASLConfig): unknown {
const obj: any = {};
if (message.krbConfig !== undefined) {
@@ -3710,6 +3990,18 @@ export const KerberosConfig: MessageFns<KerberosConfig> = {
return message;
},
+ fromJSON(object: any): KerberosConfig {
+ return {
+ primary: isSet(object.primary) ? globalThis.String(object.primary) : "",
+ instance: isSet(object.instance) ? globalThis.String(object.instance) : "",
+ realm: isSet(object.realm) ? globalThis.String(object.realm) : "",
+ keytab: isSet(object.keytab) ? bytesFromBase64(object.keytab) : new Uint8Array(0),
+ kdcHost: isSet(object.kdcHost) ? globalThis.String(object.kdcHost) : "",
+ kdcPort: isSet(object.kdcPort) ? globalThis.String(object.kdcPort) : "",
+ kdcTransportProtocol: isSet(object.kdcTransportProtocol) ? globalThis.String(object.kdcTransportProtocol) : "",
+ };
+ },
+
toJSON(message: KerberosConfig): unknown {
const obj: any = {};
if (message.primary !== "") {
@@ -4600,6 +4892,15 @@ export const InstanceServiceDefinition = {
},
} as const;
+function bytesFromBase64(b64: string): Uint8Array {
+ 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 {
const bin: string[] = [];
arr.forEach((byte) => {
@@ -4616,9 +4917,18 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isObject(value: any): boolean {
+ return typeof value === "object" && value !== null;
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/issue_service.ts b/frontend/src/types/proto/v1/issue_service.ts
index 407a4985cf..2439494651 100644
--- a/frontend/src/types/proto/v1/issue_service.ts
+++ b/frontend/src/types/proto/v1/issue_service.ts
@@ -973,6 +973,13 @@ export const GetIssueRequest: MessageFns<GetIssueRequest> = {
return message;
},
+ fromJSON(object: any): GetIssueRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ force: isSet(object.force) ? globalThis.Boolean(object.force) : false,
+ };
+ },
+
toJSON(message: GetIssueRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1042,6 +1049,13 @@ export const CreateIssueRequest: MessageFns<CreateIssueRequest> = {
return message;
},
+ fromJSON(object: any): CreateIssueRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ issue: isSet(object.issue) ? Issue.fromJSON(object.issue) : undefined,
+ };
+ },
+
toJSON(message: CreateIssueRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1144,6 +1158,16 @@ export const ListIssuesRequest: MessageFns<ListIssuesRequest> = {
return message;
},
+ fromJSON(object: any): ListIssuesRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ query: isSet(object.query) ? globalThis.String(object.query) : "",
+ };
+ },
+
toJSON(message: ListIssuesRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1225,6 +1249,13 @@ export const ListIssuesResponse: MessageFns<ListIssuesResponse> = {
return message;
},
+ fromJSON(object: any): ListIssuesResponse {
+ return {
+ issues: globalThis.Array.isArray(object?.issues) ? object.issues.map((e: any) => Issue.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListIssuesResponse): unknown {
const obj: any = {};
if (message.issues?.length) {
@@ -1327,6 +1358,16 @@ export const SearchIssuesRequest: MessageFns<SearchIssuesRequest> = {
return message;
},
+ fromJSON(object: any): SearchIssuesRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ query: isSet(object.query) ? globalThis.String(object.query) : "",
+ };
+ },
+
toJSON(message: SearchIssuesRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1408,6 +1449,13 @@ export const SearchIssuesResponse: MessageFns<SearchIssuesResponse> = {
return message;
},
+ fromJSON(object: any): SearchIssuesResponse {
+ return {
+ issues: globalThis.Array.isArray(object?.issues) ? object.issues.map((e: any) => Issue.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: SearchIssuesResponse): unknown {
const obj: any = {};
if (message.issues?.length) {
@@ -1477,6 +1525,13 @@ export const UpdateIssueRequest: MessageFns<UpdateIssueRequest> = {
return message;
},
+ fromJSON(object: any): UpdateIssueRequest {
+ return {
+ issue: isSet(object.issue) ? Issue.fromJSON(object.issue) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateIssueRequest): unknown {
const obj: any = {};
if (message.issue !== undefined) {
@@ -1568,6 +1623,15 @@ export const BatchUpdateIssuesStatusRequest: MessageFns<BatchUpdateIssuesStatusR
return message;
},
+ fromJSON(object: any): BatchUpdateIssuesStatusRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ issues: globalThis.Array.isArray(object?.issues) ? object.issues.map((e: any) => globalThis.String(e)) : [],
+ status: isSet(object.status) ? issueStatusFromJSON(object.status) : IssueStatus.ISSUE_STATUS_UNSPECIFIED,
+ reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
+ };
+ },
+
toJSON(message: BatchUpdateIssuesStatusRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1623,6 +1687,10 @@ export const BatchUpdateIssuesStatusResponse: MessageFns<BatchUpdateIssuesStatus
return message;
},
+ fromJSON(_: any): BatchUpdateIssuesStatusResponse {
+ return {};
+ },
+
toJSON(_: BatchUpdateIssuesStatusResponse): unknown {
const obj: any = {};
return obj;
@@ -1684,6 +1752,13 @@ export const ApproveIssueRequest: MessageFns<ApproveIssueRequest> = {
return message;
},
+ fromJSON(object: any): ApproveIssueRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ };
+ },
+
toJSON(message: ApproveIssueRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1753,6 +1828,13 @@ export const RejectIssueRequest: MessageFns<RejectIssueRequest> = {
return message;
},
+ fromJSON(object: any): RejectIssueRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ };
+ },
+
toJSON(message: RejectIssueRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1822,6 +1904,13 @@ export const RequestIssueRequest: MessageFns<RequestIssueRequest> = {
return message;
},
+ fromJSON(object: any): RequestIssueRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ };
+ },
+
toJSON(message: RequestIssueRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2113,6 +2202,48 @@ export const Issue: MessageFns<Issue> = {
return message;
},
+ fromJSON(object: any): Issue {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
+ type: isSet(object.type) ? issue_TypeFromJSON(object.type) : Issue_Type.TYPE_UNSPECIFIED,
+ status: isSet(object.status) ? issueStatusFromJSON(object.status) : IssueStatus.ISSUE_STATUS_UNSPECIFIED,
+ approvers: globalThis.Array.isArray(object?.approvers)
+ ? object.approvers.map((e: any) => Issue_Approver.fromJSON(e))
+ : [],
+ approvalTemplates: globalThis.Array.isArray(object?.approvalTemplates)
+ ? object.approvalTemplates.map((e: any) => ApprovalTemplate.fromJSON(e))
+ : [],
+ approvalFindingDone: isSet(object.approvalFindingDone) ? globalThis.Boolean(object.approvalFindingDone) : false,
+ approvalFindingError: isSet(object.approvalFindingError) ? globalThis.String(object.approvalFindingError) : "",
+ subscribers: globalThis.Array.isArray(object?.subscribers)
+ ? object.subscribers.map((e: any) => globalThis.String(e))
+ : [],
+ creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
+ plan: isSet(object.plan) ? globalThis.String(object.plan) : "",
+ rollout: isSet(object.rollout) ? globalThis.String(object.rollout) : "",
+ grantRequest: isSet(object.grantRequest) ? GrantRequest.fromJSON(object.grantRequest) : undefined,
+ releasers: globalThis.Array.isArray(object?.releasers)
+ ? object.releasers.map((e: any) => globalThis.String(e))
+ : [],
+ riskLevel: isSet(object.riskLevel)
+ ? issue_RiskLevelFromJSON(object.riskLevel)
+ : Issue_RiskLevel.RISK_LEVEL_UNSPECIFIED,
+ taskStatusCount: isObject(object.taskStatusCount)
+ ? Object.entries(object.taskStatusCount).reduce<{ [key: string]: number }>((acc, [key, value]) => {
+ acc[key] = Number(value);
+ return acc;
+ }, {})
+ : {},
+ labels: globalThis.Array.isArray(object?.labels)
+ ? object.labels.map((e: any) => globalThis.String(e))
+ : [],
+ };
+ },
+
toJSON(message: Issue): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2274,6 +2405,15 @@ export const Issue_Approver: MessageFns<Issue_Approver> = {
return message;
},
+ fromJSON(object: any): Issue_Approver {
+ return {
+ status: isSet(object.status)
+ ? issue_Approver_StatusFromJSON(object.status)
+ : Issue_Approver_Status.STATUS_UNSPECIFIED,
+ principal: isSet(object.principal) ? globalThis.String(object.principal) : "",
+ };
+ },
+
toJSON(message: Issue_Approver): unknown {
const obj: any = {};
if (message.status !== Issue_Approver_Status.STATUS_UNSPECIFIED) {
@@ -2343,6 +2483,13 @@ export const Issue_TaskStatusCountEntry: MessageFns<Issue_TaskStatusCountEntry>
return message;
},
+ fromJSON(object: any): Issue_TaskStatusCountEntry {
+ return {
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
+ value: isSet(object.value) ? globalThis.Number(object.value) : 0,
+ };
+ },
+
toJSON(message: Issue_TaskStatusCountEntry): unknown {
const obj: any = {};
if (message.key !== "") {
@@ -2434,6 +2581,15 @@ export const GrantRequest: MessageFns<GrantRequest> = {
return message;
},
+ fromJSON(object: any): GrantRequest {
+ return {
+ role: isSet(object.role) ? globalThis.String(object.role) : "",
+ user: isSet(object.user) ? globalThis.String(object.user) : "",
+ condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
+ expiration: isSet(object.expiration) ? Duration.fromJSON(object.expiration) : undefined,
+ };
+ },
+
toJSON(message: GrantRequest): unknown {
const obj: any = {};
if (message.role !== "") {
@@ -2526,6 +2682,14 @@ export const ApprovalTemplate: MessageFns<ApprovalTemplate> = {
return message;
},
+ fromJSON(object: any): ApprovalTemplate {
+ return {
+ flow: isSet(object.flow) ? ApprovalFlow.fromJSON(object.flow) : undefined,
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
+ };
+ },
+
toJSON(message: ApprovalTemplate): unknown {
const obj: any = {};
if (message.flow !== undefined) {
@@ -2590,6 +2754,12 @@ export const ApprovalFlow: MessageFns<ApprovalFlow> = {
return message;
},
+ fromJSON(object: any): ApprovalFlow {
+ return {
+ steps: globalThis.Array.isArray(object?.steps) ? object.steps.map((e: any) => ApprovalStep.fromJSON(e)) : [],
+ };
+ },
+
toJSON(message: ApprovalFlow): unknown {
const obj: any = {};
if (message.steps?.length) {
@@ -2655,6 +2825,13 @@ export const ApprovalStep: MessageFns<ApprovalStep> = {
return message;
},
+ fromJSON(object: any): ApprovalStep {
+ return {
+ type: isSet(object.type) ? approvalStep_TypeFromJSON(object.type) : ApprovalStep_Type.TYPE_UNSPECIFIED,
+ nodes: globalThis.Array.isArray(object?.nodes) ? object.nodes.map((e: any) => ApprovalNode.fromJSON(e)) : [],
+ };
+ },
+
toJSON(message: ApprovalStep): unknown {
const obj: any = {};
if (message.type !== ApprovalStep_Type.TYPE_UNSPECIFIED) {
@@ -2724,6 +2901,13 @@ export const ApprovalNode: MessageFns<ApprovalNode> = {
return message;
},
+ fromJSON(object: any): ApprovalNode {
+ return {
+ type: isSet(object.type) ? approvalNode_TypeFromJSON(object.type) : ApprovalNode_Type.TYPE_UNSPECIFIED,
+ role: isSet(object.role) ? globalThis.String(object.role) : "",
+ };
+ },
+
toJSON(message: ApprovalNode): unknown {
const obj: any = {};
if (message.type !== ApprovalNode_Type.TYPE_UNSPECIFIED) {
@@ -2804,6 +2988,14 @@ export const ListIssueCommentsRequest: MessageFns<ListIssueCommentsRequest> = {
return message;
},
+ fromJSON(object: any): ListIssueCommentsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: ListIssueCommentsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -2877,6 +3069,15 @@ export const ListIssueCommentsResponse: MessageFns<ListIssueCommentsResponse> =
return message;
},
+ fromJSON(object: any): ListIssueCommentsResponse {
+ return {
+ issueComments: globalThis.Array.isArray(object?.issueComments)
+ ? object.issueComments.map((e: any) => IssueComment.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListIssueCommentsResponse): unknown {
const obj: any = {};
if (message.issueComments?.length) {
@@ -2946,6 +3147,13 @@ export const CreateIssueCommentRequest: MessageFns<CreateIssueCommentRequest> =
return message;
},
+ fromJSON(object: any): CreateIssueCommentRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ issueComment: isSet(object.issueComment) ? IssueComment.fromJSON(object.issueComment) : undefined,
+ };
+ },
+
toJSON(message: CreateIssueCommentRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -3028,6 +3236,14 @@ export const UpdateIssueCommentRequest: MessageFns<UpdateIssueCommentRequest> =
return message;
},
+ fromJSON(object: any): UpdateIssueCommentRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ issueComment: isSet(object.issueComment) ? IssueComment.fromJSON(object.issueComment) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateIssueCommentRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -3214,6 +3430,24 @@ export const IssueComment: MessageFns<IssueComment> = {
return message;
},
+ fromJSON(object: any): IssueComment {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ payload: isSet(object.payload) ? globalThis.String(object.payload) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
+ creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
+ approval: isSet(object.approval) ? IssueComment_Approval.fromJSON(object.approval) : undefined,
+ issueUpdate: isSet(object.issueUpdate) ? IssueComment_IssueUpdate.fromJSON(object.issueUpdate) : undefined,
+ stageEnd: isSet(object.stageEnd) ? IssueComment_StageEnd.fromJSON(object.stageEnd) : undefined,
+ taskUpdate: isSet(object.taskUpdate) ? IssueComment_TaskUpdate.fromJSON(object.taskUpdate) : undefined,
+ taskPriorBackup: isSet(object.taskPriorBackup)
+ ? IssueComment_TaskPriorBackup.fromJSON(object.taskPriorBackup)
+ : undefined,
+ };
+ },
+
toJSON(message: IssueComment): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -3322,6 +3556,14 @@ export const IssueComment_Approval: MessageFns<IssueComment_Approval> = {
return message;
},
+ fromJSON(object: any): IssueComment_Approval {
+ return {
+ status: isSet(object.status)
+ ? issueComment_Approval_StatusFromJSON(object.status)
+ : IssueComment_Approval_Status.STATUS_UNSPECIFIED,
+ };
+ },
+
toJSON(message: IssueComment_Approval): unknown {
const obj: any = {};
if (message.status !== IssueComment_Approval_Status.STATUS_UNSPECIFIED) {
@@ -3462,6 +3704,21 @@ export const IssueComment_IssueUpdate: MessageFns<IssueComment_IssueUpdate> = {
return message;
},
+ fromJSON(object: any): IssueComment_IssueUpdate {
+ return {
+ fromTitle: isSet(object.fromTitle) ? globalThis.String(object.fromTitle) : undefined,
+ toTitle: isSet(object.toTitle) ? globalThis.String(object.toTitle) : undefined,
+ fromDescription: isSet(object.fromDescription) ? globalThis.String(object.fromDescription) : undefined,
+ toDescription: isSet(object.toDescription) ? globalThis.String(object.toDescription) : undefined,
+ fromStatus: isSet(object.fromStatus) ? issueStatusFromJSON(object.fromStatus) : undefined,
+ toStatus: isSet(object.toStatus) ? issueStatusFromJSON(object.toStatus) : undefined,
+ fromLabels: globalThis.Array.isArray(object?.fromLabels)
+ ? object.fromLabels.map((e: any) => globalThis.String(e))
+ : [],
+ toLabels: globalThis.Array.isArray(object?.toLabels) ? object.toLabels.map((e: any) => globalThis.String(e)) : [],
+ };
+ },
+
toJSON(message: IssueComment_IssueUpdate): unknown {
const obj: any = {};
if (message.fromTitle !== undefined) {
@@ -3544,6 +3801,10 @@ export const IssueComment_StageEnd: MessageFns<IssueComment_StageEnd> = {
return message;
},
+ fromJSON(object: any): IssueComment_StageEnd {
+ return { stage: isSet(object.stage) ? globalThis.String(object.stage) : "" };
+ },
+
toJSON(message: IssueComment_StageEnd): unknown {
const obj: any = {};
if (message.stage !== "") {
@@ -3631,6 +3892,15 @@ export const IssueComment_TaskUpdate: MessageFns<IssueComment_TaskUpdate> = {
return message;
},
+ fromJSON(object: any): IssueComment_TaskUpdate {
+ return {
+ tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => globalThis.String(e)) : [],
+ fromSheet: isSet(object.fromSheet) ? globalThis.String(object.fromSheet) : undefined,
+ toSheet: isSet(object.toSheet) ? globalThis.String(object.toSheet) : undefined,
+ toStatus: isSet(object.toStatus) ? issueComment_TaskUpdate_StatusFromJSON(object.toStatus) : undefined,
+ };
+ },
+
toJSON(message: IssueComment_TaskUpdate): unknown {
const obj: any = {};
if (message.tasks?.length) {
@@ -3741,6 +4011,18 @@ export const IssueComment_TaskPriorBackup: MessageFns<IssueComment_TaskPriorBack
return message;
},
+ fromJSON(object: any): IssueComment_TaskPriorBackup {
+ return {
+ task: isSet(object.task) ? globalThis.String(object.task) : "",
+ tables: globalThis.Array.isArray(object?.tables)
+ ? object.tables.map((e: any) => IssueComment_TaskPriorBackup_Table.fromJSON(e))
+ : [],
+ originalLine: isSet(object.originalLine) ? globalThis.Number(object.originalLine) : undefined,
+ database: isSet(object.database) ? globalThis.String(object.database) : "",
+ error: isSet(object.error) ? globalThis.String(object.error) : "",
+ };
+ },
+
toJSON(message: IssueComment_TaskPriorBackup): unknown {
const obj: any = {};
if (message.task !== "") {
@@ -3822,6 +4104,13 @@ export const IssueComment_TaskPriorBackup_Table: MessageFns<IssueComment_TaskPri
return message;
},
+ fromJSON(object: any): IssueComment_TaskPriorBackup_Table {
+ return {
+ schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
+ table: isSet(object.table) ? globalThis.String(object.table) : "",
+ };
+ },
+
toJSON(message: IssueComment_TaskPriorBackup_Table): unknown {
const obj: any = {};
if (message.schema !== "") {
@@ -4773,15 +5062,44 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isObject(value: any): boolean {
+ return typeof value === "object" && value !== null;
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/org_policy_service.ts b/frontend/src/types/proto/v1/org_policy_service.ts
index 68c34a853c..f75f2ccf8c 100644
--- a/frontend/src/types/proto/v1/org_policy_service.ts
+++ b/frontend/src/types/proto/v1/org_policy_service.ts
@@ -675,6 +675,14 @@ export const CreatePolicyRequest: MessageFns<CreatePolicyRequest> = {
return message;
},
+ fromJSON(object: any): CreatePolicyRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ policy: isSet(object.policy) ? Policy.fromJSON(object.policy) : undefined,
+ type: isSet(object.type) ? policyTypeFromJSON(object.type) : PolicyType.POLICY_TYPE_UNSPECIFIED,
+ };
+ },
+
toJSON(message: CreatePolicyRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -761,6 +769,14 @@ export const UpdatePolicyRequest: MessageFns<UpdatePolicyRequest> = {
return message;
},
+ fromJSON(object: any): UpdatePolicyRequest {
+ return {
+ policy: isSet(object.policy) ? Policy.fromJSON(object.policy) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ allowMissing: isSet(object.allowMissing) ? globalThis.Boolean(object.allowMissing) : false,
+ };
+ },
+
toJSON(message: UpdatePolicyRequest): unknown {
const obj: any = {};
if (message.policy !== undefined) {
@@ -825,6 +841,10 @@ export const DeletePolicyRequest: MessageFns<DeletePolicyRequest> = {
return message;
},
+ fromJSON(object: any): DeletePolicyRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DeletePolicyRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -879,6 +899,10 @@ export const GetPolicyRequest: MessageFns<GetPolicyRequest> = {
return message;
},
+ fromJSON(object: any): GetPolicyRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetPolicyRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -977,6 +1001,16 @@ export const ListPoliciesRequest: MessageFns<ListPoliciesRequest> = {
return message;
},
+ fromJSON(object: any): ListPoliciesRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ policyType: isSet(object.policyType) ? policyTypeFromJSON(object.policyType) : undefined,
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
+ };
+ },
+
toJSON(message: ListPoliciesRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1058,6 +1092,13 @@ export const ListPoliciesResponse: MessageFns<ListPoliciesResponse> = {
return message;
},
+ fromJSON(object: any): ListPoliciesResponse {
+ return {
+ policies: globalThis.Array.isArray(object?.policies) ? object.policies.map((e: any) => Policy.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListPoliciesResponse): unknown {
const obj: any = {};
if (message.policies?.length) {
@@ -1280,6 +1321,37 @@ export const Policy: MessageFns<Policy> = {
return message;
},
+ fromJSON(object: any): Policy {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ inheritFromParent: isSet(object.inheritFromParent) ? globalThis.Boolean(object.inheritFromParent) : false,
+ type: isSet(object.type) ? policyTypeFromJSON(object.type) : PolicyType.POLICY_TYPE_UNSPECIFIED,
+ rolloutPolicy: isSet(object.rolloutPolicy) ? RolloutPolicy.fromJSON(object.rolloutPolicy) : undefined,
+ disableCopyDataPolicy: isSet(object.disableCopyDataPolicy)
+ ? DisableCopyDataPolicy.fromJSON(object.disableCopyDataPolicy)
+ : undefined,
+ maskingRulePolicy: isSet(object.maskingRulePolicy)
+ ? MaskingRulePolicy.fromJSON(object.maskingRulePolicy)
+ : undefined,
+ maskingExceptionPolicy: isSet(object.maskingExceptionPolicy)
+ ? MaskingExceptionPolicy.fromJSON(object.maskingExceptionPolicy)
+ : undefined,
+ restrictIssueCreationForSqlReviewPolicy: isSet(object.restrictIssueCreationForSqlReviewPolicy)
+ ? RestrictIssueCreationForSQLReviewPolicy.fromJSON(object.restrictIssueCreationForSqlReviewPolicy)
+ : undefined,
+ tagPolicy: isSet(object.tagPolicy) ? TagPolicy.fromJSON(object.tagPolicy) : undefined,
+ dataSourceQueryPolicy: isSet(object.dataSourceQueryPolicy)
+ ? DataSourceQueryPolicy.fromJSON(object.dataSourceQueryPolicy)
+ : undefined,
+ exportDataPolicy: isSet(object.exportDataPolicy) ? ExportDataPolicy.fromJSON(object.exportDataPolicy) : undefined,
+ queryDataPolicy: isSet(object.queryDataPolicy) ? QueryDataPolicy.fromJSON(object.queryDataPolicy) : undefined,
+ enforce: isSet(object.enforce) ? globalThis.Boolean(object.enforce) : false,
+ resourceType: isSet(object.resourceType)
+ ? policyResourceTypeFromJSON(object.resourceType)
+ : PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED,
+ };
+ },
+
toJSON(message: Policy): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1433,6 +1505,16 @@ export const RolloutPolicy: MessageFns<RolloutPolicy> = {
return message;
},
+ fromJSON(object: any): RolloutPolicy {
+ return {
+ automatic: isSet(object.automatic) ? globalThis.Boolean(object.automatic) : false,
+ roles: globalThis.Array.isArray(object?.roles) ? object.roles.map((e: any) => globalThis.String(e)) : [],
+ issueRoles: globalThis.Array.isArray(object?.issueRoles)
+ ? object.issueRoles.map((e: any) => globalThis.String(e))
+ : [],
+ };
+ },
+
toJSON(message: RolloutPolicy): unknown {
const obj: any = {};
if (message.automatic !== false) {
@@ -1495,6 +1577,10 @@ export const DisableCopyDataPolicy: MessageFns<DisableCopyDataPolicy> = {
return message;
},
+ fromJSON(object: any): DisableCopyDataPolicy {
+ return { active: isSet(object.active) ? globalThis.Boolean(object.active) : false };
+ },
+
toJSON(message: DisableCopyDataPolicy): unknown {
const obj: any = {};
if (message.active !== false) {
@@ -1549,6 +1635,10 @@ export const ExportDataPolicy: MessageFns<ExportDataPolicy> = {
return message;
},
+ fromJSON(object: any): ExportDataPolicy {
+ return { disable: isSet(object.disable) ? globalThis.Boolean(object.disable) : false };
+ },
+
toJSON(message: ExportDataPolicy): unknown {
const obj: any = {};
if (message.disable !== false) {
@@ -1603,6 +1693,10 @@ export const QueryDataPolicy: MessageFns<QueryDataPolicy> = {
return message;
},
+ fromJSON(object: any): QueryDataPolicy {
+ return { timeout: isSet(object.timeout) ? Duration.fromJSON(object.timeout) : undefined };
+ },
+
toJSON(message: QueryDataPolicy): unknown {
const obj: any = {};
if (message.timeout !== undefined) {
@@ -1709,6 +1803,16 @@ export const SQLReviewRule: MessageFns<SQLReviewRule> = {
return message;
},
+ fromJSON(object: any): SQLReviewRule {
+ return {
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
+ level: isSet(object.level) ? sQLReviewRuleLevelFromJSON(object.level) : SQLReviewRuleLevel.LEVEL_UNSPECIFIED,
+ payload: isSet(object.payload) ? globalThis.String(object.payload) : "",
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
+ comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
+ };
+ },
+
toJSON(message: SQLReviewRule): unknown {
const obj: any = {};
if (message.type !== "") {
@@ -1779,6 +1883,14 @@ export const MaskingExceptionPolicy: MessageFns<MaskingExceptionPolicy> = {
return message;
},
+ fromJSON(object: any): MaskingExceptionPolicy {
+ return {
+ maskingExceptions: globalThis.Array.isArray(object?.maskingExceptions)
+ ? object.maskingExceptions.map((e: any) => MaskingExceptionPolicy_MaskingException.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: MaskingExceptionPolicy): unknown {
const obj: any = {};
if (message.maskingExceptions?.length) {
@@ -1860,6 +1972,16 @@ export const MaskingExceptionPolicy_MaskingException: MessageFns<MaskingExceptio
return message;
},
+ fromJSON(object: any): MaskingExceptionPolicy_MaskingException {
+ return {
+ action: isSet(object.action)
+ ? maskingExceptionPolicy_MaskingException_ActionFromJSON(object.action)
+ : MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED,
+ member: isSet(object.member) ? globalThis.String(object.member) : "",
+ condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
+ };
+ },
+
toJSON(message: MaskingExceptionPolicy_MaskingException): unknown {
const obj: any = {};
if (message.action !== MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED) {
@@ -1924,6 +2046,14 @@ export const MaskingRulePolicy: MessageFns<MaskingRulePolicy> = {
return message;
},
+ fromJSON(object: any): MaskingRulePolicy {
+ return {
+ rules: globalThis.Array.isArray(object?.rules)
+ ? object.rules.map((e: any) => MaskingRulePolicy_MaskingRule.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: MaskingRulePolicy): unknown {
const obj: any = {};
if (message.rules?.length) {
@@ -2000,6 +2130,14 @@ export const MaskingRulePolicy_MaskingRule: MessageFns<MaskingRulePolicy_Masking
return message;
},
+ fromJSON(object: any): MaskingRulePolicy_MaskingRule {
+ return {
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
+ semanticType: isSet(object.semanticType) ? globalThis.String(object.semanticType) : "",
+ };
+ },
+
toJSON(message: MaskingRulePolicy_MaskingRule): unknown {
const obj: any = {};
if (message.id !== "") {
@@ -2064,6 +2202,10 @@ export const RestrictIssueCreationForSQLReviewPolicy: MessageFns<RestrictIssueCr
return message;
},
+ fromJSON(object: any): RestrictIssueCreationForSQLReviewPolicy {
+ return { disallow: isSet(object.disallow) ? globalThis.Boolean(object.disallow) : false };
+ },
+
toJSON(message: RestrictIssueCreationForSQLReviewPolicy): unknown {
const obj: any = {};
if (message.disallow !== false) {
@@ -2121,6 +2263,17 @@ export const TagPolicy: MessageFns<TagPolicy> = {
return message;
},
+ fromJSON(object: any): TagPolicy {
+ return {
+ tags: isObject(object.tags)
+ ? Object.entries(object.tags).reduce<{ [key: string]: string }>((acc, [key, value]) => {
+ acc[key] = String(value);
+ return acc;
+ }, {})
+ : {},
+ };
+ },
+
toJSON(message: TagPolicy): unknown {
const obj: any = {};
if (message.tags) {
@@ -2197,6 +2350,13 @@ export const TagPolicy_TagsEntry: MessageFns<TagPolicy_TagsEntry> = {
return message;
},
+ fromJSON(object: any): TagPolicy_TagsEntry {
+ return {
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
+ };
+ },
+
toJSON(message: TagPolicy_TagsEntry): unknown {
const obj: any = {};
if (message.key !== "") {
@@ -2281,6 +2441,16 @@ export const DataSourceQueryPolicy: MessageFns<DataSourceQueryPolicy> = {
return message;
},
+ fromJSON(object: any): DataSourceQueryPolicy {
+ return {
+ adminDataSourceRestriction: isSet(object.adminDataSourceRestriction)
+ ? dataSourceQueryPolicy_RestrictionFromJSON(object.adminDataSourceRestriction)
+ : DataSourceQueryPolicy_Restriction.RESTRICTION_UNSPECIFIED,
+ disallowDdl: isSet(object.disallowDdl) ? globalThis.Boolean(object.disallowDdl) : false,
+ disallowDml: isSet(object.disallowDml) ? globalThis.Boolean(object.disallowDml) : false,
+ };
+ },
+
toJSON(message: DataSourceQueryPolicy): unknown {
const obj: any = {};
if (message.adminDataSourceRestriction !== DataSourceQueryPolicy_Restriction.RESTRICTION_UNSPECIFIED) {
@@ -3457,9 +3627,18 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isObject(value: any): boolean {
+ return typeof value === "object" && value !== null;
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/plan_service.ts b/frontend/src/types/proto/v1/plan_service.ts
index b099fa8276..5eccef0014 100644
--- a/frontend/src/types/proto/v1/plan_service.ts
+++ b/frontend/src/types/proto/v1/plan_service.ts
@@ -702,6 +702,10 @@ export const GetPlanRequest: MessageFns<GetPlanRequest> = {
return message;
},
+ fromJSON(object: any): GetPlanRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetPlanRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -778,6 +782,14 @@ export const ListPlansRequest: MessageFns<ListPlansRequest> = {
return message;
},
+ fromJSON(object: any): ListPlansRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: ListPlansRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -851,6 +863,13 @@ export const ListPlansResponse: MessageFns<ListPlansResponse> = {
return message;
},
+ fromJSON(object: any): ListPlansResponse {
+ return {
+ plans: globalThis.Array.isArray(object?.plans) ? object.plans.map((e: any) => Plan.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListPlansResponse): unknown {
const obj: any = {};
if (message.plans?.length) {
@@ -942,6 +961,15 @@ export const SearchPlansRequest: MessageFns<SearchPlansRequest> = {
return message;
},
+ fromJSON(object: any): SearchPlansRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ };
+ },
+
toJSON(message: SearchPlansRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1019,6 +1047,13 @@ export const SearchPlansResponse: MessageFns<SearchPlansResponse> = {
return message;
},
+ fromJSON(object: any): SearchPlansResponse {
+ return {
+ plans: globalThis.Array.isArray(object?.plans) ? object.plans.map((e: any) => Plan.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: SearchPlansResponse): unknown {
const obj: any = {};
if (message.plans?.length) {
@@ -1088,6 +1123,13 @@ export const CreatePlanRequest: MessageFns<CreatePlanRequest> = {
return message;
},
+ fromJSON(object: any): CreatePlanRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined,
+ };
+ },
+
toJSON(message: CreatePlanRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1157,6 +1199,13 @@ export const UpdatePlanRequest: MessageFns<UpdatePlanRequest> = {
return message;
},
+ fromJSON(object: any): UpdatePlanRequest {
+ return {
+ plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdatePlanRequest): unknown {
const obj: any = {};
if (message.plan !== undefined) {
@@ -1340,6 +1389,27 @@ export const Plan: MessageFns<Plan> = {
return message;
},
+ fromJSON(object: any): Plan {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ issue: isSet(object.issue) ? globalThis.String(object.issue) : "",
+ rollout: isSet(object.rollout) ? globalThis.String(object.rollout) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
+ specs: globalThis.Array.isArray(object?.specs) ? object.specs.map((e: any) => Plan_Spec.fromJSON(e)) : [],
+ creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
+ planCheckRunStatusCount: isObject(object.planCheckRunStatusCount)
+ ? Object.entries(object.planCheckRunStatusCount).reduce<{ [key: string]: number }>((acc, [key, value]) => {
+ acc[key] = Number(value);
+ return acc;
+ }, {})
+ : {},
+ deployment: isSet(object.deployment) ? Plan_Deployment.fromJSON(object.deployment) : undefined,
+ };
+ },
+
toJSON(message: Plan): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1486,6 +1556,21 @@ export const Plan_Spec: MessageFns<Plan_Spec> = {
return message;
},
+ fromJSON(object: any): Plan_Spec {
+ return {
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ createDatabaseConfig: isSet(object.createDatabaseConfig)
+ ? Plan_CreateDatabaseConfig.fromJSON(object.createDatabaseConfig)
+ : undefined,
+ changeDatabaseConfig: isSet(object.changeDatabaseConfig)
+ ? Plan_ChangeDatabaseConfig.fromJSON(object.changeDatabaseConfig)
+ : undefined,
+ exportDataConfig: isSet(object.exportDataConfig)
+ ? Plan_ExportDataConfig.fromJSON(object.exportDataConfig)
+ : undefined,
+ };
+ },
+
toJSON(message: Plan_Spec): unknown {
const obj: any = {};
if (message.id !== "") {
@@ -1569,6 +1654,13 @@ export const Plan_PlanCheckRunStatusCountEntry: MessageFns<Plan_PlanCheckRunStat
return message;
},
+ fromJSON(object: any): Plan_PlanCheckRunStatusCountEntry {
+ return {
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
+ value: isSet(object.value) ? globalThis.Number(object.value) : 0,
+ };
+ },
+
toJSON(message: Plan_PlanCheckRunStatusCountEntry): unknown {
const obj: any = {};
if (message.key !== "") {
@@ -1713,6 +1805,19 @@ export const Plan_CreateDatabaseConfig: MessageFns<Plan_CreateDatabaseConfig> =
return message;
},
+ fromJSON(object: any): Plan_CreateDatabaseConfig {
+ return {
+ target: isSet(object.target) ? globalThis.String(object.target) : "",
+ database: isSet(object.database) ? globalThis.String(object.database) : "",
+ table: isSet(object.table) ? globalThis.String(object.table) : "",
+ characterSet: isSet(object.characterSet) ? globalThis.String(object.characterSet) : "",
+ collation: isSet(object.collation) ? globalThis.String(object.collation) : "",
+ cluster: isSet(object.cluster) ? globalThis.String(object.cluster) : "",
+ owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
+ environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
+ };
+ },
+
toJSON(message: Plan_CreateDatabaseConfig): unknown {
const obj: any = {};
if (message.target !== "") {
@@ -1860,6 +1965,24 @@ export const Plan_ChangeDatabaseConfig: MessageFns<Plan_ChangeDatabaseConfig> =
return message;
},
+ fromJSON(object: any): Plan_ChangeDatabaseConfig {
+ return {
+ targets: globalThis.Array.isArray(object?.targets) ? object.targets.map((e: any) => globalThis.String(e)) : [],
+ sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
+ release: isSet(object.release) ? globalThis.String(object.release) : "",
+ type: isSet(object.type)
+ ? plan_ChangeDatabaseConfig_TypeFromJSON(object.type)
+ : Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED,
+ ghostFlags: isObject(object.ghostFlags)
+ ? Object.entries(object.ghostFlags).reduce<{ [key: string]: string }>((acc, [key, value]) => {
+ acc[key] = String(value);
+ return acc;
+ }, {})
+ : {},
+ enablePriorBackup: isSet(object.enablePriorBackup) ? globalThis.Boolean(object.enablePriorBackup) : false,
+ };
+ },
+
toJSON(message: Plan_ChangeDatabaseConfig): unknown {
const obj: any = {};
if (message.targets?.length) {
@@ -1959,6 +2082,13 @@ export const Plan_ChangeDatabaseConfig_GhostFlagsEntry: MessageFns<Plan_ChangeDa
return message;
},
+ fromJSON(object: any): Plan_ChangeDatabaseConfig_GhostFlagsEntry {
+ return {
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
+ };
+ },
+
toJSON(message: Plan_ChangeDatabaseConfig_GhostFlagsEntry): unknown {
const obj: any = {};
if (message.key !== "") {
@@ -2052,6 +2182,15 @@ export const Plan_ExportDataConfig: MessageFns<Plan_ExportDataConfig> = {
return message;
},
+ fromJSON(object: any): Plan_ExportDataConfig {
+ return {
+ targets: globalThis.Array.isArray(object?.targets) ? object.targets.map((e: any) => globalThis.String(e)) : [],
+ sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
+ format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,
+ password: isSet(object.password) ? globalThis.String(object.password) : undefined,
+ };
+ },
+
toJSON(message: Plan_ExportDataConfig): unknown {
const obj: any = {};
if (message.targets?.length) {
@@ -2129,6 +2268,17 @@ export const Plan_Deployment: MessageFns<Plan_Deployment> = {
return message;
},
+ fromJSON(object: any): Plan_Deployment {
+ return {
+ environments: globalThis.Array.isArray(object?.environments)
+ ? object.environments.map((e: any) => globalThis.String(e))
+ : [],
+ databaseGroupMappings: globalThis.Array.isArray(object?.databaseGroupMappings)
+ ? object.databaseGroupMappings.map((e: any) => Plan_Deployment_DatabaseGroupMapping.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: Plan_Deployment): unknown {
const obj: any = {};
if (message.environments?.length) {
@@ -2201,6 +2351,15 @@ export const Plan_Deployment_DatabaseGroupMapping: MessageFns<Plan_Deployment_Da
return message;
},
+ fromJSON(object: any): Plan_Deployment_DatabaseGroupMapping {
+ return {
+ databaseGroup: isSet(object.databaseGroup) ? globalThis.String(object.databaseGroup) : "",
+ databases: globalThis.Array.isArray(object?.databases)
+ ? object.databases.map((e: any) => globalThis.String(e))
+ : [],
+ };
+ },
+
toJSON(message: Plan_Deployment_DatabaseGroupMapping): unknown {
const obj: any = {};
if (message.databaseGroup !== "") {
@@ -2292,6 +2451,15 @@ export const ListPlanCheckRunsRequest: MessageFns<ListPlanCheckRunsRequest> = {
return message;
},
+ fromJSON(object: any): ListPlanCheckRunsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ latestOnly: isSet(object.latestOnly) ? globalThis.Boolean(object.latestOnly) : false,
+ };
+ },
+
toJSON(message: ListPlanCheckRunsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -2369,6 +2537,15 @@ export const ListPlanCheckRunsResponse: MessageFns<ListPlanCheckRunsResponse> =
return message;
},
+ fromJSON(object: any): ListPlanCheckRunsResponse {
+ return {
+ planCheckRuns: globalThis.Array.isArray(object?.planCheckRuns)
+ ? object.planCheckRuns.map((e: any) => PlanCheckRun.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListPlanCheckRunsResponse): unknown {
const obj: any = {};
if (message.planCheckRuns?.length) {
@@ -2438,6 +2615,13 @@ export const RunPlanChecksRequest: MessageFns<RunPlanChecksRequest> = {
return message;
},
+ fromJSON(object: any): RunPlanChecksRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ specId: isSet(object.specId) ? globalThis.String(object.specId) : undefined,
+ };
+ },
+
toJSON(message: RunPlanChecksRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2485,6 +2669,10 @@ export const RunPlanChecksResponse: MessageFns<RunPlanChecksResponse> = {
return message;
},
+ fromJSON(_: any): RunPlanChecksResponse {
+ return {};
+ },
+
toJSON(_: RunPlanChecksResponse): unknown {
const obj: any = {};
return obj;
@@ -2546,6 +2734,15 @@ export const BatchCancelPlanCheckRunsRequest: MessageFns<BatchCancelPlanCheckRun
return message;
},
+ fromJSON(object: any): BatchCancelPlanCheckRunsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ planCheckRuns: globalThis.Array.isArray(object?.planCheckRuns)
+ ? object.planCheckRuns.map((e: any) => globalThis.String(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchCancelPlanCheckRunsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -2593,6 +2790,10 @@ export const BatchCancelPlanCheckRunsResponse: MessageFns<BatchCancelPlanCheckRu
return message;
},
+ fromJSON(_: any): BatchCancelPlanCheckRunsResponse {
+ return {};
+ },
+
toJSON(_: BatchCancelPlanCheckRunsResponse): unknown {
const obj: any = {};
return obj;
@@ -2729,6 +2930,23 @@ export const PlanCheckRun: MessageFns<PlanCheckRun> = {
return message;
},
+ fromJSON(object: any): PlanCheckRun {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ type: isSet(object.type) ? planCheckRun_TypeFromJSON(object.type) : PlanCheckRun_Type.TYPE_UNSPECIFIED,
+ status: isSet(object.status)
+ ? planCheckRun_StatusFromJSON(object.status)
+ : PlanCheckRun_Status.STATUS_UNSPECIFIED,
+ target: isSet(object.target) ? globalThis.String(object.target) : "",
+ sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
+ results: globalThis.Array.isArray(object?.results)
+ ? object.results.map((e: any) => PlanCheckRun_Result.fromJSON(e))
+ : [],
+ error: isSet(object.error) ? globalThis.String(object.error) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ };
+ },
+
toJSON(message: PlanCheckRun): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2875,6 +3093,23 @@ export const PlanCheckRun_Result: MessageFns<PlanCheckRun_Result> = {
return message;
},
+ fromJSON(object: any): PlanCheckRun_Result {
+ return {
+ status: isSet(object.status)
+ ? planCheckRun_Result_StatusFromJSON(object.status)
+ : PlanCheckRun_Result_Status.STATUS_UNSPECIFIED,
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ content: isSet(object.content) ? globalThis.String(object.content) : "",
+ code: isSet(object.code) ? globalThis.Number(object.code) : 0,
+ sqlSummaryReport: isSet(object.sqlSummaryReport)
+ ? PlanCheckRun_Result_SqlSummaryReport.fromJSON(object.sqlSummaryReport)
+ : undefined,
+ sqlReviewReport: isSet(object.sqlReviewReport)
+ ? PlanCheckRun_Result_SqlReviewReport.fromJSON(object.sqlReviewReport)
+ : undefined,
+ };
+ },
+
toJSON(message: PlanCheckRun_Result): unknown {
const obj: any = {};
if (message.status !== PlanCheckRun_Result_Status.STATUS_UNSPECIFIED) {
@@ -2975,6 +3210,16 @@ export const PlanCheckRun_Result_SqlSummaryReport: MessageFns<PlanCheckRun_Resul
return message;
},
+ fromJSON(object: any): PlanCheckRun_Result_SqlSummaryReport {
+ return {
+ statementTypes: globalThis.Array.isArray(object?.statementTypes)
+ ? object.statementTypes.map((e: any) => globalThis.String(e))
+ : [],
+ affectedRows: isSet(object.affectedRows) ? globalThis.Number(object.affectedRows) : 0,
+ changedResources: isSet(object.changedResources) ? ChangedResources.fromJSON(object.changedResources) : undefined,
+ };
+ },
+
toJSON(message: PlanCheckRun_Result_SqlSummaryReport): unknown {
const obj: any = {};
if (message.statementTypes?.length) {
@@ -3072,6 +3317,15 @@ export const PlanCheckRun_Result_SqlReviewReport: MessageFns<PlanCheckRun_Result
return message;
},
+ fromJSON(object: any): PlanCheckRun_Result_SqlReviewReport {
+ return {
+ line: isSet(object.line) ? globalThis.Number(object.line) : 0,
+ column: isSet(object.column) ? globalThis.Number(object.column) : 0,
+ startPosition: isSet(object.startPosition) ? Position.fromJSON(object.startPosition) : undefined,
+ endPosition: isSet(object.endPosition) ? Position.fromJSON(object.endPosition) : undefined,
+ };
+ },
+
toJSON(message: PlanCheckRun_Result_SqlReviewReport): unknown {
const obj: any = {};
if (message.line !== 0) {
@@ -3693,15 +3947,44 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isObject(value: any): boolean {
+ return typeof value === "object" && value !== null;
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/project_service.ts b/frontend/src/types/proto/v1/project_service.ts
index 7e175e9f35..edad953893 100644
--- a/frontend/src/types/proto/v1/project_service.ts
+++ b/frontend/src/types/proto/v1/project_service.ts
@@ -556,6 +556,10 @@ export const GetProjectRequest: MessageFns<GetProjectRequest> = {
return message;
},
+ fromJSON(object: any): GetProjectRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetProjectRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -643,6 +647,15 @@ export const ListProjectsRequest: MessageFns<ListProjectsRequest> = {
return message;
},
+ fromJSON(object: any): ListProjectsRequest {
+ return {
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ };
+ },
+
toJSON(message: ListProjectsRequest): unknown {
const obj: any = {};
if (message.pageSize !== 0) {
@@ -720,6 +733,13 @@ export const ListProjectsResponse: MessageFns<ListProjectsResponse> = {
return message;
},
+ fromJSON(object: any): ListProjectsResponse {
+ return {
+ projects: globalThis.Array.isArray(object?.projects) ? object.projects.map((e: any) => Project.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListProjectsResponse): unknown {
const obj: any = {};
if (message.projects?.length) {
@@ -811,6 +831,15 @@ export const SearchProjectsRequest: MessageFns<SearchProjectsRequest> = {
return message;
},
+ fromJSON(object: any): SearchProjectsRequest {
+ return {
+ showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: SearchProjectsRequest): unknown {
const obj: any = {};
if (message.showDeleted !== false) {
@@ -888,6 +917,13 @@ export const SearchProjectsResponse: MessageFns<SearchProjectsResponse> = {
return message;
},
+ fromJSON(object: any): SearchProjectsResponse {
+ return {
+ projects: globalThis.Array.isArray(object?.projects) ? object.projects.map((e: any) => Project.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: SearchProjectsResponse): unknown {
const obj: any = {};
if (message.projects?.length) {
@@ -957,6 +993,13 @@ export const CreateProjectRequest: MessageFns<CreateProjectRequest> = {
return message;
},
+ fromJSON(object: any): CreateProjectRequest {
+ return {
+ project: isSet(object.project) ? Project.fromJSON(object.project) : undefined,
+ projectId: isSet(object.projectId) ? globalThis.String(object.projectId) : "",
+ };
+ },
+
toJSON(message: CreateProjectRequest): unknown {
const obj: any = {};
if (message.project !== undefined) {
@@ -1028,6 +1071,13 @@ export const UpdateProjectRequest: MessageFns<UpdateProjectRequest> = {
return message;
},
+ fromJSON(object: any): UpdateProjectRequest {
+ return {
+ project: isSet(object.project) ? Project.fromJSON(object.project) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateProjectRequest): unknown {
const obj: any = {};
if (message.project !== undefined) {
@@ -1099,6 +1149,13 @@ export const DeleteProjectRequest: MessageFns<DeleteProjectRequest> = {
return message;
},
+ fromJSON(object: any): DeleteProjectRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ force: isSet(object.force) ? globalThis.Boolean(object.force) : false,
+ };
+ },
+
toJSON(message: DeleteProjectRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1157,6 +1214,10 @@ export const UndeleteProjectRequest: MessageFns<UndeleteProjectRequest> = {
return message;
},
+ fromJSON(object: any): UndeleteProjectRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: UndeleteProjectRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1222,6 +1283,13 @@ export const BatchGetIamPolicyRequest: MessageFns<BatchGetIamPolicyRequest> = {
return message;
},
+ fromJSON(object: any): BatchGetIamPolicyRequest {
+ return {
+ scope: isSet(object.scope) ? globalThis.String(object.scope) : "",
+ names: globalThis.Array.isArray(object?.names) ? object.names.map((e: any) => globalThis.String(e)) : [],
+ };
+ },
+
toJSON(message: BatchGetIamPolicyRequest): unknown {
const obj: any = {};
if (message.scope !== "") {
@@ -1280,6 +1348,14 @@ export const BatchGetIamPolicyResponse: MessageFns<BatchGetIamPolicyResponse> =
return message;
},
+ fromJSON(object: any): BatchGetIamPolicyResponse {
+ return {
+ policyResults: globalThis.Array.isArray(object?.policyResults)
+ ? object.policyResults.map((e: any) => BatchGetIamPolicyResponse_PolicyResult.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchGetIamPolicyResponse): unknown {
const obj: any = {};
if (message.policyResults?.length) {
@@ -1346,6 +1422,13 @@ export const BatchGetIamPolicyResponse_PolicyResult: MessageFns<BatchGetIamPolic
return message;
},
+ fromJSON(object: any): BatchGetIamPolicyResponse_PolicyResult {
+ return {
+ project: isSet(object.project) ? globalThis.String(object.project) : "",
+ policy: isSet(object.policy) ? IamPolicy.fromJSON(object.policy) : undefined,
+ };
+ },
+
toJSON(message: BatchGetIamPolicyResponse_PolicyResult): unknown {
const obj: any = {};
if (message.project !== "") {
@@ -1428,6 +1511,14 @@ export const Label: MessageFns<Label> = {
return message;
},
+ fromJSON(object: any): Label {
+ return {
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
+ color: isSet(object.color) ? globalThis.String(object.color) : "",
+ group: isSet(object.group) ? globalThis.String(object.group) : "",
+ };
+ },
+
toJSON(message: Label): unknown {
const obj: any = {};
if (message.value !== "") {
@@ -1684,6 +1775,40 @@ export const Project: MessageFns<Project> = {
return message;
},
+ fromJSON(object: any): Project {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ webhooks: globalThis.Array.isArray(object?.webhooks) ? object.webhooks.map((e: any) => Webhook.fromJSON(e)) : [],
+ dataClassificationConfigId: isSet(object.dataClassificationConfigId)
+ ? globalThis.String(object.dataClassificationConfigId)
+ : "",
+ issueLabels: globalThis.Array.isArray(object?.issueLabels)
+ ? object.issueLabels.map((e: any) => Label.fromJSON(e))
+ : [],
+ forceIssueLabels: isSet(object.forceIssueLabels) ? globalThis.Boolean(object.forceIssueLabels) : false,
+ allowModifyStatement: isSet(object.allowModifyStatement)
+ ? globalThis.Boolean(object.allowModifyStatement)
+ : false,
+ autoResolveIssue: isSet(object.autoResolveIssue) ? globalThis.Boolean(object.autoResolveIssue) : false,
+ enforceIssueTitle: isSet(object.enforceIssueTitle) ? globalThis.Boolean(object.enforceIssueTitle) : false,
+ autoEnableBackup: isSet(object.autoEnableBackup) ? globalThis.Boolean(object.autoEnableBackup) : false,
+ skipBackupErrors: isSet(object.skipBackupErrors) ? globalThis.Boolean(object.skipBackupErrors) : false,
+ postgresDatabaseTenantMode: isSet(object.postgresDatabaseTenantMode)
+ ? globalThis.Boolean(object.postgresDatabaseTenantMode)
+ : false,
+ allowSelfApproval: isSet(object.allowSelfApproval) ? globalThis.Boolean(object.allowSelfApproval) : false,
+ executionRetryPolicy: isSet(object.executionRetryPolicy)
+ ? Project_ExecutionRetryPolicy.fromJSON(object.executionRetryPolicy)
+ : undefined,
+ ciSamplingSize: isSet(object.ciSamplingSize) ? globalThis.Number(object.ciSamplingSize) : 0,
+ parallelTasksPerRollout: isSet(object.parallelTasksPerRollout)
+ ? globalThis.Number(object.parallelTasksPerRollout)
+ : 0,
+ };
+ },
+
toJSON(message: Project): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1804,6 +1929,10 @@ export const Project_ExecutionRetryPolicy: MessageFns<Project_ExecutionRetryPoli
return message;
},
+ fromJSON(object: any): Project_ExecutionRetryPolicy {
+ return { maximumRetries: isSet(object.maximumRetries) ? globalThis.Number(object.maximumRetries) : 0 };
+ },
+
toJSON(message: Project_ExecutionRetryPolicy): unknown {
const obj: any = {};
if (message.maximumRetries !== 0) {
@@ -1869,6 +1998,13 @@ export const AddWebhookRequest: MessageFns<AddWebhookRequest> = {
return message;
},
+ fromJSON(object: any): AddWebhookRequest {
+ return {
+ project: isSet(object.project) ? globalThis.String(object.project) : "",
+ webhook: isSet(object.webhook) ? Webhook.fromJSON(object.webhook) : undefined,
+ };
+ },
+
toJSON(message: AddWebhookRequest): unknown {
const obj: any = {};
if (message.project !== "") {
@@ -1940,6 +2076,13 @@ export const UpdateWebhookRequest: MessageFns<UpdateWebhookRequest> = {
return message;
},
+ fromJSON(object: any): UpdateWebhookRequest {
+ return {
+ webhook: isSet(object.webhook) ? Webhook.fromJSON(object.webhook) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateWebhookRequest): unknown {
const obj: any = {};
if (message.webhook !== undefined) {
@@ -2000,6 +2143,10 @@ export const RemoveWebhookRequest: MessageFns<RemoveWebhookRequest> = {
return message;
},
+ fromJSON(object: any): RemoveWebhookRequest {
+ return { webhook: isSet(object.webhook) ? Webhook.fromJSON(object.webhook) : undefined };
+ },
+
toJSON(message: RemoveWebhookRequest): unknown {
const obj: any = {};
if (message.webhook !== undefined) {
@@ -2067,6 +2214,13 @@ export const TestWebhookRequest: MessageFns<TestWebhookRequest> = {
return message;
},
+ fromJSON(object: any): TestWebhookRequest {
+ return {
+ project: isSet(object.project) ? globalThis.String(object.project) : "",
+ webhook: isSet(object.webhook) ? Webhook.fromJSON(object.webhook) : undefined,
+ };
+ },
+
toJSON(message: TestWebhookRequest): unknown {
const obj: any = {};
if (message.project !== "") {
@@ -2127,6 +2281,10 @@ export const TestWebhookResponse: MessageFns<TestWebhookResponse> = {
return message;
},
+ fromJSON(object: any): TestWebhookResponse {
+ return { error: isSet(object.error) ? globalThis.String(object.error) : "" };
+ },
+
toJSON(message: TestWebhookResponse): unknown {
const obj: any = {};
if (message.error !== "") {
@@ -2255,6 +2413,19 @@ export const Webhook: MessageFns<Webhook> = {
return message;
},
+ fromJSON(object: any): Webhook {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ type: isSet(object.type) ? webhook_TypeFromJSON(object.type) : Webhook_Type.TYPE_UNSPECIFIED,
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ url: isSet(object.url) ? globalThis.String(object.url) : "",
+ directMessage: isSet(object.directMessage) ? globalThis.Boolean(object.directMessage) : false,
+ notificationTypes: globalThis.Array.isArray(object?.notificationTypes)
+ ? object.notificationTypes.map((e: any) => activity_TypeFromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: Webhook): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2318,6 +2489,10 @@ export const Activity: MessageFns<Activity> = {
return message;
},
+ fromJSON(_: any): Activity {
+ return {};
+ },
+
toJSON(_: Activity): unknown {
const obj: any = {};
return obj;
@@ -3260,9 +3435,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/release_service.ts b/frontend/src/types/proto/v1/release_service.ts
index 3684261eb9..eee5f9a85a 100644
--- a/frontend/src/types/proto/v1/release_service.ts
+++ b/frontend/src/types/proto/v1/release_service.ts
@@ -380,6 +380,10 @@ export const GetReleaseRequest: MessageFns<GetReleaseRequest> = {
return message;
},
+ fromJSON(object: any): GetReleaseRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetReleaseRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -467,6 +471,15 @@ export const ListReleasesRequest: MessageFns<ListReleasesRequest> = {
return message;
},
+ fromJSON(object: any): ListReleasesRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
+ };
+ },
+
toJSON(message: ListReleasesRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -544,6 +557,13 @@ export const ListReleasesResponse: MessageFns<ListReleasesResponse> = {
return message;
},
+ fromJSON(object: any): ListReleasesResponse {
+ return {
+ releases: globalThis.Array.isArray(object?.releases) ? object.releases.map((e: any) => Release.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListReleasesResponse): unknown {
const obj: any = {};
if (message.releases?.length) {
@@ -613,6 +633,13 @@ export const CreateReleaseRequest: MessageFns<CreateReleaseRequest> = {
return message;
},
+ fromJSON(object: any): CreateReleaseRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ release: isSet(object.release) ? Release.fromJSON(object.release) : undefined,
+ };
+ },
+
toJSON(message: CreateReleaseRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -684,6 +711,13 @@ export const UpdateReleaseRequest: MessageFns<UpdateReleaseRequest> = {
return message;
},
+ fromJSON(object: any): UpdateReleaseRequest {
+ return {
+ release: isSet(object.release) ? Release.fromJSON(object.release) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateReleaseRequest): unknown {
const obj: any = {};
if (message.release !== undefined) {
@@ -744,6 +778,10 @@ export const DeleteReleaseRequest: MessageFns<DeleteReleaseRequest> = {
return message;
},
+ fromJSON(object: any): DeleteReleaseRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DeleteReleaseRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -798,6 +836,10 @@ export const UndeleteReleaseRequest: MessageFns<UndeleteReleaseRequest> = {
return message;
},
+ fromJSON(object: any): UndeleteReleaseRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: UndeleteReleaseRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -874,6 +916,14 @@ export const CheckReleaseRequest: MessageFns<CheckReleaseRequest> = {
return message;
},
+ fromJSON(object: any): CheckReleaseRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ release: isSet(object.release) ? Release.fromJSON(object.release) : undefined,
+ targets: globalThis.Array.isArray(object?.targets) ? object.targets.map((e: any) => globalThis.String(e)) : [],
+ };
+ },
+
toJSON(message: CheckReleaseRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -960,6 +1010,18 @@ export const CheckReleaseResponse: MessageFns<CheckReleaseResponse> = {
return message;
},
+ fromJSON(object: any): CheckReleaseResponse {
+ return {
+ results: globalThis.Array.isArray(object?.results)
+ ? object.results.map((e: any) => CheckReleaseResponse_CheckResult.fromJSON(e))
+ : [],
+ affectedRows: isSet(object.affectedRows) ? globalThis.Number(object.affectedRows) : 0,
+ riskLevel: isSet(object.riskLevel)
+ ? checkReleaseResponse_RiskLevelFromJSON(object.riskLevel)
+ : CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED,
+ };
+ },
+
toJSON(message: CheckReleaseResponse): unknown {
const obj: any = {};
if (message.results?.length) {
@@ -1072,6 +1134,18 @@ export const CheckReleaseResponse_CheckResult: MessageFns<CheckReleaseResponse_C
return message;
},
+ fromJSON(object: any): CheckReleaseResponse_CheckResult {
+ return {
+ file: isSet(object.file) ? globalThis.String(object.file) : "",
+ target: isSet(object.target) ? globalThis.String(object.target) : "",
+ advices: globalThis.Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromJSON(e)) : [],
+ affectedRows: isSet(object.affectedRows) ? globalThis.Number(object.affectedRows) : 0,
+ riskLevel: isSet(object.riskLevel)
+ ? checkReleaseResponse_RiskLevelFromJSON(object.riskLevel)
+ : CheckReleaseResponse_RiskLevel.RISK_LEVEL_UNSPECIFIED,
+ };
+ },
+
toJSON(message: CheckReleaseResponse_CheckResult): unknown {
const obj: any = {};
if (message.file !== "") {
@@ -1216,6 +1290,18 @@ export const Release: MessageFns<Release> = {
return message;
},
+ fromJSON(object: any): Release {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ files: globalThis.Array.isArray(object?.files) ? object.files.map((e: any) => Release_File.fromJSON(e)) : [],
+ vcsSource: isSet(object.vcsSource) ? Release_VCSSource.fromJSON(object.vcsSource) : undefined,
+ creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
+ };
+ },
+
toJSON(message: Release): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1396,6 +1482,22 @@ export const Release_File: MessageFns<Release_File> = {
return message;
},
+ fromJSON(object: any): Release_File {
+ return {
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
+ type: isSet(object.type) ? releaseFileTypeFromJSON(object.type) : ReleaseFileType.TYPE_UNSPECIFIED,
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
+ changeType: isSet(object.changeType)
+ ? release_File_ChangeTypeFromJSON(object.changeType)
+ : Release_File_ChangeType.CHANGE_TYPE_UNSPECIFIED,
+ sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
+ statement: isSet(object.statement) ? bytesFromBase64(object.statement) : new Uint8Array(0),
+ sheetSha256: isSet(object.sheetSha256) ? globalThis.String(object.sheetSha256) : "",
+ statementSize: isSet(object.statementSize) ? Long.fromValue(object.statementSize) : Long.ZERO,
+ };
+ },
+
toJSON(message: Release_File): unknown {
const obj: any = {};
if (message.id !== "") {
@@ -1495,6 +1597,13 @@ export const Release_VCSSource: MessageFns<Release_VCSSource> = {
return message;
},
+ fromJSON(object: any): Release_VCSSource {
+ return {
+ vcsType: isSet(object.vcsType) ? vCSTypeFromJSON(object.vcsType) : VCSType.VCS_TYPE_UNSPECIFIED,
+ url: isSet(object.url) ? globalThis.String(object.url) : "",
+ };
+ },
+
toJSON(message: Release_VCSSource): unknown {
const obj: any = {};
if (message.vcsType !== VCSType.VCS_TYPE_UNSPECIFIED) {
@@ -1991,6 +2100,15 @@ export const ReleaseServiceDefinition = {
},
} as const;
+function bytesFromBase64(b64: string): Uint8Array {
+ 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 {
const bin: string[] = [];
arr.forEach((byte) => {
@@ -2007,15 +2125,40 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/review_config_service.ts b/frontend/src/types/proto/v1/review_config_service.ts
index 6e3e6321a1..31e79a758a 100644
--- a/frontend/src/types/proto/v1/review_config_service.ts
+++ b/frontend/src/types/proto/v1/review_config_service.ts
@@ -146,6 +146,13 @@ export const ListReviewConfigsRequest: MessageFns<ListReviewConfigsRequest> = {
return message;
},
+ fromJSON(object: any): ListReviewConfigsRequest {
+ return {
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: ListReviewConfigsRequest): unknown {
const obj: any = {};
if (message.pageSize !== 0) {
@@ -215,6 +222,15 @@ export const ListReviewConfigsResponse: MessageFns<ListReviewConfigsResponse> =
return message;
},
+ fromJSON(object: any): ListReviewConfigsResponse {
+ return {
+ reviewConfigs: globalThis.Array.isArray(object?.reviewConfigs)
+ ? object.reviewConfigs.map((e: any) => ReviewConfig.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListReviewConfigsResponse): unknown {
const obj: any = {};
if (message.reviewConfigs?.length) {
@@ -273,6 +289,10 @@ export const CreateReviewConfigRequest: MessageFns<CreateReviewConfigRequest> =
return message;
},
+ fromJSON(object: any): CreateReviewConfigRequest {
+ return { reviewConfig: isSet(object.reviewConfig) ? ReviewConfig.fromJSON(object.reviewConfig) : undefined };
+ },
+
toJSON(message: CreateReviewConfigRequest): unknown {
const obj: any = {};
if (message.reviewConfig !== undefined) {
@@ -351,6 +371,14 @@ export const UpdateReviewConfigRequest: MessageFns<UpdateReviewConfigRequest> =
return message;
},
+ fromJSON(object: any): UpdateReviewConfigRequest {
+ return {
+ reviewConfig: isSet(object.reviewConfig) ? ReviewConfig.fromJSON(object.reviewConfig) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ allowMissing: isSet(object.allowMissing) ? globalThis.Boolean(object.allowMissing) : false,
+ };
+ },
+
toJSON(message: UpdateReviewConfigRequest): unknown {
const obj: any = {};
if (message.reviewConfig !== undefined) {
@@ -415,6 +443,10 @@ export const GetReviewConfigRequest: MessageFns<GetReviewConfigRequest> = {
return message;
},
+ fromJSON(object: any): GetReviewConfigRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetReviewConfigRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -469,6 +501,10 @@ export const DeleteReviewConfigRequest: MessageFns<DeleteReviewConfigRequest> =
return message;
},
+ fromJSON(object: any): DeleteReviewConfigRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DeleteReviewConfigRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -567,6 +603,18 @@ export const ReviewConfig: MessageFns<ReviewConfig> = {
return message;
},
+ fromJSON(object: any): ReviewConfig {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
+ rules: globalThis.Array.isArray(object?.rules) ? object.rules.map((e: any) => SQLReviewRule.fromJSON(e)) : [],
+ resources: globalThis.Array.isArray(object?.resources)
+ ? object.resources.map((e: any) => globalThis.String(e))
+ : [],
+ };
+ },
+
toJSON(message: ReviewConfig): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1037,9 +1085,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/revision_service.ts b/frontend/src/types/proto/v1/revision_service.ts
index 955efe0177..115efc9e21 100644
--- a/frontend/src/types/proto/v1/revision_service.ts
+++ b/frontend/src/types/proto/v1/revision_service.ts
@@ -205,6 +205,15 @@ export const ListRevisionsRequest: MessageFns<ListRevisionsRequest> = {
return message;
},
+ fromJSON(object: any): ListRevisionsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
+ };
+ },
+
toJSON(message: ListRevisionsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -282,6 +291,15 @@ export const ListRevisionsResponse: MessageFns<ListRevisionsResponse> = {
return message;
},
+ fromJSON(object: any): ListRevisionsResponse {
+ return {
+ revisions: globalThis.Array.isArray(object?.revisions)
+ ? object.revisions.map((e: any) => Revision.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListRevisionsResponse): unknown {
const obj: any = {};
if (message.revisions?.length) {
@@ -351,6 +369,13 @@ export const CreateRevisionRequest: MessageFns<CreateRevisionRequest> = {
return message;
},
+ fromJSON(object: any): CreateRevisionRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ revision: isSet(object.revision) ? Revision.fromJSON(object.revision) : undefined,
+ };
+ },
+
toJSON(message: CreateRevisionRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -422,6 +447,15 @@ export const BatchCreateRevisionsRequest: MessageFns<BatchCreateRevisionsRequest
return message;
},
+ fromJSON(object: any): BatchCreateRevisionsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ requests: globalThis.Array.isArray(object?.requests)
+ ? object.requests.map((e: any) => CreateRevisionRequest.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchCreateRevisionsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -480,6 +514,14 @@ export const BatchCreateRevisionsResponse: MessageFns<BatchCreateRevisionsRespon
return message;
},
+ fromJSON(object: any): BatchCreateRevisionsResponse {
+ return {
+ revisions: globalThis.Array.isArray(object?.revisions)
+ ? object.revisions.map((e: any) => Revision.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchCreateRevisionsResponse): unknown {
const obj: any = {};
if (message.revisions?.length) {
@@ -534,6 +576,10 @@ export const GetRevisionRequest: MessageFns<GetRevisionRequest> = {
return message;
},
+ fromJSON(object: any): GetRevisionRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetRevisionRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -588,6 +634,10 @@ export const DeleteRevisionRequest: MessageFns<DeleteRevisionRequest> = {
return message;
},
+ fromJSON(object: any): DeleteRevisionRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DeleteRevisionRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -788,6 +838,24 @@ export const Revision: MessageFns<Revision> = {
return message;
},
+ fromJSON(object: any): Revision {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ release: isSet(object.release) ? globalThis.String(object.release) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ deleter: isSet(object.deleter) ? globalThis.String(object.deleter) : "",
+ deleteTime: isSet(object.deleteTime) ? fromJsonTimestamp(object.deleteTime) : undefined,
+ file: isSet(object.file) ? globalThis.String(object.file) : "",
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
+ sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
+ sheetSha256: isSet(object.sheetSha256) ? globalThis.String(object.sheetSha256) : "",
+ statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
+ statementSize: isSet(object.statementSize) ? Long.fromValue(object.statementSize) : Long.ZERO,
+ issue: isSet(object.issue) ? globalThis.String(object.issue) : "",
+ taskRun: isSet(object.taskRun) ? globalThis.String(object.taskRun) : "",
+ };
+ },
+
toJSON(message: Revision): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1305,15 +1373,40 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/risk_service.ts b/frontend/src/types/proto/v1/risk_service.ts
index c138c3eb58..a02217d4e2 100644
--- a/frontend/src/types/proto/v1/risk_service.ts
+++ b/frontend/src/types/proto/v1/risk_service.ts
@@ -283,6 +283,13 @@ export const ListRisksRequest: MessageFns<ListRisksRequest> = {
return message;
},
+ fromJSON(object: any): ListRisksRequest {
+ return {
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: ListRisksRequest): unknown {
const obj: any = {};
if (message.pageSize !== 0) {
@@ -352,6 +359,13 @@ export const ListRisksResponse: MessageFns<ListRisksResponse> = {
return message;
},
+ fromJSON(object: any): ListRisksResponse {
+ return {
+ risks: globalThis.Array.isArray(object?.risks) ? object.risks.map((e: any) => Risk.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListRisksResponse): unknown {
const obj: any = {};
if (message.risks?.length) {
@@ -410,6 +424,10 @@ export const CreateRiskRequest: MessageFns<CreateRiskRequest> = {
return message;
},
+ fromJSON(object: any): CreateRiskRequest {
+ return { risk: isSet(object.risk) ? Risk.fromJSON(object.risk) : undefined };
+ },
+
toJSON(message: CreateRiskRequest): unknown {
const obj: any = {};
if (message.risk !== undefined) {
@@ -464,6 +482,10 @@ export const GetRiskRequest: MessageFns<GetRiskRequest> = {
return message;
},
+ fromJSON(object: any): GetRiskRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetRiskRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -529,6 +551,13 @@ export const UpdateRiskRequest: MessageFns<UpdateRiskRequest> = {
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 = {};
if (message.risk !== undefined) {
@@ -587,6 +616,10 @@ export const DeleteRiskRequest: MessageFns<DeleteRiskRequest> = {
return message;
},
+ fromJSON(object: any): DeleteRiskRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DeleteRiskRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -696,6 +729,17 @@ export const Risk: MessageFns<Risk> = {
return message;
},
+ fromJSON(object: any): Risk {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ source: isSet(object.source) ? risk_SourceFromJSON(object.source) : Risk_Source.SOURCE_UNSPECIFIED,
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ level: isSet(object.level) ? globalThis.Number(object.level) : 0,
+ active: isSet(object.active) ? globalThis.Boolean(object.active) : false,
+ condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
+ };
+ },
+
toJSON(message: Risk): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -912,9 +956,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/role_service.ts b/frontend/src/types/proto/v1/role_service.ts
index 4610848c7f..dac5fe1d3c 100644
--- a/frontend/src/types/proto/v1/role_service.ts
+++ b/frontend/src/types/proto/v1/role_service.ts
@@ -186,6 +186,13 @@ export const ListRolesRequest: MessageFns<ListRolesRequest> = {
return message;
},
+ fromJSON(object: any): ListRolesRequest {
+ return {
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: ListRolesRequest): unknown {
const obj: any = {};
if (message.pageSize !== 0) {
@@ -255,6 +262,13 @@ export const ListRolesResponse: MessageFns<ListRolesResponse> = {
return message;
},
+ fromJSON(object: any): ListRolesResponse {
+ return {
+ roles: globalThis.Array.isArray(object?.roles) ? object.roles.map((e: any) => Role.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListRolesResponse): unknown {
const obj: any = {};
if (message.roles?.length) {
@@ -324,6 +338,13 @@ export const CreateRoleRequest: MessageFns<CreateRoleRequest> = {
return message;
},
+ fromJSON(object: any): CreateRoleRequest {
+ return {
+ role: isSet(object.role) ? Role.fromJSON(object.role) : undefined,
+ roleId: isSet(object.roleId) ? globalThis.String(object.roleId) : "",
+ };
+ },
+
toJSON(message: CreateRoleRequest): unknown {
const obj: any = {};
if (message.role !== undefined) {
@@ -382,6 +403,10 @@ export const GetRoleRequest: MessageFns<GetRoleRequest> = {
return message;
},
+ fromJSON(object: any): GetRoleRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetRoleRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -458,6 +483,14 @@ export const UpdateRoleRequest: MessageFns<UpdateRoleRequest> = {
return message;
},
+ fromJSON(object: any): UpdateRoleRequest {
+ return {
+ role: isSet(object.role) ? Role.fromJSON(object.role) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ allowMissing: isSet(object.allowMissing) ? globalThis.Boolean(object.allowMissing) : false,
+ };
+ },
+
toJSON(message: UpdateRoleRequest): unknown {
const obj: any = {};
if (message.role !== undefined) {
@@ -520,6 +553,10 @@ export const DeleteRoleRequest: MessageFns<DeleteRoleRequest> = {
return message;
},
+ fromJSON(object: any): DeleteRoleRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DeleteRoleRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -618,6 +655,18 @@ export const Role: MessageFns<Role> = {
return message;
},
+ fromJSON(object: any): Role {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
+ permissions: globalThis.Array.isArray(object?.permissions)
+ ? object.permissions.map((e: any) => globalThis.String(e))
+ : [],
+ type: isSet(object.type) ? role_TypeFromJSON(object.type) : Role_Type.TYPE_UNSPECIFIED,
+ };
+ },
+
toJSON(message: Role): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -827,9 +876,14 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/rollout_service.ts b/frontend/src/types/proto/v1/rollout_service.ts
index 831ce8510d..0db7a835b3 100644
--- a/frontend/src/types/proto/v1/rollout_service.ts
+++ b/frontend/src/types/proto/v1/rollout_service.ts
@@ -1113,6 +1113,15 @@ export const BatchRunTasksRequest: MessageFns<BatchRunTasksRequest> = {
return message;
},
+ fromJSON(object: any): BatchRunTasksRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => globalThis.String(e)) : [],
+ reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
+ runTime: isSet(object.runTime) ? fromJsonTimestamp(object.runTime) : undefined,
+ };
+ },
+
toJSON(message: BatchRunTasksRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1170,6 +1179,10 @@ export const BatchRunTasksResponse: MessageFns<BatchRunTasksResponse> = {
return message;
},
+ fromJSON(_: any): BatchRunTasksResponse {
+ return {};
+ },
+
toJSON(_: BatchRunTasksResponse): unknown {
const obj: any = {};
return obj;
@@ -1242,6 +1255,14 @@ export const BatchSkipTasksRequest: MessageFns<BatchSkipTasksRequest> = {
return message;
},
+ fromJSON(object: any): BatchSkipTasksRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => globalThis.String(e)) : [],
+ reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
+ };
+ },
+
toJSON(message: BatchSkipTasksRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1293,6 +1314,10 @@ export const BatchSkipTasksResponse: MessageFns<BatchSkipTasksResponse> = {
return message;
},
+ fromJSON(_: any): BatchSkipTasksResponse {
+ return {};
+ },
+
toJSON(_: BatchSkipTasksResponse): unknown {
const obj: any = {};
return obj;
@@ -1365,6 +1390,14 @@ export const BatchCancelTaskRunsRequest: MessageFns<BatchCancelTaskRunsRequest>
return message;
},
+ fromJSON(object: any): BatchCancelTaskRunsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ taskRuns: globalThis.Array.isArray(object?.taskRuns) ? object.taskRuns.map((e: any) => globalThis.String(e)) : [],
+ reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
+ };
+ },
+
toJSON(message: BatchCancelTaskRunsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1416,6 +1449,10 @@ export const BatchCancelTaskRunsResponse: MessageFns<BatchCancelTaskRunsResponse
return message;
},
+ fromJSON(_: any): BatchCancelTaskRunsResponse {
+ return {};
+ },
+
toJSON(_: BatchCancelTaskRunsResponse): unknown {
const obj: any = {};
return obj;
@@ -1466,6 +1503,10 @@ export const GetRolloutRequest: MessageFns<GetRolloutRequest> = {
return message;
},
+ fromJSON(object: any): GetRolloutRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetRolloutRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1542,6 +1583,14 @@ export const ListRolloutsRequest: MessageFns<ListRolloutsRequest> = {
return message;
},
+ fromJSON(object: any): ListRolloutsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: ListRolloutsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1615,6 +1664,13 @@ export const ListRolloutsResponse: MessageFns<ListRolloutsResponse> = {
return message;
},
+ fromJSON(object: any): ListRolloutsResponse {
+ return {
+ rollouts: globalThis.Array.isArray(object?.rollouts) ? object.rollouts.map((e: any) => Rollout.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListRolloutsResponse): unknown {
const obj: any = {};
if (message.rollouts?.length) {
@@ -1706,6 +1762,15 @@ export const CreateRolloutRequest: MessageFns<CreateRolloutRequest> = {
return message;
},
+ fromJSON(object: any): CreateRolloutRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ rollout: isSet(object.rollout) ? Rollout.fromJSON(object.rollout) : undefined,
+ target: isSet(object.target) ? globalThis.String(object.target) : undefined,
+ validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
+ };
+ },
+
toJSON(message: CreateRolloutRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1785,6 +1850,13 @@ export const PreviewRolloutRequest: MessageFns<PreviewRolloutRequest> = {
return message;
},
+ fromJSON(object: any): PreviewRolloutRequest {
+ return {
+ project: isSet(object.project) ? globalThis.String(object.project) : "",
+ plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined,
+ };
+ },
+
toJSON(message: PreviewRolloutRequest): unknown {
const obj: any = {};
if (message.project !== "") {
@@ -1865,6 +1937,14 @@ export const ListTaskRunsRequest: MessageFns<ListTaskRunsRequest> = {
return message;
},
+ fromJSON(object: any): ListTaskRunsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: ListTaskRunsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -1938,6 +2018,13 @@ export const ListTaskRunsResponse: MessageFns<ListTaskRunsResponse> = {
return message;
},
+ fromJSON(object: any): ListTaskRunsResponse {
+ return {
+ taskRuns: globalThis.Array.isArray(object?.taskRuns) ? object.taskRuns.map((e: any) => TaskRun.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListTaskRunsResponse): unknown {
const obj: any = {};
if (message.taskRuns?.length) {
@@ -1996,6 +2083,10 @@ export const GetTaskRunRequest: MessageFns<GetTaskRunRequest> = {
return message;
},
+ fromJSON(object: any): GetTaskRunRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetTaskRunRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2050,6 +2141,10 @@ export const GetTaskRunLogRequest: MessageFns<GetTaskRunLogRequest> = {
return message;
},
+ fromJSON(object: any): GetTaskRunLogRequest {
+ return { parent: isSet(object.parent) ? globalThis.String(object.parent) : "" };
+ },
+
toJSON(message: GetTaskRunLogRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -2170,6 +2265,18 @@ export const Rollout: MessageFns<Rollout> = {
return message;
},
+ fromJSON(object: any): Rollout {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ plan: isSet(object.plan) ? globalThis.String(object.plan) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ stages: globalThis.Array.isArray(object?.stages) ? object.stages.map((e: any) => Stage.fromJSON(e)) : [],
+ creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ issue: isSet(object.issue) ? globalThis.String(object.issue) : "",
+ };
+ },
+
toJSON(message: Rollout): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2283,6 +2390,15 @@ export const Stage: MessageFns<Stage> = {
return message;
},
+ fromJSON(object: any): Stage {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
+ tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => Task.fromJSON(e)) : [],
+ };
+ },
+
toJSON(message: Stage): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2459,6 +2575,27 @@ export const Task: MessageFns<Task> = {
return message;
},
+ fromJSON(object: any): Task {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ specId: isSet(object.specId) ? globalThis.String(object.specId) : "",
+ status: isSet(object.status) ? task_StatusFromJSON(object.status) : Task_Status.STATUS_UNSPECIFIED,
+ skippedReason: isSet(object.skippedReason) ? globalThis.String(object.skippedReason) : "",
+ type: isSet(object.type) ? task_TypeFromJSON(object.type) : Task_Type.TYPE_UNSPECIFIED,
+ target: isSet(object.target) ? globalThis.String(object.target) : "",
+ databaseCreate: isSet(object.databaseCreate) ? Task_DatabaseCreate.fromJSON(object.databaseCreate) : undefined,
+ databaseSchemaUpdate: isSet(object.databaseSchemaUpdate)
+ ? Task_DatabaseSchemaUpdate.fromJSON(object.databaseSchemaUpdate)
+ : undefined,
+ databaseDataUpdate: isSet(object.databaseDataUpdate)
+ ? Task_DatabaseDataUpdate.fromJSON(object.databaseDataUpdate)
+ : undefined,
+ databaseDataExport: isSet(object.databaseDataExport)
+ ? Task_DatabaseDataExport.fromJSON(object.databaseDataExport)
+ : undefined,
+ };
+ },
+
toJSON(message: Task): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2623,6 +2760,18 @@ export const Task_DatabaseCreate: MessageFns<Task_DatabaseCreate> = {
return message;
},
+ fromJSON(object: any): Task_DatabaseCreate {
+ return {
+ project: isSet(object.project) ? globalThis.String(object.project) : "",
+ database: isSet(object.database) ? globalThis.String(object.database) : "",
+ table: isSet(object.table) ? globalThis.String(object.table) : "",
+ sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
+ characterSet: isSet(object.characterSet) ? globalThis.String(object.characterSet) : "",
+ collation: isSet(object.collation) ? globalThis.String(object.collation) : "",
+ environment: isSet(object.environment) ? globalThis.String(object.environment) : "",
+ };
+ },
+
toJSON(message: Task_DatabaseCreate): unknown {
const obj: any = {};
if (message.project !== "") {
@@ -2712,6 +2861,13 @@ export const Task_DatabaseSchemaUpdate: MessageFns<Task_DatabaseSchemaUpdate> =
return message;
},
+ fromJSON(object: any): Task_DatabaseSchemaUpdate {
+ return {
+ sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
+ schemaVersion: isSet(object.schemaVersion) ? globalThis.String(object.schemaVersion) : "",
+ };
+ },
+
toJSON(message: Task_DatabaseSchemaUpdate): unknown {
const obj: any = {};
if (message.sheet !== "") {
@@ -2781,6 +2937,13 @@ export const Task_DatabaseDataUpdate: MessageFns<Task_DatabaseDataUpdate> = {
return message;
},
+ fromJSON(object: any): Task_DatabaseDataUpdate {
+ return {
+ sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
+ schemaVersion: isSet(object.schemaVersion) ? globalThis.String(object.schemaVersion) : "",
+ };
+ },
+
toJSON(message: Task_DatabaseDataUpdate): unknown {
const obj: any = {};
if (message.sheet !== "") {
@@ -2872,6 +3035,15 @@ export const Task_DatabaseDataExport: MessageFns<Task_DatabaseDataExport> = {
return message;
},
+ fromJSON(object: any): Task_DatabaseDataExport {
+ return {
+ target: isSet(object.target) ? globalThis.String(object.target) : "",
+ sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
+ format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,
+ password: isSet(object.password) ? globalThis.String(object.password) : undefined,
+ };
+ },
+
toJSON(message: Task_DatabaseDataExport): unknown {
const obj: any = {};
if (message.target !== "") {
@@ -3096,6 +3268,29 @@ export const TaskRun: MessageFns<TaskRun> = {
return message;
},
+ fromJSON(object: any): TaskRun {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
+ status: isSet(object.status) ? taskRun_StatusFromJSON(object.status) : TaskRun_Status.STATUS_UNSPECIFIED,
+ detail: isSet(object.detail) ? globalThis.String(object.detail) : "",
+ changelog: isSet(object.changelog) ? globalThis.String(object.changelog) : "",
+ schemaVersion: isSet(object.schemaVersion) ? globalThis.String(object.schemaVersion) : "",
+ startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined,
+ exportArchiveStatus: isSet(object.exportArchiveStatus)
+ ? taskRun_ExportArchiveStatusFromJSON(object.exportArchiveStatus)
+ : TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED,
+ priorBackupDetail: isSet(object.priorBackupDetail)
+ ? TaskRun_PriorBackupDetail.fromJSON(object.priorBackupDetail)
+ : undefined,
+ schedulerInfo: isSet(object.schedulerInfo) ? TaskRun_SchedulerInfo.fromJSON(object.schedulerInfo) : undefined,
+ sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
+ runTime: isSet(object.runTime) ? fromJsonTimestamp(object.runTime) : undefined,
+ };
+ },
+
toJSON(message: TaskRun): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -3215,6 +3410,14 @@ export const TaskRun_PriorBackupDetail: MessageFns<TaskRun_PriorBackupDetail> =
return message;
},
+ fromJSON(object: any): TaskRun_PriorBackupDetail {
+ return {
+ items: globalThis.Array.isArray(object?.items)
+ ? object.items.map((e: any) => TaskRun_PriorBackupDetail_Item.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: TaskRun_PriorBackupDetail): unknown {
const obj: any = {};
if (message.items?.length) {
@@ -3302,6 +3505,19 @@ export const TaskRun_PriorBackupDetail_Item: MessageFns<TaskRun_PriorBackupDetai
return message;
},
+ fromJSON(object: any): TaskRun_PriorBackupDetail_Item {
+ return {
+ sourceTable: isSet(object.sourceTable)
+ ? TaskRun_PriorBackupDetail_Item_Table.fromJSON(object.sourceTable)
+ : undefined,
+ targetTable: isSet(object.targetTable)
+ ? TaskRun_PriorBackupDetail_Item_Table.fromJSON(object.targetTable)
+ : undefined,
+ startPosition: isSet(object.startPosition) ? Position.fromJSON(object.startPosition) : undefined,
+ endPosition: isSet(object.endPosition) ? Position.fromJSON(object.endPosition) : undefined,
+ };
+ },
+
toJSON(message: TaskRun_PriorBackupDetail_Item): unknown {
const obj: any = {};
if (message.sourceTable !== undefined) {
@@ -3398,6 +3614,14 @@ export const TaskRun_PriorBackupDetail_Item_Table: MessageFns<TaskRun_PriorBacku
return message;
},
+ fromJSON(object: any): TaskRun_PriorBackupDetail_Item_Table {
+ return {
+ database: isSet(object.database) ? globalThis.String(object.database) : "",
+ schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
+ table: isSet(object.table) ? globalThis.String(object.table) : "",
+ };
+ },
+
toJSON(message: TaskRun_PriorBackupDetail_Item_Table): unknown {
const obj: any = {};
if (message.database !== "") {
@@ -3471,6 +3695,15 @@ export const TaskRun_SchedulerInfo: MessageFns<TaskRun_SchedulerInfo> = {
return message;
},
+ fromJSON(object: any): TaskRun_SchedulerInfo {
+ return {
+ reportTime: isSet(object.reportTime) ? fromJsonTimestamp(object.reportTime) : undefined,
+ waitingCause: isSet(object.waitingCause)
+ ? TaskRun_SchedulerInfo_WaitingCause.fromJSON(object.waitingCause)
+ : undefined,
+ };
+ },
+
toJSON(message: TaskRun_SchedulerInfo): unknown {
const obj: any = {};
if (message.reportTime !== undefined) {
@@ -3555,6 +3788,14 @@ export const TaskRun_SchedulerInfo_WaitingCause: MessageFns<TaskRun_SchedulerInf
return message;
},
+ fromJSON(object: any): TaskRun_SchedulerInfo_WaitingCause {
+ return {
+ connectionLimit: isSet(object.connectionLimit) ? globalThis.Boolean(object.connectionLimit) : undefined,
+ task: isSet(object.task) ? TaskRun_SchedulerInfo_WaitingCause_Task.fromJSON(object.task) : undefined,
+ parallelTasksLimit: isSet(object.parallelTasksLimit) ? globalThis.Boolean(object.parallelTasksLimit) : undefined,
+ };
+ },
+
toJSON(message: TaskRun_SchedulerInfo_WaitingCause): unknown {
const obj: any = {};
if (message.connectionLimit !== undefined) {
@@ -3630,6 +3871,13 @@ export const TaskRun_SchedulerInfo_WaitingCause_Task: MessageFns<TaskRun_Schedul
return message;
},
+ fromJSON(object: any): TaskRun_SchedulerInfo_WaitingCause_Task {
+ return {
+ task: isSet(object.task) ? globalThis.String(object.task) : "",
+ issue: isSet(object.issue) ? globalThis.String(object.issue) : "",
+ };
+ },
+
toJSON(message: TaskRun_SchedulerInfo_WaitingCause_Task): unknown {
const obj: any = {};
if (message.task !== "") {
@@ -3699,6 +3947,15 @@ export const TaskRunLog: MessageFns<TaskRunLog> = {
return message;
},
+ fromJSON(object: any): TaskRunLog {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ entries: globalThis.Array.isArray(object?.entries)
+ ? object.entries.map((e: any) => TaskRunLogEntry.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: TaskRunLog): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -3867,6 +4124,27 @@ export const TaskRunLogEntry: MessageFns<TaskRunLogEntry> = {
return message;
},
+ fromJSON(object: any): TaskRunLogEntry {
+ return {
+ type: isSet(object.type) ? taskRunLogEntry_TypeFromJSON(object.type) : TaskRunLogEntry_Type.TYPE_UNSPECIFIED,
+ logTime: isSet(object.logTime) ? fromJsonTimestamp(object.logTime) : undefined,
+ deployId: isSet(object.deployId) ? globalThis.String(object.deployId) : "",
+ schemaDump: isSet(object.schemaDump) ? TaskRunLogEntry_SchemaDump.fromJSON(object.schemaDump) : undefined,
+ commandExecute: isSet(object.commandExecute)
+ ? TaskRunLogEntry_CommandExecute.fromJSON(object.commandExecute)
+ : undefined,
+ databaseSync: isSet(object.databaseSync) ? TaskRunLogEntry_DatabaseSync.fromJSON(object.databaseSync) : undefined,
+ taskRunStatusUpdate: isSet(object.taskRunStatusUpdate)
+ ? TaskRunLogEntry_TaskRunStatusUpdate.fromJSON(object.taskRunStatusUpdate)
+ : undefined,
+ transactionControl: isSet(object.transactionControl)
+ ? TaskRunLogEntry_TransactionControl.fromJSON(object.transactionControl)
+ : undefined,
+ priorBackup: isSet(object.priorBackup) ? TaskRunLogEntry_PriorBackup.fromJSON(object.priorBackup) : undefined,
+ retryInfo: isSet(object.retryInfo) ? TaskRunLogEntry_RetryInfo.fromJSON(object.retryInfo) : undefined,
+ };
+ },
+
toJSON(message: TaskRunLogEntry): unknown {
const obj: any = {};
if (message.type !== TaskRunLogEntry_Type.TYPE_UNSPECIFIED) {
@@ -3995,6 +4273,14 @@ export const TaskRunLogEntry_SchemaDump: MessageFns<TaskRunLogEntry_SchemaDump>
return message;
},
+ fromJSON(object: any): TaskRunLogEntry_SchemaDump {
+ return {
+ startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined,
+ endTime: isSet(object.endTime) ? fromJsonTimestamp(object.endTime) : undefined,
+ error: isSet(object.error) ? globalThis.String(object.error) : "",
+ };
+ },
+
toJSON(message: TaskRunLogEntry_SchemaDump): unknown {
const obj: any = {};
if (message.startTime !== undefined) {
@@ -4095,6 +4381,18 @@ export const TaskRunLogEntry_CommandExecute: MessageFns<TaskRunLogEntry_CommandE
return message;
},
+ fromJSON(object: any): TaskRunLogEntry_CommandExecute {
+ return {
+ logTime: isSet(object.logTime) ? fromJsonTimestamp(object.logTime) : undefined,
+ commandIndexes: globalThis.Array.isArray(object?.commandIndexes)
+ ? object.commandIndexes.map((e: any) => globalThis.Number(e))
+ : [],
+ response: isSet(object.response)
+ ? TaskRunLogEntry_CommandExecute_CommandResponse.fromJSON(object.response)
+ : undefined,
+ };
+ },
+
toJSON(message: TaskRunLogEntry_CommandExecute): unknown {
const obj: any = {};
if (message.logTime !== undefined) {
@@ -4211,6 +4509,17 @@ export const TaskRunLogEntry_CommandExecute_CommandResponse: MessageFns<
return message;
},
+ fromJSON(object: any): TaskRunLogEntry_CommandExecute_CommandResponse {
+ return {
+ logTime: isSet(object.logTime) ? fromJsonTimestamp(object.logTime) : undefined,
+ error: isSet(object.error) ? globalThis.String(object.error) : "",
+ affectedRows: isSet(object.affectedRows) ? globalThis.Number(object.affectedRows) : 0,
+ allAffectedRows: globalThis.Array.isArray(object?.allAffectedRows)
+ ? object.allAffectedRows.map((e: any) => globalThis.Number(e))
+ : [],
+ };
+ },
+
toJSON(message: TaskRunLogEntry_CommandExecute_CommandResponse): unknown {
const obj: any = {};
if (message.logTime !== undefined) {
@@ -4305,6 +4614,14 @@ export const TaskRunLogEntry_DatabaseSync: MessageFns<TaskRunLogEntry_DatabaseSy
return message;
},
+ fromJSON(object: any): TaskRunLogEntry_DatabaseSync {
+ return {
+ startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined,
+ endTime: isSet(object.endTime) ? fromJsonTimestamp(object.endTime) : undefined,
+ error: isSet(object.error) ? globalThis.String(object.error) : "",
+ };
+ },
+
toJSON(message: TaskRunLogEntry_DatabaseSync): unknown {
const obj: any = {};
if (message.startTime !== undefined) {
@@ -4371,6 +4688,14 @@ export const TaskRunLogEntry_TaskRunStatusUpdate: MessageFns<TaskRunLogEntry_Tas
return message;
},
+ fromJSON(object: any): TaskRunLogEntry_TaskRunStatusUpdate {
+ return {
+ status: isSet(object.status)
+ ? taskRunLogEntry_TaskRunStatusUpdate_StatusFromJSON(object.status)
+ : TaskRunLogEntry_TaskRunStatusUpdate_Status.STATUS_UNSPECIFIED,
+ };
+ },
+
toJSON(message: TaskRunLogEntry_TaskRunStatusUpdate): unknown {
const obj: any = {};
if (message.status !== TaskRunLogEntry_TaskRunStatusUpdate_Status.STATUS_UNSPECIFIED) {
@@ -4436,6 +4761,15 @@ export const TaskRunLogEntry_TransactionControl: MessageFns<TaskRunLogEntry_Tran
return message;
},
+ fromJSON(object: any): TaskRunLogEntry_TransactionControl {
+ return {
+ type: isSet(object.type)
+ ? taskRunLogEntry_TransactionControl_TypeFromJSON(object.type)
+ : TaskRunLogEntry_TransactionControl_Type.TYPE_UNSPECIFIED,
+ error: isSet(object.error) ? globalThis.String(object.error) : "",
+ };
+ },
+
toJSON(message: TaskRunLogEntry_TransactionControl): unknown {
const obj: any = {};
if (message.type !== TaskRunLogEntry_TransactionControl_Type.TYPE_UNSPECIFIED) {
@@ -4527,6 +4861,17 @@ export const TaskRunLogEntry_PriorBackup: MessageFns<TaskRunLogEntry_PriorBackup
return message;
},
+ fromJSON(object: any): TaskRunLogEntry_PriorBackup {
+ return {
+ startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined,
+ endTime: isSet(object.endTime) ? fromJsonTimestamp(object.endTime) : undefined,
+ priorBackupDetail: isSet(object.priorBackupDetail)
+ ? TaskRun_PriorBackupDetail.fromJSON(object.priorBackupDetail)
+ : undefined,
+ error: isSet(object.error) ? globalThis.String(object.error) : "",
+ };
+ },
+
toJSON(message: TaskRunLogEntry_PriorBackup): unknown {
const obj: any = {};
if (message.startTime !== undefined) {
@@ -4621,6 +4966,14 @@ export const TaskRunLogEntry_RetryInfo: MessageFns<TaskRunLogEntry_RetryInfo> =
return message;
},
+ fromJSON(object: any): TaskRunLogEntry_RetryInfo {
+ return {
+ error: isSet(object.error) ? globalThis.String(object.error) : "",
+ retryCount: isSet(object.retryCount) ? globalThis.Number(object.retryCount) : 0,
+ maximumRetries: isSet(object.maximumRetries) ? globalThis.Number(object.maximumRetries) : 0,
+ };
+ },
+
toJSON(message: TaskRunLogEntry_RetryInfo): unknown {
const obj: any = {};
if (message.error !== "") {
@@ -4683,6 +5036,10 @@ export const GetTaskRunSessionRequest: MessageFns<GetTaskRunSessionRequest> = {
return message;
},
+ fromJSON(object: any): GetTaskRunSessionRequest {
+ return { parent: isSet(object.parent) ? globalThis.String(object.parent) : "" };
+ },
+
toJSON(message: GetTaskRunSessionRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -4748,6 +5105,13 @@ export const TaskRunSession: MessageFns<TaskRunSession> = {
return message;
},
+ fromJSON(object: any): TaskRunSession {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ postgres: isSet(object.postgres) ? TaskRunSession_Postgres.fromJSON(object.postgres) : undefined,
+ };
+ },
+
toJSON(message: TaskRunSession): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -4830,6 +5194,18 @@ export const TaskRunSession_Postgres: MessageFns<TaskRunSession_Postgres> = {
return message;
},
+ fromJSON(object: any): TaskRunSession_Postgres {
+ return {
+ session: isSet(object.session) ? TaskRunSession_Postgres_Session.fromJSON(object.session) : undefined,
+ blockingSessions: globalThis.Array.isArray(object?.blockingSessions)
+ ? object.blockingSessions.map((e: any) => TaskRunSession_Postgres_Session.fromJSON(e))
+ : [],
+ blockedSessions: globalThis.Array.isArray(object?.blockedSessions)
+ ? object.blockedSessions.map((e: any) => TaskRunSession_Postgres_Session.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: TaskRunSession_Postgres): unknown {
const obj: any = {};
if (message.session !== undefined) {
@@ -5053,6 +5429,27 @@ export const TaskRunSession_Postgres_Session: MessageFns<TaskRunSession_Postgres
return message;
},
+ fromJSON(object: any): TaskRunSession_Postgres_Session {
+ return {
+ pid: isSet(object.pid) ? globalThis.String(object.pid) : "",
+ blockedByPids: globalThis.Array.isArray(object?.blockedByPids)
+ ? object.blockedByPids.map((e: any) => globalThis.String(e))
+ : [],
+ query: isSet(object.query) ? globalThis.String(object.query) : "",
+ state: isSet(object.state) ? globalThis.String(object.state) : undefined,
+ waitEventType: isSet(object.waitEventType) ? globalThis.String(object.waitEventType) : undefined,
+ waitEvent: isSet(object.waitEvent) ? globalThis.String(object.waitEvent) : undefined,
+ datname: isSet(object.datname) ? globalThis.String(object.datname) : undefined,
+ usename: isSet(object.usename) ? globalThis.String(object.usename) : undefined,
+ applicationName: isSet(object.applicationName) ? globalThis.String(object.applicationName) : "",
+ clientAddr: isSet(object.clientAddr) ? globalThis.String(object.clientAddr) : undefined,
+ clientPort: isSet(object.clientPort) ? globalThis.String(object.clientPort) : undefined,
+ backendStart: isSet(object.backendStart) ? fromJsonTimestamp(object.backendStart) : undefined,
+ xactStart: isSet(object.xactStart) ? fromJsonTimestamp(object.xactStart) : undefined,
+ queryStart: isSet(object.queryStart) ? fromJsonTimestamp(object.queryStart) : undefined,
+ };
+ },
+
toJSON(message: TaskRunSession_Postgres_Session): unknown {
const obj: any = {};
if (message.pid !== "") {
@@ -5165,6 +5562,10 @@ export const PreviewTaskRunRollbackRequest: MessageFns<PreviewTaskRunRollbackReq
return message;
},
+ fromJSON(object: any): PreviewTaskRunRollbackRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: PreviewTaskRunRollbackRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -5219,6 +5620,10 @@ export const PreviewTaskRunRollbackResponse: MessageFns<PreviewTaskRunRollbackRe
return message;
},
+ fromJSON(object: any): PreviewTaskRunRollbackResponse {
+ return { statement: isSet(object.statement) ? globalThis.String(object.statement) : "" };
+ },
+
toJSON(message: PreviewTaskRunRollbackResponse): unknown {
const obj: any = {};
if (message.statement !== "") {
@@ -6223,15 +6628,40 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/setting_service.ts b/frontend/src/types/proto/v1/setting_service.ts
index 0e124dfca7..d34c76c51a 100644
--- a/frontend/src/types/proto/v1/setting_service.ts
+++ b/frontend/src/types/proto/v1/setting_service.ts
@@ -1066,6 +1066,13 @@ export const ListSettingsRequest: MessageFns<ListSettingsRequest> = {
return message;
},
+ fromJSON(object: any): ListSettingsRequest {
+ return {
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: ListSettingsRequest): unknown {
const obj: any = {};
if (message.pageSize !== 0) {
@@ -1135,6 +1142,13 @@ export const ListSettingsResponse: MessageFns<ListSettingsResponse> = {
return message;
},
+ fromJSON(object: any): ListSettingsResponse {
+ return {
+ settings: globalThis.Array.isArray(object?.settings) ? object.settings.map((e: any) => Setting.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListSettingsResponse): unknown {
const obj: any = {};
if (message.settings?.length) {
@@ -1193,6 +1207,10 @@ export const GetSettingRequest: MessageFns<GetSettingRequest> = {
return message;
},
+ fromJSON(object: any): GetSettingRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetSettingRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1247,6 +1265,10 @@ export const GetSettingResponse: MessageFns<GetSettingResponse> = {
return message;
},
+ fromJSON(object: any): GetSettingResponse {
+ return { setting: isSet(object.setting) ? Setting.fromJSON(object.setting) : undefined };
+ },
+
toJSON(message: GetSettingResponse): unknown {
const obj: any = {};
if (message.setting !== undefined) {
@@ -1336,6 +1358,15 @@ export const UpdateSettingRequest: MessageFns<UpdateSettingRequest> = {
return message;
},
+ fromJSON(object: any): UpdateSettingRequest {
+ return {
+ setting: isSet(object.setting) ? Setting.fromJSON(object.setting) : undefined,
+ validateOnly: isSet(object.validateOnly) ? globalThis.Boolean(object.validateOnly) : false,
+ allowMissing: isSet(object.allowMissing) ? globalThis.Boolean(object.allowMissing) : false,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateSettingRequest): unknown {
const obj: any = {};
if (message.setting !== undefined) {
@@ -1415,6 +1446,13 @@ export const Setting: MessageFns<Setting> = {
return message;
},
+ fromJSON(object: any): Setting {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ value: isSet(object.value) ? Value.fromJSON(object.value) : undefined,
+ };
+ },
+
toJSON(message: Setting): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1643,6 +1681,48 @@ export const Value: MessageFns<Value> = {
return message;
},
+ fromJSON(object: any): Value {
+ return {
+ stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined,
+ smtpMailDeliverySettingValue: isSet(object.smtpMailDeliverySettingValue)
+ ? SMTPMailDeliverySettingValue.fromJSON(object.smtpMailDeliverySettingValue)
+ : undefined,
+ appImSettingValue: isSet(object.appImSettingValue) ? AppIMSetting.fromJSON(object.appImSettingValue) : undefined,
+ agentPluginSettingValue: isSet(object.agentPluginSettingValue)
+ ? AgentPluginSetting.fromJSON(object.agentPluginSettingValue)
+ : undefined,
+ workspaceProfileSettingValue: isSet(object.workspaceProfileSettingValue)
+ ? WorkspaceProfileSetting.fromJSON(object.workspaceProfileSettingValue)
+ : undefined,
+ workspaceApprovalSettingValue: isSet(object.workspaceApprovalSettingValue)
+ ? WorkspaceApprovalSetting.fromJSON(object.workspaceApprovalSettingValue)
+ : undefined,
+ workspaceTrialSettingValue: isSet(object.workspaceTrialSettingValue)
+ ? WorkspaceTrialSetting.fromJSON(object.workspaceTrialSettingValue)
+ : undefined,
+ schemaTemplateSettingValue: isSet(object.schemaTemplateSettingValue)
+ ? SchemaTemplateSetting.fromJSON(object.schemaTemplateSettingValue)
+ : undefined,
+ dataClassificationSettingValue: isSet(object.dataClassificationSettingValue)
+ ? DataClassificationSetting.fromJSON(object.dataClassificationSettingValue)
+ : undefined,
+ semanticTypeSettingValue: isSet(object.semanticTypeSettingValue)
+ ? SemanticTypeSetting.fromJSON(object.semanticTypeSettingValue)
+ : undefined,
+ maximumSqlResultSizeSetting: isSet(object.maximumSqlResultSizeSetting)
+ ? MaximumSQLResultSizeSetting.fromJSON(object.maximumSqlResultSizeSetting)
+ : undefined,
+ scimSetting: isSet(object.scimSetting) ? SCIMSetting.fromJSON(object.scimSetting) : undefined,
+ passwordRestrictionSetting: isSet(object.passwordRestrictionSetting)
+ ? PasswordRestrictionSetting.fromJSON(object.passwordRestrictionSetting)
+ : undefined,
+ aiSetting: isSet(object.aiSetting) ? AISetting.fromJSON(object.aiSetting) : undefined,
+ environmentSetting: isSet(object.environmentSetting)
+ ? EnvironmentSetting.fromJSON(object.environmentSetting)
+ : undefined,
+ };
+ },
+
toJSON(message: Value): unknown {
const obj: any = {};
if (message.stringValue !== undefined) {
@@ -1913,6 +1993,26 @@ export const SMTPMailDeliverySettingValue: MessageFns<SMTPMailDeliverySettingVal
return message;
},
+ fromJSON(object: any): SMTPMailDeliverySettingValue {
+ return {
+ server: isSet(object.server) ? globalThis.String(object.server) : "",
+ port: isSet(object.port) ? globalThis.Number(object.port) : 0,
+ encryption: isSet(object.encryption)
+ ? sMTPMailDeliverySettingValue_EncryptionFromJSON(object.encryption)
+ : SMTPMailDeliverySettingValue_Encryption.ENCRYPTION_UNSPECIFIED,
+ ca: isSet(object.ca) ? globalThis.String(object.ca) : undefined,
+ key: isSet(object.key) ? globalThis.String(object.key) : undefined,
+ cert: isSet(object.cert) ? globalThis.String(object.cert) : undefined,
+ authentication: isSet(object.authentication)
+ ? sMTPMailDeliverySettingValue_AuthenticationFromJSON(object.authentication)
+ : SMTPMailDeliverySettingValue_Authentication.AUTHENTICATION_UNSPECIFIED,
+ username: isSet(object.username) ? globalThis.String(object.username) : "",
+ password: isSet(object.password) ? globalThis.String(object.password) : undefined,
+ from: isSet(object.from) ? globalThis.String(object.from) : "",
+ to: isSet(object.to) ? globalThis.String(object.to) : "",
+ };
+ },
+
toJSON(message: SMTPMailDeliverySettingValue): unknown {
const obj: any = {};
if (message.server !== "") {
@@ -2052,6 +2152,16 @@ export const AppIMSetting: MessageFns<AppIMSetting> = {
return message;
},
+ fromJSON(object: any): AppIMSetting {
+ return {
+ slack: isSet(object.slack) ? AppIMSetting_Slack.fromJSON(object.slack) : undefined,
+ feishu: isSet(object.feishu) ? AppIMSetting_Feishu.fromJSON(object.feishu) : undefined,
+ wecom: isSet(object.wecom) ? AppIMSetting_Wecom.fromJSON(object.wecom) : undefined,
+ lark: isSet(object.lark) ? AppIMSetting_Lark.fromJSON(object.lark) : undefined,
+ dingtalk: isSet(object.dingtalk) ? AppIMSetting_DingTalk.fromJSON(object.dingtalk) : undefined,
+ };
+ },
+
toJSON(message: AppIMSetting): unknown {
const obj: any = {};
if (message.slack !== undefined) {
@@ -2143,6 +2253,13 @@ export const AppIMSetting_Slack: MessageFns<AppIMSetting_Slack> = {
return message;
},
+ fromJSON(object: any): AppIMSetting_Slack {
+ return {
+ enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
+ token: isSet(object.token) ? globalThis.String(object.token) : "",
+ };
+ },
+
toJSON(message: AppIMSetting_Slack): unknown {
const obj: any = {};
if (message.enabled !== false) {
@@ -2223,6 +2340,14 @@ export const AppIMSetting_Feishu: MessageFns<AppIMSetting_Feishu> = {
return message;
},
+ fromJSON(object: any): AppIMSetting_Feishu {
+ return {
+ enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
+ appId: isSet(object.appId) ? globalThis.String(object.appId) : "",
+ appSecret: isSet(object.appSecret) ? globalThis.String(object.appSecret) : "",
+ };
+ },
+
toJSON(message: AppIMSetting_Feishu): unknown {
const obj: any = {};
if (message.enabled !== false) {
@@ -2318,6 +2443,15 @@ export const AppIMSetting_Wecom: MessageFns<AppIMSetting_Wecom> = {
return message;
},
+ fromJSON(object: any): AppIMSetting_Wecom {
+ return {
+ enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
+ corpId: isSet(object.corpId) ? globalThis.String(object.corpId) : "",
+ agentId: isSet(object.agentId) ? globalThis.String(object.agentId) : "",
+ secret: isSet(object.secret) ? globalThis.String(object.secret) : "",
+ };
+ },
+
toJSON(message: AppIMSetting_Wecom): unknown {
const obj: any = {};
if (message.enabled !== false) {
@@ -2406,6 +2540,14 @@ export const AppIMSetting_Lark: MessageFns<AppIMSetting_Lark> = {
return message;
},
+ fromJSON(object: any): AppIMSetting_Lark {
+ return {
+ enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
+ appId: isSet(object.appId) ? globalThis.String(object.appId) : "",
+ appSecret: isSet(object.appSecret) ? globalThis.String(object.appSecret) : "",
+ };
+ },
+
toJSON(message: AppIMSetting_Lark): unknown {
const obj: any = {};
if (message.enabled !== false) {
@@ -2501,6 +2643,15 @@ export const AppIMSetting_DingTalk: MessageFns<AppIMSetting_DingTalk> = {
return message;
},
+ fromJSON(object: any): AppIMSetting_DingTalk {
+ return {
+ enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
+ clientId: isSet(object.clientId) ? globalThis.String(object.clientId) : "",
+ clientSecret: isSet(object.clientSecret) ? globalThis.String(object.clientSecret) : "",
+ robotCode: isSet(object.robotCode) ? globalThis.String(object.robotCode) : "",
+ };
+ },
+
toJSON(message: AppIMSetting_DingTalk): unknown {
const obj: any = {};
if (message.enabled !== false) {
@@ -2578,6 +2729,13 @@ export const AgentPluginSetting: MessageFns<AgentPluginSetting> = {
return message;
},
+ fromJSON(object: any): AgentPluginSetting {
+ return {
+ url: isSet(object.url) ? globalThis.String(object.url) : "",
+ token: isSet(object.token) ? globalThis.String(object.token) : "",
+ };
+ },
+
toJSON(message: AgentPluginSetting): unknown {
const obj: any = {};
if (message.url !== "") {
@@ -2758,6 +2916,32 @@ export const WorkspaceProfileSetting: MessageFns<WorkspaceProfileSetting> = {
return message;
},
+ fromJSON(object: any): WorkspaceProfileSetting {
+ return {
+ externalUrl: isSet(object.externalUrl) ? globalThis.String(object.externalUrl) : "",
+ disallowSignup: isSet(object.disallowSignup) ? globalThis.Boolean(object.disallowSignup) : false,
+ require2fa: isSet(object.require2fa) ? globalThis.Boolean(object.require2fa) : false,
+ outboundIpList: globalThis.Array.isArray(object?.outboundIpList)
+ ? object.outboundIpList.map((e: any) => globalThis.String(e))
+ : [],
+ tokenDuration: isSet(object.tokenDuration) ? Duration.fromJSON(object.tokenDuration) : undefined,
+ announcement: isSet(object.announcement) ? Announcement.fromJSON(object.announcement) : undefined,
+ maximumRoleExpiration: isSet(object.maximumRoleExpiration)
+ ? Duration.fromJSON(object.maximumRoleExpiration)
+ : undefined,
+ domains: globalThis.Array.isArray(object?.domains) ? object.domains.map((e: any) => globalThis.String(e)) : [],
+ enforceIdentityDomain: isSet(object.enforceIdentityDomain)
+ ? globalThis.Boolean(object.enforceIdentityDomain)
+ : false,
+ databaseChangeMode: isSet(object.databaseChangeMode)
+ ? databaseChangeModeFromJSON(object.databaseChangeMode)
+ : DatabaseChangeMode.DATABASE_CHANGE_MODE_UNSPECIFIED,
+ disallowPasswordSignin: isSet(object.disallowPasswordSignin)
+ ? globalThis.Boolean(object.disallowPasswordSignin)
+ : false,
+ };
+ },
+
toJSON(message: WorkspaceProfileSetting): unknown {
const obj: any = {};
if (message.externalUrl !== "") {
@@ -2881,6 +3065,16 @@ export const Announcement: MessageFns<Announcement> = {
return message;
},
+ fromJSON(object: any): Announcement {
+ return {
+ level: isSet(object.level)
+ ? announcement_AlertLevelFromJSON(object.level)
+ : Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED,
+ text: isSet(object.text) ? globalThis.String(object.text) : "",
+ link: isSet(object.link) ? globalThis.String(object.link) : "",
+ };
+ },
+
toJSON(message: Announcement): unknown {
const obj: any = {};
if (message.level !== Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED) {
@@ -2943,6 +3137,14 @@ export const WorkspaceApprovalSetting: MessageFns<WorkspaceApprovalSetting> = {
return message;
},
+ fromJSON(object: any): WorkspaceApprovalSetting {
+ return {
+ rules: globalThis.Array.isArray(object?.rules)
+ ? object.rules.map((e: any) => WorkspaceApprovalSetting_Rule.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: WorkspaceApprovalSetting): unknown {
const obj: any = {};
if (message.rules?.length) {
@@ -3008,6 +3210,13 @@ export const WorkspaceApprovalSetting_Rule: MessageFns<WorkspaceApprovalSetting_
return message;
},
+ fromJSON(object: any): WorkspaceApprovalSetting_Rule {
+ return {
+ template: isSet(object.template) ? ApprovalTemplate.fromJSON(object.template) : undefined,
+ condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
+ };
+ },
+
toJSON(message: WorkspaceApprovalSetting_Rule): unknown {
const obj: any = {};
if (message.template !== undefined) {
@@ -3092,6 +3301,20 @@ export const SchemaTemplateSetting: MessageFns<SchemaTemplateSetting> = {
return message;
},
+ fromJSON(object: any): SchemaTemplateSetting {
+ return {
+ fieldTemplates: globalThis.Array.isArray(object?.fieldTemplates)
+ ? object.fieldTemplates.map((e: any) => SchemaTemplateSetting_FieldTemplate.fromJSON(e))
+ : [],
+ columnTypes: globalThis.Array.isArray(object?.columnTypes)
+ ? object.columnTypes.map((e: any) => SchemaTemplateSetting_ColumnType.fromJSON(e))
+ : [],
+ tableTemplates: globalThis.Array.isArray(object?.tableTemplates)
+ ? object.tableTemplates.map((e: any) => SchemaTemplateSetting_TableTemplate.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: SchemaTemplateSetting): unknown {
const obj: any = {};
if (message.fieldTemplates?.length) {
@@ -3200,6 +3423,16 @@ export const SchemaTemplateSetting_FieldTemplate: MessageFns<SchemaTemplateSetti
return message;
},
+ fromJSON(object: any): SchemaTemplateSetting_FieldTemplate {
+ return {
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
+ category: isSet(object.category) ? globalThis.String(object.category) : "",
+ column: isSet(object.column) ? ColumnMetadata.fromJSON(object.column) : undefined,
+ catalog: isSet(object.catalog) ? ColumnCatalog.fromJSON(object.catalog) : undefined,
+ };
+ },
+
toJSON(message: SchemaTemplateSetting_FieldTemplate): unknown {
const obj: any = {};
if (message.id !== "") {
@@ -3296,6 +3529,14 @@ export const SchemaTemplateSetting_ColumnType: MessageFns<SchemaTemplateSetting_
return message;
},
+ fromJSON(object: any): SchemaTemplateSetting_ColumnType {
+ return {
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
+ enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
+ types: globalThis.Array.isArray(object?.types) ? object.types.map((e: any) => globalThis.String(e)) : [],
+ };
+ },
+
toJSON(message: SchemaTemplateSetting_ColumnType): unknown {
const obj: any = {};
if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
@@ -3402,6 +3643,16 @@ export const SchemaTemplateSetting_TableTemplate: MessageFns<SchemaTemplateSetti
return message;
},
+ fromJSON(object: any): SchemaTemplateSetting_TableTemplate {
+ return {
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
+ category: isSet(object.category) ? globalThis.String(object.category) : "",
+ table: isSet(object.table) ? TableMetadata.fromJSON(object.table) : undefined,
+ catalog: isSet(object.catalog) ? TableCatalog.fromJSON(object.catalog) : undefined,
+ };
+ },
+
toJSON(message: SchemaTemplateSetting_TableTemplate): unknown {
const obj: any = {};
if (message.id !== "") {
@@ -3538,6 +3789,17 @@ export const WorkspaceTrialSetting: MessageFns<WorkspaceTrialSetting> = {
return message;
},
+ fromJSON(object: any): WorkspaceTrialSetting {
+ return {
+ instanceCount: isSet(object.instanceCount) ? globalThis.Number(object.instanceCount) : 0,
+ expireTime: isSet(object.expireTime) ? fromJsonTimestamp(object.expireTime) : undefined,
+ issuedTime: isSet(object.issuedTime) ? fromJsonTimestamp(object.issuedTime) : undefined,
+ subject: isSet(object.subject) ? globalThis.String(object.subject) : "",
+ orgName: isSet(object.orgName) ? globalThis.String(object.orgName) : "",
+ plan: isSet(object.plan) ? planTypeFromJSON(object.plan) : PlanType.PLAN_TYPE_UNSPECIFIED,
+ };
+ },
+
toJSON(message: WorkspaceTrialSetting): unknown {
const obj: any = {};
if (message.instanceCount !== 0) {
@@ -3616,6 +3878,14 @@ export const DataClassificationSetting: MessageFns<DataClassificationSetting> =
return message;
},
+ fromJSON(object: any): DataClassificationSetting {
+ return {
+ configs: globalThis.Array.isArray(object?.configs)
+ ? object.configs.map((e: any) => DataClassificationSetting_DataClassificationConfig.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: DataClassificationSetting): unknown {
const obj: any = {};
if (message.configs?.length) {
@@ -3729,6 +3999,27 @@ export const DataClassificationSetting_DataClassificationConfig: MessageFns<
return message;
},
+ fromJSON(object: any): DataClassificationSetting_DataClassificationConfig {
+ return {
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ levels: globalThis.Array.isArray(object?.levels)
+ ? object.levels.map((e: any) => DataClassificationSetting_DataClassificationConfig_Level.fromJSON(e))
+ : [],
+ classification: isObject(object.classification)
+ ? Object.entries(object.classification).reduce<
+ { [key: string]: DataClassificationSetting_DataClassificationConfig_DataClassification }
+ >((acc, [key, value]) => {
+ acc[key] = DataClassificationSetting_DataClassificationConfig_DataClassification.fromJSON(value);
+ return acc;
+ }, {})
+ : {},
+ classificationFromConfig: isSet(object.classificationFromConfig)
+ ? globalThis.Boolean(object.classificationFromConfig)
+ : false,
+ };
+ },
+
toJSON(message: DataClassificationSetting_DataClassificationConfig): unknown {
const obj: any = {};
if (message.id !== "") {
@@ -3844,6 +4135,14 @@ export const DataClassificationSetting_DataClassificationConfig_Level: MessageFn
return message;
},
+ fromJSON(object: any): DataClassificationSetting_DataClassificationConfig_Level {
+ return {
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
+ };
+ },
+
toJSON(message: DataClassificationSetting_DataClassificationConfig_Level): unknown {
const obj: any = {};
if (message.id !== "") {
@@ -3951,6 +4250,15 @@ export const DataClassificationSetting_DataClassificationConfig_DataClassificati
return message;
},
+ fromJSON(object: any): DataClassificationSetting_DataClassificationConfig_DataClassification {
+ return {
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
+ levelId: isSet(object.levelId) ? globalThis.String(object.levelId) : undefined,
+ };
+ },
+
toJSON(message: DataClassificationSetting_DataClassificationConfig_DataClassification): unknown {
const obj: any = {};
if (message.id !== "") {
@@ -4046,6 +4354,15 @@ export const DataClassificationSetting_DataClassificationConfig_ClassificationEn
return message;
},
+ fromJSON(object: any): DataClassificationSetting_DataClassificationConfig_ClassificationEntry {
+ return {
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
+ value: isSet(object.value)
+ ? DataClassificationSetting_DataClassificationConfig_DataClassification.fromJSON(object.value)
+ : undefined,
+ };
+ },
+
toJSON(message: DataClassificationSetting_DataClassificationConfig_ClassificationEntry): unknown {
const obj: any = {};
if (message.key !== "") {
@@ -4110,6 +4427,14 @@ export const SemanticTypeSetting: MessageFns<SemanticTypeSetting> = {
return message;
},
+ fromJSON(object: any): SemanticTypeSetting {
+ return {
+ types: globalThis.Array.isArray(object?.types)
+ ? object.types.map((e: any) => SemanticTypeSetting_SemanticType.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: SemanticTypeSetting): unknown {
const obj: any = {};
if (message.types?.length) {
@@ -4197,6 +4522,15 @@ export const SemanticTypeSetting_SemanticType: MessageFns<SemanticTypeSetting_Se
return message;
},
+ fromJSON(object: any): SemanticTypeSetting_SemanticType {
+ return {
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
+ algorithm: isSet(object.algorithm) ? Algorithm.fromJSON(object.algorithm) : undefined,
+ };
+ },
+
toJSON(message: SemanticTypeSetting_SemanticType): unknown {
const obj: any = {};
if (message.id !== "") {
@@ -4298,6 +4632,17 @@ export const Algorithm: MessageFns<Algorithm> = {
return message;
},
+ fromJSON(object: any): Algorithm {
+ return {
+ fullMask: isSet(object.fullMask) ? Algorithm_FullMask.fromJSON(object.fullMask) : undefined,
+ rangeMask: isSet(object.rangeMask) ? Algorithm_RangeMask.fromJSON(object.rangeMask) : undefined,
+ md5Mask: isSet(object.md5Mask) ? Algorithm_MD5Mask.fromJSON(object.md5Mask) : undefined,
+ innerOuterMask: isSet(object.innerOuterMask)
+ ? Algorithm_InnerOuterMask.fromJSON(object.innerOuterMask)
+ : undefined,
+ };
+ },
+
toJSON(message: Algorithm): unknown {
const obj: any = {};
if (message.fullMask !== undefined) {
@@ -4372,6 +4717,10 @@ export const Algorithm_FullMask: MessageFns<Algorithm_FullMask> = {
return message;
},
+ fromJSON(object: any): Algorithm_FullMask {
+ return { substitution: isSet(object.substitution) ? globalThis.String(object.substitution) : "" };
+ },
+
toJSON(message: Algorithm_FullMask): unknown {
const obj: any = {};
if (message.substitution !== "") {
@@ -4426,6 +4775,14 @@ export const Algorithm_RangeMask: MessageFns<Algorithm_RangeMask> = {
return message;
},
+ fromJSON(object: any): Algorithm_RangeMask {
+ return {
+ slices: globalThis.Array.isArray(object?.slices)
+ ? object.slices.map((e: any) => Algorithm_RangeMask_Slice.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: Algorithm_RangeMask): unknown {
const obj: any = {};
if (message.slices?.length) {
@@ -4502,6 +4859,14 @@ export const Algorithm_RangeMask_Slice: MessageFns<Algorithm_RangeMask_Slice> =
return message;
},
+ fromJSON(object: any): Algorithm_RangeMask_Slice {
+ return {
+ start: isSet(object.start) ? globalThis.Number(object.start) : 0,
+ end: isSet(object.end) ? globalThis.Number(object.end) : 0,
+ substitution: isSet(object.substitution) ? globalThis.String(object.substitution) : "",
+ };
+ },
+
toJSON(message: Algorithm_RangeMask_Slice): unknown {
const obj: any = {};
if (message.start !== 0) {
@@ -4564,6 +4929,10 @@ export const Algorithm_MD5Mask: MessageFns<Algorithm_MD5Mask> = {
return message;
},
+ fromJSON(object: any): Algorithm_MD5Mask {
+ return { salt: isSet(object.salt) ? globalThis.String(object.salt) : "" };
+ },
+
toJSON(message: Algorithm_MD5Mask): unknown {
const obj: any = {};
if (message.salt !== "") {
@@ -4656,6 +5025,17 @@ export const Algorithm_InnerOuterMask: MessageFns<Algorithm_InnerOuterMask> = {
return message;
},
+ fromJSON(object: any): Algorithm_InnerOuterMask {
+ return {
+ prefixLen: isSet(object.prefixLen) ? globalThis.Number(object.prefixLen) : 0,
+ suffixLen: isSet(object.suffixLen) ? globalThis.Number(object.suffixLen) : 0,
+ type: isSet(object.type)
+ ? algorithm_InnerOuterMask_MaskTypeFromJSON(object.type)
+ : Algorithm_InnerOuterMask_MaskType.MASK_TYPE_UNSPECIFIED,
+ substitution: isSet(object.substitution) ? globalThis.String(object.substitution) : "",
+ };
+ },
+
toJSON(message: Algorithm_InnerOuterMask): unknown {
const obj: any = {};
if (message.prefixLen !== 0) {
@@ -4722,6 +5102,10 @@ export const MaximumSQLResultSizeSetting: MessageFns<MaximumSQLResultSizeSetting
return message;
},
+ fromJSON(object: any): MaximumSQLResultSizeSetting {
+ return { limit: isSet(object.limit) ? Long.fromValue(object.limit) : Long.ZERO };
+ },
+
toJSON(message: MaximumSQLResultSizeSetting): unknown {
const obj: any = {};
if (!message.limit.equals(Long.ZERO)) {
@@ -4776,6 +5160,10 @@ export const SCIMSetting: MessageFns<SCIMSetting> = {
return message;
},
+ fromJSON(object: any): SCIMSetting {
+ return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
+ },
+
toJSON(message: SCIMSetting): unknown {
const obj: any = {};
if (message.token !== "") {
@@ -4904,6 +5292,24 @@ export const PasswordRestrictionSetting: MessageFns<PasswordRestrictionSetting>
return message;
},
+ fromJSON(object: any): PasswordRestrictionSetting {
+ return {
+ minLength: isSet(object.minLength) ? globalThis.Number(object.minLength) : 0,
+ requireNumber: isSet(object.requireNumber) ? globalThis.Boolean(object.requireNumber) : false,
+ requireLetter: isSet(object.requireLetter) ? globalThis.Boolean(object.requireLetter) : false,
+ requireUppercaseLetter: isSet(object.requireUppercaseLetter)
+ ? globalThis.Boolean(object.requireUppercaseLetter)
+ : false,
+ requireSpecialCharacter: isSet(object.requireSpecialCharacter)
+ ? globalThis.Boolean(object.requireSpecialCharacter)
+ : false,
+ requireResetPasswordForFirstLogin: isSet(object.requireResetPasswordForFirstLogin)
+ ? globalThis.Boolean(object.requireResetPasswordForFirstLogin)
+ : false,
+ passwordRotation: isSet(object.passwordRotation) ? Duration.fromJSON(object.passwordRotation) : undefined,
+ };
+ },
+
toJSON(message: PasswordRestrictionSetting): unknown {
const obj: any = {};
if (message.minLength !== 0) {
@@ -5046,6 +5452,19 @@ export const AISetting: MessageFns<AISetting> = {
return message;
},
+ fromJSON(object: any): AISetting {
+ return {
+ enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
+ provider: isSet(object.provider)
+ ? aISetting_ProviderFromJSON(object.provider)
+ : AISetting_Provider.PROVIDER_UNSPECIFIED,
+ endpoint: isSet(object.endpoint) ? globalThis.String(object.endpoint) : "",
+ apiKey: isSet(object.apiKey) ? globalThis.String(object.apiKey) : "",
+ model: isSet(object.model) ? globalThis.String(object.model) : "",
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
+ };
+ },
+
toJSON(message: AISetting): unknown {
const obj: any = {};
if (message.enabled !== false) {
@@ -5120,6 +5539,14 @@ export const EnvironmentSetting: MessageFns<EnvironmentSetting> = {
return message;
},
+ fromJSON(object: any): EnvironmentSetting {
+ return {
+ environments: globalThis.Array.isArray(object?.environments)
+ ? object.environments.map((e: any) => EnvironmentSetting_Environment.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: EnvironmentSetting): unknown {
const obj: any = {};
if (message.environments?.length) {
@@ -5221,6 +5648,21 @@ export const EnvironmentSetting_Environment: MessageFns<EnvironmentSetting_Envir
return message;
},
+ fromJSON(object: any): EnvironmentSetting_Environment {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ tags: isObject(object.tags)
+ ? Object.entries(object.tags).reduce<{ [key: string]: string }>((acc, [key, value]) => {
+ acc[key] = String(value);
+ return acc;
+ }, {})
+ : {},
+ color: isSet(object.color) ? globalThis.String(object.color) : "",
+ };
+ },
+
toJSON(message: EnvironmentSetting_Environment): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -5313,6 +5755,13 @@ export const EnvironmentSetting_Environment_TagsEntry: MessageFns<EnvironmentSet
return message;
},
+ fromJSON(object: any): EnvironmentSetting_Environment_TagsEntry {
+ return {
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
+ };
+ },
+
toJSON(message: EnvironmentSetting_Environment_TagsEntry): unknown {
const obj: any = {};
if (message.key !== "") {
@@ -5467,15 +5916,44 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isObject(value: any): boolean {
+ return typeof value === "object" && value !== null;
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/sheet_service.ts b/frontend/src/types/proto/v1/sheet_service.ts
index 71d420f843..c07531d2c8 100644
--- a/frontend/src/types/proto/v1/sheet_service.ts
+++ b/frontend/src/types/proto/v1/sheet_service.ts
@@ -204,6 +204,13 @@ export const CreateSheetRequest: MessageFns<CreateSheetRequest> = {
return message;
},
+ fromJSON(object: any): CreateSheetRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ sheet: isSet(object.sheet) ? Sheet.fromJSON(object.sheet) : undefined,
+ };
+ },
+
toJSON(message: CreateSheetRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -273,6 +280,15 @@ export const BatchCreateSheetsRequest: MessageFns<BatchCreateSheetsRequest> = {
return message;
},
+ fromJSON(object: any): BatchCreateSheetsRequest {
+ return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
+ requests: globalThis.Array.isArray(object?.requests)
+ ? object.requests.map((e: any) => CreateSheetRequest.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: BatchCreateSheetsRequest): unknown {
const obj: any = {};
if (message.parent !== "") {
@@ -331,6 +347,10 @@ export const BatchCreateSheetsResponse: MessageFns<BatchCreateSheetsResponse> =
return message;
},
+ fromJSON(object: any): BatchCreateSheetsResponse {
+ return { sheets: globalThis.Array.isArray(object?.sheets) ? object.sheets.map((e: any) => Sheet.fromJSON(e)) : [] };
+ },
+
toJSON(message: BatchCreateSheetsResponse): unknown {
const obj: any = {};
if (message.sheets?.length) {
@@ -396,6 +416,13 @@ export const GetSheetRequest: MessageFns<GetSheetRequest> = {
return message;
},
+ fromJSON(object: any): GetSheetRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ raw: isSet(object.raw) ? globalThis.Boolean(object.raw) : false,
+ };
+ },
+
toJSON(message: GetSheetRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -465,6 +492,13 @@ export const UpdateSheetRequest: MessageFns<UpdateSheetRequest> = {
return message;
},
+ fromJSON(object: any): UpdateSheetRequest {
+ return {
+ sheet: isSet(object.sheet) ? Sheet.fromJSON(object.sheet) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateSheetRequest): unknown {
const obj: any = {};
if (message.sheet !== undefined) {
@@ -609,6 +643,19 @@ export const Sheet: MessageFns<Sheet> = {
return message;
},
+ fromJSON(object: any): Sheet {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0),
+ contentSize: isSet(object.contentSize) ? Long.fromValue(object.contentSize) : Long.ZERO,
+ payload: isSet(object.payload) ? SheetPayload.fromJSON(object.payload) : undefined,
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
+ };
+ },
+
toJSON(message: Sheet): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -708,6 +755,15 @@ export const SheetPayload: MessageFns<SheetPayload> = {
return message;
},
+ fromJSON(object: any): SheetPayload {
+ return {
+ type: isSet(object.type) ? sheetPayload_TypeFromJSON(object.type) : SheetPayload_Type.TYPE_UNSPECIFIED,
+ commands: globalThis.Array.isArray(object?.commands)
+ ? object.commands.map((e: any) => SheetCommand.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: SheetPayload): unknown {
const obj: any = {};
if (message.type !== SheetPayload_Type.TYPE_UNSPECIFIED) {
@@ -777,6 +833,13 @@ export const SheetCommand: MessageFns<SheetCommand> = {
return message;
},
+ fromJSON(object: any): SheetCommand {
+ return {
+ start: isSet(object.start) ? globalThis.Number(object.start) : 0,
+ end: isSet(object.end) ? globalThis.Number(object.end) : 0,
+ };
+ },
+
toJSON(message: SheetCommand): unknown {
const obj: any = {};
if (message.start !== 0) {
@@ -1045,6 +1108,15 @@ export const SheetServiceDefinition = {
},
} as const;
+function bytesFromBase64(b64: string): Uint8Array {
+ 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 {
const bin: string[] = [];
arr.forEach((byte) => {
@@ -1061,15 +1133,40 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/sql_service.ts b/frontend/src/types/proto/v1/sql_service.ts
index 7bbd686801..aa098689ad 100644
--- a/frontend/src/types/proto/v1/sql_service.ts
+++ b/frontend/src/types/proto/v1/sql_service.ts
@@ -848,6 +848,16 @@ export const AdminExecuteRequest: MessageFns<AdminExecuteRequest> = {
return message;
},
+ fromJSON(object: any): AdminExecuteRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
+ limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
+ schema: isSet(object.schema) ? globalThis.String(object.schema) : undefined,
+ container: isSet(object.container) ? globalThis.String(object.container) : undefined,
+ };
+ },
+
toJSON(message: AdminExecuteRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -918,6 +928,12 @@ export const AdminExecuteResponse: MessageFns<AdminExecuteResponse> = {
return message;
},
+ fromJSON(object: any): AdminExecuteResponse {
+ return {
+ results: globalThis.Array.isArray(object?.results) ? object.results.map((e: any) => QueryResult.fromJSON(e)) : [],
+ };
+ },
+
toJSON(message: AdminExecuteResponse): unknown {
const obj: any = {};
if (message.results?.length) {
@@ -1058,6 +1074,19 @@ export const QueryRequest: MessageFns<QueryRequest> = {
return message;
},
+ fromJSON(object: any): QueryRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
+ limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
+ dataSourceId: isSet(object.dataSourceId) ? globalThis.String(object.dataSourceId) : "",
+ explain: isSet(object.explain) ? globalThis.Boolean(object.explain) : false,
+ schema: isSet(object.schema) ? globalThis.String(object.schema) : undefined,
+ queryOption: isSet(object.queryOption) ? QueryOption.fromJSON(object.queryOption) : undefined,
+ container: isSet(object.container) ? globalThis.String(object.container) : undefined,
+ };
+ },
+
toJSON(message: QueryRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1142,6 +1171,12 @@ export const QueryResponse: MessageFns<QueryResponse> = {
return message;
},
+ fromJSON(object: any): QueryResponse {
+ return {
+ results: globalThis.Array.isArray(object?.results) ? object.results.map((e: any) => QueryResult.fromJSON(e)) : [],
+ };
+ },
+
toJSON(message: QueryResponse): unknown {
const obj: any = {};
if (message.results?.length) {
@@ -1196,6 +1231,14 @@ export const QueryOption: MessageFns<QueryOption> = {
return message;
},
+ fromJSON(object: any): QueryOption {
+ return {
+ redisRunCommandsOn: isSet(object.redisRunCommandsOn)
+ ? queryOption_RedisRunCommandsOnFromJSON(object.redisRunCommandsOn)
+ : QueryOption_RedisRunCommandsOn.REDIS_RUN_COMMANDS_ON_UNSPECIFIED,
+ };
+ },
+
toJSON(message: QueryOption): unknown {
const obj: any = {};
if (message.redisRunCommandsOn !== QueryOption_RedisRunCommandsOn.REDIS_RUN_COMMANDS_ON_UNSPECIFIED) {
@@ -1409,6 +1452,31 @@ export const QueryResult: MessageFns<QueryResult> = {
return message;
},
+ fromJSON(object: any): QueryResult {
+ return {
+ columnNames: globalThis.Array.isArray(object?.columnNames)
+ ? object.columnNames.map((e: any) => globalThis.String(e))
+ : [],
+ columnTypeNames: globalThis.Array.isArray(object?.columnTypeNames)
+ ? object.columnTypeNames.map((e: any) => globalThis.String(e))
+ : [],
+ rows: globalThis.Array.isArray(object?.rows) ? object.rows.map((e: any) => QueryRow.fromJSON(e)) : [],
+ rowsCount: isSet(object.rowsCount) ? Long.fromValue(object.rowsCount) : Long.ZERO,
+ masked: globalThis.Array.isArray(object?.masked) ? object.masked.map((e: any) => globalThis.Boolean(e)) : [],
+ sensitive: globalThis.Array.isArray(object?.sensitive)
+ ? object.sensitive.map((e: any) => globalThis.Boolean(e))
+ : [],
+ error: isSet(object.error) ? globalThis.String(object.error) : "",
+ latency: isSet(object.latency) ? Duration.fromJSON(object.latency) : undefined,
+ statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
+ postgresError: isSet(object.postgresError) ? QueryResult_PostgresError.fromJSON(object.postgresError) : undefined,
+ allowExport: isSet(object.allowExport) ? globalThis.Boolean(object.allowExport) : false,
+ messages: globalThis.Array.isArray(object?.messages)
+ ? object.messages.map((e: any) => QueryResult_Message.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: QueryResult): unknown {
const obj: any = {};
if (message.columnNames?.length) {
@@ -1707,6 +1775,28 @@ export const QueryResult_PostgresError: MessageFns<QueryResult_PostgresError> =
return message;
},
+ fromJSON(object: any): QueryResult_PostgresError {
+ return {
+ severity: isSet(object.severity) ? globalThis.String(object.severity) : "",
+ code: isSet(object.code) ? globalThis.String(object.code) : "",
+ message: isSet(object.message) ? globalThis.String(object.message) : "",
+ detail: isSet(object.detail) ? globalThis.String(object.detail) : "",
+ hint: isSet(object.hint) ? globalThis.String(object.hint) : "",
+ position: isSet(object.position) ? globalThis.Number(object.position) : 0,
+ internalPosition: isSet(object.internalPosition) ? globalThis.Number(object.internalPosition) : 0,
+ internalQuery: isSet(object.internalQuery) ? globalThis.String(object.internalQuery) : "",
+ where: isSet(object.where) ? globalThis.String(object.where) : "",
+ schemaName: isSet(object.schemaName) ? globalThis.String(object.schemaName) : "",
+ tableName: isSet(object.tableName) ? globalThis.String(object.tableName) : "",
+ columnName: isSet(object.columnName) ? globalThis.String(object.columnName) : "",
+ dataTypeName: isSet(object.dataTypeName) ? globalThis.String(object.dataTypeName) : "",
+ constraintName: isSet(object.constraintName) ? globalThis.String(object.constraintName) : "",
+ file: isSet(object.file) ? globalThis.String(object.file) : "",
+ line: isSet(object.line) ? globalThis.Number(object.line) : 0,
+ routine: isSet(object.routine) ? globalThis.String(object.routine) : "",
+ };
+ },
+
toJSON(message: QueryResult_PostgresError): unknown {
const obj: any = {};
if (message.severity !== "") {
@@ -1836,6 +1926,15 @@ export const QueryResult_Message: MessageFns<QueryResult_Message> = {
return message;
},
+ fromJSON(object: any): QueryResult_Message {
+ return {
+ level: isSet(object.level)
+ ? queryResult_Message_LevelFromJSON(object.level)
+ : QueryResult_Message_Level.LEVEL_UNSPECIFIED,
+ content: isSet(object.content) ? globalThis.String(object.content) : "",
+ };
+ },
+
toJSON(message: QueryResult_Message): unknown {
const obj: any = {};
if (message.level !== QueryResult_Message_Level.LEVEL_UNSPECIFIED) {
@@ -1894,6 +1993,12 @@ export const QueryRow: MessageFns<QueryRow> = {
return message;
},
+ fromJSON(object: any): QueryRow {
+ return {
+ values: globalThis.Array.isArray(object?.values) ? object.values.map((e: any) => RowValue.fromJSON(e)) : [],
+ };
+ },
+
toJSON(message: QueryRow): unknown {
const obj: any = {};
if (message.values?.length) {
@@ -2094,6 +2199,26 @@ export const RowValue: MessageFns<RowValue> = {
return message;
},
+ fromJSON(object: any): RowValue {
+ return {
+ nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,
+ boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined,
+ bytesValue: isSet(object.bytesValue) ? bytesFromBase64(object.bytesValue) : undefined,
+ doubleValue: isSet(object.doubleValue) ? globalThis.Number(object.doubleValue) : undefined,
+ floatValue: isSet(object.floatValue) ? globalThis.Number(object.floatValue) : undefined,
+ int32Value: isSet(object.int32Value) ? globalThis.Number(object.int32Value) : undefined,
+ int64Value: isSet(object.int64Value) ? Long.fromValue(object.int64Value) : undefined,
+ stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined,
+ uint32Value: isSet(object.uint32Value) ? globalThis.Number(object.uint32Value) : undefined,
+ uint64Value: isSet(object.uint64Value) ? Long.fromValue(object.uint64Value) : undefined,
+ valueValue: isSet(object?.valueValue) ? object.valueValue : undefined,
+ timestampValue: isSet(object.timestampValue) ? RowValue_Timestamp.fromJSON(object.timestampValue) : undefined,
+ timestampTzValue: isSet(object.timestampTzValue)
+ ? RowValue_TimestampTZ.fromJSON(object.timestampTzValue)
+ : undefined,
+ };
+ },
+
toJSON(message: RowValue): unknown {
const obj: any = {};
if (message.nullValue !== undefined) {
@@ -2215,6 +2340,13 @@ export const RowValue_Timestamp: MessageFns<RowValue_Timestamp> = {
return message;
},
+ fromJSON(object: any): RowValue_Timestamp {
+ return {
+ googleTimestamp: isSet(object.googleTimestamp) ? fromJsonTimestamp(object.googleTimestamp) : undefined,
+ accuracy: isSet(object.accuracy) ? globalThis.Number(object.accuracy) : 0,
+ };
+ },
+
toJSON(message: RowValue_Timestamp): unknown {
const obj: any = {};
if (message.googleTimestamp !== undefined) {
@@ -2308,6 +2440,15 @@ export const RowValue_TimestampTZ: MessageFns<RowValue_TimestampTZ> = {
return message;
},
+ fromJSON(object: any): RowValue_TimestampTZ {
+ return {
+ googleTimestamp: isSet(object.googleTimestamp) ? fromJsonTimestamp(object.googleTimestamp) : undefined,
+ zone: isSet(object.zone) ? globalThis.String(object.zone) : "",
+ offset: isSet(object.offset) ? globalThis.Number(object.offset) : 0,
+ accuracy: isSet(object.accuracy) ? globalThis.Number(object.accuracy) : 0,
+ };
+ },
+
toJSON(message: RowValue_TimestampTZ): unknown {
const obj: any = {};
if (message.googleTimestamp !== undefined) {
@@ -2438,6 +2579,17 @@ export const Advice: MessageFns<Advice> = {
return message;
},
+ fromJSON(object: any): Advice {
+ return {
+ status: isSet(object.status) ? advice_StatusFromJSON(object.status) : Advice_Status.STATUS_UNSPECIFIED,
+ code: isSet(object.code) ? globalThis.Number(object.code) : 0,
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ content: isSet(object.content) ? globalThis.String(object.content) : "",
+ startPosition: isSet(object.startPosition) ? Position.fromJSON(object.startPosition) : undefined,
+ endPosition: isSet(object.endPosition) ? Position.fromJSON(object.endPosition) : undefined,
+ };
+ },
+
toJSON(message: Advice): unknown {
const obj: any = {};
if (message.status !== Advice_Status.STATUS_UNSPECIFIED) {
@@ -2590,6 +2742,18 @@ export const ExportRequest: MessageFns<ExportRequest> = {
return message;
},
+ fromJSON(object: any): ExportRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
+ limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
+ format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,
+ admin: isSet(object.admin) ? globalThis.Boolean(object.admin) : false,
+ password: isSet(object.password) ? globalThis.String(object.password) : "",
+ dataSourceId: isSet(object.dataSourceId) ? globalThis.String(object.dataSourceId) : "",
+ };
+ },
+
toJSON(message: ExportRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2668,6 +2832,10 @@ export const ExportResponse: MessageFns<ExportResponse> = {
return message;
},
+ fromJSON(object: any): ExportResponse {
+ return { content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0) };
+ },
+
toJSON(message: ExportResponse): unknown {
const obj: any = {};
if (message.content.length !== 0) {
@@ -2744,6 +2912,14 @@ export const PrettyRequest: MessageFns<PrettyRequest> = {
return message;
},
+ fromJSON(object: any): PrettyRequest {
+ return {
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
+ currentSchema: isSet(object.currentSchema) ? globalThis.String(object.currentSchema) : "",
+ expectedSchema: isSet(object.expectedSchema) ? globalThis.String(object.expectedSchema) : "",
+ };
+ },
+
toJSON(message: PrettyRequest): unknown {
const obj: any = {};
if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
@@ -2817,6 +2993,13 @@ export const PrettyResponse: MessageFns<PrettyResponse> = {
return message;
},
+ fromJSON(object: any): PrettyResponse {
+ return {
+ currentSchema: isSet(object.currentSchema) ? globalThis.String(object.currentSchema) : "",
+ expectedSchema: isSet(object.expectedSchema) ? globalThis.String(object.expectedSchema) : "",
+ };
+ },
+
toJSON(message: PrettyResponse): unknown {
const obj: any = {};
if (message.currentSchema !== "") {
@@ -2897,6 +3080,16 @@ export const CheckRequest: MessageFns<CheckRequest> = {
return message;
},
+ fromJSON(object: any): CheckRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
+ changeType: isSet(object.changeType)
+ ? checkRequest_ChangeTypeFromJSON(object.changeType)
+ : CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED,
+ };
+ },
+
toJSON(message: CheckRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -2970,6 +3163,13 @@ export const CheckResponse: MessageFns<CheckResponse> = {
return message;
},
+ fromJSON(object: any): CheckResponse {
+ return {
+ advices: globalThis.Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromJSON(e)) : [],
+ affectedRows: isSet(object.affectedRows) ? globalThis.Number(object.affectedRows) : 0,
+ };
+ },
+
toJSON(message: CheckResponse): unknown {
const obj: any = {};
if (message.advices?.length) {
@@ -3028,6 +3228,10 @@ export const ParseMyBatisMapperRequest: MessageFns<ParseMyBatisMapperRequest> =
return message;
},
+ fromJSON(object: any): ParseMyBatisMapperRequest {
+ return { content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0) };
+ },
+
toJSON(message: ParseMyBatisMapperRequest): unknown {
const obj: any = {};
if (message.content.length !== 0) {
@@ -3082,6 +3286,14 @@ export const ParseMyBatisMapperResponse: MessageFns<ParseMyBatisMapperResponse>
return message;
},
+ fromJSON(object: any): ParseMyBatisMapperResponse {
+ return {
+ statements: globalThis.Array.isArray(object?.statements)
+ ? object.statements.map((e: any) => globalThis.String(e))
+ : [],
+ };
+ },
+
toJSON(message: ParseMyBatisMapperResponse): unknown {
const obj: any = {};
if (message.statements?.length) {
@@ -3198,6 +3410,19 @@ export const DiffMetadataRequest: MessageFns<DiffMetadataRequest> = {
return message;
},
+ fromJSON(object: any): DiffMetadataRequest {
+ return {
+ sourceMetadata: isSet(object.sourceMetadata) ? DatabaseMetadata.fromJSON(object.sourceMetadata) : undefined,
+ targetMetadata: isSet(object.targetMetadata) ? DatabaseMetadata.fromJSON(object.targetMetadata) : undefined,
+ sourceCatalog: isSet(object.sourceCatalog) ? DatabaseCatalog.fromJSON(object.sourceCatalog) : undefined,
+ targetCatalog: isSet(object.targetCatalog) ? DatabaseCatalog.fromJSON(object.targetCatalog) : undefined,
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
+ classificationFromConfig: isSet(object.classificationFromConfig)
+ ? globalThis.Boolean(object.classificationFromConfig)
+ : false,
+ };
+ },
+
toJSON(message: DiffMetadataRequest): unknown {
const obj: any = {};
if (message.sourceMetadata !== undefined) {
@@ -3280,6 +3505,10 @@ export const DiffMetadataResponse: MessageFns<DiffMetadataResponse> = {
return message;
},
+ fromJSON(object: any): DiffMetadataResponse {
+ return { diff: isSet(object.diff) ? globalThis.String(object.diff) : "" };
+ },
+
toJSON(message: DiffMetadataResponse): unknown {
const obj: any = {};
if (message.diff !== "") {
@@ -3356,6 +3585,14 @@ export const SearchQueryHistoriesRequest: MessageFns<SearchQueryHistoriesRequest
return message;
},
+ fromJSON(object: any): SearchQueryHistoriesRequest {
+ return {
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ };
+ },
+
toJSON(message: SearchQueryHistoriesRequest): unknown {
const obj: any = {};
if (message.pageSize !== 0) {
@@ -3429,6 +3666,15 @@ export const SearchQueryHistoriesResponse: MessageFns<SearchQueryHistoriesRespon
return message;
},
+ fromJSON(object: any): SearchQueryHistoriesResponse {
+ return {
+ queryHistories: globalThis.Array.isArray(object?.queryHistories)
+ ? object.queryHistories.map((e: any) => QueryHistory.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: SearchQueryHistoriesResponse): unknown {
const obj: any = {};
if (message.queryHistories?.length) {
@@ -3573,6 +3819,19 @@ export const QueryHistory: MessageFns<QueryHistory> = {
return message;
},
+ fromJSON(object: any): QueryHistory {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ database: isSet(object.database) ? globalThis.String(object.database) : "",
+ creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
+ error: isSet(object.error) ? globalThis.String(object.error) : undefined,
+ duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined,
+ type: isSet(object.type) ? queryHistory_TypeFromJSON(object.type) : QueryHistory_Type.TYPE_UNSPECIFIED,
+ };
+ },
+
toJSON(message: QueryHistory): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -3659,6 +3918,14 @@ export const AICompletionRequest: MessageFns<AICompletionRequest> = {
return message;
},
+ fromJSON(object: any): AICompletionRequest {
+ return {
+ messages: globalThis.Array.isArray(object?.messages)
+ ? object.messages.map((e: any) => AICompletionRequest_Message.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: AICompletionRequest): unknown {
const obj: any = {};
if (message.messages?.length) {
@@ -3724,6 +3991,13 @@ export const AICompletionRequest_Message: MessageFns<AICompletionRequest_Message
return message;
},
+ fromJSON(object: any): AICompletionRequest_Message {
+ return {
+ role: isSet(object.role) ? globalThis.String(object.role) : "",
+ content: isSet(object.content) ? globalThis.String(object.content) : "",
+ };
+ },
+
toJSON(message: AICompletionRequest_Message): unknown {
const obj: any = {};
if (message.role !== "") {
@@ -3782,6 +4056,14 @@ export const AICompletionResponse: MessageFns<AICompletionResponse> = {
return message;
},
+ fromJSON(object: any): AICompletionResponse {
+ return {
+ candidates: globalThis.Array.isArray(object?.candidates)
+ ? object.candidates.map((e: any) => AICompletionResponse_Candidate.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: AICompletionResponse): unknown {
const obj: any = {};
if (message.candidates?.length) {
@@ -3836,6 +4118,12 @@ export const AICompletionResponse_Candidate: MessageFns<AICompletionResponse_Can
return message;
},
+ fromJSON(object: any): AICompletionResponse_Candidate {
+ return {
+ content: isSet(object.content) ? AICompletionResponse_Candidate_Content.fromJSON(object.content) : undefined,
+ };
+ },
+
toJSON(message: AICompletionResponse_Candidate): unknown {
const obj: any = {};
if (message.content !== undefined) {
@@ -3892,6 +4180,14 @@ export const AICompletionResponse_Candidate_Content: MessageFns<AICompletionResp
return message;
},
+ fromJSON(object: any): AICompletionResponse_Candidate_Content {
+ return {
+ parts: globalThis.Array.isArray(object?.parts)
+ ? object.parts.map((e: any) => AICompletionResponse_Candidate_Content_Part.fromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: AICompletionResponse_Candidate_Content): unknown {
const obj: any = {};
if (message.parts?.length) {
@@ -3949,6 +4245,10 @@ export const AICompletionResponse_Candidate_Content_Part: MessageFns<AICompletio
return message;
},
+ fromJSON(object: any): AICompletionResponse_Candidate_Content_Part {
+ return { text: isSet(object.text) ? globalThis.String(object.text) : "" };
+ },
+
toJSON(message: AICompletionResponse_Candidate_Content_Part): unknown {
const obj: any = {};
if (message.text !== "") {
@@ -4518,6 +4818,15 @@ export const SQLServiceDefinition = {
},
} as const;
+function bytesFromBase64(b64: string): Uint8Array {
+ 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 {
const bin: string[] = [];
arr.forEach((byte) => {
@@ -4534,15 +4843,40 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/subscription_service.ts b/frontend/src/types/proto/v1/subscription_service.ts
index 414f21e8d7..09d26d154a 100644
--- a/frontend/src/types/proto/v1/subscription_service.ts
+++ b/frontend/src/types/proto/v1/subscription_service.ts
@@ -759,6 +759,10 @@ export const GetSubscriptionRequest: MessageFns<GetSubscriptionRequest> = {
return message;
},
+ fromJSON(_: any): GetSubscriptionRequest {
+ return {};
+ },
+
toJSON(_: GetSubscriptionRequest): unknown {
const obj: any = {};
return obj;
@@ -809,6 +813,10 @@ export const UpdateSubscriptionRequest: MessageFns<UpdateSubscriptionRequest> =
return message;
},
+ fromJSON(object: any): UpdateSubscriptionRequest {
+ return { patch: isSet(object.patch) ? PatchSubscription.fromJSON(object.patch) : undefined };
+ },
+
toJSON(message: UpdateSubscriptionRequest): unknown {
const obj: any = {};
if (message.patch !== undefined) {
@@ -865,6 +873,10 @@ export const PatchSubscription: MessageFns<PatchSubscription> = {
return message;
},
+ fromJSON(object: any): PatchSubscription {
+ return { license: isSet(object.license) ? globalThis.String(object.license) : "" };
+ },
+
toJSON(message: PatchSubscription): unknown {
const obj: any = {};
if (message.license !== "") {
@@ -1005,6 +1017,19 @@ export const Subscription: MessageFns<Subscription> = {
return message;
},
+ fromJSON(object: any): Subscription {
+ return {
+ seatCount: isSet(object.seatCount) ? globalThis.Number(object.seatCount) : 0,
+ instanceCount: isSet(object.instanceCount) ? globalThis.Number(object.instanceCount) : 0,
+ expiresTime: isSet(object.expiresTime) ? fromJsonTimestamp(object.expiresTime) : undefined,
+ startedTime: isSet(object.startedTime) ? fromJsonTimestamp(object.startedTime) : undefined,
+ plan: isSet(object.plan) ? planTypeFromJSON(object.plan) : PlanType.PLAN_TYPE_UNSPECIFIED,
+ trialing: isSet(object.trialing) ? globalThis.Boolean(object.trialing) : false,
+ orgId: isSet(object.orgId) ? globalThis.String(object.orgId) : "",
+ orgName: isSet(object.orgName) ? globalThis.String(object.orgName) : "",
+ };
+ },
+
toJSON(message: Subscription): unknown {
const obj: any = {};
if (message.seatCount !== 0) {
@@ -1114,6 +1139,15 @@ export const PlanConfig: MessageFns<PlanConfig> = {
return message;
},
+ fromJSON(object: any): PlanConfig {
+ return {
+ plans: globalThis.Array.isArray(object?.plans) ? object.plans.map((e: any) => PlanLimitConfig.fromJSON(e)) : [],
+ instanceFeatures: globalThis.Array.isArray(object?.instanceFeatures)
+ ? object.instanceFeatures.map((e: any) => planFeatureFromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: PlanConfig): unknown {
const obj: any = {};
if (message.plans?.length) {
@@ -1217,6 +1251,17 @@ export const PlanLimitConfig: MessageFns<PlanLimitConfig> = {
return message;
},
+ fromJSON(object: any): PlanLimitConfig {
+ return {
+ type: isSet(object.type) ? planTypeFromJSON(object.type) : PlanType.PLAN_TYPE_UNSPECIFIED,
+ maximumInstanceCount: isSet(object.maximumInstanceCount) ? globalThis.Number(object.maximumInstanceCount) : 0,
+ maximumSeatCount: isSet(object.maximumSeatCount) ? globalThis.Number(object.maximumSeatCount) : 0,
+ features: globalThis.Array.isArray(object?.features)
+ ? object.features.map((e: any) => planFeatureFromJSON(e))
+ : [],
+ };
+ },
+
toJSON(message: PlanLimitConfig): unknown {
const obj: any = {};
if (message.type !== PlanType.PLAN_TYPE_UNSPECIFIED) {
@@ -1323,15 +1368,40 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/user_service.ts b/frontend/src/types/proto/v1/user_service.ts
index f41c348c28..6298635bcd 100644
--- a/frontend/src/types/proto/v1/user_service.ts
+++ b/frontend/src/types/proto/v1/user_service.ts
@@ -271,6 +271,10 @@ export const GetUserRequest: MessageFns<GetUserRequest> = {
return message;
},
+ fromJSON(object: any): GetUserRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetUserRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -325,6 +329,10 @@ export const BatchGetUsersRequest: MessageFns<BatchGetUsersRequest> = {
return message;
},
+ fromJSON(object: any): BatchGetUsersRequest {
+ return { names: globalThis.Array.isArray(object?.names) ? object.names.map((e: any) => globalThis.String(e)) : [] };
+ },
+
toJSON(message: BatchGetUsersRequest): unknown {
const obj: any = {};
if (message.names?.length) {
@@ -379,6 +387,10 @@ export const BatchGetUsersResponse: MessageFns<BatchGetUsersResponse> = {
return message;
},
+ fromJSON(object: any): BatchGetUsersResponse {
+ return { users: globalThis.Array.isArray(object?.users) ? object.users.map((e: any) => User.fromJSON(e)) : [] };
+ },
+
toJSON(message: BatchGetUsersResponse): unknown {
const obj: any = {};
if (message.users?.length) {
@@ -466,6 +478,15 @@ export const ListUsersRequest: MessageFns<ListUsersRequest> = {
return message;
},
+ fromJSON(object: any): ListUsersRequest {
+ return {
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ };
+ },
+
toJSON(message: ListUsersRequest): unknown {
const obj: any = {};
if (message.pageSize !== 0) {
@@ -543,6 +564,13 @@ export const ListUsersResponse: MessageFns<ListUsersResponse> = {
return message;
},
+ fromJSON(object: any): ListUsersResponse {
+ return {
+ users: globalThis.Array.isArray(object?.users) ? object.users.map((e: any) => User.fromJSON(e)) : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: ListUsersResponse): unknown {
const obj: any = {};
if (message.users?.length) {
@@ -601,6 +629,10 @@ export const CreateUserRequest: MessageFns<CreateUserRequest> = {
return message;
},
+ fromJSON(object: any): CreateUserRequest {
+ return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined };
+ },
+
toJSON(message: CreateUserRequest): unknown {
const obj: any = {};
if (message.user !== undefined) {
@@ -705,6 +737,20 @@ export const UpdateUserRequest: MessageFns<UpdateUserRequest> = {
return message;
},
+ fromJSON(object: any): UpdateUserRequest {
+ return {
+ user: isSet(object.user) ? User.fromJSON(object.user) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ otpCode: isSet(object.otpCode) ? globalThis.String(object.otpCode) : undefined,
+ regenerateTempMfaSecret: isSet(object.regenerateTempMfaSecret)
+ ? globalThis.Boolean(object.regenerateTempMfaSecret)
+ : false,
+ regenerateRecoveryCodes: isSet(object.regenerateRecoveryCodes)
+ ? globalThis.Boolean(object.regenerateRecoveryCodes)
+ : false,
+ };
+ },
+
toJSON(message: UpdateUserRequest): unknown {
const obj: any = {};
if (message.user !== undefined) {
@@ -775,6 +821,10 @@ export const DeleteUserRequest: MessageFns<DeleteUserRequest> = {
return message;
},
+ fromJSON(object: any): DeleteUserRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DeleteUserRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -829,6 +879,10 @@ export const UndeleteUserRequest: MessageFns<UndeleteUserRequest> = {
return message;
},
+ fromJSON(object: any): UndeleteUserRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: UndeleteUserRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1017,6 +1071,25 @@ export const User: MessageFns<User> = {
return message;
},
+ fromJSON(object: any): User {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
+ email: isSet(object.email) ? globalThis.String(object.email) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ userType: isSet(object.userType) ? userTypeFromJSON(object.userType) : UserType.USER_TYPE_UNSPECIFIED,
+ password: isSet(object.password) ? globalThis.String(object.password) : "",
+ serviceKey: isSet(object.serviceKey) ? globalThis.String(object.serviceKey) : "",
+ mfaEnabled: isSet(object.mfaEnabled) ? globalThis.Boolean(object.mfaEnabled) : false,
+ mfaSecret: isSet(object.mfaSecret) ? globalThis.String(object.mfaSecret) : "",
+ recoveryCodes: globalThis.Array.isArray(object?.recoveryCodes)
+ ? object.recoveryCodes.map((e: any) => globalThis.String(e))
+ : [],
+ phone: isSet(object.phone) ? globalThis.String(object.phone) : "",
+ profile: isSet(object.profile) ? User_Profile.fromJSON(object.profile) : undefined,
+ };
+ },
+
toJSON(message: User): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1139,6 +1212,16 @@ export const User_Profile: MessageFns<User_Profile> = {
return message;
},
+ fromJSON(object: any): User_Profile {
+ return {
+ lastLoginTime: isSet(object.lastLoginTime) ? fromJsonTimestamp(object.lastLoginTime) : undefined,
+ lastChangePasswordTime: isSet(object.lastChangePasswordTime)
+ ? fromJsonTimestamp(object.lastChangePasswordTime)
+ : undefined,
+ source: isSet(object.source) ? globalThis.String(object.source) : "",
+ };
+ },
+
toJSON(message: User_Profile): unknown {
const obj: any = {};
if (message.lastLoginTime !== undefined) {
@@ -1468,15 +1551,40 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/frontend/src/types/proto/v1/worksheet_service.ts b/frontend/src/types/proto/v1/worksheet_service.ts
index 05ca8cf8d4..131335e509 100644
--- a/frontend/src/types/proto/v1/worksheet_service.ts
+++ b/frontend/src/types/proto/v1/worksheet_service.ts
@@ -280,6 +280,10 @@ export const CreateWorksheetRequest: MessageFns<CreateWorksheetRequest> = {
return message;
},
+ fromJSON(object: any): CreateWorksheetRequest {
+ return { worksheet: isSet(object.worksheet) ? Worksheet.fromJSON(object.worksheet) : undefined };
+ },
+
toJSON(message: CreateWorksheetRequest): unknown {
const obj: any = {};
if (message.worksheet !== undefined) {
@@ -336,6 +340,10 @@ export const GetWorksheetRequest: MessageFns<GetWorksheetRequest> = {
return message;
},
+ fromJSON(object: any): GetWorksheetRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: GetWorksheetRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -401,6 +409,13 @@ export const UpdateWorksheetRequest: MessageFns<UpdateWorksheetRequest> = {
return message;
},
+ fromJSON(object: any): UpdateWorksheetRequest {
+ return {
+ worksheet: isSet(object.worksheet) ? Worksheet.fromJSON(object.worksheet) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateWorksheetRequest): unknown {
const obj: any = {};
if (message.worksheet !== undefined) {
@@ -472,6 +487,13 @@ export const UpdateWorksheetOrganizerRequest: MessageFns<UpdateWorksheetOrganize
return message;
},
+ fromJSON(object: any): UpdateWorksheetOrganizerRequest {
+ return {
+ organizer: isSet(object.organizer) ? WorksheetOrganizer.fromJSON(object.organizer) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
toJSON(message: UpdateWorksheetOrganizerRequest): unknown {
const obj: any = {};
if (message.organizer !== undefined) {
@@ -543,6 +565,13 @@ export const WorksheetOrganizer: MessageFns<WorksheetOrganizer> = {
return message;
},
+ fromJSON(object: any): WorksheetOrganizer {
+ return {
+ worksheet: isSet(object.worksheet) ? globalThis.String(object.worksheet) : "",
+ starred: isSet(object.starred) ? globalThis.Boolean(object.starred) : false,
+ };
+ },
+
toJSON(message: WorksheetOrganizer): unknown {
const obj: any = {};
if (message.worksheet !== "") {
@@ -601,6 +630,10 @@ export const DeleteWorksheetRequest: MessageFns<DeleteWorksheetRequest> = {
return message;
},
+ fromJSON(object: any): DeleteWorksheetRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
toJSON(message: DeleteWorksheetRequest): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -677,6 +710,14 @@ export const SearchWorksheetsRequest: MessageFns<SearchWorksheetsRequest> = {
return message;
},
+ fromJSON(object: any): SearchWorksheetsRequest {
+ return {
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
toJSON(message: SearchWorksheetsRequest): unknown {
const obj: any = {};
if (message.filter !== "") {
@@ -750,6 +791,15 @@ export const SearchWorksheetsResponse: MessageFns<SearchWorksheetsResponse> = {
return message;
},
+ fromJSON(object: any): SearchWorksheetsResponse {
+ return {
+ worksheets: globalThis.Array.isArray(object?.worksheets)
+ ? object.worksheets.map((e: any) => Worksheet.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
toJSON(message: SearchWorksheetsResponse): unknown {
const obj: any = {};
if (message.worksheets?.length) {
@@ -930,6 +980,24 @@ export const Worksheet: MessageFns<Worksheet> = {
return message;
},
+ fromJSON(object: any): Worksheet {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ project: isSet(object.project) ? globalThis.String(object.project) : "",
+ database: isSet(object.database) ? globalThis.String(object.database) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
+ content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0),
+ contentSize: isSet(object.contentSize) ? Long.fromValue(object.contentSize) : Long.ZERO,
+ visibility: isSet(object.visibility)
+ ? worksheet_VisibilityFromJSON(object.visibility)
+ : Worksheet_Visibility.VISIBILITY_UNSPECIFIED,
+ starred: isSet(object.starred) ? globalThis.Boolean(object.starred) : false,
+ };
+ },
+
toJSON(message: Worksheet): unknown {
const obj: any = {};
if (message.name !== "") {
@@ -1397,6 +1465,15 @@ export const WorksheetServiceDefinition = {
},
} as const;
+function bytesFromBase64(b64: string): Uint8Array {
+ 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 {
const bin: string[] = [];
arr.forEach((byte) => {
@@ -1413,15 +1490,40 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(Math.trunc(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.toNumber() || 0) * 1_000;
millis += (t.nanos || 0) / 1_000_000;
return new globalThis.Date(millis);
}
+function fromJsonTimestamp(o: any): Timestamp {
+ if (o instanceof globalThis.Date) {
+ return toTimestamp(o);
+ } else if (typeof o === "string") {
+ return toTimestamp(new globalThis.Date(o));
+ } else {
+ return Timestamp.fromJSON(o);
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml
index 9b3d59e521..1d0168f257 100644
--- a/proto/buf.gen.yaml
+++ b/proto/buf.gen.yaml
@@ -23,7 +23,6 @@ plugins:
- forceLong=long
- stringEnums=true
- useDate=false
- - outputJsonMethods=to-only
types:
- bytebase.v1
- remote: buf.build/community/pseudomuto-doc:v1.5.1