Skip to content

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

chore(frontend): add `stringEnums` flag (#11834)

boojackb769bb2a6852
diff --git a/frontend/src/components/ChangeHistory/ChangeHistoryStatusIcon.vue b/frontend/src/components/ChangeHistory/ChangeHistoryStatusIcon.vue
index cf75cb9339..dd6ec6d754 100644
--- a/frontend/src/components/ChangeHistory/ChangeHistoryStatusIcon.vue
+++ b/frontend/src/components/ChangeHistory/ChangeHistoryStatusIcon.vue
@@ -30,7 +30,7 @@ import { ChangeHistory_Status } from "@/types/proto/v1/database_service";
const props = defineProps({
status: {
required: true,
- type: Number as PropType<ChangeHistory_Status>,
+ type: String as PropType<ChangeHistory_Status>,
},
});
diff --git a/frontend/src/components/DeploymentConfigTool/SelectorItemV2.vue b/frontend/src/components/DeploymentConfigTool/SelectorItemV2.vue
index bb070aaa78..0ed6762c7c 100644
--- a/frontend/src/components/DeploymentConfigTool/SelectorItemV2.vue
+++ b/frontend/src/components/DeploymentConfigTool/SelectorItemV2.vue
@@ -147,7 +147,7 @@ const resetValues = () => {
props.selector.values = [];
};
-const operatorToText = (op: number) => {
+const operatorToText = (op: string) => {
if (op === OperatorType.OPERATOR_TYPE_IN) {
return allowMultipleValues.value ? "in" : "is";
}
diff --git a/frontend/src/components/EnvironmentForm.vue b/frontend/src/components/EnvironmentForm.vue
index 7ccc36da5b..e7f1a7d83f 100644
--- a/frontend/src/components/EnvironmentForm.vue
+++ b/frontend/src/components/EnvironmentForm.vue
@@ -289,7 +289,7 @@ const props = defineProps({
},
environmentTier: {
required: true,
- type: Number as PropType<EnvironmentTier>,
+ type: String as PropType<EnvironmentTier>,
},
});
diff --git a/frontend/src/components/InstanceForm/constants.ts b/frontend/src/components/InstanceForm/constants.ts
index 94113c9b11..056e3eb282 100644
--- a/frontend/src/components/InstanceForm/constants.ts
+++ b/frontend/src/components/InstanceForm/constants.ts
@@ -43,7 +43,7 @@ export const EngineList = computed(() => {
return supportedEngineV1List();
});
-export const EngineIconPath: Record<number, string> = {
+export const EngineIconPath: Record<string, string> = {
[Engine.MYSQL]: new URL("@/assets/db-mysql.png", import.meta.url).href,
[Engine.POSTGRES]: new URL("@/assets/db-postgres.png", import.meta.url).href,
[Engine.TIDB]: new URL("@/assets/db-tidb.png", import.meta.url).href,
diff --git a/frontend/src/components/IssueV1/components/IssueStatusIcon.vue b/frontend/src/components/IssueV1/components/IssueStatusIcon.vue
index 5925bb5b34..2bedfdc271 100644
--- a/frontend/src/components/IssueV1/components/IssueStatusIcon.vue
+++ b/frontend/src/components/IssueV1/components/IssueStatusIcon.vue
@@ -64,11 +64,11 @@ export type SizeType = "small" | "normal";
const props = defineProps({
issueStatus: {
required: true,
- type: Number as PropType<IssueStatus>,
+ type: String as PropType<IssueStatus>,
},
// Specify taskStatus if we want to show the task specific status when issueStatus is OPEN.
taskStatus: {
- type: Number as PropType<Task_Status>,
+ type: String as PropType<Task_Status>,
default: undefined,
},
size: {
diff --git a/frontend/src/components/v2/Model/ProductionEnvironmentV1Icon.vue b/frontend/src/components/v2/Model/ProductionEnvironmentV1Icon.vue
index e464a44518..672efe6b05 100644
--- a/frontend/src/components/v2/Model/ProductionEnvironmentV1Icon.vue
+++ b/frontend/src/components/v2/Model/ProductionEnvironmentV1Icon.vue
@@ -28,7 +28,7 @@ export default defineComponent({
default: undefined,
},
tier: {
- type: Number as PropType<EnvironmentTier>,
+ type: String as PropType<EnvironmentTier>,
default: EnvironmentTier.UNPROTECTED,
},
tooltip: {
diff --git a/frontend/src/components/v2/Select/UserSelect.vue b/frontend/src/components/v2/Select/UserSelect.vue
index db4f2d0d43..4207fcef2d 100644
--- a/frontend/src/components/v2/Select/UserSelect.vue
+++ b/frontend/src/components/v2/Select/UserSelect.vue
@@ -270,7 +270,9 @@ const renderLabel = (option: SelectOption) => {
: user.title;
const children = [h("span", { class: "max-w-[10rem] truncate" }, title)];
if (user.name !== UNKNOWN_USER_NAME && user.name !== SYSTEM_BOT_USER_NAME) {
- children.push(h("span", { class: "text-gray-400" }, `(${user.email})`));
+ children.push(
+ h("span", { class: "text-gray-400 truncate" }, `(${user.email})`)
+ );
}
if (user.userType === UserType.SERVICE_ACCOUNT) {
children.push(h(ServiceAccountTag));
diff --git a/frontend/src/grpcweb/index.ts b/frontend/src/grpcweb/index.ts
index 3dfd9b98fb..ef803bd9aa 100644
--- a/frontend/src/grpcweb/index.ts
+++ b/frontend/src/grpcweb/index.ts
@@ -34,6 +34,7 @@ import {
authInterceptorMiddleware,
errorNotificationMiddleware,
} from "./middlewares";
+import { AuditLogServiceDefinition } from "@/types/proto/v1/audit_log_service";
// Create each grpc service client.
// Reference: https://github.com/deeplay-io/nice-grpc/blob/master/packages/nice-grpc-web/README.md
@@ -194,6 +195,11 @@ export const changelistServiceClient = clientFactory.create(
channel
);
+export const auditLogServiceClient = clientFactory.create(
+ AuditLogServiceDefinition,
+ channel
+);
+
// e.g. How to use `authServiceClient`?
//
// await authServiceClient.login({
diff --git a/frontend/src/store/modules/v1/activity.ts b/frontend/src/store/modules/v1/activity.ts
index d847016afb..c43cc0deee 100644
--- a/frontend/src/store/modules/v1/activity.ts
+++ b/frontend/src/store/modules/v1/activity.ts
@@ -4,7 +4,6 @@ import { defineStore } from "pinia";
import { reactive } from "vue";
import { loggingServiceClient } from "@/grpcweb";
import type { IdType, FindActivityMessage, ComposedIssue } from "@/types";
-import { UNKNOWN_ID, EMPTY_ID } from "@/types";
import type { ExportFormat } from "@/types/proto/v1/common";
import type { LogEntity } from "@/types/proto/v1/logging_service";
import {
@@ -12,7 +11,7 @@ import {
logEntity_LevelToJSON,
} from "@/types/proto/v1/logging_service";
import { isDatabaseChangeRelatedIssue, extractRolloutUID } from "@/utils";
-import { userNamePrefix, getLogId, logNamePrefix } from "./common";
+import { userNamePrefix, getLogId } from "./common";
dayjs.extend(utc);
@@ -97,16 +96,6 @@ export const useActivityV1Store = defineStore("activity_v1", () => {
return mergedList;
};
- const fetchActivityByUID = async (uid: IdType) => {
- if (uid == EMPTY_ID || uid == UNKNOWN_ID) {
- return;
- }
- const entity = await loggingServiceClient.getLog({
- name: `${logNamePrefix}${uid}`,
- });
- return entity;
- };
-
const getResourceId = (activity: LogEntity): IdType => {
return activity.resource.split("/").slice(-1)[0];
};
@@ -129,7 +118,6 @@ export const useActivityV1Store = defineStore("activity_v1", () => {
return {
fetchActivityList,
fetchActivityListForIssueV1,
- fetchActivityByUID,
getActivityListByIssueV1,
getResourceId,
exportData,
diff --git a/frontend/src/store/modules/v1/auditLog.ts b/frontend/src/store/modules/v1/auditLog.ts
new file mode 100644
index 0000000000..8752a5c50b
--- /dev/null
+++ b/frontend/src/store/modules/v1/auditLog.ts
@@ -0,0 +1,44 @@
+import dayjs from "dayjs";
+import utc from "dayjs/plugin/utc";
+import { defineStore } from "pinia";
+import { reactive } from "vue";
+import { auditLogServiceClient } from "@/grpcweb";
+import type { SearchAuditLogsParams } from "@/types";
+import type { AuditLog } from "@/types/proto/v1/audit_log_service";
+import { userNamePrefix } from "./common";
+
+dayjs.extend(utc);
+
+const buildFilter = (search: SearchAuditLogsParams): string => {
+ const filter: string[] = [];
+ if (search.resource) {
+ filter.push(`resource == "${search.resource}"`);
+ }
+ if (search.creatorEmail) {
+ filter.push(`user == "${userNamePrefix}${search.creatorEmail}"`);
+ }
+ return filter.join(" && ");
+};
+
+export const useAuditLogStore = defineStore("audit_log", () => {
+ const auditLogList = reactive(new Map<string, AuditLog[]>());
+
+ const fetchAuditLogs = async (search: SearchAuditLogsParams) => {
+ const resp = await auditLogServiceClient.searchAuditLogs({
+ filter: buildFilter(search),
+ orderBy: search.order ? `create_time ${search.order}` : undefined,
+ pageSize: search.pageSize,
+ pageToken: search.pageToken,
+ });
+ for (const auditLog of resp.auditLogs) {
+ const list = auditLogList.get(auditLog.resource) || [];
+ list.push(auditLog);
+ auditLogList.set(auditLog.resource, list);
+ }
+ return resp;
+ };
+
+ return {
+ fetchAuditLogs,
+ };
+});
diff --git a/frontend/src/store/modules/v1/index.ts b/frontend/src/store/modules/v1/index.ts
index f51b153457..cdd9545e39 100644
--- a/frontend/src/store/modules/v1/index.ts
+++ b/frontend/src/store/modules/v1/index.ts
@@ -25,3 +25,4 @@ export * from "./anomaly";
export * from "./schemaEditor";
export * from "./changelist";
export * from "./issueComment";
+export * from "./auditLog";
diff --git a/frontend/src/store/modules/v1/subscription.ts b/frontend/src/store/modules/v1/subscription.ts
index ac0bfae9ff..7050080e57 100644
--- a/frontend/src/store/modules/v1/subscription.ts
+++ b/frontend/src/store/modules/v1/subscription.ts
@@ -11,7 +11,7 @@ import type { Subscription } from "@/types/proto/v1/subscription_service";
import {
PlanType,
planTypeFromJSON,
- planTypeToJSON,
+ planTypeToNumber,
} from "@/types/proto/v1/subscription_service";
import { useSettingV1Store } from "./setting";
@@ -154,7 +154,7 @@ export const useSubscriptionV1Store = defineStore("subscription_v1", {
return false;
}
- return !this.isExpired && matrix[this.currentPlan - 1];
+ return !this.isExpired && matrix[planTypeToNumber(this.currentPlan) - 1];
},
hasInstanceFeature(
type: FeatureType,
@@ -189,7 +189,7 @@ export const useSubscriptionV1Store = defineStore("subscription_v1", {
for (let i = 0; i < matrix.length; i++) {
if (matrix[i]) {
- return (i + 1) as PlanType;
+ return planTypeFromJSON(i + 1) as PlanType;
}
}
return PlanType.FREE;
@@ -250,7 +250,7 @@ export const useSubscriptionV1Store = defineStore("subscription_v1", {
stateMatrix.set(
featureType,
[PlanType.FREE, PlanType.TEAM, PlanType.ENTERPRISE].map((type) => {
- return feature.matrix[planTypeToJSON(type)] ?? false;
+ return feature.matrix[type] ?? false;
})
);
}
diff --git a/frontend/src/types/auditLog.ts b/frontend/src/types/auditLog.ts
index e6adb31eae..9a765cf5d1 100644
--- a/frontend/src/types/auditLog.ts
+++ b/frontend/src/types/auditLog.ts
@@ -45,3 +45,11 @@ export const AuditActivityTypeI18nNameMap: Map<LogEntity_Action, string> =
],
[LogEntity_Action.ACTION_DATABASE_SQL_EXPORT, "audit-log.type.sql-export"],
]);
+
+export interface SearchAuditLogsParams {
+ resource?: string;
+ creatorEmail?: string;
+ order?: "asc" | "desc";
+ pageSize?: number;
+ pageToken?: string;
+}
diff --git a/frontend/src/types/proto/google/api/client.ts b/frontend/src/types/proto/google/api/client.ts
index e0e583296f..153884fa42 100644
--- a/frontend/src/types/proto/google/api/client.ts
+++ b/frontend/src/types/proto/google/api/client.ts
@@ -2,7 +2,7 @@
import Long from "long";
import _m0 from "protobufjs/minimal";
import { Duration } from "../protobuf/duration";
-import { LaunchStage, launchStageFromJSON, launchStageToJSON } from "./launch_stage";
+import { LaunchStage, launchStageFromJSON, launchStageToJSON, launchStageToNumber } from "./launch_stage";
export const protobufPackage = "google.api";
@@ -12,22 +12,22 @@ export const protobufPackage = "google.api";
*/
export enum ClientLibraryOrganization {
/** CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED - Not useful. */
- CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0,
+ CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED",
/** CLOUD - Google Cloud Platform Org. */
- CLOUD = 1,
+ CLOUD = "CLOUD",
/** ADS - Ads (Advertising) Org. */
- ADS = 2,
+ ADS = "ADS",
/** PHOTOS - Photos Org. */
- PHOTOS = 3,
+ PHOTOS = "PHOTOS",
/** STREET_VIEW - Street View Org. */
- STREET_VIEW = 4,
+ STREET_VIEW = "STREET_VIEW",
/** SHOPPING - Shopping Org. */
- SHOPPING = 5,
+ SHOPPING = "SHOPPING",
/** GEO - Geo Org. */
- GEO = 6,
+ GEO = "GEO",
/** GENERATIVE_AI - Generative AI - https://developers.generativeai.google */
- GENERATIVE_AI = 7,
- UNRECOGNIZED = -1,
+ GENERATIVE_AI = "GENERATIVE_AI",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function clientLibraryOrganizationFromJSON(object: any): ClientLibraryOrganization {
@@ -87,21 +87,45 @@ export function clientLibraryOrganizationToJSON(object: ClientLibraryOrganizatio
}
}
+export function clientLibraryOrganizationToNumber(object: ClientLibraryOrganization): number {
+ switch (object) {
+ case ClientLibraryOrganization.CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED:
+ return 0;
+ case ClientLibraryOrganization.CLOUD:
+ return 1;
+ case ClientLibraryOrganization.ADS:
+ return 2;
+ case ClientLibraryOrganization.PHOTOS:
+ return 3;
+ case ClientLibraryOrganization.STREET_VIEW:
+ return 4;
+ case ClientLibraryOrganization.SHOPPING:
+ return 5;
+ case ClientLibraryOrganization.GEO:
+ return 6;
+ case ClientLibraryOrganization.GENERATIVE_AI:
+ return 7;
+ case ClientLibraryOrganization.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/** To where should client libraries be published? */
export enum ClientLibraryDestination {
/**
* CLIENT_LIBRARY_DESTINATION_UNSPECIFIED - Client libraries will neither be generated nor published to package
* managers.
*/
- CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0,
+ CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED",
/**
* GITHUB - Generate the client library in a repo under github.com/googleapis,
* but don't publish it to package managers.
*/
- GITHUB = 10,
+ GITHUB = "GITHUB",
/** PACKAGE_MANAGER - Publish the library to package managers like nuget.org and npmjs.com. */
- PACKAGE_MANAGER = 20,
- UNRECOGNIZED = -1,
+ PACKAGE_MANAGER = "PACKAGE_MANAGER",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function clientLibraryDestinationFromJSON(object: any): ClientLibraryDestination {
@@ -136,6 +160,20 @@ export function clientLibraryDestinationToJSON(object: ClientLibraryDestination)
}
}
+export function clientLibraryDestinationToNumber(object: ClientLibraryDestination): number {
+ switch (object) {
+ case ClientLibraryDestination.CLIENT_LIBRARY_DESTINATION_UNSPECIFIED:
+ return 0;
+ case ClientLibraryDestination.GITHUB:
+ return 10;
+ case ClientLibraryDestination.PACKAGE_MANAGER:
+ return 20;
+ case ClientLibraryDestination.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/** Required information for every language. */
export interface CommonLanguageSettings {
/**
@@ -456,7 +494,7 @@ export const CommonLanguageSettings = {
}
writer.uint32(18).fork();
for (const v of message.destinations) {
- writer.int32(v);
+ writer.int32(clientLibraryDestinationToNumber(v));
}
writer.ldelim();
return writer;
@@ -478,7 +516,7 @@ export const CommonLanguageSettings = {
continue;
case 2:
if (tag === 16) {
- message.destinations.push(reader.int32() as any);
+ message.destinations.push(clientLibraryDestinationFromJSON(reader.int32()));
continue;
}
@@ -486,7 +524,7 @@ export const CommonLanguageSettings = {
if (tag === 18) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
- message.destinations.push(reader.int32() as any);
+ message.destinations.push(clientLibraryDestinationFromJSON(reader.int32()));
}
continue;
@@ -536,7 +574,7 @@ export const CommonLanguageSettings = {
function createBaseClientLibrarySettings(): ClientLibrarySettings {
return {
version: "",
- launchStage: 0,
+ launchStage: LaunchStage.LAUNCH_STAGE_UNSPECIFIED,
restNumericEnums: false,
javaSettings: undefined,
cppSettings: undefined,
@@ -554,8 +592,8 @@ export const ClientLibrarySettings = {
if (message.version !== "") {
writer.uint32(10).string(message.version);
}
- if (message.launchStage !== 0) {
- writer.uint32(16).int32(message.launchStage);
+ if (message.launchStage !== LaunchStage.LAUNCH_STAGE_UNSPECIFIED) {
+ writer.uint32(16).int32(launchStageToNumber(message.launchStage));
}
if (message.restNumericEnums === true) {
writer.uint32(24).bool(message.restNumericEnums);
@@ -606,7 +644,7 @@ export const ClientLibrarySettings = {
break;
}
- message.launchStage = reader.int32() as any;
+ message.launchStage = launchStageFromJSON(reader.int32());
continue;
case 3:
if (tag !== 24) {
@@ -683,7 +721,9 @@ export const ClientLibrarySettings = {
fromJSON(object: any): ClientLibrarySettings {
return {
version: isSet(object.version) ? globalThis.String(object.version) : "",
- launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : 0,
+ launchStage: isSet(object.launchStage)
+ ? launchStageFromJSON(object.launchStage)
+ : LaunchStage.LAUNCH_STAGE_UNSPECIFIED,
restNumericEnums: isSet(object.restNumericEnums) ? globalThis.Boolean(object.restNumericEnums) : false,
javaSettings: isSet(object.javaSettings) ? JavaSettings.fromJSON(object.javaSettings) : undefined,
cppSettings: isSet(object.cppSettings) ? CppSettings.fromJSON(object.cppSettings) : undefined,
@@ -701,7 +741,7 @@ export const ClientLibrarySettings = {
if (message.version !== "") {
obj.version = message.version;
}
- if (message.launchStage !== 0) {
+ if (message.launchStage !== LaunchStage.LAUNCH_STAGE_UNSPECIFIED) {
obj.launchStage = launchStageToJSON(message.launchStage);
}
if (message.restNumericEnums === true) {
@@ -740,7 +780,7 @@ export const ClientLibrarySettings = {
fromPartial(object: DeepPartial<ClientLibrarySettings>): ClientLibrarySettings {
const message = createBaseClientLibrarySettings();
message.version = object.version ?? "";
- message.launchStage = object.launchStage ?? 0;
+ message.launchStage = object.launchStage ?? LaunchStage.LAUNCH_STAGE_UNSPECIFIED;
message.restNumericEnums = object.restNumericEnums ?? false;
message.javaSettings = (object.javaSettings !== undefined && object.javaSettings !== null)
? JavaSettings.fromPartial(object.javaSettings)
@@ -779,7 +819,7 @@ function createBasePublishing(): Publishing {
githubLabel: "",
codeownerGithubTeams: [],
docTagPrefix: "",
- organization: 0,
+ organization: ClientLibraryOrganization.CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED,
librarySettings: [],
protoReferenceDocumentationUri: "",
};
@@ -808,8 +848,8 @@ export const Publishing = {
if (message.docTagPrefix !== "") {
writer.uint32(850).string(message.docTagPrefix);
}
- if (message.organization !== 0) {
- writer.uint32(856).int32(message.organization);
+ if (message.organization !== ClientLibraryOrganization.CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED) {
+ writer.uint32(856).int32(clientLibraryOrganizationToNumber(message.organization));
}
for (const v of message.librarySettings) {
ClientLibrarySettings.encode(v!, writer.uint32(874).fork()).ldelim();
@@ -881,7 +921,7 @@ export const Publishing = {
break;
}
- message.organization = reader.int32() as any;
+ message.organization = clientLibraryOrganizationFromJSON(reader.int32());
continue;
case 109:
if (tag !== 874) {
@@ -919,7 +959,9 @@ export const Publishing = {
? object.codeownerGithubTeams.map((e: any) => globalThis.String(e))
: [],
docTagPrefix: isSet(object.docTagPrefix) ? globalThis.String(object.docTagPrefix) : "",
- organization: isSet(object.organization) ? clientLibraryOrganizationFromJSON(object.organization) : 0,
+ organization: isSet(object.organization)
+ ? clientLibraryOrganizationFromJSON(object.organization)
+ : ClientLibraryOrganization.CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED,
librarySettings: globalThis.Array.isArray(object?.librarySettings)
? object.librarySettings.map((e: any) => ClientLibrarySettings.fromJSON(e))
: [],
@@ -952,7 +994,7 @@ export const Publishing = {
if (message.docTagPrefix !== "") {
obj.docTagPrefix = message.docTagPrefix;
}
- if (message.organization !== 0) {
+ if (message.organization !== ClientLibraryOrganization.CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED) {
obj.organization = clientLibraryOrganizationToJSON(message.organization);
}
if (message.librarySettings?.length) {
@@ -976,7 +1018,7 @@ export const Publishing = {
message.githubLabel = object.githubLabel ?? "";
message.codeownerGithubTeams = object.codeownerGithubTeams?.map((e) => e) || [];
message.docTagPrefix = object.docTagPrefix ?? "";
- message.organization = object.organization ?? 0;
+ message.organization = object.organization ?? ClientLibraryOrganization.CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED;
message.librarySettings = object.librarySettings?.map((e) => ClientLibrarySettings.fromPartial(e)) || [];
message.protoReferenceDocumentationUri = object.protoReferenceDocumentationUri ?? "";
return message;
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 d56806c896..10c358c765 100644
--- a/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts
+++ b/frontend/src/types/proto/google/api/expr/v1alpha1/syntax.ts
@@ -2,7 +2,7 @@
import Long from "long";
import _m0 from "protobufjs/minimal";
import { Duration } from "../../../protobuf/duration";
-import { NullValue, nullValueFromJSON, nullValueToJSON } from "../../../protobuf/struct";
+import { NullValue, nullValueFromJSON, nullValueToJSON, nullValueToNumber } from "../../../protobuf/struct";
import { Timestamp } from "../../../protobuf/timestamp";
export const protobufPackage = "google.api.expr.v1alpha1";
@@ -1362,7 +1362,7 @@ function createBaseConstant(): Constant {
export const Constant = {
encode(message: Constant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.nullValue !== undefined) {
- writer.uint32(8).int32(message.nullValue);
+ writer.uint32(8).int32(nullValueToNumber(message.nullValue));
}
if (message.boolValue !== undefined) {
writer.uint32(16).bool(message.boolValue);
@@ -1403,7 +1403,7 @@ export const Constant = {
break;
}
- message.nullValue = reader.int32() as any;
+ message.nullValue = nullValueFromJSON(reader.int32());
continue;
case 2:
if (tag !== 16) {
diff --git a/frontend/src/types/proto/google/api/field_behavior.ts b/frontend/src/types/proto/google/api/field_behavior.ts
index 016d2b56e6..1764487606 100644
--- a/frontend/src/types/proto/google/api/field_behavior.ts
+++ b/frontend/src/types/proto/google/api/field_behavior.ts
@@ -12,53 +12,53 @@ export const protobufPackage = "google.api";
*/
export enum FieldBehavior {
/** FIELD_BEHAVIOR_UNSPECIFIED - Conventional default for enums. Do not use this. */
- FIELD_BEHAVIOR_UNSPECIFIED = 0,
+ FIELD_BEHAVIOR_UNSPECIFIED = "FIELD_BEHAVIOR_UNSPECIFIED",
/**
* OPTIONAL - Specifically denotes a field as optional.
* While all fields in protocol buffers are optional, this may be specified
* for emphasis if appropriate.
*/
- OPTIONAL = 1,
+ OPTIONAL = "OPTIONAL",
/**
* REQUIRED - Denotes a field as required.
* This indicates that the field **must** be provided as part of the request,
* and failure to do so will cause an error (usually `INVALID_ARGUMENT`).
*/
- REQUIRED = 2,
+ REQUIRED = "REQUIRED",
/**
* OUTPUT_ONLY - Denotes a field as output only.
* This indicates that the field is provided in responses, but including the
* field in a request does nothing (the server *must* ignore it and
* *must not* throw an error as a result of the field's presence).
*/
- OUTPUT_ONLY = 3,
+ OUTPUT_ONLY = "OUTPUT_ONLY",
/**
* INPUT_ONLY - Denotes a field as input only.
* This indicates that the field is provided in requests, and the
* corresponding field is not included in output.
*/
- INPUT_ONLY = 4,
+ INPUT_ONLY = "INPUT_ONLY",
/**
* IMMUTABLE - Denotes a field as immutable.
* This indicates that the field may be set once in a request to create a
* resource, but may not be changed thereafter.
*/
- IMMUTABLE = 5,
+ IMMUTABLE = "IMMUTABLE",
/**
* UNORDERED_LIST - Denotes that a (repeated) field is an unordered list.
* This indicates that the service may provide the elements of the list
* in any arbitrary order, rather than the order the user originally
* provided. Additionally, the list's order may or may not be stable.
*/
- UNORDERED_LIST = 6,
+ UNORDERED_LIST = "UNORDERED_LIST",
/**
* NON_EMPTY_DEFAULT - Denotes that this field returns a non-empty default value if not set.
* This indicates that if the user provides the empty value in a request,
* a non-empty value will be returned. The user will not be aware of what
* non-empty value to expect.
*/
- NON_EMPTY_DEFAULT = 7,
- UNRECOGNIZED = -1,
+ NON_EMPTY_DEFAULT = "NON_EMPTY_DEFAULT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function fieldBehaviorFromJSON(object: any): FieldBehavior {
@@ -117,3 +117,27 @@ export function fieldBehaviorToJSON(object: FieldBehavior): string {
return "UNRECOGNIZED";
}
}
+
+export function fieldBehaviorToNumber(object: FieldBehavior): number {
+ switch (object) {
+ case FieldBehavior.FIELD_BEHAVIOR_UNSPECIFIED:
+ return 0;
+ case FieldBehavior.OPTIONAL:
+ return 1;
+ case FieldBehavior.REQUIRED:
+ return 2;
+ case FieldBehavior.OUTPUT_ONLY:
+ return 3;
+ case FieldBehavior.INPUT_ONLY:
+ return 4;
+ case FieldBehavior.IMMUTABLE:
+ return 5;
+ case FieldBehavior.UNORDERED_LIST:
+ return 6;
+ case FieldBehavior.NON_EMPTY_DEFAULT:
+ return 7;
+ case FieldBehavior.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
diff --git a/frontend/src/types/proto/google/api/launch_stage.ts b/frontend/src/types/proto/google/api/launch_stage.ts
index 8bdd5e6a5a..90a4e34248 100644
--- a/frontend/src/types/proto/google/api/launch_stage.ts
+++ b/frontend/src/types/proto/google/api/launch_stage.ts
@@ -8,11 +8,11 @@ export const protobufPackage = "google.api";
*/
export enum LaunchStage {
/** LAUNCH_STAGE_UNSPECIFIED - Do not use this default value. */
- LAUNCH_STAGE_UNSPECIFIED = 0,
+ LAUNCH_STAGE_UNSPECIFIED = "LAUNCH_STAGE_UNSPECIFIED",
/** UNIMPLEMENTED - The feature is not yet implemented. Users can not use it. */
- UNIMPLEMENTED = 6,
+ UNIMPLEMENTED = "UNIMPLEMENTED",
/** PRELAUNCH - Prelaunch features are hidden from users and are only visible internally. */
- PRELAUNCH = 7,
+ PRELAUNCH = "PRELAUNCH",
/**
* EARLY_ACCESS - Early Access features are limited to a closed group of testers. To use
* these features, you must sign up in advance and sign a Trusted Tester
@@ -20,7 +20,7 @@ export enum LaunchStage {
* be unstable, changed in backward-incompatible ways, and are not
* guaranteed to be released.
*/
- EARLY_ACCESS = 1,
+ EARLY_ACCESS = "EARLY_ACCESS",
/**
* ALPHA - Alpha is a limited availability test for releases before they are cleared
* for widespread use. By Alpha, all significant design issues are resolved
@@ -32,7 +32,7 @@ export enum LaunchStage {
* test environments or for limited-use tests -- just like they would in
* normal production cases.
*/
- ALPHA = 2,
+ ALPHA = "ALPHA",
/**
* BETA - Beta is the point at which we are ready to open a release for any
* customer to use. There are no SLA or technical support obligations in a
@@ -40,12 +40,12 @@ export enum LaunchStage {
* may have some open outstanding issues. Beta releases are suitable for
* limited production use cases.
*/
- BETA = 3,
+ BETA = "BETA",
/**
* GA - GA features are open to all developers and are considered stable and
* fully qualified for production use.
*/
- GA = 4,
+ GA = "GA",
/**
* DEPRECATED - Deprecated features are scheduled to be shut down and removed. For more
* information, see the "Deprecation Policy" section of our [Terms of
@@ -53,8 +53,8 @@ export enum LaunchStage {
* and the [Google Cloud Platform Subject to the Deprecation
* Policy](https://cloud.google.com/terms/deprecation) documentation.
*/
- DEPRECATED = 5,
- UNRECOGNIZED = -1,
+ DEPRECATED = "DEPRECATED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function launchStageFromJSON(object: any): LaunchStage {
@@ -113,3 +113,27 @@ export function launchStageToJSON(object: LaunchStage): string {
return "UNRECOGNIZED";
}
}
+
+export function launchStageToNumber(object: LaunchStage): number {
+ switch (object) {
+ case LaunchStage.LAUNCH_STAGE_UNSPECIFIED:
+ return 0;
+ case LaunchStage.UNIMPLEMENTED:
+ return 6;
+ case LaunchStage.PRELAUNCH:
+ return 7;
+ case LaunchStage.EARLY_ACCESS:
+ return 1;
+ case LaunchStage.ALPHA:
+ return 2;
+ case LaunchStage.BETA:
+ return 3;
+ case LaunchStage.GA:
+ return 4;
+ case LaunchStage.DEPRECATED:
+ return 5;
+ case LaunchStage.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.ts
index e5804c3efe..e228fcead9 100644
--- a/frontend/src/types/proto/google/protobuf/descriptor.ts
+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts
@@ -174,43 +174,43 @@ export enum FieldDescriptorProto_Type {
* TYPE_DOUBLE - 0 is reserved for errors.
* Order is weird for historical reasons.
*/
- TYPE_DOUBLE = 1,
- TYPE_FLOAT = 2,
+ TYPE_DOUBLE = "TYPE_DOUBLE",
+ TYPE_FLOAT = "TYPE_FLOAT",
/**
* TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
* negative values are likely.
*/
- TYPE_INT64 = 3,
- TYPE_UINT64 = 4,
+ TYPE_INT64 = "TYPE_INT64",
+ TYPE_UINT64 = "TYPE_UINT64",
/**
* TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
* negative values are likely.
*/
- TYPE_INT32 = 5,
- TYPE_FIXED64 = 6,
- TYPE_FIXED32 = 7,
- TYPE_BOOL = 8,
- TYPE_STRING = 9,
+ TYPE_INT32 = "TYPE_INT32",
+ TYPE_FIXED64 = "TYPE_FIXED64",
+ TYPE_FIXED32 = "TYPE_FIXED32",
+ TYPE_BOOL = "TYPE_BOOL",
+ TYPE_STRING = "TYPE_STRING",
/**
* TYPE_GROUP - Tag-delimited aggregate.
* Group type is deprecated and not supported in proto3. However, Proto3
* implementations should still be able to parse the group wire format and
* treat group fields as unknown fields.
*/
- TYPE_GROUP = 10,
+ TYPE_GROUP = "TYPE_GROUP",
/** TYPE_MESSAGE - Length-delimited aggregate. */
- TYPE_MESSAGE = 11,
+ TYPE_MESSAGE = "TYPE_MESSAGE",
/** TYPE_BYTES - New in version 2. */
- TYPE_BYTES = 12,
- TYPE_UINT32 = 13,
- TYPE_ENUM = 14,
- TYPE_SFIXED32 = 15,
- TYPE_SFIXED64 = 16,
+ TYPE_BYTES = "TYPE_BYTES",
+ TYPE_UINT32 = "TYPE_UINT32",
+ TYPE_ENUM = "TYPE_ENUM",
+ TYPE_SFIXED32 = "TYPE_SFIXED32",
+ TYPE_SFIXED64 = "TYPE_SFIXED64",
/** TYPE_SINT32 - Uses ZigZag encoding. */
- TYPE_SINT32 = 17,
+ TYPE_SINT32 = "TYPE_SINT32",
/** TYPE_SINT64 - Uses ZigZag encoding. */
- TYPE_SINT64 = 18,
- UNRECOGNIZED = -1,
+ TYPE_SINT64 = "TYPE_SINT64",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type {
@@ -320,12 +320,56 @@ export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Typ
}
}
+export function fieldDescriptorProto_TypeToNumber(object: FieldDescriptorProto_Type): number {
+ switch (object) {
+ case FieldDescriptorProto_Type.TYPE_DOUBLE:
+ return 1;
+ case FieldDescriptorProto_Type.TYPE_FLOAT:
+ return 2;
+ case FieldDescriptorProto_Type.TYPE_INT64:
+ return 3;
+ case FieldDescriptorProto_Type.TYPE_UINT64:
+ return 4;
+ case FieldDescriptorProto_Type.TYPE_INT32:
+ return 5;
+ case FieldDescriptorProto_Type.TYPE_FIXED64:
+ return 6;
+ case FieldDescriptorProto_Type.TYPE_FIXED32:
+ return 7;
+ case FieldDescriptorProto_Type.TYPE_BOOL:
+ return 8;
+ case FieldDescriptorProto_Type.TYPE_STRING:
+ return 9;
+ case FieldDescriptorProto_Type.TYPE_GROUP:
+ return 10;
+ case FieldDescriptorProto_Type.TYPE_MESSAGE:
+ return 11;
+ case FieldDescriptorProto_Type.TYPE_BYTES:
+ return 12;
+ case FieldDescriptorProto_Type.TYPE_UINT32:
+ return 13;
+ case FieldDescriptorProto_Type.TYPE_ENUM:
+ return 14;
+ case FieldDescriptorProto_Type.TYPE_SFIXED32:
+ return 15;
+ case FieldDescriptorProto_Type.TYPE_SFIXED64:
+ return 16;
+ case FieldDescriptorProto_Type.TYPE_SINT32:
+ return 17;
+ case FieldDescriptorProto_Type.TYPE_SINT64:
+ return 18;
+ case FieldDescriptorProto_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum FieldDescriptorProto_Label {
/** LABEL_OPTIONAL - 0 is reserved for errors */
- LABEL_OPTIONAL = 1,
- LABEL_REQUIRED = 2,
- LABEL_REPEATED = 3,
- UNRECOGNIZED = -1,
+ LABEL_OPTIONAL = "LABEL_OPTIONAL",
+ LABEL_REQUIRED = "LABEL_REQUIRED",
+ LABEL_REPEATED = "LABEL_REPEATED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label {
@@ -360,6 +404,20 @@ export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_La
}
}
+export function fieldDescriptorProto_LabelToNumber(object: FieldDescriptorProto_Label): number {
+ switch (object) {
+ case FieldDescriptorProto_Label.LABEL_OPTIONAL:
+ return 1;
+ case FieldDescriptorProto_Label.LABEL_REQUIRED:
+ return 2;
+ case FieldDescriptorProto_Label.LABEL_REPEATED:
+ return 3;
+ case FieldDescriptorProto_Label.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/** Describes a oneof. */
export interface OneofDescriptorProto {
name: string;
@@ -557,12 +615,12 @@ export interface FileOptions {
/** Generated classes can be optimized for speed or code size. */
export enum FileOptions_OptimizeMode {
/** SPEED - Generate complete code for parsing, serialization, */
- SPEED = 1,
+ SPEED = "SPEED",
/** CODE_SIZE - etc. */
- CODE_SIZE = 2,
+ CODE_SIZE = "CODE_SIZE",
/** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */
- LITE_RUNTIME = 3,
- UNRECOGNIZED = -1,
+ LITE_RUNTIME = "LITE_RUNTIME",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode {
@@ -597,6 +655,20 @@ export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode)
}
}
+export function fileOptions_OptimizeModeToNumber(object: FileOptions_OptimizeMode): number {
+ switch (object) {
+ case FileOptions_OptimizeMode.SPEED:
+ return 1;
+ case FileOptions_OptimizeMode.CODE_SIZE:
+ return 2;
+ case FileOptions_OptimizeMode.LITE_RUNTIME:
+ return 3;
+ case FileOptions_OptimizeMode.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface MessageOptions {
/**
* Set true to use the old proto1 MessageSet wire format for extensions.
@@ -766,10 +838,10 @@ export interface FieldOptions {
export enum FieldOptions_CType {
/** STRING - Default mode. */
- STRING = 0,
- CORD = 1,
- STRING_PIECE = 2,
- UNRECOGNIZED = -1,
+ STRING = "STRING",
+ CORD = "CORD",
+ STRING_PIECE = "STRING_PIECE",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType {
@@ -804,14 +876,28 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string {
}
}
+export function fieldOptions_CTypeToNumber(object: FieldOptions_CType): number {
+ switch (object) {
+ case FieldOptions_CType.STRING:
+ return 0;
+ case FieldOptions_CType.CORD:
+ return 1;
+ case FieldOptions_CType.STRING_PIECE:
+ return 2;
+ case FieldOptions_CType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum FieldOptions_JSType {
/** JS_NORMAL - Use the default type. */
- JS_NORMAL = 0,
+ JS_NORMAL = "JS_NORMAL",
/** JS_STRING - Use JavaScript strings. */
- JS_STRING = 1,
+ JS_STRING = "JS_STRING",
/** JS_NUMBER - Use JavaScript numbers. */
- JS_NUMBER = 2,
- UNRECOGNIZED = -1,
+ JS_NUMBER = "JS_NUMBER",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType {
@@ -846,16 +932,30 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string {
}
}
+export function fieldOptions_JSTypeToNumber(object: FieldOptions_JSType): number {
+ switch (object) {
+ case FieldOptions_JSType.JS_NORMAL:
+ return 0;
+ case FieldOptions_JSType.JS_STRING:
+ return 1;
+ case FieldOptions_JSType.JS_NUMBER:
+ return 2;
+ case FieldOptions_JSType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/**
* If set to RETENTION_SOURCE, the option will be omitted from the binary.
* Note: as of January 2023, support for this is in progress and does not yet
* have an effect (b/264593489).
*/
export enum FieldOptions_OptionRetention {
- RETENTION_UNKNOWN = 0,
- RETENTION_RUNTIME = 1,
- RETENTION_SOURCE = 2,
- UNRECOGNIZED = -1,
+ RETENTION_UNKNOWN = "RETENTION_UNKNOWN",
+ RETENTION_RUNTIME = "RETENTION_RUNTIME",
+ RETENTION_SOURCE = "RETENTION_SOURCE",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function fieldOptions_OptionRetentionFromJSON(object: any): FieldOptions_OptionRetention {
@@ -890,6 +990,20 @@ export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRe
}
}
+export function fieldOptions_OptionRetentionToNumber(object: FieldOptions_OptionRetention): number {
+ switch (object) {
+ case FieldOptions_OptionRetention.RETENTION_UNKNOWN:
+ return 0;
+ case FieldOptions_OptionRetention.RETENTION_RUNTIME:
+ return 1;
+ case FieldOptions_OptionRetention.RETENTION_SOURCE:
+ return 2;
+ case FieldOptions_OptionRetention.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/**
* This indicates the types of entities that the field may apply to when used
* as an option. If it is unset, then the field may be freely used as an
@@ -897,17 +1011,17 @@ export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRe
* in progress and does not yet have an effect (b/264593489).
*/
export enum FieldOptions_OptionTargetType {
- TARGET_TYPE_UNKNOWN = 0,
- TARGET_TYPE_FILE = 1,
- TARGET_TYPE_EXTENSION_RANGE = 2,
- TARGET_TYPE_MESSAGE = 3,
- TARGET_TYPE_FIELD = 4,
- TARGET_TYPE_ONEOF = 5,
- TARGET_TYPE_ENUM = 6,
- TARGET_TYPE_ENUM_ENTRY = 7,
- TARGET_TYPE_SERVICE = 8,
- TARGET_TYPE_METHOD = 9,
- UNRECOGNIZED = -1,
+ TARGET_TYPE_UNKNOWN = "TARGET_TYPE_UNKNOWN",
+ TARGET_TYPE_FILE = "TARGET_TYPE_FILE",
+ TARGET_TYPE_EXTENSION_RANGE = "TARGET_TYPE_EXTENSION_RANGE",
+ TARGET_TYPE_MESSAGE = "TARGET_TYPE_MESSAGE",
+ TARGET_TYPE_FIELD = "TARGET_TYPE_FIELD",
+ TARGET_TYPE_ONEOF = "TARGET_TYPE_ONEOF",
+ TARGET_TYPE_ENUM = "TARGET_TYPE_ENUM",
+ TARGET_TYPE_ENUM_ENTRY = "TARGET_TYPE_ENUM_ENTRY",
+ TARGET_TYPE_SERVICE = "TARGET_TYPE_SERVICE",
+ TARGET_TYPE_METHOD = "TARGET_TYPE_METHOD",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function fieldOptions_OptionTargetTypeFromJSON(object: any): FieldOptions_OptionTargetType {
@@ -977,6 +1091,34 @@ export function fieldOptions_OptionTargetTypeToJSON(object: FieldOptions_OptionT
}
}
+export function fieldOptions_OptionTargetTypeToNumber(object: FieldOptions_OptionTargetType): number {
+ switch (object) {
+ case FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN:
+ return 0;
+ case FieldOptions_OptionTargetType.TARGET_TYPE_FILE:
+ return 1;
+ case FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE:
+ return 2;
+ case FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE:
+ return 3;
+ case FieldOptions_OptionTargetType.TARGET_TYPE_FIELD:
+ return 4;
+ case FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF:
+ return 5;
+ case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM:
+ return 6;
+ case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY:
+ return 7;
+ case FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE:
+ return 8;
+ case FieldOptions_OptionTargetType.TARGET_TYPE_METHOD:
+ return 9;
+ case FieldOptions_OptionTargetType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface OneofOptions {
/** The parser stores options it doesn't recognize here. See above. */
uninterpretedOption: UninterpretedOption[];
@@ -1053,12 +1195,12 @@ export interface MethodOptions {
* methods, and PUT verb for idempotent methods instead of the default POST.
*/
export enum MethodOptions_IdempotencyLevel {
- IDEMPOTENCY_UNKNOWN = 0,
+ IDEMPOTENCY_UNKNOWN = "IDEMPOTENCY_UNKNOWN",
/** NO_SIDE_EFFECTS - implies idempotent */
- NO_SIDE_EFFECTS = 1,
+ NO_SIDE_EFFECTS = "NO_SIDE_EFFECTS",
/** IDEMPOTENT - idempotent, but may have side effects */
- IDEMPOTENT = 2,
- UNRECOGNIZED = -1,
+ IDEMPOTENT = "IDEMPOTENT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel {
@@ -1093,6 +1235,20 @@ export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_Idemp
}
}
+export function methodOptions_IdempotencyLevelToNumber(object: MethodOptions_IdempotencyLevel): number {
+ switch (object) {
+ case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN:
+ return 0;
+ case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS:
+ return 1;
+ case MethodOptions_IdempotencyLevel.IDEMPOTENT:
+ return 2;
+ case MethodOptions_IdempotencyLevel.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/**
* A message representing a option the parser does not recognize. This only
* appears in options protos created by the compiler::Parser class.
@@ -1310,12 +1466,12 @@ export interface GeneratedCodeInfo_Annotation {
*/
export enum GeneratedCodeInfo_Annotation_Semantic {
/** NONE - There is no effect or the effect is indescribable. */
- NONE = 0,
+ NONE = "NONE",
/** SET - The element is set or otherwise mutated. */
- SET = 1,
+ SET = "SET",
/** ALIAS - An alias to the element is returned. */
- ALIAS = 2,
- UNRECOGNIZED = -1,
+ ALIAS = "ALIAS",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function generatedCodeInfo_Annotation_SemanticFromJSON(object: any): GeneratedCodeInfo_Annotation_Semantic {
@@ -1350,6 +1506,20 @@ export function generatedCodeInfo_Annotation_SemanticToJSON(object: GeneratedCod
}
}
+export function generatedCodeInfo_Annotation_SemanticToNumber(object: GeneratedCodeInfo_Annotation_Semantic): number {
+ switch (object) {
+ case GeneratedCodeInfo_Annotation_Semantic.NONE:
+ return 0;
+ case GeneratedCodeInfo_Annotation_Semantic.SET:
+ return 1;
+ case GeneratedCodeInfo_Annotation_Semantic.ALIAS:
+ return 2;
+ case GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
function createBaseFileDescriptorSet(): FileDescriptorSet {
return { file: [] };
}
@@ -2157,8 +2327,8 @@ function createBaseFieldDescriptorProto(): FieldDescriptorProto {
return {
name: "",
number: 0,
- label: 1,
- type: 1,
+ label: FieldDescriptorProto_Label.LABEL_OPTIONAL,
+ type: FieldDescriptorProto_Type.TYPE_DOUBLE,
typeName: "",
extendee: "",
defaultValue: "",
@@ -2177,11 +2347,11 @@ export const FieldDescriptorProto = {
if (message.number !== 0) {
writer.uint32(24).int32(message.number);
}
- if (message.label !== 1) {
- writer.uint32(32).int32(message.label);
+ if (message.label !== FieldDescriptorProto_Label.LABEL_OPTIONAL) {
+ writer.uint32(32).int32(fieldDescriptorProto_LabelToNumber(message.label));
}
- if (message.type !== 1) {
- writer.uint32(40).int32(message.type);
+ if (message.type !== FieldDescriptorProto_Type.TYPE_DOUBLE) {
+ writer.uint32(40).int32(fieldDescriptorProto_TypeToNumber(message.type));
}
if (message.typeName !== "") {
writer.uint32(50).string(message.typeName);
@@ -2233,14 +2403,14 @@ export const FieldDescriptorProto = {
break;
}
- message.label = reader.int32() as any;
+ message.label = fieldDescriptorProto_LabelFromJSON(reader.int32());
continue;
case 5:
if (tag !== 40) {
break;
}
- message.type = reader.int32() as any;
+ message.type = fieldDescriptorProto_TypeFromJSON(reader.int32());
continue;
case 6:
if (tag !== 50) {
@@ -2304,8 +2474,10 @@ export const FieldDescriptorProto = {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
number: isSet(object.number) ? globalThis.Number(object.number) : 0,
- label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 1,
- type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 1,
+ label: isSet(object.label)
+ ? fieldDescriptorProto_LabelFromJSON(object.label)
+ : FieldDescriptorProto_Label.LABEL_OPTIONAL,
+ type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : FieldDescriptorProto_Type.TYPE_DOUBLE,
typeName: isSet(object.typeName) ? globalThis.String(object.typeName) : "",
extendee: isSet(object.extendee) ? globalThis.String(object.extendee) : "",
defaultValue: isSet(object.defaultValue) ? globalThis.String(object.defaultValue) : "",
@@ -2324,10 +2496,10 @@ export const FieldDescriptorProto = {
if (message.number !== 0) {
obj.number = Math.round(message.number);
}
- if (message.label !== 1) {
+ if (message.label !== FieldDescriptorProto_Label.LABEL_OPTIONAL) {
obj.label = fieldDescriptorProto_LabelToJSON(message.label);
}
- if (message.type !== 1) {
+ if (message.type !== FieldDescriptorProto_Type.TYPE_DOUBLE) {
obj.type = fieldDescriptorProto_TypeToJSON(message.type);
}
if (message.typeName !== "") {
@@ -2361,8 +2533,8 @@ export const FieldDescriptorProto = {
const message = createBaseFieldDescriptorProto();
message.name = object.name ?? "";
message.number = object.number ?? 0;
- message.label = object.label ?? 1;
- message.type = object.type ?? 1;
+ message.label = object.label ?? FieldDescriptorProto_Label.LABEL_OPTIONAL;
+ message.type = object.type ?? FieldDescriptorProto_Type.TYPE_DOUBLE;
message.typeName = object.typeName ?? "";
message.extendee = object.extendee ?? "";
message.defaultValue = object.defaultValue ?? "";
@@ -2988,7 +3160,7 @@ function createBaseFileOptions(): FileOptions {
javaMultipleFiles: false,
javaGenerateEqualsAndHash: false,
javaStringCheckUtf8: false,
- optimizeFor: 1,
+ optimizeFor: FileOptions_OptimizeMode.SPEED,
goPackage: "",
ccGenericServices: false,
javaGenericServices: false,
@@ -3024,8 +3196,8 @@ export const FileOptions = {
if (message.javaStringCheckUtf8 === true) {
writer.uint32(216).bool(message.javaStringCheckUtf8);
}
- if (message.optimizeFor !== 1) {
- writer.uint32(72).int32(message.optimizeFor);
+ if (message.optimizeFor !== FileOptions_OptimizeMode.SPEED) {
+ writer.uint32(72).int32(fileOptions_OptimizeModeToNumber(message.optimizeFor));
}
if (message.goPackage !== "") {
writer.uint32(90).string(message.goPackage);
@@ -3122,7 +3294,7 @@ export const FileOptions = {
break;
}
- message.optimizeFor = reader.int32() as any;
+ message.optimizeFor = fileOptions_OptimizeModeFromJSON(reader.int32());
continue;
case 11:
if (tag !== 90) {
@@ -3247,7 +3419,9 @@ export const FileOptions = {
? globalThis.Boolean(object.javaGenerateEqualsAndHash)
: false,
javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) ? globalThis.Boolean(object.javaStringCheckUtf8) : false,
- optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : 1,
+ optimizeFor: isSet(object.optimizeFor)
+ ? fileOptions_OptimizeModeFromJSON(object.optimizeFor)
+ : FileOptions_OptimizeMode.SPEED,
goPackage: isSet(object.goPackage) ? globalThis.String(object.goPackage) : "",
ccGenericServices: isSet(object.ccGenericServices) ? globalThis.Boolean(object.ccGenericServices) : false,
javaGenericServices: isSet(object.javaGenericServices) ? globalThis.Boolean(object.javaGenericServices) : false,
@@ -3285,7 +3459,7 @@ export const FileOptions = {
if (message.javaStringCheckUtf8 === true) {
obj.javaStringCheckUtf8 = message.javaStringCheckUtf8;
}
- if (message.optimizeFor !== 1) {
+ if (message.optimizeFor !== FileOptions_OptimizeMode.SPEED) {
obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor);
}
if (message.goPackage !== "") {
@@ -3346,7 +3520,7 @@ export const FileOptions = {
message.javaMultipleFiles = object.javaMultipleFiles ?? false;
message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash ?? false;
message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false;
- message.optimizeFor = object.optimizeFor ?? 1;
+ message.optimizeFor = object.optimizeFor ?? FileOptions_OptimizeMode.SPEED;
message.goPackage = object.goPackage ?? "";
message.ccGenericServices = object.ccGenericServices ?? false;
message.javaGenericServices = object.javaGenericServices ?? false;
@@ -3517,30 +3691,30 @@ export const MessageOptions = {
function createBaseFieldOptions(): FieldOptions {
return {
- ctype: 0,
+ ctype: FieldOptions_CType.STRING,
packed: false,
- jstype: 0,
+ jstype: FieldOptions_JSType.JS_NORMAL,
lazy: false,
unverifiedLazy: false,
deprecated: false,
weak: false,
debugRedact: false,
- retention: 0,
- target: 0,
+ retention: FieldOptions_OptionRetention.RETENTION_UNKNOWN,
+ target: FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN,
uninterpretedOption: [],
};
}
export const FieldOptions = {
encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.ctype !== 0) {
- writer.uint32(8).int32(message.ctype);
+ if (message.ctype !== FieldOptions_CType.STRING) {
+ writer.uint32(8).int32(fieldOptions_CTypeToNumber(message.ctype));
}
if (message.packed === true) {
writer.uint32(16).bool(message.packed);
}
- if (message.jstype !== 0) {
- writer.uint32(48).int32(message.jstype);
+ if (message.jstype !== FieldOptions_JSType.JS_NORMAL) {
+ writer.uint32(48).int32(fieldOptions_JSTypeToNumber(message.jstype));
}
if (message.lazy === true) {
writer.uint32(40).bool(message.lazy);
@@ -3557,11 +3731,11 @@ export const FieldOptions = {
if (message.debugRedact === true) {
writer.uint32(128).bool(message.debugRedact);
}
- if (message.retention !== 0) {
- writer.uint32(136).int32(message.retention);
+ if (message.retention !== FieldOptions_OptionRetention.RETENTION_UNKNOWN) {
+ writer.uint32(136).int32(fieldOptions_OptionRetentionToNumber(message.retention));
}
- if (message.target !== 0) {
- writer.uint32(144).int32(message.target);
+ if (message.target !== FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN) {
+ writer.uint32(144).int32(fieldOptions_OptionTargetTypeToNumber(message.target));
}
for (const v of message.uninterpretedOption) {
UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();
@@ -3581,7 +3755,7 @@ export const FieldOptions = {
break;
}
- message.ctype = reader.int32() as any;
+ message.ctype = fieldOptions_CTypeFromJSON(reader.int32());
continue;
case 2:
if (tag !== 16) {
@@ -3595,7 +3769,7 @@ export const FieldOptions = {
break;
}
- message.jstype = reader.int32() as any;
+ message.jstype = fieldOptions_JSTypeFromJSON(reader.int32());
continue;
case 5:
if (tag !== 40) {
@@ -3637,14 +3811,14 @@ export const FieldOptions = {
break;
}
- message.retention = reader.int32() as any;
+ message.retention = fieldOptions_OptionRetentionFromJSON(reader.int32());
continue;
case 18:
if (tag !== 144) {
break;
}
- message.target = reader.int32() as any;
+ message.target = fieldOptions_OptionTargetTypeFromJSON(reader.int32());
continue;
case 999:
if (tag !== 7994) {
@@ -3664,16 +3838,20 @@ export const FieldOptions = {
fromJSON(object: any): FieldOptions {
return {
- ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0,
+ 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) : 0,
+ 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) : 0,
- target: isSet(object.target) ? fieldOptions_OptionTargetTypeFromJSON(object.target) : 0,
+ retention: isSet(object.retention)
+ ? fieldOptions_OptionRetentionFromJSON(object.retention)
+ : FieldOptions_OptionRetention.RETENTION_UNKNOWN,
+ target: isSet(object.target)
+ ? fieldOptions_OptionTargetTypeFromJSON(object.target)
+ : FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN,
uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
: [],
@@ -3682,13 +3860,13 @@ export const FieldOptions = {
toJSON(message: FieldOptions): unknown {
const obj: any = {};
- if (message.ctype !== 0) {
+ if (message.ctype !== FieldOptions_CType.STRING) {
obj.ctype = fieldOptions_CTypeToJSON(message.ctype);
}
if (message.packed === true) {
obj.packed = message.packed;
}
- if (message.jstype !== 0) {
+ if (message.jstype !== FieldOptions_JSType.JS_NORMAL) {
obj.jstype = fieldOptions_JSTypeToJSON(message.jstype);
}
if (message.lazy === true) {
@@ -3706,10 +3884,10 @@ export const FieldOptions = {
if (message.debugRedact === true) {
obj.debugRedact = message.debugRedact;
}
- if (message.retention !== 0) {
+ if (message.retention !== FieldOptions_OptionRetention.RETENTION_UNKNOWN) {
obj.retention = fieldOptions_OptionRetentionToJSON(message.retention);
}
- if (message.target !== 0) {
+ if (message.target !== FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN) {
obj.target = fieldOptions_OptionTargetTypeToJSON(message.target);
}
if (message.uninterpretedOption?.length) {
@@ -3723,16 +3901,16 @@ export const FieldOptions = {
},
fromPartial(object: DeepPartial<FieldOptions>): FieldOptions {
const message = createBaseFieldOptions();
- message.ctype = object.ctype ?? 0;
+ message.ctype = object.ctype ?? FieldOptions_CType.STRING;
message.packed = object.packed ?? false;
- message.jstype = object.jstype ?? 0;
+ message.jstype = object.jstype ?? FieldOptions_JSType.JS_NORMAL;
message.lazy = object.lazy ?? false;
message.unverifiedLazy = object.unverifiedLazy ?? false;
message.deprecated = object.deprecated ?? false;
message.weak = object.weak ?? false;
message.debugRedact = object.debugRedact ?? false;
- message.retention = object.retention ?? 0;
- message.target = object.target ?? 0;
+ message.retention = object.retention ?? FieldOptions_OptionRetention.RETENTION_UNKNOWN;
+ message.target = object.target ?? FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN;
message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
return message;
},
@@ -4060,7 +4238,11 @@ export const ServiceOptions = {
};
function createBaseMethodOptions(): MethodOptions {
- return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] };
+ return {
+ deprecated: false,
+ idempotencyLevel: MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN,
+ uninterpretedOption: [],
+ };
}
export const MethodOptions = {
@@ -4068,8 +4250,8 @@ export const MethodOptions = {
if (message.deprecated === true) {
writer.uint32(264).bool(message.deprecated);
}
- if (message.idempotencyLevel !== 0) {
- writer.uint32(272).int32(message.idempotencyLevel);
+ if (message.idempotencyLevel !== MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN) {
+ writer.uint32(272).int32(methodOptions_IdempotencyLevelToNumber(message.idempotencyLevel));
}
for (const v of message.uninterpretedOption) {
UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();
@@ -4096,7 +4278,7 @@ export const MethodOptions = {
break;
}
- message.idempotencyLevel = reader.int32() as any;
+ message.idempotencyLevel = methodOptions_IdempotencyLevelFromJSON(reader.int32());
continue;
case 999:
if (tag !== 7994) {
@@ -4119,7 +4301,7 @@ export const MethodOptions = {
deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false,
idempotencyLevel: isSet(object.idempotencyLevel)
? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel)
- : 0,
+ : MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN,
uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
: [],
@@ -4131,7 +4313,7 @@ export const MethodOptions = {
if (message.deprecated === true) {
obj.deprecated = message.deprecated;
}
- if (message.idempotencyLevel !== 0) {
+ if (message.idempotencyLevel !== MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN) {
obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel);
}
if (message.uninterpretedOption?.length) {
@@ -4146,7 +4328,7 @@ export const MethodOptions = {
fromPartial(object: DeepPartial<MethodOptions>): MethodOptions {
const message = createBaseMethodOptions();
message.deprecated = object.deprecated ?? false;
- message.idempotencyLevel = object.idempotencyLevel ?? 0;
+ message.idempotencyLevel = object.idempotencyLevel ?? MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN;
message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
return message;
},
@@ -4657,7 +4839,7 @@ export const GeneratedCodeInfo = {
};
function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation {
- return { path: [], sourceFile: "", begin: 0, end: 0, semantic: 0 };
+ return { path: [], sourceFile: "", begin: 0, end: 0, semantic: GeneratedCodeInfo_Annotation_Semantic.NONE };
}
export const GeneratedCodeInfo_Annotation = {
@@ -4676,8 +4858,8 @@ export const GeneratedCodeInfo_Annotation = {
if (message.end !== 0) {
writer.uint32(32).int32(message.end);
}
- if (message.semantic !== 0) {
- writer.uint32(40).int32(message.semantic);
+ if (message.semantic !== GeneratedCodeInfo_Annotation_Semantic.NONE) {
+ writer.uint32(40).int32(generatedCodeInfo_Annotation_SemanticToNumber(message.semantic));
}
return writer;
},
@@ -4732,7 +4914,7 @@ export const GeneratedCodeInfo_Annotation = {
break;
}
- message.semantic = reader.int32() as any;
+ message.semantic = generatedCodeInfo_Annotation_SemanticFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -4749,7 +4931,9 @@ export const GeneratedCodeInfo_Annotation = {
sourceFile: isSet(object.sourceFile) ? globalThis.String(object.sourceFile) : "",
begin: isSet(object.begin) ? globalThis.Number(object.begin) : 0,
end: isSet(object.end) ? globalThis.Number(object.end) : 0,
- semantic: isSet(object.semantic) ? generatedCodeInfo_Annotation_SemanticFromJSON(object.semantic) : 0,
+ semantic: isSet(object.semantic)
+ ? generatedCodeInfo_Annotation_SemanticFromJSON(object.semantic)
+ : GeneratedCodeInfo_Annotation_Semantic.NONE,
};
},
@@ -4767,7 +4951,7 @@ export const GeneratedCodeInfo_Annotation = {
if (message.end !== 0) {
obj.end = Math.round(message.end);
}
- if (message.semantic !== 0) {
+ if (message.semantic !== GeneratedCodeInfo_Annotation_Semantic.NONE) {
obj.semantic = generatedCodeInfo_Annotation_SemanticToJSON(message.semantic);
}
return obj;
@@ -4782,7 +4966,7 @@ export const GeneratedCodeInfo_Annotation = {
message.sourceFile = object.sourceFile ?? "";
message.begin = object.begin ?? 0;
message.end = object.end ?? 0;
- message.semantic = object.semantic ?? 0;
+ message.semantic = object.semantic ?? GeneratedCodeInfo_Annotation_Semantic.NONE;
return message;
},
};
diff --git a/frontend/src/types/proto/google/protobuf/struct.ts b/frontend/src/types/proto/google/protobuf/struct.ts
index dbdf7a289a..31ff603438 100644
--- a/frontend/src/types/proto/google/protobuf/struct.ts
+++ b/frontend/src/types/proto/google/protobuf/struct.ts
@@ -12,8 +12,8 @@ export const protobufPackage = "google.protobuf";
*/
export enum NullValue {
/** NULL_VALUE - Null value. */
- NULL_VALUE = 0,
- UNRECOGNIZED = -1,
+ NULL_VALUE = "NULL_VALUE",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function nullValueFromJSON(object: any): NullValue {
@@ -38,6 +38,16 @@ export function nullValueToJSON(object: NullValue): string {
}
}
+export function nullValueToNumber(object: NullValue): number {
+ switch (object) {
+ case NullValue.NULL_VALUE:
+ return 0;
+ case NullValue.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/**
* `Struct` represents a structured data value, consisting of fields
* which map to dynamically typed values. In some languages, `Struct`
@@ -292,7 +302,7 @@ function createBaseValue(): Value {
export const Value = {
encode(message: Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.nullValue !== undefined) {
- writer.uint32(8).int32(message.nullValue);
+ writer.uint32(8).int32(nullValueToNumber(message.nullValue));
}
if (message.numberValue !== undefined) {
writer.uint32(17).double(message.numberValue);
@@ -324,7 +334,7 @@ export const Value = {
break;
}
- message.nullValue = reader.int32() as any;
+ message.nullValue = nullValueFromJSON(reader.int32());
continue;
case 2:
if (tag !== 17) {
diff --git a/frontend/src/types/proto/store/activity.ts b/frontend/src/types/proto/store/activity.ts
index 80a7f27e6f..95130f6762 100644
--- a/frontend/src/types/proto/store/activity.ts
+++ b/frontend/src/types/proto/store/activity.ts
@@ -42,9 +42,9 @@ export interface ActivityIssueCommentCreatePayload_ExternalApprovalEvent {
}
export enum ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Type {
- TYPE_UNSPECIFIED = 0,
- TYPE_FEISHU = 1,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ TYPE_FEISHU = "TYPE_FEISHU",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function activityIssueCommentCreatePayload_ExternalApprovalEvent_TypeFromJSON(
@@ -78,11 +78,25 @@ export function activityIssueCommentCreatePayload_ExternalApprovalEvent_TypeToJS
}
}
+export function activityIssueCommentCreatePayload_ExternalApprovalEvent_TypeToNumber(
+ object: ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Type,
+): number {
+ switch (object) {
+ case ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Type.TYPE_FEISHU:
+ return 1;
+ case ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Action {
- ACTION_UNSPECIFIED = 0,
- ACTION_APPROVE = 1,
- ACTION_REJECT = 2,
- UNRECOGNIZED = -1,
+ ACTION_UNSPECIFIED = "ACTION_UNSPECIFIED",
+ ACTION_APPROVE = "ACTION_APPROVE",
+ ACTION_REJECT = "ACTION_REJECT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function activityIssueCommentCreatePayload_ExternalApprovalEvent_ActionFromJSON(
@@ -121,17 +135,33 @@ export function activityIssueCommentCreatePayload_ExternalApprovalEvent_ActionTo
}
}
+export function activityIssueCommentCreatePayload_ExternalApprovalEvent_ActionToNumber(
+ object: ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Action,
+): number {
+ switch (object) {
+ case ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Action.ACTION_UNSPECIFIED:
+ return 0;
+ case ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Action.ACTION_APPROVE:
+ return 1;
+ case ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Action.ACTION_REJECT:
+ return 2;
+ case ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Action.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface ActivityIssueCommentCreatePayload_ApprovalEvent {
/** The new status. */
status: ActivityIssueCommentCreatePayload_ApprovalEvent_Status;
}
export enum ActivityIssueCommentCreatePayload_ApprovalEvent_Status {
- STATUS_UNSPECIFIED = 0,
- PENDING = 1,
- APPROVED = 2,
- REJECTED = 3,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ PENDING = "PENDING",
+ APPROVED = "APPROVED",
+ REJECTED = "REJECTED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function activityIssueCommentCreatePayload_ApprovalEvent_StatusFromJSON(
@@ -175,6 +205,24 @@ export function activityIssueCommentCreatePayload_ApprovalEvent_StatusToJSON(
}
}
+export function activityIssueCommentCreatePayload_ApprovalEvent_StatusToNumber(
+ object: ActivityIssueCommentCreatePayload_ApprovalEvent_Status,
+): number {
+ switch (object) {
+ case ActivityIssueCommentCreatePayload_ApprovalEvent_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case ActivityIssueCommentCreatePayload_ApprovalEvent_Status.PENDING:
+ return 1;
+ case ActivityIssueCommentCreatePayload_ApprovalEvent_Status.APPROVED:
+ return 2;
+ case ActivityIssueCommentCreatePayload_ApprovalEvent_Status.REJECTED:
+ return 3;
+ case ActivityIssueCommentCreatePayload_ApprovalEvent_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface ActivityIssueApprovalNotifyPayload {
approvalStep: ApprovalStep | undefined;
}
@@ -482,7 +530,11 @@ export const ActivityIssueCommentCreatePayload_TaskRollbackBy = {
};
function createBaseActivityIssueCommentCreatePayload_ExternalApprovalEvent(): ActivityIssueCommentCreatePayload_ExternalApprovalEvent {
- return { type: 0, action: 0, stageName: "" };
+ return {
+ type: ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Type.TYPE_UNSPECIFIED,
+ action: ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Action.ACTION_UNSPECIFIED,
+ stageName: "",
+ };
}
export const ActivityIssueCommentCreatePayload_ExternalApprovalEvent = {
@@ -490,11 +542,11 @@ export const ActivityIssueCommentCreatePayload_ExternalApprovalEvent = {
message: ActivityIssueCommentCreatePayload_ExternalApprovalEvent,
writer: _m0.Writer = _m0.Writer.create(),
): _m0.Writer {
- if (message.type !== 0) {
- writer.uint32(8).int32(message.type);
+ if (message.type !== ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(8).int32(activityIssueCommentCreatePayload_ExternalApprovalEvent_TypeToNumber(message.type));
}
- if (message.action !== 0) {
- writer.uint32(16).int32(message.action);
+ if (message.action !== ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Action.ACTION_UNSPECIFIED) {
+ writer.uint32(16).int32(activityIssueCommentCreatePayload_ExternalApprovalEvent_ActionToNumber(message.action));
}
if (message.stageName !== "") {
writer.uint32(26).string(message.stageName);
@@ -514,14 +566,14 @@ export const ActivityIssueCommentCreatePayload_ExternalApprovalEvent = {
break;
}
- message.type = reader.int32() as any;
+ message.type = activityIssueCommentCreatePayload_ExternalApprovalEvent_TypeFromJSON(reader.int32());
continue;
case 2:
if (tag !== 16) {
break;
}
- message.action = reader.int32() as any;
+ message.action = activityIssueCommentCreatePayload_ExternalApprovalEvent_ActionFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -541,20 +593,22 @@ export const ActivityIssueCommentCreatePayload_ExternalApprovalEvent = {
fromJSON(object: any): ActivityIssueCommentCreatePayload_ExternalApprovalEvent {
return {
- type: isSet(object.type) ? activityIssueCommentCreatePayload_ExternalApprovalEvent_TypeFromJSON(object.type) : 0,
+ type: isSet(object.type)
+ ? activityIssueCommentCreatePayload_ExternalApprovalEvent_TypeFromJSON(object.type)
+ : ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Type.TYPE_UNSPECIFIED,
action: isSet(object.action)
? activityIssueCommentCreatePayload_ExternalApprovalEvent_ActionFromJSON(object.action)
- : 0,
+ : ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Action.ACTION_UNSPECIFIED,
stageName: isSet(object.stageName) ? globalThis.String(object.stageName) : "",
};
},
toJSON(message: ActivityIssueCommentCreatePayload_ExternalApprovalEvent): unknown {
const obj: any = {};
- if (message.type !== 0) {
+ if (message.type !== ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Type.TYPE_UNSPECIFIED) {
obj.type = activityIssueCommentCreatePayload_ExternalApprovalEvent_TypeToJSON(message.type);
}
- if (message.action !== 0) {
+ if (message.action !== ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Action.ACTION_UNSPECIFIED) {
obj.action = activityIssueCommentCreatePayload_ExternalApprovalEvent_ActionToJSON(message.action);
}
if (message.stageName !== "") {
@@ -572,15 +626,15 @@ export const ActivityIssueCommentCreatePayload_ExternalApprovalEvent = {
object: DeepPartial<ActivityIssueCommentCreatePayload_ExternalApprovalEvent>,
): ActivityIssueCommentCreatePayload_ExternalApprovalEvent {
const message = createBaseActivityIssueCommentCreatePayload_ExternalApprovalEvent();
- message.type = object.type ?? 0;
- message.action = object.action ?? 0;
+ message.type = object.type ?? ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Type.TYPE_UNSPECIFIED;
+ message.action = object.action ?? ActivityIssueCommentCreatePayload_ExternalApprovalEvent_Action.ACTION_UNSPECIFIED;
message.stageName = object.stageName ?? "";
return message;
},
};
function createBaseActivityIssueCommentCreatePayload_ApprovalEvent(): ActivityIssueCommentCreatePayload_ApprovalEvent {
- return { status: 0 };
+ return { status: ActivityIssueCommentCreatePayload_ApprovalEvent_Status.STATUS_UNSPECIFIED };
}
export const ActivityIssueCommentCreatePayload_ApprovalEvent = {
@@ -588,8 +642,8 @@ export const ActivityIssueCommentCreatePayload_ApprovalEvent = {
message: ActivityIssueCommentCreatePayload_ApprovalEvent,
writer: _m0.Writer = _m0.Writer.create(),
): _m0.Writer {
- if (message.status !== 0) {
- writer.uint32(8).int32(message.status);
+ if (message.status !== ActivityIssueCommentCreatePayload_ApprovalEvent_Status.STATUS_UNSPECIFIED) {
+ writer.uint32(8).int32(activityIssueCommentCreatePayload_ApprovalEvent_StatusToNumber(message.status));
}
return writer;
},
@@ -606,7 +660,7 @@ export const ActivityIssueCommentCreatePayload_ApprovalEvent = {
break;
}
- message.status = reader.int32() as any;
+ message.status = activityIssueCommentCreatePayload_ApprovalEvent_StatusFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -619,13 +673,15 @@ export const ActivityIssueCommentCreatePayload_ApprovalEvent = {
fromJSON(object: any): ActivityIssueCommentCreatePayload_ApprovalEvent {
return {
- status: isSet(object.status) ? activityIssueCommentCreatePayload_ApprovalEvent_StatusFromJSON(object.status) : 0,
+ status: isSet(object.status)
+ ? activityIssueCommentCreatePayload_ApprovalEvent_StatusFromJSON(object.status)
+ : ActivityIssueCommentCreatePayload_ApprovalEvent_Status.STATUS_UNSPECIFIED,
};
},
toJSON(message: ActivityIssueCommentCreatePayload_ApprovalEvent): unknown {
const obj: any = {};
- if (message.status !== 0) {
+ if (message.status !== ActivityIssueCommentCreatePayload_ApprovalEvent_Status.STATUS_UNSPECIFIED) {
obj.status = activityIssueCommentCreatePayload_ApprovalEvent_StatusToJSON(message.status);
}
return obj;
@@ -640,7 +696,7 @@ export const ActivityIssueCommentCreatePayload_ApprovalEvent = {
object: DeepPartial<ActivityIssueCommentCreatePayload_ApprovalEvent>,
): ActivityIssueCommentCreatePayload_ApprovalEvent {
const message = createBaseActivityIssueCommentCreatePayload_ApprovalEvent();
- message.status = object.status ?? 0;
+ message.status = object.status ?? ActivityIssueCommentCreatePayload_ApprovalEvent_Status.STATUS_UNSPECIFIED;
return message;
},
};
diff --git a/frontend/src/types/proto/store/approval.ts b/frontend/src/types/proto/store/approval.ts
index ae6e48608e..c7554b6c43 100644
--- a/frontend/src/types/proto/store/approval.ts
+++ b/frontend/src/types/proto/store/approval.ts
@@ -21,11 +21,11 @@ export interface IssuePayloadApproval {
}
export enum IssuePayloadApproval_RiskLevel {
- RISK_LEVEL_UNSPECIFIED = 0,
- LOW = 1,
- MODERATE = 2,
- HIGH = 3,
- UNRECOGNIZED = -1,
+ RISK_LEVEL_UNSPECIFIED = "RISK_LEVEL_UNSPECIFIED",
+ LOW = "LOW",
+ MODERATE = "MODERATE",
+ HIGH = "HIGH",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function issuePayloadApproval_RiskLevelFromJSON(object: any): IssuePayloadApproval_RiskLevel {
@@ -65,6 +65,22 @@ export function issuePayloadApproval_RiskLevelToJSON(object: IssuePayloadApprova
}
}
+export function issuePayloadApproval_RiskLevelToNumber(object: IssuePayloadApproval_RiskLevel): number {
+ switch (object) {
+ case IssuePayloadApproval_RiskLevel.RISK_LEVEL_UNSPECIFIED:
+ return 0;
+ case IssuePayloadApproval_RiskLevel.LOW:
+ return 1;
+ case IssuePayloadApproval_RiskLevel.MODERATE:
+ return 2;
+ case IssuePayloadApproval_RiskLevel.HIGH:
+ return 3;
+ case IssuePayloadApproval_RiskLevel.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface IssuePayloadApproval_Approver {
/** The new status. */
status: IssuePayloadApproval_Approver_Status;
@@ -73,11 +89,11 @@ export interface IssuePayloadApproval_Approver {
}
export enum IssuePayloadApproval_Approver_Status {
- STATUS_UNSPECIFIED = 0,
- PENDING = 1,
- APPROVED = 2,
- REJECTED = 3,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ PENDING = "PENDING",
+ APPROVED = "APPROVED",
+ REJECTED = "REJECTED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function issuePayloadApproval_Approver_StatusFromJSON(object: any): IssuePayloadApproval_Approver_Status {
@@ -117,6 +133,22 @@ export function issuePayloadApproval_Approver_StatusToJSON(object: IssuePayloadA
}
}
+export function issuePayloadApproval_Approver_StatusToNumber(object: IssuePayloadApproval_Approver_Status): number {
+ switch (object) {
+ case IssuePayloadApproval_Approver_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case IssuePayloadApproval_Approver_Status.PENDING:
+ return 1;
+ case IssuePayloadApproval_Approver_Status.APPROVED:
+ return 2;
+ case IssuePayloadApproval_Approver_Status.REJECTED:
+ return 3;
+ case IssuePayloadApproval_Approver_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface ApprovalTemplate {
flow: ApprovalFlow | undefined;
title: string;
@@ -139,10 +171,10 @@ export interface ApprovalStep {
* ANY means approving any node will proceed.
*/
export enum ApprovalStep_Type {
- TYPE_UNSPECIFIED = 0,
- ALL = 1,
- ANY = 2,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ ALL = "ALL",
+ ANY = "ANY",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function approvalStep_TypeFromJSON(object: any): ApprovalStep_Type {
@@ -177,6 +209,20 @@ export function approvalStep_TypeToJSON(object: ApprovalStep_Type): string {
}
}
+export function approvalStep_TypeToNumber(object: ApprovalStep_Type): number {
+ switch (object) {
+ case ApprovalStep_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case ApprovalStep_Type.ALL:
+ return 1;
+ case ApprovalStep_Type.ANY:
+ return 2;
+ case ApprovalStep_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface ApprovalNode {
type: ApprovalNode_Type;
groupValue?:
@@ -194,9 +240,9 @@ export interface ApprovalNode {
* See GroupValue below for the predefined user groups.
*/
export enum ApprovalNode_Type {
- TYPE_UNSPECIFIED = 0,
- ANY_IN_GROUP = 1,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ ANY_IN_GROUP = "ANY_IN_GROUP",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function approvalNode_TypeFromJSON(object: any): ApprovalNode_Type {
@@ -226,6 +272,18 @@ export function approvalNode_TypeToJSON(object: ApprovalNode_Type): string {
}
}
+export function approvalNode_TypeToNumber(object: ApprovalNode_Type): number {
+ switch (object) {
+ case ApprovalNode_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case ApprovalNode_Type.ANY_IN_GROUP:
+ return 1;
+ case ApprovalNode_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/**
* The predefined user groups are:
* - WORKSPACE_OWNER
@@ -234,12 +292,12 @@ export function approvalNode_TypeToJSON(object: ApprovalNode_Type): string {
* - PROJECT_MEMBER
*/
export enum ApprovalNode_GroupValue {
- GROUP_VALUE_UNSPECIFILED = 0,
- WORKSPACE_OWNER = 1,
- WORKSPACE_DBA = 2,
- PROJECT_OWNER = 3,
- PROJECT_MEMBER = 4,
- UNRECOGNIZED = -1,
+ GROUP_VALUE_UNSPECIFILED = "GROUP_VALUE_UNSPECIFILED",
+ WORKSPACE_OWNER = "WORKSPACE_OWNER",
+ WORKSPACE_DBA = "WORKSPACE_DBA",
+ PROJECT_OWNER = "PROJECT_OWNER",
+ PROJECT_MEMBER = "PROJECT_MEMBER",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function approvalNode_GroupValueFromJSON(object: any): ApprovalNode_GroupValue {
@@ -284,8 +342,32 @@ export function approvalNode_GroupValueToJSON(object: ApprovalNode_GroupValue):
}
}
+export function approvalNode_GroupValueToNumber(object: ApprovalNode_GroupValue): number {
+ switch (object) {
+ case ApprovalNode_GroupValue.GROUP_VALUE_UNSPECIFILED:
+ return 0;
+ case ApprovalNode_GroupValue.WORKSPACE_OWNER:
+ return 1;
+ case ApprovalNode_GroupValue.WORKSPACE_DBA:
+ return 2;
+ case ApprovalNode_GroupValue.PROJECT_OWNER:
+ return 3;
+ case ApprovalNode_GroupValue.PROJECT_MEMBER:
+ return 4;
+ case ApprovalNode_GroupValue.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
function createBaseIssuePayloadApproval(): IssuePayloadApproval {
- return { approvalTemplates: [], approvers: [], approvalFindingDone: false, approvalFindingError: "", riskLevel: 0 };
+ return {
+ approvalTemplates: [],
+ approvers: [],
+ approvalFindingDone: false,
+ approvalFindingError: "",
+ riskLevel: IssuePayloadApproval_RiskLevel.RISK_LEVEL_UNSPECIFIED,
+ };
}
export const IssuePayloadApproval = {
@@ -302,8 +384,8 @@ export const IssuePayloadApproval = {
if (message.approvalFindingError !== "") {
writer.uint32(34).string(message.approvalFindingError);
}
- if (message.riskLevel !== 0) {
- writer.uint32(40).int32(message.riskLevel);
+ if (message.riskLevel !== IssuePayloadApproval_RiskLevel.RISK_LEVEL_UNSPECIFIED) {
+ writer.uint32(40).int32(issuePayloadApproval_RiskLevelToNumber(message.riskLevel));
}
return writer;
},
@@ -348,7 +430,7 @@ export const IssuePayloadApproval = {
break;
}
- message.riskLevel = reader.int32() as any;
+ message.riskLevel = issuePayloadApproval_RiskLevelFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -369,7 +451,9 @@ export const IssuePayloadApproval = {
: [],
approvalFindingDone: isSet(object.approvalFindingDone) ? globalThis.Boolean(object.approvalFindingDone) : false,
approvalFindingError: isSet(object.approvalFindingError) ? globalThis.String(object.approvalFindingError) : "",
- riskLevel: isSet(object.riskLevel) ? issuePayloadApproval_RiskLevelFromJSON(object.riskLevel) : 0,
+ riskLevel: isSet(object.riskLevel)
+ ? issuePayloadApproval_RiskLevelFromJSON(object.riskLevel)
+ : IssuePayloadApproval_RiskLevel.RISK_LEVEL_UNSPECIFIED,
};
},
@@ -387,7 +471,7 @@ export const IssuePayloadApproval = {
if (message.approvalFindingError !== "") {
obj.approvalFindingError = message.approvalFindingError;
}
- if (message.riskLevel !== 0) {
+ if (message.riskLevel !== IssuePayloadApproval_RiskLevel.RISK_LEVEL_UNSPECIFIED) {
obj.riskLevel = issuePayloadApproval_RiskLevelToJSON(message.riskLevel);
}
return obj;
@@ -402,19 +486,19 @@ export const IssuePayloadApproval = {
message.approvers = object.approvers?.map((e) => IssuePayloadApproval_Approver.fromPartial(e)) || [];
message.approvalFindingDone = object.approvalFindingDone ?? false;
message.approvalFindingError = object.approvalFindingError ?? "";
- message.riskLevel = object.riskLevel ?? 0;
+ message.riskLevel = object.riskLevel ?? IssuePayloadApproval_RiskLevel.RISK_LEVEL_UNSPECIFIED;
return message;
},
};
function createBaseIssuePayloadApproval_Approver(): IssuePayloadApproval_Approver {
- return { status: 0, principalId: 0 };
+ return { status: IssuePayloadApproval_Approver_Status.STATUS_UNSPECIFIED, principalId: 0 };
}
export const IssuePayloadApproval_Approver = {
encode(message: IssuePayloadApproval_Approver, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.status !== 0) {
- writer.uint32(8).int32(message.status);
+ if (message.status !== IssuePayloadApproval_Approver_Status.STATUS_UNSPECIFIED) {
+ writer.uint32(8).int32(issuePayloadApproval_Approver_StatusToNumber(message.status));
}
if (message.principalId !== 0) {
writer.uint32(16).int32(message.principalId);
@@ -434,7 +518,7 @@ export const IssuePayloadApproval_Approver = {
break;
}
- message.status = reader.int32() as any;
+ message.status = issuePayloadApproval_Approver_StatusFromJSON(reader.int32());
continue;
case 2:
if (tag !== 16) {
@@ -454,14 +538,16 @@ export const IssuePayloadApproval_Approver = {
fromJSON(object: any): IssuePayloadApproval_Approver {
return {
- status: isSet(object.status) ? issuePayloadApproval_Approver_StatusFromJSON(object.status) : 0,
+ status: isSet(object.status)
+ ? issuePayloadApproval_Approver_StatusFromJSON(object.status)
+ : IssuePayloadApproval_Approver_Status.STATUS_UNSPECIFIED,
principalId: isSet(object.principalId) ? globalThis.Number(object.principalId) : 0,
};
},
toJSON(message: IssuePayloadApproval_Approver): unknown {
const obj: any = {};
- if (message.status !== 0) {
+ if (message.status !== IssuePayloadApproval_Approver_Status.STATUS_UNSPECIFIED) {
obj.status = issuePayloadApproval_Approver_StatusToJSON(message.status);
}
if (message.principalId !== 0) {
@@ -475,7 +561,7 @@ export const IssuePayloadApproval_Approver = {
},
fromPartial(object: DeepPartial<IssuePayloadApproval_Approver>): IssuePayloadApproval_Approver {
const message = createBaseIssuePayloadApproval_Approver();
- message.status = object.status ?? 0;
+ message.status = object.status ?? IssuePayloadApproval_Approver_Status.STATUS_UNSPECIFIED;
message.principalId = object.principalId ?? 0;
return message;
},
@@ -647,13 +733,13 @@ export const ApprovalFlow = {
};
function createBaseApprovalStep(): ApprovalStep {
- return { type: 0, nodes: [] };
+ return { type: ApprovalStep_Type.TYPE_UNSPECIFIED, nodes: [] };
}
export const ApprovalStep = {
encode(message: ApprovalStep, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.type !== 0) {
- writer.uint32(8).int32(message.type);
+ if (message.type !== ApprovalStep_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(8).int32(approvalStep_TypeToNumber(message.type));
}
for (const v of message.nodes) {
ApprovalNode.encode(v!, writer.uint32(18).fork()).ldelim();
@@ -673,7 +759,7 @@ export const ApprovalStep = {
break;
}
- message.type = reader.int32() as any;
+ message.type = approvalStep_TypeFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -693,14 +779,14 @@ export const ApprovalStep = {
fromJSON(object: any): ApprovalStep {
return {
- type: isSet(object.type) ? approvalStep_TypeFromJSON(object.type) : 0,
+ 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 !== 0) {
+ if (message.type !== ApprovalStep_Type.TYPE_UNSPECIFIED) {
obj.type = approvalStep_TypeToJSON(message.type);
}
if (message.nodes?.length) {
@@ -714,23 +800,28 @@ export const ApprovalStep = {
},
fromPartial(object: DeepPartial<ApprovalStep>): ApprovalStep {
const message = createBaseApprovalStep();
- message.type = object.type ?? 0;
+ message.type = object.type ?? ApprovalStep_Type.TYPE_UNSPECIFIED;
message.nodes = object.nodes?.map((e) => ApprovalNode.fromPartial(e)) || [];
return message;
},
};
function createBaseApprovalNode(): ApprovalNode {
- return { type: 0, groupValue: undefined, role: undefined, externalNodeId: undefined };
+ return {
+ type: ApprovalNode_Type.TYPE_UNSPECIFIED,
+ groupValue: undefined,
+ role: undefined,
+ externalNodeId: undefined,
+ };
}
export const ApprovalNode = {
encode(message: ApprovalNode, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.type !== 0) {
- writer.uint32(8).int32(message.type);
+ if (message.type !== ApprovalNode_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(8).int32(approvalNode_TypeToNumber(message.type));
}
if (message.groupValue !== undefined) {
- writer.uint32(16).int32(message.groupValue);
+ writer.uint32(16).int32(approvalNode_GroupValueToNumber(message.groupValue));
}
if (message.role !== undefined) {
writer.uint32(26).string(message.role);
@@ -753,14 +844,14 @@ export const ApprovalNode = {
break;
}
- message.type = reader.int32() as any;
+ message.type = approvalNode_TypeFromJSON(reader.int32());
continue;
case 2:
if (tag !== 16) {
break;
}
- message.groupValue = reader.int32() as any;
+ message.groupValue = approvalNode_GroupValueFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -787,7 +878,7 @@ export const ApprovalNode = {
fromJSON(object: any): ApprovalNode {
return {
- type: isSet(object.type) ? approvalNode_TypeFromJSON(object.type) : 0,
+ type: isSet(object.type) ? approvalNode_TypeFromJSON(object.type) : ApprovalNode_Type.TYPE_UNSPECIFIED,
groupValue: isSet(object.groupValue) ? approvalNode_GroupValueFromJSON(object.groupValue) : undefined,
role: isSet(object.role) ? globalThis.String(object.role) : undefined,
externalNodeId: isSet(object.externalNodeId) ? globalThis.String(object.externalNodeId) : undefined,
@@ -796,7 +887,7 @@ export const ApprovalNode = {
toJSON(message: ApprovalNode): unknown {
const obj: any = {};
- if (message.type !== 0) {
+ if (message.type !== ApprovalNode_Type.TYPE_UNSPECIFIED) {
obj.type = approvalNode_TypeToJSON(message.type);
}
if (message.groupValue !== undefined) {
@@ -816,7 +907,7 @@ export const ApprovalNode = {
},
fromPartial(object: DeepPartial<ApprovalNode>): ApprovalNode {
const message = createBaseApprovalNode();
- message.type = object.type ?? 0;
+ message.type = object.type ?? ApprovalNode_Type.TYPE_UNSPECIFIED;
message.groupValue = object.groupValue ?? undefined;
message.role = object.role ?? undefined;
message.externalNodeId = object.externalNodeId ?? undefined;
diff --git a/frontend/src/types/proto/store/audit_log.ts b/frontend/src/types/proto/store/audit_log.ts
index 5c2be91689..eca79ce1a4 100644
--- a/frontend/src/types/proto/store/audit_log.ts
+++ b/frontend/src/types/proto/store/audit_log.ts
@@ -34,16 +34,16 @@ export interface AuditLog {
}
export enum AuditLog_Severity {
- DEFAULT = 0,
- DEBUG = 1,
- INFO = 2,
- NOTICE = 3,
- WARNING = 4,
- ERROR = 5,
- CRITICAL = 6,
- ALERT = 7,
- EMERGENCY = 8,
- UNRECOGNIZED = -1,
+ DEFAULT = "DEFAULT",
+ DEBUG = "DEBUG",
+ INFO = "INFO",
+ NOTICE = "NOTICE",
+ WARNING = "WARNING",
+ ERROR = "ERROR",
+ CRITICAL = "CRITICAL",
+ ALERT = "ALERT",
+ EMERGENCY = "EMERGENCY",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function auditLog_SeverityFromJSON(object: any): AuditLog_Severity {
@@ -108,8 +108,43 @@ export function auditLog_SeverityToJSON(object: AuditLog_Severity): string {
}
}
+export function auditLog_SeverityToNumber(object: AuditLog_Severity): number {
+ switch (object) {
+ case AuditLog_Severity.DEFAULT:
+ return 0;
+ case AuditLog_Severity.DEBUG:
+ return 1;
+ case AuditLog_Severity.INFO:
+ return 2;
+ case AuditLog_Severity.NOTICE:
+ return 3;
+ case AuditLog_Severity.WARNING:
+ return 4;
+ case AuditLog_Severity.ERROR:
+ return 5;
+ case AuditLog_Severity.CRITICAL:
+ return 6;
+ case AuditLog_Severity.ALERT:
+ return 7;
+ case AuditLog_Severity.EMERGENCY:
+ return 8;
+ case AuditLog_Severity.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
function createBaseAuditLog(): AuditLog {
- return { parent: "", method: "", resource: "", user: "", severity: 0, request: "", response: "", status: undefined };
+ return {
+ parent: "",
+ method: "",
+ resource: "",
+ user: "",
+ severity: AuditLog_Severity.DEFAULT,
+ request: "",
+ response: "",
+ status: undefined,
+ };
}
export const AuditLog = {
@@ -126,8 +161,8 @@ export const AuditLog = {
if (message.user !== "") {
writer.uint32(34).string(message.user);
}
- if (message.severity !== 0) {
- writer.uint32(40).int32(message.severity);
+ if (message.severity !== AuditLog_Severity.DEFAULT) {
+ writer.uint32(40).int32(auditLog_SeverityToNumber(message.severity));
}
if (message.request !== "") {
writer.uint32(50).string(message.request);
@@ -181,7 +216,7 @@ export const AuditLog = {
break;
}
- message.severity = reader.int32() as any;
+ message.severity = auditLog_SeverityFromJSON(reader.int32());
continue;
case 6:
if (tag !== 50) {
@@ -219,7 +254,7 @@ export const AuditLog = {
method: isSet(object.method) ? globalThis.String(object.method) : "",
resource: isSet(object.resource) ? globalThis.String(object.resource) : "",
user: isSet(object.user) ? globalThis.String(object.user) : "",
- severity: isSet(object.severity) ? auditLog_SeverityFromJSON(object.severity) : 0,
+ severity: isSet(object.severity) ? auditLog_SeverityFromJSON(object.severity) : AuditLog_Severity.DEFAULT,
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,
@@ -240,7 +275,7 @@ export const AuditLog = {
if (message.user !== "") {
obj.user = message.user;
}
- if (message.severity !== 0) {
+ if (message.severity !== AuditLog_Severity.DEFAULT) {
obj.severity = auditLog_SeverityToJSON(message.severity);
}
if (message.request !== "") {
@@ -264,7 +299,7 @@ export const AuditLog = {
message.method = object.method ?? "";
message.resource = object.resource ?? "";
message.user = object.user ?? "";
- message.severity = object.severity ?? 0;
+ message.severity = object.severity ?? AuditLog_Severity.DEFAULT;
message.request = object.request ?? "";
message.response = object.response ?? "";
message.status = (object.status !== undefined && object.status !== null)
diff --git a/frontend/src/types/proto/store/common.ts b/frontend/src/types/proto/store/common.ts
index 1b0a581717..75b0484fc4 100644
--- a/frontend/src/types/proto/store/common.ts
+++ b/frontend/src/types/proto/store/common.ts
@@ -5,29 +5,29 @@ import _m0 from "protobufjs/minimal";
export const protobufPackage = "bytebase.store";
export enum Engine {
- ENGINE_UNSPECIFIED = 0,
- CLICKHOUSE = 1,
- MYSQL = 2,
- POSTGRES = 3,
- SNOWFLAKE = 4,
- SQLITE = 5,
- TIDB = 6,
- MONGODB = 7,
- REDIS = 8,
- ORACLE = 9,
- SPANNER = 10,
- MSSQL = 11,
- REDSHIFT = 12,
- MARIADB = 13,
- OCEANBASE = 14,
- DM = 15,
- RISINGWAVE = 16,
- OCEANBASE_ORACLE = 17,
- STARROCKS = 18,
- DORIS = 19,
- HIVE = 20,
- ELASTICSEARCH = 21,
- UNRECOGNIZED = -1,
+ ENGINE_UNSPECIFIED = "ENGINE_UNSPECIFIED",
+ CLICKHOUSE = "CLICKHOUSE",
+ MYSQL = "MYSQL",
+ POSTGRES = "POSTGRES",
+ SNOWFLAKE = "SNOWFLAKE",
+ SQLITE = "SQLITE",
+ TIDB = "TIDB",
+ MONGODB = "MONGODB",
+ REDIS = "REDIS",
+ ORACLE = "ORACLE",
+ SPANNER = "SPANNER",
+ MSSQL = "MSSQL",
+ REDSHIFT = "REDSHIFT",
+ MARIADB = "MARIADB",
+ OCEANBASE = "OCEANBASE",
+ DM = "DM",
+ RISINGWAVE = "RISINGWAVE",
+ OCEANBASE_ORACLE = "OCEANBASE_ORACLE",
+ STARROCKS = "STARROCKS",
+ DORIS = "DORIS",
+ HIVE = "HIVE",
+ ELASTICSEARCH = "ELASTICSEARCH",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function engineFromJSON(object: any): Engine {
@@ -157,17 +157,69 @@ export function engineToJSON(object: Engine): string {
}
}
+export function engineToNumber(object: Engine): number {
+ switch (object) {
+ case Engine.ENGINE_UNSPECIFIED:
+ return 0;
+ case Engine.CLICKHOUSE:
+ return 1;
+ case Engine.MYSQL:
+ return 2;
+ case Engine.POSTGRES:
+ return 3;
+ case Engine.SNOWFLAKE:
+ return 4;
+ case Engine.SQLITE:
+ return 5;
+ case Engine.TIDB:
+ return 6;
+ case Engine.MONGODB:
+ return 7;
+ case Engine.REDIS:
+ return 8;
+ case Engine.ORACLE:
+ return 9;
+ case Engine.SPANNER:
+ return 10;
+ case Engine.MSSQL:
+ return 11;
+ case Engine.REDSHIFT:
+ return 12;
+ case Engine.MARIADB:
+ return 13;
+ case Engine.OCEANBASE:
+ return 14;
+ case Engine.DM:
+ return 15;
+ case Engine.RISINGWAVE:
+ return 16;
+ case Engine.OCEANBASE_ORACLE:
+ return 17;
+ case Engine.STARROCKS:
+ return 18;
+ case Engine.DORIS:
+ return 19;
+ case Engine.HIVE:
+ return 20;
+ case Engine.ELASTICSEARCH:
+ return 21;
+ case Engine.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum VCSType {
- VCS_TYPE_UNSPECIFIED = 0,
+ VCS_TYPE_UNSPECIFIED = "VCS_TYPE_UNSPECIFIED",
/** GITHUB - GitHub type. Using for GitHub community edition(ce). */
- GITHUB = 1,
+ GITHUB = "GITHUB",
/** GITLAB - GitLab type. Using for GitLab community edition(ce) and enterprise edition(ee). */
- GITLAB = 2,
+ GITLAB = "GITLAB",
/** BITBUCKET - BitBucket type. Using for BitBucket cloud or BitBucket server. */
- BITBUCKET = 3,
+ BITBUCKET = "BITBUCKET",
/** AZURE_DEVOPS - Azure DevOps. Using for Azure DevOps GitOps workflow. */
- AZURE_DEVOPS = 4,
- UNRECOGNIZED = -1,
+ AZURE_DEVOPS = "AZURE_DEVOPS",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function vCSTypeFromJSON(object: any): VCSType {
@@ -212,12 +264,30 @@ export function vCSTypeToJSON(object: VCSType): string {
}
}
+export function vCSTypeToNumber(object: VCSType): number {
+ switch (object) {
+ case VCSType.VCS_TYPE_UNSPECIFIED:
+ return 0;
+ case VCSType.GITHUB:
+ return 1;
+ case VCSType.GITLAB:
+ return 2;
+ case VCSType.BITBUCKET:
+ return 3;
+ case VCSType.AZURE_DEVOPS:
+ return 4;
+ case VCSType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum MaskingLevel {
- MASKING_LEVEL_UNSPECIFIED = 0,
- NONE = 1,
- PARTIAL = 2,
- FULL = 3,
- UNRECOGNIZED = -1,
+ MASKING_LEVEL_UNSPECIFIED = "MASKING_LEVEL_UNSPECIFIED",
+ NONE = "NONE",
+ PARTIAL = "PARTIAL",
+ FULL = "FULL",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function maskingLevelFromJSON(object: any): MaskingLevel {
@@ -257,13 +327,29 @@ export function maskingLevelToJSON(object: MaskingLevel): string {
}
}
+export function maskingLevelToNumber(object: MaskingLevel): number {
+ switch (object) {
+ case MaskingLevel.MASKING_LEVEL_UNSPECIFIED:
+ return 0;
+ case MaskingLevel.NONE:
+ return 1;
+ case MaskingLevel.PARTIAL:
+ return 2;
+ case MaskingLevel.FULL:
+ return 3;
+ case MaskingLevel.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum ExportFormat {
- FORMAT_UNSPECIFIED = 0,
- CSV = 1,
- JSON = 2,
- SQL = 3,
- XLSX = 4,
- UNRECOGNIZED = -1,
+ FORMAT_UNSPECIFIED = "FORMAT_UNSPECIFIED",
+ CSV = "CSV",
+ JSON = "JSON",
+ SQL = "SQL",
+ XLSX = "XLSX",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function exportFormatFromJSON(object: any): ExportFormat {
@@ -308,6 +394,24 @@ export function exportFormatToJSON(object: ExportFormat): string {
}
}
+export function exportFormatToNumber(object: ExportFormat): number {
+ switch (object) {
+ case ExportFormat.FORMAT_UNSPECIFIED:
+ return 0;
+ case ExportFormat.CSV:
+ return 1;
+ case ExportFormat.JSON:
+ return 2;
+ case ExportFormat.SQL:
+ return 3;
+ case ExportFormat.XLSX:
+ return 4;
+ case ExportFormat.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/** Used internally for obfuscating the page token. */
export interface PageToken {
limit: number;
diff --git a/frontend/src/types/proto/store/data_source.ts b/frontend/src/types/proto/store/data_source.ts
index 14cb9bce72..e819686e3c 100644
--- a/frontend/src/types/proto/store/data_source.ts
+++ b/frontend/src/types/proto/store/data_source.ts
@@ -21,14 +21,14 @@ export interface DataSourceExternalSecret {
}
export enum DataSourceExternalSecret_SecretType {
- SAECRET_TYPE_UNSPECIFIED = 0,
+ SAECRET_TYPE_UNSPECIFIED = "SAECRET_TYPE_UNSPECIFIED",
/** VAULT_KV_V2 - ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2 */
- VAULT_KV_V2 = 1,
+ VAULT_KV_V2 = "VAULT_KV_V2",
/** AWS_SECRETS_MANAGER - ref: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html */
- AWS_SECRETS_MANAGER = 2,
+ AWS_SECRETS_MANAGER = "AWS_SECRETS_MANAGER",
/** GCP_SECRET_MANAGER - ref: https://cloud.google.com/secret-manager/docs */
- GCP_SECRET_MANAGER = 3,
- UNRECOGNIZED = -1,
+ GCP_SECRET_MANAGER = "GCP_SECRET_MANAGER",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function dataSourceExternalSecret_SecretTypeFromJSON(object: any): DataSourceExternalSecret_SecretType {
@@ -68,13 +68,29 @@ export function dataSourceExternalSecret_SecretTypeToJSON(object: DataSourceExte
}
}
+export function dataSourceExternalSecret_SecretTypeToNumber(object: DataSourceExternalSecret_SecretType): number {
+ switch (object) {
+ case DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED:
+ return 0;
+ case DataSourceExternalSecret_SecretType.VAULT_KV_V2:
+ return 1;
+ case DataSourceExternalSecret_SecretType.AWS_SECRETS_MANAGER:
+ return 2;
+ case DataSourceExternalSecret_SecretType.GCP_SECRET_MANAGER:
+ return 3;
+ case DataSourceExternalSecret_SecretType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum DataSourceExternalSecret_AuthType {
- AUTH_TYPE_UNSPECIFIED = 0,
+ AUTH_TYPE_UNSPECIFIED = "AUTH_TYPE_UNSPECIFIED",
/** TOKEN - ref: https://developer.hashicorp.com/vault/docs/auth/token */
- TOKEN = 1,
+ TOKEN = "TOKEN",
/** VAULT_APP_ROLE - ref: https://developer.hashicorp.com/vault/docs/auth/approle */
- VAULT_APP_ROLE = 2,
- UNRECOGNIZED = -1,
+ VAULT_APP_ROLE = "VAULT_APP_ROLE",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function dataSourceExternalSecret_AuthTypeFromJSON(object: any): DataSourceExternalSecret_AuthType {
@@ -109,6 +125,20 @@ export function dataSourceExternalSecret_AuthTypeToJSON(object: DataSourceExtern
}
}
+export function dataSourceExternalSecret_AuthTypeToNumber(object: DataSourceExternalSecret_AuthType): number {
+ switch (object) {
+ case DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED:
+ return 0;
+ case DataSourceExternalSecret_AuthType.TOKEN:
+ return 1;
+ case DataSourceExternalSecret_AuthType.VAULT_APP_ROLE:
+ return 2;
+ case DataSourceExternalSecret_AuthType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface DataSourceExternalSecret_AppRoleAuthOption {
roleId: string;
/** the secret id for the role without ttl. */
@@ -119,10 +149,10 @@ export interface DataSourceExternalSecret_AppRoleAuthOption {
}
export enum DataSourceExternalSecret_AppRoleAuthOption_SecretType {
- SECRET_TYPE_UNSPECIFIED = 0,
- PLAIN = 1,
- ENVIRONMENT = 2,
- UNRECOGNIZED = -1,
+ SECRET_TYPE_UNSPECIFIED = "SECRET_TYPE_UNSPECIFIED",
+ PLAIN = "PLAIN",
+ ENVIRONMENT = "ENVIRONMENT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(
@@ -161,6 +191,22 @@ export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToJSON(
}
}
+export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToNumber(
+ object: DataSourceExternalSecret_AppRoleAuthOption_SecretType,
+): number {
+ switch (object) {
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED:
+ return 0;
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN:
+ return 1;
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.ENVIRONMENT:
+ return 2;
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface DataSourceOptions {
/** srv is a boolean flag that indicates whether the host is a DNS SRV record. */
srv: boolean;
@@ -193,11 +239,11 @@ export interface DataSourceOptions {
}
export enum DataSourceOptions_AuthenticationType {
- AUTHENTICATION_UNSPECIFIED = 0,
- PASSWORD = 1,
- GOOGLE_CLOUD_SQL_IAM = 2,
- AWS_RDS_IAM = 3,
- UNRECOGNIZED = -1,
+ AUTHENTICATION_UNSPECIFIED = "AUTHENTICATION_UNSPECIFIED",
+ PASSWORD = "PASSWORD",
+ GOOGLE_CLOUD_SQL_IAM = "GOOGLE_CLOUD_SQL_IAM",
+ AWS_RDS_IAM = "AWS_RDS_IAM",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function dataSourceOptions_AuthenticationTypeFromJSON(object: any): DataSourceOptions_AuthenticationType {
@@ -237,6 +283,22 @@ export function dataSourceOptions_AuthenticationTypeToJSON(object: DataSourceOpt
}
}
+export function dataSourceOptions_AuthenticationTypeToNumber(object: DataSourceOptions_AuthenticationType): number {
+ switch (object) {
+ case DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED:
+ return 0;
+ case DataSourceOptions_AuthenticationType.PASSWORD:
+ return 1;
+ case DataSourceOptions_AuthenticationType.GOOGLE_CLOUD_SQL_IAM:
+ return 2;
+ case DataSourceOptions_AuthenticationType.AWS_RDS_IAM:
+ return 3;
+ case DataSourceOptions_AuthenticationType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface SASLConfig {
krbConfig?: KerberosConfig | undefined;
plainConfig?: PlainSASLConfig | undefined;
@@ -258,9 +320,9 @@ export interface PlainSASLConfig {
function createBaseDataSourceExternalSecret(): DataSourceExternalSecret {
return {
- secretType: 0,
+ secretType: DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED,
url: "",
- authType: 0,
+ authType: DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED,
appRole: undefined,
token: undefined,
engineName: "",
@@ -271,14 +333,14 @@ function createBaseDataSourceExternalSecret(): DataSourceExternalSecret {
export const DataSourceExternalSecret = {
encode(message: DataSourceExternalSecret, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.secretType !== 0) {
- writer.uint32(8).int32(message.secretType);
+ if (message.secretType !== DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED) {
+ writer.uint32(8).int32(dataSourceExternalSecret_SecretTypeToNumber(message.secretType));
}
if (message.url !== "") {
writer.uint32(18).string(message.url);
}
- if (message.authType !== 0) {
- writer.uint32(24).int32(message.authType);
+ if (message.authType !== DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED) {
+ writer.uint32(24).int32(dataSourceExternalSecret_AuthTypeToNumber(message.authType));
}
if (message.appRole !== undefined) {
DataSourceExternalSecret_AppRoleAuthOption.encode(message.appRole, writer.uint32(34).fork()).ldelim();
@@ -310,7 +372,7 @@ export const DataSourceExternalSecret = {
break;
}
- message.secretType = reader.int32() as any;
+ message.secretType = dataSourceExternalSecret_SecretTypeFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -324,7 +386,7 @@ export const DataSourceExternalSecret = {
break;
}
- message.authType = reader.int32() as any;
+ message.authType = dataSourceExternalSecret_AuthTypeFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -372,9 +434,13 @@ export const DataSourceExternalSecret = {
fromJSON(object: any): DataSourceExternalSecret {
return {
- secretType: isSet(object.secretType) ? dataSourceExternalSecret_SecretTypeFromJSON(object.secretType) : 0,
+ 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) : 0,
+ 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) : "",
@@ -385,13 +451,13 @@ export const DataSourceExternalSecret = {
toJSON(message: DataSourceExternalSecret): unknown {
const obj: any = {};
- if (message.secretType !== 0) {
+ if (message.secretType !== DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED) {
obj.secretType = dataSourceExternalSecret_SecretTypeToJSON(message.secretType);
}
if (message.url !== "") {
obj.url = message.url;
}
- if (message.authType !== 0) {
+ if (message.authType !== DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED) {
obj.authType = dataSourceExternalSecret_AuthTypeToJSON(message.authType);
}
if (message.appRole !== undefined) {
@@ -417,9 +483,9 @@ export const DataSourceExternalSecret = {
},
fromPartial(object: DeepPartial<DataSourceExternalSecret>): DataSourceExternalSecret {
const message = createBaseDataSourceExternalSecret();
- message.secretType = object.secretType ?? 0;
+ message.secretType = object.secretType ?? DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED;
message.url = object.url ?? "";
- message.authType = object.authType ?? 0;
+ message.authType = object.authType ?? DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED;
message.appRole = (object.appRole !== undefined && object.appRole !== null)
? DataSourceExternalSecret_AppRoleAuthOption.fromPartial(object.appRole)
: undefined;
@@ -432,7 +498,12 @@ export const DataSourceExternalSecret = {
};
function createBaseDataSourceExternalSecret_AppRoleAuthOption(): DataSourceExternalSecret_AppRoleAuthOption {
- return { roleId: "", secretId: "", type: 0, mountPath: "" };
+ return {
+ roleId: "",
+ secretId: "",
+ type: DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED,
+ mountPath: "",
+ };
}
export const DataSourceExternalSecret_AppRoleAuthOption = {
@@ -443,8 +514,8 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
if (message.secretId !== "") {
writer.uint32(18).string(message.secretId);
}
- if (message.type !== 0) {
- writer.uint32(24).int32(message.type);
+ if (message.type !== DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED) {
+ writer.uint32(24).int32(dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToNumber(message.type));
}
if (message.mountPath !== "") {
writer.uint32(34).string(message.mountPath);
@@ -478,7 +549,7 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
break;
}
- message.type = reader.int32() as any;
+ message.type = dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -500,7 +571,9 @@ export const 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) : 0,
+ type: isSet(object.type)
+ ? dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(object.type)
+ : DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED,
mountPath: isSet(object.mountPath) ? globalThis.String(object.mountPath) : "",
};
},
@@ -513,7 +586,7 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
if (message.secretId !== "") {
obj.secretId = message.secretId;
}
- if (message.type !== 0) {
+ if (message.type !== DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED) {
obj.type = dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToJSON(message.type);
}
if (message.mountPath !== "") {
@@ -531,7 +604,7 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
const message = createBaseDataSourceExternalSecret_AppRoleAuthOption();
message.roleId = object.roleId ?? "";
message.secretId = object.secretId ?? "";
- message.type = object.type ?? 0;
+ message.type = object.type ?? DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED;
message.mountPath = object.mountPath ?? "";
return message;
},
@@ -550,7 +623,7 @@ function createBaseDataSourceOptions(): DataSourceOptions {
sshObfuscatedPrivateKey: "",
authenticationPrivateKeyObfuscated: "",
externalSecret: undefined,
- authenticationType: 0,
+ authenticationType: DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED,
saslConfig: undefined,
};
}
@@ -590,8 +663,8 @@ export const DataSourceOptions = {
if (message.externalSecret !== undefined) {
DataSourceExternalSecret.encode(message.externalSecret, writer.uint32(90).fork()).ldelim();
}
- if (message.authenticationType !== 0) {
- writer.uint32(96).int32(message.authenticationType);
+ if (message.authenticationType !== DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED) {
+ writer.uint32(96).int32(dataSourceOptions_AuthenticationTypeToNumber(message.authenticationType));
}
if (message.saslConfig !== undefined) {
SASLConfig.encode(message.saslConfig, writer.uint32(106).fork()).ldelim();
@@ -688,7 +761,7 @@ export const DataSourceOptions = {
break;
}
- message.authenticationType = reader.int32() as any;
+ message.authenticationType = dataSourceOptions_AuthenticationTypeFromJSON(reader.int32());
continue;
case 13:
if (tag !== 106) {
@@ -729,7 +802,7 @@ export const DataSourceOptions = {
: undefined,
authenticationType: isSet(object.authenticationType)
? dataSourceOptions_AuthenticationTypeFromJSON(object.authenticationType)
- : 0,
+ : DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED,
saslConfig: isSet(object.saslConfig) ? SASLConfig.fromJSON(object.saslConfig) : undefined,
};
},
@@ -769,7 +842,7 @@ export const DataSourceOptions = {
if (message.externalSecret !== undefined) {
obj.externalSecret = DataSourceExternalSecret.toJSON(message.externalSecret);
}
- if (message.authenticationType !== 0) {
+ if (message.authenticationType !== DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED) {
obj.authenticationType = dataSourceOptions_AuthenticationTypeToJSON(message.authenticationType);
}
if (message.saslConfig !== undefined) {
@@ -796,7 +869,8 @@ export const DataSourceOptions = {
message.externalSecret = (object.externalSecret !== undefined && object.externalSecret !== null)
? DataSourceExternalSecret.fromPartial(object.externalSecret)
: undefined;
- message.authenticationType = object.authenticationType ?? 0;
+ message.authenticationType = object.authenticationType ??
+ DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED;
message.saslConfig = (object.saslConfig !== undefined && object.saslConfig !== null)
? SASLConfig.fromPartial(object.saslConfig)
: undefined;
diff --git a/frontend/src/types/proto/store/database.ts b/frontend/src/types/proto/store/database.ts
index d7101395f1..372369d703 100644
--- a/frontend/src/types/proto/store/database.ts
+++ b/frontend/src/types/proto/store/database.ts
@@ -89,10 +89,10 @@ export interface TaskMetadata {
}
export enum TaskMetadata_State {
- STATE_UNSPECIFIED = 0,
- STATE_STARTED = 1,
- STATE_SUSPENDED = 2,
- UNRECOGNIZED = -1,
+ STATE_UNSPECIFIED = "STATE_UNSPECIFIED",
+ STATE_STARTED = "STATE_STARTED",
+ STATE_SUSPENDED = "STATE_SUSPENDED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function taskMetadata_StateFromJSON(object: any): TaskMetadata_State {
@@ -127,6 +127,20 @@ export function taskMetadata_StateToJSON(object: TaskMetadata_State): string {
}
}
+export function taskMetadata_StateToNumber(object: TaskMetadata_State): number {
+ switch (object) {
+ case TaskMetadata_State.STATE_UNSPECIFIED:
+ return 0;
+ case TaskMetadata_State.STATE_STARTED:
+ return 1;
+ case TaskMetadata_State.STATE_SUSPENDED:
+ return 2;
+ case TaskMetadata_State.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface StreamMetadata {
/** The name is the name of a stream. */
name: string;
@@ -147,9 +161,9 @@ export interface StreamMetadata {
}
export enum StreamMetadata_Type {
- TYPE_UNSPECIFIED = 0,
- TYPE_DELTA = 1,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ TYPE_DELTA = "TYPE_DELTA",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function streamMetadata_TypeFromJSON(object: any): StreamMetadata_Type {
@@ -179,12 +193,24 @@ export function streamMetadata_TypeToJSON(object: StreamMetadata_Type): string {
}
}
+export function streamMetadata_TypeToNumber(object: StreamMetadata_Type): number {
+ switch (object) {
+ case StreamMetadata_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case StreamMetadata_Type.TYPE_DELTA:
+ return 1;
+ case StreamMetadata_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum StreamMetadata_Mode {
- MODE_UNSPECIFIED = 0,
- MODE_DEFAULT = 1,
- MODE_APPEND_ONLY = 2,
- MODE_INSERT_ONLY = 3,
- UNRECOGNIZED = -1,
+ MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
+ MODE_DEFAULT = "MODE_DEFAULT",
+ MODE_APPEND_ONLY = "MODE_APPEND_ONLY",
+ MODE_INSERT_ONLY = "MODE_INSERT_ONLY",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function streamMetadata_ModeFromJSON(object: any): StreamMetadata_Mode {
@@ -224,6 +250,22 @@ export function streamMetadata_ModeToJSON(object: StreamMetadata_Mode): string {
}
}
+export function streamMetadata_ModeToNumber(object: StreamMetadata_Mode): number {
+ switch (object) {
+ case StreamMetadata_Mode.MODE_UNSPECIFIED:
+ return 0;
+ case StreamMetadata_Mode.MODE_DEFAULT:
+ return 1;
+ case StreamMetadata_Mode.MODE_APPEND_ONLY:
+ return 2;
+ case StreamMetadata_Mode.MODE_INSERT_ONLY:
+ return 3;
+ case StreamMetadata_Mode.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/** TableMetadata is the metadata for tables. */
export interface TableMetadata {
/** The name is the name of a table. */
@@ -314,16 +356,16 @@ export interface TablePartitionMetadata {
* PostgreSQL: RANGE, LIST, HASH (https://www.postgresql.org/docs/current/ddl-partitioning.html)
*/
export enum TablePartitionMetadata_Type {
- TYPE_UNSPECIFIED = 0,
- RANGE = 1,
- RANGE_COLUMNS = 2,
- LIST = 3,
- LIST_COLUMNS = 4,
- HASH = 5,
- LINEAR_HASH = 6,
- KEY = 7,
- LINEAR_KEY = 8,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ RANGE = "RANGE",
+ RANGE_COLUMNS = "RANGE_COLUMNS",
+ LIST = "LIST",
+ LIST_COLUMNS = "LIST_COLUMNS",
+ HASH = "HASH",
+ LINEAR_HASH = "LINEAR_HASH",
+ KEY = "KEY",
+ LINEAR_KEY = "LINEAR_KEY",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function tablePartitionMetadata_TypeFromJSON(object: any): TablePartitionMetadata_Type {
@@ -388,6 +430,32 @@ export function tablePartitionMetadata_TypeToJSON(object: TablePartitionMetadata
}
}
+export function tablePartitionMetadata_TypeToNumber(object: TablePartitionMetadata_Type): number {
+ switch (object) {
+ case TablePartitionMetadata_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case TablePartitionMetadata_Type.RANGE:
+ return 1;
+ case TablePartitionMetadata_Type.RANGE_COLUMNS:
+ return 2;
+ case TablePartitionMetadata_Type.LIST:
+ return 3;
+ case TablePartitionMetadata_Type.LIST_COLUMNS:
+ return 4;
+ case TablePartitionMetadata_Type.HASH:
+ return 5;
+ case TablePartitionMetadata_Type.LINEAR_HASH:
+ return 6;
+ case TablePartitionMetadata_Type.KEY:
+ return 7;
+ case TablePartitionMetadata_Type.LINEAR_KEY:
+ return 8;
+ case TablePartitionMetadata_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/** ColumnMetadata is the metadata for columns. */
export interface ColumnMetadata {
/** The name is the name of a column. */
@@ -1127,7 +1195,7 @@ function createBaseTaskMetadata(): TaskMetadata {
warehouse: "",
schedule: "",
predecessors: [],
- state: 0,
+ state: TaskMetadata_State.STATE_UNSPECIFIED,
condition: "",
definition: "",
};
@@ -1156,8 +1224,8 @@ export const TaskMetadata = {
for (const v of message.predecessors) {
writer.uint32(58).string(v!);
}
- if (message.state !== 0) {
- writer.uint32(64).int32(message.state);
+ if (message.state !== TaskMetadata_State.STATE_UNSPECIFIED) {
+ writer.uint32(64).int32(taskMetadata_StateToNumber(message.state));
}
if (message.condition !== "") {
writer.uint32(74).string(message.condition);
@@ -1229,7 +1297,7 @@ export const TaskMetadata = {
break;
}
- message.state = reader.int32() as any;
+ message.state = taskMetadata_StateFromJSON(reader.int32());
continue;
case 9:
if (tag !== 74) {
@@ -1265,7 +1333,7 @@ export const TaskMetadata = {
predecessors: globalThis.Array.isArray(object?.predecessors)
? object.predecessors.map((e: any) => globalThis.String(e))
: [],
- state: isSet(object.state) ? taskMetadata_StateFromJSON(object.state) : 0,
+ 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) : "",
};
@@ -1294,7 +1362,7 @@ export const TaskMetadata = {
if (message.predecessors?.length) {
obj.predecessors = message.predecessors;
}
- if (message.state !== 0) {
+ if (message.state !== TaskMetadata_State.STATE_UNSPECIFIED) {
obj.state = taskMetadata_StateToJSON(message.state);
}
if (message.condition !== "") {
@@ -1318,7 +1386,7 @@ export const TaskMetadata = {
message.warehouse = object.warehouse ?? "";
message.schedule = object.schedule ?? "";
message.predecessors = object.predecessors?.map((e) => e) || [];
- message.state = object.state ?? 0;
+ message.state = object.state ?? TaskMetadata_State.STATE_UNSPECIFIED;
message.condition = object.condition ?? "";
message.definition = object.definition ?? "";
return message;
@@ -1326,7 +1394,16 @@ export const TaskMetadata = {
};
function createBaseStreamMetadata(): StreamMetadata {
- return { name: "", tableName: "", owner: "", comment: "", type: 0, stale: false, mode: 0, definition: "" };
+ return {
+ name: "",
+ tableName: "",
+ owner: "",
+ comment: "",
+ type: StreamMetadata_Type.TYPE_UNSPECIFIED,
+ stale: false,
+ mode: StreamMetadata_Mode.MODE_UNSPECIFIED,
+ definition: "",
+ };
}
export const StreamMetadata = {
@@ -1343,14 +1420,14 @@ export const StreamMetadata = {
if (message.comment !== "") {
writer.uint32(34).string(message.comment);
}
- if (message.type !== 0) {
- writer.uint32(40).int32(message.type);
+ if (message.type !== StreamMetadata_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(40).int32(streamMetadata_TypeToNumber(message.type));
}
if (message.stale === true) {
writer.uint32(48).bool(message.stale);
}
- if (message.mode !== 0) {
- writer.uint32(56).int32(message.mode);
+ if (message.mode !== StreamMetadata_Mode.MODE_UNSPECIFIED) {
+ writer.uint32(56).int32(streamMetadata_ModeToNumber(message.mode));
}
if (message.definition !== "") {
writer.uint32(66).string(message.definition);
@@ -1398,7 +1475,7 @@ export const StreamMetadata = {
break;
}
- message.type = reader.int32() as any;
+ message.type = streamMetadata_TypeFromJSON(reader.int32());
continue;
case 6:
if (tag !== 48) {
@@ -1412,7 +1489,7 @@ export const StreamMetadata = {
break;
}
- message.mode = reader.int32() as any;
+ message.mode = streamMetadata_ModeFromJSON(reader.int32());
continue;
case 8:
if (tag !== 66) {
@@ -1436,9 +1513,9 @@ export const StreamMetadata = {
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) : 0,
+ 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) : 0,
+ mode: isSet(object.mode) ? streamMetadata_ModeFromJSON(object.mode) : StreamMetadata_Mode.MODE_UNSPECIFIED,
definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
};
},
@@ -1457,13 +1534,13 @@ export const StreamMetadata = {
if (message.comment !== "") {
obj.comment = message.comment;
}
- if (message.type !== 0) {
+ if (message.type !== StreamMetadata_Type.TYPE_UNSPECIFIED) {
obj.type = streamMetadata_TypeToJSON(message.type);
}
if (message.stale === true) {
obj.stale = message.stale;
}
- if (message.mode !== 0) {
+ if (message.mode !== StreamMetadata_Mode.MODE_UNSPECIFIED) {
obj.mode = streamMetadata_ModeToJSON(message.mode);
}
if (message.definition !== "") {
@@ -1481,9 +1558,9 @@ export const StreamMetadata = {
message.tableName = object.tableName ?? "";
message.owner = object.owner ?? "";
message.comment = object.comment ?? "";
- message.type = object.type ?? 0;
+ message.type = object.type ?? StreamMetadata_Type.TYPE_UNSPECIFIED;
message.stale = object.stale ?? false;
- message.mode = object.mode ?? 0;
+ message.mode = object.mode ?? StreamMetadata_Mode.MODE_UNSPECIFIED;
message.definition = object.definition ?? "";
return message;
},
@@ -1897,7 +1974,14 @@ export const ExternalTableMetadata = {
};
function createBaseTablePartitionMetadata(): TablePartitionMetadata {
- return { name: "", type: 0, expression: "", value: "", useDefault: "", subpartitions: [] };
+ return {
+ name: "",
+ type: TablePartitionMetadata_Type.TYPE_UNSPECIFIED,
+ expression: "",
+ value: "",
+ useDefault: "",
+ subpartitions: [],
+ };
}
export const TablePartitionMetadata = {
@@ -1905,8 +1989,8 @@ export const TablePartitionMetadata = {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
- if (message.type !== 0) {
- writer.uint32(16).int32(message.type);
+ if (message.type !== TablePartitionMetadata_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(16).int32(tablePartitionMetadata_TypeToNumber(message.type));
}
if (message.expression !== "") {
writer.uint32(26).string(message.expression);
@@ -1942,7 +2026,7 @@ export const TablePartitionMetadata = {
break;
}
- message.type = reader.int32() as any;
+ message.type = tablePartitionMetadata_TypeFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -1984,7 +2068,9 @@ export const TablePartitionMetadata = {
fromJSON(object: any): TablePartitionMetadata {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
- type: isSet(object.type) ? tablePartitionMetadata_TypeFromJSON(object.type) : 0,
+ 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) : "",
@@ -1999,7 +2085,7 @@ export const TablePartitionMetadata = {
if (message.name !== "") {
obj.name = message.name;
}
- if (message.type !== 0) {
+ if (message.type !== TablePartitionMetadata_Type.TYPE_UNSPECIFIED) {
obj.type = tablePartitionMetadata_TypeToJSON(message.type);
}
if (message.expression !== "") {
@@ -2023,7 +2109,7 @@ export const TablePartitionMetadata = {
fromPartial(object: DeepPartial<TablePartitionMetadata>): TablePartitionMetadata {
const message = createBaseTablePartitionMetadata();
message.name = object.name ?? "";
- message.type = object.type ?? 0;
+ message.type = object.type ?? TablePartitionMetadata_Type.TYPE_UNSPECIFIED;
message.expression = object.expression ?? "";
message.value = object.value ?? "";
message.useDefault = object.useDefault ?? "";
diff --git a/frontend/src/types/proto/store/export_archive.ts b/frontend/src/types/proto/store/export_archive.ts
index 83b49a657d..9bb17f70da 100644
--- a/frontend/src/types/proto/store/export_archive.ts
+++ b/frontend/src/types/proto/store/export_archive.ts
@@ -1,7 +1,7 @@
/* eslint-disable */
import Long from "long";
import _m0 from "protobufjs/minimal";
-import { ExportFormat, exportFormatFromJSON, exportFormatToJSON } from "./common";
+import { ExportFormat, exportFormatFromJSON, exportFormatToJSON, exportFormatToNumber } from "./common";
export const protobufPackage = "bytebase.store";
@@ -11,13 +11,13 @@ export interface ExportArchivePayload {
}
function createBaseExportArchivePayload(): ExportArchivePayload {
- return { fileFormat: 0 };
+ return { fileFormat: ExportFormat.FORMAT_UNSPECIFIED };
}
export const ExportArchivePayload = {
encode(message: ExportArchivePayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.fileFormat !== 0) {
- writer.uint32(8).int32(message.fileFormat);
+ if (message.fileFormat !== ExportFormat.FORMAT_UNSPECIFIED) {
+ writer.uint32(8).int32(exportFormatToNumber(message.fileFormat));
}
return writer;
},
@@ -34,7 +34,7 @@ export const ExportArchivePayload = {
break;
}
- message.fileFormat = reader.int32() as any;
+ message.fileFormat = exportFormatFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -46,12 +46,14 @@ export const ExportArchivePayload = {
},
fromJSON(object: any): ExportArchivePayload {
- return { fileFormat: isSet(object.fileFormat) ? exportFormatFromJSON(object.fileFormat) : 0 };
+ return {
+ fileFormat: isSet(object.fileFormat) ? exportFormatFromJSON(object.fileFormat) : ExportFormat.FORMAT_UNSPECIFIED,
+ };
},
toJSON(message: ExportArchivePayload): unknown {
const obj: any = {};
- if (message.fileFormat !== 0) {
+ if (message.fileFormat !== ExportFormat.FORMAT_UNSPECIFIED) {
obj.fileFormat = exportFormatToJSON(message.fileFormat);
}
return obj;
@@ -62,7 +64,7 @@ export const ExportArchivePayload = {
},
fromPartial(object: DeepPartial<ExportArchivePayload>): ExportArchivePayload {
const message = createBaseExportArchivePayload();
- message.fileFormat = object.fileFormat ?? 0;
+ message.fileFormat = object.fileFormat ?? ExportFormat.FORMAT_UNSPECIFIED;
return message;
},
};
diff --git a/frontend/src/types/proto/store/idp.ts b/frontend/src/types/proto/store/idp.ts
index d3d6582699..a0a248cb28 100644
--- a/frontend/src/types/proto/store/idp.ts
+++ b/frontend/src/types/proto/store/idp.ts
@@ -5,11 +5,11 @@ import _m0 from "protobufjs/minimal";
export const protobufPackage = "bytebase.store";
export enum IdentityProviderType {
- IDENTITY_PROVIDER_TYPE_UNSPECIFIED = 0,
- OAUTH2 = 1,
- OIDC = 2,
- LDAP = 3,
- UNRECOGNIZED = -1,
+ IDENTITY_PROVIDER_TYPE_UNSPECIFIED = "IDENTITY_PROVIDER_TYPE_UNSPECIFIED",
+ OAUTH2 = "OAUTH2",
+ OIDC = "OIDC",
+ LDAP = "LDAP",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function identityProviderTypeFromJSON(object: any): IdentityProviderType {
@@ -49,19 +49,35 @@ export function identityProviderTypeToJSON(object: IdentityProviderType): string
}
}
+export function identityProviderTypeToNumber(object: IdentityProviderType): number {
+ switch (object) {
+ case IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED:
+ return 0;
+ case IdentityProviderType.OAUTH2:
+ return 1;
+ case IdentityProviderType.OIDC:
+ return 2;
+ case IdentityProviderType.LDAP:
+ return 3;
+ case IdentityProviderType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum OAuth2AuthStyle {
- OAUTH2_AUTH_STYLE_UNSPECIFIED = 0,
+ OAUTH2_AUTH_STYLE_UNSPECIFIED = "OAUTH2_AUTH_STYLE_UNSPECIFIED",
/**
* IN_PARAMS - IN_PARAMS sends the "client_id" and "client_secret" in the POST body
* as application/x-www-form-urlencoded parameters.
*/
- IN_PARAMS = 1,
+ IN_PARAMS = "IN_PARAMS",
/**
* IN_HEADER - IN_HEADER sends the client_id and client_password using HTTP Basic Authorization.
* This is an optional style described in the OAuth2 RFC 6749 section 2.3.1.
*/
- IN_HEADER = 2,
- UNRECOGNIZED = -1,
+ IN_HEADER = "IN_HEADER",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function oAuth2AuthStyleFromJSON(object: any): OAuth2AuthStyle {
@@ -96,6 +112,20 @@ export function oAuth2AuthStyleToJSON(object: OAuth2AuthStyle): string {
}
}
+export function oAuth2AuthStyleToNumber(object: OAuth2AuthStyle): number {
+ switch (object) {
+ case OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED:
+ return 0;
+ case OAuth2AuthStyle.IN_PARAMS:
+ return 1;
+ case OAuth2AuthStyle.IN_HEADER:
+ return 2;
+ case OAuth2AuthStyle.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface IdentityProviderConfig {
oauth2Config?: OAuth2IdentityProviderConfig | undefined;
oidcConfig?: OIDCIdentityProviderConfig | undefined;
@@ -301,7 +331,7 @@ function createBaseOAuth2IdentityProviderConfig(): OAuth2IdentityProviderConfig
scopes: [],
fieldMapping: undefined,
skipTlsVerify: false,
- authStyle: 0,
+ authStyle: OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
};
}
@@ -331,8 +361,8 @@ export const OAuth2IdentityProviderConfig = {
if (message.skipTlsVerify === true) {
writer.uint32(64).bool(message.skipTlsVerify);
}
- if (message.authStyle !== 0) {
- writer.uint32(72).int32(message.authStyle);
+ if (message.authStyle !== OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED) {
+ writer.uint32(72).int32(oAuth2AuthStyleToNumber(message.authStyle));
}
return writer;
},
@@ -405,7 +435,7 @@ export const OAuth2IdentityProviderConfig = {
break;
}
- message.authStyle = reader.int32() as any;
+ message.authStyle = oAuth2AuthStyleFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -426,7 +456,9 @@ export const OAuth2IdentityProviderConfig = {
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) : 0,
+ authStyle: isSet(object.authStyle)
+ ? oAuth2AuthStyleFromJSON(object.authStyle)
+ : OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
};
},
@@ -456,7 +488,7 @@ export const OAuth2IdentityProviderConfig = {
if (message.skipTlsVerify === true) {
obj.skipTlsVerify = message.skipTlsVerify;
}
- if (message.authStyle !== 0) {
+ if (message.authStyle !== OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED) {
obj.authStyle = oAuth2AuthStyleToJSON(message.authStyle);
}
return obj;
@@ -477,13 +509,20 @@ export const OAuth2IdentityProviderConfig = {
? FieldMapping.fromPartial(object.fieldMapping)
: undefined;
message.skipTlsVerify = object.skipTlsVerify ?? false;
- message.authStyle = object.authStyle ?? 0;
+ message.authStyle = object.authStyle ?? OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED;
return message;
},
};
function createBaseOIDCIdentityProviderConfig(): OIDCIdentityProviderConfig {
- return { issuer: "", clientId: "", clientSecret: "", fieldMapping: undefined, skipTlsVerify: false, authStyle: 0 };
+ return {
+ issuer: "",
+ clientId: "",
+ clientSecret: "",
+ fieldMapping: undefined,
+ skipTlsVerify: false,
+ authStyle: OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
+ };
}
export const OIDCIdentityProviderConfig = {
@@ -503,8 +542,8 @@ export const OIDCIdentityProviderConfig = {
if (message.skipTlsVerify === true) {
writer.uint32(40).bool(message.skipTlsVerify);
}
- if (message.authStyle !== 0) {
- writer.uint32(48).int32(message.authStyle);
+ if (message.authStyle !== OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED) {
+ writer.uint32(48).int32(oAuth2AuthStyleToNumber(message.authStyle));
}
return writer;
},
@@ -556,7 +595,7 @@ export const OIDCIdentityProviderConfig = {
break;
}
- message.authStyle = reader.int32() as any;
+ message.authStyle = oAuth2AuthStyleFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -574,7 +613,9 @@ export const OIDCIdentityProviderConfig = {
clientSecret: isSet(object.clientSecret) ? globalThis.String(object.clientSecret) : "",
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) : 0,
+ authStyle: isSet(object.authStyle)
+ ? oAuth2AuthStyleFromJSON(object.authStyle)
+ : OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
};
},
@@ -595,7 +636,7 @@ export const OIDCIdentityProviderConfig = {
if (message.skipTlsVerify === true) {
obj.skipTlsVerify = message.skipTlsVerify;
}
- if (message.authStyle !== 0) {
+ if (message.authStyle !== OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED) {
obj.authStyle = oAuth2AuthStyleToJSON(message.authStyle);
}
return obj;
@@ -613,7 +654,7 @@ export const OIDCIdentityProviderConfig = {
? FieldMapping.fromPartial(object.fieldMapping)
: undefined;
message.skipTlsVerify = object.skipTlsVerify ?? false;
- message.authStyle = object.authStyle ?? 0;
+ message.authStyle = object.authStyle ?? OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED;
return message;
},
};
diff --git a/frontend/src/types/proto/store/issue_comment.ts b/frontend/src/types/proto/store/issue_comment.ts
index 0663ef5fcd..6f7d058683 100644
--- a/frontend/src/types/proto/store/issue_comment.ts
+++ b/frontend/src/types/proto/store/issue_comment.ts
@@ -19,11 +19,11 @@ export interface IssueCommentPayload_Approval {
}
export enum IssueCommentPayload_Approval_Status {
- STATUS_UNSPECIFIED = 0,
- PENDING = 1,
- APPROVED = 2,
- REJECTED = 3,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ PENDING = "PENDING",
+ APPROVED = "APPROVED",
+ REJECTED = "REJECTED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function issueCommentPayload_Approval_StatusFromJSON(object: any): IssueCommentPayload_Approval_Status {
@@ -63,6 +63,22 @@ export function issueCommentPayload_Approval_StatusToJSON(object: IssueCommentPa
}
}
+export function issueCommentPayload_Approval_StatusToNumber(object: IssueCommentPayload_Approval_Status): number {
+ switch (object) {
+ case IssueCommentPayload_Approval_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case IssueCommentPayload_Approval_Status.PENDING:
+ return 1;
+ case IssueCommentPayload_Approval_Status.APPROVED:
+ return 2;
+ case IssueCommentPayload_Approval_Status.REJECTED:
+ return 3;
+ case IssueCommentPayload_Approval_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface IssueCommentPayload_IssueUpdate {
fromTitle?: string | undefined;
toTitle?: string | undefined;
@@ -81,11 +97,11 @@ export interface IssueCommentPayload_IssueUpdate {
}
export enum IssueCommentPayload_IssueUpdate_IssueStatus {
- ISSUE_STATUS_UNSPECIFIED = 0,
- OPEN = 1,
- DONE = 2,
- CANCELED = 3,
- UNRECOGNIZED = -1,
+ ISSUE_STATUS_UNSPECIFIED = "ISSUE_STATUS_UNSPECIFIED",
+ OPEN = "OPEN",
+ DONE = "DONE",
+ CANCELED = "CANCELED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function issueCommentPayload_IssueUpdate_IssueStatusFromJSON(
@@ -129,6 +145,24 @@ export function issueCommentPayload_IssueUpdate_IssueStatusToJSON(
}
}
+export function issueCommentPayload_IssueUpdate_IssueStatusToNumber(
+ object: IssueCommentPayload_IssueUpdate_IssueStatus,
+): number {
+ switch (object) {
+ case IssueCommentPayload_IssueUpdate_IssueStatus.ISSUE_STATUS_UNSPECIFIED:
+ return 0;
+ case IssueCommentPayload_IssueUpdate_IssueStatus.OPEN:
+ return 1;
+ case IssueCommentPayload_IssueUpdate_IssueStatus.DONE:
+ return 2;
+ case IssueCommentPayload_IssueUpdate_IssueStatus.CANCELED:
+ return 3;
+ case IssueCommentPayload_IssueUpdate_IssueStatus.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface IssueCommentPayload_StageEnd {
stage: string;
}
@@ -147,14 +181,14 @@ export interface IssueCommentPayload_TaskUpdate {
}
export enum IssueCommentPayload_TaskUpdate_Status {
- STATUS_UNSPECIFIED = 0,
- PENDING = 1,
- RUNNING = 2,
- DONE = 3,
- FAILED = 4,
- SKIPPED = 5,
- CANCELED = 6,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ PENDING = "PENDING",
+ RUNNING = "RUNNING",
+ DONE = "DONE",
+ FAILED = "FAILED",
+ SKIPPED = "SKIPPED",
+ CANCELED = "CANCELED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function issueCommentPayload_TaskUpdate_StatusFromJSON(object: any): IssueCommentPayload_TaskUpdate_Status {
@@ -209,6 +243,28 @@ export function issueCommentPayload_TaskUpdate_StatusToJSON(object: IssueComment
}
}
+export function issueCommentPayload_TaskUpdate_StatusToNumber(object: IssueCommentPayload_TaskUpdate_Status): number {
+ switch (object) {
+ case IssueCommentPayload_TaskUpdate_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case IssueCommentPayload_TaskUpdate_Status.PENDING:
+ return 1;
+ case IssueCommentPayload_TaskUpdate_Status.RUNNING:
+ return 2;
+ case IssueCommentPayload_TaskUpdate_Status.DONE:
+ return 3;
+ case IssueCommentPayload_TaskUpdate_Status.FAILED:
+ return 4;
+ case IssueCommentPayload_TaskUpdate_Status.SKIPPED:
+ return 5;
+ case IssueCommentPayload_TaskUpdate_Status.CANCELED:
+ return 6;
+ case IssueCommentPayload_TaskUpdate_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface IssueCommentPayload_TaskPriorBackup {
task: string;
tables: IssueCommentPayload_TaskPriorBackup_Table[];
@@ -375,13 +431,13 @@ export const IssueCommentPayload = {
};
function createBaseIssueCommentPayload_Approval(): IssueCommentPayload_Approval {
- return { status: 0 };
+ return { status: IssueCommentPayload_Approval_Status.STATUS_UNSPECIFIED };
}
export const IssueCommentPayload_Approval = {
encode(message: IssueCommentPayload_Approval, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.status !== 0) {
- writer.uint32(8).int32(message.status);
+ if (message.status !== IssueCommentPayload_Approval_Status.STATUS_UNSPECIFIED) {
+ writer.uint32(8).int32(issueCommentPayload_Approval_StatusToNumber(message.status));
}
return writer;
},
@@ -398,7 +454,7 @@ export const IssueCommentPayload_Approval = {
break;
}
- message.status = reader.int32() as any;
+ message.status = issueCommentPayload_Approval_StatusFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -410,12 +466,16 @@ export const IssueCommentPayload_Approval = {
},
fromJSON(object: any): IssueCommentPayload_Approval {
- return { status: isSet(object.status) ? issueCommentPayload_Approval_StatusFromJSON(object.status) : 0 };
+ return {
+ status: isSet(object.status)
+ ? issueCommentPayload_Approval_StatusFromJSON(object.status)
+ : IssueCommentPayload_Approval_Status.STATUS_UNSPECIFIED,
+ };
},
toJSON(message: IssueCommentPayload_Approval): unknown {
const obj: any = {};
- if (message.status !== 0) {
+ if (message.status !== IssueCommentPayload_Approval_Status.STATUS_UNSPECIFIED) {
obj.status = issueCommentPayload_Approval_StatusToJSON(message.status);
}
return obj;
@@ -426,7 +486,7 @@ export const IssueCommentPayload_Approval = {
},
fromPartial(object: DeepPartial<IssueCommentPayload_Approval>): IssueCommentPayload_Approval {
const message = createBaseIssueCommentPayload_Approval();
- message.status = object.status ?? 0;
+ message.status = object.status ?? IssueCommentPayload_Approval_Status.STATUS_UNSPECIFIED;
return message;
},
};
@@ -459,10 +519,10 @@ export const IssueCommentPayload_IssueUpdate = {
writer.uint32(34).string(message.toDescription);
}
if (message.fromStatus !== undefined) {
- writer.uint32(40).int32(message.fromStatus);
+ writer.uint32(40).int32(issueCommentPayload_IssueUpdate_IssueStatusToNumber(message.fromStatus));
}
if (message.toStatus !== undefined) {
- writer.uint32(48).int32(message.toStatus);
+ writer.uint32(48).int32(issueCommentPayload_IssueUpdate_IssueStatusToNumber(message.toStatus));
}
if (message.fromAssignee !== undefined) {
writer.uint32(58).string(message.fromAssignee);
@@ -513,14 +573,14 @@ export const IssueCommentPayload_IssueUpdate = {
break;
}
- message.fromStatus = reader.int32() as any;
+ message.fromStatus = issueCommentPayload_IssueUpdate_IssueStatusFromJSON(reader.int32());
continue;
case 6:
if (tag !== 48) {
break;
}
- message.toStatus = reader.int32() as any;
+ message.toStatus = issueCommentPayload_IssueUpdate_IssueStatusFromJSON(reader.int32());
continue;
case 7:
if (tag !== 58) {
@@ -694,7 +754,7 @@ export const IssueCommentPayload_TaskUpdate = {
Timestamp.encode(toTimestamp(message.toEarliestAllowedTime), writer.uint32(42).fork()).ldelim();
}
if (message.toStatus !== undefined) {
- writer.uint32(48).int32(message.toStatus);
+ writer.uint32(48).int32(issueCommentPayload_TaskUpdate_StatusToNumber(message.toStatus));
}
return writer;
},
@@ -746,7 +806,7 @@ export const IssueCommentPayload_TaskUpdate = {
break;
}
- message.toStatus = reader.int32() as any;
+ message.toStatus = issueCommentPayload_TaskUpdate_StatusFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
diff --git a/frontend/src/types/proto/store/plan.ts b/frontend/src/types/proto/store/plan.ts
index 2fcd8d27ae..6588bab80d 100644
--- a/frontend/src/types/proto/store/plan.ts
+++ b/frontend/src/types/proto/store/plan.ts
@@ -6,9 +6,11 @@ import {
ExportFormat,
exportFormatFromJSON,
exportFormatToJSON,
+ exportFormatToNumber,
VCSType,
vCSTypeFromJSON,
vCSTypeToJSON,
+ vCSTypeToNumber,
} from "./common";
export const protobufPackage = "bytebase.store";
@@ -114,24 +116,24 @@ export interface PlanConfig_ChangeDatabaseConfig {
/** Type is the database change type. */
export enum PlanConfig_ChangeDatabaseConfig_Type {
- TYPE_UNSPECIFIED = 0,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
/**
* BASELINE - Used for establishing schema baseline, this is used when
* 1. Onboard the database into Bytebase since Bytebase needs to know the current database schema.
* 2. Had schema drift and need to re-establish the baseline.
*/
- BASELINE = 1,
+ BASELINE = "BASELINE",
/** MIGRATE - Used for DDL changes including CREATE DATABASE. */
- MIGRATE = 2,
+ MIGRATE = "MIGRATE",
/** MIGRATE_SDL - Used for schema changes via state-based schema migration including CREATE DATABASE. */
- MIGRATE_SDL = 3,
+ MIGRATE_SDL = "MIGRATE_SDL",
/** MIGRATE_GHOST - Used for DDL changes using gh-ost. */
- MIGRATE_GHOST = 4,
+ MIGRATE_GHOST = "MIGRATE_GHOST",
/** BRANCH - Used when restoring from a backup (the restored database branched from the original backup). */
- BRANCH = 5,
+ BRANCH = "BRANCH",
/** DATA - Used for DML change. */
- DATA = 6,
- UNRECOGNIZED = -1,
+ DATA = "DATA",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function planConfig_ChangeDatabaseConfig_TypeFromJSON(object: any): PlanConfig_ChangeDatabaseConfig_Type {
@@ -186,6 +188,28 @@ export function planConfig_ChangeDatabaseConfig_TypeToJSON(object: PlanConfig_Ch
}
}
+export function planConfig_ChangeDatabaseConfig_TypeToNumber(object: PlanConfig_ChangeDatabaseConfig_Type): number {
+ switch (object) {
+ case PlanConfig_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case PlanConfig_ChangeDatabaseConfig_Type.BASELINE:
+ return 1;
+ case PlanConfig_ChangeDatabaseConfig_Type.MIGRATE:
+ return 2;
+ case PlanConfig_ChangeDatabaseConfig_Type.MIGRATE_SDL:
+ return 3;
+ case PlanConfig_ChangeDatabaseConfig_Type.MIGRATE_GHOST:
+ return 4;
+ case PlanConfig_ChangeDatabaseConfig_Type.BRANCH:
+ return 5;
+ case PlanConfig_ChangeDatabaseConfig_Type.DATA:
+ return 6;
+ case PlanConfig_ChangeDatabaseConfig_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface PlanConfig_ChangeDatabaseConfig_RollbackDetail {
/**
* rollback_from_task is the task from which the rollback SQL statement is generated for this task.
@@ -854,7 +878,7 @@ function createBasePlanConfig_ChangeDatabaseConfig(): PlanConfig_ChangeDatabaseC
return {
target: "",
sheet: "",
- type: 0,
+ type: PlanConfig_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED,
schemaVersion: "",
rollbackEnabled: false,
rollbackDetail: undefined,
@@ -871,8 +895,8 @@ export const PlanConfig_ChangeDatabaseConfig = {
if (message.sheet !== "") {
writer.uint32(18).string(message.sheet);
}
- if (message.type !== 0) {
- writer.uint32(24).int32(message.type);
+ if (message.type !== PlanConfig_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(24).int32(planConfig_ChangeDatabaseConfig_TypeToNumber(message.type));
}
if (message.schemaVersion !== "") {
writer.uint32(34).string(message.schemaVersion);
@@ -922,7 +946,7 @@ export const PlanConfig_ChangeDatabaseConfig = {
break;
}
- message.type = reader.int32() as any;
+ message.type = planConfig_ChangeDatabaseConfig_TypeFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -978,7 +1002,9 @@ export const PlanConfig_ChangeDatabaseConfig = {
return {
target: isSet(object.target) ? globalThis.String(object.target) : "",
sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- type: isSet(object.type) ? planConfig_ChangeDatabaseConfig_TypeFromJSON(object.type) : 0,
+ type: isSet(object.type)
+ ? planConfig_ChangeDatabaseConfig_TypeFromJSON(object.type)
+ : PlanConfig_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED,
schemaVersion: isSet(object.schemaVersion) ? globalThis.String(object.schemaVersion) : "",
rollbackEnabled: isSet(object.rollbackEnabled) ? globalThis.Boolean(object.rollbackEnabled) : false,
rollbackDetail: isSet(object.rollbackDetail)
@@ -1004,7 +1030,7 @@ export const PlanConfig_ChangeDatabaseConfig = {
if (message.sheet !== "") {
obj.sheet = message.sheet;
}
- if (message.type !== 0) {
+ if (message.type !== PlanConfig_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED) {
obj.type = planConfig_ChangeDatabaseConfig_TypeToJSON(message.type);
}
if (message.schemaVersion !== "") {
@@ -1040,7 +1066,7 @@ export const PlanConfig_ChangeDatabaseConfig = {
const message = createBasePlanConfig_ChangeDatabaseConfig();
message.target = object.target ?? "";
message.sheet = object.sheet ?? "";
- message.type = object.type ?? 0;
+ message.type = object.type ?? PlanConfig_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED;
message.schemaVersion = object.schemaVersion ?? "";
message.rollbackEnabled = object.rollbackEnabled ?? false;
message.rollbackDetail = (object.rollbackDetail !== undefined && object.rollbackDetail !== null)
@@ -1290,7 +1316,7 @@ export const PlanConfig_ChangeDatabaseConfig_PreUpdateBackupDetail = {
};
function createBasePlanConfig_ExportDataConfig(): PlanConfig_ExportDataConfig {
- return { target: "", sheet: "", format: 0, password: undefined };
+ return { target: "", sheet: "", format: ExportFormat.FORMAT_UNSPECIFIED, password: undefined };
}
export const PlanConfig_ExportDataConfig = {
@@ -1301,8 +1327,8 @@ export const PlanConfig_ExportDataConfig = {
if (message.sheet !== "") {
writer.uint32(18).string(message.sheet);
}
- if (message.format !== 0) {
- writer.uint32(24).int32(message.format);
+ if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
+ writer.uint32(24).int32(exportFormatToNumber(message.format));
}
if (message.password !== undefined) {
writer.uint32(34).string(message.password);
@@ -1336,7 +1362,7 @@ export const PlanConfig_ExportDataConfig = {
break;
}
- message.format = reader.int32() as any;
+ message.format = exportFormatFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -1358,7 +1384,7 @@ export const PlanConfig_ExportDataConfig = {
return {
target: isSet(object.target) ? globalThis.String(object.target) : "",
sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- format: isSet(object.format) ? exportFormatFromJSON(object.format) : 0,
+ format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,
password: isSet(object.password) ? globalThis.String(object.password) : undefined,
};
},
@@ -1371,7 +1397,7 @@ export const PlanConfig_ExportDataConfig = {
if (message.sheet !== "") {
obj.sheet = message.sheet;
}
- if (message.format !== 0) {
+ if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
obj.format = exportFormatToJSON(message.format);
}
if (message.password !== undefined) {
@@ -1387,20 +1413,20 @@ export const PlanConfig_ExportDataConfig = {
const message = createBasePlanConfig_ExportDataConfig();
message.target = object.target ?? "";
message.sheet = object.sheet ?? "";
- message.format = object.format ?? 0;
+ message.format = object.format ?? ExportFormat.FORMAT_UNSPECIFIED;
message.password = object.password ?? undefined;
return message;
},
};
function createBasePlanConfig_VCSSource(): PlanConfig_VCSSource {
- return { vcsType: 0, vcsConnector: "", pullRequestUrl: "" };
+ return { vcsType: VCSType.VCS_TYPE_UNSPECIFIED, vcsConnector: "", pullRequestUrl: "" };
}
export const PlanConfig_VCSSource = {
encode(message: PlanConfig_VCSSource, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.vcsType !== 0) {
- writer.uint32(8).int32(message.vcsType);
+ if (message.vcsType !== VCSType.VCS_TYPE_UNSPECIFIED) {
+ writer.uint32(8).int32(vCSTypeToNumber(message.vcsType));
}
if (message.vcsConnector !== "") {
writer.uint32(18).string(message.vcsConnector);
@@ -1423,7 +1449,7 @@ export const PlanConfig_VCSSource = {
break;
}
- message.vcsType = reader.int32() as any;
+ message.vcsType = vCSTypeFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -1450,7 +1476,7 @@ export const PlanConfig_VCSSource = {
fromJSON(object: any): PlanConfig_VCSSource {
return {
- vcsType: isSet(object.vcsType) ? vCSTypeFromJSON(object.vcsType) : 0,
+ vcsType: isSet(object.vcsType) ? vCSTypeFromJSON(object.vcsType) : VCSType.VCS_TYPE_UNSPECIFIED,
vcsConnector: isSet(object.vcsConnector) ? globalThis.String(object.vcsConnector) : "",
pullRequestUrl: isSet(object.pullRequestUrl) ? globalThis.String(object.pullRequestUrl) : "",
};
@@ -1458,7 +1484,7 @@ export const PlanConfig_VCSSource = {
toJSON(message: PlanConfig_VCSSource): unknown {
const obj: any = {};
- if (message.vcsType !== 0) {
+ if (message.vcsType !== VCSType.VCS_TYPE_UNSPECIFIED) {
obj.vcsType = vCSTypeToJSON(message.vcsType);
}
if (message.vcsConnector !== "") {
@@ -1475,7 +1501,7 @@ export const PlanConfig_VCSSource = {
},
fromPartial(object: DeepPartial<PlanConfig_VCSSource>): PlanConfig_VCSSource {
const message = createBasePlanConfig_VCSSource();
- message.vcsType = object.vcsType ?? 0;
+ message.vcsType = object.vcsType ?? VCSType.VCS_TYPE_UNSPECIFIED;
message.vcsConnector = object.vcsConnector ?? "";
message.pullRequestUrl = object.pullRequestUrl ?? "";
return message;
diff --git a/frontend/src/types/proto/store/plan_check_run.ts b/frontend/src/types/proto/store/plan_check_run.ts
index 90d6d4357d..3a37220105 100644
--- a/frontend/src/types/proto/store/plan_check_run.ts
+++ b/frontend/src/types/proto/store/plan_check_run.ts
@@ -18,12 +18,12 @@ export interface PlanCheckRunConfig {
}
export enum PlanCheckRunConfig_ChangeDatabaseType {
- CHANGE_DATABASE_TYPE_UNSPECIFIED = 0,
- DDL = 1,
- DML = 2,
- SDL = 3,
- DDL_GHOST = 4,
- UNRECOGNIZED = -1,
+ CHANGE_DATABASE_TYPE_UNSPECIFIED = "CHANGE_DATABASE_TYPE_UNSPECIFIED",
+ DDL = "DDL",
+ DML = "DML",
+ SDL = "SDL",
+ DDL_GHOST = "DDL_GHOST",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function planCheckRunConfig_ChangeDatabaseTypeFromJSON(object: any): PlanCheckRunConfig_ChangeDatabaseType {
@@ -68,6 +68,24 @@ export function planCheckRunConfig_ChangeDatabaseTypeToJSON(object: PlanCheckRun
}
}
+export function planCheckRunConfig_ChangeDatabaseTypeToNumber(object: PlanCheckRunConfig_ChangeDatabaseType): number {
+ switch (object) {
+ case PlanCheckRunConfig_ChangeDatabaseType.CHANGE_DATABASE_TYPE_UNSPECIFIED:
+ return 0;
+ case PlanCheckRunConfig_ChangeDatabaseType.DDL:
+ return 1;
+ case PlanCheckRunConfig_ChangeDatabaseType.DML:
+ return 2;
+ case PlanCheckRunConfig_ChangeDatabaseType.SDL:
+ return 3;
+ case PlanCheckRunConfig_ChangeDatabaseType.DDL_GHOST:
+ return 4;
+ case PlanCheckRunConfig_ChangeDatabaseType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface PlanCheckRunConfig_GhostFlagsEntry {
key: string;
value: string;
@@ -96,11 +114,11 @@ export interface PlanCheckRunResult_Result {
}
export enum PlanCheckRunResult_Result_Status {
- STATUS_UNSPECIFIED = 0,
- ERROR = 1,
- WARNING = 2,
- SUCCESS = 3,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ ERROR = "ERROR",
+ WARNING = "WARNING",
+ SUCCESS = "SUCCESS",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function planCheckRunResult_Result_StatusFromJSON(object: any): PlanCheckRunResult_Result_Status {
@@ -140,6 +158,22 @@ export function planCheckRunResult_Result_StatusToJSON(object: PlanCheckRunResul
}
}
+export function planCheckRunResult_Result_StatusToNumber(object: PlanCheckRunResult_Result_Status): number {
+ switch (object) {
+ case PlanCheckRunResult_Result_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case PlanCheckRunResult_Result_Status.ERROR:
+ return 1;
+ case PlanCheckRunResult_Result_Status.WARNING:
+ return 2;
+ case PlanCheckRunResult_Result_Status.SUCCESS:
+ return 3;
+ case PlanCheckRunResult_Result_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface PlanCheckRunResult_Result_SqlSummaryReport {
code: number;
/** statement_types are the types of statements that are found in the sql. */
@@ -159,7 +193,7 @@ export interface PlanCheckRunResult_Result_SqlReviewReport {
function createBasePlanCheckRunConfig(): PlanCheckRunConfig {
return {
sheetUid: 0,
- changeDatabaseType: 0,
+ changeDatabaseType: PlanCheckRunConfig_ChangeDatabaseType.CHANGE_DATABASE_TYPE_UNSPECIFIED,
instanceUid: 0,
databaseName: "",
databaseGroupUid: undefined,
@@ -173,8 +207,8 @@ export const PlanCheckRunConfig = {
if (message.sheetUid !== 0) {
writer.uint32(8).int32(message.sheetUid);
}
- if (message.changeDatabaseType !== 0) {
- writer.uint32(16).int32(message.changeDatabaseType);
+ if (message.changeDatabaseType !== PlanCheckRunConfig_ChangeDatabaseType.CHANGE_DATABASE_TYPE_UNSPECIFIED) {
+ writer.uint32(16).int32(planCheckRunConfig_ChangeDatabaseTypeToNumber(message.changeDatabaseType));
}
if (message.instanceUid !== 0) {
writer.uint32(24).int32(message.instanceUid);
@@ -213,7 +247,7 @@ export const PlanCheckRunConfig = {
break;
}
- message.changeDatabaseType = reader.int32() as any;
+ message.changeDatabaseType = planCheckRunConfig_ChangeDatabaseTypeFromJSON(reader.int32());
continue;
case 3:
if (tag !== 24) {
@@ -267,7 +301,7 @@ export const PlanCheckRunConfig = {
sheetUid: isSet(object.sheetUid) ? globalThis.Number(object.sheetUid) : 0,
changeDatabaseType: isSet(object.changeDatabaseType)
? planCheckRunConfig_ChangeDatabaseTypeFromJSON(object.changeDatabaseType)
- : 0,
+ : PlanCheckRunConfig_ChangeDatabaseType.CHANGE_DATABASE_TYPE_UNSPECIFIED,
instanceUid: isSet(object.instanceUid) ? globalThis.Number(object.instanceUid) : 0,
databaseName: isSet(object.databaseName) ? globalThis.String(object.databaseName) : "",
databaseGroupUid: isSet(object.databaseGroupUid) ? Long.fromValue(object.databaseGroupUid) : undefined,
@@ -288,7 +322,7 @@ export const PlanCheckRunConfig = {
if (message.sheetUid !== 0) {
obj.sheetUid = Math.round(message.sheetUid);
}
- if (message.changeDatabaseType !== 0) {
+ if (message.changeDatabaseType !== PlanCheckRunConfig_ChangeDatabaseType.CHANGE_DATABASE_TYPE_UNSPECIFIED) {
obj.changeDatabaseType = planCheckRunConfig_ChangeDatabaseTypeToJSON(message.changeDatabaseType);
}
if (message.instanceUid !== 0) {
@@ -321,7 +355,8 @@ export const PlanCheckRunConfig = {
fromPartial(object: DeepPartial<PlanCheckRunConfig>): PlanCheckRunConfig {
const message = createBasePlanCheckRunConfig();
message.sheetUid = object.sheetUid ?? 0;
- message.changeDatabaseType = object.changeDatabaseType ?? 0;
+ message.changeDatabaseType = object.changeDatabaseType ??
+ PlanCheckRunConfig_ChangeDatabaseType.CHANGE_DATABASE_TYPE_UNSPECIFIED;
message.instanceUid = object.instanceUid ?? 0;
message.databaseName = object.databaseName ?? "";
message.databaseGroupUid = (object.databaseGroupUid !== undefined && object.databaseGroupUid !== null)
@@ -552,13 +587,20 @@ export const PlanCheckRunResult = {
};
function createBasePlanCheckRunResult_Result(): PlanCheckRunResult_Result {
- return { status: 0, title: "", content: "", code: 0, sqlSummaryReport: undefined, sqlReviewReport: undefined };
+ return {
+ status: PlanCheckRunResult_Result_Status.STATUS_UNSPECIFIED,
+ title: "",
+ content: "",
+ code: 0,
+ sqlSummaryReport: undefined,
+ sqlReviewReport: undefined,
+ };
}
export const PlanCheckRunResult_Result = {
encode(message: PlanCheckRunResult_Result, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.status !== 0) {
- writer.uint32(8).int32(message.status);
+ if (message.status !== PlanCheckRunResult_Result_Status.STATUS_UNSPECIFIED) {
+ writer.uint32(8).int32(planCheckRunResult_Result_StatusToNumber(message.status));
}
if (message.title !== "") {
writer.uint32(18).string(message.title);
@@ -590,7 +632,7 @@ export const PlanCheckRunResult_Result = {
break;
}
- message.status = reader.int32() as any;
+ message.status = planCheckRunResult_Result_StatusFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -638,7 +680,9 @@ export const PlanCheckRunResult_Result = {
fromJSON(object: any): PlanCheckRunResult_Result {
return {
- status: isSet(object.status) ? planCheckRunResult_Result_StatusFromJSON(object.status) : 0,
+ status: isSet(object.status)
+ ? planCheckRunResult_Result_StatusFromJSON(object.status)
+ : PlanCheckRunResult_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,
@@ -653,7 +697,7 @@ export const PlanCheckRunResult_Result = {
toJSON(message: PlanCheckRunResult_Result): unknown {
const obj: any = {};
- if (message.status !== 0) {
+ if (message.status !== PlanCheckRunResult_Result_Status.STATUS_UNSPECIFIED) {
obj.status = planCheckRunResult_Result_StatusToJSON(message.status);
}
if (message.title !== "") {
@@ -679,7 +723,7 @@ export const PlanCheckRunResult_Result = {
},
fromPartial(object: DeepPartial<PlanCheckRunResult_Result>): PlanCheckRunResult_Result {
const message = createBasePlanCheckRunResult_Result();
- message.status = object.status ?? 0;
+ message.status = object.status ?? PlanCheckRunResult_Result_Status.STATUS_UNSPECIFIED;
message.title = object.title ?? "";
message.content = object.content ?? "";
message.code = object.code ?? 0;
diff --git a/frontend/src/types/proto/store/policy.ts b/frontend/src/types/proto/store/policy.ts
index f2ea6fdc33..5cd7aa37bb 100644
--- a/frontend/src/types/proto/store/policy.ts
+++ b/frontend/src/types/proto/store/policy.ts
@@ -2,16 +2,25 @@
import Long from "long";
import _m0 from "protobufjs/minimal";
import { Expr } from "../google/type/expr";
-import { Engine, engineFromJSON, engineToJSON, MaskingLevel, maskingLevelFromJSON, maskingLevelToJSON } from "./common";
+import {
+ Engine,
+ engineFromJSON,
+ engineToJSON,
+ engineToNumber,
+ MaskingLevel,
+ maskingLevelFromJSON,
+ maskingLevelToJSON,
+ maskingLevelToNumber,
+} from "./common";
export const protobufPackage = "bytebase.store";
export enum SQLReviewRuleLevel {
- LEVEL_UNSPECIFIED = 0,
- ERROR = 1,
- WARNING = 2,
- DISABLED = 3,
- UNRECOGNIZED = -1,
+ LEVEL_UNSPECIFIED = "LEVEL_UNSPECIFIED",
+ ERROR = "ERROR",
+ WARNING = "WARNING",
+ DISABLED = "DISABLED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function sQLReviewRuleLevelFromJSON(object: any): SQLReviewRuleLevel {
@@ -51,6 +60,22 @@ export function sQLReviewRuleLevelToJSON(object: SQLReviewRuleLevel): string {
}
}
+export function sQLReviewRuleLevelToNumber(object: SQLReviewRuleLevel): number {
+ switch (object) {
+ case SQLReviewRuleLevel.LEVEL_UNSPECIFIED:
+ return 0;
+ case SQLReviewRuleLevel.ERROR:
+ return 1;
+ case SQLReviewRuleLevel.WARNING:
+ return 2;
+ case SQLReviewRuleLevel.DISABLED:
+ return 3;
+ case SQLReviewRuleLevel.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface RolloutPolicy {
automatic: boolean;
workspaceRoles: string[];
@@ -124,10 +149,10 @@ export interface MaskingExceptionPolicy_MaskingException {
}
export enum MaskingExceptionPolicy_MaskingException_Action {
- ACTION_UNSPECIFIED = 0,
- QUERY = 1,
- EXPORT = 2,
- UNRECOGNIZED = -1,
+ ACTION_UNSPECIFIED = "ACTION_UNSPECIFIED",
+ QUERY = "QUERY",
+ EXPORT = "EXPORT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function maskingExceptionPolicy_MaskingException_ActionFromJSON(
@@ -166,6 +191,22 @@ export function maskingExceptionPolicy_MaskingException_ActionToJSON(
}
}
+export function maskingExceptionPolicy_MaskingException_ActionToNumber(
+ object: MaskingExceptionPolicy_MaskingException_Action,
+): number {
+ switch (object) {
+ case MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED:
+ return 0;
+ case MaskingExceptionPolicy_MaskingException_Action.QUERY:
+ return 1;
+ case MaskingExceptionPolicy_MaskingException_Action.EXPORT:
+ return 2;
+ case MaskingExceptionPolicy_MaskingException_Action.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface MaskingRulePolicy {
rules: MaskingRulePolicy_MaskingRule[];
}
@@ -514,7 +555,7 @@ function createBaseMaskData(): MaskData {
schema: "",
table: "",
column: "",
- maskingLevel: 0,
+ maskingLevel: MaskingLevel.MASKING_LEVEL_UNSPECIFIED,
fullMaskingAlgorithmId: "",
partialMaskingAlgorithmId: "",
};
@@ -531,8 +572,8 @@ export const MaskData = {
if (message.column !== "") {
writer.uint32(26).string(message.column);
}
- if (message.maskingLevel !== 0) {
- writer.uint32(32).int32(message.maskingLevel);
+ if (message.maskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
+ writer.uint32(32).int32(maskingLevelToNumber(message.maskingLevel));
}
if (message.fullMaskingAlgorithmId !== "") {
writer.uint32(42).string(message.fullMaskingAlgorithmId);
@@ -576,7 +617,7 @@ export const MaskData = {
break;
}
- message.maskingLevel = reader.int32() as any;
+ message.maskingLevel = maskingLevelFromJSON(reader.int32());
continue;
case 5:
if (tag !== 42) {
@@ -606,7 +647,9 @@ export const MaskData = {
schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
table: isSet(object.table) ? globalThis.String(object.table) : "",
column: isSet(object.column) ? globalThis.String(object.column) : "",
- maskingLevel: isSet(object.maskingLevel) ? maskingLevelFromJSON(object.maskingLevel) : 0,
+ maskingLevel: isSet(object.maskingLevel)
+ ? maskingLevelFromJSON(object.maskingLevel)
+ : MaskingLevel.MASKING_LEVEL_UNSPECIFIED,
fullMaskingAlgorithmId: isSet(object.fullMaskingAlgorithmId)
? globalThis.String(object.fullMaskingAlgorithmId)
: "",
@@ -627,7 +670,7 @@ export const MaskData = {
if (message.column !== "") {
obj.column = message.column;
}
- if (message.maskingLevel !== 0) {
+ if (message.maskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
obj.maskingLevel = maskingLevelToJSON(message.maskingLevel);
}
if (message.fullMaskingAlgorithmId !== "") {
@@ -647,7 +690,7 @@ export const MaskData = {
message.schema = object.schema ?? "";
message.table = object.table ?? "";
message.column = object.column ?? "";
- message.maskingLevel = object.maskingLevel ?? 0;
+ message.maskingLevel = object.maskingLevel ?? MaskingLevel.MASKING_LEVEL_UNSPECIFIED;
message.fullMaskingAlgorithmId = object.fullMaskingAlgorithmId ?? "";
message.partialMaskingAlgorithmId = object.partialMaskingAlgorithmId ?? "";
return message;
@@ -717,16 +760,21 @@ export const MaskingExceptionPolicy = {
};
function createBaseMaskingExceptionPolicy_MaskingException(): MaskingExceptionPolicy_MaskingException {
- return { action: 0, maskingLevel: 0, member: "", condition: undefined };
+ return {
+ action: MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED,
+ maskingLevel: MaskingLevel.MASKING_LEVEL_UNSPECIFIED,
+ member: "",
+ condition: undefined,
+ };
}
export const MaskingExceptionPolicy_MaskingException = {
encode(message: MaskingExceptionPolicy_MaskingException, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.action !== 0) {
- writer.uint32(8).int32(message.action);
+ if (message.action !== MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED) {
+ writer.uint32(8).int32(maskingExceptionPolicy_MaskingException_ActionToNumber(message.action));
}
- if (message.maskingLevel !== 0) {
- writer.uint32(16).int32(message.maskingLevel);
+ if (message.maskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
+ writer.uint32(16).int32(maskingLevelToNumber(message.maskingLevel));
}
if (message.member !== "") {
writer.uint32(34).string(message.member);
@@ -749,14 +797,14 @@ export const MaskingExceptionPolicy_MaskingException = {
break;
}
- message.action = reader.int32() as any;
+ message.action = maskingExceptionPolicy_MaskingException_ActionFromJSON(reader.int32());
continue;
case 2:
if (tag !== 16) {
break;
}
- message.maskingLevel = reader.int32() as any;
+ message.maskingLevel = maskingLevelFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -783,8 +831,12 @@ export const MaskingExceptionPolicy_MaskingException = {
fromJSON(object: any): MaskingExceptionPolicy_MaskingException {
return {
- action: isSet(object.action) ? maskingExceptionPolicy_MaskingException_ActionFromJSON(object.action) : 0,
- maskingLevel: isSet(object.maskingLevel) ? maskingLevelFromJSON(object.maskingLevel) : 0,
+ action: isSet(object.action)
+ ? maskingExceptionPolicy_MaskingException_ActionFromJSON(object.action)
+ : MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED,
+ maskingLevel: isSet(object.maskingLevel)
+ ? maskingLevelFromJSON(object.maskingLevel)
+ : MaskingLevel.MASKING_LEVEL_UNSPECIFIED,
member: isSet(object.member) ? globalThis.String(object.member) : "",
condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
};
@@ -792,10 +844,10 @@ export const MaskingExceptionPolicy_MaskingException = {
toJSON(message: MaskingExceptionPolicy_MaskingException): unknown {
const obj: any = {};
- if (message.action !== 0) {
+ if (message.action !== MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED) {
obj.action = maskingExceptionPolicy_MaskingException_ActionToJSON(message.action);
}
- if (message.maskingLevel !== 0) {
+ if (message.maskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
obj.maskingLevel = maskingLevelToJSON(message.maskingLevel);
}
if (message.member !== "") {
@@ -812,8 +864,8 @@ export const MaskingExceptionPolicy_MaskingException = {
},
fromPartial(object: DeepPartial<MaskingExceptionPolicy_MaskingException>): MaskingExceptionPolicy_MaskingException {
const message = createBaseMaskingExceptionPolicy_MaskingException();
- message.action = object.action ?? 0;
- message.maskingLevel = object.maskingLevel ?? 0;
+ message.action = object.action ?? MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED;
+ message.maskingLevel = object.maskingLevel ?? MaskingLevel.MASKING_LEVEL_UNSPECIFIED;
message.member = object.member ?? "";
message.condition = (object.condition !== undefined && object.condition !== null)
? Expr.fromPartial(object.condition)
@@ -884,7 +936,7 @@ export const MaskingRulePolicy = {
};
function createBaseMaskingRulePolicy_MaskingRule(): MaskingRulePolicy_MaskingRule {
- return { id: "", condition: undefined, maskingLevel: 0 };
+ return { id: "", condition: undefined, maskingLevel: MaskingLevel.MASKING_LEVEL_UNSPECIFIED };
}
export const MaskingRulePolicy_MaskingRule = {
@@ -895,8 +947,8 @@ export const MaskingRulePolicy_MaskingRule = {
if (message.condition !== undefined) {
Expr.encode(message.condition, writer.uint32(18).fork()).ldelim();
}
- if (message.maskingLevel !== 0) {
- writer.uint32(24).int32(message.maskingLevel);
+ if (message.maskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
+ writer.uint32(24).int32(maskingLevelToNumber(message.maskingLevel));
}
return writer;
},
@@ -927,7 +979,7 @@ export const MaskingRulePolicy_MaskingRule = {
break;
}
- message.maskingLevel = reader.int32() as any;
+ message.maskingLevel = maskingLevelFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -942,7 +994,9 @@ export const MaskingRulePolicy_MaskingRule = {
return {
id: isSet(object.id) ? globalThis.String(object.id) : "",
condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
- maskingLevel: isSet(object.maskingLevel) ? maskingLevelFromJSON(object.maskingLevel) : 0,
+ maskingLevel: isSet(object.maskingLevel)
+ ? maskingLevelFromJSON(object.maskingLevel)
+ : MaskingLevel.MASKING_LEVEL_UNSPECIFIED,
};
},
@@ -954,7 +1008,7 @@ export const MaskingRulePolicy_MaskingRule = {
if (message.condition !== undefined) {
obj.condition = Expr.toJSON(message.condition);
}
- if (message.maskingLevel !== 0) {
+ if (message.maskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
obj.maskingLevel = maskingLevelToJSON(message.maskingLevel);
}
return obj;
@@ -969,7 +1023,7 @@ export const MaskingRulePolicy_MaskingRule = {
message.condition = (object.condition !== undefined && object.condition !== null)
? Expr.fromPartial(object.condition)
: undefined;
- message.maskingLevel = object.maskingLevel ?? 0;
+ message.maskingLevel = object.maskingLevel ?? MaskingLevel.MASKING_LEVEL_UNSPECIFIED;
return message;
},
};
@@ -1051,7 +1105,13 @@ export const SQLReviewPolicy = {
};
function createBaseSQLReviewRule(): SQLReviewRule {
- return { type: "", level: 0, payload: "", engine: 0, comment: "" };
+ return {
+ type: "",
+ level: SQLReviewRuleLevel.LEVEL_UNSPECIFIED,
+ payload: "",
+ engine: Engine.ENGINE_UNSPECIFIED,
+ comment: "",
+ };
}
export const SQLReviewRule = {
@@ -1059,14 +1119,14 @@ export const SQLReviewRule = {
if (message.type !== "") {
writer.uint32(10).string(message.type);
}
- if (message.level !== 0) {
- writer.uint32(16).int32(message.level);
+ if (message.level !== SQLReviewRuleLevel.LEVEL_UNSPECIFIED) {
+ writer.uint32(16).int32(sQLReviewRuleLevelToNumber(message.level));
}
if (message.payload !== "") {
writer.uint32(26).string(message.payload);
}
- if (message.engine !== 0) {
- writer.uint32(32).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(32).int32(engineToNumber(message.engine));
}
if (message.comment !== "") {
writer.uint32(42).string(message.comment);
@@ -1093,7 +1153,7 @@ export const SQLReviewRule = {
break;
}
- message.level = reader.int32() as any;
+ message.level = sQLReviewRuleLevelFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -1107,7 +1167,7 @@ export const SQLReviewRule = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
case 5:
if (tag !== 42) {
@@ -1128,9 +1188,9 @@ export const SQLReviewRule = {
fromJSON(object: any): SQLReviewRule {
return {
type: isSet(object.type) ? globalThis.String(object.type) : "",
- level: isSet(object.level) ? sQLReviewRuleLevelFromJSON(object.level) : 0,
+ 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) : 0,
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
};
},
@@ -1140,13 +1200,13 @@ export const SQLReviewRule = {
if (message.type !== "") {
obj.type = message.type;
}
- if (message.level !== 0) {
+ if (message.level !== SQLReviewRuleLevel.LEVEL_UNSPECIFIED) {
obj.level = sQLReviewRuleLevelToJSON(message.level);
}
if (message.payload !== "") {
obj.payload = message.payload;
}
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
if (message.comment !== "") {
@@ -1161,9 +1221,9 @@ export const SQLReviewRule = {
fromPartial(object: DeepPartial<SQLReviewRule>): SQLReviewRule {
const message = createBaseSQLReviewRule();
message.type = object.type ?? "";
- message.level = object.level ?? 0;
+ message.level = object.level ?? SQLReviewRuleLevel.LEVEL_UNSPECIFIED;
message.payload = object.payload ?? "";
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
message.comment = object.comment ?? "";
return message;
},
diff --git a/frontend/src/types/proto/store/project.ts b/frontend/src/types/proto/store/project.ts
index 16126b1953..c4013d0d38 100644
--- a/frontend/src/types/proto/store/project.ts
+++ b/frontend/src/types/proto/store/project.ts
@@ -24,10 +24,10 @@ export interface ProtectionRule {
/** The type of target. */
export enum ProtectionRule_Target {
- PROTECTION_TARGET_UNSPECIFIED = 0,
- BRANCH = 1,
- CHANGELIST = 2,
- UNRECOGNIZED = -1,
+ PROTECTION_TARGET_UNSPECIFIED = "PROTECTION_TARGET_UNSPECIFIED",
+ BRANCH = "BRANCH",
+ CHANGELIST = "CHANGELIST",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function protectionRule_TargetFromJSON(object: any): ProtectionRule_Target {
@@ -62,10 +62,24 @@ export function protectionRule_TargetToJSON(object: ProtectionRule_Target): stri
}
}
+export function protectionRule_TargetToNumber(object: ProtectionRule_Target): number {
+ switch (object) {
+ case ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED:
+ return 0;
+ case ProtectionRule_Target.BRANCH:
+ return 1;
+ case ProtectionRule_Target.CHANGELIST:
+ return 2;
+ case ProtectionRule_Target.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum ProtectionRule_BranchSource {
- BRANCH_SOURCE_UNSPECIFIED = 0,
- DATABASE = 1,
- UNRECOGNIZED = -1,
+ BRANCH_SOURCE_UNSPECIFIED = "BRANCH_SOURCE_UNSPECIFIED",
+ DATABASE = "DATABASE",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function protectionRule_BranchSourceFromJSON(object: any): ProtectionRule_BranchSource {
@@ -95,6 +109,18 @@ export function protectionRule_BranchSourceToJSON(object: ProtectionRule_BranchS
}
}
+export function protectionRule_BranchSourceToNumber(object: ProtectionRule_BranchSource): number {
+ switch (object) {
+ case ProtectionRule_BranchSource.BRANCH_SOURCE_UNSPECIFIED:
+ return 0;
+ case ProtectionRule_BranchSource.DATABASE:
+ return 1;
+ case ProtectionRule_BranchSource.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
function createBaseProject(): Project {
return { protectionRules: [] };
}
@@ -157,7 +183,13 @@ export const Project = {
};
function createBaseProtectionRule(): ProtectionRule {
- return { id: "", target: 0, nameFilter: "", allowedRoles: [], branchSource: 0 };
+ return {
+ id: "",
+ target: ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED,
+ nameFilter: "",
+ allowedRoles: [],
+ branchSource: ProtectionRule_BranchSource.BRANCH_SOURCE_UNSPECIFIED,
+ };
}
export const ProtectionRule = {
@@ -165,8 +197,8 @@ export const ProtectionRule = {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
- if (message.target !== 0) {
- writer.uint32(16).int32(message.target);
+ if (message.target !== ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED) {
+ writer.uint32(16).int32(protectionRule_TargetToNumber(message.target));
}
if (message.nameFilter !== "") {
writer.uint32(26).string(message.nameFilter);
@@ -174,8 +206,8 @@ export const ProtectionRule = {
for (const v of message.allowedRoles) {
writer.uint32(34).string(v!);
}
- if (message.branchSource !== 0) {
- writer.uint32(40).int32(message.branchSource);
+ if (message.branchSource !== ProtectionRule_BranchSource.BRANCH_SOURCE_UNSPECIFIED) {
+ writer.uint32(40).int32(protectionRule_BranchSourceToNumber(message.branchSource));
}
return writer;
},
@@ -199,7 +231,7 @@ export const ProtectionRule = {
break;
}
- message.target = reader.int32() as any;
+ message.target = protectionRule_TargetFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -220,7 +252,7 @@ export const ProtectionRule = {
break;
}
- message.branchSource = reader.int32() as any;
+ message.branchSource = protectionRule_BranchSourceFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -234,12 +266,16 @@ export const ProtectionRule = {
fromJSON(object: any): ProtectionRule {
return {
id: isSet(object.id) ? globalThis.String(object.id) : "",
- target: isSet(object.target) ? protectionRule_TargetFromJSON(object.target) : 0,
+ target: isSet(object.target)
+ ? protectionRule_TargetFromJSON(object.target)
+ : ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED,
nameFilter: isSet(object.nameFilter) ? globalThis.String(object.nameFilter) : "",
allowedRoles: globalThis.Array.isArray(object?.allowedRoles)
? object.allowedRoles.map((e: any) => globalThis.String(e))
: [],
- branchSource: isSet(object.branchSource) ? protectionRule_BranchSourceFromJSON(object.branchSource) : 0,
+ branchSource: isSet(object.branchSource)
+ ? protectionRule_BranchSourceFromJSON(object.branchSource)
+ : ProtectionRule_BranchSource.BRANCH_SOURCE_UNSPECIFIED,
};
},
@@ -248,7 +284,7 @@ export const ProtectionRule = {
if (message.id !== "") {
obj.id = message.id;
}
- if (message.target !== 0) {
+ if (message.target !== ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED) {
obj.target = protectionRule_TargetToJSON(message.target);
}
if (message.nameFilter !== "") {
@@ -257,7 +293,7 @@ export const ProtectionRule = {
if (message.allowedRoles?.length) {
obj.allowedRoles = message.allowedRoles;
}
- if (message.branchSource !== 0) {
+ if (message.branchSource !== ProtectionRule_BranchSource.BRANCH_SOURCE_UNSPECIFIED) {
obj.branchSource = protectionRule_BranchSourceToJSON(message.branchSource);
}
return obj;
@@ -269,10 +305,10 @@ export const ProtectionRule = {
fromPartial(object: DeepPartial<ProtectionRule>): ProtectionRule {
const message = createBaseProtectionRule();
message.id = object.id ?? "";
- message.target = object.target ?? 0;
+ message.target = object.target ?? ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED;
message.nameFilter = object.nameFilter ?? "";
message.allowedRoles = object.allowedRoles?.map((e) => e) || [];
- message.branchSource = object.branchSource ?? 0;
+ message.branchSource = object.branchSource ?? ProtectionRule_BranchSource.BRANCH_SOURCE_UNSPECIFIED;
return message;
},
};
diff --git a/frontend/src/types/proto/store/setting.ts b/frontend/src/types/proto/store/setting.ts
index f6e3188985..45b091299f 100644
--- a/frontend/src/types/proto/store/setting.ts
+++ b/frontend/src/types/proto/store/setting.ts
@@ -5,7 +5,7 @@ import { ParsedExpr } from "../google/api/expr/v1alpha1/syntax";
import { Duration } from "../google/protobuf/duration";
import { Expr } from "../google/type/expr";
import { ApprovalTemplate } from "./approval";
-import { Engine, engineFromJSON, engineToJSON } from "./common";
+import { Engine, engineFromJSON, engineToJSON, engineToNumber } from "./common";
import { ColumnConfig, ColumnMetadata, TableConfig, TableMetadata } from "./database";
export const protobufPackage = "bytebase.store";
@@ -48,11 +48,11 @@ export interface Announcement {
/** We support three levels of AlertLevel: INFO, WARNING, and ERROR. */
export enum Announcement_AlertLevel {
- ALERT_LEVEL_UNSPECIFIED = 0,
- ALERT_LEVEL_INFO = 1,
- ALERT_LEVEL_WARNING = 2,
- ALERT_LEVEL_CRITICAL = 3,
- UNRECOGNIZED = -1,
+ ALERT_LEVEL_UNSPECIFIED = "ALERT_LEVEL_UNSPECIFIED",
+ ALERT_LEVEL_INFO = "ALERT_LEVEL_INFO",
+ ALERT_LEVEL_WARNING = "ALERT_LEVEL_WARNING",
+ ALERT_LEVEL_CRITICAL = "ALERT_LEVEL_CRITICAL",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function announcement_AlertLevelFromJSON(object: any): Announcement_AlertLevel {
@@ -92,6 +92,22 @@ export function announcement_AlertLevelToJSON(object: Announcement_AlertLevel):
}
}
+export function announcement_AlertLevelToNumber(object: Announcement_AlertLevel): number {
+ switch (object) {
+ case Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED:
+ return 0;
+ case Announcement_AlertLevel.ALERT_LEVEL_INFO:
+ return 1;
+ case Announcement_AlertLevel.ALERT_LEVEL_WARNING:
+ return 2;
+ case Announcement_AlertLevel.ALERT_LEVEL_CRITICAL:
+ return 3;
+ case Announcement_AlertLevel.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface AgentPluginSetting {
/** The URL for the agent API. */
url: string;
@@ -146,11 +162,11 @@ export interface SMTPMailDeliverySetting {
/** We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS. */
export enum SMTPMailDeliverySetting_Encryption {
- ENCRYPTION_UNSPECIFIED = 0,
- ENCRYPTION_NONE = 1,
- ENCRYPTION_STARTTLS = 2,
- ENCRYPTION_SSL_TLS = 3,
- UNRECOGNIZED = -1,
+ ENCRYPTION_UNSPECIFIED = "ENCRYPTION_UNSPECIFIED",
+ ENCRYPTION_NONE = "ENCRYPTION_NONE",
+ ENCRYPTION_STARTTLS = "ENCRYPTION_STARTTLS",
+ ENCRYPTION_SSL_TLS = "ENCRYPTION_SSL_TLS",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function sMTPMailDeliverySetting_EncryptionFromJSON(object: any): SMTPMailDeliverySetting_Encryption {
@@ -190,17 +206,33 @@ export function sMTPMailDeliverySetting_EncryptionToJSON(object: SMTPMailDeliver
}
}
+export function sMTPMailDeliverySetting_EncryptionToNumber(object: SMTPMailDeliverySetting_Encryption): number {
+ switch (object) {
+ case SMTPMailDeliverySetting_Encryption.ENCRYPTION_UNSPECIFIED:
+ return 0;
+ case SMTPMailDeliverySetting_Encryption.ENCRYPTION_NONE:
+ return 1;
+ case SMTPMailDeliverySetting_Encryption.ENCRYPTION_STARTTLS:
+ return 2;
+ case SMTPMailDeliverySetting_Encryption.ENCRYPTION_SSL_TLS:
+ return 3;
+ case SMTPMailDeliverySetting_Encryption.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/**
* We support four types of SMTP authentication: NONE, PLAIN, LOGIN, and
* CRAM-MD5.
*/
export enum SMTPMailDeliverySetting_Authentication {
- AUTHENTICATION_UNSPECIFIED = 0,
- AUTHENTICATION_NONE = 1,
- AUTHENTICATION_PLAIN = 2,
- AUTHENTICATION_LOGIN = 3,
- AUTHENTICATION_CRAM_MD5 = 4,
- UNRECOGNIZED = -1,
+ AUTHENTICATION_UNSPECIFIED = "AUTHENTICATION_UNSPECIFIED",
+ AUTHENTICATION_NONE = "AUTHENTICATION_NONE",
+ AUTHENTICATION_PLAIN = "AUTHENTICATION_PLAIN",
+ AUTHENTICATION_LOGIN = "AUTHENTICATION_LOGIN",
+ AUTHENTICATION_CRAM_MD5 = "AUTHENTICATION_CRAM_MD5",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function sMTPMailDeliverySetting_AuthenticationFromJSON(object: any): SMTPMailDeliverySetting_Authentication {
@@ -245,6 +277,24 @@ export function sMTPMailDeliverySetting_AuthenticationToJSON(object: SMTPMailDel
}
}
+export function sMTPMailDeliverySetting_AuthenticationToNumber(object: SMTPMailDeliverySetting_Authentication): number {
+ switch (object) {
+ case SMTPMailDeliverySetting_Authentication.AUTHENTICATION_UNSPECIFIED:
+ return 0;
+ case SMTPMailDeliverySetting_Authentication.AUTHENTICATION_NONE:
+ return 1;
+ case SMTPMailDeliverySetting_Authentication.AUTHENTICATION_PLAIN:
+ return 2;
+ case SMTPMailDeliverySetting_Authentication.AUTHENTICATION_LOGIN:
+ return 3;
+ case SMTPMailDeliverySetting_Authentication.AUTHENTICATION_CRAM_MD5:
+ return 4;
+ case SMTPMailDeliverySetting_Authentication.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface SchemaTemplateSetting {
fieldTemplates: SchemaTemplateSetting_FieldTemplate[];
columnTypes: SchemaTemplateSetting_ColumnType[];
@@ -556,13 +606,13 @@ export const WorkspaceProfileSetting = {
};
function createBaseAnnouncement(): Announcement {
- return { level: 0, text: "", link: "" };
+ return { level: Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED, text: "", link: "" };
}
export const Announcement = {
encode(message: Announcement, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.level !== 0) {
- writer.uint32(8).int32(message.level);
+ if (message.level !== Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED) {
+ writer.uint32(8).int32(announcement_AlertLevelToNumber(message.level));
}
if (message.text !== "") {
writer.uint32(18).string(message.text);
@@ -585,7 +635,7 @@ export const Announcement = {
break;
}
- message.level = reader.int32() as any;
+ message.level = announcement_AlertLevelFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -612,7 +662,9 @@ export const Announcement = {
fromJSON(object: any): Announcement {
return {
- level: isSet(object.level) ? announcement_AlertLevelFromJSON(object.level) : 0,
+ 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) : "",
};
@@ -620,7 +672,7 @@ export const Announcement = {
toJSON(message: Announcement): unknown {
const obj: any = {};
- if (message.level !== 0) {
+ if (message.level !== Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED) {
obj.level = announcement_AlertLevelToJSON(message.level);
}
if (message.text !== "") {
@@ -637,7 +689,7 @@ export const Announcement = {
},
fromPartial(object: DeepPartial<Announcement>): Announcement {
const message = createBaseAnnouncement();
- message.level = object.level ?? 0;
+ message.level = object.level ?? Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED;
message.text = object.text ?? "";
message.link = object.link ?? "";
return message;
@@ -1028,11 +1080,11 @@ function createBaseSMTPMailDeliverySetting(): SMTPMailDeliverySetting {
return {
server: "",
port: 0,
- encryption: 0,
+ encryption: SMTPMailDeliverySetting_Encryption.ENCRYPTION_UNSPECIFIED,
ca: "",
key: "",
cert: "",
- authentication: 0,
+ authentication: SMTPMailDeliverySetting_Authentication.AUTHENTICATION_UNSPECIFIED,
username: "",
password: "",
from: "",
@@ -1047,8 +1099,8 @@ export const SMTPMailDeliverySetting = {
if (message.port !== 0) {
writer.uint32(16).int32(message.port);
}
- if (message.encryption !== 0) {
- writer.uint32(24).int32(message.encryption);
+ if (message.encryption !== SMTPMailDeliverySetting_Encryption.ENCRYPTION_UNSPECIFIED) {
+ writer.uint32(24).int32(sMTPMailDeliverySetting_EncryptionToNumber(message.encryption));
}
if (message.ca !== "") {
writer.uint32(34).string(message.ca);
@@ -1059,8 +1111,8 @@ export const SMTPMailDeliverySetting = {
if (message.cert !== "") {
writer.uint32(50).string(message.cert);
}
- if (message.authentication !== 0) {
- writer.uint32(56).int32(message.authentication);
+ if (message.authentication !== SMTPMailDeliverySetting_Authentication.AUTHENTICATION_UNSPECIFIED) {
+ writer.uint32(56).int32(sMTPMailDeliverySetting_AuthenticationToNumber(message.authentication));
}
if (message.username !== "") {
writer.uint32(66).string(message.username);
@@ -1100,7 +1152,7 @@ export const SMTPMailDeliverySetting = {
break;
}
- message.encryption = reader.int32() as any;
+ message.encryption = sMTPMailDeliverySetting_EncryptionFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -1128,7 +1180,7 @@ export const SMTPMailDeliverySetting = {
break;
}
- message.authentication = reader.int32() as any;
+ message.authentication = sMTPMailDeliverySetting_AuthenticationFromJSON(reader.int32());
continue;
case 8:
if (tag !== 66) {
@@ -1164,13 +1216,15 @@ export const SMTPMailDeliverySetting = {
return {
server: isSet(object.server) ? globalThis.String(object.server) : "",
port: isSet(object.port) ? globalThis.Number(object.port) : 0,
- encryption: isSet(object.encryption) ? sMTPMailDeliverySetting_EncryptionFromJSON(object.encryption) : 0,
+ encryption: isSet(object.encryption)
+ ? sMTPMailDeliverySetting_EncryptionFromJSON(object.encryption)
+ : SMTPMailDeliverySetting_Encryption.ENCRYPTION_UNSPECIFIED,
ca: isSet(object.ca) ? globalThis.String(object.ca) : "",
key: isSet(object.key) ? globalThis.String(object.key) : "",
cert: isSet(object.cert) ? globalThis.String(object.cert) : "",
authentication: isSet(object.authentication)
? sMTPMailDeliverySetting_AuthenticationFromJSON(object.authentication)
- : 0,
+ : SMTPMailDeliverySetting_Authentication.AUTHENTICATION_UNSPECIFIED,
username: isSet(object.username) ? globalThis.String(object.username) : "",
password: isSet(object.password) ? globalThis.String(object.password) : "",
from: isSet(object.from) ? globalThis.String(object.from) : "",
@@ -1185,7 +1239,7 @@ export const SMTPMailDeliverySetting = {
if (message.port !== 0) {
obj.port = Math.round(message.port);
}
- if (message.encryption !== 0) {
+ if (message.encryption !== SMTPMailDeliverySetting_Encryption.ENCRYPTION_UNSPECIFIED) {
obj.encryption = sMTPMailDeliverySetting_EncryptionToJSON(message.encryption);
}
if (message.ca !== "") {
@@ -1197,7 +1251,7 @@ export const SMTPMailDeliverySetting = {
if (message.cert !== "") {
obj.cert = message.cert;
}
- if (message.authentication !== 0) {
+ if (message.authentication !== SMTPMailDeliverySetting_Authentication.AUTHENTICATION_UNSPECIFIED) {
obj.authentication = sMTPMailDeliverySetting_AuthenticationToJSON(message.authentication);
}
if (message.username !== "") {
@@ -1219,11 +1273,11 @@ export const SMTPMailDeliverySetting = {
const message = createBaseSMTPMailDeliverySetting();
message.server = object.server ?? "";
message.port = object.port ?? 0;
- message.encryption = object.encryption ?? 0;
+ message.encryption = object.encryption ?? SMTPMailDeliverySetting_Encryption.ENCRYPTION_UNSPECIFIED;
message.ca = object.ca ?? "";
message.key = object.key ?? "";
message.cert = object.cert ?? "";
- message.authentication = object.authentication ?? 0;
+ message.authentication = object.authentication ?? SMTPMailDeliverySetting_Authentication.AUTHENTICATION_UNSPECIFIED;
message.username = object.username ?? "";
message.password = object.password ?? "";
message.from = object.from ?? "";
@@ -1329,7 +1383,7 @@ export const SchemaTemplateSetting = {
};
function createBaseSchemaTemplateSetting_FieldTemplate(): SchemaTemplateSetting_FieldTemplate {
- return { id: "", engine: 0, category: "", column: undefined, config: undefined };
+ return { id: "", engine: Engine.ENGINE_UNSPECIFIED, category: "", column: undefined, config: undefined };
}
export const SchemaTemplateSetting_FieldTemplate = {
@@ -1337,8 +1391,8 @@ export const SchemaTemplateSetting_FieldTemplate = {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
- if (message.engine !== 0) {
- writer.uint32(16).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(16).int32(engineToNumber(message.engine));
}
if (message.category !== "") {
writer.uint32(26).string(message.category);
@@ -1371,7 +1425,7 @@ export const SchemaTemplateSetting_FieldTemplate = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -1406,7 +1460,7 @@ export const SchemaTemplateSetting_FieldTemplate = {
fromJSON(object: any): SchemaTemplateSetting_FieldTemplate {
return {
id: isSet(object.id) ? globalThis.String(object.id) : "",
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ 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,
config: isSet(object.config) ? ColumnConfig.fromJSON(object.config) : undefined,
@@ -1418,7 +1472,7 @@ export const SchemaTemplateSetting_FieldTemplate = {
if (message.id !== "") {
obj.id = message.id;
}
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
if (message.category !== "") {
@@ -1439,7 +1493,7 @@ export const SchemaTemplateSetting_FieldTemplate = {
fromPartial(object: DeepPartial<SchemaTemplateSetting_FieldTemplate>): SchemaTemplateSetting_FieldTemplate {
const message = createBaseSchemaTemplateSetting_FieldTemplate();
message.id = object.id ?? "";
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
message.category = object.category ?? "";
message.column = (object.column !== undefined && object.column !== null)
? ColumnMetadata.fromPartial(object.column)
@@ -1452,13 +1506,13 @@ export const SchemaTemplateSetting_FieldTemplate = {
};
function createBaseSchemaTemplateSetting_ColumnType(): SchemaTemplateSetting_ColumnType {
- return { engine: 0, enabled: false, types: [] };
+ return { engine: Engine.ENGINE_UNSPECIFIED, enabled: false, types: [] };
}
export const SchemaTemplateSetting_ColumnType = {
encode(message: SchemaTemplateSetting_ColumnType, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.engine !== 0) {
- writer.uint32(8).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(8).int32(engineToNumber(message.engine));
}
if (message.enabled === true) {
writer.uint32(16).bool(message.enabled);
@@ -1481,7 +1535,7 @@ export const SchemaTemplateSetting_ColumnType = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
case 2:
if (tag !== 16) {
@@ -1508,7 +1562,7 @@ export const SchemaTemplateSetting_ColumnType = {
fromJSON(object: any): SchemaTemplateSetting_ColumnType {
return {
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ 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)) : [],
};
@@ -1516,7 +1570,7 @@ export const SchemaTemplateSetting_ColumnType = {
toJSON(message: SchemaTemplateSetting_ColumnType): unknown {
const obj: any = {};
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
if (message.enabled === true) {
@@ -1533,7 +1587,7 @@ export const SchemaTemplateSetting_ColumnType = {
},
fromPartial(object: DeepPartial<SchemaTemplateSetting_ColumnType>): SchemaTemplateSetting_ColumnType {
const message = createBaseSchemaTemplateSetting_ColumnType();
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
message.enabled = object.enabled ?? false;
message.types = object.types?.map((e) => e) || [];
return message;
@@ -1541,7 +1595,7 @@ export const SchemaTemplateSetting_ColumnType = {
};
function createBaseSchemaTemplateSetting_TableTemplate(): SchemaTemplateSetting_TableTemplate {
- return { id: "", engine: 0, category: "", table: undefined, config: undefined };
+ return { id: "", engine: Engine.ENGINE_UNSPECIFIED, category: "", table: undefined, config: undefined };
}
export const SchemaTemplateSetting_TableTemplate = {
@@ -1549,8 +1603,8 @@ export const SchemaTemplateSetting_TableTemplate = {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
- if (message.engine !== 0) {
- writer.uint32(16).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(16).int32(engineToNumber(message.engine));
}
if (message.category !== "") {
writer.uint32(26).string(message.category);
@@ -1583,7 +1637,7 @@ export const SchemaTemplateSetting_TableTemplate = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -1618,7 +1672,7 @@ export const SchemaTemplateSetting_TableTemplate = {
fromJSON(object: any): SchemaTemplateSetting_TableTemplate {
return {
id: isSet(object.id) ? globalThis.String(object.id) : "",
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ 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,
config: isSet(object.config) ? TableConfig.fromJSON(object.config) : undefined,
@@ -1630,7 +1684,7 @@ export const SchemaTemplateSetting_TableTemplate = {
if (message.id !== "") {
obj.id = message.id;
}
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
if (message.category !== "") {
@@ -1651,7 +1705,7 @@ export const SchemaTemplateSetting_TableTemplate = {
fromPartial(object: DeepPartial<SchemaTemplateSetting_TableTemplate>): SchemaTemplateSetting_TableTemplate {
const message = createBaseSchemaTemplateSetting_TableTemplate();
message.id = object.id ?? "";
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
message.category = object.category ?? "";
message.table = (object.table !== undefined && object.table !== null)
? TableMetadata.fromPartial(object.table)
diff --git a/frontend/src/types/proto/store/sheet.ts b/frontend/src/types/proto/store/sheet.ts
index b77ff0ca11..ec756e6116 100644
--- a/frontend/src/types/proto/store/sheet.ts
+++ b/frontend/src/types/proto/store/sheet.ts
@@ -1,7 +1,7 @@
/* eslint-disable */
import Long from "long";
import _m0 from "protobufjs/minimal";
-import { Engine, engineFromJSON, engineToJSON } from "./common";
+import { Engine, engineFromJSON, engineToJSON, engineToNumber } from "./common";
import { DatabaseConfig } from "./database";
export const protobufPackage = "bytebase.store";
@@ -20,7 +20,7 @@ export interface SheetPayload {
}
function createBaseSheetPayload(): SheetPayload {
- return { databaseConfig: undefined, baselineDatabaseConfig: undefined, engine: 0 };
+ return { databaseConfig: undefined, baselineDatabaseConfig: undefined, engine: Engine.ENGINE_UNSPECIFIED };
}
export const SheetPayload = {
@@ -31,8 +31,8 @@ export const SheetPayload = {
if (message.baselineDatabaseConfig !== undefined) {
DatabaseConfig.encode(message.baselineDatabaseConfig, writer.uint32(18).fork()).ldelim();
}
- if (message.engine !== 0) {
- writer.uint32(24).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(24).int32(engineToNumber(message.engine));
}
return writer;
},
@@ -63,7 +63,7 @@ export const SheetPayload = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -80,7 +80,7 @@ export const SheetPayload = {
baselineDatabaseConfig: isSet(object.baselineDatabaseConfig)
? DatabaseConfig.fromJSON(object.baselineDatabaseConfig)
: undefined,
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
};
},
@@ -92,7 +92,7 @@ export const SheetPayload = {
if (message.baselineDatabaseConfig !== undefined) {
obj.baselineDatabaseConfig = DatabaseConfig.toJSON(message.baselineDatabaseConfig);
}
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
return obj;
@@ -110,7 +110,7 @@ export const SheetPayload = {
(object.baselineDatabaseConfig !== undefined && object.baselineDatabaseConfig !== null)
? DatabaseConfig.fromPartial(object.baselineDatabaseConfig)
: undefined;
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
return message;
},
};
diff --git a/frontend/src/types/proto/v1/anomaly_service.ts b/frontend/src/types/proto/v1/anomaly_service.ts
index 1e4a00f625..24412fa2de 100644
--- a/frontend/src/types/proto/v1/anomaly_service.ts
+++ b/frontend/src/types/proto/v1/anomaly_service.ts
@@ -64,27 +64,27 @@ export interface Anomaly {
/** AnomalyType is the type of the anomaly. */
export enum Anomaly_AnomalyType {
/** ANOMALY_TYPE_UNSPECIFIED - Unspecified anomaly type. */
- ANOMALY_TYPE_UNSPECIFIED = 0,
+ ANOMALY_TYPE_UNSPECIFIED = "ANOMALY_TYPE_UNSPECIFIED",
/**
* INSTANCE_CONNECTION - Instance level anomaly.
*
* INSTANCE_CONNECTION is the anomaly type for instance connection, e.g. the instance is down.
*/
- INSTANCE_CONNECTION = 1,
+ INSTANCE_CONNECTION = "INSTANCE_CONNECTION",
/** MIGRATION_SCHEMA - MIGRATION_SCHEMA is the anomaly type for migration schema, e.g. the migration schema in the instance is missing. */
- MIGRATION_SCHEMA = 2,
+ MIGRATION_SCHEMA = "MIGRATION_SCHEMA",
/**
* DATABASE_CONNECTION - Database level anomaly.
*
* DATABASE_CONNECTION is the anomaly type for database connection, e.g. the database had been deleted.
*/
- DATABASE_CONNECTION = 5,
+ DATABASE_CONNECTION = "DATABASE_CONNECTION",
/**
* DATABASE_SCHEMA_DRIFT - DATABASE_SCHEMA_DRIFT is the anomaly type for database schema drift,
* e.g. the database schema had been changed without bytebase migration.
*/
- DATABASE_SCHEMA_DRIFT = 6,
- UNRECOGNIZED = -1,
+ DATABASE_SCHEMA_DRIFT = "DATABASE_SCHEMA_DRIFT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function anomaly_AnomalyTypeFromJSON(object: any): Anomaly_AnomalyType {
@@ -129,17 +129,35 @@ export function anomaly_AnomalyTypeToJSON(object: Anomaly_AnomalyType): string {
}
}
+export function anomaly_AnomalyTypeToNumber(object: Anomaly_AnomalyType): number {
+ switch (object) {
+ case Anomaly_AnomalyType.ANOMALY_TYPE_UNSPECIFIED:
+ return 0;
+ case Anomaly_AnomalyType.INSTANCE_CONNECTION:
+ return 1;
+ case Anomaly_AnomalyType.MIGRATION_SCHEMA:
+ return 2;
+ case Anomaly_AnomalyType.DATABASE_CONNECTION:
+ return 5;
+ case Anomaly_AnomalyType.DATABASE_SCHEMA_DRIFT:
+ return 6;
+ case Anomaly_AnomalyType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/** AnomalySeverity is the severity of the anomaly. */
export enum Anomaly_AnomalySeverity {
/** ANOMALY_SEVERITY_UNSPECIFIED - Unspecified anomaly severity. */
- ANOMALY_SEVERITY_UNSPECIFIED = 0,
+ ANOMALY_SEVERITY_UNSPECIFIED = "ANOMALY_SEVERITY_UNSPECIFIED",
/** MEDIUM - MEDIUM is the info level anomaly severity. */
- MEDIUM = 1,
+ MEDIUM = "MEDIUM",
/** HIGH - HIGH is the warning level anomaly severity. */
- HIGH = 2,
+ HIGH = "HIGH",
/** CRITICAL - CRITICAL is the critical level anomaly severity. */
- CRITICAL = 3,
- UNRECOGNIZED = -1,
+ CRITICAL = "CRITICAL",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function anomaly_AnomalySeverityFromJSON(object: any): Anomaly_AnomalySeverity {
@@ -179,6 +197,22 @@ export function anomaly_AnomalySeverityToJSON(object: Anomaly_AnomalySeverity):
}
}
+export function anomaly_AnomalySeverityToNumber(object: Anomaly_AnomalySeverity): number {
+ switch (object) {
+ case Anomaly_AnomalySeverity.ANOMALY_SEVERITY_UNSPECIFIED:
+ return 0;
+ case Anomaly_AnomalySeverity.MEDIUM:
+ return 1;
+ case Anomaly_AnomalySeverity.HIGH:
+ return 2;
+ case Anomaly_AnomalySeverity.CRITICAL:
+ return 3;
+ case Anomaly_AnomalySeverity.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/**
* Instance level anomaly detail.
*
@@ -377,8 +411,8 @@ export const SearchAnomaliesResponse = {
function createBaseAnomaly(): Anomaly {
return {
resource: "",
- type: 0,
- severity: 0,
+ type: Anomaly_AnomalyType.ANOMALY_TYPE_UNSPECIFIED,
+ severity: Anomaly_AnomalySeverity.ANOMALY_SEVERITY_UNSPECIFIED,
instanceConnectionDetail: undefined,
databaseConnectionDetail: undefined,
databaseSchemaDriftDetail: undefined,
@@ -392,11 +426,11 @@ export const Anomaly = {
if (message.resource !== "") {
writer.uint32(10).string(message.resource);
}
- if (message.type !== 0) {
- writer.uint32(16).int32(message.type);
+ if (message.type !== Anomaly_AnomalyType.ANOMALY_TYPE_UNSPECIFIED) {
+ writer.uint32(16).int32(anomaly_AnomalyTypeToNumber(message.type));
}
- if (message.severity !== 0) {
- writer.uint32(24).int32(message.severity);
+ if (message.severity !== Anomaly_AnomalySeverity.ANOMALY_SEVERITY_UNSPECIFIED) {
+ writer.uint32(24).int32(anomaly_AnomalySeverityToNumber(message.severity));
}
if (message.instanceConnectionDetail !== undefined) {
Anomaly_InstanceConnectionDetail.encode(message.instanceConnectionDetail, writer.uint32(34).fork()).ldelim();
@@ -435,14 +469,14 @@ export const Anomaly = {
break;
}
- message.type = reader.int32() as any;
+ message.type = anomaly_AnomalyTypeFromJSON(reader.int32());
continue;
case 3:
if (tag !== 24) {
break;
}
- message.severity = reader.int32() as any;
+ message.severity = anomaly_AnomalySeverityFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -491,8 +525,12 @@ export const Anomaly = {
fromJSON(object: any): Anomaly {
return {
resource: isSet(object.resource) ? globalThis.String(object.resource) : "",
- type: isSet(object.type) ? anomaly_AnomalyTypeFromJSON(object.type) : 0,
- severity: isSet(object.severity) ? anomaly_AnomalySeverityFromJSON(object.severity) : 0,
+ type: isSet(object.type)
+ ? anomaly_AnomalyTypeFromJSON(object.type)
+ : Anomaly_AnomalyType.ANOMALY_TYPE_UNSPECIFIED,
+ severity: isSet(object.severity)
+ ? anomaly_AnomalySeverityFromJSON(object.severity)
+ : Anomaly_AnomalySeverity.ANOMALY_SEVERITY_UNSPECIFIED,
instanceConnectionDetail: isSet(object.instanceConnectionDetail)
? Anomaly_InstanceConnectionDetail.fromJSON(object.instanceConnectionDetail)
: undefined,
@@ -512,10 +550,10 @@ export const Anomaly = {
if (message.resource !== "") {
obj.resource = message.resource;
}
- if (message.type !== 0) {
+ if (message.type !== Anomaly_AnomalyType.ANOMALY_TYPE_UNSPECIFIED) {
obj.type = anomaly_AnomalyTypeToJSON(message.type);
}
- if (message.severity !== 0) {
+ if (message.severity !== Anomaly_AnomalySeverity.ANOMALY_SEVERITY_UNSPECIFIED) {
obj.severity = anomaly_AnomalySeverityToJSON(message.severity);
}
if (message.instanceConnectionDetail !== undefined) {
@@ -542,8 +580,8 @@ export const Anomaly = {
fromPartial(object: DeepPartial<Anomaly>): Anomaly {
const message = createBaseAnomaly();
message.resource = object.resource ?? "";
- message.type = object.type ?? 0;
- message.severity = object.severity ?? 0;
+ message.type = object.type ?? Anomaly_AnomalyType.ANOMALY_TYPE_UNSPECIFIED;
+ message.severity = object.severity ?? Anomaly_AnomalySeverity.ANOMALY_SEVERITY_UNSPECIFIED;
message.instanceConnectionDetail =
(object.instanceConnectionDetail !== undefined && object.instanceConnectionDetail !== null)
? Anomaly_InstanceConnectionDetail.fromPartial(object.instanceConnectionDetail)
diff --git a/frontend/src/types/proto/v1/audit_log_service.ts b/frontend/src/types/proto/v1/audit_log_service.ts
index cc065b0207..391614c420 100644
--- a/frontend/src/types/proto/v1/audit_log_service.ts
+++ b/frontend/src/types/proto/v1/audit_log_service.ts
@@ -69,16 +69,16 @@ export interface AuditLog {
}
export enum AuditLog_Severity {
- DEFAULT = 0,
- DEBUG = 1,
- INFO = 2,
- NOTICE = 3,
- WARNING = 4,
- ERROR = 5,
- CRITICAL = 6,
- ALERT = 7,
- EMERGENCY = 8,
- UNRECOGNIZED = -1,
+ DEFAULT = "DEFAULT",
+ DEBUG = "DEBUG",
+ INFO = "INFO",
+ NOTICE = "NOTICE",
+ WARNING = "WARNING",
+ ERROR = "ERROR",
+ CRITICAL = "CRITICAL",
+ ALERT = "ALERT",
+ EMERGENCY = "EMERGENCY",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function auditLog_SeverityFromJSON(object: any): AuditLog_Severity {
@@ -143,6 +143,32 @@ export function auditLog_SeverityToJSON(object: AuditLog_Severity): string {
}
}
+export function auditLog_SeverityToNumber(object: AuditLog_Severity): number {
+ switch (object) {
+ case AuditLog_Severity.DEFAULT:
+ return 0;
+ case AuditLog_Severity.DEBUG:
+ return 1;
+ case AuditLog_Severity.INFO:
+ return 2;
+ case AuditLog_Severity.NOTICE:
+ return 3;
+ case AuditLog_Severity.WARNING:
+ return 4;
+ case AuditLog_Severity.ERROR:
+ return 5;
+ case AuditLog_Severity.CRITICAL:
+ return 6;
+ case AuditLog_Severity.ALERT:
+ return 7;
+ case AuditLog_Severity.EMERGENCY:
+ return 8;
+ case AuditLog_Severity.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
function createBaseSearchAuditLogsRequest(): SearchAuditLogsRequest {
return { filter: "", orderBy: "", pageSize: 0, pageToken: "" };
}
@@ -329,7 +355,7 @@ function createBaseAuditLog(): AuditLog {
createTime: undefined,
user: "",
method: "",
- severity: 0,
+ severity: AuditLog_Severity.DEFAULT,
resource: "",
request: "",
response: "",
@@ -351,8 +377,8 @@ export const AuditLog = {
if (message.method !== "") {
writer.uint32(34).string(message.method);
}
- if (message.severity !== 0) {
- writer.uint32(40).int32(message.severity);
+ if (message.severity !== AuditLog_Severity.DEFAULT) {
+ writer.uint32(40).int32(auditLog_SeverityToNumber(message.severity));
}
if (message.resource !== "") {
writer.uint32(50).string(message.resource);
@@ -409,7 +435,7 @@ export const AuditLog = {
break;
}
- message.severity = reader.int32() as any;
+ message.severity = auditLog_SeverityFromJSON(reader.int32());
continue;
case 6:
if (tag !== 50) {
@@ -454,7 +480,7 @@ export const AuditLog = {
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) : 0,
+ 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) : "",
@@ -476,7 +502,7 @@ export const AuditLog = {
if (message.method !== "") {
obj.method = message.method;
}
- if (message.severity !== 0) {
+ if (message.severity !== AuditLog_Severity.DEFAULT) {
obj.severity = auditLog_SeverityToJSON(message.severity);
}
if (message.resource !== "") {
@@ -503,7 +529,7 @@ export const AuditLog = {
message.createTime = object.createTime ?? undefined;
message.user = object.user ?? "";
message.method = object.method ?? "";
- message.severity = object.severity ?? 0;
+ message.severity = object.severity ?? AuditLog_Severity.DEFAULT;
message.resource = object.resource ?? "";
message.request = object.request ?? "";
message.response = object.response ?? "";
diff --git a/frontend/src/types/proto/v1/auth_service.ts b/frontend/src/types/proto/v1/auth_service.ts
index 59e2afe3bd..1d17fd3f86 100644
--- a/frontend/src/types/proto/v1/auth_service.ts
+++ b/frontend/src/types/proto/v1/auth_service.ts
@@ -3,16 +3,16 @@ import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
-import { State, stateFromJSON, stateToJSON } from "./common";
+import { State, stateFromJSON, stateToJSON, stateToNumber } from "./common";
export const protobufPackage = "bytebase.v1";
export enum UserType {
- USER_TYPE_UNSPECIFIED = 0,
- USER = 1,
- SYSTEM_BOT = 2,
- SERVICE_ACCOUNT = 3,
- UNRECOGNIZED = -1,
+ USER_TYPE_UNSPECIFIED = "USER_TYPE_UNSPECIFIED",
+ USER = "USER",
+ SYSTEM_BOT = "SYSTEM_BOT",
+ SERVICE_ACCOUNT = "SERVICE_ACCOUNT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function userTypeFromJSON(object: any): UserType {
@@ -52,6 +52,22 @@ export function userTypeToJSON(object: UserType): string {
}
}
+export function userTypeToNumber(object: UserType): number {
+ switch (object) {
+ case UserType.USER_TYPE_UNSPECIFIED:
+ return 0;
+ case UserType.USER:
+ return 1;
+ case UserType.SYSTEM_BOT:
+ return 2;
+ case UserType.SERVICE_ACCOUNT:
+ return 3;
+ case UserType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface GetUserRequest {
/**
* The name of the user to retrieve.
@@ -1209,10 +1225,10 @@ export const LogoutRequest = {
function createBaseUser(): User {
return {
name: "",
- state: 0,
+ state: State.STATE_UNSPECIFIED,
email: "",
title: "",
- userType: 0,
+ userType: UserType.USER_TYPE_UNSPECIFIED,
password: "",
serviceKey: "",
mfaEnabled: false,
@@ -1228,8 +1244,8 @@ export const User = {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
- if (message.state !== 0) {
- writer.uint32(16).int32(message.state);
+ if (message.state !== State.STATE_UNSPECIFIED) {
+ writer.uint32(16).int32(stateToNumber(message.state));
}
if (message.email !== "") {
writer.uint32(26).string(message.email);
@@ -1237,8 +1253,8 @@ export const User = {
if (message.title !== "") {
writer.uint32(34).string(message.title);
}
- if (message.userType !== 0) {
- writer.uint32(40).int32(message.userType);
+ if (message.userType !== UserType.USER_TYPE_UNSPECIFIED) {
+ writer.uint32(40).int32(userTypeToNumber(message.userType));
}
if (message.password !== "") {
writer.uint32(58).string(message.password);
@@ -1283,7 +1299,7 @@ export const User = {
break;
}
- message.state = reader.int32() as any;
+ message.state = stateFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -1304,7 +1320,7 @@ export const User = {
break;
}
- message.userType = reader.int32() as any;
+ message.userType = userTypeFromJSON(reader.int32());
continue;
case 7:
if (tag !== 58) {
@@ -1367,10 +1383,10 @@ export const User = {
fromJSON(object: any): User {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
- state: isSet(object.state) ? stateFromJSON(object.state) : 0,
+ 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) : 0,
+ 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,
@@ -1388,7 +1404,7 @@ export const User = {
if (message.name !== "") {
obj.name = message.name;
}
- if (message.state !== 0) {
+ if (message.state !== State.STATE_UNSPECIFIED) {
obj.state = stateToJSON(message.state);
}
if (message.email !== "") {
@@ -1397,7 +1413,7 @@ export const User = {
if (message.title !== "") {
obj.title = message.title;
}
- if (message.userType !== 0) {
+ if (message.userType !== UserType.USER_TYPE_UNSPECIFIED) {
obj.userType = userTypeToJSON(message.userType);
}
if (message.password !== "") {
@@ -1430,10 +1446,10 @@ export const User = {
fromPartial(object: DeepPartial<User>): User {
const message = createBaseUser();
message.name = object.name ?? "";
- message.state = object.state ?? 0;
+ message.state = object.state ?? State.STATE_UNSPECIFIED;
message.email = object.email ?? "";
message.title = object.title ?? "";
- message.userType = object.userType ?? 0;
+ message.userType = object.userType ?? UserType.USER_TYPE_UNSPECIFIED;
message.password = object.password ?? "";
message.serviceKey = object.serviceKey ?? "";
message.mfaEnabled = object.mfaEnabled ?? false;
diff --git a/frontend/src/types/proto/v1/branch_service.ts b/frontend/src/types/proto/v1/branch_service.ts
index 982c221ecc..649cc2dae3 100644
--- a/frontend/src/types/proto/v1/branch_service.ts
+++ b/frontend/src/types/proto/v1/branch_service.ts
@@ -4,7 +4,7 @@ import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
import { Timestamp } from "../google/protobuf/timestamp";
-import { Engine, engineFromJSON, engineToJSON } from "./common";
+import { Engine, engineFromJSON, engineToJSON, engineToNumber } from "./common";
import { DatabaseMetadata } from "./database_service";
export const protobufPackage = "bytebase.v1";
@@ -14,12 +14,12 @@ export enum BranchView {
* BRANCH_VIEW_UNSPECIFIED - The default / unset value.
* The API will default to the BASIC view.
*/
- BRANCH_VIEW_UNSPECIFIED = 0,
+ BRANCH_VIEW_UNSPECIFIED = "BRANCH_VIEW_UNSPECIFIED",
/** BRANCH_VIEW_BASIC - Exclude schema, baseline_schema. */
- BRANCH_VIEW_BASIC = 1,
+ BRANCH_VIEW_BASIC = "BRANCH_VIEW_BASIC",
/** BRANCH_VIEW_FULL - Include everything. */
- BRANCH_VIEW_FULL = 2,
- UNRECOGNIZED = -1,
+ BRANCH_VIEW_FULL = "BRANCH_VIEW_FULL",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function branchViewFromJSON(object: any): BranchView {
@@ -54,6 +54,20 @@ export function branchViewToJSON(object: BranchView): string {
}
}
+export function branchViewToNumber(object: BranchView): number {
+ switch (object) {
+ case BranchView.BRANCH_VIEW_UNSPECIFIED:
+ return 0;
+ case BranchView.BRANCH_VIEW_BASIC:
+ return 1;
+ case BranchView.BRANCH_VIEW_FULL:
+ return 2;
+ case BranchView.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface Branch {
/**
* The name of the branch.
@@ -327,7 +341,7 @@ function createBaseBranch(): Branch {
schemaMetadata: undefined,
baselineSchema: "",
baselineSchemaMetadata: undefined,
- engine: 0,
+ engine: Engine.ENGINE_UNSPECIFIED,
baselineDatabase: "",
parentBranch: "",
etag: "",
@@ -358,8 +372,8 @@ export const Branch = {
if (message.baselineSchemaMetadata !== undefined) {
DatabaseMetadata.encode(message.baselineSchemaMetadata, writer.uint32(50).fork()).ldelim();
}
- if (message.engine !== 0) {
- writer.uint32(56).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(56).int32(engineToNumber(message.engine));
}
if (message.baselineDatabase !== "") {
writer.uint32(66).string(message.baselineDatabase);
@@ -439,7 +453,7 @@ export const Branch = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
case 8:
if (tag !== 66) {
@@ -509,7 +523,7 @@ export const Branch = {
baselineSchemaMetadata: isSet(object.baselineSchemaMetadata)
? DatabaseMetadata.fromJSON(object.baselineSchemaMetadata)
: undefined,
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
baselineDatabase: isSet(object.baselineDatabase) ? globalThis.String(object.baselineDatabase) : "",
parentBranch: isSet(object.parentBranch) ? globalThis.String(object.parentBranch) : "",
etag: isSet(object.etag) ? globalThis.String(object.etag) : "",
@@ -540,7 +554,7 @@ export const Branch = {
if (message.baselineSchemaMetadata !== undefined) {
obj.baselineSchemaMetadata = DatabaseMetadata.toJSON(message.baselineSchemaMetadata);
}
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
if (message.baselineDatabase !== "") {
@@ -583,7 +597,7 @@ export const Branch = {
(object.baselineSchemaMetadata !== undefined && object.baselineSchemaMetadata !== null)
? DatabaseMetadata.fromPartial(object.baselineSchemaMetadata)
: undefined;
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
message.baselineDatabase = object.baselineDatabase ?? "";
message.parentBranch = object.parentBranch ?? "";
message.etag = object.etag ?? "";
@@ -653,7 +667,7 @@ export const GetBranchRequest = {
};
function createBaseListBranchesRequest(): ListBranchesRequest {
- return { parent: "", filter: "", pageSize: 0, pageToken: "", view: 0 };
+ return { parent: "", filter: "", pageSize: 0, pageToken: "", view: BranchView.BRANCH_VIEW_UNSPECIFIED };
}
export const ListBranchesRequest = {
@@ -670,8 +684,8 @@ export const ListBranchesRequest = {
if (message.pageToken !== "") {
writer.uint32(34).string(message.pageToken);
}
- if (message.view !== 0) {
- writer.uint32(40).int32(message.view);
+ if (message.view !== BranchView.BRANCH_VIEW_UNSPECIFIED) {
+ writer.uint32(40).int32(branchViewToNumber(message.view));
}
return writer;
},
@@ -716,7 +730,7 @@ export const ListBranchesRequest = {
break;
}
- message.view = reader.int32() as any;
+ message.view = branchViewFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -733,7 +747,7 @@ export const ListBranchesRequest = {
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) : "",
- view: isSet(object.view) ? branchViewFromJSON(object.view) : 0,
+ view: isSet(object.view) ? branchViewFromJSON(object.view) : BranchView.BRANCH_VIEW_UNSPECIFIED,
};
},
@@ -751,7 +765,7 @@ export const ListBranchesRequest = {
if (message.pageToken !== "") {
obj.pageToken = message.pageToken;
}
- if (message.view !== 0) {
+ if (message.view !== BranchView.BRANCH_VIEW_UNSPECIFIED) {
obj.view = branchViewToJSON(message.view);
}
return obj;
@@ -766,7 +780,7 @@ export const ListBranchesRequest = {
message.filter = object.filter ?? "";
message.pageSize = object.pageSize ?? 0;
message.pageToken = object.pageToken ?? "";
- message.view = object.view ?? 0;
+ message.view = object.view ?? BranchView.BRANCH_VIEW_UNSPECIFIED;
return message;
},
};
@@ -1579,7 +1593,7 @@ export const DiffDatabaseResponse = {
};
function createBaseDiffMetadataRequest(): DiffMetadataRequest {
- return { sourceMetadata: undefined, targetMetadata: undefined, engine: 0 };
+ return { sourceMetadata: undefined, targetMetadata: undefined, engine: Engine.ENGINE_UNSPECIFIED };
}
export const DiffMetadataRequest = {
@@ -1590,8 +1604,8 @@ export const DiffMetadataRequest = {
if (message.targetMetadata !== undefined) {
DatabaseMetadata.encode(message.targetMetadata, writer.uint32(18).fork()).ldelim();
}
- if (message.engine !== 0) {
- writer.uint32(24).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(24).int32(engineToNumber(message.engine));
}
return writer;
},
@@ -1622,7 +1636,7 @@ export const DiffMetadataRequest = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -1637,7 +1651,7 @@ export const DiffMetadataRequest = {
return {
sourceMetadata: isSet(object.sourceMetadata) ? DatabaseMetadata.fromJSON(object.sourceMetadata) : undefined,
targetMetadata: isSet(object.targetMetadata) ? DatabaseMetadata.fromJSON(object.targetMetadata) : undefined,
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
};
},
@@ -1649,7 +1663,7 @@ export const DiffMetadataRequest = {
if (message.targetMetadata !== undefined) {
obj.targetMetadata = DatabaseMetadata.toJSON(message.targetMetadata);
}
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
return obj;
@@ -1666,7 +1680,7 @@ export const DiffMetadataRequest = {
message.targetMetadata = (object.targetMetadata !== undefined && object.targetMetadata !== null)
? DatabaseMetadata.fromPartial(object.targetMetadata)
: undefined;
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
return message;
},
};
diff --git a/frontend/src/types/proto/v1/common.ts b/frontend/src/types/proto/v1/common.ts
index d92afee0ee..7422967d42 100644
--- a/frontend/src/types/proto/v1/common.ts
+++ b/frontend/src/types/proto/v1/common.ts
@@ -3,10 +3,10 @@
export const protobufPackage = "bytebase.v1";
export enum State {
- STATE_UNSPECIFIED = 0,
- ACTIVE = 1,
- DELETED = 2,
- UNRECOGNIZED = -1,
+ STATE_UNSPECIFIED = "STATE_UNSPECIFIED",
+ ACTIVE = "ACTIVE",
+ DELETED = "DELETED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function stateFromJSON(object: any): State {
@@ -41,30 +41,44 @@ export function stateToJSON(object: State): string {
}
}
+export function stateToNumber(object: State): number {
+ switch (object) {
+ case State.STATE_UNSPECIFIED:
+ return 0;
+ case State.ACTIVE:
+ return 1;
+ case State.DELETED:
+ return 2;
+ case State.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum Engine {
- ENGINE_UNSPECIFIED = 0,
- CLICKHOUSE = 1,
- MYSQL = 2,
- POSTGRES = 3,
- SNOWFLAKE = 4,
- SQLITE = 5,
- TIDB = 6,
- MONGODB = 7,
- REDIS = 8,
- ORACLE = 9,
- SPANNER = 10,
- MSSQL = 11,
- REDSHIFT = 12,
- MARIADB = 13,
- OCEANBASE = 14,
- DM = 15,
- RISINGWAVE = 16,
- OCEANBASE_ORACLE = 17,
- STARROCKS = 18,
- DORIS = 19,
- HIVE = 20,
- ELASTICSEARCH = 21,
- UNRECOGNIZED = -1,
+ ENGINE_UNSPECIFIED = "ENGINE_UNSPECIFIED",
+ CLICKHOUSE = "CLICKHOUSE",
+ MYSQL = "MYSQL",
+ POSTGRES = "POSTGRES",
+ SNOWFLAKE = "SNOWFLAKE",
+ SQLITE = "SQLITE",
+ TIDB = "TIDB",
+ MONGODB = "MONGODB",
+ REDIS = "REDIS",
+ ORACLE = "ORACLE",
+ SPANNER = "SPANNER",
+ MSSQL = "MSSQL",
+ REDSHIFT = "REDSHIFT",
+ MARIADB = "MARIADB",
+ OCEANBASE = "OCEANBASE",
+ DM = "DM",
+ RISINGWAVE = "RISINGWAVE",
+ OCEANBASE_ORACLE = "OCEANBASE_ORACLE",
+ STARROCKS = "STARROCKS",
+ DORIS = "DORIS",
+ HIVE = "HIVE",
+ ELASTICSEARCH = "ELASTICSEARCH",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function engineFromJSON(object: any): Engine {
@@ -194,17 +208,69 @@ export function engineToJSON(object: Engine): string {
}
}
+export function engineToNumber(object: Engine): number {
+ switch (object) {
+ case Engine.ENGINE_UNSPECIFIED:
+ return 0;
+ case Engine.CLICKHOUSE:
+ return 1;
+ case Engine.MYSQL:
+ return 2;
+ case Engine.POSTGRES:
+ return 3;
+ case Engine.SNOWFLAKE:
+ return 4;
+ case Engine.SQLITE:
+ return 5;
+ case Engine.TIDB:
+ return 6;
+ case Engine.MONGODB:
+ return 7;
+ case Engine.REDIS:
+ return 8;
+ case Engine.ORACLE:
+ return 9;
+ case Engine.SPANNER:
+ return 10;
+ case Engine.MSSQL:
+ return 11;
+ case Engine.REDSHIFT:
+ return 12;
+ case Engine.MARIADB:
+ return 13;
+ case Engine.OCEANBASE:
+ return 14;
+ case Engine.DM:
+ return 15;
+ case Engine.RISINGWAVE:
+ return 16;
+ case Engine.OCEANBASE_ORACLE:
+ return 17;
+ case Engine.STARROCKS:
+ return 18;
+ case Engine.DORIS:
+ return 19;
+ case Engine.HIVE:
+ return 20;
+ case Engine.ELASTICSEARCH:
+ return 21;
+ case Engine.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum VCSType {
- VCS_TYPE_UNSPECIFIED = 0,
+ VCS_TYPE_UNSPECIFIED = "VCS_TYPE_UNSPECIFIED",
/** GITHUB - GitHub type. Using for GitHub community edition(ce). */
- GITHUB = 1,
+ GITHUB = "GITHUB",
/** GITLAB - GitLab type. Using for GitLab community edition(ce) and enterprise edition(ee). */
- GITLAB = 2,
+ GITLAB = "GITLAB",
/** BITBUCKET - BitBucket type. Using for BitBucket cloud or BitBucket server. */
- BITBUCKET = 3,
+ BITBUCKET = "BITBUCKET",
/** AZURE_DEVOPS - Azure DevOps. Using for Azure DevOps GitOps workflow. */
- AZURE_DEVOPS = 4,
- UNRECOGNIZED = -1,
+ AZURE_DEVOPS = "AZURE_DEVOPS",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function vCSTypeFromJSON(object: any): VCSType {
@@ -249,12 +315,30 @@ export function vCSTypeToJSON(object: VCSType): string {
}
}
+export function vCSTypeToNumber(object: VCSType): number {
+ switch (object) {
+ case VCSType.VCS_TYPE_UNSPECIFIED:
+ return 0;
+ case VCSType.GITHUB:
+ return 1;
+ case VCSType.GITLAB:
+ return 2;
+ case VCSType.BITBUCKET:
+ return 3;
+ case VCSType.AZURE_DEVOPS:
+ return 4;
+ case VCSType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum MaskingLevel {
- MASKING_LEVEL_UNSPECIFIED = 0,
- NONE = 1,
- PARTIAL = 2,
- FULL = 3,
- UNRECOGNIZED = -1,
+ MASKING_LEVEL_UNSPECIFIED = "MASKING_LEVEL_UNSPECIFIED",
+ NONE = "NONE",
+ PARTIAL = "PARTIAL",
+ FULL = "FULL",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function maskingLevelFromJSON(object: any): MaskingLevel {
@@ -294,13 +378,29 @@ export function maskingLevelToJSON(object: MaskingLevel): string {
}
}
+export function maskingLevelToNumber(object: MaskingLevel): number {
+ switch (object) {
+ case MaskingLevel.MASKING_LEVEL_UNSPECIFIED:
+ return 0;
+ case MaskingLevel.NONE:
+ return 1;
+ case MaskingLevel.PARTIAL:
+ return 2;
+ case MaskingLevel.FULL:
+ return 3;
+ case MaskingLevel.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum ExportFormat {
- FORMAT_UNSPECIFIED = 0,
- CSV = 1,
- JSON = 2,
- SQL = 3,
- XLSX = 4,
- UNRECOGNIZED = -1,
+ FORMAT_UNSPECIFIED = "FORMAT_UNSPECIFIED",
+ CSV = "CSV",
+ JSON = "JSON",
+ SQL = "SQL",
+ XLSX = "XLSX",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function exportFormatFromJSON(object: any): ExportFormat {
@@ -344,3 +444,21 @@ export function exportFormatToJSON(object: ExportFormat): string {
return "UNRECOGNIZED";
}
}
+
+export function exportFormatToNumber(object: ExportFormat): number {
+ switch (object) {
+ case ExportFormat.FORMAT_UNSPECIFIED:
+ return 0;
+ case ExportFormat.CSV:
+ return 1;
+ case ExportFormat.JSON:
+ return 2;
+ case ExportFormat.SQL:
+ return 3;
+ case ExportFormat.XLSX:
+ return 4;
+ case ExportFormat.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
diff --git a/frontend/src/types/proto/v1/database_service.ts b/frontend/src/types/proto/v1/database_service.ts
index 32fbf734ac..908d8de4b1 100644
--- a/frontend/src/types/proto/v1/database_service.ts
+++ b/frontend/src/types/proto/v1/database_service.ts
@@ -5,7 +5,16 @@ import { Duration } from "../google/protobuf/duration";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
import { Timestamp } from "../google/protobuf/timestamp";
-import { MaskingLevel, maskingLevelFromJSON, maskingLevelToJSON, State, stateFromJSON, stateToJSON } from "./common";
+import {
+ MaskingLevel,
+ maskingLevelFromJSON,
+ maskingLevelToJSON,
+ maskingLevelToNumber,
+ State,
+ stateFromJSON,
+ stateToJSON,
+ stateToNumber,
+} from "./common";
import { InstanceResource } from "./instance_service";
export const protobufPackage = "bytebase.v1";
@@ -15,12 +24,12 @@ export enum DatabaseMetadataView {
* DATABASE_METADATA_VIEW_UNSPECIFIED - The default and unset value.
* The API will default to the BASIC view.
*/
- DATABASE_METADATA_VIEW_UNSPECIFIED = 0,
+ DATABASE_METADATA_VIEW_UNSPECIFIED = "DATABASE_METADATA_VIEW_UNSPECIFIED",
/** DATABASE_METADATA_VIEW_BASIC - Include basic information of schema object names such as schema, table, view, function names. */
- DATABASE_METADATA_VIEW_BASIC = 1,
+ DATABASE_METADATA_VIEW_BASIC = "DATABASE_METADATA_VIEW_BASIC",
/** DATABASE_METADATA_VIEW_FULL - Include everything such as columns and column masking level. */
- DATABASE_METADATA_VIEW_FULL = 2,
- UNRECOGNIZED = -1,
+ DATABASE_METADATA_VIEW_FULL = "DATABASE_METADATA_VIEW_FULL",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function databaseMetadataViewFromJSON(object: any): DatabaseMetadataView {
@@ -55,15 +64,29 @@ export function databaseMetadataViewToJSON(object: DatabaseMetadataView): string
}
}
+export function databaseMetadataViewToNumber(object: DatabaseMetadataView): number {
+ switch (object) {
+ case DatabaseMetadataView.DATABASE_METADATA_VIEW_UNSPECIFIED:
+ return 0;
+ case DatabaseMetadataView.DATABASE_METADATA_VIEW_BASIC:
+ return 1;
+ case DatabaseMetadataView.DATABASE_METADATA_VIEW_FULL:
+ return 2;
+ case DatabaseMetadataView.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum ChangeHistoryView {
/**
* CHANGE_HISTORY_VIEW_UNSPECIFIED - The default / unset value.
* The API will default to the BASIC view.
*/
- CHANGE_HISTORY_VIEW_UNSPECIFIED = 0,
- CHANGE_HISTORY_VIEW_BASIC = 1,
- CHANGE_HISTORY_VIEW_FULL = 2,
- UNRECOGNIZED = -1,
+ CHANGE_HISTORY_VIEW_UNSPECIFIED = "CHANGE_HISTORY_VIEW_UNSPECIFIED",
+ CHANGE_HISTORY_VIEW_BASIC = "CHANGE_HISTORY_VIEW_BASIC",
+ CHANGE_HISTORY_VIEW_FULL = "CHANGE_HISTORY_VIEW_FULL",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function changeHistoryViewFromJSON(object: any): ChangeHistoryView {
@@ -98,6 +121,20 @@ export function changeHistoryViewToJSON(object: ChangeHistoryView): string {
}
}
+export function changeHistoryViewToNumber(object: ChangeHistoryView): number {
+ switch (object) {
+ case ChangeHistoryView.CHANGE_HISTORY_VIEW_UNSPECIFIED:
+ return 0;
+ case ChangeHistoryView.CHANGE_HISTORY_VIEW_BASIC:
+ return 1;
+ case ChangeHistoryView.CHANGE_HISTORY_VIEW_FULL:
+ return 2;
+ case ChangeHistoryView.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface GetDatabaseRequest {
/**
* The name of the database to retrieve.
@@ -490,16 +527,16 @@ export interface TablePartitionMetadata {
* PostgreSQL: RANGE, LIST, HASH (https://www.postgresql.org/docs/current/ddl-partitioning.html)
*/
export enum TablePartitionMetadata_Type {
- TYPE_UNSPECIFIED = 0,
- RANGE = 1,
- RANGE_COLUMNS = 2,
- LIST = 3,
- LIST_COLUMNS = 4,
- HASH = 5,
- LINEAR_HASH = 6,
- KEY = 7,
- LINEAR_KEY = 8,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ RANGE = "RANGE",
+ RANGE_COLUMNS = "RANGE_COLUMNS",
+ LIST = "LIST",
+ LIST_COLUMNS = "LIST_COLUMNS",
+ HASH = "HASH",
+ LINEAR_HASH = "LINEAR_HASH",
+ KEY = "KEY",
+ LINEAR_KEY = "LINEAR_KEY",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function tablePartitionMetadata_TypeFromJSON(object: any): TablePartitionMetadata_Type {
@@ -564,6 +601,32 @@ export function tablePartitionMetadata_TypeToJSON(object: TablePartitionMetadata
}
}
+export function tablePartitionMetadata_TypeToNumber(object: TablePartitionMetadata_Type): number {
+ switch (object) {
+ case TablePartitionMetadata_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case TablePartitionMetadata_Type.RANGE:
+ return 1;
+ case TablePartitionMetadata_Type.RANGE_COLUMNS:
+ return 2;
+ case TablePartitionMetadata_Type.LIST:
+ return 3;
+ case TablePartitionMetadata_Type.LIST_COLUMNS:
+ return 4;
+ case TablePartitionMetadata_Type.HASH:
+ return 5;
+ case TablePartitionMetadata_Type.LINEAR_HASH:
+ return 6;
+ case TablePartitionMetadata_Type.KEY:
+ return 7;
+ case TablePartitionMetadata_Type.LINEAR_KEY:
+ return 8;
+ case TablePartitionMetadata_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/** ColumnMetadata is the metadata for columns. */
export interface ColumnMetadata {
/** The name is the name of a column. */
@@ -682,10 +745,10 @@ export interface TaskMetadata {
}
export enum TaskMetadata_State {
- STATE_UNSPECIFIED = 0,
- STATE_STARTED = 1,
- STATE_SUSPENDED = 2,
- UNRECOGNIZED = -1,
+ STATE_UNSPECIFIED = "STATE_UNSPECIFIED",
+ STATE_STARTED = "STATE_STARTED",
+ STATE_SUSPENDED = "STATE_SUSPENDED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function taskMetadata_StateFromJSON(object: any): TaskMetadata_State {
@@ -720,6 +783,20 @@ export function taskMetadata_StateToJSON(object: TaskMetadata_State): string {
}
}
+export function taskMetadata_StateToNumber(object: TaskMetadata_State): number {
+ switch (object) {
+ case TaskMetadata_State.STATE_UNSPECIFIED:
+ return 0;
+ case TaskMetadata_State.STATE_STARTED:
+ return 1;
+ case TaskMetadata_State.STATE_SUSPENDED:
+ return 2;
+ case TaskMetadata_State.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface StreamMetadata {
/** The name is the name of a stream. */
name: string;
@@ -740,9 +817,9 @@ export interface StreamMetadata {
}
export enum StreamMetadata_Type {
- TYPE_UNSPECIFIED = 0,
- TYPE_DELTA = 1,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ TYPE_DELTA = "TYPE_DELTA",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function streamMetadata_TypeFromJSON(object: any): StreamMetadata_Type {
@@ -772,12 +849,24 @@ export function streamMetadata_TypeToJSON(object: StreamMetadata_Type): string {
}
}
+export function streamMetadata_TypeToNumber(object: StreamMetadata_Type): number {
+ switch (object) {
+ case StreamMetadata_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case StreamMetadata_Type.TYPE_DELTA:
+ return 1;
+ case StreamMetadata_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum StreamMetadata_Mode {
- MODE_UNSPECIFIED = 0,
- MODE_DEFAULT = 1,
- MODE_APPEND_ONLY = 2,
- MODE_INSERT_ONLY = 3,
- UNRECOGNIZED = -1,
+ MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
+ MODE_DEFAULT = "MODE_DEFAULT",
+ MODE_APPEND_ONLY = "MODE_APPEND_ONLY",
+ MODE_INSERT_ONLY = "MODE_INSERT_ONLY",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function streamMetadata_ModeFromJSON(object: any): StreamMetadata_Mode {
@@ -817,6 +906,22 @@ export function streamMetadata_ModeToJSON(object: StreamMetadata_Mode): string {
}
}
+export function streamMetadata_ModeToNumber(object: StreamMetadata_Mode): number {
+ switch (object) {
+ case StreamMetadata_Mode.MODE_UNSPECIFIED:
+ return 0;
+ case StreamMetadata_Mode.MODE_DEFAULT:
+ return 1;
+ case StreamMetadata_Mode.MODE_APPEND_ONLY:
+ return 2;
+ case StreamMetadata_Mode.MODE_INSERT_ONLY:
+ return 3;
+ case StreamMetadata_Mode.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/** IndexMetadata is the metadata for indexes. */
export interface IndexMetadata {
/** The name is the name of an index. */
@@ -1168,11 +1273,11 @@ export interface ChangeHistory {
}
export enum ChangeHistory_Source {
- SOURCE_UNSPECIFIED = 0,
- UI = 1,
- VCS = 2,
- LIBRARY = 3,
- UNRECOGNIZED = -1,
+ SOURCE_UNSPECIFIED = "SOURCE_UNSPECIFIED",
+ UI = "UI",
+ VCS = "VCS",
+ LIBRARY = "LIBRARY",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function changeHistory_SourceFromJSON(object: any): ChangeHistory_Source {
@@ -1212,15 +1317,31 @@ export function changeHistory_SourceToJSON(object: ChangeHistory_Source): string
}
}
+export function changeHistory_SourceToNumber(object: ChangeHistory_Source): number {
+ switch (object) {
+ case ChangeHistory_Source.SOURCE_UNSPECIFIED:
+ return 0;
+ case ChangeHistory_Source.UI:
+ return 1;
+ case ChangeHistory_Source.VCS:
+ return 2;
+ case ChangeHistory_Source.LIBRARY:
+ return 3;
+ case ChangeHistory_Source.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum ChangeHistory_Type {
- TYPE_UNSPECIFIED = 0,
- BASELINE = 1,
- MIGRATE = 2,
- MIGRATE_SDL = 3,
- MIGRATE_GHOST = 4,
- BRANCH = 5,
- DATA = 6,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ BASELINE = "BASELINE",
+ MIGRATE = "MIGRATE",
+ MIGRATE_SDL = "MIGRATE_SDL",
+ MIGRATE_GHOST = "MIGRATE_GHOST",
+ BRANCH = "BRANCH",
+ DATA = "DATA",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function changeHistory_TypeFromJSON(object: any): ChangeHistory_Type {
@@ -1275,12 +1396,34 @@ export function changeHistory_TypeToJSON(object: ChangeHistory_Type): string {
}
}
+export function changeHistory_TypeToNumber(object: ChangeHistory_Type): number {
+ switch (object) {
+ case ChangeHistory_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case ChangeHistory_Type.BASELINE:
+ return 1;
+ case ChangeHistory_Type.MIGRATE:
+ return 2;
+ case ChangeHistory_Type.MIGRATE_SDL:
+ return 3;
+ case ChangeHistory_Type.MIGRATE_GHOST:
+ return 4;
+ case ChangeHistory_Type.BRANCH:
+ return 5;
+ case ChangeHistory_Type.DATA:
+ return 6;
+ case ChangeHistory_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum ChangeHistory_Status {
- STATUS_UNSPECIFIED = 0,
- PENDING = 1,
- DONE = 2,
- FAILED = 3,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ PENDING = "PENDING",
+ DONE = "DONE",
+ FAILED = "FAILED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function changeHistory_StatusFromJSON(object: any): ChangeHistory_Status {
@@ -1320,6 +1463,22 @@ export function changeHistory_StatusToJSON(object: ChangeHistory_Status): string
}
}
+export function changeHistory_StatusToNumber(object: ChangeHistory_Status): number {
+ switch (object) {
+ case ChangeHistory_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case ChangeHistory_Status.PENDING:
+ return 1;
+ case ChangeHistory_Status.DONE:
+ return 2;
+ case ChangeHistory_Status.FAILED:
+ return 3;
+ case ChangeHistory_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface ChangedResources {
databases: ChangedResourceDatabase[];
}
@@ -2147,7 +2306,7 @@ export const SyncDatabaseResponse = {
};
function createBaseGetDatabaseMetadataRequest(): GetDatabaseMetadataRequest {
- return { name: "", view: 0, filter: "" };
+ return { name: "", view: DatabaseMetadataView.DATABASE_METADATA_VIEW_UNSPECIFIED, filter: "" };
}
export const GetDatabaseMetadataRequest = {
@@ -2155,8 +2314,8 @@ export const GetDatabaseMetadataRequest = {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
- if (message.view !== 0) {
- writer.uint32(16).int32(message.view);
+ if (message.view !== DatabaseMetadataView.DATABASE_METADATA_VIEW_UNSPECIFIED) {
+ writer.uint32(16).int32(databaseMetadataViewToNumber(message.view));
}
if (message.filter !== "") {
writer.uint32(26).string(message.filter);
@@ -2183,7 +2342,7 @@ export const GetDatabaseMetadataRequest = {
break;
}
- message.view = reader.int32() as any;
+ message.view = databaseMetadataViewFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -2204,7 +2363,9 @@ export const GetDatabaseMetadataRequest = {
fromJSON(object: any): GetDatabaseMetadataRequest {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
- view: isSet(object.view) ? databaseMetadataViewFromJSON(object.view) : 0,
+ view: isSet(object.view)
+ ? databaseMetadataViewFromJSON(object.view)
+ : DatabaseMetadataView.DATABASE_METADATA_VIEW_UNSPECIFIED,
filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
};
},
@@ -2214,7 +2375,7 @@ export const GetDatabaseMetadataRequest = {
if (message.name !== "") {
obj.name = message.name;
}
- if (message.view !== 0) {
+ if (message.view !== DatabaseMetadataView.DATABASE_METADATA_VIEW_UNSPECIFIED) {
obj.view = databaseMetadataViewToJSON(message.view);
}
if (message.filter !== "") {
@@ -2229,7 +2390,7 @@ export const GetDatabaseMetadataRequest = {
fromPartial(object: DeepPartial<GetDatabaseMetadataRequest>): GetDatabaseMetadataRequest {
const message = createBaseGetDatabaseMetadataRequest();
message.name = object.name ?? "";
- message.view = object.view ?? 0;
+ message.view = object.view ?? DatabaseMetadataView.DATABASE_METADATA_VIEW_UNSPECIFIED;
message.filter = object.filter ?? "";
return message;
},
@@ -2565,7 +2726,7 @@ function createBaseDatabase(): Database {
return {
name: "",
uid: "",
- syncState: 0,
+ syncState: State.STATE_UNSPECIFIED,
successfulSyncTime: undefined,
project: "",
schemaVersion: "",
@@ -2584,8 +2745,8 @@ export const Database = {
if (message.uid !== "") {
writer.uint32(18).string(message.uid);
}
- if (message.syncState !== 0) {
- writer.uint32(24).int32(message.syncState);
+ if (message.syncState !== State.STATE_UNSPECIFIED) {
+ writer.uint32(24).int32(stateToNumber(message.syncState));
}
if (message.successfulSyncTime !== undefined) {
Timestamp.encode(toTimestamp(message.successfulSyncTime), writer.uint32(34).fork()).ldelim();
@@ -2637,7 +2798,7 @@ export const Database = {
break;
}
- message.syncState = reader.int32() as any;
+ message.syncState = stateFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -2704,7 +2865,7 @@ export const Database = {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
- syncState: isSet(object.syncState) ? stateFromJSON(object.syncState) : 0,
+ syncState: isSet(object.syncState) ? stateFromJSON(object.syncState) : 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) : "",
@@ -2728,7 +2889,7 @@ export const Database = {
if (message.uid !== "") {
obj.uid = message.uid;
}
- if (message.syncState !== 0) {
+ if (message.syncState !== State.STATE_UNSPECIFIED) {
obj.syncState = stateToJSON(message.syncState);
}
if (message.successfulSyncTime !== undefined) {
@@ -2768,7 +2929,7 @@ export const Database = {
const message = createBaseDatabase();
message.name = object.name ?? "";
message.uid = object.uid ?? "";
- message.syncState = object.syncState ?? 0;
+ message.syncState = object.syncState ?? State.STATE_UNSPECIFIED;
message.successfulSyncTime = object.successfulSyncTime ?? undefined;
message.project = object.project ?? "";
message.schemaVersion = object.schemaVersion ?? "";
@@ -3608,7 +3769,14 @@ export const TableMetadata = {
};
function createBaseTablePartitionMetadata(): TablePartitionMetadata {
- return { name: "", type: 0, expression: "", value: "", useDefault: "", subpartitions: [] };
+ return {
+ name: "",
+ type: TablePartitionMetadata_Type.TYPE_UNSPECIFIED,
+ expression: "",
+ value: "",
+ useDefault: "",
+ subpartitions: [],
+ };
}
export const TablePartitionMetadata = {
@@ -3616,8 +3784,8 @@ export const TablePartitionMetadata = {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
- if (message.type !== 0) {
- writer.uint32(16).int32(message.type);
+ if (message.type !== TablePartitionMetadata_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(16).int32(tablePartitionMetadata_TypeToNumber(message.type));
}
if (message.expression !== "") {
writer.uint32(26).string(message.expression);
@@ -3653,7 +3821,7 @@ export const TablePartitionMetadata = {
break;
}
- message.type = reader.int32() as any;
+ message.type = tablePartitionMetadata_TypeFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -3695,7 +3863,9 @@ export const TablePartitionMetadata = {
fromJSON(object: any): TablePartitionMetadata {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
- type: isSet(object.type) ? tablePartitionMetadata_TypeFromJSON(object.type) : 0,
+ 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) : "",
@@ -3710,7 +3880,7 @@ export const TablePartitionMetadata = {
if (message.name !== "") {
obj.name = message.name;
}
- if (message.type !== 0) {
+ if (message.type !== TablePartitionMetadata_Type.TYPE_UNSPECIFIED) {
obj.type = tablePartitionMetadata_TypeToJSON(message.type);
}
if (message.expression !== "") {
@@ -3734,7 +3904,7 @@ export const TablePartitionMetadata = {
fromPartial(object: DeepPartial<TablePartitionMetadata>): TablePartitionMetadata {
const message = createBaseTablePartitionMetadata();
message.name = object.name ?? "";
- message.type = object.type ?? 0;
+ message.type = object.type ?? TablePartitionMetadata_Type.TYPE_UNSPECIFIED;
message.expression = object.expression ?? "";
message.value = object.value ?? "";
message.useDefault = object.useDefault ?? "";
@@ -3759,7 +3929,7 @@ function createBaseColumnMetadata(): ColumnMetadata {
comment: "",
classification: "",
userComment: "",
- effectiveMaskingLevel: 0,
+ effectiveMaskingLevel: MaskingLevel.MASKING_LEVEL_UNSPECIFIED,
};
}
@@ -3807,8 +3977,8 @@ export const ColumnMetadata = {
if (message.userComment !== "") {
writer.uint32(106).string(message.userComment);
}
- if (message.effectiveMaskingLevel !== 0) {
- writer.uint32(112).int32(message.effectiveMaskingLevel);
+ if (message.effectiveMaskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
+ writer.uint32(112).int32(maskingLevelToNumber(message.effectiveMaskingLevel));
}
return writer;
},
@@ -3923,7 +4093,7 @@ export const ColumnMetadata = {
break;
}
- message.effectiveMaskingLevel = reader.int32() as any;
+ message.effectiveMaskingLevel = maskingLevelFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -3952,7 +4122,7 @@ export const ColumnMetadata = {
userComment: isSet(object.userComment) ? globalThis.String(object.userComment) : "",
effectiveMaskingLevel: isSet(object.effectiveMaskingLevel)
? maskingLevelFromJSON(object.effectiveMaskingLevel)
- : 0,
+ : MaskingLevel.MASKING_LEVEL_UNSPECIFIED,
};
},
@@ -4000,7 +4170,7 @@ export const ColumnMetadata = {
if (message.userComment !== "") {
obj.userComment = message.userComment;
}
- if (message.effectiveMaskingLevel !== 0) {
+ if (message.effectiveMaskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
obj.effectiveMaskingLevel = maskingLevelToJSON(message.effectiveMaskingLevel);
}
return obj;
@@ -4025,7 +4195,7 @@ export const ColumnMetadata = {
message.comment = object.comment ?? "";
message.classification = object.classification ?? "";
message.userComment = object.userComment ?? "";
- message.effectiveMaskingLevel = object.effectiveMaskingLevel ?? 0;
+ message.effectiveMaskingLevel = object.effectiveMaskingLevel ?? MaskingLevel.MASKING_LEVEL_UNSPECIFIED;
return message;
},
};
@@ -4488,7 +4658,7 @@ function createBaseTaskMetadata(): TaskMetadata {
warehouse: "",
schedule: "",
predecessors: [],
- state: 0,
+ state: TaskMetadata_State.STATE_UNSPECIFIED,
condition: "",
definition: "",
};
@@ -4517,8 +4687,8 @@ export const TaskMetadata = {
for (const v of message.predecessors) {
writer.uint32(58).string(v!);
}
- if (message.state !== 0) {
- writer.uint32(64).int32(message.state);
+ if (message.state !== TaskMetadata_State.STATE_UNSPECIFIED) {
+ writer.uint32(64).int32(taskMetadata_StateToNumber(message.state));
}
if (message.condition !== "") {
writer.uint32(74).string(message.condition);
@@ -4590,7 +4760,7 @@ export const TaskMetadata = {
break;
}
- message.state = reader.int32() as any;
+ message.state = taskMetadata_StateFromJSON(reader.int32());
continue;
case 9:
if (tag !== 74) {
@@ -4626,7 +4796,7 @@ export const TaskMetadata = {
predecessors: globalThis.Array.isArray(object?.predecessors)
? object.predecessors.map((e: any) => globalThis.String(e))
: [],
- state: isSet(object.state) ? taskMetadata_StateFromJSON(object.state) : 0,
+ 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) : "",
};
@@ -4655,7 +4825,7 @@ export const TaskMetadata = {
if (message.predecessors?.length) {
obj.predecessors = message.predecessors;
}
- if (message.state !== 0) {
+ if (message.state !== TaskMetadata_State.STATE_UNSPECIFIED) {
obj.state = taskMetadata_StateToJSON(message.state);
}
if (message.condition !== "") {
@@ -4679,7 +4849,7 @@ export const TaskMetadata = {
message.warehouse = object.warehouse ?? "";
message.schedule = object.schedule ?? "";
message.predecessors = object.predecessors?.map((e) => e) || [];
- message.state = object.state ?? 0;
+ message.state = object.state ?? TaskMetadata_State.STATE_UNSPECIFIED;
message.condition = object.condition ?? "";
message.definition = object.definition ?? "";
return message;
@@ -4687,7 +4857,16 @@ export const TaskMetadata = {
};
function createBaseStreamMetadata(): StreamMetadata {
- return { name: "", tableName: "", owner: "", comment: "", type: 0, stale: false, mode: 0, definition: "" };
+ return {
+ name: "",
+ tableName: "",
+ owner: "",
+ comment: "",
+ type: StreamMetadata_Type.TYPE_UNSPECIFIED,
+ stale: false,
+ mode: StreamMetadata_Mode.MODE_UNSPECIFIED,
+ definition: "",
+ };
}
export const StreamMetadata = {
@@ -4704,14 +4883,14 @@ export const StreamMetadata = {
if (message.comment !== "") {
writer.uint32(34).string(message.comment);
}
- if (message.type !== 0) {
- writer.uint32(40).int32(message.type);
+ if (message.type !== StreamMetadata_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(40).int32(streamMetadata_TypeToNumber(message.type));
}
if (message.stale === true) {
writer.uint32(48).bool(message.stale);
}
- if (message.mode !== 0) {
- writer.uint32(56).int32(message.mode);
+ if (message.mode !== StreamMetadata_Mode.MODE_UNSPECIFIED) {
+ writer.uint32(56).int32(streamMetadata_ModeToNumber(message.mode));
}
if (message.definition !== "") {
writer.uint32(66).string(message.definition);
@@ -4759,7 +4938,7 @@ export const StreamMetadata = {
break;
}
- message.type = reader.int32() as any;
+ message.type = streamMetadata_TypeFromJSON(reader.int32());
continue;
case 6:
if (tag !== 48) {
@@ -4773,7 +4952,7 @@ export const StreamMetadata = {
break;
}
- message.mode = reader.int32() as any;
+ message.mode = streamMetadata_ModeFromJSON(reader.int32());
continue;
case 8:
if (tag !== 66) {
@@ -4797,9 +4976,9 @@ export const StreamMetadata = {
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) : 0,
+ 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) : 0,
+ mode: isSet(object.mode) ? streamMetadata_ModeFromJSON(object.mode) : StreamMetadata_Mode.MODE_UNSPECIFIED,
definition: isSet(object.definition) ? globalThis.String(object.definition) : "",
};
},
@@ -4818,13 +4997,13 @@ export const StreamMetadata = {
if (message.comment !== "") {
obj.comment = message.comment;
}
- if (message.type !== 0) {
+ if (message.type !== StreamMetadata_Type.TYPE_UNSPECIFIED) {
obj.type = streamMetadata_TypeToJSON(message.type);
}
if (message.stale === true) {
obj.stale = message.stale;
}
- if (message.mode !== 0) {
+ if (message.mode !== StreamMetadata_Mode.MODE_UNSPECIFIED) {
obj.mode = streamMetadata_ModeToJSON(message.mode);
}
if (message.definition !== "") {
@@ -4842,9 +5021,9 @@ export const StreamMetadata = {
message.tableName = object.tableName ?? "";
message.owner = object.owner ?? "";
message.comment = object.comment ?? "";
- message.type = object.type ?? 0;
+ message.type = object.type ?? StreamMetadata_Type.TYPE_UNSPECIFIED;
message.stale = object.stale ?? false;
- message.mode = object.mode ?? 0;
+ message.mode = object.mode ?? StreamMetadata_Mode.MODE_UNSPECIFIED;
message.definition = object.definition ?? "";
return message;
},
@@ -7023,9 +7202,9 @@ function createBaseChangeHistory(): ChangeHistory {
createTime: undefined,
updateTime: undefined,
releaseVersion: "",
- source: 0,
- type: 0,
- status: 0,
+ source: ChangeHistory_Source.SOURCE_UNSPECIFIED,
+ type: ChangeHistory_Type.TYPE_UNSPECIFIED,
+ status: ChangeHistory_Status.STATUS_UNSPECIFIED,
version: "",
description: "",
statement: "",
@@ -7064,14 +7243,14 @@ export const ChangeHistory = {
if (message.releaseVersion !== "") {
writer.uint32(58).string(message.releaseVersion);
}
- if (message.source !== 0) {
- writer.uint32(64).int32(message.source);
+ if (message.source !== ChangeHistory_Source.SOURCE_UNSPECIFIED) {
+ writer.uint32(64).int32(changeHistory_SourceToNumber(message.source));
}
- if (message.type !== 0) {
- writer.uint32(72).int32(message.type);
+ if (message.type !== ChangeHistory_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(72).int32(changeHistory_TypeToNumber(message.type));
}
- if (message.status !== 0) {
- writer.uint32(80).int32(message.status);
+ if (message.status !== ChangeHistory_Status.STATUS_UNSPECIFIED) {
+ writer.uint32(80).int32(changeHistory_StatusToNumber(message.status));
}
if (message.version !== "") {
writer.uint32(90).string(message.version);
@@ -7173,21 +7352,21 @@ export const ChangeHistory = {
break;
}
- message.source = reader.int32() as any;
+ message.source = changeHistory_SourceFromJSON(reader.int32());
continue;
case 9:
if (tag !== 72) {
break;
}
- message.type = reader.int32() as any;
+ message.type = changeHistory_TypeFromJSON(reader.int32());
continue;
case 10:
if (tag !== 80) {
break;
}
- message.status = reader.int32() as any;
+ message.status = changeHistory_StatusFromJSON(reader.int32());
continue;
case 11:
if (tag !== 90) {
@@ -7291,9 +7470,13 @@ export const ChangeHistory = {
createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
releaseVersion: isSet(object.releaseVersion) ? globalThis.String(object.releaseVersion) : "",
- source: isSet(object.source) ? changeHistory_SourceFromJSON(object.source) : 0,
- type: isSet(object.type) ? changeHistory_TypeFromJSON(object.type) : 0,
- status: isSet(object.status) ? changeHistory_StatusFromJSON(object.status) : 0,
+ source: isSet(object.source)
+ ? changeHistory_SourceFromJSON(object.source)
+ : ChangeHistory_Source.SOURCE_UNSPECIFIED,
+ type: isSet(object.type) ? changeHistory_TypeFromJSON(object.type) : ChangeHistory_Type.TYPE_UNSPECIFIED,
+ status: isSet(object.status)
+ ? changeHistory_StatusFromJSON(object.status)
+ : ChangeHistory_Status.STATUS_UNSPECIFIED,
version: isSet(object.version) ? globalThis.String(object.version) : "",
description: isSet(object.description) ? globalThis.String(object.description) : "",
statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
@@ -7332,13 +7515,13 @@ export const ChangeHistory = {
if (message.releaseVersion !== "") {
obj.releaseVersion = message.releaseVersion;
}
- if (message.source !== 0) {
+ if (message.source !== ChangeHistory_Source.SOURCE_UNSPECIFIED) {
obj.source = changeHistory_SourceToJSON(message.source);
}
- if (message.type !== 0) {
+ if (message.type !== ChangeHistory_Type.TYPE_UNSPECIFIED) {
obj.type = changeHistory_TypeToJSON(message.type);
}
- if (message.status !== 0) {
+ if (message.status !== ChangeHistory_Status.STATUS_UNSPECIFIED) {
obj.status = changeHistory_StatusToJSON(message.status);
}
if (message.version !== "") {
@@ -7392,9 +7575,9 @@ export const ChangeHistory = {
message.createTime = object.createTime ?? undefined;
message.updateTime = object.updateTime ?? undefined;
message.releaseVersion = object.releaseVersion ?? "";
- message.source = object.source ?? 0;
- message.type = object.type ?? 0;
- message.status = object.status ?? 0;
+ message.source = object.source ?? ChangeHistory_Source.SOURCE_UNSPECIFIED;
+ message.type = object.type ?? ChangeHistory_Type.TYPE_UNSPECIFIED;
+ message.status = object.status ?? ChangeHistory_Status.STATUS_UNSPECIFIED;
message.version = object.version ?? "";
message.description = object.description ?? "";
message.statement = object.statement ?? "";
@@ -7692,7 +7875,13 @@ export const ChangedResourceTable = {
};
function createBaseListChangeHistoriesRequest(): ListChangeHistoriesRequest {
- return { parent: "", pageSize: 0, pageToken: "", view: 0, filter: "" };
+ return {
+ parent: "",
+ pageSize: 0,
+ pageToken: "",
+ view: ChangeHistoryView.CHANGE_HISTORY_VIEW_UNSPECIFIED,
+ filter: "",
+ };
}
export const ListChangeHistoriesRequest = {
@@ -7706,8 +7895,8 @@ export const ListChangeHistoriesRequest = {
if (message.pageToken !== "") {
writer.uint32(26).string(message.pageToken);
}
- if (message.view !== 0) {
- writer.uint32(32).int32(message.view);
+ if (message.view !== ChangeHistoryView.CHANGE_HISTORY_VIEW_UNSPECIFIED) {
+ writer.uint32(32).int32(changeHistoryViewToNumber(message.view));
}
if (message.filter !== "") {
writer.uint32(42).string(message.filter);
@@ -7748,7 +7937,7 @@ export const ListChangeHistoriesRequest = {
break;
}
- message.view = reader.int32() as any;
+ message.view = changeHistoryViewFromJSON(reader.int32());
continue;
case 5:
if (tag !== 42) {
@@ -7771,7 +7960,9 @@ export const ListChangeHistoriesRequest = {
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) ? changeHistoryViewFromJSON(object.view) : 0,
+ view: isSet(object.view)
+ ? changeHistoryViewFromJSON(object.view)
+ : ChangeHistoryView.CHANGE_HISTORY_VIEW_UNSPECIFIED,
filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
};
},
@@ -7787,7 +7978,7 @@ export const ListChangeHistoriesRequest = {
if (message.pageToken !== "") {
obj.pageToken = message.pageToken;
}
- if (message.view !== 0) {
+ if (message.view !== ChangeHistoryView.CHANGE_HISTORY_VIEW_UNSPECIFIED) {
obj.view = changeHistoryViewToJSON(message.view);
}
if (message.filter !== "") {
@@ -7804,7 +7995,7 @@ export const ListChangeHistoriesRequest = {
message.parent = object.parent ?? "";
message.pageSize = object.pageSize ?? 0;
message.pageToken = object.pageToken ?? "";
- message.view = object.view ?? 0;
+ message.view = object.view ?? ChangeHistoryView.CHANGE_HISTORY_VIEW_UNSPECIFIED;
message.filter = object.filter ?? "";
return message;
},
@@ -7887,7 +8078,7 @@ export const ListChangeHistoriesResponse = {
};
function createBaseGetChangeHistoryRequest(): GetChangeHistoryRequest {
- return { name: "", view: 0, sdlFormat: false, concise: false };
+ return { name: "", view: ChangeHistoryView.CHANGE_HISTORY_VIEW_UNSPECIFIED, sdlFormat: false, concise: false };
}
export const GetChangeHistoryRequest = {
@@ -7895,8 +8086,8 @@ export const GetChangeHistoryRequest = {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
- if (message.view !== 0) {
- writer.uint32(16).int32(message.view);
+ if (message.view !== ChangeHistoryView.CHANGE_HISTORY_VIEW_UNSPECIFIED) {
+ writer.uint32(16).int32(changeHistoryViewToNumber(message.view));
}
if (message.sdlFormat === true) {
writer.uint32(24).bool(message.sdlFormat);
@@ -7926,7 +8117,7 @@ export const GetChangeHistoryRequest = {
break;
}
- message.view = reader.int32() as any;
+ message.view = changeHistoryViewFromJSON(reader.int32());
continue;
case 3:
if (tag !== 24) {
@@ -7954,7 +8145,9 @@ export const GetChangeHistoryRequest = {
fromJSON(object: any): GetChangeHistoryRequest {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
- view: isSet(object.view) ? changeHistoryViewFromJSON(object.view) : 0,
+ view: isSet(object.view)
+ ? changeHistoryViewFromJSON(object.view)
+ : ChangeHistoryView.CHANGE_HISTORY_VIEW_UNSPECIFIED,
sdlFormat: isSet(object.sdlFormat) ? globalThis.Boolean(object.sdlFormat) : false,
concise: isSet(object.concise) ? globalThis.Boolean(object.concise) : false,
};
@@ -7965,7 +8158,7 @@ export const GetChangeHistoryRequest = {
if (message.name !== "") {
obj.name = message.name;
}
- if (message.view !== 0) {
+ if (message.view !== ChangeHistoryView.CHANGE_HISTORY_VIEW_UNSPECIFIED) {
obj.view = changeHistoryViewToJSON(message.view);
}
if (message.sdlFormat === true) {
@@ -7983,7 +8176,7 @@ export const GetChangeHistoryRequest = {
fromPartial(object: DeepPartial<GetChangeHistoryRequest>): GetChangeHistoryRequest {
const message = createBaseGetChangeHistoryRequest();
message.name = object.name ?? "";
- message.view = object.view ?? 0;
+ message.view = object.view ?? ChangeHistoryView.CHANGE_HISTORY_VIEW_UNSPECIFIED;
message.sdlFormat = object.sdlFormat ?? false;
message.concise = object.concise ?? false;
return message;
diff --git a/frontend/src/types/proto/v1/environment_service.ts b/frontend/src/types/proto/v1/environment_service.ts
index c8c9691b62..b3fdb95770 100644
--- a/frontend/src/types/proto/v1/environment_service.ts
+++ b/frontend/src/types/proto/v1/environment_service.ts
@@ -3,15 +3,15 @@ import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
-import { State, stateFromJSON, stateToJSON } from "./common";
+import { State, stateFromJSON, stateToJSON, stateToNumber } from "./common";
export const protobufPackage = "bytebase.v1";
export enum EnvironmentTier {
- ENVIRONMENT_TIER_UNSPECIFIED = 0,
- PROTECTED = 1,
- UNPROTECTED = 2,
- UNRECOGNIZED = -1,
+ ENVIRONMENT_TIER_UNSPECIFIED = "ENVIRONMENT_TIER_UNSPECIFIED",
+ PROTECTED = "PROTECTED",
+ UNPROTECTED = "UNPROTECTED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function environmentTierFromJSON(object: any): EnvironmentTier {
@@ -46,6 +46,20 @@ export function environmentTierToJSON(object: EnvironmentTier): string {
}
}
+export function environmentTierToNumber(object: EnvironmentTier): number {
+ switch (object) {
+ case EnvironmentTier.ENVIRONMENT_TIER_UNSPECIFIED:
+ return 0;
+ case EnvironmentTier.PROTECTED:
+ return 1;
+ case EnvironmentTier.UNPROTECTED:
+ return 2;
+ case EnvironmentTier.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface GetEnvironmentRequest {
/**
* The name of the environment to retrieve.
@@ -632,7 +646,14 @@ export const UndeleteEnvironmentRequest = {
};
function createBaseEnvironment(): Environment {
- return { name: "", uid: "", state: 0, title: "", order: 0, tier: 0 };
+ return {
+ name: "",
+ uid: "",
+ state: State.STATE_UNSPECIFIED,
+ title: "",
+ order: 0,
+ tier: EnvironmentTier.ENVIRONMENT_TIER_UNSPECIFIED,
+ };
}
export const Environment = {
@@ -643,8 +664,8 @@ export const Environment = {
if (message.uid !== "") {
writer.uint32(18).string(message.uid);
}
- if (message.state !== 0) {
- writer.uint32(24).int32(message.state);
+ if (message.state !== State.STATE_UNSPECIFIED) {
+ writer.uint32(24).int32(stateToNumber(message.state));
}
if (message.title !== "") {
writer.uint32(34).string(message.title);
@@ -652,8 +673,8 @@ export const Environment = {
if (message.order !== 0) {
writer.uint32(40).int32(message.order);
}
- if (message.tier !== 0) {
- writer.uint32(48).int32(message.tier);
+ if (message.tier !== EnvironmentTier.ENVIRONMENT_TIER_UNSPECIFIED) {
+ writer.uint32(48).int32(environmentTierToNumber(message.tier));
}
return writer;
},
@@ -684,7 +705,7 @@ export const Environment = {
break;
}
- message.state = reader.int32() as any;
+ message.state = stateFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -705,7 +726,7 @@ export const Environment = {
break;
}
- message.tier = reader.int32() as any;
+ message.tier = environmentTierFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -720,10 +741,10 @@ export const Environment = {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
- state: isSet(object.state) ? stateFromJSON(object.state) : 0,
+ state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
title: isSet(object.title) ? globalThis.String(object.title) : "",
order: isSet(object.order) ? globalThis.Number(object.order) : 0,
- tier: isSet(object.tier) ? environmentTierFromJSON(object.tier) : 0,
+ tier: isSet(object.tier) ? environmentTierFromJSON(object.tier) : EnvironmentTier.ENVIRONMENT_TIER_UNSPECIFIED,
};
},
@@ -735,7 +756,7 @@ export const Environment = {
if (message.uid !== "") {
obj.uid = message.uid;
}
- if (message.state !== 0) {
+ if (message.state !== State.STATE_UNSPECIFIED) {
obj.state = stateToJSON(message.state);
}
if (message.title !== "") {
@@ -744,7 +765,7 @@ export const Environment = {
if (message.order !== 0) {
obj.order = Math.round(message.order);
}
- if (message.tier !== 0) {
+ if (message.tier !== EnvironmentTier.ENVIRONMENT_TIER_UNSPECIFIED) {
obj.tier = environmentTierToJSON(message.tier);
}
return obj;
@@ -757,10 +778,10 @@ export const Environment = {
const message = createBaseEnvironment();
message.name = object.name ?? "";
message.uid = object.uid ?? "";
- message.state = object.state ?? 0;
+ message.state = object.state ?? State.STATE_UNSPECIFIED;
message.title = object.title ?? "";
message.order = object.order ?? 0;
- message.tier = object.tier ?? 0;
+ message.tier = object.tier ?? EnvironmentTier.ENVIRONMENT_TIER_UNSPECIFIED;
return message;
},
};
diff --git a/frontend/src/types/proto/v1/idp_service.ts b/frontend/src/types/proto/v1/idp_service.ts
index fb88b5db02..e25848a55e 100644
--- a/frontend/src/types/proto/v1/idp_service.ts
+++ b/frontend/src/types/proto/v1/idp_service.ts
@@ -3,16 +3,16 @@ import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
-import { State, stateFromJSON, stateToJSON } from "./common";
+import { State, stateFromJSON, stateToJSON, stateToNumber } from "./common";
export const protobufPackage = "bytebase.v1";
export enum IdentityProviderType {
- IDENTITY_PROVIDER_TYPE_UNSPECIFIED = 0,
- OAUTH2 = 1,
- OIDC = 2,
- LDAP = 3,
- UNRECOGNIZED = -1,
+ IDENTITY_PROVIDER_TYPE_UNSPECIFIED = "IDENTITY_PROVIDER_TYPE_UNSPECIFIED",
+ OAUTH2 = "OAUTH2",
+ OIDC = "OIDC",
+ LDAP = "LDAP",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function identityProviderTypeFromJSON(object: any): IdentityProviderType {
@@ -52,19 +52,35 @@ export function identityProviderTypeToJSON(object: IdentityProviderType): string
}
}
+export function identityProviderTypeToNumber(object: IdentityProviderType): number {
+ switch (object) {
+ case IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED:
+ return 0;
+ case IdentityProviderType.OAUTH2:
+ return 1;
+ case IdentityProviderType.OIDC:
+ return 2;
+ case IdentityProviderType.LDAP:
+ return 3;
+ case IdentityProviderType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum OAuth2AuthStyle {
- OAUTH2_AUTH_STYLE_UNSPECIFIED = 0,
+ OAUTH2_AUTH_STYLE_UNSPECIFIED = "OAUTH2_AUTH_STYLE_UNSPECIFIED",
/**
* IN_PARAMS - IN_PARAMS sends the "client_id" and "client_secret" in the POST body
* as application/x-www-form-urlencoded parameters.
*/
- IN_PARAMS = 1,
+ IN_PARAMS = "IN_PARAMS",
/**
* IN_HEADER - IN_HEADER sends the client_id and client_password using HTTP Basic Authorization.
* This is an optional style described in the OAuth2 RFC 6749 section 2.3.1.
*/
- IN_HEADER = 2,
- UNRECOGNIZED = -1,
+ IN_HEADER = "IN_HEADER",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function oAuth2AuthStyleFromJSON(object: any): OAuth2AuthStyle {
@@ -99,6 +115,20 @@ export function oAuth2AuthStyleToJSON(object: OAuth2AuthStyle): string {
}
}
+export function oAuth2AuthStyleToNumber(object: OAuth2AuthStyle): number {
+ switch (object) {
+ case OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED:
+ return 0;
+ case OAuth2AuthStyle.IN_PARAMS:
+ return 1;
+ case OAuth2AuthStyle.IN_HEADER:
+ return 2;
+ case OAuth2AuthStyle.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface GetIdentityProviderRequest {
name: string;
}
@@ -966,7 +996,15 @@ export const TestIdentityProviderResponse = {
};
function createBaseIdentityProvider(): IdentityProvider {
- return { name: "", uid: "", state: 0, title: "", domain: "", type: 0, config: undefined };
+ return {
+ name: "",
+ uid: "",
+ state: State.STATE_UNSPECIFIED,
+ title: "",
+ domain: "",
+ type: IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED,
+ config: undefined,
+ };
}
export const IdentityProvider = {
@@ -977,8 +1015,8 @@ export const IdentityProvider = {
if (message.uid !== "") {
writer.uint32(18).string(message.uid);
}
- if (message.state !== 0) {
- writer.uint32(24).int32(message.state);
+ if (message.state !== State.STATE_UNSPECIFIED) {
+ writer.uint32(24).int32(stateToNumber(message.state));
}
if (message.title !== "") {
writer.uint32(34).string(message.title);
@@ -986,8 +1024,8 @@ export const IdentityProvider = {
if (message.domain !== "") {
writer.uint32(42).string(message.domain);
}
- if (message.type !== 0) {
- writer.uint32(48).int32(message.type);
+ if (message.type !== IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED) {
+ writer.uint32(48).int32(identityProviderTypeToNumber(message.type));
}
if (message.config !== undefined) {
IdentityProviderConfig.encode(message.config, writer.uint32(58).fork()).ldelim();
@@ -1021,7 +1059,7 @@ export const IdentityProvider = {
break;
}
- message.state = reader.int32() as any;
+ message.state = stateFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -1042,7 +1080,7 @@ export const IdentityProvider = {
break;
}
- message.type = reader.int32() as any;
+ message.type = identityProviderTypeFromJSON(reader.int32());
continue;
case 7:
if (tag !== 58) {
@@ -1064,10 +1102,12 @@ export const IdentityProvider = {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
- state: isSet(object.state) ? stateFromJSON(object.state) : 0,
+ state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
title: isSet(object.title) ? globalThis.String(object.title) : "",
domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
- type: isSet(object.type) ? identityProviderTypeFromJSON(object.type) : 0,
+ type: isSet(object.type)
+ ? identityProviderTypeFromJSON(object.type)
+ : IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED,
config: isSet(object.config) ? IdentityProviderConfig.fromJSON(object.config) : undefined,
};
},
@@ -1080,7 +1120,7 @@ export const IdentityProvider = {
if (message.uid !== "") {
obj.uid = message.uid;
}
- if (message.state !== 0) {
+ if (message.state !== State.STATE_UNSPECIFIED) {
obj.state = stateToJSON(message.state);
}
if (message.title !== "") {
@@ -1089,7 +1129,7 @@ export const IdentityProvider = {
if (message.domain !== "") {
obj.domain = message.domain;
}
- if (message.type !== 0) {
+ if (message.type !== IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED) {
obj.type = identityProviderTypeToJSON(message.type);
}
if (message.config !== undefined) {
@@ -1105,10 +1145,10 @@ export const IdentityProvider = {
const message = createBaseIdentityProvider();
message.name = object.name ?? "";
message.uid = object.uid ?? "";
- message.state = object.state ?? 0;
+ message.state = object.state ?? State.STATE_UNSPECIFIED;
message.title = object.title ?? "";
message.domain = object.domain ?? "";
- message.type = object.type ?? 0;
+ message.type = object.type ?? IdentityProviderType.IDENTITY_PROVIDER_TYPE_UNSPECIFIED;
message.config = (object.config !== undefined && object.config !== null)
? IdentityProviderConfig.fromPartial(object.config)
: undefined;
@@ -1221,7 +1261,7 @@ function createBaseOAuth2IdentityProviderConfig(): OAuth2IdentityProviderConfig
scopes: [],
fieldMapping: undefined,
skipTlsVerify: false,
- authStyle: 0,
+ authStyle: OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
};
}
@@ -1251,8 +1291,8 @@ export const OAuth2IdentityProviderConfig = {
if (message.skipTlsVerify === true) {
writer.uint32(64).bool(message.skipTlsVerify);
}
- if (message.authStyle !== 0) {
- writer.uint32(72).int32(message.authStyle);
+ if (message.authStyle !== OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED) {
+ writer.uint32(72).int32(oAuth2AuthStyleToNumber(message.authStyle));
}
return writer;
},
@@ -1325,7 +1365,7 @@ export const OAuth2IdentityProviderConfig = {
break;
}
- message.authStyle = reader.int32() as any;
+ message.authStyle = oAuth2AuthStyleFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -1346,7 +1386,9 @@ export const OAuth2IdentityProviderConfig = {
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) : 0,
+ authStyle: isSet(object.authStyle)
+ ? oAuth2AuthStyleFromJSON(object.authStyle)
+ : OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
};
},
@@ -1376,7 +1418,7 @@ export const OAuth2IdentityProviderConfig = {
if (message.skipTlsVerify === true) {
obj.skipTlsVerify = message.skipTlsVerify;
}
- if (message.authStyle !== 0) {
+ if (message.authStyle !== OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED) {
obj.authStyle = oAuth2AuthStyleToJSON(message.authStyle);
}
return obj;
@@ -1397,7 +1439,7 @@ export const OAuth2IdentityProviderConfig = {
? FieldMapping.fromPartial(object.fieldMapping)
: undefined;
message.skipTlsVerify = object.skipTlsVerify ?? false;
- message.authStyle = object.authStyle ?? 0;
+ message.authStyle = object.authStyle ?? OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED;
return message;
},
};
@@ -1410,7 +1452,7 @@ function createBaseOIDCIdentityProviderConfig(): OIDCIdentityProviderConfig {
scopes: [],
fieldMapping: undefined,
skipTlsVerify: false,
- authStyle: 0,
+ authStyle: OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
};
}
@@ -1434,8 +1476,8 @@ export const OIDCIdentityProviderConfig = {
if (message.skipTlsVerify === true) {
writer.uint32(48).bool(message.skipTlsVerify);
}
- if (message.authStyle !== 0) {
- writer.uint32(56).int32(message.authStyle);
+ if (message.authStyle !== OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED) {
+ writer.uint32(56).int32(oAuth2AuthStyleToNumber(message.authStyle));
}
return writer;
},
@@ -1494,7 +1536,7 @@ export const OIDCIdentityProviderConfig = {
break;
}
- message.authStyle = reader.int32() as any;
+ message.authStyle = oAuth2AuthStyleFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -1513,7 +1555,9 @@ export const OIDCIdentityProviderConfig = {
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) : 0,
+ authStyle: isSet(object.authStyle)
+ ? oAuth2AuthStyleFromJSON(object.authStyle)
+ : OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED,
};
},
@@ -1537,7 +1581,7 @@ export const OIDCIdentityProviderConfig = {
if (message.skipTlsVerify === true) {
obj.skipTlsVerify = message.skipTlsVerify;
}
- if (message.authStyle !== 0) {
+ if (message.authStyle !== OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED) {
obj.authStyle = oAuth2AuthStyleToJSON(message.authStyle);
}
return obj;
@@ -1556,7 +1600,7 @@ export const OIDCIdentityProviderConfig = {
? FieldMapping.fromPartial(object.fieldMapping)
: undefined;
message.skipTlsVerify = object.skipTlsVerify ?? false;
- message.authStyle = object.authStyle ?? 0;
+ message.authStyle = object.authStyle ?? OAuth2AuthStyle.OAUTH2_AUTH_STYLE_UNSPECIFIED;
return message;
},
};
diff --git a/frontend/src/types/proto/v1/instance_service.ts b/frontend/src/types/proto/v1/instance_service.ts
index a19951234a..c2deb5b1f1 100644
--- a/frontend/src/types/proto/v1/instance_service.ts
+++ b/frontend/src/types/proto/v1/instance_service.ts
@@ -4,15 +4,24 @@ import _m0 from "protobufjs/minimal";
import { Duration } from "../google/protobuf/duration";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
-import { Engine, engineFromJSON, engineToJSON, State, stateFromJSON, stateToJSON } from "./common";
+import {
+ Engine,
+ engineFromJSON,
+ engineToJSON,
+ engineToNumber,
+ State,
+ stateFromJSON,
+ stateToJSON,
+ stateToNumber,
+} from "./common";
export const protobufPackage = "bytebase.v1";
export enum DataSourceType {
- DATA_SOURCE_UNSPECIFIED = 0,
- ADMIN = 1,
- READ_ONLY = 2,
- UNRECOGNIZED = -1,
+ DATA_SOURCE_UNSPECIFIED = "DATA_SOURCE_UNSPECIFIED",
+ ADMIN = "ADMIN",
+ READ_ONLY = "READ_ONLY",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function dataSourceTypeFromJSON(object: any): DataSourceType {
@@ -47,6 +56,20 @@ export function dataSourceTypeToJSON(object: DataSourceType): string {
}
}
+export function dataSourceTypeToNumber(object: DataSourceType): number {
+ switch (object) {
+ case DataSourceType.DATA_SOURCE_UNSPECIFIED:
+ return 0;
+ case DataSourceType.ADMIN:
+ return 1;
+ case DataSourceType.READ_ONLY:
+ return 2;
+ case DataSourceType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface GetInstanceRequest {
/**
* The name of the instance to retrieve.
@@ -288,14 +311,14 @@ export interface DataSourceExternalSecret {
}
export enum DataSourceExternalSecret_SecretType {
- SAECRET_TYPE_UNSPECIFIED = 0,
+ SAECRET_TYPE_UNSPECIFIED = "SAECRET_TYPE_UNSPECIFIED",
/** VAULT_KV_V2 - ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2 */
- VAULT_KV_V2 = 1,
+ VAULT_KV_V2 = "VAULT_KV_V2",
/** AWS_SECRETS_MANAGER - ref: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html */
- AWS_SECRETS_MANAGER = 2,
+ AWS_SECRETS_MANAGER = "AWS_SECRETS_MANAGER",
/** GCP_SECRET_MANAGER - ref: https://cloud.google.com/secret-manager/docs */
- GCP_SECRET_MANAGER = 3,
- UNRECOGNIZED = -1,
+ GCP_SECRET_MANAGER = "GCP_SECRET_MANAGER",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function dataSourceExternalSecret_SecretTypeFromJSON(object: any): DataSourceExternalSecret_SecretType {
@@ -335,13 +358,29 @@ export function dataSourceExternalSecret_SecretTypeToJSON(object: DataSourceExte
}
}
+export function dataSourceExternalSecret_SecretTypeToNumber(object: DataSourceExternalSecret_SecretType): number {
+ switch (object) {
+ case DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED:
+ return 0;
+ case DataSourceExternalSecret_SecretType.VAULT_KV_V2:
+ return 1;
+ case DataSourceExternalSecret_SecretType.AWS_SECRETS_MANAGER:
+ return 2;
+ case DataSourceExternalSecret_SecretType.GCP_SECRET_MANAGER:
+ return 3;
+ case DataSourceExternalSecret_SecretType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum DataSourceExternalSecret_AuthType {
- AUTH_TYPE_UNSPECIFIED = 0,
+ AUTH_TYPE_UNSPECIFIED = "AUTH_TYPE_UNSPECIFIED",
/** TOKEN - ref: https://developer.hashicorp.com/vault/docs/auth/token */
- TOKEN = 1,
+ TOKEN = "TOKEN",
/** VAULT_APP_ROLE - ref: https://developer.hashicorp.com/vault/docs/auth/approle */
- VAULT_APP_ROLE = 2,
- UNRECOGNIZED = -1,
+ VAULT_APP_ROLE = "VAULT_APP_ROLE",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function dataSourceExternalSecret_AuthTypeFromJSON(object: any): DataSourceExternalSecret_AuthType {
@@ -376,6 +415,20 @@ export function dataSourceExternalSecret_AuthTypeToJSON(object: DataSourceExtern
}
}
+export function dataSourceExternalSecret_AuthTypeToNumber(object: DataSourceExternalSecret_AuthType): number {
+ switch (object) {
+ case DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED:
+ return 0;
+ case DataSourceExternalSecret_AuthType.TOKEN:
+ return 1;
+ case DataSourceExternalSecret_AuthType.VAULT_APP_ROLE:
+ return 2;
+ case DataSourceExternalSecret_AuthType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface DataSourceExternalSecret_AppRoleAuthOption {
roleId: string;
/** the secret id for the role without ttl. */
@@ -386,10 +439,10 @@ export interface DataSourceExternalSecret_AppRoleAuthOption {
}
export enum DataSourceExternalSecret_AppRoleAuthOption_SecretType {
- SECRET_TYPE_UNSPECIFIED = 0,
- PLAIN = 1,
- ENVIRONMENT = 2,
- UNRECOGNIZED = -1,
+ SECRET_TYPE_UNSPECIFIED = "SECRET_TYPE_UNSPECIFIED",
+ PLAIN = "PLAIN",
+ ENVIRONMENT = "ENVIRONMENT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(
@@ -428,6 +481,22 @@ export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToJSON(
}
}
+export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToNumber(
+ object: DataSourceExternalSecret_AppRoleAuthOption_SecretType,
+): number {
+ switch (object) {
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED:
+ return 0;
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN:
+ return 1;
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.ENVIRONMENT:
+ return 2;
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface DataSource {
id: string;
type: DataSourceType;
@@ -476,11 +545,11 @@ export interface DataSource {
}
export enum DataSource_AuthenticationType {
- AUTHENTICATION_UNSPECIFIED = 0,
- PASSWORD = 1,
- GOOGLE_CLOUD_SQL_IAM = 2,
- AWS_RDS_IAM = 3,
- UNRECOGNIZED = -1,
+ AUTHENTICATION_UNSPECIFIED = "AUTHENTICATION_UNSPECIFIED",
+ PASSWORD = "PASSWORD",
+ GOOGLE_CLOUD_SQL_IAM = "GOOGLE_CLOUD_SQL_IAM",
+ AWS_RDS_IAM = "AWS_RDS_IAM",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function dataSource_AuthenticationTypeFromJSON(object: any): DataSource_AuthenticationType {
@@ -520,6 +589,22 @@ export function dataSource_AuthenticationTypeToJSON(object: DataSource_Authentic
}
}
+export function dataSource_AuthenticationTypeToNumber(object: DataSource_AuthenticationType): number {
+ switch (object) {
+ case DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED:
+ return 0;
+ case DataSource_AuthenticationType.PASSWORD:
+ return 1;
+ case DataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM:
+ return 2;
+ case DataSource_AuthenticationType.AWS_RDS_IAM:
+ return 3;
+ case DataSource_AuthenticationType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface InstanceResource {
title: string;
engine: Engine;
@@ -1831,9 +1916,9 @@ function createBaseInstance(): Instance {
return {
name: "",
uid: "",
- state: 0,
+ state: State.STATE_UNSPECIFIED,
title: "",
- engine: 0,
+ engine: Engine.ENGINE_UNSPECIFIED,
engineVersion: "",
externalLink: "",
dataSources: [],
@@ -1851,14 +1936,14 @@ export const Instance = {
if (message.uid !== "") {
writer.uint32(18).string(message.uid);
}
- if (message.state !== 0) {
- writer.uint32(24).int32(message.state);
+ if (message.state !== State.STATE_UNSPECIFIED) {
+ writer.uint32(24).int32(stateToNumber(message.state));
}
if (message.title !== "") {
writer.uint32(34).string(message.title);
}
- if (message.engine !== 0) {
- writer.uint32(40).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(40).int32(engineToNumber(message.engine));
}
if (message.engineVersion !== "") {
writer.uint32(50).string(message.engineVersion);
@@ -1907,7 +1992,7 @@ export const Instance = {
break;
}
- message.state = reader.int32() as any;
+ message.state = stateFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -1921,7 +2006,7 @@ export const Instance = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
case 6:
if (tag !== 50) {
@@ -1978,9 +2063,9 @@ export const Instance = {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
- state: isSet(object.state) ? stateFromJSON(object.state) : 0,
+ 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) : 0,
+ 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)
@@ -2000,13 +2085,13 @@ export const Instance = {
if (message.uid !== "") {
obj.uid = message.uid;
}
- if (message.state !== 0) {
+ if (message.state !== State.STATE_UNSPECIFIED) {
obj.state = stateToJSON(message.state);
}
if (message.title !== "") {
obj.title = message.title;
}
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
if (message.engineVersion !== "") {
@@ -2037,9 +2122,9 @@ export const Instance = {
const message = createBaseInstance();
message.name = object.name ?? "";
message.uid = object.uid ?? "";
- message.state = object.state ?? 0;
+ message.state = object.state ?? State.STATE_UNSPECIFIED;
message.title = object.title ?? "";
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
message.engineVersion = object.engineVersion ?? "";
message.externalLink = object.externalLink ?? "";
message.dataSources = object.dataSources?.map((e) => DataSource.fromPartial(e)) || [];
@@ -2054,9 +2139,9 @@ export const Instance = {
function createBaseDataSourceExternalSecret(): DataSourceExternalSecret {
return {
- secretType: 0,
+ secretType: DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED,
url: "",
- authType: 0,
+ authType: DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED,
appRole: undefined,
token: undefined,
engineName: "",
@@ -2067,14 +2152,14 @@ function createBaseDataSourceExternalSecret(): DataSourceExternalSecret {
export const DataSourceExternalSecret = {
encode(message: DataSourceExternalSecret, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.secretType !== 0) {
- writer.uint32(8).int32(message.secretType);
+ if (message.secretType !== DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED) {
+ writer.uint32(8).int32(dataSourceExternalSecret_SecretTypeToNumber(message.secretType));
}
if (message.url !== "") {
writer.uint32(18).string(message.url);
}
- if (message.authType !== 0) {
- writer.uint32(24).int32(message.authType);
+ if (message.authType !== DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED) {
+ writer.uint32(24).int32(dataSourceExternalSecret_AuthTypeToNumber(message.authType));
}
if (message.appRole !== undefined) {
DataSourceExternalSecret_AppRoleAuthOption.encode(message.appRole, writer.uint32(34).fork()).ldelim();
@@ -2106,7 +2191,7 @@ export const DataSourceExternalSecret = {
break;
}
- message.secretType = reader.int32() as any;
+ message.secretType = dataSourceExternalSecret_SecretTypeFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -2120,7 +2205,7 @@ export const DataSourceExternalSecret = {
break;
}
- message.authType = reader.int32() as any;
+ message.authType = dataSourceExternalSecret_AuthTypeFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -2168,9 +2253,13 @@ export const DataSourceExternalSecret = {
fromJSON(object: any): DataSourceExternalSecret {
return {
- secretType: isSet(object.secretType) ? dataSourceExternalSecret_SecretTypeFromJSON(object.secretType) : 0,
+ 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) : 0,
+ 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) : "",
@@ -2181,13 +2270,13 @@ export const DataSourceExternalSecret = {
toJSON(message: DataSourceExternalSecret): unknown {
const obj: any = {};
- if (message.secretType !== 0) {
+ if (message.secretType !== DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED) {
obj.secretType = dataSourceExternalSecret_SecretTypeToJSON(message.secretType);
}
if (message.url !== "") {
obj.url = message.url;
}
- if (message.authType !== 0) {
+ if (message.authType !== DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED) {
obj.authType = dataSourceExternalSecret_AuthTypeToJSON(message.authType);
}
if (message.appRole !== undefined) {
@@ -2213,9 +2302,9 @@ export const DataSourceExternalSecret = {
},
fromPartial(object: DeepPartial<DataSourceExternalSecret>): DataSourceExternalSecret {
const message = createBaseDataSourceExternalSecret();
- message.secretType = object.secretType ?? 0;
+ message.secretType = object.secretType ?? DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED;
message.url = object.url ?? "";
- message.authType = object.authType ?? 0;
+ message.authType = object.authType ?? DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED;
message.appRole = (object.appRole !== undefined && object.appRole !== null)
? DataSourceExternalSecret_AppRoleAuthOption.fromPartial(object.appRole)
: undefined;
@@ -2228,7 +2317,12 @@ export const DataSourceExternalSecret = {
};
function createBaseDataSourceExternalSecret_AppRoleAuthOption(): DataSourceExternalSecret_AppRoleAuthOption {
- return { roleId: "", secretId: "", type: 0, mountPath: "" };
+ return {
+ roleId: "",
+ secretId: "",
+ type: DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED,
+ mountPath: "",
+ };
}
export const DataSourceExternalSecret_AppRoleAuthOption = {
@@ -2239,8 +2333,8 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
if (message.secretId !== "") {
writer.uint32(18).string(message.secretId);
}
- if (message.type !== 0) {
- writer.uint32(24).int32(message.type);
+ if (message.type !== DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED) {
+ writer.uint32(24).int32(dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToNumber(message.type));
}
if (message.mountPath !== "") {
writer.uint32(34).string(message.mountPath);
@@ -2274,7 +2368,7 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
break;
}
- message.type = reader.int32() as any;
+ message.type = dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -2296,7 +2390,9 @@ export const 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) : 0,
+ type: isSet(object.type)
+ ? dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(object.type)
+ : DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED,
mountPath: isSet(object.mountPath) ? globalThis.String(object.mountPath) : "",
};
},
@@ -2309,7 +2405,7 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
if (message.secretId !== "") {
obj.secretId = message.secretId;
}
- if (message.type !== 0) {
+ if (message.type !== DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED) {
obj.type = dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToJSON(message.type);
}
if (message.mountPath !== "") {
@@ -2327,7 +2423,7 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
const message = createBaseDataSourceExternalSecret_AppRoleAuthOption();
message.roleId = object.roleId ?? "";
message.secretId = object.secretId ?? "";
- message.type = object.type ?? 0;
+ message.type = object.type ?? DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED;
message.mountPath = object.mountPath ?? "";
return message;
},
@@ -2336,7 +2432,7 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
function createBaseDataSource(): DataSource {
return {
id: "",
- type: 0,
+ type: DataSourceType.DATA_SOURCE_UNSPECIFIED,
username: "",
password: "",
sslCa: "",
@@ -2356,7 +2452,7 @@ function createBaseDataSource(): DataSource {
sshPrivateKey: "",
authenticationPrivateKey: "",
externalSecret: undefined,
- authenticationType: 0,
+ authenticationType: DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED,
saslConfig: undefined,
};
}
@@ -2366,8 +2462,8 @@ export const DataSource = {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
- if (message.type !== 0) {
- writer.uint32(16).int32(message.type);
+ if (message.type !== DataSourceType.DATA_SOURCE_UNSPECIFIED) {
+ writer.uint32(16).int32(dataSourceTypeToNumber(message.type));
}
if (message.username !== "") {
writer.uint32(26).string(message.username);
@@ -2426,8 +2522,8 @@ export const DataSource = {
if (message.externalSecret !== undefined) {
DataSourceExternalSecret.encode(message.externalSecret, writer.uint32(170).fork()).ldelim();
}
- if (message.authenticationType !== 0) {
- writer.uint32(176).int32(message.authenticationType);
+ if (message.authenticationType !== DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED) {
+ writer.uint32(176).int32(dataSource_AuthenticationTypeToNumber(message.authenticationType));
}
if (message.saslConfig !== undefined) {
SASLConfig.encode(message.saslConfig, writer.uint32(186).fork()).ldelim();
@@ -2454,7 +2550,7 @@ export const DataSource = {
break;
}
- message.type = reader.int32() as any;
+ message.type = dataSourceTypeFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -2594,7 +2690,7 @@ export const DataSource = {
break;
}
- message.authenticationType = reader.int32() as any;
+ message.authenticationType = dataSource_AuthenticationTypeFromJSON(reader.int32());
continue;
case 23:
if (tag !== 186) {
@@ -2615,7 +2711,7 @@ export const DataSource = {
fromJSON(object: any): DataSource {
return {
id: isSet(object.id) ? globalThis.String(object.id) : "",
- type: isSet(object.type) ? dataSourceTypeFromJSON(object.type) : 0,
+ 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) : "",
sslCa: isSet(object.sslCa) ? globalThis.String(object.sslCa) : "",
@@ -2643,7 +2739,7 @@ export const DataSource = {
: undefined,
authenticationType: isSet(object.authenticationType)
? dataSource_AuthenticationTypeFromJSON(object.authenticationType)
- : 0,
+ : DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED,
saslConfig: isSet(object.saslConfig) ? SASLConfig.fromJSON(object.saslConfig) : undefined,
};
},
@@ -2653,7 +2749,7 @@ export const DataSource = {
if (message.id !== "") {
obj.id = message.id;
}
- if (message.type !== 0) {
+ if (message.type !== DataSourceType.DATA_SOURCE_UNSPECIFIED) {
obj.type = dataSourceTypeToJSON(message.type);
}
if (message.username !== "") {
@@ -2713,7 +2809,7 @@ export const DataSource = {
if (message.externalSecret !== undefined) {
obj.externalSecret = DataSourceExternalSecret.toJSON(message.externalSecret);
}
- if (message.authenticationType !== 0) {
+ if (message.authenticationType !== DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED) {
obj.authenticationType = dataSource_AuthenticationTypeToJSON(message.authenticationType);
}
if (message.saslConfig !== undefined) {
@@ -2728,7 +2824,7 @@ export const DataSource = {
fromPartial(object: DeepPartial<DataSource>): DataSource {
const message = createBaseDataSource();
message.id = object.id ?? "";
- message.type = object.type ?? 0;
+ message.type = object.type ?? DataSourceType.DATA_SOURCE_UNSPECIFIED;
message.username = object.username ?? "";
message.password = object.password ?? "";
message.sslCa = object.sslCa ?? "";
@@ -2750,7 +2846,7 @@ export const DataSource = {
message.externalSecret = (object.externalSecret !== undefined && object.externalSecret !== null)
? DataSourceExternalSecret.fromPartial(object.externalSecret)
: undefined;
- message.authenticationType = object.authenticationType ?? 0;
+ message.authenticationType = object.authenticationType ?? DataSource_AuthenticationType.AUTHENTICATION_UNSPECIFIED;
message.saslConfig = (object.saslConfig !== undefined && object.saslConfig !== null)
? SASLConfig.fromPartial(object.saslConfig)
: undefined;
@@ -2759,7 +2855,7 @@ export const DataSource = {
};
function createBaseInstanceResource(): InstanceResource {
- return { title: "", engine: 0, engineVersion: "", dataSources: [], activation: false };
+ return { title: "", engine: Engine.ENGINE_UNSPECIFIED, engineVersion: "", dataSources: [], activation: false };
}
export const InstanceResource = {
@@ -2767,8 +2863,8 @@ export const InstanceResource = {
if (message.title !== "") {
writer.uint32(10).string(message.title);
}
- if (message.engine !== 0) {
- writer.uint32(16).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(16).int32(engineToNumber(message.engine));
}
if (message.engineVersion !== "") {
writer.uint32(26).string(message.engineVersion);
@@ -2801,7 +2897,7 @@ export const InstanceResource = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -2836,7 +2932,7 @@ export const InstanceResource = {
fromJSON(object: any): InstanceResource {
return {
title: isSet(object.title) ? globalThis.String(object.title) : "",
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ 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))
@@ -2850,7 +2946,7 @@ export const InstanceResource = {
if (message.title !== "") {
obj.title = message.title;
}
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
if (message.engineVersion !== "") {
@@ -2871,7 +2967,7 @@ export const InstanceResource = {
fromPartial(object: DeepPartial<InstanceResource>): InstanceResource {
const message = createBaseInstanceResource();
message.title = object.title ?? "";
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
message.engineVersion = object.engineVersion ?? "";
message.dataSources = object.dataSources?.map((e) => DataSource.fromPartial(e)) || [];
message.activation = object.activation ?? false;
diff --git a/frontend/src/types/proto/v1/issue_service.ts b/frontend/src/types/proto/v1/issue_service.ts
index a47ad9dfcc..eae02ebad0 100644
--- a/frontend/src/types/proto/v1/issue_service.ts
+++ b/frontend/src/types/proto/v1/issue_service.ts
@@ -9,11 +9,11 @@ import { Expr } from "../google/type/expr";
export const protobufPackage = "bytebase.v1";
export enum IssueStatus {
- ISSUE_STATUS_UNSPECIFIED = 0,
- OPEN = 1,
- DONE = 2,
- CANCELED = 3,
- UNRECOGNIZED = -1,
+ ISSUE_STATUS_UNSPECIFIED = "ISSUE_STATUS_UNSPECIFIED",
+ OPEN = "OPEN",
+ DONE = "DONE",
+ CANCELED = "CANCELED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function issueStatusFromJSON(object: any): IssueStatus {
@@ -53,6 +53,22 @@ export function issueStatusToJSON(object: IssueStatus): string {
}
}
+export function issueStatusToNumber(object: IssueStatus): number {
+ switch (object) {
+ case IssueStatus.ISSUE_STATUS_UNSPECIFIED:
+ return 0;
+ case IssueStatus.OPEN:
+ return 1;
+ case IssueStatus.DONE:
+ return 2;
+ case IssueStatus.CANCELED:
+ return 3;
+ case IssueStatus.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface GetIssueRequest {
/**
* The name of the issue to retrieve.
@@ -288,11 +304,11 @@ export interface Issue {
}
export enum Issue_Type {
- TYPE_UNSPECIFIED = 0,
- DATABASE_CHANGE = 1,
- GRANT_REQUEST = 2,
- DATABASE_DATA_EXPORT = 3,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ DATABASE_CHANGE = "DATABASE_CHANGE",
+ GRANT_REQUEST = "GRANT_REQUEST",
+ DATABASE_DATA_EXPORT = "DATABASE_DATA_EXPORT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function issue_TypeFromJSON(object: any): Issue_Type {
@@ -332,12 +348,28 @@ export function issue_TypeToJSON(object: Issue_Type): string {
}
}
+export function issue_TypeToNumber(object: Issue_Type): number {
+ switch (object) {
+ case Issue_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case Issue_Type.DATABASE_CHANGE:
+ return 1;
+ case Issue_Type.GRANT_REQUEST:
+ return 2;
+ case Issue_Type.DATABASE_DATA_EXPORT:
+ return 3;
+ case Issue_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum Issue_RiskLevel {
- RISK_LEVEL_UNSPECIFIED = 0,
- LOW = 1,
- MODERATE = 2,
- HIGH = 3,
- UNRECOGNIZED = -1,
+ RISK_LEVEL_UNSPECIFIED = "RISK_LEVEL_UNSPECIFIED",
+ LOW = "LOW",
+ MODERATE = "MODERATE",
+ HIGH = "HIGH",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function issue_RiskLevelFromJSON(object: any): Issue_RiskLevel {
@@ -377,6 +409,22 @@ export function issue_RiskLevelToJSON(object: Issue_RiskLevel): string {
}
}
+export function issue_RiskLevelToNumber(object: Issue_RiskLevel): number {
+ switch (object) {
+ case Issue_RiskLevel.RISK_LEVEL_UNSPECIFIED:
+ return 0;
+ case Issue_RiskLevel.LOW:
+ return 1;
+ case Issue_RiskLevel.MODERATE:
+ return 2;
+ case Issue_RiskLevel.HIGH:
+ return 3;
+ case Issue_RiskLevel.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface Issue_Approver {
/** The new status. */
status: Issue_Approver_Status;
@@ -385,11 +433,11 @@ export interface Issue_Approver {
}
export enum Issue_Approver_Status {
- STATUS_UNSPECIFIED = 0,
- PENDING = 1,
- APPROVED = 2,
- REJECTED = 3,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ PENDING = "PENDING",
+ APPROVED = "APPROVED",
+ REJECTED = "REJECTED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function issue_Approver_StatusFromJSON(object: any): Issue_Approver_Status {
@@ -429,6 +477,22 @@ export function issue_Approver_StatusToJSON(object: Issue_Approver_Status): stri
}
}
+export function issue_Approver_StatusToNumber(object: Issue_Approver_Status): number {
+ switch (object) {
+ case Issue_Approver_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case Issue_Approver_Status.PENDING:
+ return 1;
+ case Issue_Approver_Status.APPROVED:
+ return 2;
+ case Issue_Approver_Status.REJECTED:
+ return 3;
+ case Issue_Approver_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface Issue_TaskStatusCountEntry {
key: string;
value: number;
@@ -475,10 +539,10 @@ export interface ApprovalStep {
* ANY means approving any node will proceed.
*/
export enum ApprovalStep_Type {
- TYPE_UNSPECIFIED = 0,
- ALL = 1,
- ANY = 2,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ ALL = "ALL",
+ ANY = "ANY",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function approvalStep_TypeFromJSON(object: any): ApprovalStep_Type {
@@ -513,6 +577,20 @@ export function approvalStep_TypeToJSON(object: ApprovalStep_Type): string {
}
}
+export function approvalStep_TypeToNumber(object: ApprovalStep_Type): number {
+ switch (object) {
+ case ApprovalStep_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case ApprovalStep_Type.ALL:
+ return 1;
+ case ApprovalStep_Type.ANY:
+ return 2;
+ case ApprovalStep_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface ApprovalNode {
type: ApprovalNode_Type;
groupValue?:
@@ -530,9 +608,9 @@ export interface ApprovalNode {
* See GroupValue below for the predefined user groups.
*/
export enum ApprovalNode_Type {
- TYPE_UNSPECIFIED = 0,
- ANY_IN_GROUP = 1,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ ANY_IN_GROUP = "ANY_IN_GROUP",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function approvalNode_TypeFromJSON(object: any): ApprovalNode_Type {
@@ -562,6 +640,18 @@ export function approvalNode_TypeToJSON(object: ApprovalNode_Type): string {
}
}
+export function approvalNode_TypeToNumber(object: ApprovalNode_Type): number {
+ switch (object) {
+ case ApprovalNode_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case ApprovalNode_Type.ANY_IN_GROUP:
+ return 1;
+ case ApprovalNode_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/**
* The predefined user groups are:
* - WORKSPACE_OWNER
@@ -570,12 +660,12 @@ export function approvalNode_TypeToJSON(object: ApprovalNode_Type): string {
* - PROJECT_MEMBER
*/
export enum ApprovalNode_GroupValue {
- GROUP_VALUE_UNSPECIFILED = 0,
- WORKSPACE_OWNER = 1,
- WORKSPACE_DBA = 2,
- PROJECT_OWNER = 3,
- PROJECT_MEMBER = 4,
- UNRECOGNIZED = -1,
+ GROUP_VALUE_UNSPECIFILED = "GROUP_VALUE_UNSPECIFILED",
+ WORKSPACE_OWNER = "WORKSPACE_OWNER",
+ WORKSPACE_DBA = "WORKSPACE_DBA",
+ PROJECT_OWNER = "PROJECT_OWNER",
+ PROJECT_MEMBER = "PROJECT_MEMBER",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function approvalNode_GroupValueFromJSON(object: any): ApprovalNode_GroupValue {
@@ -620,6 +710,24 @@ export function approvalNode_GroupValueToJSON(object: ApprovalNode_GroupValue):
}
}
+export function approvalNode_GroupValueToNumber(object: ApprovalNode_GroupValue): number {
+ switch (object) {
+ case ApprovalNode_GroupValue.GROUP_VALUE_UNSPECIFILED:
+ return 0;
+ case ApprovalNode_GroupValue.WORKSPACE_OWNER:
+ return 1;
+ case ApprovalNode_GroupValue.WORKSPACE_DBA:
+ return 2;
+ case ApprovalNode_GroupValue.PROJECT_OWNER:
+ return 3;
+ case ApprovalNode_GroupValue.PROJECT_MEMBER:
+ return 4;
+ case ApprovalNode_GroupValue.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface ListIssueCommentsRequest {
/** Format: projects/{projects}/issues/{issue} */
parent: string;
@@ -696,11 +804,11 @@ export interface IssueComment_Approval {
}
export enum IssueComment_Approval_Status {
- STATUS_UNSPECIFIED = 0,
- PENDING = 1,
- APPROVED = 2,
- REJECTED = 3,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ PENDING = "PENDING",
+ APPROVED = "APPROVED",
+ REJECTED = "REJECTED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function issueComment_Approval_StatusFromJSON(object: any): IssueComment_Approval_Status {
@@ -740,6 +848,22 @@ export function issueComment_Approval_StatusToJSON(object: IssueComment_Approval
}
}
+export function issueComment_Approval_StatusToNumber(object: IssueComment_Approval_Status): number {
+ switch (object) {
+ case IssueComment_Approval_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case IssueComment_Approval_Status.PENDING:
+ return 1;
+ case IssueComment_Approval_Status.APPROVED:
+ return 2;
+ case IssueComment_Approval_Status.REJECTED:
+ return 3;
+ case IssueComment_Approval_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface IssueComment_IssueUpdate {
fromTitle?: string | undefined;
toTitle?: string | undefined;
@@ -775,14 +899,14 @@ export interface IssueComment_TaskUpdate {
}
export enum IssueComment_TaskUpdate_Status {
- STATUS_UNSPECIFIED = 0,
- PENDING = 1,
- RUNNING = 2,
- DONE = 3,
- FAILED = 4,
- SKIPPED = 5,
- CANCELED = 6,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ PENDING = "PENDING",
+ RUNNING = "RUNNING",
+ DONE = "DONE",
+ FAILED = "FAILED",
+ SKIPPED = "SKIPPED",
+ CANCELED = "CANCELED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function issueComment_TaskUpdate_StatusFromJSON(object: any): IssueComment_TaskUpdate_Status {
@@ -837,6 +961,28 @@ export function issueComment_TaskUpdate_StatusToJSON(object: IssueComment_TaskUp
}
}
+export function issueComment_TaskUpdate_StatusToNumber(object: IssueComment_TaskUpdate_Status): number {
+ switch (object) {
+ case IssueComment_TaskUpdate_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case IssueComment_TaskUpdate_Status.PENDING:
+ return 1;
+ case IssueComment_TaskUpdate_Status.RUNNING:
+ return 2;
+ case IssueComment_TaskUpdate_Status.DONE:
+ return 3;
+ case IssueComment_TaskUpdate_Status.FAILED:
+ return 4;
+ case IssueComment_TaskUpdate_Status.SKIPPED:
+ return 5;
+ case IssueComment_TaskUpdate_Status.CANCELED:
+ return 6;
+ case IssueComment_TaskUpdate_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface IssueComment_TaskPriorBackup {
task: string;
tables: IssueComment_TaskPriorBackup_Table[];
@@ -1458,7 +1604,7 @@ export const UpdateIssueRequest = {
};
function createBaseBatchUpdateIssuesStatusRequest(): BatchUpdateIssuesStatusRequest {
- return { parent: "", issues: [], status: 0, reason: "" };
+ return { parent: "", issues: [], status: IssueStatus.ISSUE_STATUS_UNSPECIFIED, reason: "" };
}
export const BatchUpdateIssuesStatusRequest = {
@@ -1469,8 +1615,8 @@ export const BatchUpdateIssuesStatusRequest = {
for (const v of message.issues) {
writer.uint32(18).string(v!);
}
- if (message.status !== 0) {
- writer.uint32(24).int32(message.status);
+ if (message.status !== IssueStatus.ISSUE_STATUS_UNSPECIFIED) {
+ writer.uint32(24).int32(issueStatusToNumber(message.status));
}
if (message.reason !== "") {
writer.uint32(34).string(message.reason);
@@ -1504,7 +1650,7 @@ export const BatchUpdateIssuesStatusRequest = {
break;
}
- message.status = reader.int32() as any;
+ message.status = issueStatusFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -1526,7 +1672,7 @@ export const 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) : 0,
+ status: isSet(object.status) ? issueStatusFromJSON(object.status) : IssueStatus.ISSUE_STATUS_UNSPECIFIED,
reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
};
},
@@ -1539,7 +1685,7 @@ export const BatchUpdateIssuesStatusRequest = {
if (message.issues?.length) {
obj.issues = message.issues;
}
- if (message.status !== 0) {
+ if (message.status !== IssueStatus.ISSUE_STATUS_UNSPECIFIED) {
obj.status = issueStatusToJSON(message.status);
}
if (message.reason !== "") {
@@ -1555,7 +1701,7 @@ export const BatchUpdateIssuesStatusRequest = {
const message = createBaseBatchUpdateIssuesStatusRequest();
message.parent = object.parent ?? "";
message.issues = object.issues?.map((e) => e) || [];
- message.status = object.status ?? 0;
+ message.status = object.status ?? IssueStatus.ISSUE_STATUS_UNSPECIFIED;
message.reason = object.reason ?? "";
return message;
},
@@ -1832,8 +1978,8 @@ function createBaseIssue(): Issue {
uid: "",
title: "",
description: "",
- type: 0,
- status: 0,
+ type: Issue_Type.TYPE_UNSPECIFIED,
+ status: IssueStatus.ISSUE_STATUS_UNSPECIFIED,
assignee: "",
assigneeAttention: false,
approvers: [],
@@ -1848,7 +1994,7 @@ function createBaseIssue(): Issue {
rollout: "",
grantRequest: undefined,
releasers: [],
- riskLevel: 0,
+ riskLevel: Issue_RiskLevel.RISK_LEVEL_UNSPECIFIED,
taskStatusCount: {},
};
}
@@ -1867,11 +2013,11 @@ export const Issue = {
if (message.description !== "") {
writer.uint32(34).string(message.description);
}
- if (message.type !== 0) {
- writer.uint32(40).int32(message.type);
+ if (message.type !== Issue_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(40).int32(issue_TypeToNumber(message.type));
}
- if (message.status !== 0) {
- writer.uint32(48).int32(message.status);
+ if (message.status !== IssueStatus.ISSUE_STATUS_UNSPECIFIED) {
+ writer.uint32(48).int32(issueStatusToNumber(message.status));
}
if (message.assignee !== "") {
writer.uint32(58).string(message.assignee);
@@ -1915,8 +2061,8 @@ export const Issue = {
for (const v of message.releasers) {
writer.uint32(162).string(v!);
}
- if (message.riskLevel !== 0) {
- writer.uint32(168).int32(message.riskLevel);
+ if (message.riskLevel !== Issue_RiskLevel.RISK_LEVEL_UNSPECIFIED) {
+ writer.uint32(168).int32(issue_RiskLevelToNumber(message.riskLevel));
}
Object.entries(message.taskStatusCount).forEach(([key, value]) => {
Issue_TaskStatusCountEntry.encode({ key: key as any, value }, writer.uint32(178).fork()).ldelim();
@@ -1964,14 +2110,14 @@ export const Issue = {
break;
}
- message.type = reader.int32() as any;
+ message.type = issue_TypeFromJSON(reader.int32());
continue;
case 6:
if (tag !== 48) {
break;
}
- message.status = reader.int32() as any;
+ message.status = issueStatusFromJSON(reader.int32());
continue;
case 7:
if (tag !== 58) {
@@ -2076,7 +2222,7 @@ export const Issue = {
break;
}
- message.riskLevel = reader.int32() as any;
+ message.riskLevel = issue_RiskLevelFromJSON(reader.int32());
continue;
case 22:
if (tag !== 178) {
@@ -2103,8 +2249,8 @@ export const Issue = {
uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
title: isSet(object.title) ? globalThis.String(object.title) : "",
description: isSet(object.description) ? globalThis.String(object.description) : "",
- type: isSet(object.type) ? issue_TypeFromJSON(object.type) : 0,
- status: isSet(object.status) ? issueStatusFromJSON(object.status) : 0,
+ type: isSet(object.type) ? issue_TypeFromJSON(object.type) : Issue_Type.TYPE_UNSPECIFIED,
+ status: isSet(object.status) ? issueStatusFromJSON(object.status) : IssueStatus.ISSUE_STATUS_UNSPECIFIED,
assignee: isSet(object.assignee) ? globalThis.String(object.assignee) : "",
assigneeAttention: isSet(object.assigneeAttention) ? globalThis.Boolean(object.assigneeAttention) : false,
approvers: globalThis.Array.isArray(object?.approvers)
@@ -2127,7 +2273,9 @@ export const Issue = {
releasers: globalThis.Array.isArray(object?.releasers)
? object.releasers.map((e: any) => globalThis.String(e))
: [],
- riskLevel: isSet(object.riskLevel) ? issue_RiskLevelFromJSON(object.riskLevel) : 0,
+ 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);
@@ -2151,10 +2299,10 @@ export const Issue = {
if (message.description !== "") {
obj.description = message.description;
}
- if (message.type !== 0) {
+ if (message.type !== Issue_Type.TYPE_UNSPECIFIED) {
obj.type = issue_TypeToJSON(message.type);
}
- if (message.status !== 0) {
+ if (message.status !== IssueStatus.ISSUE_STATUS_UNSPECIFIED) {
obj.status = issueStatusToJSON(message.status);
}
if (message.assignee !== "") {
@@ -2199,7 +2347,7 @@ export const Issue = {
if (message.releasers?.length) {
obj.releasers = message.releasers;
}
- if (message.riskLevel !== 0) {
+ if (message.riskLevel !== Issue_RiskLevel.RISK_LEVEL_UNSPECIFIED) {
obj.riskLevel = issue_RiskLevelToJSON(message.riskLevel);
}
if (message.taskStatusCount) {
@@ -2223,8 +2371,8 @@ export const Issue = {
message.uid = object.uid ?? "";
message.title = object.title ?? "";
message.description = object.description ?? "";
- message.type = object.type ?? 0;
- message.status = object.status ?? 0;
+ message.type = object.type ?? Issue_Type.TYPE_UNSPECIFIED;
+ message.status = object.status ?? IssueStatus.ISSUE_STATUS_UNSPECIFIED;
message.assignee = object.assignee ?? "";
message.assigneeAttention = object.assigneeAttention ?? false;
message.approvers = object.approvers?.map((e) => Issue_Approver.fromPartial(e)) || [];
@@ -2241,7 +2389,7 @@ export const Issue = {
? GrantRequest.fromPartial(object.grantRequest)
: undefined;
message.releasers = object.releasers?.map((e) => e) || [];
- message.riskLevel = object.riskLevel ?? 0;
+ message.riskLevel = object.riskLevel ?? Issue_RiskLevel.RISK_LEVEL_UNSPECIFIED;
message.taskStatusCount = Object.entries(object.taskStatusCount ?? {}).reduce<{ [key: string]: number }>(
(acc, [key, value]) => {
if (value !== undefined) {
@@ -2256,13 +2404,13 @@ export const Issue = {
};
function createBaseIssue_Approver(): Issue_Approver {
- return { status: 0, principal: "" };
+ return { status: Issue_Approver_Status.STATUS_UNSPECIFIED, principal: "" };
}
export const Issue_Approver = {
encode(message: Issue_Approver, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.status !== 0) {
- writer.uint32(8).int32(message.status);
+ if (message.status !== Issue_Approver_Status.STATUS_UNSPECIFIED) {
+ writer.uint32(8).int32(issue_Approver_StatusToNumber(message.status));
}
if (message.principal !== "") {
writer.uint32(18).string(message.principal);
@@ -2282,7 +2430,7 @@ export const Issue_Approver = {
break;
}
- message.status = reader.int32() as any;
+ message.status = issue_Approver_StatusFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -2302,14 +2450,16 @@ export const Issue_Approver = {
fromJSON(object: any): Issue_Approver {
return {
- status: isSet(object.status) ? issue_Approver_StatusFromJSON(object.status) : 0,
+ 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 !== 0) {
+ if (message.status !== Issue_Approver_Status.STATUS_UNSPECIFIED) {
obj.status = issue_Approver_StatusToJSON(message.status);
}
if (message.principal !== "") {
@@ -2323,7 +2473,7 @@ export const Issue_Approver = {
},
fromPartial(object: DeepPartial<Issue_Approver>): Issue_Approver {
const message = createBaseIssue_Approver();
- message.status = object.status ?? 0;
+ message.status = object.status ?? Issue_Approver_Status.STATUS_UNSPECIFIED;
message.principal = object.principal ?? "";
return message;
},
@@ -2677,13 +2827,13 @@ export const ApprovalFlow = {
};
function createBaseApprovalStep(): ApprovalStep {
- return { type: 0, nodes: [] };
+ return { type: ApprovalStep_Type.TYPE_UNSPECIFIED, nodes: [] };
}
export const ApprovalStep = {
encode(message: ApprovalStep, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.type !== 0) {
- writer.uint32(8).int32(message.type);
+ if (message.type !== ApprovalStep_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(8).int32(approvalStep_TypeToNumber(message.type));
}
for (const v of message.nodes) {
ApprovalNode.encode(v!, writer.uint32(18).fork()).ldelim();
@@ -2703,7 +2853,7 @@ export const ApprovalStep = {
break;
}
- message.type = reader.int32() as any;
+ message.type = approvalStep_TypeFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -2723,14 +2873,14 @@ export const ApprovalStep = {
fromJSON(object: any): ApprovalStep {
return {
- type: isSet(object.type) ? approvalStep_TypeFromJSON(object.type) : 0,
+ 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 !== 0) {
+ if (message.type !== ApprovalStep_Type.TYPE_UNSPECIFIED) {
obj.type = approvalStep_TypeToJSON(message.type);
}
if (message.nodes?.length) {
@@ -2744,23 +2894,28 @@ export const ApprovalStep = {
},
fromPartial(object: DeepPartial<ApprovalStep>): ApprovalStep {
const message = createBaseApprovalStep();
- message.type = object.type ?? 0;
+ message.type = object.type ?? ApprovalStep_Type.TYPE_UNSPECIFIED;
message.nodes = object.nodes?.map((e) => ApprovalNode.fromPartial(e)) || [];
return message;
},
};
function createBaseApprovalNode(): ApprovalNode {
- return { type: 0, groupValue: undefined, role: undefined, externalNodeId: undefined };
+ return {
+ type: ApprovalNode_Type.TYPE_UNSPECIFIED,
+ groupValue: undefined,
+ role: undefined,
+ externalNodeId: undefined,
+ };
}
export const ApprovalNode = {
encode(message: ApprovalNode, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.type !== 0) {
- writer.uint32(8).int32(message.type);
+ if (message.type !== ApprovalNode_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(8).int32(approvalNode_TypeToNumber(message.type));
}
if (message.groupValue !== undefined) {
- writer.uint32(16).int32(message.groupValue);
+ writer.uint32(16).int32(approvalNode_GroupValueToNumber(message.groupValue));
}
if (message.role !== undefined) {
writer.uint32(26).string(message.role);
@@ -2783,14 +2938,14 @@ export const ApprovalNode = {
break;
}
- message.type = reader.int32() as any;
+ message.type = approvalNode_TypeFromJSON(reader.int32());
continue;
case 2:
if (tag !== 16) {
break;
}
- message.groupValue = reader.int32() as any;
+ message.groupValue = approvalNode_GroupValueFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -2817,7 +2972,7 @@ export const ApprovalNode = {
fromJSON(object: any): ApprovalNode {
return {
- type: isSet(object.type) ? approvalNode_TypeFromJSON(object.type) : 0,
+ type: isSet(object.type) ? approvalNode_TypeFromJSON(object.type) : ApprovalNode_Type.TYPE_UNSPECIFIED,
groupValue: isSet(object.groupValue) ? approvalNode_GroupValueFromJSON(object.groupValue) : undefined,
role: isSet(object.role) ? globalThis.String(object.role) : undefined,
externalNodeId: isSet(object.externalNodeId) ? globalThis.String(object.externalNodeId) : undefined,
@@ -2826,7 +2981,7 @@ export const ApprovalNode = {
toJSON(message: ApprovalNode): unknown {
const obj: any = {};
- if (message.type !== 0) {
+ if (message.type !== ApprovalNode_Type.TYPE_UNSPECIFIED) {
obj.type = approvalNode_TypeToJSON(message.type);
}
if (message.groupValue !== undefined) {
@@ -2846,7 +3001,7 @@ export const ApprovalNode = {
},
fromPartial(object: DeepPartial<ApprovalNode>): ApprovalNode {
const message = createBaseApprovalNode();
- message.type = object.type ?? 0;
+ message.type = object.type ?? ApprovalNode_Type.TYPE_UNSPECIFIED;
message.groupValue = object.groupValue ?? undefined;
message.role = object.role ?? undefined;
message.externalNodeId = object.externalNodeId ?? undefined;
@@ -3436,13 +3591,13 @@ export const IssueComment = {
};
function createBaseIssueComment_Approval(): IssueComment_Approval {
- return { status: 0 };
+ return { status: IssueComment_Approval_Status.STATUS_UNSPECIFIED };
}
export const IssueComment_Approval = {
encode(message: IssueComment_Approval, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.status !== 0) {
- writer.uint32(8).int32(message.status);
+ if (message.status !== IssueComment_Approval_Status.STATUS_UNSPECIFIED) {
+ writer.uint32(8).int32(issueComment_Approval_StatusToNumber(message.status));
}
return writer;
},
@@ -3459,7 +3614,7 @@ export const IssueComment_Approval = {
break;
}
- message.status = reader.int32() as any;
+ message.status = issueComment_Approval_StatusFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -3471,12 +3626,16 @@ export const IssueComment_Approval = {
},
fromJSON(object: any): IssueComment_Approval {
- return { status: isSet(object.status) ? issueComment_Approval_StatusFromJSON(object.status) : 0 };
+ 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 !== 0) {
+ if (message.status !== IssueComment_Approval_Status.STATUS_UNSPECIFIED) {
obj.status = issueComment_Approval_StatusToJSON(message.status);
}
return obj;
@@ -3487,7 +3646,7 @@ export const IssueComment_Approval = {
},
fromPartial(object: DeepPartial<IssueComment_Approval>): IssueComment_Approval {
const message = createBaseIssueComment_Approval();
- message.status = object.status ?? 0;
+ message.status = object.status ?? IssueComment_Approval_Status.STATUS_UNSPECIFIED;
return message;
},
};
@@ -3520,10 +3679,10 @@ export const IssueComment_IssueUpdate = {
writer.uint32(34).string(message.toDescription);
}
if (message.fromStatus !== undefined) {
- writer.uint32(40).int32(message.fromStatus);
+ writer.uint32(40).int32(issueStatusToNumber(message.fromStatus));
}
if (message.toStatus !== undefined) {
- writer.uint32(48).int32(message.toStatus);
+ writer.uint32(48).int32(issueStatusToNumber(message.toStatus));
}
if (message.fromAssignee !== undefined) {
writer.uint32(58).string(message.fromAssignee);
@@ -3574,14 +3733,14 @@ export const IssueComment_IssueUpdate = {
break;
}
- message.fromStatus = reader.int32() as any;
+ message.fromStatus = issueStatusFromJSON(reader.int32());
continue;
case 6:
if (tag !== 48) {
break;
}
- message.toStatus = reader.int32() as any;
+ message.toStatus = issueStatusFromJSON(reader.int32());
continue;
case 7:
if (tag !== 58) {
@@ -3751,7 +3910,7 @@ export const IssueComment_TaskUpdate = {
Timestamp.encode(toTimestamp(message.toEarliestAllowedTime), writer.uint32(42).fork()).ldelim();
}
if (message.toStatus !== undefined) {
- writer.uint32(48).int32(message.toStatus);
+ writer.uint32(48).int32(issueComment_TaskUpdate_StatusToNumber(message.toStatus));
}
return writer;
},
@@ -3803,7 +3962,7 @@ export const IssueComment_TaskUpdate = {
break;
}
- message.toStatus = reader.int32() as any;
+ message.toStatus = issueComment_TaskUpdate_StatusFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
diff --git a/frontend/src/types/proto/v1/logging_service.ts b/frontend/src/types/proto/v1/logging_service.ts
index 8775c2d676..61e0d995e0 100644
--- a/frontend/src/types/proto/v1/logging_service.ts
+++ b/frontend/src/types/proto/v1/logging_service.ts
@@ -2,7 +2,7 @@
import Long from "long";
import _m0 from "protobufjs/minimal";
import { Timestamp } from "../google/protobuf/timestamp";
-import { ExportFormat, exportFormatFromJSON, exportFormatToJSON } from "./common";
+import { ExportFormat, exportFormatFromJSON, exportFormatToJSON, exportFormatToNumber } from "./common";
export const protobufPackage = "bytebase.v1";
@@ -142,70 +142,70 @@ export interface LogEntity {
export enum LogEntity_Action {
/** ACTION_UNSPECIFIED - In worksapce resource only. */
- ACTION_UNSPECIFIED = 0,
+ ACTION_UNSPECIFIED = "ACTION_UNSPECIFIED",
/**
* ACTION_MEMBER_CREATE - Member related activity types.
* Enum value 1 - 20
*
* ACTION_MEMBER_CREATE is the type for creating a new member.
*/
- ACTION_MEMBER_CREATE = 1,
+ ACTION_MEMBER_CREATE = "ACTION_MEMBER_CREATE",
/** ACTION_MEMBER_ROLE_UPDATE - ACTION_MEMBER_ROLE_UPDATE is the type for updating a member's role. */
- ACTION_MEMBER_ROLE_UPDATE = 2,
+ ACTION_MEMBER_ROLE_UPDATE = "ACTION_MEMBER_ROLE_UPDATE",
/** ACTION_MEMBER_ACTIVATE - ACTION_MEMBER_ACTIVATE_UPDATE is the type for activating members. */
- ACTION_MEMBER_ACTIVATE = 3,
+ ACTION_MEMBER_ACTIVATE = "ACTION_MEMBER_ACTIVATE",
/** ACTION_MEMBER_DEACTIVE - ACTION_MEMBER_DEACTIVE is the type for deactiving members. */
- ACTION_MEMBER_DEACTIVE = 4,
+ ACTION_MEMBER_DEACTIVE = "ACTION_MEMBER_DEACTIVE",
/**
* ACTION_ISSUE_CREATE - Issue related activity types.
* Enum value 21 - 40
*
* ACTION_ISSUE_CREATE is the type for creating a new issue.
*/
- ACTION_ISSUE_CREATE = 21,
+ ACTION_ISSUE_CREATE = "ACTION_ISSUE_CREATE",
/** ACTION_ISSUE_COMMENT_CREATE - ACTION_ISSUE_COMMENT_CREATE is the type for creating a new comment on an issue. */
- ACTION_ISSUE_COMMENT_CREATE = 22,
+ ACTION_ISSUE_COMMENT_CREATE = "ACTION_ISSUE_COMMENT_CREATE",
/** ACTION_ISSUE_FIELD_UPDATE - ACTION_ISSUE_FIELD_UPDATE is the type for updating an issue's field. */
- ACTION_ISSUE_FIELD_UPDATE = 23,
+ ACTION_ISSUE_FIELD_UPDATE = "ACTION_ISSUE_FIELD_UPDATE",
/** ACTION_ISSUE_STATUS_UPDATE - ACTION_ISSUE_STATUS_UPDATE is the type for updating an issue's status. */
- ACTION_ISSUE_STATUS_UPDATE = 24,
+ ACTION_ISSUE_STATUS_UPDATE = "ACTION_ISSUE_STATUS_UPDATE",
/** ACTION_ISSUE_APPROVAL_NOTIFY - ACTION_ISSUE_APPROVAL_NOTIFY is the type for notifying issue approval. */
- ACTION_ISSUE_APPROVAL_NOTIFY = 25,
+ ACTION_ISSUE_APPROVAL_NOTIFY = "ACTION_ISSUE_APPROVAL_NOTIFY",
/** ACTION_PIPELINE_STAGE_STATUS_UPDATE - ACTION_PIPELINE_STAGE_STATUS_UPDATE represents the pipeline stage status change, including BEGIN, END for now. */
- ACTION_PIPELINE_STAGE_STATUS_UPDATE = 31,
+ ACTION_PIPELINE_STAGE_STATUS_UPDATE = "ACTION_PIPELINE_STAGE_STATUS_UPDATE",
/** ACTION_PIPELINE_TASK_STATUS_UPDATE - ACTION_PIPELINE_TASK_STATUS_UPDATE represents the pipeline task status change, including PENDING, PENDING_APPROVAL, RUNNING, SUCCESS, FAILURE, CANCELED for now. */
- ACTION_PIPELINE_TASK_STATUS_UPDATE = 32,
+ ACTION_PIPELINE_TASK_STATUS_UPDATE = "ACTION_PIPELINE_TASK_STATUS_UPDATE",
/** ACTION_PIPELINE_TASK_STATEMENT_UPDATE - ACTION_PIPELINE_TASK_STATEMENT_UPDATE represents the manual update of the task statement. */
- ACTION_PIPELINE_TASK_STATEMENT_UPDATE = 34,
+ ACTION_PIPELINE_TASK_STATEMENT_UPDATE = "ACTION_PIPELINE_TASK_STATEMENT_UPDATE",
/** ACTION_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE - ACTION_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE represents the manual update of the task earliest allowed time. */
- ACTION_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE = 35,
+ ACTION_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE = "ACTION_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE",
/** ACTION_PIPELINE_TASK_RUN_STATUS_UPDATE - ACTION_PIPELINE_TASK_RUN_STATUS_UPDATE represents the pipeline task run status change, including PENDING, RUNNING, SUCCESS, FAILURE, CANCELED for now. */
- ACTION_PIPELINE_TASK_RUN_STATUS_UPDATE = 36,
+ ACTION_PIPELINE_TASK_RUN_STATUS_UPDATE = "ACTION_PIPELINE_TASK_RUN_STATUS_UPDATE",
/** ACTION_PIPELINE_TASK_PRIOR_BACKUP - ACTION_PIPELINE_TASK_PRIOR_BACKUP represents the pipeline task prior backup activity. */
- ACTION_PIPELINE_TASK_PRIOR_BACKUP = 37,
+ ACTION_PIPELINE_TASK_PRIOR_BACKUP = "ACTION_PIPELINE_TASK_PRIOR_BACKUP",
/**
* ACTION_PROJECT_REPOSITORY_PUSH - Project related activity types.
* Enum value 41 - 60
*
* ACTION_PROJECT_REPOSITORY_PUSH represents Bytebase receiving a push event from the project repository.
*/
- ACTION_PROJECT_REPOSITORY_PUSH = 41,
+ ACTION_PROJECT_REPOSITORY_PUSH = "ACTION_PROJECT_REPOSITORY_PUSH",
/** ACTION_PROJECT_MEMBER_CREATE - ACTION_PROJECT_MEMBER_CREATE represents adding a member to the project. */
- ACTION_PROJECT_MEMBER_CREATE = 42,
+ ACTION_PROJECT_MEMBER_CREATE = "ACTION_PROJECT_MEMBER_CREATE",
/** ACTION_PROJECT_MEMBER_DELETE - ACTION_PROJECT_MEMBER_DELETE represents removing a member from the project. */
- ACTION_PROJECT_MEMBER_DELETE = 43,
+ ACTION_PROJECT_MEMBER_DELETE = "ACTION_PROJECT_MEMBER_DELETE",
/** ACTION_PROJECT_DATABASE_TRANSFER - ACTION_PROJECT_DATABASE_TRANSFER represents transfering the database from one project to another. */
- ACTION_PROJECT_DATABASE_TRANSFER = 45,
+ ACTION_PROJECT_DATABASE_TRANSFER = "ACTION_PROJECT_DATABASE_TRANSFER",
/**
* ACTION_DATABASE_SQL_EDITOR_QUERY - Database related activity types.
* Enum value 61 - 80
*
* ACTION_DATABASE_SQL_EDITOR_QUERY is the type for SQL editor query.
*/
- ACTION_DATABASE_SQL_EDITOR_QUERY = 61,
+ ACTION_DATABASE_SQL_EDITOR_QUERY = "ACTION_DATABASE_SQL_EDITOR_QUERY",
/** ACTION_DATABASE_SQL_EXPORT - ACTION_DATABASE_SQL_EXPORT is the type for exporting SQL. */
- ACTION_DATABASE_SQL_EXPORT = 62,
- UNRECOGNIZED = -1,
+ ACTION_DATABASE_SQL_EXPORT = "ACTION_DATABASE_SQL_EXPORT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function logEntity_ActionFromJSON(object: any): LogEntity_Action {
@@ -335,15 +335,67 @@ export function logEntity_ActionToJSON(object: LogEntity_Action): string {
}
}
+export function logEntity_ActionToNumber(object: LogEntity_Action): number {
+ switch (object) {
+ case LogEntity_Action.ACTION_UNSPECIFIED:
+ return 0;
+ case LogEntity_Action.ACTION_MEMBER_CREATE:
+ return 1;
+ case LogEntity_Action.ACTION_MEMBER_ROLE_UPDATE:
+ return 2;
+ case LogEntity_Action.ACTION_MEMBER_ACTIVATE:
+ return 3;
+ case LogEntity_Action.ACTION_MEMBER_DEACTIVE:
+ return 4;
+ case LogEntity_Action.ACTION_ISSUE_CREATE:
+ return 21;
+ case LogEntity_Action.ACTION_ISSUE_COMMENT_CREATE:
+ return 22;
+ case LogEntity_Action.ACTION_ISSUE_FIELD_UPDATE:
+ return 23;
+ case LogEntity_Action.ACTION_ISSUE_STATUS_UPDATE:
+ return 24;
+ case LogEntity_Action.ACTION_ISSUE_APPROVAL_NOTIFY:
+ return 25;
+ case LogEntity_Action.ACTION_PIPELINE_STAGE_STATUS_UPDATE:
+ return 31;
+ case LogEntity_Action.ACTION_PIPELINE_TASK_STATUS_UPDATE:
+ return 32;
+ case LogEntity_Action.ACTION_PIPELINE_TASK_STATEMENT_UPDATE:
+ return 34;
+ case LogEntity_Action.ACTION_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE:
+ return 35;
+ case LogEntity_Action.ACTION_PIPELINE_TASK_RUN_STATUS_UPDATE:
+ return 36;
+ case LogEntity_Action.ACTION_PIPELINE_TASK_PRIOR_BACKUP:
+ return 37;
+ case LogEntity_Action.ACTION_PROJECT_REPOSITORY_PUSH:
+ return 41;
+ case LogEntity_Action.ACTION_PROJECT_MEMBER_CREATE:
+ return 42;
+ case LogEntity_Action.ACTION_PROJECT_MEMBER_DELETE:
+ return 43;
+ case LogEntity_Action.ACTION_PROJECT_DATABASE_TRANSFER:
+ return 45;
+ case LogEntity_Action.ACTION_DATABASE_SQL_EDITOR_QUERY:
+ return 61;
+ case LogEntity_Action.ACTION_DATABASE_SQL_EXPORT:
+ return 62;
+ case LogEntity_Action.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum LogEntity_Level {
- LEVEL_UNSPECIFIED = 0,
+ LEVEL_UNSPECIFIED = "LEVEL_UNSPECIFIED",
/** LEVEL_INFO - LEVEL_INFO is the type for information. */
- LEVEL_INFO = 1,
+ LEVEL_INFO = "LEVEL_INFO",
/** LEVEL_WARNING - LEVEL_WARNING is the type for warning. */
- LEVEL_WARNING = 2,
+ LEVEL_WARNING = "LEVEL_WARNING",
/** LEVEL_ERROR - LEVEL_ERROR is the type for error. */
- LEVEL_ERROR = 3,
- UNRECOGNIZED = -1,
+ LEVEL_ERROR = "LEVEL_ERROR",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function logEntity_LevelFromJSON(object: any): LogEntity_Level {
@@ -383,6 +435,22 @@ export function logEntity_LevelToJSON(object: LogEntity_Level): string {
}
}
+export function logEntity_LevelToNumber(object: LogEntity_Level): number {
+ switch (object) {
+ case LogEntity_Level.LEVEL_UNSPECIFIED:
+ return 0;
+ case LogEntity_Level.LEVEL_INFO:
+ return 1;
+ case LogEntity_Level.LEVEL_WARNING:
+ return 2;
+ case LogEntity_Level.LEVEL_ERROR:
+ return 3;
+ case LogEntity_Level.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
function createBaseSearchLogsRequest(): SearchLogsRequest {
return { filter: "", orderBy: "", pageSize: 0, pageToken: "" };
}
@@ -621,7 +689,7 @@ export const GetLogRequest = {
};
function createBaseExportLogsRequest(): ExportLogsRequest {
- return { filter: "", orderBy: "", format: 0 };
+ return { filter: "", orderBy: "", format: ExportFormat.FORMAT_UNSPECIFIED };
}
export const ExportLogsRequest = {
@@ -632,8 +700,8 @@ export const ExportLogsRequest = {
if (message.orderBy !== "") {
writer.uint32(18).string(message.orderBy);
}
- if (message.format !== 0) {
- writer.uint32(40).int32(message.format);
+ if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
+ writer.uint32(40).int32(exportFormatToNumber(message.format));
}
return writer;
},
@@ -664,7 +732,7 @@ export const ExportLogsRequest = {
break;
}
- message.format = reader.int32() as any;
+ message.format = exportFormatFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -679,7 +747,7 @@ export const ExportLogsRequest = {
return {
filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
orderBy: isSet(object.orderBy) ? globalThis.String(object.orderBy) : "",
- format: isSet(object.format) ? exportFormatFromJSON(object.format) : 0,
+ format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,
};
},
@@ -691,7 +759,7 @@ export const ExportLogsRequest = {
if (message.orderBy !== "") {
obj.orderBy = message.orderBy;
}
- if (message.format !== 0) {
+ if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
obj.format = exportFormatToJSON(message.format);
}
return obj;
@@ -704,7 +772,7 @@ export const ExportLogsRequest = {
const message = createBaseExportLogsRequest();
message.filter = object.filter ?? "";
message.orderBy = object.orderBy ?? "";
- message.format = object.format ?? 0;
+ message.format = object.format ?? ExportFormat.FORMAT_UNSPECIFIED;
return message;
},
};
@@ -772,8 +840,8 @@ function createBaseLogEntity(): LogEntity {
creator: "",
createTime: undefined,
updateTime: undefined,
- action: 0,
- level: 0,
+ action: LogEntity_Action.ACTION_UNSPECIFIED,
+ level: LogEntity_Level.LEVEL_UNSPECIFIED,
resource: "",
payload: "",
comment: "",
@@ -794,11 +862,11 @@ export const LogEntity = {
if (message.updateTime !== undefined) {
Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(34).fork()).ldelim();
}
- if (message.action !== 0) {
- writer.uint32(40).int32(message.action);
+ if (message.action !== LogEntity_Action.ACTION_UNSPECIFIED) {
+ writer.uint32(40).int32(logEntity_ActionToNumber(message.action));
}
- if (message.level !== 0) {
- writer.uint32(48).int32(message.level);
+ if (message.level !== LogEntity_Level.LEVEL_UNSPECIFIED) {
+ writer.uint32(48).int32(logEntity_LevelToNumber(message.level));
}
if (message.resource !== "") {
writer.uint32(58).string(message.resource);
@@ -852,14 +920,14 @@ export const LogEntity = {
break;
}
- message.action = reader.int32() as any;
+ message.action = logEntity_ActionFromJSON(reader.int32());
continue;
case 6:
if (tag !== 48) {
break;
}
- message.level = reader.int32() as any;
+ message.level = logEntity_LevelFromJSON(reader.int32());
continue;
case 7:
if (tag !== 58) {
@@ -897,8 +965,8 @@ export const LogEntity = {
creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
- action: isSet(object.action) ? logEntity_ActionFromJSON(object.action) : 0,
- level: isSet(object.level) ? logEntity_LevelFromJSON(object.level) : 0,
+ action: isSet(object.action) ? logEntity_ActionFromJSON(object.action) : LogEntity_Action.ACTION_UNSPECIFIED,
+ level: isSet(object.level) ? logEntity_LevelFromJSON(object.level) : LogEntity_Level.LEVEL_UNSPECIFIED,
resource: isSet(object.resource) ? globalThis.String(object.resource) : "",
payload: isSet(object.payload) ? globalThis.String(object.payload) : "",
comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
@@ -919,10 +987,10 @@ export const LogEntity = {
if (message.updateTime !== undefined) {
obj.updateTime = message.updateTime.toISOString();
}
- if (message.action !== 0) {
+ if (message.action !== LogEntity_Action.ACTION_UNSPECIFIED) {
obj.action = logEntity_ActionToJSON(message.action);
}
- if (message.level !== 0) {
+ if (message.level !== LogEntity_Level.LEVEL_UNSPECIFIED) {
obj.level = logEntity_LevelToJSON(message.level);
}
if (message.resource !== "") {
@@ -946,8 +1014,8 @@ export const LogEntity = {
message.creator = object.creator ?? "";
message.createTime = object.createTime ?? undefined;
message.updateTime = object.updateTime ?? undefined;
- message.action = object.action ?? 0;
- message.level = object.level ?? 0;
+ message.action = object.action ?? LogEntity_Action.ACTION_UNSPECIFIED;
+ message.level = object.level ?? LogEntity_Level.LEVEL_UNSPECIFIED;
message.resource = object.resource ?? "";
message.payload = object.payload ?? "";
message.comment = object.comment ?? "";
diff --git a/frontend/src/types/proto/v1/org_policy_service.ts b/frontend/src/types/proto/v1/org_policy_service.ts
index 345886ccd2..d68cf7dbf4 100644
--- a/frontend/src/types/proto/v1/org_policy_service.ts
+++ b/frontend/src/types/proto/v1/org_policy_service.ts
@@ -4,21 +4,30 @@ import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
import { Expr } from "../google/type/expr";
-import { Engine, engineFromJSON, engineToJSON, MaskingLevel, maskingLevelFromJSON, maskingLevelToJSON } from "./common";
+import {
+ Engine,
+ engineFromJSON,
+ engineToJSON,
+ engineToNumber,
+ MaskingLevel,
+ maskingLevelFromJSON,
+ maskingLevelToJSON,
+ maskingLevelToNumber,
+} from "./common";
export const protobufPackage = "bytebase.v1";
export enum PolicyType {
- POLICY_TYPE_UNSPECIFIED = 0,
- ROLLOUT_POLICY = 11,
- SQL_REVIEW = 4,
- MASKING = 5,
- SLOW_QUERY = 7,
- DISABLE_COPY_DATA = 8,
- MASKING_RULE = 9,
- MASKING_EXCEPTION = 10,
- RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW = 12,
- UNRECOGNIZED = -1,
+ POLICY_TYPE_UNSPECIFIED = "POLICY_TYPE_UNSPECIFIED",
+ ROLLOUT_POLICY = "ROLLOUT_POLICY",
+ SQL_REVIEW = "SQL_REVIEW",
+ MASKING = "MASKING",
+ SLOW_QUERY = "SLOW_QUERY",
+ DISABLE_COPY_DATA = "DISABLE_COPY_DATA",
+ MASKING_RULE = "MASKING_RULE",
+ MASKING_EXCEPTION = "MASKING_EXCEPTION",
+ RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW = "RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function policyTypeFromJSON(object: any): PolicyType {
@@ -83,14 +92,40 @@ export function policyTypeToJSON(object: PolicyType): string {
}
}
+export function policyTypeToNumber(object: PolicyType): number {
+ switch (object) {
+ case PolicyType.POLICY_TYPE_UNSPECIFIED:
+ return 0;
+ case PolicyType.ROLLOUT_POLICY:
+ return 11;
+ case PolicyType.SQL_REVIEW:
+ return 4;
+ case PolicyType.MASKING:
+ return 5;
+ case PolicyType.SLOW_QUERY:
+ return 7;
+ case PolicyType.DISABLE_COPY_DATA:
+ return 8;
+ case PolicyType.MASKING_RULE:
+ return 9;
+ case PolicyType.MASKING_EXCEPTION:
+ return 10;
+ case PolicyType.RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW:
+ return 12;
+ case PolicyType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum PolicyResourceType {
- RESOURCE_TYPE_UNSPECIFIED = 0,
- WORKSPACE = 1,
- ENVIRONMENT = 2,
- PROJECT = 3,
- INSTANCE = 4,
- DATABASE = 5,
- UNRECOGNIZED = -1,
+ RESOURCE_TYPE_UNSPECIFIED = "RESOURCE_TYPE_UNSPECIFIED",
+ WORKSPACE = "WORKSPACE",
+ ENVIRONMENT = "ENVIRONMENT",
+ PROJECT = "PROJECT",
+ INSTANCE = "INSTANCE",
+ DATABASE = "DATABASE",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function policyResourceTypeFromJSON(object: any): PolicyResourceType {
@@ -140,12 +175,32 @@ export function policyResourceTypeToJSON(object: PolicyResourceType): string {
}
}
+export function policyResourceTypeToNumber(object: PolicyResourceType): number {
+ switch (object) {
+ case PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED:
+ return 0;
+ case PolicyResourceType.WORKSPACE:
+ return 1;
+ case PolicyResourceType.ENVIRONMENT:
+ return 2;
+ case PolicyResourceType.PROJECT:
+ return 3;
+ case PolicyResourceType.INSTANCE:
+ return 4;
+ case PolicyResourceType.DATABASE:
+ return 5;
+ case PolicyResourceType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum SQLReviewRuleLevel {
- LEVEL_UNSPECIFIED = 0,
- ERROR = 1,
- WARNING = 2,
- DISABLED = 3,
- UNRECOGNIZED = -1,
+ LEVEL_UNSPECIFIED = "LEVEL_UNSPECIFIED",
+ ERROR = "ERROR",
+ WARNING = "WARNING",
+ DISABLED = "DISABLED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function sQLReviewRuleLevelFromJSON(object: any): SQLReviewRuleLevel {
@@ -185,6 +240,22 @@ export function sQLReviewRuleLevelToJSON(object: SQLReviewRuleLevel): string {
}
}
+export function sQLReviewRuleLevelToNumber(object: SQLReviewRuleLevel): number {
+ switch (object) {
+ case SQLReviewRuleLevel.LEVEL_UNSPECIFIED:
+ return 0;
+ case SQLReviewRuleLevel.ERROR:
+ return 1;
+ case SQLReviewRuleLevel.WARNING:
+ return 2;
+ case SQLReviewRuleLevel.DISABLED:
+ return 3;
+ case SQLReviewRuleLevel.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface CreatePolicyRequest {
/**
* The parent resource where this instance will be created.
@@ -377,10 +448,10 @@ export interface MaskingExceptionPolicy_MaskingException {
}
export enum MaskingExceptionPolicy_MaskingException_Action {
- ACTION_UNSPECIFIED = 0,
- QUERY = 1,
- EXPORT = 2,
- UNRECOGNIZED = -1,
+ ACTION_UNSPECIFIED = "ACTION_UNSPECIFIED",
+ QUERY = "QUERY",
+ EXPORT = "EXPORT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function maskingExceptionPolicy_MaskingException_ActionFromJSON(
@@ -419,6 +490,22 @@ export function maskingExceptionPolicy_MaskingException_ActionToJSON(
}
}
+export function maskingExceptionPolicy_MaskingException_ActionToNumber(
+ object: MaskingExceptionPolicy_MaskingException_Action,
+): number {
+ switch (object) {
+ case MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED:
+ return 0;
+ case MaskingExceptionPolicy_MaskingException_Action.QUERY:
+ return 1;
+ case MaskingExceptionPolicy_MaskingException_Action.EXPORT:
+ return 2;
+ case MaskingExceptionPolicy_MaskingException_Action.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface MaskingRulePolicy {
rules: MaskingRulePolicy_MaskingRule[];
}
@@ -435,7 +522,7 @@ export interface RestrictIssueCreationForSQLReviewPolicy {
}
function createBaseCreatePolicyRequest(): CreatePolicyRequest {
- return { parent: "", policy: undefined, type: 0 };
+ return { parent: "", policy: undefined, type: PolicyType.POLICY_TYPE_UNSPECIFIED };
}
export const CreatePolicyRequest = {
@@ -446,8 +533,8 @@ export const CreatePolicyRequest = {
if (message.policy !== undefined) {
Policy.encode(message.policy, writer.uint32(18).fork()).ldelim();
}
- if (message.type !== 0) {
- writer.uint32(24).int32(message.type);
+ if (message.type !== PolicyType.POLICY_TYPE_UNSPECIFIED) {
+ writer.uint32(24).int32(policyTypeToNumber(message.type));
}
return writer;
},
@@ -478,7 +565,7 @@ export const CreatePolicyRequest = {
break;
}
- message.type = reader.int32() as any;
+ message.type = policyTypeFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -493,7 +580,7 @@ export const 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) : 0,
+ type: isSet(object.type) ? policyTypeFromJSON(object.type) : PolicyType.POLICY_TYPE_UNSPECIFIED,
};
},
@@ -505,7 +592,7 @@ export const CreatePolicyRequest = {
if (message.policy !== undefined) {
obj.policy = Policy.toJSON(message.policy);
}
- if (message.type !== 0) {
+ if (message.type !== PolicyType.POLICY_TYPE_UNSPECIFIED) {
obj.type = policyTypeToJSON(message.type);
}
return obj;
@@ -520,7 +607,7 @@ export const CreatePolicyRequest = {
message.policy = (object.policy !== undefined && object.policy !== null)
? Policy.fromPartial(object.policy)
: undefined;
- message.type = object.type ?? 0;
+ message.type = object.type ?? PolicyType.POLICY_TYPE_UNSPECIFIED;
return message;
},
};
@@ -740,7 +827,7 @@ export const ListPoliciesRequest = {
writer.uint32(10).string(message.parent);
}
if (message.policyType !== undefined) {
- writer.uint32(16).int32(message.policyType);
+ writer.uint32(16).int32(policyTypeToNumber(message.policyType));
}
if (message.pageSize !== 0) {
writer.uint32(24).int32(message.pageSize);
@@ -773,7 +860,7 @@ export const ListPoliciesRequest = {
break;
}
- message.policyType = reader.int32() as any;
+ message.policyType = policyTypeFromJSON(reader.int32());
continue;
case 3:
if (tag !== 24) {
@@ -928,7 +1015,7 @@ function createBasePolicy(): Policy {
name: "",
uid: "",
inheritFromParent: false,
- type: 0,
+ type: PolicyType.POLICY_TYPE_UNSPECIFIED,
rolloutPolicy: undefined,
maskingPolicy: undefined,
sqlReviewPolicy: undefined,
@@ -938,7 +1025,7 @@ function createBasePolicy(): Policy {
maskingExceptionPolicy: undefined,
restrictIssueCreationForSqlReviewPolicy: undefined,
enforce: false,
- resourceType: 0,
+ resourceType: PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED,
resourceUid: "",
};
}
@@ -954,8 +1041,8 @@ export const Policy = {
if (message.inheritFromParent === true) {
writer.uint32(32).bool(message.inheritFromParent);
}
- if (message.type !== 0) {
- writer.uint32(40).int32(message.type);
+ if (message.type !== PolicyType.POLICY_TYPE_UNSPECIFIED) {
+ writer.uint32(40).int32(policyTypeToNumber(message.type));
}
if (message.rolloutPolicy !== undefined) {
RolloutPolicy.encode(message.rolloutPolicy, writer.uint32(154).fork()).ldelim();
@@ -987,8 +1074,8 @@ export const Policy = {
if (message.enforce === true) {
writer.uint32(104).bool(message.enforce);
}
- if (message.resourceType !== 0) {
- writer.uint32(112).int32(message.resourceType);
+ if (message.resourceType !== PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED) {
+ writer.uint32(112).int32(policyResourceTypeToNumber(message.resourceType));
}
if (message.resourceUid !== "") {
writer.uint32(122).string(message.resourceUid);
@@ -1029,7 +1116,7 @@ export const Policy = {
break;
}
- message.type = reader.int32() as any;
+ message.type = policyTypeFromJSON(reader.int32());
continue;
case 19:
if (tag !== 154) {
@@ -1102,7 +1189,7 @@ export const Policy = {
break;
}
- message.resourceType = reader.int32() as any;
+ message.resourceType = policyResourceTypeFromJSON(reader.int32());
continue;
case 15:
if (tag !== 122) {
@@ -1125,7 +1212,7 @@ export const Policy = {
name: isSet(object.name) ? globalThis.String(object.name) : "",
uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
inheritFromParent: isSet(object.inheritFromParent) ? globalThis.Boolean(object.inheritFromParent) : false,
- type: isSet(object.type) ? policyTypeFromJSON(object.type) : 0,
+ type: isSet(object.type) ? policyTypeFromJSON(object.type) : PolicyType.POLICY_TYPE_UNSPECIFIED,
rolloutPolicy: isSet(object.rolloutPolicy) ? RolloutPolicy.fromJSON(object.rolloutPolicy) : undefined,
maskingPolicy: isSet(object.maskingPolicy) ? MaskingPolicy.fromJSON(object.maskingPolicy) : undefined,
sqlReviewPolicy: isSet(object.sqlReviewPolicy) ? SQLReviewPolicy.fromJSON(object.sqlReviewPolicy) : undefined,
@@ -1143,7 +1230,9 @@ export const Policy = {
? RestrictIssueCreationForSQLReviewPolicy.fromJSON(object.restrictIssueCreationForSqlReviewPolicy)
: undefined,
enforce: isSet(object.enforce) ? globalThis.Boolean(object.enforce) : false,
- resourceType: isSet(object.resourceType) ? policyResourceTypeFromJSON(object.resourceType) : 0,
+ resourceType: isSet(object.resourceType)
+ ? policyResourceTypeFromJSON(object.resourceType)
+ : PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED,
resourceUid: isSet(object.resourceUid) ? globalThis.String(object.resourceUid) : "",
};
},
@@ -1159,7 +1248,7 @@ export const Policy = {
if (message.inheritFromParent === true) {
obj.inheritFromParent = message.inheritFromParent;
}
- if (message.type !== 0) {
+ if (message.type !== PolicyType.POLICY_TYPE_UNSPECIFIED) {
obj.type = policyTypeToJSON(message.type);
}
if (message.rolloutPolicy !== undefined) {
@@ -1191,7 +1280,7 @@ export const Policy = {
if (message.enforce === true) {
obj.enforce = message.enforce;
}
- if (message.resourceType !== 0) {
+ if (message.resourceType !== PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED) {
obj.resourceType = policyResourceTypeToJSON(message.resourceType);
}
if (message.resourceUid !== "") {
@@ -1208,7 +1297,7 @@ export const Policy = {
message.name = object.name ?? "";
message.uid = object.uid ?? "";
message.inheritFromParent = object.inheritFromParent ?? false;
- message.type = object.type ?? 0;
+ message.type = object.type ?? PolicyType.POLICY_TYPE_UNSPECIFIED;
message.rolloutPolicy = (object.rolloutPolicy !== undefined && object.rolloutPolicy !== null)
? RolloutPolicy.fromPartial(object.rolloutPolicy)
: undefined;
@@ -1238,7 +1327,7 @@ export const Policy = {
? RestrictIssueCreationForSQLReviewPolicy.fromPartial(object.restrictIssueCreationForSqlReviewPolicy)
: undefined;
message.enforce = object.enforce ?? false;
- message.resourceType = object.resourceType ?? 0;
+ message.resourceType = object.resourceType ?? PolicyResourceType.RESOURCE_TYPE_UNSPECIFIED;
message.resourceUid = object.resourceUid ?? "";
return message;
},
@@ -1532,7 +1621,7 @@ function createBaseMaskData(): MaskData {
schema: "",
table: "",
column: "",
- maskingLevel: 0,
+ maskingLevel: MaskingLevel.MASKING_LEVEL_UNSPECIFIED,
fullMaskingAlgorithmId: "",
partialMaskingAlgorithmId: "",
};
@@ -1549,8 +1638,8 @@ export const MaskData = {
if (message.column !== "") {
writer.uint32(26).string(message.column);
}
- if (message.maskingLevel !== 0) {
- writer.uint32(32).int32(message.maskingLevel);
+ if (message.maskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
+ writer.uint32(32).int32(maskingLevelToNumber(message.maskingLevel));
}
if (message.fullMaskingAlgorithmId !== "") {
writer.uint32(42).string(message.fullMaskingAlgorithmId);
@@ -1594,7 +1683,7 @@ export const MaskData = {
break;
}
- message.maskingLevel = reader.int32() as any;
+ message.maskingLevel = maskingLevelFromJSON(reader.int32());
continue;
case 5:
if (tag !== 42) {
@@ -1624,7 +1713,9 @@ export const MaskData = {
schema: isSet(object.schema) ? globalThis.String(object.schema) : "",
table: isSet(object.table) ? globalThis.String(object.table) : "",
column: isSet(object.column) ? globalThis.String(object.column) : "",
- maskingLevel: isSet(object.maskingLevel) ? maskingLevelFromJSON(object.maskingLevel) : 0,
+ maskingLevel: isSet(object.maskingLevel)
+ ? maskingLevelFromJSON(object.maskingLevel)
+ : MaskingLevel.MASKING_LEVEL_UNSPECIFIED,
fullMaskingAlgorithmId: isSet(object.fullMaskingAlgorithmId)
? globalThis.String(object.fullMaskingAlgorithmId)
: "",
@@ -1645,7 +1736,7 @@ export const MaskData = {
if (message.column !== "") {
obj.column = message.column;
}
- if (message.maskingLevel !== 0) {
+ if (message.maskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
obj.maskingLevel = maskingLevelToJSON(message.maskingLevel);
}
if (message.fullMaskingAlgorithmId !== "") {
@@ -1665,7 +1756,7 @@ export const MaskData = {
message.schema = object.schema ?? "";
message.table = object.table ?? "";
message.column = object.column ?? "";
- message.maskingLevel = object.maskingLevel ?? 0;
+ message.maskingLevel = object.maskingLevel ?? MaskingLevel.MASKING_LEVEL_UNSPECIFIED;
message.fullMaskingAlgorithmId = object.fullMaskingAlgorithmId ?? "";
message.partialMaskingAlgorithmId = object.partialMaskingAlgorithmId ?? "";
return message;
@@ -1747,7 +1838,13 @@ export const SQLReviewPolicy = {
};
function createBaseSQLReviewRule(): SQLReviewRule {
- return { type: "", level: 0, payload: "", engine: 0, comment: "" };
+ return {
+ type: "",
+ level: SQLReviewRuleLevel.LEVEL_UNSPECIFIED,
+ payload: "",
+ engine: Engine.ENGINE_UNSPECIFIED,
+ comment: "",
+ };
}
export const SQLReviewRule = {
@@ -1755,14 +1852,14 @@ export const SQLReviewRule = {
if (message.type !== "") {
writer.uint32(10).string(message.type);
}
- if (message.level !== 0) {
- writer.uint32(16).int32(message.level);
+ if (message.level !== SQLReviewRuleLevel.LEVEL_UNSPECIFIED) {
+ writer.uint32(16).int32(sQLReviewRuleLevelToNumber(message.level));
}
if (message.payload !== "") {
writer.uint32(26).string(message.payload);
}
- if (message.engine !== 0) {
- writer.uint32(32).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(32).int32(engineToNumber(message.engine));
}
if (message.comment !== "") {
writer.uint32(42).string(message.comment);
@@ -1789,7 +1886,7 @@ export const SQLReviewRule = {
break;
}
- message.level = reader.int32() as any;
+ message.level = sQLReviewRuleLevelFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -1803,7 +1900,7 @@ export const SQLReviewRule = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
case 5:
if (tag !== 42) {
@@ -1824,9 +1921,9 @@ export const SQLReviewRule = {
fromJSON(object: any): SQLReviewRule {
return {
type: isSet(object.type) ? globalThis.String(object.type) : "",
- level: isSet(object.level) ? sQLReviewRuleLevelFromJSON(object.level) : 0,
+ 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) : 0,
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
comment: isSet(object.comment) ? globalThis.String(object.comment) : "",
};
},
@@ -1836,13 +1933,13 @@ export const SQLReviewRule = {
if (message.type !== "") {
obj.type = message.type;
}
- if (message.level !== 0) {
+ if (message.level !== SQLReviewRuleLevel.LEVEL_UNSPECIFIED) {
obj.level = sQLReviewRuleLevelToJSON(message.level);
}
if (message.payload !== "") {
obj.payload = message.payload;
}
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
if (message.comment !== "") {
@@ -1857,9 +1954,9 @@ export const SQLReviewRule = {
fromPartial(object: DeepPartial<SQLReviewRule>): SQLReviewRule {
const message = createBaseSQLReviewRule();
message.type = object.type ?? "";
- message.level = object.level ?? 0;
+ message.level = object.level ?? SQLReviewRuleLevel.LEVEL_UNSPECIFIED;
message.payload = object.payload ?? "";
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
message.comment = object.comment ?? "";
return message;
},
@@ -1928,16 +2025,21 @@ export const MaskingExceptionPolicy = {
};
function createBaseMaskingExceptionPolicy_MaskingException(): MaskingExceptionPolicy_MaskingException {
- return { action: 0, maskingLevel: 0, member: "", condition: undefined };
+ return {
+ action: MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED,
+ maskingLevel: MaskingLevel.MASKING_LEVEL_UNSPECIFIED,
+ member: "",
+ condition: undefined,
+ };
}
export const MaskingExceptionPolicy_MaskingException = {
encode(message: MaskingExceptionPolicy_MaskingException, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.action !== 0) {
- writer.uint32(8).int32(message.action);
+ if (message.action !== MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED) {
+ writer.uint32(8).int32(maskingExceptionPolicy_MaskingException_ActionToNumber(message.action));
}
- if (message.maskingLevel !== 0) {
- writer.uint32(16).int32(message.maskingLevel);
+ if (message.maskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
+ writer.uint32(16).int32(maskingLevelToNumber(message.maskingLevel));
}
if (message.member !== "") {
writer.uint32(26).string(message.member);
@@ -1960,14 +2062,14 @@ export const MaskingExceptionPolicy_MaskingException = {
break;
}
- message.action = reader.int32() as any;
+ message.action = maskingExceptionPolicy_MaskingException_ActionFromJSON(reader.int32());
continue;
case 2:
if (tag !== 16) {
break;
}
- message.maskingLevel = reader.int32() as any;
+ message.maskingLevel = maskingLevelFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -1994,8 +2096,12 @@ export const MaskingExceptionPolicy_MaskingException = {
fromJSON(object: any): MaskingExceptionPolicy_MaskingException {
return {
- action: isSet(object.action) ? maskingExceptionPolicy_MaskingException_ActionFromJSON(object.action) : 0,
- maskingLevel: isSet(object.maskingLevel) ? maskingLevelFromJSON(object.maskingLevel) : 0,
+ action: isSet(object.action)
+ ? maskingExceptionPolicy_MaskingException_ActionFromJSON(object.action)
+ : MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED,
+ maskingLevel: isSet(object.maskingLevel)
+ ? maskingLevelFromJSON(object.maskingLevel)
+ : MaskingLevel.MASKING_LEVEL_UNSPECIFIED,
member: isSet(object.member) ? globalThis.String(object.member) : "",
condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
};
@@ -2003,10 +2109,10 @@ export const MaskingExceptionPolicy_MaskingException = {
toJSON(message: MaskingExceptionPolicy_MaskingException): unknown {
const obj: any = {};
- if (message.action !== 0) {
+ if (message.action !== MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED) {
obj.action = maskingExceptionPolicy_MaskingException_ActionToJSON(message.action);
}
- if (message.maskingLevel !== 0) {
+ if (message.maskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
obj.maskingLevel = maskingLevelToJSON(message.maskingLevel);
}
if (message.member !== "") {
@@ -2023,8 +2129,8 @@ export const MaskingExceptionPolicy_MaskingException = {
},
fromPartial(object: DeepPartial<MaskingExceptionPolicy_MaskingException>): MaskingExceptionPolicy_MaskingException {
const message = createBaseMaskingExceptionPolicy_MaskingException();
- message.action = object.action ?? 0;
- message.maskingLevel = object.maskingLevel ?? 0;
+ message.action = object.action ?? MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED;
+ message.maskingLevel = object.maskingLevel ?? MaskingLevel.MASKING_LEVEL_UNSPECIFIED;
message.member = object.member ?? "";
message.condition = (object.condition !== undefined && object.condition !== null)
? Expr.fromPartial(object.condition)
@@ -2095,7 +2201,7 @@ export const MaskingRulePolicy = {
};
function createBaseMaskingRulePolicy_MaskingRule(): MaskingRulePolicy_MaskingRule {
- return { id: "", condition: undefined, maskingLevel: 0 };
+ return { id: "", condition: undefined, maskingLevel: MaskingLevel.MASKING_LEVEL_UNSPECIFIED };
}
export const MaskingRulePolicy_MaskingRule = {
@@ -2106,8 +2212,8 @@ export const MaskingRulePolicy_MaskingRule = {
if (message.condition !== undefined) {
Expr.encode(message.condition, writer.uint32(18).fork()).ldelim();
}
- if (message.maskingLevel !== 0) {
- writer.uint32(24).int32(message.maskingLevel);
+ if (message.maskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
+ writer.uint32(24).int32(maskingLevelToNumber(message.maskingLevel));
}
return writer;
},
@@ -2138,7 +2244,7 @@ export const MaskingRulePolicy_MaskingRule = {
break;
}
- message.maskingLevel = reader.int32() as any;
+ message.maskingLevel = maskingLevelFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -2153,7 +2259,9 @@ export const MaskingRulePolicy_MaskingRule = {
return {
id: isSet(object.id) ? globalThis.String(object.id) : "",
condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,
- maskingLevel: isSet(object.maskingLevel) ? maskingLevelFromJSON(object.maskingLevel) : 0,
+ maskingLevel: isSet(object.maskingLevel)
+ ? maskingLevelFromJSON(object.maskingLevel)
+ : MaskingLevel.MASKING_LEVEL_UNSPECIFIED,
};
},
@@ -2165,7 +2273,7 @@ export const MaskingRulePolicy_MaskingRule = {
if (message.condition !== undefined) {
obj.condition = Expr.toJSON(message.condition);
}
- if (message.maskingLevel !== 0) {
+ if (message.maskingLevel !== MaskingLevel.MASKING_LEVEL_UNSPECIFIED) {
obj.maskingLevel = maskingLevelToJSON(message.maskingLevel);
}
return obj;
@@ -2180,7 +2288,7 @@ export const MaskingRulePolicy_MaskingRule = {
message.condition = (object.condition !== undefined && object.condition !== null)
? Expr.fromPartial(object.condition)
: undefined;
- message.maskingLevel = object.maskingLevel ?? 0;
+ message.maskingLevel = object.maskingLevel ?? MaskingLevel.MASKING_LEVEL_UNSPECIFIED;
return message;
},
};
diff --git a/frontend/src/types/proto/v1/project_service.ts b/frontend/src/types/proto/v1/project_service.ts
index 9f6b9ee7ea..22ef24dbd3 100644
--- a/frontend/src/types/proto/v1/project_service.ts
+++ b/frontend/src/types/proto/v1/project_service.ts
@@ -4,16 +4,16 @@ import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
import { Expr } from "../google/type/expr";
-import { State, stateFromJSON, stateToJSON } from "./common";
+import { State, stateFromJSON, stateToJSON, stateToNumber } from "./common";
import { IamPolicy } from "./iam_policy";
export const protobufPackage = "bytebase.v1";
export enum Workflow {
- WORKFLOW_UNSPECIFIED = 0,
- UI = 1,
- VCS = 2,
- UNRECOGNIZED = -1,
+ WORKFLOW_UNSPECIFIED = "WORKFLOW_UNSPECIFIED",
+ UI = "UI",
+ VCS = "VCS",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function workflowFromJSON(object: any): Workflow {
@@ -48,11 +48,25 @@ export function workflowToJSON(object: Workflow): string {
}
}
+export function workflowToNumber(object: Workflow): number {
+ switch (object) {
+ case Workflow.WORKFLOW_UNSPECIFIED:
+ return 0;
+ case Workflow.UI:
+ return 1;
+ case Workflow.VCS:
+ return 2;
+ case Workflow.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum TenantMode {
- TENANT_MODE_UNSPECIFIED = 0,
- TENANT_MODE_DISABLED = 1,
- TENANT_MODE_ENABLED = 2,
- UNRECOGNIZED = -1,
+ TENANT_MODE_UNSPECIFIED = "TENANT_MODE_UNSPECIFIED",
+ TENANT_MODE_DISABLED = "TENANT_MODE_DISABLED",
+ TENANT_MODE_ENABLED = "TENANT_MODE_ENABLED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function tenantModeFromJSON(object: any): TenantMode {
@@ -87,14 +101,28 @@ export function tenantModeToJSON(object: TenantMode): string {
}
}
+export function tenantModeToNumber(object: TenantMode): number {
+ switch (object) {
+ case TenantMode.TENANT_MODE_UNSPECIFIED:
+ return 0;
+ case TenantMode.TENANT_MODE_DISABLED:
+ return 1;
+ case TenantMode.TENANT_MODE_ENABLED:
+ return 2;
+ case TenantMode.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum OperatorType {
/** OPERATOR_TYPE_UNSPECIFIED - The operator is not specified. */
- OPERATOR_TYPE_UNSPECIFIED = 0,
+ OPERATOR_TYPE_UNSPECIFIED = "OPERATOR_TYPE_UNSPECIFIED",
/** OPERATOR_TYPE_IN - The operator is "In". */
- OPERATOR_TYPE_IN = 1,
+ OPERATOR_TYPE_IN = "OPERATOR_TYPE_IN",
/** OPERATOR_TYPE_EXISTS - The operator is "Exists". */
- OPERATOR_TYPE_EXISTS = 2,
- UNRECOGNIZED = -1,
+ OPERATOR_TYPE_EXISTS = "OPERATOR_TYPE_EXISTS",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function operatorTypeFromJSON(object: any): OperatorType {
@@ -129,17 +157,31 @@ export function operatorTypeToJSON(object: OperatorType): string {
}
}
+export function operatorTypeToNumber(object: OperatorType): number {
+ switch (object) {
+ case OperatorType.OPERATOR_TYPE_UNSPECIFIED:
+ return 0;
+ case OperatorType.OPERATOR_TYPE_IN:
+ return 1;
+ case OperatorType.OPERATOR_TYPE_EXISTS:
+ return 2;
+ case OperatorType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum DatabaseGroupView {
/**
* DATABASE_GROUP_VIEW_UNSPECIFIED - The default / unset value.
* The API will default to the BASIC view.
*/
- DATABASE_GROUP_VIEW_UNSPECIFIED = 0,
+ DATABASE_GROUP_VIEW_UNSPECIFIED = "DATABASE_GROUP_VIEW_UNSPECIFIED",
/** DATABASE_GROUP_VIEW_BASIC - Include basic information about the database group, but exclude the list of matched databases and unmatched databases. */
- DATABASE_GROUP_VIEW_BASIC = 1,
+ DATABASE_GROUP_VIEW_BASIC = "DATABASE_GROUP_VIEW_BASIC",
/** DATABASE_GROUP_VIEW_FULL - Include everything. */
- DATABASE_GROUP_VIEW_FULL = 2,
- UNRECOGNIZED = -1,
+ DATABASE_GROUP_VIEW_FULL = "DATABASE_GROUP_VIEW_FULL",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function databaseGroupViewFromJSON(object: any): DatabaseGroupView {
@@ -174,17 +216,31 @@ export function databaseGroupViewToJSON(object: DatabaseGroupView): string {
}
}
+export function databaseGroupViewToNumber(object: DatabaseGroupView): number {
+ switch (object) {
+ case DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED:
+ return 0;
+ case DatabaseGroupView.DATABASE_GROUP_VIEW_BASIC:
+ return 1;
+ case DatabaseGroupView.DATABASE_GROUP_VIEW_FULL:
+ return 2;
+ case DatabaseGroupView.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum SchemaGroupView {
/**
* SCHEMA_GROUP_VIEW_UNSPECIFIED - The default / unset value.
* The API will default to the BASIC view.
*/
- SCHEMA_GROUP_VIEW_UNSPECIFIED = 0,
+ SCHEMA_GROUP_VIEW_UNSPECIFIED = "SCHEMA_GROUP_VIEW_UNSPECIFIED",
/** SCHEMA_GROUP_VIEW_BASIC - Include basic information about the schema group, but exclude the list of matched tables and unmatched tables. */
- SCHEMA_GROUP_VIEW_BASIC = 1,
+ SCHEMA_GROUP_VIEW_BASIC = "SCHEMA_GROUP_VIEW_BASIC",
/** SCHEMA_GROUP_VIEW_FULL - Include everything. */
- SCHEMA_GROUP_VIEW_FULL = 2,
- UNRECOGNIZED = -1,
+ SCHEMA_GROUP_VIEW_FULL = "SCHEMA_GROUP_VIEW_FULL",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function schemaGroupViewFromJSON(object: any): SchemaGroupView {
@@ -219,6 +275,20 @@ export function schemaGroupViewToJSON(object: SchemaGroupView): string {
}
}
+export function schemaGroupViewToNumber(object: SchemaGroupView): number {
+ switch (object) {
+ case SchemaGroupView.SCHEMA_GROUP_VIEW_UNSPECIFIED:
+ return 0;
+ case SchemaGroupView.SCHEMA_GROUP_VIEW_BASIC:
+ return 1;
+ case SchemaGroupView.SCHEMA_GROUP_VIEW_FULL:
+ return 2;
+ case SchemaGroupView.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface GetProjectRequest {
/**
* The name of the project to retrieve.
@@ -443,15 +513,15 @@ export interface Webhook {
}
export enum Webhook_Type {
- TYPE_UNSPECIFIED = 0,
- TYPE_SLACK = 1,
- TYPE_DISCORD = 2,
- TYPE_TEAMS = 3,
- TYPE_DINGTALK = 4,
- TYPE_FEISHU = 5,
- TYPE_WECOM = 6,
- TYPE_CUSTOM = 7,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ TYPE_SLACK = "TYPE_SLACK",
+ TYPE_DISCORD = "TYPE_DISCORD",
+ TYPE_TEAMS = "TYPE_TEAMS",
+ TYPE_DINGTALK = "TYPE_DINGTALK",
+ TYPE_FEISHU = "TYPE_FEISHU",
+ TYPE_WECOM = "TYPE_WECOM",
+ TYPE_CUSTOM = "TYPE_CUSTOM",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function webhook_TypeFromJSON(object: any): Webhook_Type {
@@ -511,6 +581,30 @@ export function webhook_TypeToJSON(object: Webhook_Type): string {
}
}
+export function webhook_TypeToNumber(object: Webhook_Type): number {
+ switch (object) {
+ case Webhook_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case Webhook_Type.TYPE_SLACK:
+ return 1;
+ case Webhook_Type.TYPE_DISCORD:
+ return 2;
+ case Webhook_Type.TYPE_TEAMS:
+ return 3;
+ case Webhook_Type.TYPE_DINGTALK:
+ return 4;
+ case Webhook_Type.TYPE_FEISHU:
+ return 5;
+ case Webhook_Type.TYPE_WECOM:
+ return 6;
+ case Webhook_Type.TYPE_CUSTOM:
+ return 7;
+ case Webhook_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface DeploymentConfig {
/**
* The name of the resource.
@@ -551,69 +645,69 @@ export interface Activity {
}
export enum Activity_Type {
- TYPE_UNSPECIFIED = 0,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
/**
* TYPE_NOTIFY_ISSUE_APPROVED - Notifications via webhooks.
*
* TYPE_NOTIFY_ISSUE_APPROVED represents the issue approved notification.
*/
- TYPE_NOTIFY_ISSUE_APPROVED = 23,
+ TYPE_NOTIFY_ISSUE_APPROVED = "TYPE_NOTIFY_ISSUE_APPROVED",
/** TYPE_NOTIFY_PIPELINE_ROLLOUT - TYPE_NOTIFY_PIPELINE_ROLLOUT represents the pipeline rollout notification. */
- TYPE_NOTIFY_PIPELINE_ROLLOUT = 24,
+ TYPE_NOTIFY_PIPELINE_ROLLOUT = "TYPE_NOTIFY_PIPELINE_ROLLOUT",
/**
* TYPE_ISSUE_CREATE - Issue related activity types.
*
* TYPE_ISSUE_CREATE represents creating an issue.
*/
- TYPE_ISSUE_CREATE = 1,
+ TYPE_ISSUE_CREATE = "TYPE_ISSUE_CREATE",
/** TYPE_ISSUE_COMMENT_CREATE - TYPE_ISSUE_COMMENT_CREATE represents commenting on an issue. */
- TYPE_ISSUE_COMMENT_CREATE = 2,
+ TYPE_ISSUE_COMMENT_CREATE = "TYPE_ISSUE_COMMENT_CREATE",
/** TYPE_ISSUE_FIELD_UPDATE - TYPE_ISSUE_FIELD_UPDATE represents updating the issue field, likes title, description, assignee, etc. */
- TYPE_ISSUE_FIELD_UPDATE = 3,
+ TYPE_ISSUE_FIELD_UPDATE = "TYPE_ISSUE_FIELD_UPDATE",
/** TYPE_ISSUE_STATUS_UPDATE - TYPE_ISSUE_STATUS_UPDATE represents the issue status change, including OPEN, CLOSE, CANCEL fow now. */
- TYPE_ISSUE_STATUS_UPDATE = 4,
+ TYPE_ISSUE_STATUS_UPDATE = "TYPE_ISSUE_STATUS_UPDATE",
/** TYPE_ISSUE_APPROVAL_NOTIFY - TYPE_ISSUE_APPROVAL_NOTIFY is the type for notifying issue approval. */
- TYPE_ISSUE_APPROVAL_NOTIFY = 21,
+ TYPE_ISSUE_APPROVAL_NOTIFY = "TYPE_ISSUE_APPROVAL_NOTIFY",
/** TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE - TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE represents the pipeline stage status change, including BEGIN, END for now. */
- TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE = 5,
+ TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE = "TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE",
/** TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE - TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE represents the pipeline task status change, including PENDING, PENDING_APPROVAL, RUNNING, SUCCESS, FAILURE, CANCELED for now. */
- TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE = 6,
+ TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE = "TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE",
/** TYPE_ISSUE_PIPELINE_TASK_RUN_STATUS_UPDATE - TYPE_ISSUE_PIPELINE_TASK_RUN_STATUS_UPDATE represents the pipeline task run status change, including PENDING, RUNNING, DONE, FAILED, CANCELED. */
- TYPE_ISSUE_PIPELINE_TASK_RUN_STATUS_UPDATE = 22,
+ TYPE_ISSUE_PIPELINE_TASK_RUN_STATUS_UPDATE = "TYPE_ISSUE_PIPELINE_TASK_RUN_STATUS_UPDATE",
/** TYPE_ISSUE_PIPELINE_TASK_STATEMENT_UPDATE - TYPE_ISSUE_PIPELINE_TASK_STATEMENT_UPDATE represents the manual update of the task statement. */
- TYPE_ISSUE_PIPELINE_TASK_STATEMENT_UPDATE = 8,
+ TYPE_ISSUE_PIPELINE_TASK_STATEMENT_UPDATE = "TYPE_ISSUE_PIPELINE_TASK_STATEMENT_UPDATE",
/** TYPE_ISSUE_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE - TYPE_ISSUE_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE represents the manual update of the task earliest allowed time. */
- TYPE_ISSUE_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE = 9,
+ TYPE_ISSUE_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE = "TYPE_ISSUE_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE",
/**
* TYPE_MEMBER_CREATE - Member related activity types.
*
* TYPE_MEMBER_CREATE represents creating a members.
*/
- TYPE_MEMBER_CREATE = 10,
+ TYPE_MEMBER_CREATE = "TYPE_MEMBER_CREATE",
/** TYPE_MEMBER_ROLE_UPDATE - TYPE_MEMBER_ROLE_UPDATE represents updating the member role, for example, from ADMIN to MEMBER. */
- TYPE_MEMBER_ROLE_UPDATE = 11,
+ TYPE_MEMBER_ROLE_UPDATE = "TYPE_MEMBER_ROLE_UPDATE",
/** TYPE_MEMBER_ACTIVATE - TYPE_MEMBER_ACTIVATE represents activating a deactivated member. */
- TYPE_MEMBER_ACTIVATE = 12,
+ TYPE_MEMBER_ACTIVATE = "TYPE_MEMBER_ACTIVATE",
/** TYPE_MEMBER_DEACTIVATE - TYPE_MEMBER_DEACTIVATE represents deactivating an active member. */
- TYPE_MEMBER_DEACTIVATE = 13,
+ TYPE_MEMBER_DEACTIVATE = "TYPE_MEMBER_DEACTIVATE",
/**
* TYPE_PROJECT_REPOSITORY_PUSH - Project related activity types.
*
* TYPE_PROJECT_REPOSITORY_PUSH represents Bytebase receiving a push event from the project repository.
*/
- TYPE_PROJECT_REPOSITORY_PUSH = 14,
+ TYPE_PROJECT_REPOSITORY_PUSH = "TYPE_PROJECT_REPOSITORY_PUSH",
/** TYPE_PROJECT_DATABASE_TRANSFER - TYPE_PROJECT_DATABASE_TRANFER represents transfering the database from one project to another. */
- TYPE_PROJECT_DATABASE_TRANSFER = 15,
+ TYPE_PROJECT_DATABASE_TRANSFER = "TYPE_PROJECT_DATABASE_TRANSFER",
/** TYPE_PROJECT_MEMBER_CREATE - TYPE_PROJECT_MEMBER_CREATE represents adding a member to the project. */
- TYPE_PROJECT_MEMBER_CREATE = 16,
+ TYPE_PROJECT_MEMBER_CREATE = "TYPE_PROJECT_MEMBER_CREATE",
/** TYPE_PROJECT_MEMBER_DELETE - TYPE_PROJECT_MEMBER_DELETE represents removing a member from the project. */
- TYPE_PROJECT_MEMBER_DELETE = 17,
+ TYPE_PROJECT_MEMBER_DELETE = "TYPE_PROJECT_MEMBER_DELETE",
/**
* TYPE_SQL_EDITOR_QUERY - SQL Editor related activity types.
* TYPE_SQL_EDITOR_QUERY represents executing query in SQL Editor.
*/
- TYPE_SQL_EDITOR_QUERY = 19,
- UNRECOGNIZED = -1,
+ TYPE_SQL_EDITOR_QUERY = "TYPE_SQL_EDITOR_QUERY",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function activity_TypeFromJSON(object: any): Activity_Type {
@@ -743,6 +837,58 @@ export function activity_TypeToJSON(object: Activity_Type): string {
}
}
+export function activity_TypeToNumber(object: Activity_Type): number {
+ switch (object) {
+ case Activity_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case Activity_Type.TYPE_NOTIFY_ISSUE_APPROVED:
+ return 23;
+ case Activity_Type.TYPE_NOTIFY_PIPELINE_ROLLOUT:
+ return 24;
+ case Activity_Type.TYPE_ISSUE_CREATE:
+ return 1;
+ case Activity_Type.TYPE_ISSUE_COMMENT_CREATE:
+ return 2;
+ case Activity_Type.TYPE_ISSUE_FIELD_UPDATE:
+ return 3;
+ case Activity_Type.TYPE_ISSUE_STATUS_UPDATE:
+ return 4;
+ case Activity_Type.TYPE_ISSUE_APPROVAL_NOTIFY:
+ return 21;
+ case Activity_Type.TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE:
+ return 5;
+ case Activity_Type.TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE:
+ return 6;
+ case Activity_Type.TYPE_ISSUE_PIPELINE_TASK_RUN_STATUS_UPDATE:
+ return 22;
+ case Activity_Type.TYPE_ISSUE_PIPELINE_TASK_STATEMENT_UPDATE:
+ return 8;
+ case Activity_Type.TYPE_ISSUE_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE:
+ return 9;
+ case Activity_Type.TYPE_MEMBER_CREATE:
+ return 10;
+ case Activity_Type.TYPE_MEMBER_ROLE_UPDATE:
+ return 11;
+ case Activity_Type.TYPE_MEMBER_ACTIVATE:
+ return 12;
+ case Activity_Type.TYPE_MEMBER_DEACTIVATE:
+ return 13;
+ case Activity_Type.TYPE_PROJECT_REPOSITORY_PUSH:
+ return 14;
+ case Activity_Type.TYPE_PROJECT_DATABASE_TRANSFER:
+ return 15;
+ case Activity_Type.TYPE_PROJECT_MEMBER_CREATE:
+ return 16;
+ case Activity_Type.TYPE_PROJECT_MEMBER_DELETE:
+ return 17;
+ case Activity_Type.TYPE_SQL_EDITOR_QUERY:
+ return 19;
+ case Activity_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface ListDatabaseGroupsRequest {
/**
* The parent resource whose database groups are to be listed.
@@ -1023,10 +1169,10 @@ export interface ProtectionRule {
/** The type of target. */
export enum ProtectionRule_Target {
- PROTECTION_TARGET_UNSPECIFIED = 0,
- BRANCH = 1,
- CHANGELIST = 2,
- UNRECOGNIZED = -1,
+ PROTECTION_TARGET_UNSPECIFIED = "PROTECTION_TARGET_UNSPECIFIED",
+ BRANCH = "BRANCH",
+ CHANGELIST = "CHANGELIST",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function protectionRule_TargetFromJSON(object: any): ProtectionRule_Target {
@@ -1061,10 +1207,24 @@ export function protectionRule_TargetToJSON(object: ProtectionRule_Target): stri
}
}
+export function protectionRule_TargetToNumber(object: ProtectionRule_Target): number {
+ switch (object) {
+ case ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED:
+ return 0;
+ case ProtectionRule_Target.BRANCH:
+ return 1;
+ case ProtectionRule_Target.CHANGELIST:
+ return 2;
+ case ProtectionRule_Target.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum ProtectionRule_BranchSource {
- BRANCH_SOURCE_UNSPECIFIED = 0,
- DATABASE = 1,
- UNRECOGNIZED = -1,
+ BRANCH_SOURCE_UNSPECIFIED = "BRANCH_SOURCE_UNSPECIFIED",
+ DATABASE = "DATABASE",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function protectionRule_BranchSourceFromJSON(object: any): ProtectionRule_BranchSource {
@@ -1094,6 +1254,18 @@ export function protectionRule_BranchSourceToJSON(object: ProtectionRule_BranchS
}
}
+export function protectionRule_BranchSourceToNumber(object: ProtectionRule_BranchSource): number {
+ switch (object) {
+ case ProtectionRule_BranchSource.BRANCH_SOURCE_UNSPECIFIED:
+ return 0;
+ case ProtectionRule_BranchSource.DATABASE:
+ return 1;
+ case ProtectionRule_BranchSource.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
function createBaseGetProjectRequest(): GetProjectRequest {
return { name: "" };
}
@@ -2178,11 +2350,11 @@ function createBaseProject(): Project {
return {
name: "",
uid: "",
- state: 0,
+ state: State.STATE_UNSPECIFIED,
title: "",
key: "",
- workflow: 0,
- tenantMode: 0,
+ workflow: Workflow.WORKFLOW_UNSPECIFIED,
+ tenantMode: TenantMode.TENANT_MODE_UNSPECIFIED,
webhooks: [],
dataClassificationConfigId: "",
};
@@ -2196,8 +2368,8 @@ export const Project = {
if (message.uid !== "") {
writer.uint32(18).string(message.uid);
}
- if (message.state !== 0) {
- writer.uint32(24).int32(message.state);
+ if (message.state !== State.STATE_UNSPECIFIED) {
+ writer.uint32(24).int32(stateToNumber(message.state));
}
if (message.title !== "") {
writer.uint32(34).string(message.title);
@@ -2205,11 +2377,11 @@ export const Project = {
if (message.key !== "") {
writer.uint32(42).string(message.key);
}
- if (message.workflow !== 0) {
- writer.uint32(48).int32(message.workflow);
+ if (message.workflow !== Workflow.WORKFLOW_UNSPECIFIED) {
+ writer.uint32(48).int32(workflowToNumber(message.workflow));
}
- if (message.tenantMode !== 0) {
- writer.uint32(64).int32(message.tenantMode);
+ if (message.tenantMode !== TenantMode.TENANT_MODE_UNSPECIFIED) {
+ writer.uint32(64).int32(tenantModeToNumber(message.tenantMode));
}
for (const v of message.webhooks) {
Webhook.encode(v!, writer.uint32(90).fork()).ldelim();
@@ -2246,7 +2418,7 @@ export const Project = {
break;
}
- message.state = reader.int32() as any;
+ message.state = stateFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -2267,14 +2439,14 @@ export const Project = {
break;
}
- message.workflow = reader.int32() as any;
+ message.workflow = workflowFromJSON(reader.int32());
continue;
case 8:
if (tag !== 64) {
break;
}
- message.tenantMode = reader.int32() as any;
+ message.tenantMode = tenantModeFromJSON(reader.int32());
continue;
case 11:
if (tag !== 90) {
@@ -2303,11 +2475,11 @@ export const Project = {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
- state: isSet(object.state) ? stateFromJSON(object.state) : 0,
+ state: isSet(object.state) ? stateFromJSON(object.state) : State.STATE_UNSPECIFIED,
title: isSet(object.title) ? globalThis.String(object.title) : "",
key: isSet(object.key) ? globalThis.String(object.key) : "",
- workflow: isSet(object.workflow) ? workflowFromJSON(object.workflow) : 0,
- tenantMode: isSet(object.tenantMode) ? tenantModeFromJSON(object.tenantMode) : 0,
+ workflow: isSet(object.workflow) ? workflowFromJSON(object.workflow) : Workflow.WORKFLOW_UNSPECIFIED,
+ tenantMode: isSet(object.tenantMode) ? tenantModeFromJSON(object.tenantMode) : TenantMode.TENANT_MODE_UNSPECIFIED,
webhooks: globalThis.Array.isArray(object?.webhooks) ? object.webhooks.map((e: any) => Webhook.fromJSON(e)) : [],
dataClassificationConfigId: isSet(object.dataClassificationConfigId)
? globalThis.String(object.dataClassificationConfigId)
@@ -2323,7 +2495,7 @@ export const Project = {
if (message.uid !== "") {
obj.uid = message.uid;
}
- if (message.state !== 0) {
+ if (message.state !== State.STATE_UNSPECIFIED) {
obj.state = stateToJSON(message.state);
}
if (message.title !== "") {
@@ -2332,10 +2504,10 @@ export const Project = {
if (message.key !== "") {
obj.key = message.key;
}
- if (message.workflow !== 0) {
+ if (message.workflow !== Workflow.WORKFLOW_UNSPECIFIED) {
obj.workflow = workflowToJSON(message.workflow);
}
- if (message.tenantMode !== 0) {
+ if (message.tenantMode !== TenantMode.TENANT_MODE_UNSPECIFIED) {
obj.tenantMode = tenantModeToJSON(message.tenantMode);
}
if (message.webhooks?.length) {
@@ -2354,11 +2526,11 @@ export const Project = {
const message = createBaseProject();
message.name = object.name ?? "";
message.uid = object.uid ?? "";
- message.state = object.state ?? 0;
+ message.state = object.state ?? State.STATE_UNSPECIFIED;
message.title = object.title ?? "";
message.key = object.key ?? "";
- message.workflow = object.workflow ?? 0;
- message.tenantMode = object.tenantMode ?? 0;
+ message.workflow = object.workflow ?? Workflow.WORKFLOW_UNSPECIFIED;
+ message.tenantMode = object.tenantMode ?? TenantMode.TENANT_MODE_UNSPECIFIED;
message.webhooks = object.webhooks?.map((e) => Webhook.fromPartial(e)) || [];
message.dataClassificationConfigId = object.dataClassificationConfigId ?? "";
return message;
@@ -2710,7 +2882,7 @@ export const TestWebhookResponse = {
};
function createBaseWebhook(): Webhook {
- return { name: "", type: 0, title: "", url: "", notificationTypes: [] };
+ return { name: "", type: Webhook_Type.TYPE_UNSPECIFIED, title: "", url: "", notificationTypes: [] };
}
export const Webhook = {
@@ -2718,8 +2890,8 @@ export const Webhook = {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
- if (message.type !== 0) {
- writer.uint32(16).int32(message.type);
+ if (message.type !== Webhook_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(16).int32(webhook_TypeToNumber(message.type));
}
if (message.title !== "") {
writer.uint32(26).string(message.title);
@@ -2729,7 +2901,7 @@ export const Webhook = {
}
writer.uint32(42).fork();
for (const v of message.notificationTypes) {
- writer.int32(v);
+ writer.int32(activity_TypeToNumber(v));
}
writer.ldelim();
return writer;
@@ -2754,7 +2926,7 @@ export const Webhook = {
break;
}
- message.type = reader.int32() as any;
+ message.type = webhook_TypeFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -2772,7 +2944,7 @@ export const Webhook = {
continue;
case 5:
if (tag === 40) {
- message.notificationTypes.push(reader.int32() as any);
+ message.notificationTypes.push(activity_TypeFromJSON(reader.int32()));
continue;
}
@@ -2780,7 +2952,7 @@ export const Webhook = {
if (tag === 42) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
- message.notificationTypes.push(reader.int32() as any);
+ message.notificationTypes.push(activity_TypeFromJSON(reader.int32()));
}
continue;
@@ -2799,7 +2971,7 @@ export const Webhook = {
fromJSON(object: any): Webhook {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
- type: isSet(object.type) ? webhook_TypeFromJSON(object.type) : 0,
+ 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) : "",
notificationTypes: globalThis.Array.isArray(object?.notificationTypes)
@@ -2813,7 +2985,7 @@ export const Webhook = {
if (message.name !== "") {
obj.name = message.name;
}
- if (message.type !== 0) {
+ if (message.type !== Webhook_Type.TYPE_UNSPECIFIED) {
obj.type = webhook_TypeToJSON(message.type);
}
if (message.title !== "") {
@@ -2834,7 +3006,7 @@ export const Webhook = {
fromPartial(object: DeepPartial<Webhook>): Webhook {
const message = createBaseWebhook();
message.name = object.name ?? "";
- message.type = object.type ?? 0;
+ message.type = object.type ?? Webhook_Type.TYPE_UNSPECIFIED;
message.title = object.title ?? "";
message.url = object.url ?? "";
message.notificationTypes = object.notificationTypes?.map((e) => e) || [];
@@ -3191,7 +3363,7 @@ export const LabelSelector = {
};
function createBaseLabelSelectorRequirement(): LabelSelectorRequirement {
- return { key: "", operator: 0, values: [] };
+ return { key: "", operator: OperatorType.OPERATOR_TYPE_UNSPECIFIED, values: [] };
}
export const LabelSelectorRequirement = {
@@ -3199,8 +3371,8 @@ export const LabelSelectorRequirement = {
if (message.key !== "") {
writer.uint32(10).string(message.key);
}
- if (message.operator !== 0) {
- writer.uint32(16).int32(message.operator);
+ if (message.operator !== OperatorType.OPERATOR_TYPE_UNSPECIFIED) {
+ writer.uint32(16).int32(operatorTypeToNumber(message.operator));
}
for (const v of message.values) {
writer.uint32(26).string(v!);
@@ -3227,7 +3399,7 @@ export const LabelSelectorRequirement = {
break;
}
- message.operator = reader.int32() as any;
+ message.operator = operatorTypeFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -3248,7 +3420,7 @@ export const LabelSelectorRequirement = {
fromJSON(object: any): LabelSelectorRequirement {
return {
key: isSet(object.key) ? globalThis.String(object.key) : "",
- operator: isSet(object.operator) ? operatorTypeFromJSON(object.operator) : 0,
+ operator: isSet(object.operator) ? operatorTypeFromJSON(object.operator) : OperatorType.OPERATOR_TYPE_UNSPECIFIED,
values: globalThis.Array.isArray(object?.values) ? object.values.map((e: any) => globalThis.String(e)) : [],
};
},
@@ -3258,7 +3430,7 @@ export const LabelSelectorRequirement = {
if (message.key !== "") {
obj.key = message.key;
}
- if (message.operator !== 0) {
+ if (message.operator !== OperatorType.OPERATOR_TYPE_UNSPECIFIED) {
obj.operator = operatorTypeToJSON(message.operator);
}
if (message.values?.length) {
@@ -3273,7 +3445,7 @@ export const LabelSelectorRequirement = {
fromPartial(object: DeepPartial<LabelSelectorRequirement>): LabelSelectorRequirement {
const message = createBaseLabelSelectorRequirement();
message.key = object.key ?? "";
- message.operator = object.operator ?? 0;
+ message.operator = object.operator ?? OperatorType.OPERATOR_TYPE_UNSPECIFIED;
message.values = object.values?.map((e) => e) || [];
return message;
},
@@ -3488,7 +3660,7 @@ export const ListDatabaseGroupsResponse = {
};
function createBaseGetDatabaseGroupRequest(): GetDatabaseGroupRequest {
- return { name: "", view: 0 };
+ return { name: "", view: DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED };
}
export const GetDatabaseGroupRequest = {
@@ -3496,8 +3668,8 @@ export const GetDatabaseGroupRequest = {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
- if (message.view !== 0) {
- writer.uint32(16).int32(message.view);
+ if (message.view !== DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED) {
+ writer.uint32(16).int32(databaseGroupViewToNumber(message.view));
}
return writer;
},
@@ -3521,7 +3693,7 @@ export const GetDatabaseGroupRequest = {
break;
}
- message.view = reader.int32() as any;
+ message.view = databaseGroupViewFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -3535,7 +3707,9 @@ export const GetDatabaseGroupRequest = {
fromJSON(object: any): GetDatabaseGroupRequest {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
- view: isSet(object.view) ? databaseGroupViewFromJSON(object.view) : 0,
+ view: isSet(object.view)
+ ? databaseGroupViewFromJSON(object.view)
+ : DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED,
};
},
@@ -3544,7 +3718,7 @@ export const GetDatabaseGroupRequest = {
if (message.name !== "") {
obj.name = message.name;
}
- if (message.view !== 0) {
+ if (message.view !== DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED) {
obj.view = databaseGroupViewToJSON(message.view);
}
return obj;
@@ -3556,7 +3730,7 @@ export const GetDatabaseGroupRequest = {
fromPartial(object: DeepPartial<GetDatabaseGroupRequest>): GetDatabaseGroupRequest {
const message = createBaseGetDatabaseGroupRequest();
message.name = object.name ?? "";
- message.view = object.view ?? 0;
+ message.view = object.view ?? DatabaseGroupView.DATABASE_GROUP_VIEW_UNSPECIFIED;
return message;
},
};
@@ -4387,7 +4561,7 @@ export const ListSchemaGroupsResponse = {
};
function createBaseGetSchemaGroupRequest(): GetSchemaGroupRequest {
- return { name: "", view: 0 };
+ return { name: "", view: SchemaGroupView.SCHEMA_GROUP_VIEW_UNSPECIFIED };
}
export const GetSchemaGroupRequest = {
@@ -4395,8 +4569,8 @@ export const GetSchemaGroupRequest = {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
- if (message.view !== 0) {
- writer.uint32(16).int32(message.view);
+ if (message.view !== SchemaGroupView.SCHEMA_GROUP_VIEW_UNSPECIFIED) {
+ writer.uint32(16).int32(schemaGroupViewToNumber(message.view));
}
return writer;
},
@@ -4420,7 +4594,7 @@ export const GetSchemaGroupRequest = {
break;
}
- message.view = reader.int32() as any;
+ message.view = schemaGroupViewFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -4434,7 +4608,7 @@ export const GetSchemaGroupRequest = {
fromJSON(object: any): GetSchemaGroupRequest {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
- view: isSet(object.view) ? schemaGroupViewFromJSON(object.view) : 0,
+ view: isSet(object.view) ? schemaGroupViewFromJSON(object.view) : SchemaGroupView.SCHEMA_GROUP_VIEW_UNSPECIFIED,
};
},
@@ -4443,7 +4617,7 @@ export const GetSchemaGroupRequest = {
if (message.name !== "") {
obj.name = message.name;
}
- if (message.view !== 0) {
+ if (message.view !== SchemaGroupView.SCHEMA_GROUP_VIEW_UNSPECIFIED) {
obj.view = schemaGroupViewToJSON(message.view);
}
return obj;
@@ -4455,7 +4629,7 @@ export const GetSchemaGroupRequest = {
fromPartial(object: DeepPartial<GetSchemaGroupRequest>): GetSchemaGroupRequest {
const message = createBaseGetSchemaGroupRequest();
message.name = object.name ?? "";
- message.view = object.view ?? 0;
+ message.view = object.view ?? SchemaGroupView.SCHEMA_GROUP_VIEW_UNSPECIFIED;
return message;
},
};
@@ -4867,7 +5041,13 @@ export const ProtectionRules = {
};
function createBaseProtectionRule(): ProtectionRule {
- return { id: "", target: 0, nameFilter: "", allowedRoles: [], branchSource: 0 };
+ return {
+ id: "",
+ target: ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED,
+ nameFilter: "",
+ allowedRoles: [],
+ branchSource: ProtectionRule_BranchSource.BRANCH_SOURCE_UNSPECIFIED,
+ };
}
export const ProtectionRule = {
@@ -4875,8 +5055,8 @@ export const ProtectionRule = {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
- if (message.target !== 0) {
- writer.uint32(16).int32(message.target);
+ if (message.target !== ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED) {
+ writer.uint32(16).int32(protectionRule_TargetToNumber(message.target));
}
if (message.nameFilter !== "") {
writer.uint32(26).string(message.nameFilter);
@@ -4884,8 +5064,8 @@ export const ProtectionRule = {
for (const v of message.allowedRoles) {
writer.uint32(34).string(v!);
}
- if (message.branchSource !== 0) {
- writer.uint32(40).int32(message.branchSource);
+ if (message.branchSource !== ProtectionRule_BranchSource.BRANCH_SOURCE_UNSPECIFIED) {
+ writer.uint32(40).int32(protectionRule_BranchSourceToNumber(message.branchSource));
}
return writer;
},
@@ -4909,7 +5089,7 @@ export const ProtectionRule = {
break;
}
- message.target = reader.int32() as any;
+ message.target = protectionRule_TargetFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -4930,7 +5110,7 @@ export const ProtectionRule = {
break;
}
- message.branchSource = reader.int32() as any;
+ message.branchSource = protectionRule_BranchSourceFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -4944,12 +5124,16 @@ export const ProtectionRule = {
fromJSON(object: any): ProtectionRule {
return {
id: isSet(object.id) ? globalThis.String(object.id) : "",
- target: isSet(object.target) ? protectionRule_TargetFromJSON(object.target) : 0,
+ target: isSet(object.target)
+ ? protectionRule_TargetFromJSON(object.target)
+ : ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED,
nameFilter: isSet(object.nameFilter) ? globalThis.String(object.nameFilter) : "",
allowedRoles: globalThis.Array.isArray(object?.allowedRoles)
? object.allowedRoles.map((e: any) => globalThis.String(e))
: [],
- branchSource: isSet(object.branchSource) ? protectionRule_BranchSourceFromJSON(object.branchSource) : 0,
+ branchSource: isSet(object.branchSource)
+ ? protectionRule_BranchSourceFromJSON(object.branchSource)
+ : ProtectionRule_BranchSource.BRANCH_SOURCE_UNSPECIFIED,
};
},
@@ -4958,7 +5142,7 @@ export const ProtectionRule = {
if (message.id !== "") {
obj.id = message.id;
}
- if (message.target !== 0) {
+ if (message.target !== ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED) {
obj.target = protectionRule_TargetToJSON(message.target);
}
if (message.nameFilter !== "") {
@@ -4967,7 +5151,7 @@ export const ProtectionRule = {
if (message.allowedRoles?.length) {
obj.allowedRoles = message.allowedRoles;
}
- if (message.branchSource !== 0) {
+ if (message.branchSource !== ProtectionRule_BranchSource.BRANCH_SOURCE_UNSPECIFIED) {
obj.branchSource = protectionRule_BranchSourceToJSON(message.branchSource);
}
return obj;
@@ -4979,10 +5163,10 @@ export const ProtectionRule = {
fromPartial(object: DeepPartial<ProtectionRule>): ProtectionRule {
const message = createBaseProtectionRule();
message.id = object.id ?? "";
- message.target = object.target ?? 0;
+ message.target = object.target ?? ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED;
message.nameFilter = object.nameFilter ?? "";
message.allowedRoles = object.allowedRoles?.map((e) => e) || [];
- message.branchSource = object.branchSource ?? 0;
+ message.branchSource = object.branchSource ?? ProtectionRule_BranchSource.BRANCH_SOURCE_UNSPECIFIED;
return message;
},
};
diff --git a/frontend/src/types/proto/v1/risk_service.ts b/frontend/src/types/proto/v1/risk_service.ts
index 0bae491426..f2733331c9 100644
--- a/frontend/src/types/proto/v1/risk_service.ts
+++ b/frontend/src/types/proto/v1/risk_service.ts
@@ -74,14 +74,14 @@ export interface Risk {
}
export enum Risk_Source {
- SOURCE_UNSPECIFIED = 0,
- DDL = 1,
- DML = 2,
- CREATE_DATABASE = 3,
- REQUEST_QUERY = 4,
- REQUEST_EXPORT = 5,
- DATA_EXPORT = 6,
- UNRECOGNIZED = -1,
+ SOURCE_UNSPECIFIED = "SOURCE_UNSPECIFIED",
+ DDL = "DDL",
+ DML = "DML",
+ CREATE_DATABASE = "CREATE_DATABASE",
+ REQUEST_QUERY = "REQUEST_QUERY",
+ REQUEST_EXPORT = "REQUEST_EXPORT",
+ DATA_EXPORT = "DATA_EXPORT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function risk_SourceFromJSON(object: any): Risk_Source {
@@ -136,6 +136,28 @@ export function risk_SourceToJSON(object: Risk_Source): string {
}
}
+export function risk_SourceToNumber(object: Risk_Source): number {
+ switch (object) {
+ case Risk_Source.SOURCE_UNSPECIFIED:
+ return 0;
+ case Risk_Source.DDL:
+ return 1;
+ case Risk_Source.DML:
+ return 2;
+ case Risk_Source.CREATE_DATABASE:
+ return 3;
+ case Risk_Source.REQUEST_QUERY:
+ return 4;
+ case Risk_Source.REQUEST_EXPORT:
+ return 5;
+ case Risk_Source.DATA_EXPORT:
+ return 6;
+ case Risk_Source.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
function createBaseListRisksRequest(): ListRisksRequest {
return { pageSize: 0, pageToken: "" };
}
@@ -473,7 +495,15 @@ export const DeleteRiskRequest = {
};
function createBaseRisk(): Risk {
- return { name: "", uid: "", source: 0, title: "", level: 0, active: false, condition: undefined };
+ return {
+ name: "",
+ uid: "",
+ source: Risk_Source.SOURCE_UNSPECIFIED,
+ title: "",
+ level: 0,
+ active: false,
+ condition: undefined,
+ };
}
export const Risk = {
@@ -484,8 +514,8 @@ export const Risk = {
if (message.uid !== "") {
writer.uint32(18).string(message.uid);
}
- if (message.source !== 0) {
- writer.uint32(24).int32(message.source);
+ if (message.source !== Risk_Source.SOURCE_UNSPECIFIED) {
+ writer.uint32(24).int32(risk_SourceToNumber(message.source));
}
if (message.title !== "") {
writer.uint32(34).string(message.title);
@@ -528,7 +558,7 @@ export const Risk = {
break;
}
- message.source = reader.int32() as any;
+ message.source = risk_SourceFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -571,7 +601,7 @@ export const Risk = {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
- source: isSet(object.source) ? risk_SourceFromJSON(object.source) : 0,
+ 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,
@@ -587,7 +617,7 @@ export const Risk = {
if (message.uid !== "") {
obj.uid = message.uid;
}
- if (message.source !== 0) {
+ if (message.source !== Risk_Source.SOURCE_UNSPECIFIED) {
obj.source = risk_SourceToJSON(message.source);
}
if (message.title !== "") {
@@ -612,7 +642,7 @@ export const Risk = {
const message = createBaseRisk();
message.name = object.name ?? "";
message.uid = object.uid ?? "";
- message.source = object.source ?? 0;
+ message.source = object.source ?? Risk_Source.SOURCE_UNSPECIFIED;
message.title = object.title ?? "";
message.level = object.level ?? 0;
message.active = object.active ?? false;
diff --git a/frontend/src/types/proto/v1/rollout_service.ts b/frontend/src/types/proto/v1/rollout_service.ts
index f1ec976bc4..83ade9ea29 100644
--- a/frontend/src/types/proto/v1/rollout_service.ts
+++ b/frontend/src/types/proto/v1/rollout_service.ts
@@ -7,9 +7,11 @@ import {
ExportFormat,
exportFormatFromJSON,
exportFormatToJSON,
+ exportFormatToNumber,
VCSType,
vCSTypeFromJSON,
vCSTypeToJSON,
+ vCSTypeToNumber,
} from "./common";
import { ChangedResources } from "./database_service";
@@ -194,22 +196,22 @@ export interface Plan_ChangeDatabaseConfig {
/** Type is the database change type. */
export enum Plan_ChangeDatabaseConfig_Type {
- TYPE_UNSPECIFIED = 0,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
/**
* BASELINE - Used for establishing schema baseline, this is used when
* 1. Onboard the database into Bytebase since Bytebase needs to know the current database schema.
* 2. Had schema drift and need to re-establish the baseline.
*/
- BASELINE = 1,
+ BASELINE = "BASELINE",
/** MIGRATE - Used for DDL changes including CREATE DATABASE. */
- MIGRATE = 2,
+ MIGRATE = "MIGRATE",
/** MIGRATE_SDL - Used for schema changes via state-based schema migration including CREATE DATABASE. */
- MIGRATE_SDL = 3,
+ MIGRATE_SDL = "MIGRATE_SDL",
/** MIGRATE_GHOST - Used for DDL changes using gh-ost. */
- MIGRATE_GHOST = 4,
+ MIGRATE_GHOST = "MIGRATE_GHOST",
/** DATA - Used for DML change. */
- DATA = 6,
- UNRECOGNIZED = -1,
+ DATA = "DATA",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function plan_ChangeDatabaseConfig_TypeFromJSON(object: any): Plan_ChangeDatabaseConfig_Type {
@@ -259,6 +261,26 @@ export function plan_ChangeDatabaseConfig_TypeToJSON(object: Plan_ChangeDatabase
}
}
+export function plan_ChangeDatabaseConfig_TypeToNumber(object: Plan_ChangeDatabaseConfig_Type): number {
+ switch (object) {
+ case Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case Plan_ChangeDatabaseConfig_Type.BASELINE:
+ return 1;
+ case Plan_ChangeDatabaseConfig_Type.MIGRATE:
+ return 2;
+ case Plan_ChangeDatabaseConfig_Type.MIGRATE_SDL:
+ return 3;
+ case Plan_ChangeDatabaseConfig_Type.MIGRATE_GHOST:
+ return 4;
+ case Plan_ChangeDatabaseConfig_Type.DATA:
+ return 6;
+ case Plan_ChangeDatabaseConfig_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface Plan_ChangeDatabaseConfig_RollbackDetail {
/**
* rollback_from_task is the task from which the rollback SQL statement is generated for this task.
@@ -430,15 +452,15 @@ export interface PlanCheckRun {
}
export enum PlanCheckRun_Type {
- TYPE_UNSPECIFIED = 0,
- DATABASE_STATEMENT_FAKE_ADVISE = 1,
- DATABASE_STATEMENT_COMPATIBILITY = 2,
- DATABASE_STATEMENT_ADVISE = 3,
- DATABASE_STATEMENT_TYPE = 4,
- DATABASE_STATEMENT_SUMMARY_REPORT = 5,
- DATABASE_CONNECT = 6,
- DATABASE_GHOST_SYNC = 7,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ DATABASE_STATEMENT_FAKE_ADVISE = "DATABASE_STATEMENT_FAKE_ADVISE",
+ DATABASE_STATEMENT_COMPATIBILITY = "DATABASE_STATEMENT_COMPATIBILITY",
+ DATABASE_STATEMENT_ADVISE = "DATABASE_STATEMENT_ADVISE",
+ DATABASE_STATEMENT_TYPE = "DATABASE_STATEMENT_TYPE",
+ DATABASE_STATEMENT_SUMMARY_REPORT = "DATABASE_STATEMENT_SUMMARY_REPORT",
+ DATABASE_CONNECT = "DATABASE_CONNECT",
+ DATABASE_GHOST_SYNC = "DATABASE_GHOST_SYNC",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function planCheckRun_TypeFromJSON(object: any): PlanCheckRun_Type {
@@ -498,13 +520,37 @@ export function planCheckRun_TypeToJSON(object: PlanCheckRun_Type): string {
}
}
+export function planCheckRun_TypeToNumber(object: PlanCheckRun_Type): number {
+ switch (object) {
+ case PlanCheckRun_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case PlanCheckRun_Type.DATABASE_STATEMENT_FAKE_ADVISE:
+ return 1;
+ case PlanCheckRun_Type.DATABASE_STATEMENT_COMPATIBILITY:
+ return 2;
+ case PlanCheckRun_Type.DATABASE_STATEMENT_ADVISE:
+ return 3;
+ case PlanCheckRun_Type.DATABASE_STATEMENT_TYPE:
+ return 4;
+ case PlanCheckRun_Type.DATABASE_STATEMENT_SUMMARY_REPORT:
+ return 5;
+ case PlanCheckRun_Type.DATABASE_CONNECT:
+ return 6;
+ case PlanCheckRun_Type.DATABASE_GHOST_SYNC:
+ return 7;
+ case PlanCheckRun_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum PlanCheckRun_Status {
- STATUS_UNSPECIFIED = 0,
- RUNNING = 1,
- DONE = 2,
- FAILED = 3,
- CANCELED = 4,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ RUNNING = "RUNNING",
+ DONE = "DONE",
+ FAILED = "FAILED",
+ CANCELED = "CANCELED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function planCheckRun_StatusFromJSON(object: any): PlanCheckRun_Status {
@@ -549,6 +595,24 @@ export function planCheckRun_StatusToJSON(object: PlanCheckRun_Status): string {
}
}
+export function planCheckRun_StatusToNumber(object: PlanCheckRun_Status): number {
+ switch (object) {
+ case PlanCheckRun_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case PlanCheckRun_Status.RUNNING:
+ return 1;
+ case PlanCheckRun_Status.DONE:
+ return 2;
+ case PlanCheckRun_Status.FAILED:
+ return 3;
+ case PlanCheckRun_Status.CANCELED:
+ return 4;
+ case PlanCheckRun_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface PlanCheckRun_Result {
status: PlanCheckRun_Result_Status;
title: string;
@@ -559,11 +623,11 @@ export interface PlanCheckRun_Result {
}
export enum PlanCheckRun_Result_Status {
- STATUS_UNSPECIFIED = 0,
- ERROR = 1,
- WARNING = 2,
- SUCCESS = 3,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ ERROR = "ERROR",
+ WARNING = "WARNING",
+ SUCCESS = "SUCCESS",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function planCheckRun_Result_StatusFromJSON(object: any): PlanCheckRun_Result_Status {
@@ -603,6 +667,22 @@ export function planCheckRun_Result_StatusToJSON(object: PlanCheckRun_Result_Sta
}
}
+export function planCheckRun_Result_StatusToNumber(object: PlanCheckRun_Result_Status): number {
+ switch (object) {
+ case PlanCheckRun_Result_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case PlanCheckRun_Result_Status.ERROR:
+ return 1;
+ case PlanCheckRun_Result_Status.WARNING:
+ return 2;
+ case PlanCheckRun_Result_Status.SUCCESS:
+ return 3;
+ case PlanCheckRun_Result_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface PlanCheckRun_Result_SqlSummaryReport {
code: number;
/** statement_types are the types of statements that are found in the sql. */
@@ -738,15 +818,15 @@ export interface Task {
}
export enum Task_Status {
- STATUS_UNSPECIFIED = 0,
- NOT_STARTED = 1,
- PENDING = 2,
- RUNNING = 3,
- DONE = 4,
- FAILED = 5,
- CANCELED = 6,
- SKIPPED = 7,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ NOT_STARTED = "NOT_STARTED",
+ PENDING = "PENDING",
+ RUNNING = "RUNNING",
+ DONE = "DONE",
+ FAILED = "FAILED",
+ CANCELED = "CANCELED",
+ SKIPPED = "SKIPPED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function task_StatusFromJSON(object: any): Task_Status {
@@ -806,26 +886,50 @@ export function task_StatusToJSON(object: Task_Status): string {
}
}
+export function task_StatusToNumber(object: Task_Status): number {
+ switch (object) {
+ case Task_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case Task_Status.NOT_STARTED:
+ return 1;
+ case Task_Status.PENDING:
+ return 2;
+ case Task_Status.RUNNING:
+ return 3;
+ case Task_Status.DONE:
+ return 4;
+ case Task_Status.FAILED:
+ return 5;
+ case Task_Status.CANCELED:
+ return 6;
+ case Task_Status.SKIPPED:
+ return 7;
+ case Task_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum Task_Type {
- TYPE_UNSPECIFIED = 0,
- GENERAL = 1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ GENERAL = "GENERAL",
/** DATABASE_CREATE - use payload DatabaseCreate */
- DATABASE_CREATE = 2,
+ DATABASE_CREATE = "DATABASE_CREATE",
/** DATABASE_SCHEMA_BASELINE - use payload DatabaseSchemaBaseline */
- DATABASE_SCHEMA_BASELINE = 3,
+ DATABASE_SCHEMA_BASELINE = "DATABASE_SCHEMA_BASELINE",
/** DATABASE_SCHEMA_UPDATE - use payload DatabaseSchemaUpdate */
- DATABASE_SCHEMA_UPDATE = 4,
+ DATABASE_SCHEMA_UPDATE = "DATABASE_SCHEMA_UPDATE",
/** DATABASE_SCHEMA_UPDATE_SDL - use payload DatabaseSchemaUpdate */
- DATABASE_SCHEMA_UPDATE_SDL = 5,
+ DATABASE_SCHEMA_UPDATE_SDL = "DATABASE_SCHEMA_UPDATE_SDL",
/** DATABASE_SCHEMA_UPDATE_GHOST_SYNC - use payload DatabaseSchemaUpdate */
- DATABASE_SCHEMA_UPDATE_GHOST_SYNC = 6,
+ DATABASE_SCHEMA_UPDATE_GHOST_SYNC = "DATABASE_SCHEMA_UPDATE_GHOST_SYNC",
/** DATABASE_SCHEMA_UPDATE_GHOST_CUTOVER - use payload nil */
- DATABASE_SCHEMA_UPDATE_GHOST_CUTOVER = 7,
+ DATABASE_SCHEMA_UPDATE_GHOST_CUTOVER = "DATABASE_SCHEMA_UPDATE_GHOST_CUTOVER",
/** DATABASE_DATA_UPDATE - use payload DatabaseDataUpdate */
- DATABASE_DATA_UPDATE = 8,
+ DATABASE_DATA_UPDATE = "DATABASE_DATA_UPDATE",
/** DATABASE_DATA_EXPORT - use payload DatabaseDataExport */
- DATABASE_DATA_EXPORT = 12,
- UNRECOGNIZED = -1,
+ DATABASE_DATA_EXPORT = "DATABASE_DATA_EXPORT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function task_TypeFromJSON(object: any): Task_Type {
@@ -895,6 +999,34 @@ export function task_TypeToJSON(object: Task_Type): string {
}
}
+export function task_TypeToNumber(object: Task_Type): number {
+ switch (object) {
+ case Task_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case Task_Type.GENERAL:
+ return 1;
+ case Task_Type.DATABASE_CREATE:
+ return 2;
+ case Task_Type.DATABASE_SCHEMA_BASELINE:
+ return 3;
+ case Task_Type.DATABASE_SCHEMA_UPDATE:
+ return 4;
+ case Task_Type.DATABASE_SCHEMA_UPDATE_SDL:
+ return 5;
+ case Task_Type.DATABASE_SCHEMA_UPDATE_GHOST_SYNC:
+ return 6;
+ case Task_Type.DATABASE_SCHEMA_UPDATE_GHOST_CUTOVER:
+ return 7;
+ case Task_Type.DATABASE_DATA_UPDATE:
+ return 8;
+ case Task_Type.DATABASE_DATA_EXPORT:
+ return 12;
+ case Task_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface Task_DatabaseCreate {
/**
* The project owning the database.
@@ -958,11 +1090,11 @@ export interface Task_DatabaseDataUpdate {
}
export enum Task_DatabaseDataUpdate_RollbackSqlStatus {
- ROLLBACK_SQL_STATUS_UNSPECIFIED = 0,
- PENDING = 1,
- DONE = 2,
- FAILED = 3,
- UNRECOGNIZED = -1,
+ ROLLBACK_SQL_STATUS_UNSPECIFIED = "ROLLBACK_SQL_STATUS_UNSPECIFIED",
+ PENDING = "PENDING",
+ DONE = "DONE",
+ FAILED = "FAILED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function task_DatabaseDataUpdate_RollbackSqlStatusFromJSON(
@@ -1006,6 +1138,24 @@ export function task_DatabaseDataUpdate_RollbackSqlStatusToJSON(
}
}
+export function task_DatabaseDataUpdate_RollbackSqlStatusToNumber(
+ object: Task_DatabaseDataUpdate_RollbackSqlStatus,
+): number {
+ switch (object) {
+ case Task_DatabaseDataUpdate_RollbackSqlStatus.ROLLBACK_SQL_STATUS_UNSPECIFIED:
+ return 0;
+ case Task_DatabaseDataUpdate_RollbackSqlStatus.PENDING:
+ return 1;
+ case Task_DatabaseDataUpdate_RollbackSqlStatus.DONE:
+ return 2;
+ case Task_DatabaseDataUpdate_RollbackSqlStatus.FAILED:
+ return 3;
+ case Task_DatabaseDataUpdate_RollbackSqlStatus.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface Task_DatabaseDataExport {
/**
* The resource name of the target.
@@ -1056,13 +1206,13 @@ export interface TaskRun {
}
export enum TaskRun_Status {
- STATUS_UNSPECIFIED = 0,
- PENDING = 1,
- RUNNING = 2,
- DONE = 3,
- FAILED = 4,
- CANCELED = 5,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ PENDING = "PENDING",
+ RUNNING = "RUNNING",
+ DONE = "DONE",
+ FAILED = "FAILED",
+ CANCELED = "CANCELED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function taskRun_StatusFromJSON(object: any): TaskRun_Status {
@@ -1112,12 +1262,32 @@ export function taskRun_StatusToJSON(object: TaskRun_Status): string {
}
}
+export function taskRun_StatusToNumber(object: TaskRun_Status): number {
+ switch (object) {
+ case TaskRun_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case TaskRun_Status.PENDING:
+ return 1;
+ case TaskRun_Status.RUNNING:
+ return 2;
+ case TaskRun_Status.DONE:
+ return 3;
+ case TaskRun_Status.FAILED:
+ return 4;
+ case TaskRun_Status.CANCELED:
+ return 5;
+ case TaskRun_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum TaskRun_ExecutionStatus {
- EXECUTION_STATUS_UNSPECIFIED = 0,
- PRE_EXECUTING = 1,
- EXECUTING = 2,
- POST_EXECUTING = 3,
- UNRECOGNIZED = -1,
+ EXECUTION_STATUS_UNSPECIFIED = "EXECUTION_STATUS_UNSPECIFIED",
+ PRE_EXECUTING = "PRE_EXECUTING",
+ EXECUTING = "EXECUTING",
+ POST_EXECUTING = "POST_EXECUTING",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function taskRun_ExecutionStatusFromJSON(object: any): TaskRun_ExecutionStatus {
@@ -1157,11 +1327,27 @@ export function taskRun_ExecutionStatusToJSON(object: TaskRun_ExecutionStatus):
}
}
+export function taskRun_ExecutionStatusToNumber(object: TaskRun_ExecutionStatus): number {
+ switch (object) {
+ case TaskRun_ExecutionStatus.EXECUTION_STATUS_UNSPECIFIED:
+ return 0;
+ case TaskRun_ExecutionStatus.PRE_EXECUTING:
+ return 1;
+ case TaskRun_ExecutionStatus.EXECUTING:
+ return 2;
+ case TaskRun_ExecutionStatus.POST_EXECUTING:
+ return 3;
+ case TaskRun_ExecutionStatus.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export enum TaskRun_ExportArchiveStatus {
- EXPORT_ARCHIVE_STATUS_UNSPECIFIED = 0,
- READY = 1,
- EXPORTED = 2,
- UNRECOGNIZED = -1,
+ EXPORT_ARCHIVE_STATUS_UNSPECIFIED = "EXPORT_ARCHIVE_STATUS_UNSPECIFIED",
+ READY = "READY",
+ EXPORTED = "EXPORTED",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function taskRun_ExportArchiveStatusFromJSON(object: any): TaskRun_ExportArchiveStatus {
@@ -1196,6 +1382,20 @@ export function taskRun_ExportArchiveStatusToJSON(object: TaskRun_ExportArchiveS
}
}
+export function taskRun_ExportArchiveStatusToNumber(object: TaskRun_ExportArchiveStatus): number {
+ switch (object) {
+ case TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED:
+ return 0;
+ case TaskRun_ExportArchiveStatus.READY:
+ return 1;
+ case TaskRun_ExportArchiveStatus.EXPORTED:
+ return 2;
+ case TaskRun_ExportArchiveStatus.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface TaskRun_ExecutionDetail {
/** Currently, the following fields are only used for EXECUTING status. */
commandsTotal: number;
@@ -2287,7 +2487,7 @@ function createBasePlan_ChangeDatabaseConfig(): Plan_ChangeDatabaseConfig {
return {
target: "",
sheet: "",
- type: 0,
+ type: Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED,
schemaVersion: "",
rollbackEnabled: false,
rollbackDetail: undefined,
@@ -2304,8 +2504,8 @@ export const Plan_ChangeDatabaseConfig = {
if (message.sheet !== "") {
writer.uint32(18).string(message.sheet);
}
- if (message.type !== 0) {
- writer.uint32(24).int32(message.type);
+ if (message.type !== Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(24).int32(plan_ChangeDatabaseConfig_TypeToNumber(message.type));
}
if (message.schemaVersion !== "") {
writer.uint32(34).string(message.schemaVersion);
@@ -2352,7 +2552,7 @@ export const Plan_ChangeDatabaseConfig = {
break;
}
- message.type = reader.int32() as any;
+ message.type = plan_ChangeDatabaseConfig_TypeFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -2408,7 +2608,9 @@ export const Plan_ChangeDatabaseConfig = {
return {
target: isSet(object.target) ? globalThis.String(object.target) : "",
sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- type: isSet(object.type) ? plan_ChangeDatabaseConfig_TypeFromJSON(object.type) : 0,
+ type: isSet(object.type)
+ ? plan_ChangeDatabaseConfig_TypeFromJSON(object.type)
+ : Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED,
schemaVersion: isSet(object.schemaVersion) ? globalThis.String(object.schemaVersion) : "",
rollbackEnabled: isSet(object.rollbackEnabled) ? globalThis.Boolean(object.rollbackEnabled) : false,
rollbackDetail: isSet(object.rollbackDetail)
@@ -2434,7 +2636,7 @@ export const Plan_ChangeDatabaseConfig = {
if (message.sheet !== "") {
obj.sheet = message.sheet;
}
- if (message.type !== 0) {
+ if (message.type !== Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED) {
obj.type = plan_ChangeDatabaseConfig_TypeToJSON(message.type);
}
if (message.schemaVersion !== "") {
@@ -2468,7 +2670,7 @@ export const Plan_ChangeDatabaseConfig = {
const message = createBasePlan_ChangeDatabaseConfig();
message.target = object.target ?? "";
message.sheet = object.sheet ?? "";
- message.type = object.type ?? 0;
+ message.type = object.type ?? Plan_ChangeDatabaseConfig_Type.TYPE_UNSPECIFIED;
message.schemaVersion = object.schemaVersion ?? "";
message.rollbackEnabled = object.rollbackEnabled ?? false;
message.rollbackDetail = (object.rollbackDetail !== undefined && object.rollbackDetail !== null)
@@ -2706,7 +2908,7 @@ export const Plan_ChangeDatabaseConfig_PreUpdateBackupDetail = {
};
function createBasePlan_ExportDataConfig(): Plan_ExportDataConfig {
- return { target: "", sheet: "", format: 0, password: undefined };
+ return { target: "", sheet: "", format: ExportFormat.FORMAT_UNSPECIFIED, password: undefined };
}
export const Plan_ExportDataConfig = {
@@ -2717,8 +2919,8 @@ export const Plan_ExportDataConfig = {
if (message.sheet !== "") {
writer.uint32(18).string(message.sheet);
}
- if (message.format !== 0) {
- writer.uint32(24).int32(message.format);
+ if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
+ writer.uint32(24).int32(exportFormatToNumber(message.format));
}
if (message.password !== undefined) {
writer.uint32(34).string(message.password);
@@ -2752,7 +2954,7 @@ export const Plan_ExportDataConfig = {
break;
}
- message.format = reader.int32() as any;
+ message.format = exportFormatFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -2774,7 +2976,7 @@ export const Plan_ExportDataConfig = {
return {
target: isSet(object.target) ? globalThis.String(object.target) : "",
sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
- format: isSet(object.format) ? exportFormatFromJSON(object.format) : 0,
+ format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,
password: isSet(object.password) ? globalThis.String(object.password) : undefined,
};
},
@@ -2787,7 +2989,7 @@ export const Plan_ExportDataConfig = {
if (message.sheet !== "") {
obj.sheet = message.sheet;
}
- if (message.format !== 0) {
+ if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
obj.format = exportFormatToJSON(message.format);
}
if (message.password !== undefined) {
@@ -2803,20 +3005,20 @@ export const Plan_ExportDataConfig = {
const message = createBasePlan_ExportDataConfig();
message.target = object.target ?? "";
message.sheet = object.sheet ?? "";
- message.format = object.format ?? 0;
+ message.format = object.format ?? ExportFormat.FORMAT_UNSPECIFIED;
message.password = object.password ?? undefined;
return message;
},
};
function createBasePlan_VCSSource(): Plan_VCSSource {
- return { vcsType: 0, vcsConnector: "", pullRequestUrl: "" };
+ return { vcsType: VCSType.VCS_TYPE_UNSPECIFIED, vcsConnector: "", pullRequestUrl: "" };
}
export const Plan_VCSSource = {
encode(message: Plan_VCSSource, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.vcsType !== 0) {
- writer.uint32(8).int32(message.vcsType);
+ if (message.vcsType !== VCSType.VCS_TYPE_UNSPECIFIED) {
+ writer.uint32(8).int32(vCSTypeToNumber(message.vcsType));
}
if (message.vcsConnector !== "") {
writer.uint32(18).string(message.vcsConnector);
@@ -2839,7 +3041,7 @@ export const Plan_VCSSource = {
break;
}
- message.vcsType = reader.int32() as any;
+ message.vcsType = vCSTypeFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -2866,7 +3068,7 @@ export const Plan_VCSSource = {
fromJSON(object: any): Plan_VCSSource {
return {
- vcsType: isSet(object.vcsType) ? vCSTypeFromJSON(object.vcsType) : 0,
+ vcsType: isSet(object.vcsType) ? vCSTypeFromJSON(object.vcsType) : VCSType.VCS_TYPE_UNSPECIFIED,
vcsConnector: isSet(object.vcsConnector) ? globalThis.String(object.vcsConnector) : "",
pullRequestUrl: isSet(object.pullRequestUrl) ? globalThis.String(object.pullRequestUrl) : "",
};
@@ -2874,7 +3076,7 @@ export const Plan_VCSSource = {
toJSON(message: Plan_VCSSource): unknown {
const obj: any = {};
- if (message.vcsType !== 0) {
+ if (message.vcsType !== VCSType.VCS_TYPE_UNSPECIFIED) {
obj.vcsType = vCSTypeToJSON(message.vcsType);
}
if (message.vcsConnector !== "") {
@@ -2891,7 +3093,7 @@ export const Plan_VCSSource = {
},
fromPartial(object: DeepPartial<Plan_VCSSource>): Plan_VCSSource {
const message = createBasePlan_VCSSource();
- message.vcsType = object.vcsType ?? 0;
+ message.vcsType = object.vcsType ?? VCSType.VCS_TYPE_UNSPECIFIED;
message.vcsConnector = object.vcsConnector ?? "";
message.pullRequestUrl = object.pullRequestUrl ?? "";
return message;
@@ -3563,8 +3765,8 @@ function createBasePlanCheckRun(): PlanCheckRun {
return {
name: "",
uid: "",
- type: 0,
- status: 0,
+ type: PlanCheckRun_Type.TYPE_UNSPECIFIED,
+ status: PlanCheckRun_Status.STATUS_UNSPECIFIED,
target: "",
sheet: "",
results: [],
@@ -3581,11 +3783,11 @@ export const PlanCheckRun = {
if (message.uid !== "") {
writer.uint32(18).string(message.uid);
}
- if (message.type !== 0) {
- writer.uint32(24).int32(message.type);
+ if (message.type !== PlanCheckRun_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(24).int32(planCheckRun_TypeToNumber(message.type));
}
- if (message.status !== 0) {
- writer.uint32(32).int32(message.status);
+ if (message.status !== PlanCheckRun_Status.STATUS_UNSPECIFIED) {
+ writer.uint32(32).int32(planCheckRun_StatusToNumber(message.status));
}
if (message.target !== "") {
writer.uint32(42).string(message.target);
@@ -3631,14 +3833,14 @@ export const PlanCheckRun = {
break;
}
- message.type = reader.int32() as any;
+ message.type = planCheckRun_TypeFromJSON(reader.int32());
continue;
case 4:
if (tag !== 32) {
break;
}
- message.status = reader.int32() as any;
+ message.status = planCheckRun_StatusFromJSON(reader.int32());
continue;
case 5:
if (tag !== 42) {
@@ -3688,8 +3890,10 @@ export const PlanCheckRun = {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
- type: isSet(object.type) ? planCheckRun_TypeFromJSON(object.type) : 0,
- status: isSet(object.status) ? planCheckRun_StatusFromJSON(object.status) : 0,
+ 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)
@@ -3708,10 +3912,10 @@ export const PlanCheckRun = {
if (message.uid !== "") {
obj.uid = message.uid;
}
- if (message.type !== 0) {
+ if (message.type !== PlanCheckRun_Type.TYPE_UNSPECIFIED) {
obj.type = planCheckRun_TypeToJSON(message.type);
}
- if (message.status !== 0) {
+ if (message.status !== PlanCheckRun_Status.STATUS_UNSPECIFIED) {
obj.status = planCheckRun_StatusToJSON(message.status);
}
if (message.target !== "") {
@@ -3739,8 +3943,8 @@ export const PlanCheckRun = {
const message = createBasePlanCheckRun();
message.name = object.name ?? "";
message.uid = object.uid ?? "";
- message.type = object.type ?? 0;
- message.status = object.status ?? 0;
+ message.type = object.type ?? PlanCheckRun_Type.TYPE_UNSPECIFIED;
+ message.status = object.status ?? PlanCheckRun_Status.STATUS_UNSPECIFIED;
message.target = object.target ?? "";
message.sheet = object.sheet ?? "";
message.results = object.results?.map((e) => PlanCheckRun_Result.fromPartial(e)) || [];
@@ -3751,13 +3955,20 @@ export const PlanCheckRun = {
};
function createBasePlanCheckRun_Result(): PlanCheckRun_Result {
- return { status: 0, title: "", content: "", code: 0, sqlSummaryReport: undefined, sqlReviewReport: undefined };
+ return {
+ status: PlanCheckRun_Result_Status.STATUS_UNSPECIFIED,
+ title: "",
+ content: "",
+ code: 0,
+ sqlSummaryReport: undefined,
+ sqlReviewReport: undefined,
+ };
}
export const PlanCheckRun_Result = {
encode(message: PlanCheckRun_Result, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.status !== 0) {
- writer.uint32(8).int32(message.status);
+ if (message.status !== PlanCheckRun_Result_Status.STATUS_UNSPECIFIED) {
+ writer.uint32(8).int32(planCheckRun_Result_StatusToNumber(message.status));
}
if (message.title !== "") {
writer.uint32(18).string(message.title);
@@ -3789,7 +4000,7 @@ export const PlanCheckRun_Result = {
break;
}
- message.status = reader.int32() as any;
+ message.status = planCheckRun_Result_StatusFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -3837,7 +4048,9 @@ export const PlanCheckRun_Result = {
fromJSON(object: any): PlanCheckRun_Result {
return {
- status: isSet(object.status) ? planCheckRun_Result_StatusFromJSON(object.status) : 0,
+ 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,
@@ -3852,7 +4065,7 @@ export const PlanCheckRun_Result = {
toJSON(message: PlanCheckRun_Result): unknown {
const obj: any = {};
- if (message.status !== 0) {
+ if (message.status !== PlanCheckRun_Result_Status.STATUS_UNSPECIFIED) {
obj.status = planCheckRun_Result_StatusToJSON(message.status);
}
if (message.title !== "") {
@@ -3878,7 +4091,7 @@ export const PlanCheckRun_Result = {
},
fromPartial(object: DeepPartial<PlanCheckRun_Result>): PlanCheckRun_Result {
const message = createBasePlanCheckRun_Result();
- message.status = object.status ?? 0;
+ message.status = object.status ?? PlanCheckRun_Result_Status.STATUS_UNSPECIFIED;
message.title = object.title ?? "";
message.content = object.content ?? "";
message.code = object.code ?? 0;
@@ -4703,9 +4916,9 @@ function createBaseTask(): Task {
uid: "",
title: "",
specId: "",
- status: 0,
+ status: Task_Status.STATUS_UNSPECIFIED,
skippedReason: "",
- type: 0,
+ type: Task_Type.TYPE_UNSPECIFIED,
dependsOnTasks: [],
target: "",
databaseCreate: undefined,
@@ -4730,14 +4943,14 @@ export const Task = {
if (message.specId !== "") {
writer.uint32(34).string(message.specId);
}
- if (message.status !== 0) {
- writer.uint32(40).int32(message.status);
+ if (message.status !== Task_Status.STATUS_UNSPECIFIED) {
+ writer.uint32(40).int32(task_StatusToNumber(message.status));
}
if (message.skippedReason !== "") {
writer.uint32(122).string(message.skippedReason);
}
- if (message.type !== 0) {
- writer.uint32(48).int32(message.type);
+ if (message.type !== Task_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(48).int32(task_TypeToNumber(message.type));
}
for (const v of message.dependsOnTasks) {
writer.uint32(58).string(v!);
@@ -4803,7 +5016,7 @@ export const Task = {
break;
}
- message.status = reader.int32() as any;
+ message.status = task_StatusFromJSON(reader.int32());
continue;
case 15:
if (tag !== 122) {
@@ -4817,7 +5030,7 @@ export const Task = {
break;
}
- message.type = reader.int32() as any;
+ message.type = task_TypeFromJSON(reader.int32());
continue;
case 7:
if (tag !== 58) {
@@ -4883,9 +5096,9 @@ export const Task = {
uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
title: isSet(object.title) ? globalThis.String(object.title) : "",
specId: isSet(object.specId) ? globalThis.String(object.specId) : "",
- status: isSet(object.status) ? task_StatusFromJSON(object.status) : 0,
+ 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) : 0,
+ type: isSet(object.type) ? task_TypeFromJSON(object.type) : Task_Type.TYPE_UNSPECIFIED,
dependsOnTasks: globalThis.Array.isArray(object?.dependsOnTasks)
? object.dependsOnTasks.map((e: any) => globalThis.String(e))
: [],
@@ -4920,13 +5133,13 @@ export const Task = {
if (message.specId !== "") {
obj.specId = message.specId;
}
- if (message.status !== 0) {
+ if (message.status !== Task_Status.STATUS_UNSPECIFIED) {
obj.status = task_StatusToJSON(message.status);
}
if (message.skippedReason !== "") {
obj.skippedReason = message.skippedReason;
}
- if (message.type !== 0) {
+ if (message.type !== Task_Type.TYPE_UNSPECIFIED) {
obj.type = task_TypeToJSON(message.type);
}
if (message.dependsOnTasks?.length) {
@@ -4962,9 +5175,9 @@ export const Task = {
message.uid = object.uid ?? "";
message.title = object.title ?? "";
message.specId = object.specId ?? "";
- message.status = object.status ?? 0;
+ message.status = object.status ?? Task_Status.STATUS_UNSPECIFIED;
message.skippedReason = object.skippedReason ?? "";
- message.type = object.type ?? 0;
+ message.type = object.type ?? Task_Type.TYPE_UNSPECIFIED;
message.dependsOnTasks = object.dependsOnTasks?.map((e) => e) || [];
message.target = object.target ?? "";
message.databaseCreate = (object.databaseCreate !== undefined && object.databaseCreate !== null)
@@ -5389,7 +5602,7 @@ function createBaseTask_DatabaseDataUpdate(): Task_DatabaseDataUpdate {
sheet: "",
schemaVersion: "",
rollbackEnabled: false,
- rollbackSqlStatus: 0,
+ rollbackSqlStatus: Task_DatabaseDataUpdate_RollbackSqlStatus.ROLLBACK_SQL_STATUS_UNSPECIFIED,
rollbackError: "",
rollbackSheet: "",
rollbackFromIssue: "",
@@ -5408,8 +5621,8 @@ export const Task_DatabaseDataUpdate = {
if (message.rollbackEnabled === true) {
writer.uint32(24).bool(message.rollbackEnabled);
}
- if (message.rollbackSqlStatus !== 0) {
- writer.uint32(32).int32(message.rollbackSqlStatus);
+ if (message.rollbackSqlStatus !== Task_DatabaseDataUpdate_RollbackSqlStatus.ROLLBACK_SQL_STATUS_UNSPECIFIED) {
+ writer.uint32(32).int32(task_DatabaseDataUpdate_RollbackSqlStatusToNumber(message.rollbackSqlStatus));
}
if (message.rollbackError !== "") {
writer.uint32(42).string(message.rollbackError);
@@ -5459,7 +5672,7 @@ export const Task_DatabaseDataUpdate = {
break;
}
- message.rollbackSqlStatus = reader.int32() as any;
+ message.rollbackSqlStatus = task_DatabaseDataUpdate_RollbackSqlStatusFromJSON(reader.int32());
continue;
case 5:
if (tag !== 42) {
@@ -5505,7 +5718,7 @@ export const Task_DatabaseDataUpdate = {
rollbackEnabled: isSet(object.rollbackEnabled) ? globalThis.Boolean(object.rollbackEnabled) : false,
rollbackSqlStatus: isSet(object.rollbackSqlStatus)
? task_DatabaseDataUpdate_RollbackSqlStatusFromJSON(object.rollbackSqlStatus)
- : 0,
+ : Task_DatabaseDataUpdate_RollbackSqlStatus.ROLLBACK_SQL_STATUS_UNSPECIFIED,
rollbackError: isSet(object.rollbackError) ? globalThis.String(object.rollbackError) : "",
rollbackSheet: isSet(object.rollbackSheet) ? globalThis.String(object.rollbackSheet) : "",
rollbackFromIssue: isSet(object.rollbackFromIssue) ? globalThis.String(object.rollbackFromIssue) : "",
@@ -5524,7 +5737,7 @@ export const Task_DatabaseDataUpdate = {
if (message.rollbackEnabled === true) {
obj.rollbackEnabled = message.rollbackEnabled;
}
- if (message.rollbackSqlStatus !== 0) {
+ if (message.rollbackSqlStatus !== Task_DatabaseDataUpdate_RollbackSqlStatus.ROLLBACK_SQL_STATUS_UNSPECIFIED) {
obj.rollbackSqlStatus = task_DatabaseDataUpdate_RollbackSqlStatusToJSON(message.rollbackSqlStatus);
}
if (message.rollbackError !== "") {
@@ -5550,7 +5763,8 @@ export const Task_DatabaseDataUpdate = {
message.sheet = object.sheet ?? "";
message.schemaVersion = object.schemaVersion ?? "";
message.rollbackEnabled = object.rollbackEnabled ?? false;
- message.rollbackSqlStatus = object.rollbackSqlStatus ?? 0;
+ message.rollbackSqlStatus = object.rollbackSqlStatus ??
+ Task_DatabaseDataUpdate_RollbackSqlStatus.ROLLBACK_SQL_STATUS_UNSPECIFIED;
message.rollbackError = object.rollbackError ?? "";
message.rollbackSheet = object.rollbackSheet ?? "";
message.rollbackFromIssue = object.rollbackFromIssue ?? "";
@@ -5560,7 +5774,7 @@ export const Task_DatabaseDataUpdate = {
};
function createBaseTask_DatabaseDataExport(): Task_DatabaseDataExport {
- return { target: "", sheet: "", format: 0, password: undefined };
+ return { target: "", sheet: "", format: ExportFormat.FORMAT_UNSPECIFIED, password: undefined };
}
export const Task_DatabaseDataExport = {
@@ -5571,8 +5785,8 @@ export const Task_DatabaseDataExport = {
if (message.sheet !== "") {
writer.uint32(18).string(message.sheet);
}
- if (message.format !== 0) {
- writer.uint32(24).int32(message.format);
+ if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
+ writer.uint32(24).int32(exportFormatToNumber(message.format));
}
if (message.password !== undefined) {
writer.uint32(34).string(message.password);
@@ -5606,7 +5820,7 @@ export const Task_DatabaseDataExport = {
break;
}
- message.format = reader.int32() as any;
+ message.format = exportFormatFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -5628,7 +5842,7 @@ export const 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) : 0,
+ format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,
password: isSet(object.password) ? globalThis.String(object.password) : undefined,
};
},
@@ -5641,7 +5855,7 @@ export const Task_DatabaseDataExport = {
if (message.sheet !== "") {
obj.sheet = message.sheet;
}
- if (message.format !== 0) {
+ if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
obj.format = exportFormatToJSON(message.format);
}
if (message.password !== undefined) {
@@ -5657,7 +5871,7 @@ export const Task_DatabaseDataExport = {
const message = createBaseTask_DatabaseDataExport();
message.target = object.target ?? "";
message.sheet = object.sheet ?? "";
- message.format = object.format ?? 0;
+ message.format = object.format ?? ExportFormat.FORMAT_UNSPECIFIED;
message.password = object.password ?? undefined;
return message;
},
@@ -5672,15 +5886,15 @@ function createBaseTaskRun(): TaskRun {
createTime: undefined,
updateTime: undefined,
title: "",
- status: 0,
+ status: TaskRun_Status.STATUS_UNSPECIFIED,
detail: "",
changeHistory: "",
schemaVersion: "",
- executionStatus: 0,
+ executionStatus: TaskRun_ExecutionStatus.EXECUTION_STATUS_UNSPECIFIED,
executionStatusUpdateTime: undefined,
executionDetail: undefined,
startTime: undefined,
- exportArchiveStatus: 0,
+ exportArchiveStatus: TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED,
};
}
@@ -5707,8 +5921,8 @@ export const TaskRun = {
if (message.title !== "") {
writer.uint32(58).string(message.title);
}
- if (message.status !== 0) {
- writer.uint32(64).int32(message.status);
+ if (message.status !== TaskRun_Status.STATUS_UNSPECIFIED) {
+ writer.uint32(64).int32(taskRun_StatusToNumber(message.status));
}
if (message.detail !== "") {
writer.uint32(74).string(message.detail);
@@ -5719,8 +5933,8 @@ export const TaskRun = {
if (message.schemaVersion !== "") {
writer.uint32(90).string(message.schemaVersion);
}
- if (message.executionStatus !== 0) {
- writer.uint32(96).int32(message.executionStatus);
+ if (message.executionStatus !== TaskRun_ExecutionStatus.EXECUTION_STATUS_UNSPECIFIED) {
+ writer.uint32(96).int32(taskRun_ExecutionStatusToNumber(message.executionStatus));
}
if (message.executionStatusUpdateTime !== undefined) {
Timestamp.encode(toTimestamp(message.executionStatusUpdateTime), writer.uint32(106).fork()).ldelim();
@@ -5731,8 +5945,8 @@ export const TaskRun = {
if (message.startTime !== undefined) {
Timestamp.encode(toTimestamp(message.startTime), writer.uint32(114).fork()).ldelim();
}
- if (message.exportArchiveStatus !== 0) {
- writer.uint32(128).int32(message.exportArchiveStatus);
+ if (message.exportArchiveStatus !== TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED) {
+ writer.uint32(128).int32(taskRun_ExportArchiveStatusToNumber(message.exportArchiveStatus));
}
return writer;
},
@@ -5798,7 +6012,7 @@ export const TaskRun = {
break;
}
- message.status = reader.int32() as any;
+ message.status = taskRun_StatusFromJSON(reader.int32());
continue;
case 9:
if (tag !== 74) {
@@ -5826,7 +6040,7 @@ export const TaskRun = {
break;
}
- message.executionStatus = reader.int32() as any;
+ message.executionStatus = taskRun_ExecutionStatusFromJSON(reader.int32());
continue;
case 13:
if (tag !== 106) {
@@ -5854,7 +6068,7 @@ export const TaskRun = {
break;
}
- message.exportArchiveStatus = reader.int32() as any;
+ message.exportArchiveStatus = taskRun_ExportArchiveStatusFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -5874,11 +6088,13 @@ export const TaskRun = {
createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
title: isSet(object.title) ? globalThis.String(object.title) : "",
- status: isSet(object.status) ? taskRun_StatusFromJSON(object.status) : 0,
+ status: isSet(object.status) ? taskRun_StatusFromJSON(object.status) : TaskRun_Status.STATUS_UNSPECIFIED,
detail: isSet(object.detail) ? globalThis.String(object.detail) : "",
changeHistory: isSet(object.changeHistory) ? globalThis.String(object.changeHistory) : "",
schemaVersion: isSet(object.schemaVersion) ? globalThis.String(object.schemaVersion) : "",
- executionStatus: isSet(object.executionStatus) ? taskRun_ExecutionStatusFromJSON(object.executionStatus) : 0,
+ executionStatus: isSet(object.executionStatus)
+ ? taskRun_ExecutionStatusFromJSON(object.executionStatus)
+ : TaskRun_ExecutionStatus.EXECUTION_STATUS_UNSPECIFIED,
executionStatusUpdateTime: isSet(object.executionStatusUpdateTime)
? fromJsonTimestamp(object.executionStatusUpdateTime)
: undefined,
@@ -5888,7 +6104,7 @@ export const TaskRun = {
startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined,
exportArchiveStatus: isSet(object.exportArchiveStatus)
? taskRun_ExportArchiveStatusFromJSON(object.exportArchiveStatus)
- : 0,
+ : TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED,
};
},
@@ -5915,7 +6131,7 @@ export const TaskRun = {
if (message.title !== "") {
obj.title = message.title;
}
- if (message.status !== 0) {
+ if (message.status !== TaskRun_Status.STATUS_UNSPECIFIED) {
obj.status = taskRun_StatusToJSON(message.status);
}
if (message.detail !== "") {
@@ -5927,7 +6143,7 @@ export const TaskRun = {
if (message.schemaVersion !== "") {
obj.schemaVersion = message.schemaVersion;
}
- if (message.executionStatus !== 0) {
+ if (message.executionStatus !== TaskRun_ExecutionStatus.EXECUTION_STATUS_UNSPECIFIED) {
obj.executionStatus = taskRun_ExecutionStatusToJSON(message.executionStatus);
}
if (message.executionStatusUpdateTime !== undefined) {
@@ -5939,7 +6155,7 @@ export const TaskRun = {
if (message.startTime !== undefined) {
obj.startTime = message.startTime.toISOString();
}
- if (message.exportArchiveStatus !== 0) {
+ if (message.exportArchiveStatus !== TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED) {
obj.exportArchiveStatus = taskRun_ExportArchiveStatusToJSON(message.exportArchiveStatus);
}
return obj;
@@ -5957,17 +6173,18 @@ export const TaskRun = {
message.createTime = object.createTime ?? undefined;
message.updateTime = object.updateTime ?? undefined;
message.title = object.title ?? "";
- message.status = object.status ?? 0;
+ message.status = object.status ?? TaskRun_Status.STATUS_UNSPECIFIED;
message.detail = object.detail ?? "";
message.changeHistory = object.changeHistory ?? "";
message.schemaVersion = object.schemaVersion ?? "";
- message.executionStatus = object.executionStatus ?? 0;
+ message.executionStatus = object.executionStatus ?? TaskRun_ExecutionStatus.EXECUTION_STATUS_UNSPECIFIED;
message.executionStatusUpdateTime = object.executionStatusUpdateTime ?? undefined;
message.executionDetail = (object.executionDetail !== undefined && object.executionDetail !== null)
? TaskRun_ExecutionDetail.fromPartial(object.executionDetail)
: undefined;
message.startTime = object.startTime ?? undefined;
- message.exportArchiveStatus = object.exportArchiveStatus ?? 0;
+ message.exportArchiveStatus = object.exportArchiveStatus ??
+ TaskRun_ExportArchiveStatus.EXPORT_ARCHIVE_STATUS_UNSPECIFIED;
return message;
},
};
diff --git a/frontend/src/types/proto/v1/setting_service.ts b/frontend/src/types/proto/v1/setting_service.ts
index c01f3b285e..4818e662cb 100644
--- a/frontend/src/types/proto/v1/setting_service.ts
+++ b/frontend/src/types/proto/v1/setting_service.ts
@@ -4,10 +4,10 @@ import _m0 from "protobufjs/minimal";
import { Duration } from "../google/protobuf/duration";
import { Timestamp } from "../google/protobuf/timestamp";
import { Expr } from "../google/type/expr";
-import { Engine, engineFromJSON, engineToJSON } from "./common";
+import { Engine, engineFromJSON, engineToJSON, engineToNumber } from "./common";
import { ColumnConfig, ColumnMetadata, TableConfig, TableMetadata } from "./database_service";
import { ApprovalTemplate } from "./issue_service";
-import { PlanType, planTypeFromJSON, planTypeToJSON } from "./subscription_service";
+import { PlanType, planTypeFromJSON, planTypeToJSON, planTypeToNumber } from "./subscription_service";
export const protobufPackage = "bytebase.v1";
@@ -122,11 +122,11 @@ export interface SMTPMailDeliverySettingValue {
/** We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS. */
export enum SMTPMailDeliverySettingValue_Encryption {
- ENCRYPTION_UNSPECIFIED = 0,
- ENCRYPTION_NONE = 1,
- ENCRYPTION_STARTTLS = 2,
- ENCRYPTION_SSL_TLS = 3,
- UNRECOGNIZED = -1,
+ ENCRYPTION_UNSPECIFIED = "ENCRYPTION_UNSPECIFIED",
+ ENCRYPTION_NONE = "ENCRYPTION_NONE",
+ ENCRYPTION_STARTTLS = "ENCRYPTION_STARTTLS",
+ ENCRYPTION_SSL_TLS = "ENCRYPTION_SSL_TLS",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function sMTPMailDeliverySettingValue_EncryptionFromJSON(object: any): SMTPMailDeliverySettingValue_Encryption {
@@ -166,14 +166,32 @@ export function sMTPMailDeliverySettingValue_EncryptionToJSON(object: SMTPMailDe
}
}
+export function sMTPMailDeliverySettingValue_EncryptionToNumber(
+ object: SMTPMailDeliverySettingValue_Encryption,
+): number {
+ switch (object) {
+ case SMTPMailDeliverySettingValue_Encryption.ENCRYPTION_UNSPECIFIED:
+ return 0;
+ case SMTPMailDeliverySettingValue_Encryption.ENCRYPTION_NONE:
+ return 1;
+ case SMTPMailDeliverySettingValue_Encryption.ENCRYPTION_STARTTLS:
+ return 2;
+ case SMTPMailDeliverySettingValue_Encryption.ENCRYPTION_SSL_TLS:
+ return 3;
+ case SMTPMailDeliverySettingValue_Encryption.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/** We support four types of SMTP authentication: NONE, PLAIN, LOGIN, and CRAM-MD5. */
export enum SMTPMailDeliverySettingValue_Authentication {
- AUTHENTICATION_UNSPECIFIED = 0,
- AUTHENTICATION_NONE = 1,
- AUTHENTICATION_PLAIN = 2,
- AUTHENTICATION_LOGIN = 3,
- AUTHENTICATION_CRAM_MD5 = 4,
- UNRECOGNIZED = -1,
+ AUTHENTICATION_UNSPECIFIED = "AUTHENTICATION_UNSPECIFIED",
+ AUTHENTICATION_NONE = "AUTHENTICATION_NONE",
+ AUTHENTICATION_PLAIN = "AUTHENTICATION_PLAIN",
+ AUTHENTICATION_LOGIN = "AUTHENTICATION_LOGIN",
+ AUTHENTICATION_CRAM_MD5 = "AUTHENTICATION_CRAM_MD5",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function sMTPMailDeliverySettingValue_AuthenticationFromJSON(
@@ -222,6 +240,26 @@ export function sMTPMailDeliverySettingValue_AuthenticationToJSON(
}
}
+export function sMTPMailDeliverySettingValue_AuthenticationToNumber(
+ object: SMTPMailDeliverySettingValue_Authentication,
+): number {
+ switch (object) {
+ case SMTPMailDeliverySettingValue_Authentication.AUTHENTICATION_UNSPECIFIED:
+ return 0;
+ case SMTPMailDeliverySettingValue_Authentication.AUTHENTICATION_NONE:
+ return 1;
+ case SMTPMailDeliverySettingValue_Authentication.AUTHENTICATION_PLAIN:
+ return 2;
+ case SMTPMailDeliverySettingValue_Authentication.AUTHENTICATION_LOGIN:
+ return 3;
+ case SMTPMailDeliverySettingValue_Authentication.AUTHENTICATION_CRAM_MD5:
+ return 4;
+ case SMTPMailDeliverySettingValue_Authentication.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface AppIMSetting {
imType: AppIMSetting_IMType;
appId: string;
@@ -230,9 +268,9 @@ export interface AppIMSetting {
}
export enum AppIMSetting_IMType {
- IM_TYPE_UNSPECIFIED = 0,
- FEISHU = 1,
- UNRECOGNIZED = -1,
+ IM_TYPE_UNSPECIFIED = "IM_TYPE_UNSPECIFIED",
+ FEISHU = "FEISHU",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function appIMSetting_IMTypeFromJSON(object: any): AppIMSetting_IMType {
@@ -262,6 +300,18 @@ export function appIMSetting_IMTypeToJSON(object: AppIMSetting_IMType): string {
}
}
+export function appIMSetting_IMTypeToNumber(object: AppIMSetting_IMType): number {
+ switch (object) {
+ case AppIMSetting_IMType.IM_TYPE_UNSPECIFIED:
+ return 0;
+ case AppIMSetting_IMType.FEISHU:
+ return 1;
+ case AppIMSetting_IMType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface AppIMSetting_ExternalApproval {
enabled: boolean;
approvalDefinitionId: string;
@@ -310,11 +360,11 @@ export interface Announcement {
/** We support three levels of AlertLevel: INFO, WARNING, and ERROR. */
export enum Announcement_AlertLevel {
- ALERT_LEVEL_UNSPECIFIED = 0,
- ALERT_LEVEL_INFO = 1,
- ALERT_LEVEL_WARNING = 2,
- ALERT_LEVEL_CRITICAL = 3,
- UNRECOGNIZED = -1,
+ ALERT_LEVEL_UNSPECIFIED = "ALERT_LEVEL_UNSPECIFIED",
+ ALERT_LEVEL_INFO = "ALERT_LEVEL_INFO",
+ ALERT_LEVEL_WARNING = "ALERT_LEVEL_WARNING",
+ ALERT_LEVEL_CRITICAL = "ALERT_LEVEL_CRITICAL",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function announcement_AlertLevelFromJSON(object: any): Announcement_AlertLevel {
@@ -354,6 +404,22 @@ export function announcement_AlertLevelToJSON(object: Announcement_AlertLevel):
}
}
+export function announcement_AlertLevelToNumber(object: Announcement_AlertLevel): number {
+ switch (object) {
+ case Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED:
+ return 0;
+ case Announcement_AlertLevel.ALERT_LEVEL_INFO:
+ return 1;
+ case Announcement_AlertLevel.ALERT_LEVEL_WARNING:
+ return 2;
+ case Announcement_AlertLevel.ALERT_LEVEL_CRITICAL:
+ return 3;
+ case Announcement_AlertLevel.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface WorkspaceApprovalSetting {
rules: WorkspaceApprovalSetting_Rule[];
}
@@ -1248,11 +1314,11 @@ function createBaseSMTPMailDeliverySettingValue(): SMTPMailDeliverySettingValue
return {
server: "",
port: 0,
- encryption: 0,
+ encryption: SMTPMailDeliverySettingValue_Encryption.ENCRYPTION_UNSPECIFIED,
ca: undefined,
key: undefined,
cert: undefined,
- authentication: 0,
+ authentication: SMTPMailDeliverySettingValue_Authentication.AUTHENTICATION_UNSPECIFIED,
username: "",
password: undefined,
from: "",
@@ -1268,8 +1334,8 @@ export const SMTPMailDeliverySettingValue = {
if (message.port !== 0) {
writer.uint32(16).int32(message.port);
}
- if (message.encryption !== 0) {
- writer.uint32(24).int32(message.encryption);
+ if (message.encryption !== SMTPMailDeliverySettingValue_Encryption.ENCRYPTION_UNSPECIFIED) {
+ writer.uint32(24).int32(sMTPMailDeliverySettingValue_EncryptionToNumber(message.encryption));
}
if (message.ca !== undefined) {
writer.uint32(34).string(message.ca);
@@ -1280,8 +1346,8 @@ export const SMTPMailDeliverySettingValue = {
if (message.cert !== undefined) {
writer.uint32(50).string(message.cert);
}
- if (message.authentication !== 0) {
- writer.uint32(56).int32(message.authentication);
+ if (message.authentication !== SMTPMailDeliverySettingValue_Authentication.AUTHENTICATION_UNSPECIFIED) {
+ writer.uint32(56).int32(sMTPMailDeliverySettingValue_AuthenticationToNumber(message.authentication));
}
if (message.username !== "") {
writer.uint32(66).string(message.username);
@@ -1324,7 +1390,7 @@ export const SMTPMailDeliverySettingValue = {
break;
}
- message.encryption = reader.int32() as any;
+ message.encryption = sMTPMailDeliverySettingValue_EncryptionFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -1352,7 +1418,7 @@ export const SMTPMailDeliverySettingValue = {
break;
}
- message.authentication = reader.int32() as any;
+ message.authentication = sMTPMailDeliverySettingValue_AuthenticationFromJSON(reader.int32());
continue;
case 8:
if (tag !== 66) {
@@ -1395,13 +1461,15 @@ export const 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) : 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)
- : 0,
+ : 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) : "",
@@ -1417,7 +1485,7 @@ export const SMTPMailDeliverySettingValue = {
if (message.port !== 0) {
obj.port = Math.round(message.port);
}
- if (message.encryption !== 0) {
+ if (message.encryption !== SMTPMailDeliverySettingValue_Encryption.ENCRYPTION_UNSPECIFIED) {
obj.encryption = sMTPMailDeliverySettingValue_EncryptionToJSON(message.encryption);
}
if (message.ca !== undefined) {
@@ -1429,7 +1497,7 @@ export const SMTPMailDeliverySettingValue = {
if (message.cert !== undefined) {
obj.cert = message.cert;
}
- if (message.authentication !== 0) {
+ if (message.authentication !== SMTPMailDeliverySettingValue_Authentication.AUTHENTICATION_UNSPECIFIED) {
obj.authentication = sMTPMailDeliverySettingValue_AuthenticationToJSON(message.authentication);
}
if (message.username !== "") {
@@ -1454,11 +1522,12 @@ export const SMTPMailDeliverySettingValue = {
const message = createBaseSMTPMailDeliverySettingValue();
message.server = object.server ?? "";
message.port = object.port ?? 0;
- message.encryption = object.encryption ?? 0;
+ message.encryption = object.encryption ?? SMTPMailDeliverySettingValue_Encryption.ENCRYPTION_UNSPECIFIED;
message.ca = object.ca ?? undefined;
message.key = object.key ?? undefined;
message.cert = object.cert ?? undefined;
- message.authentication = object.authentication ?? 0;
+ message.authentication = object.authentication ??
+ SMTPMailDeliverySettingValue_Authentication.AUTHENTICATION_UNSPECIFIED;
message.username = object.username ?? "";
message.password = object.password ?? undefined;
message.from = object.from ?? "";
@@ -1468,13 +1537,13 @@ export const SMTPMailDeliverySettingValue = {
};
function createBaseAppIMSetting(): AppIMSetting {
- return { imType: 0, appId: "", appSecret: "", externalApproval: undefined };
+ return { imType: AppIMSetting_IMType.IM_TYPE_UNSPECIFIED, appId: "", appSecret: "", externalApproval: undefined };
}
export const AppIMSetting = {
encode(message: AppIMSetting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.imType !== 0) {
- writer.uint32(8).int32(message.imType);
+ if (message.imType !== AppIMSetting_IMType.IM_TYPE_UNSPECIFIED) {
+ writer.uint32(8).int32(appIMSetting_IMTypeToNumber(message.imType));
}
if (message.appId !== "") {
writer.uint32(18).string(message.appId);
@@ -1500,7 +1569,7 @@ export const AppIMSetting = {
break;
}
- message.imType = reader.int32() as any;
+ message.imType = appIMSetting_IMTypeFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -1534,7 +1603,9 @@ export const AppIMSetting = {
fromJSON(object: any): AppIMSetting {
return {
- imType: isSet(object.imType) ? appIMSetting_IMTypeFromJSON(object.imType) : 0,
+ imType: isSet(object.imType)
+ ? appIMSetting_IMTypeFromJSON(object.imType)
+ : AppIMSetting_IMType.IM_TYPE_UNSPECIFIED,
appId: isSet(object.appId) ? globalThis.String(object.appId) : "",
appSecret: isSet(object.appSecret) ? globalThis.String(object.appSecret) : "",
externalApproval: isSet(object.externalApproval)
@@ -1545,7 +1616,7 @@ export const AppIMSetting = {
toJSON(message: AppIMSetting): unknown {
const obj: any = {};
- if (message.imType !== 0) {
+ if (message.imType !== AppIMSetting_IMType.IM_TYPE_UNSPECIFIED) {
obj.imType = appIMSetting_IMTypeToJSON(message.imType);
}
if (message.appId !== "") {
@@ -1565,7 +1636,7 @@ export const AppIMSetting = {
},
fromPartial(object: DeepPartial<AppIMSetting>): AppIMSetting {
const message = createBaseAppIMSetting();
- message.imType = object.imType ?? 0;
+ message.imType = object.imType ?? AppIMSetting_IMType.IM_TYPE_UNSPECIFIED;
message.appId = object.appId ?? "";
message.appSecret = object.appSecret ?? "";
message.externalApproval = (object.externalApproval !== undefined && object.externalApproval !== null)
@@ -1887,13 +1958,13 @@ export const WorkspaceProfileSetting = {
};
function createBaseAnnouncement(): Announcement {
- return { level: 0, text: "", link: "" };
+ return { level: Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED, text: "", link: "" };
}
export const Announcement = {
encode(message: Announcement, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.level !== 0) {
- writer.uint32(8).int32(message.level);
+ if (message.level !== Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED) {
+ writer.uint32(8).int32(announcement_AlertLevelToNumber(message.level));
}
if (message.text !== "") {
writer.uint32(18).string(message.text);
@@ -1916,7 +1987,7 @@ export const Announcement = {
break;
}
- message.level = reader.int32() as any;
+ message.level = announcement_AlertLevelFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -1943,7 +2014,9 @@ export const Announcement = {
fromJSON(object: any): Announcement {
return {
- level: isSet(object.level) ? announcement_AlertLevelFromJSON(object.level) : 0,
+ 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) : "",
};
@@ -1951,7 +2024,7 @@ export const Announcement = {
toJSON(message: Announcement): unknown {
const obj: any = {};
- if (message.level !== 0) {
+ if (message.level !== Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED) {
obj.level = announcement_AlertLevelToJSON(message.level);
}
if (message.text !== "") {
@@ -1968,7 +2041,7 @@ export const Announcement = {
},
fromPartial(object: DeepPartial<Announcement>): Announcement {
const message = createBaseAnnouncement();
- message.level = object.level ?? 0;
+ message.level = object.level ?? Announcement_AlertLevel.ALERT_LEVEL_UNSPECIFIED;
message.text = object.text ?? "";
message.link = object.link ?? "";
return message;
@@ -2362,7 +2435,7 @@ export const SchemaTemplateSetting = {
};
function createBaseSchemaTemplateSetting_FieldTemplate(): SchemaTemplateSetting_FieldTemplate {
- return { id: "", engine: 0, category: "", column: undefined, config: undefined };
+ return { id: "", engine: Engine.ENGINE_UNSPECIFIED, category: "", column: undefined, config: undefined };
}
export const SchemaTemplateSetting_FieldTemplate = {
@@ -2370,8 +2443,8 @@ export const SchemaTemplateSetting_FieldTemplate = {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
- if (message.engine !== 0) {
- writer.uint32(16).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(16).int32(engineToNumber(message.engine));
}
if (message.category !== "") {
writer.uint32(26).string(message.category);
@@ -2404,7 +2477,7 @@ export const SchemaTemplateSetting_FieldTemplate = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -2439,7 +2512,7 @@ export const SchemaTemplateSetting_FieldTemplate = {
fromJSON(object: any): SchemaTemplateSetting_FieldTemplate {
return {
id: isSet(object.id) ? globalThis.String(object.id) : "",
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ 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,
config: isSet(object.config) ? ColumnConfig.fromJSON(object.config) : undefined,
@@ -2451,7 +2524,7 @@ export const SchemaTemplateSetting_FieldTemplate = {
if (message.id !== "") {
obj.id = message.id;
}
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
if (message.category !== "") {
@@ -2472,7 +2545,7 @@ export const SchemaTemplateSetting_FieldTemplate = {
fromPartial(object: DeepPartial<SchemaTemplateSetting_FieldTemplate>): SchemaTemplateSetting_FieldTemplate {
const message = createBaseSchemaTemplateSetting_FieldTemplate();
message.id = object.id ?? "";
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
message.category = object.category ?? "";
message.column = (object.column !== undefined && object.column !== null)
? ColumnMetadata.fromPartial(object.column)
@@ -2485,13 +2558,13 @@ export const SchemaTemplateSetting_FieldTemplate = {
};
function createBaseSchemaTemplateSetting_ColumnType(): SchemaTemplateSetting_ColumnType {
- return { engine: 0, enabled: false, types: [] };
+ return { engine: Engine.ENGINE_UNSPECIFIED, enabled: false, types: [] };
}
export const SchemaTemplateSetting_ColumnType = {
encode(message: SchemaTemplateSetting_ColumnType, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.engine !== 0) {
- writer.uint32(8).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(8).int32(engineToNumber(message.engine));
}
if (message.enabled === true) {
writer.uint32(16).bool(message.enabled);
@@ -2514,7 +2587,7 @@ export const SchemaTemplateSetting_ColumnType = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
case 2:
if (tag !== 16) {
@@ -2541,7 +2614,7 @@ export const SchemaTemplateSetting_ColumnType = {
fromJSON(object: any): SchemaTemplateSetting_ColumnType {
return {
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ 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)) : [],
};
@@ -2549,7 +2622,7 @@ export const SchemaTemplateSetting_ColumnType = {
toJSON(message: SchemaTemplateSetting_ColumnType): unknown {
const obj: any = {};
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
if (message.enabled === true) {
@@ -2566,7 +2639,7 @@ export const SchemaTemplateSetting_ColumnType = {
},
fromPartial(object: DeepPartial<SchemaTemplateSetting_ColumnType>): SchemaTemplateSetting_ColumnType {
const message = createBaseSchemaTemplateSetting_ColumnType();
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
message.enabled = object.enabled ?? false;
message.types = object.types?.map((e) => e) || [];
return message;
@@ -2574,7 +2647,7 @@ export const SchemaTemplateSetting_ColumnType = {
};
function createBaseSchemaTemplateSetting_TableTemplate(): SchemaTemplateSetting_TableTemplate {
- return { id: "", engine: 0, category: "", table: undefined, config: undefined };
+ return { id: "", engine: Engine.ENGINE_UNSPECIFIED, category: "", table: undefined, config: undefined };
}
export const SchemaTemplateSetting_TableTemplate = {
@@ -2582,8 +2655,8 @@ export const SchemaTemplateSetting_TableTemplate = {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
- if (message.engine !== 0) {
- writer.uint32(16).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(16).int32(engineToNumber(message.engine));
}
if (message.category !== "") {
writer.uint32(26).string(message.category);
@@ -2616,7 +2689,7 @@ export const SchemaTemplateSetting_TableTemplate = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
case 3:
if (tag !== 26) {
@@ -2651,7 +2724,7 @@ export const SchemaTemplateSetting_TableTemplate = {
fromJSON(object: any): SchemaTemplateSetting_TableTemplate {
return {
id: isSet(object.id) ? globalThis.String(object.id) : "",
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ 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,
config: isSet(object.config) ? TableConfig.fromJSON(object.config) : undefined,
@@ -2663,7 +2736,7 @@ export const SchemaTemplateSetting_TableTemplate = {
if (message.id !== "") {
obj.id = message.id;
}
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
if (message.category !== "") {
@@ -2684,7 +2757,7 @@ export const SchemaTemplateSetting_TableTemplate = {
fromPartial(object: DeepPartial<SchemaTemplateSetting_TableTemplate>): SchemaTemplateSetting_TableTemplate {
const message = createBaseSchemaTemplateSetting_TableTemplate();
message.id = object.id ?? "";
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
message.category = object.category ?? "";
message.table = (object.table !== undefined && object.table !== null)
? TableMetadata.fromPartial(object.table)
@@ -2697,7 +2770,14 @@ export const SchemaTemplateSetting_TableTemplate = {
};
function createBaseWorkspaceTrialSetting(): WorkspaceTrialSetting {
- return { instanceCount: 0, expireTime: undefined, issuedTime: undefined, subject: "", orgName: "", plan: 0 };
+ return {
+ instanceCount: 0,
+ expireTime: undefined,
+ issuedTime: undefined,
+ subject: "",
+ orgName: "",
+ plan: PlanType.PLAN_TYPE_UNSPECIFIED,
+ };
}
export const WorkspaceTrialSetting = {
@@ -2717,8 +2797,8 @@ export const WorkspaceTrialSetting = {
if (message.orgName !== "") {
writer.uint32(42).string(message.orgName);
}
- if (message.plan !== 0) {
- writer.uint32(48).int32(message.plan);
+ if (message.plan !== PlanType.PLAN_TYPE_UNSPECIFIED) {
+ writer.uint32(48).int32(planTypeToNumber(message.plan));
}
return writer;
},
@@ -2770,7 +2850,7 @@ export const WorkspaceTrialSetting = {
break;
}
- message.plan = reader.int32() as any;
+ message.plan = planTypeFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -2788,7 +2868,7 @@ export const WorkspaceTrialSetting = {
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) : 0,
+ plan: isSet(object.plan) ? planTypeFromJSON(object.plan) : PlanType.PLAN_TYPE_UNSPECIFIED,
};
},
@@ -2809,7 +2889,7 @@ export const WorkspaceTrialSetting = {
if (message.orgName !== "") {
obj.orgName = message.orgName;
}
- if (message.plan !== 0) {
+ if (message.plan !== PlanType.PLAN_TYPE_UNSPECIFIED) {
obj.plan = planTypeToJSON(message.plan);
}
return obj;
@@ -2825,7 +2905,7 @@ export const WorkspaceTrialSetting = {
message.issuedTime = object.issuedTime ?? undefined;
message.subject = object.subject ?? "";
message.orgName = object.orgName ?? "";
- message.plan = object.plan ?? 0;
+ message.plan = object.plan ?? PlanType.PLAN_TYPE_UNSPECIFIED;
return message;
},
};
diff --git a/frontend/src/types/proto/v1/sheet_service.ts b/frontend/src/types/proto/v1/sheet_service.ts
index 13425c2cd4..b25f814cfa 100644
--- a/frontend/src/types/proto/v1/sheet_service.ts
+++ b/frontend/src/types/proto/v1/sheet_service.ts
@@ -3,7 +3,7 @@ import Long from "long";
import _m0 from "protobufjs/minimal";
import { FieldMask } from "../google/protobuf/field_mask";
import { Timestamp } from "../google/protobuf/timestamp";
-import { Engine, engineFromJSON, engineToJSON } from "./common";
+import { Engine, engineFromJSON, engineToJSON, engineToNumber } from "./common";
import { DatabaseConfig } from "./database_service";
export const protobufPackage = "bytebase.v1";
@@ -104,9 +104,9 @@ export interface SheetPayload {
/** Type of the SheetPayload. */
export enum SheetPayload_Type {
- TYPE_UNSPECIFIED = 0,
- SCHEMA_DESIGN = 1,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ SCHEMA_DESIGN = "SCHEMA_DESIGN",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function sheetPayload_TypeFromJSON(object: any): SheetPayload_Type {
@@ -136,6 +136,18 @@ export function sheetPayload_TypeToJSON(object: SheetPayload_Type): string {
}
}
+export function sheetPayload_TypeToNumber(object: SheetPayload_Type): number {
+ switch (object) {
+ case SheetPayload_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case SheetPayload_Type.SCHEMA_DESIGN:
+ return 1;
+ case SheetPayload_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
function createBaseCreateSheetRequest(): CreateSheetRequest {
return { parent: "", sheet: undefined };
}
@@ -369,7 +381,7 @@ function createBaseSheet(): Sheet {
content: new Uint8Array(0),
contentSize: Long.ZERO,
payload: undefined,
- engine: 0,
+ engine: Engine.ENGINE_UNSPECIFIED,
};
}
@@ -402,8 +414,8 @@ export const Sheet = {
if (message.payload !== undefined) {
SheetPayload.encode(message.payload, writer.uint32(106).fork()).ldelim();
}
- if (message.engine !== 0) {
- writer.uint32(112).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(112).int32(engineToNumber(message.engine));
}
return writer;
},
@@ -483,7 +495,7 @@ export const Sheet = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -505,7 +517,7 @@ export const Sheet = {
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) : 0,
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
};
},
@@ -538,7 +550,7 @@ export const Sheet = {
if (message.payload !== undefined) {
obj.payload = SheetPayload.toJSON(message.payload);
}
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
return obj;
@@ -562,19 +574,19 @@ export const Sheet = {
message.payload = (object.payload !== undefined && object.payload !== null)
? SheetPayload.fromPartial(object.payload)
: undefined;
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
return message;
},
};
function createBaseSheetPayload(): SheetPayload {
- return { type: 0, databaseConfig: undefined, baselineDatabaseConfig: undefined };
+ return { type: SheetPayload_Type.TYPE_UNSPECIFIED, databaseConfig: undefined, baselineDatabaseConfig: undefined };
}
export const SheetPayload = {
encode(message: SheetPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.type !== 0) {
- writer.uint32(8).int32(message.type);
+ if (message.type !== SheetPayload_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(8).int32(sheetPayload_TypeToNumber(message.type));
}
if (message.databaseConfig !== undefined) {
DatabaseConfig.encode(message.databaseConfig, writer.uint32(18).fork()).ldelim();
@@ -597,7 +609,7 @@ export const SheetPayload = {
break;
}
- message.type = reader.int32() as any;
+ message.type = sheetPayload_TypeFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -624,7 +636,7 @@ export const SheetPayload = {
fromJSON(object: any): SheetPayload {
return {
- type: isSet(object.type) ? sheetPayload_TypeFromJSON(object.type) : 0,
+ type: isSet(object.type) ? sheetPayload_TypeFromJSON(object.type) : SheetPayload_Type.TYPE_UNSPECIFIED,
databaseConfig: isSet(object.databaseConfig) ? DatabaseConfig.fromJSON(object.databaseConfig) : undefined,
baselineDatabaseConfig: isSet(object.baselineDatabaseConfig)
? DatabaseConfig.fromJSON(object.baselineDatabaseConfig)
@@ -634,7 +646,7 @@ export const SheetPayload = {
toJSON(message: SheetPayload): unknown {
const obj: any = {};
- if (message.type !== 0) {
+ if (message.type !== SheetPayload_Type.TYPE_UNSPECIFIED) {
obj.type = sheetPayload_TypeToJSON(message.type);
}
if (message.databaseConfig !== undefined) {
@@ -651,7 +663,7 @@ export const SheetPayload = {
},
fromPartial(object: DeepPartial<SheetPayload>): SheetPayload {
const message = createBaseSheetPayload();
- message.type = object.type ?? 0;
+ message.type = object.type ?? SheetPayload_Type.TYPE_UNSPECIFIED;
message.databaseConfig = (object.databaseConfig !== undefined && object.databaseConfig !== null)
? DatabaseConfig.fromPartial(object.databaseConfig)
: undefined;
diff --git a/frontend/src/types/proto/v1/sql_service.ts b/frontend/src/types/proto/v1/sql_service.ts
index 22ac0d396f..abcd9070e9 100644
--- a/frontend/src/types/proto/v1/sql_service.ts
+++ b/frontend/src/types/proto/v1/sql_service.ts
@@ -2,9 +2,18 @@
import Long from "long";
import _m0 from "protobufjs/minimal";
import { Duration } from "../google/protobuf/duration";
-import { NullValue, nullValueFromJSON, nullValueToJSON, Value } from "../google/protobuf/struct";
+import { NullValue, nullValueFromJSON, nullValueToJSON, nullValueToNumber, Value } from "../google/protobuf/struct";
import { Timestamp } from "../google/protobuf/timestamp";
-import { Engine, engineFromJSON, engineToJSON, ExportFormat, exportFormatFromJSON, exportFormatToJSON } from "./common";
+import {
+ Engine,
+ engineFromJSON,
+ engineToJSON,
+ engineToNumber,
+ ExportFormat,
+ exportFormatFromJSON,
+ exportFormatToJSON,
+ exportFormatToNumber,
+} from "./common";
import { DatabaseMetadata } from "./database_service";
export const protobufPackage = "bytebase.v1";
@@ -149,11 +158,11 @@ export interface Advice {
export enum Advice_Status {
/** STATUS_UNSPECIFIED - Unspecified. */
- STATUS_UNSPECIFIED = 0,
- SUCCESS = 1,
- WARNING = 2,
- ERROR = 3,
- UNRECOGNIZED = -1,
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ SUCCESS = "SUCCESS",
+ WARNING = "WARNING",
+ ERROR = "ERROR",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function advice_StatusFromJSON(object: any): Advice_Status {
@@ -193,6 +202,22 @@ export function advice_StatusToJSON(object: Advice_Status): string {
}
}
+export function advice_StatusToNumber(object: Advice_Status): number {
+ switch (object) {
+ case Advice_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case Advice_Status.SUCCESS:
+ return 1;
+ case Advice_Status.WARNING:
+ return 2;
+ case Advice_Status.ERROR:
+ return 3;
+ case Advice_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface ExportRequest {
/**
* The name is the instance name to execute the query against.
@@ -265,11 +290,11 @@ export interface CheckRequest {
}
export enum CheckRequest_ChangeType {
- CHANGE_TYPE_UNSPECIFIED = 0,
- DDL = 1,
- DDL_GHOST = 2,
- DML = 3,
- UNRECOGNIZED = -1,
+ CHANGE_TYPE_UNSPECIFIED = "CHANGE_TYPE_UNSPECIFIED",
+ DDL = "DDL",
+ DDL_GHOST = "DDL_GHOST",
+ DML = "DML",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function checkRequest_ChangeTypeFromJSON(object: any): CheckRequest_ChangeType {
@@ -309,6 +334,22 @@ export function checkRequest_ChangeTypeToJSON(object: CheckRequest_ChangeType):
}
}
+export function checkRequest_ChangeTypeToNumber(object: CheckRequest_ChangeType): number {
+ switch (object) {
+ case CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED:
+ return 0;
+ case CheckRequest_ChangeType.DDL:
+ return 1;
+ case CheckRequest_ChangeType.DDL_GHOST:
+ return 2;
+ case CheckRequest_ChangeType.DML:
+ return 3;
+ case CheckRequest_ChangeType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface CheckResponse {
advices: Advice[];
}
@@ -391,10 +432,10 @@ export interface QueryHistory {
}
export enum QueryHistory_Type {
- TYPE_UNSPECIFIED = 0,
- QUERY = 1,
- EXPORT = 2,
- UNRECOGNIZED = -1,
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ QUERY = "QUERY",
+ EXPORT = "EXPORT",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function queryHistory_TypeFromJSON(object: any): QueryHistory_Type {
@@ -429,6 +470,20 @@ export function queryHistory_TypeToJSON(object: QueryHistory_Type): string {
}
}
+export function queryHistory_TypeToNumber(object: QueryHistory_Type): number {
+ switch (object) {
+ case QueryHistory_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case QueryHistory_Type.QUERY:
+ return 1;
+ case QueryHistory_Type.EXPORT:
+ return 2;
+ case QueryHistory_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
function createBaseExecuteRequest(): ExecuteRequest {
return { name: "", statement: "", limit: 0, timeout: undefined };
}
@@ -1297,7 +1352,7 @@ function createBaseRowValue(): RowValue {
export const RowValue = {
encode(message: RowValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.nullValue !== undefined) {
- writer.uint32(8).int32(message.nullValue);
+ writer.uint32(8).int32(nullValueToNumber(message.nullValue));
}
if (message.boolValue !== undefined) {
writer.uint32(16).bool(message.boolValue);
@@ -1344,7 +1399,7 @@ export const RowValue = {
break;
}
- message.nullValue = reader.int32() as any;
+ message.nullValue = nullValueFromJSON(reader.int32());
continue;
case 2:
if (tag !== 16) {
@@ -1504,13 +1559,13 @@ export const RowValue = {
};
function createBaseAdvice(): Advice {
- return { status: 0, code: 0, title: "", content: "", line: 0, column: 0, detail: "" };
+ return { status: Advice_Status.STATUS_UNSPECIFIED, code: 0, title: "", content: "", line: 0, column: 0, detail: "" };
}
export const Advice = {
encode(message: Advice, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.status !== 0) {
- writer.uint32(8).int32(message.status);
+ if (message.status !== Advice_Status.STATUS_UNSPECIFIED) {
+ writer.uint32(8).int32(advice_StatusToNumber(message.status));
}
if (message.code !== 0) {
writer.uint32(16).int32(message.code);
@@ -1545,7 +1600,7 @@ export const Advice = {
break;
}
- message.status = reader.int32() as any;
+ message.status = advice_StatusFromJSON(reader.int32());
continue;
case 2:
if (tag !== 16) {
@@ -1600,7 +1655,7 @@ export const Advice = {
fromJSON(object: any): Advice {
return {
- status: isSet(object.status) ? advice_StatusFromJSON(object.status) : 0,
+ 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) : "",
@@ -1612,7 +1667,7 @@ export const Advice = {
toJSON(message: Advice): unknown {
const obj: any = {};
- if (message.status !== 0) {
+ if (message.status !== Advice_Status.STATUS_UNSPECIFIED) {
obj.status = advice_StatusToJSON(message.status);
}
if (message.code !== 0) {
@@ -1641,7 +1696,7 @@ export const Advice = {
},
fromPartial(object: DeepPartial<Advice>): Advice {
const message = createBaseAdvice();
- message.status = object.status ?? 0;
+ message.status = object.status ?? Advice_Status.STATUS_UNSPECIFIED;
message.code = object.code ?? 0;
message.title = object.title ?? "";
message.content = object.content ?? "";
@@ -1653,7 +1708,15 @@ export const Advice = {
};
function createBaseExportRequest(): ExportRequest {
- return { name: "", connectionDatabase: "", statement: "", limit: 0, format: 0, admin: false, password: "" };
+ return {
+ name: "",
+ connectionDatabase: "",
+ statement: "",
+ limit: 0,
+ format: ExportFormat.FORMAT_UNSPECIFIED,
+ admin: false,
+ password: "",
+ };
}
export const ExportRequest = {
@@ -1670,8 +1733,8 @@ export const ExportRequest = {
if (message.limit !== 0) {
writer.uint32(32).int32(message.limit);
}
- if (message.format !== 0) {
- writer.uint32(40).int32(message.format);
+ if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
+ writer.uint32(40).int32(exportFormatToNumber(message.format));
}
if (message.admin === true) {
writer.uint32(48).bool(message.admin);
@@ -1722,7 +1785,7 @@ export const ExportRequest = {
break;
}
- message.format = reader.int32() as any;
+ message.format = exportFormatFromJSON(reader.int32());
continue;
case 6:
if (tag !== 48) {
@@ -1753,7 +1816,7 @@ export const ExportRequest = {
connectionDatabase: isSet(object.connectionDatabase) ? globalThis.String(object.connectionDatabase) : "",
statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
- format: isSet(object.format) ? exportFormatFromJSON(object.format) : 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) : "",
};
@@ -1773,7 +1836,7 @@ export const ExportRequest = {
if (message.limit !== 0) {
obj.limit = Math.round(message.limit);
}
- if (message.format !== 0) {
+ if (message.format !== ExportFormat.FORMAT_UNSPECIFIED) {
obj.format = exportFormatToJSON(message.format);
}
if (message.admin === true) {
@@ -1794,7 +1857,7 @@ export const ExportRequest = {
message.connectionDatabase = object.connectionDatabase ?? "";
message.statement = object.statement ?? "";
message.limit = object.limit ?? 0;
- message.format = object.format ?? 0;
+ message.format = object.format ?? ExportFormat.FORMAT_UNSPECIFIED;
message.admin = object.admin ?? false;
message.password = object.password ?? "";
return message;
@@ -1859,13 +1922,13 @@ export const ExportResponse = {
};
function createBaseDifferPreviewRequest(): DifferPreviewRequest {
- return { engine: 0, oldSchema: "", newMetadata: undefined };
+ return { engine: Engine.ENGINE_UNSPECIFIED, oldSchema: "", newMetadata: undefined };
}
export const DifferPreviewRequest = {
encode(message: DifferPreviewRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.engine !== 0) {
- writer.uint32(8).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(8).int32(engineToNumber(message.engine));
}
if (message.oldSchema !== "") {
writer.uint32(18).string(message.oldSchema);
@@ -1888,7 +1951,7 @@ export const DifferPreviewRequest = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -1915,7 +1978,7 @@ export const DifferPreviewRequest = {
fromJSON(object: any): DifferPreviewRequest {
return {
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
oldSchema: isSet(object.oldSchema) ? globalThis.String(object.oldSchema) : "",
newMetadata: isSet(object.newMetadata) ? DatabaseMetadata.fromJSON(object.newMetadata) : undefined,
};
@@ -1923,7 +1986,7 @@ export const DifferPreviewRequest = {
toJSON(message: DifferPreviewRequest): unknown {
const obj: any = {};
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
if (message.oldSchema !== "") {
@@ -1940,7 +2003,7 @@ export const DifferPreviewRequest = {
},
fromPartial(object: DeepPartial<DifferPreviewRequest>): DifferPreviewRequest {
const message = createBaseDifferPreviewRequest();
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
message.oldSchema = object.oldSchema ?? "";
message.newMetadata = (object.newMetadata !== undefined && object.newMetadata !== null)
? DatabaseMetadata.fromPartial(object.newMetadata)
@@ -2007,13 +2070,13 @@ export const DifferPreviewResponse = {
};
function createBasePrettyRequest(): PrettyRequest {
- return { engine: 0, currentSchema: "", expectedSchema: "" };
+ return { engine: Engine.ENGINE_UNSPECIFIED, currentSchema: "", expectedSchema: "" };
}
export const PrettyRequest = {
encode(message: PrettyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.engine !== 0) {
- writer.uint32(8).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(8).int32(engineToNumber(message.engine));
}
if (message.currentSchema !== "") {
writer.uint32(18).string(message.currentSchema);
@@ -2036,7 +2099,7 @@ export const PrettyRequest = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
case 2:
if (tag !== 18) {
@@ -2063,7 +2126,7 @@ export const PrettyRequest = {
fromJSON(object: any): PrettyRequest {
return {
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ 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) : "",
};
@@ -2071,7 +2134,7 @@ export const PrettyRequest = {
toJSON(message: PrettyRequest): unknown {
const obj: any = {};
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
if (message.currentSchema !== "") {
@@ -2088,7 +2151,7 @@ export const PrettyRequest = {
},
fromPartial(object: DeepPartial<PrettyRequest>): PrettyRequest {
const message = createBasePrettyRequest();
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
message.currentSchema = object.currentSchema ?? "";
message.expectedSchema = object.expectedSchema ?? "";
return message;
@@ -2170,7 +2233,12 @@ export const PrettyResponse = {
};
function createBaseCheckRequest(): CheckRequest {
- return { statement: "", database: "", metadata: undefined, changeType: 0 };
+ return {
+ statement: "",
+ database: "",
+ metadata: undefined,
+ changeType: CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED,
+ };
}
export const CheckRequest = {
@@ -2184,8 +2252,8 @@ export const CheckRequest = {
if (message.metadata !== undefined) {
DatabaseMetadata.encode(message.metadata, writer.uint32(26).fork()).ldelim();
}
- if (message.changeType !== 0) {
- writer.uint32(32).int32(message.changeType);
+ if (message.changeType !== CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED) {
+ writer.uint32(32).int32(checkRequest_ChangeTypeToNumber(message.changeType));
}
return writer;
},
@@ -2223,7 +2291,7 @@ export const CheckRequest = {
break;
}
- message.changeType = reader.int32() as any;
+ message.changeType = checkRequest_ChangeTypeFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -2239,7 +2307,9 @@ export const CheckRequest = {
statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
database: isSet(object.database) ? globalThis.String(object.database) : "",
metadata: isSet(object.metadata) ? DatabaseMetadata.fromJSON(object.metadata) : undefined,
- changeType: isSet(object.changeType) ? checkRequest_ChangeTypeFromJSON(object.changeType) : 0,
+ changeType: isSet(object.changeType)
+ ? checkRequest_ChangeTypeFromJSON(object.changeType)
+ : CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED,
};
},
@@ -2254,7 +2324,7 @@ export const CheckRequest = {
if (message.metadata !== undefined) {
obj.metadata = DatabaseMetadata.toJSON(message.metadata);
}
- if (message.changeType !== 0) {
+ if (message.changeType !== CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED) {
obj.changeType = checkRequest_ChangeTypeToJSON(message.changeType);
}
return obj;
@@ -2270,7 +2340,7 @@ export const CheckRequest = {
message.metadata = (object.metadata !== undefined && object.metadata !== null)
? DatabaseMetadata.fromPartial(object.metadata)
: undefined;
- message.changeType = object.changeType ?? 0;
+ message.changeType = object.changeType ?? CheckRequest_ChangeType.CHANGE_TYPE_UNSPECIFIED;
return message;
},
};
@@ -2453,7 +2523,7 @@ export const ParseMyBatisMapperResponse = {
};
function createBaseStringifyMetadataRequest(): StringifyMetadataRequest {
- return { metadata: undefined, engine: 0 };
+ return { metadata: undefined, engine: Engine.ENGINE_UNSPECIFIED };
}
export const StringifyMetadataRequest = {
@@ -2461,8 +2531,8 @@ export const StringifyMetadataRequest = {
if (message.metadata !== undefined) {
DatabaseMetadata.encode(message.metadata, writer.uint32(10).fork()).ldelim();
}
- if (message.engine !== 0) {
- writer.uint32(16).int32(message.engine);
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(16).int32(engineToNumber(message.engine));
}
return writer;
},
@@ -2486,7 +2556,7 @@ export const StringifyMetadataRequest = {
break;
}
- message.engine = reader.int32() as any;
+ message.engine = engineFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -2500,7 +2570,7 @@ export const StringifyMetadataRequest = {
fromJSON(object: any): StringifyMetadataRequest {
return {
metadata: isSet(object.metadata) ? DatabaseMetadata.fromJSON(object.metadata) : undefined,
- engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
};
},
@@ -2509,7 +2579,7 @@ export const StringifyMetadataRequest = {
if (message.metadata !== undefined) {
obj.metadata = DatabaseMetadata.toJSON(message.metadata);
}
- if (message.engine !== 0) {
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
obj.engine = engineToJSON(message.engine);
}
return obj;
@@ -2523,7 +2593,7 @@ export const StringifyMetadataRequest = {
message.metadata = (object.metadata !== undefined && object.metadata !== null)
? DatabaseMetadata.fromPartial(object.metadata)
: undefined;
- message.engine = object.engine ?? 0;
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
return message;
},
};
@@ -2759,7 +2829,7 @@ function createBaseQueryHistory(): QueryHistory {
statement: "",
error: undefined,
duration: undefined,
- type: 0,
+ type: QueryHistory_Type.TYPE_UNSPECIFIED,
};
}
@@ -2786,8 +2856,8 @@ export const QueryHistory = {
if (message.duration !== undefined) {
Duration.encode(message.duration, writer.uint32(58).fork()).ldelim();
}
- if (message.type !== 0) {
- writer.uint32(64).int32(message.type);
+ if (message.type !== QueryHistory_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(64).int32(queryHistory_TypeToNumber(message.type));
}
return writer;
},
@@ -2853,7 +2923,7 @@ export const QueryHistory = {
break;
}
- message.type = reader.int32() as any;
+ message.type = queryHistory_TypeFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -2873,7 +2943,7 @@ export const QueryHistory = {
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) : 0,
+ type: isSet(object.type) ? queryHistory_TypeFromJSON(object.type) : QueryHistory_Type.TYPE_UNSPECIFIED,
};
},
@@ -2900,7 +2970,7 @@ export const QueryHistory = {
if (message.duration !== undefined) {
obj.duration = Duration.toJSON(message.duration);
}
- if (message.type !== 0) {
+ if (message.type !== QueryHistory_Type.TYPE_UNSPECIFIED) {
obj.type = queryHistory_TypeToJSON(message.type);
}
return obj;
@@ -2920,7 +2990,7 @@ export const QueryHistory = {
message.duration = (object.duration !== undefined && object.duration !== null)
? Duration.fromPartial(object.duration)
: undefined;
- message.type = object.type ?? 0;
+ message.type = object.type ?? QueryHistory_Type.TYPE_UNSPECIFIED;
return message;
},
};
diff --git a/frontend/src/types/proto/v1/subscription_service.ts b/frontend/src/types/proto/v1/subscription_service.ts
index 90154c2a40..35c2e484a8 100644
--- a/frontend/src/types/proto/v1/subscription_service.ts
+++ b/frontend/src/types/proto/v1/subscription_service.ts
@@ -6,11 +6,11 @@ import { Timestamp } from "../google/protobuf/timestamp";
export const protobufPackage = "bytebase.v1";
export enum PlanType {
- PLAN_TYPE_UNSPECIFIED = 0,
- FREE = 1,
- TEAM = 2,
- ENTERPRISE = 3,
- UNRECOGNIZED = -1,
+ PLAN_TYPE_UNSPECIFIED = "PLAN_TYPE_UNSPECIFIED",
+ FREE = "FREE",
+ TEAM = "TEAM",
+ ENTERPRISE = "ENTERPRISE",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function planTypeFromJSON(object: any): PlanType {
@@ -50,6 +50,22 @@ export function planTypeToJSON(object: PlanType): string {
}
}
+export function planTypeToNumber(object: PlanType): number {
+ switch (object) {
+ case PlanType.PLAN_TYPE_UNSPECIFIED:
+ return 0;
+ case PlanType.FREE:
+ return 1;
+ case PlanType.TEAM:
+ return 2;
+ case PlanType.ENTERPRISE:
+ return 3;
+ case PlanType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
export interface GetSubscriptionRequest {
}
@@ -297,7 +313,7 @@ function createBaseSubscription(): Subscription {
instanceCount: 0,
expiresTime: undefined,
startedTime: undefined,
- plan: 0,
+ plan: PlanType.PLAN_TYPE_UNSPECIFIED,
trialing: false,
orgId: "",
orgName: "",
@@ -315,8 +331,8 @@ export const Subscription = {
if (message.startedTime !== undefined) {
Timestamp.encode(toTimestamp(message.startedTime), writer.uint32(34).fork()).ldelim();
}
- if (message.plan !== 0) {
- writer.uint32(40).int32(message.plan);
+ if (message.plan !== PlanType.PLAN_TYPE_UNSPECIFIED) {
+ writer.uint32(40).int32(planTypeToNumber(message.plan));
}
if (message.trialing === true) {
writer.uint32(48).bool(message.trialing);
@@ -363,7 +379,7 @@ export const Subscription = {
break;
}
- message.plan = reader.int32() as any;
+ message.plan = planTypeFromJSON(reader.int32());
continue;
case 6:
if (tag !== 48) {
@@ -400,7 +416,7 @@ export const Subscription = {
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) : 0,
+ 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) : "",
@@ -418,7 +434,7 @@ export const Subscription = {
if (message.startedTime !== undefined) {
obj.startedTime = message.startedTime.toISOString();
}
- if (message.plan !== 0) {
+ if (message.plan !== PlanType.PLAN_TYPE_UNSPECIFIED) {
obj.plan = planTypeToJSON(message.plan);
}
if (message.trialing === true) {
@@ -441,7 +457,7 @@ export const Subscription = {
message.instanceCount = object.instanceCount ?? 0;
message.expiresTime = object.expiresTime ?? undefined;
message.startedTime = object.startedTime ?? undefined;
- message.plan = object.plan ?? 0;
+ message.plan = object.plan ?? PlanType.PLAN_TYPE_UNSPECIFIED;
message.trialing = object.trialing ?? false;
message.orgId = object.orgId ?? "";
message.orgName = object.orgName ?? "";
diff --git a/frontend/src/types/proto/v1/vcs_provider_service.ts b/frontend/src/types/proto/v1/vcs_provider_service.ts
index 6ddf1acb99..d3bd4d62a7 100644
--- a/frontend/src/types/proto/v1/vcs_provider_service.ts
+++ b/frontend/src/types/proto/v1/vcs_provider_service.ts
@@ -3,7 +3,7 @@ import Long from "long";
import _m0 from "protobufjs/minimal";
import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
-import { VCSType, vCSTypeFromJSON, vCSTypeToJSON } from "./common";
+import { VCSType, vCSTypeFromJSON, vCSTypeToJSON, vCSTypeToNumber } from "./common";
import { VCSConnector } from "./vcs_connector_service";
export const protobufPackage = "bytebase.v1";
@@ -894,7 +894,7 @@ export const ListVCSConnectorsInProviderResponse = {
};
function createBaseVCSProvider(): VCSProvider {
- return { name: "", title: "", type: 0, url: "", accessToken: "" };
+ return { name: "", title: "", type: VCSType.VCS_TYPE_UNSPECIFIED, url: "", accessToken: "" };
}
export const VCSProvider = {
@@ -905,8 +905,8 @@ export const VCSProvider = {
if (message.title !== "") {
writer.uint32(18).string(message.title);
}
- if (message.type !== 0) {
- writer.uint32(24).int32(message.type);
+ if (message.type !== VCSType.VCS_TYPE_UNSPECIFIED) {
+ writer.uint32(24).int32(vCSTypeToNumber(message.type));
}
if (message.url !== "") {
writer.uint32(34).string(message.url);
@@ -943,7 +943,7 @@ export const VCSProvider = {
break;
}
- message.type = reader.int32() as any;
+ message.type = vCSTypeFromJSON(reader.int32());
continue;
case 4:
if (tag !== 34) {
@@ -972,7 +972,7 @@ export const VCSProvider = {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
title: isSet(object.title) ? globalThis.String(object.title) : "",
- type: isSet(object.type) ? vCSTypeFromJSON(object.type) : 0,
+ type: isSet(object.type) ? vCSTypeFromJSON(object.type) : VCSType.VCS_TYPE_UNSPECIFIED,
url: isSet(object.url) ? globalThis.String(object.url) : "",
accessToken: isSet(object.accessToken) ? globalThis.String(object.accessToken) : "",
};
@@ -986,7 +986,7 @@ export const VCSProvider = {
if (message.title !== "") {
obj.title = message.title;
}
- if (message.type !== 0) {
+ if (message.type !== VCSType.VCS_TYPE_UNSPECIFIED) {
obj.type = vCSTypeToJSON(message.type);
}
if (message.url !== "") {
@@ -1005,7 +1005,7 @@ export const VCSProvider = {
const message = createBaseVCSProvider();
message.name = object.name ?? "";
message.title = object.title ?? "";
- message.type = object.type ?? 0;
+ message.type = object.type ?? VCSType.VCS_TYPE_UNSPECIFIED;
message.url = object.url ?? "";
message.accessToken = object.accessToken ?? "";
return message;
diff --git a/frontend/src/types/proto/v1/worksheet_service.ts b/frontend/src/types/proto/v1/worksheet_service.ts
index 2a5fc2f063..a7ad57d7ec 100644
--- a/frontend/src/types/proto/v1/worksheet_service.ts
+++ b/frontend/src/types/proto/v1/worksheet_service.ts
@@ -163,14 +163,14 @@ export interface Worksheet {
}
export enum Worksheet_Visibility {
- VISIBILITY_UNSPECIFIED = 0,
+ VISIBILITY_UNSPECIFIED = "VISIBILITY_UNSPECIFIED",
/** VISIBILITY_PROJECT_READ - Read access in project scope, worksheet OWNER/DBA and project OWNER can read/write, other project members can read. */
- VISIBILITY_PROJECT_READ = 1,
+ VISIBILITY_PROJECT_READ = "VISIBILITY_PROJECT_READ",
/** VISIBILITY_PROJECT_WRITE - Write access in project scope, worksheet OWNER/DBA and all members in the project can write the worksheet. */
- VISIBILITY_PROJECT_WRITE = 2,
+ VISIBILITY_PROJECT_WRITE = "VISIBILITY_PROJECT_WRITE",
/** VISIBILITY_PRIVATE - Private, only worksheet OWNER can read/write. */
- VISIBILITY_PRIVATE = 3,
- UNRECOGNIZED = -1,
+ VISIBILITY_PRIVATE = "VISIBILITY_PRIVATE",
+ UNRECOGNIZED = "UNRECOGNIZED",
}
export function worksheet_VisibilityFromJSON(object: any): Worksheet_Visibility {
@@ -210,6 +210,22 @@ export function worksheet_VisibilityToJSON(object: Worksheet_Visibility): string
}
}
+export function worksheet_VisibilityToNumber(object: Worksheet_Visibility): number {
+ switch (object) {
+ case Worksheet_Visibility.VISIBILITY_UNSPECIFIED:
+ return 0;
+ case Worksheet_Visibility.VISIBILITY_PROJECT_READ:
+ return 1;
+ case Worksheet_Visibility.VISIBILITY_PROJECT_WRITE:
+ return 2;
+ case Worksheet_Visibility.VISIBILITY_PRIVATE:
+ return 3;
+ case Worksheet_Visibility.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
function createBaseCreateWorksheetRequest(): CreateWorksheetRequest {
return { worksheet: undefined };
}
@@ -785,7 +801,7 @@ function createBaseWorksheet(): Worksheet {
updateTime: undefined,
content: new Uint8Array(0),
contentSize: Long.ZERO,
- visibility: 0,
+ visibility: Worksheet_Visibility.VISIBILITY_UNSPECIFIED,
starred: false,
};
}
@@ -819,8 +835,8 @@ export const Worksheet = {
if (!message.contentSize.isZero()) {
writer.uint32(72).int64(message.contentSize);
}
- if (message.visibility !== 0) {
- writer.uint32(80).int32(message.visibility);
+ if (message.visibility !== Worksheet_Visibility.VISIBILITY_UNSPECIFIED) {
+ writer.uint32(80).int32(worksheet_VisibilityToNumber(message.visibility));
}
if (message.starred === true) {
writer.uint32(88).bool(message.starred);
@@ -903,7 +919,7 @@ export const Worksheet = {
break;
}
- message.visibility = reader.int32() as any;
+ message.visibility = worksheet_VisibilityFromJSON(reader.int32());
continue;
case 11:
if (tag !== 88) {
@@ -932,7 +948,9 @@ export const Worksheet = {
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) : 0,
+ visibility: isSet(object.visibility)
+ ? worksheet_VisibilityFromJSON(object.visibility)
+ : Worksheet_Visibility.VISIBILITY_UNSPECIFIED,
starred: isSet(object.starred) ? globalThis.Boolean(object.starred) : false,
};
},
@@ -966,7 +984,7 @@ export const Worksheet = {
if (!message.contentSize.isZero()) {
obj.contentSize = (message.contentSize || Long.ZERO).toString();
}
- if (message.visibility !== 0) {
+ if (message.visibility !== Worksheet_Visibility.VISIBILITY_UNSPECIFIED) {
obj.visibility = worksheet_VisibilityToJSON(message.visibility);
}
if (message.starred === true) {
@@ -991,7 +1009,7 @@ export const Worksheet = {
message.contentSize = (object.contentSize !== undefined && object.contentSize !== null)
? Long.fromValue(object.contentSize)
: Long.ZERO;
- message.visibility = object.visibility ?? 0;
+ message.visibility = object.visibility ?? Worksheet_Visibility.VISIBILITY_UNSPECIFIED;
message.starred = object.starred ?? false;
return message;
},
diff --git a/frontend/src/utils/v1/instance.ts b/frontend/src/utils/v1/instance.ts
index 1ca71ac656..0af5ee0409 100644
--- a/frontend/src/utils/v1/instance.ts
+++ b/frontend/src/utils/v1/instance.ts
@@ -239,7 +239,7 @@ export const instanceV1SupportsTablePartition = (
};
export const engineOfInstanceV1 = (instanceOrEngine: Instance | Engine) => {
- if (typeof instanceOrEngine === "number") {
+ if (typeof instanceOrEngine === "string") {
return instanceOrEngine;
}
return instanceOrEngine.engine;
diff --git a/frontend/src/utils/workspaceApprovalSetting.ts b/frontend/src/utils/workspaceApprovalSetting.ts
index fcf4f8e169..cd2c411ae6 100644
--- a/frontend/src/utils/workspaceApprovalSetting.ts
+++ b/frontend/src/utils/workspaceApprovalSetting.ts
@@ -26,7 +26,10 @@ import {
ApprovalNode_Type,
ApprovalStep_Type,
} from "@/types/proto/v1/issue_service";
-import { Risk_Source } from "@/types/proto/v1/risk_service";
+import {
+ Risk_Source,
+ risk_SourceFromJSON,
+} from "@/types/proto/v1/risk_service";
import {
WorkspaceApprovalSetting,
WorkspaceApprovalSetting_Rule as ApprovalRule,
@@ -230,8 +233,7 @@ const resolveSourceExpr = (expr: SimpleExpr): Risk_Source => {
if (!args || args.length !== 2) return Risk_Source.UNRECOGNIZED;
const factor = args[0];
if (factor !== "source") return Risk_Source.UNRECOGNIZED;
- const source = args[1];
- if (!isNumber(source)) return Risk_Source.UNRECOGNIZED;
+ const source = risk_SourceFromJSON(args[1]);
if (!SupportedSourceList.includes(source)) return Risk_Source.UNRECOGNIZED;
return source;
};
diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml
index 5518d3f47c..33894098ce 100644
--- a/proto/buf.gen.yaml
+++ b/proto/buf.gen.yaml
@@ -20,6 +20,7 @@ plugins:
- useExactTypes=false
- esModuleInterop=true
- forceLong=long
+ - stringEnums=true
- plugin: buf.build/community/pseudomuto-doc:v1.5.1
out: gen/grpc-doc
opt: